Ride-The-Lightning-RTL/angular/vendor.js
ShahanaFarooqui e00834521a API resolution fix
API resolution fix
2018-09-16 16:43:35 -04:00

152538 lines
6.5 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["vendor"],{
/***/ "./node_modules/@agm/core/core.module.js":
/*!***********************************************!*\
!*** ./node_modules/@agm/core/core.module.js ***!
\***********************************************/
/*! exports provided: coreDirectives, AgmCoreModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coreDirectives", function() { return coreDirectives; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgmCoreModule", function() { return AgmCoreModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _directives_map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./directives/map */ "./node_modules/@agm/core/directives/map.js");
/* harmony import */ var _directives_circle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./directives/circle */ "./node_modules/@agm/core/directives/circle.js");
/* harmony import */ var _directives_info_window__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./directives/info-window */ "./node_modules/@agm/core/directives/info-window.js");
/* harmony import */ var _directives_marker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./directives/marker */ "./node_modules/@agm/core/directives/marker.js");
/* harmony import */ var _directives_polygon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./directives/polygon */ "./node_modules/@agm/core/directives/polygon.js");
/* harmony import */ var _directives_polyline__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./directives/polyline */ "./node_modules/@agm/core/directives/polyline.js");
/* harmony import */ var _directives_polyline_point__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./directives/polyline-point */ "./node_modules/@agm/core/directives/polyline-point.js");
/* harmony import */ var _directives_kml_layer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./directives/kml-layer */ "./node_modules/@agm/core/directives/kml-layer.js");
/* harmony import */ var _directives_data_layer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./directives/data-layer */ "./node_modules/@agm/core/directives/data-layer.js");
/* harmony import */ var _services_maps_api_loader_lazy_maps_api_loader__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./services/maps-api-loader/lazy-maps-api-loader */ "./node_modules/@agm/core/services/maps-api-loader/lazy-maps-api-loader.js");
/* harmony import */ var _services_maps_api_loader_maps_api_loader__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./services/maps-api-loader/maps-api-loader */ "./node_modules/@agm/core/services/maps-api-loader/maps-api-loader.js");
/* harmony import */ var _utils_browser_globals__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/browser-globals */ "./node_modules/@agm/core/utils/browser-globals.js");
/**
* @internal
*/
function coreDirectives() {
return [
_directives_map__WEBPACK_IMPORTED_MODULE_1__["AgmMap"], _directives_marker__WEBPACK_IMPORTED_MODULE_4__["AgmMarker"], _directives_info_window__WEBPACK_IMPORTED_MODULE_3__["AgmInfoWindow"], _directives_circle__WEBPACK_IMPORTED_MODULE_2__["AgmCircle"],
_directives_polygon__WEBPACK_IMPORTED_MODULE_5__["AgmPolygon"], _directives_polyline__WEBPACK_IMPORTED_MODULE_6__["AgmPolyline"], _directives_polyline_point__WEBPACK_IMPORTED_MODULE_7__["AgmPolylinePoint"], _directives_kml_layer__WEBPACK_IMPORTED_MODULE_8__["AgmKmlLayer"],
_directives_data_layer__WEBPACK_IMPORTED_MODULE_9__["AgmDataLayer"]
];
}
/**
* The angular-google-maps core module. Contains all Directives/Services/Pipes
* of the core module. Please use `AgmCoreModule.forRoot()` in your app module.
*/
var AgmCoreModule = (function () {
function AgmCoreModule() {
}
/**
* Please use this method when you register the module at the root level.
*/
AgmCoreModule.forRoot = function (lazyMapsAPILoaderConfig) {
return {
ngModule: AgmCoreModule,
providers: _utils_browser_globals__WEBPACK_IMPORTED_MODULE_12__["BROWSER_GLOBALS_PROVIDERS"].concat([
{ provide: _services_maps_api_loader_maps_api_loader__WEBPACK_IMPORTED_MODULE_11__["MapsAPILoader"], useClass: _services_maps_api_loader_lazy_maps_api_loader__WEBPACK_IMPORTED_MODULE_10__["LazyMapsAPILoader"] },
{ provide: _services_maps_api_loader_lazy_maps_api_loader__WEBPACK_IMPORTED_MODULE_10__["LAZY_MAPS_API_CONFIG"], useValue: lazyMapsAPILoaderConfig }
]),
};
};
return AgmCoreModule;
}());
AgmCoreModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{ declarations: coreDirectives(), exports: coreDirectives() },] },
];
/** @nocollapse */
AgmCoreModule.ctorParameters = function () { return []; };
//# sourceMappingURL=core.module.js.map
/***/ }),
/***/ "./node_modules/@agm/core/directives.js":
/*!**********************************************!*\
!*** ./node_modules/@agm/core/directives.js ***!
\**********************************************/
/*! exports provided: AgmMap, AgmCircle, AgmInfoWindow, AgmKmlLayer, AgmDataLayer, AgmMarker, AgmPolygon, AgmPolyline, AgmPolylinePoint */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _directives_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./directives/map */ "./node_modules/@agm/core/directives/map.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmMap", function() { return _directives_map__WEBPACK_IMPORTED_MODULE_0__["AgmMap"]; });
/* harmony import */ var _directives_circle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./directives/circle */ "./node_modules/@agm/core/directives/circle.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmCircle", function() { return _directives_circle__WEBPACK_IMPORTED_MODULE_1__["AgmCircle"]; });
/* harmony import */ var _directives_info_window__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./directives/info-window */ "./node_modules/@agm/core/directives/info-window.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmInfoWindow", function() { return _directives_info_window__WEBPACK_IMPORTED_MODULE_2__["AgmInfoWindow"]; });
/* harmony import */ var _directives_kml_layer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./directives/kml-layer */ "./node_modules/@agm/core/directives/kml-layer.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmKmlLayer", function() { return _directives_kml_layer__WEBPACK_IMPORTED_MODULE_3__["AgmKmlLayer"]; });
/* harmony import */ var _directives_data_layer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./directives/data-layer */ "./node_modules/@agm/core/directives/data-layer.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmDataLayer", function() { return _directives_data_layer__WEBPACK_IMPORTED_MODULE_4__["AgmDataLayer"]; });
/* harmony import */ var _directives_marker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./directives/marker */ "./node_modules/@agm/core/directives/marker.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmMarker", function() { return _directives_marker__WEBPACK_IMPORTED_MODULE_5__["AgmMarker"]; });
/* harmony import */ var _directives_polygon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./directives/polygon */ "./node_modules/@agm/core/directives/polygon.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmPolygon", function() { return _directives_polygon__WEBPACK_IMPORTED_MODULE_6__["AgmPolygon"]; });
/* harmony import */ var _directives_polyline__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./directives/polyline */ "./node_modules/@agm/core/directives/polyline.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmPolyline", function() { return _directives_polyline__WEBPACK_IMPORTED_MODULE_7__["AgmPolyline"]; });
/* harmony import */ var _directives_polyline_point__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./directives/polyline-point */ "./node_modules/@agm/core/directives/polyline-point.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmPolylinePoint", function() { return _directives_polyline_point__WEBPACK_IMPORTED_MODULE_8__["AgmPolylinePoint"]; });
//# sourceMappingURL=directives.js.map
/***/ }),
/***/ "./node_modules/@agm/core/directives/circle.js":
/*!*****************************************************!*\
!*** ./node_modules/@agm/core/directives/circle.js ***!
\*****************************************************/
/*! exports provided: AgmCircle */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgmCircle", function() { return AgmCircle; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _services_managers_circle_manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services/managers/circle-manager */ "./node_modules/@agm/core/services/managers/circle-manager.js");
var AgmCircle = (function () {
function AgmCircle(_manager) {
this._manager = _manager;
/**
* Indicates whether this Circle handles mouse events. Defaults to true.
*/
this.clickable = true;
/**
* If set to true, the user can drag this circle over the map. Defaults to false.
*/
// tslint:disable-next-line:no-input-rename
this.draggable = false;
/**
* If set to true, the user can edit this circle by dragging the control points shown at
* the center and around the circumference of the circle. Defaults to false.
*/
this.editable = false;
/**
* The radius in meters on the Earth's surface.
*/
this.radius = 0;
/**
* The stroke position. Defaults to CENTER.
* This property is not supported on Internet Explorer 8 and earlier.
*/
this.strokePosition = 'CENTER';
/**
* The stroke width in pixels.
*/
this.strokeWeight = 0;
/**
* Whether this circle is visible on the map. Defaults to true.
*/
this.visible = true;
/**
* This event is fired when the circle's center is changed.
*/
this.centerChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event emitter gets emitted when the user clicks on the circle.
*/
this.circleClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event emitter gets emitted when the user clicks on the circle.
*/
this.circleDblClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is repeatedly fired while the user drags the circle.
*/
this.drag = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the user stops dragging the circle.
*/
this.dragEnd = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the user starts dragging the circle.
*/
this.dragStart = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the DOM mousedown event is fired on the circle.
*/
this.mouseDown = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the DOM mousemove event is fired on the circle.
*/
this.mouseMove = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired on circle mouseout.
*/
this.mouseOut = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired on circle mouseover.
*/
this.mouseOver = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the DOM mouseup event is fired on the circle.
*/
this.mouseUp = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the circle's radius is changed.
*/
this.radiusChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the circle is right-clicked on.
*/
this.rightClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this._circleAddedToManager = false;
this._eventSubscriptions = [];
}
/** @internal */
AgmCircle.prototype.ngOnInit = function () {
this._manager.addCircle(this);
this._circleAddedToManager = true;
this._registerEventListeners();
};
/** @internal */
AgmCircle.prototype.ngOnChanges = function (changes) {
if (!this._circleAddedToManager) {
return;
}
if (changes['latitude'] || changes['longitude']) {
this._manager.setCenter(this);
}
if (changes['editable']) {
this._manager.setEditable(this);
}
if (changes['draggable']) {
this._manager.setDraggable(this);
}
if (changes['visible']) {
this._manager.setVisible(this);
}
if (changes['radius']) {
this._manager.setRadius(this);
}
this._updateCircleOptionsChanges(changes);
};
AgmCircle.prototype._updateCircleOptionsChanges = function (changes) {
var options = {};
var optionKeys = Object.keys(changes).filter(function (k) { return AgmCircle._mapOptions.indexOf(k) !== -1; });
optionKeys.forEach(function (k) { options[k] = changes[k].currentValue; });
if (optionKeys.length > 0) {
this._manager.setOptions(this, options);
}
};
AgmCircle.prototype._registerEventListeners = function () {
var _this = this;
var events = new Map();
events.set('center_changed', this.centerChange);
events.set('click', this.circleClick);
events.set('dblclick', this.circleDblClick);
events.set('drag', this.drag);
events.set('dragend', this.dragEnd);
events.set('dragStart', this.dragStart);
events.set('mousedown', this.mouseDown);
events.set('mousemove', this.mouseMove);
events.set('mouseout', this.mouseOut);
events.set('mouseover', this.mouseOver);
events.set('mouseup', this.mouseUp);
events.set('radius_changed', this.radiusChange);
events.set('rightclick', this.rightClick);
events.forEach(function (eventEmitter, eventName) {
_this._eventSubscriptions.push(_this._manager.createEventObservable(eventName, _this).subscribe(function (value) {
switch (eventName) {
case 'radius_changed':
_this._manager.getRadius(_this).then(function (radius) { return eventEmitter.emit(radius); });
break;
case 'center_changed':
_this._manager.getCenter(_this).then(function (center) {
return eventEmitter.emit({ lat: center.lat(), lng: center.lng() });
});
break;
default:
eventEmitter.emit({ coords: { lat: value.latLng.lat(), lng: value.latLng.lng() } });
}
}));
});
};
/** @internal */
AgmCircle.prototype.ngOnDestroy = function () {
this._eventSubscriptions.forEach(function (s) { s.unsubscribe(); });
this._eventSubscriptions = null;
this._manager.removeCircle(this);
};
/**
* Gets the LatLngBounds of this Circle.
*/
AgmCircle.prototype.getBounds = function () { return this._manager.getBounds(this); };
AgmCircle.prototype.getCenter = function () { return this._manager.getCenter(this); };
return AgmCircle;
}());
AgmCircle._mapOptions = [
'fillColor', 'fillOpacity', 'strokeColor', 'strokeOpacity', 'strokePosition', 'strokeWeight',
'visible', 'zIndex', 'clickable'
];
AgmCircle.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'agm-circle'
},] },
];
/** @nocollapse */
AgmCircle.ctorParameters = function () { return [
{ type: _services_managers_circle_manager__WEBPACK_IMPORTED_MODULE_1__["CircleManager"], },
]; };
AgmCircle.propDecorators = {
'latitude': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'longitude': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'clickable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'draggable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['circleDraggable',] },],
'editable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'fillColor': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'fillOpacity': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'radius': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'strokeColor': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'strokeOpacity': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'strokePosition': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'strokeWeight': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'visible': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'zIndex': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'centerChange': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'circleClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'circleDblClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'drag': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'dragEnd': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'dragStart': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'mouseDown': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'mouseMove': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'mouseOut': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'mouseOver': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'mouseUp': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'radiusChange': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'rightClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
//# sourceMappingURL=circle.js.map
/***/ }),
/***/ "./node_modules/@agm/core/directives/data-layer.js":
/*!*********************************************************!*\
!*** ./node_modules/@agm/core/directives/data-layer.js ***!
\*********************************************************/
/*! exports provided: AgmDataLayer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgmDataLayer", function() { return AgmDataLayer; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _services_managers_data_layer_manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../services/managers/data-layer-manager */ "./node_modules/@agm/core/services/managers/data-layer-manager.js");
var layerId = 0;
/**
* AgmDataLayer enables the user to add data layers to the map.
*
* ### Example
* ```typescript
* import { Component } from 'angular2/core';
* import { AgmMap, AgmDataLayer } from
* 'angular-google-maps/core';
*
* @Component({
* selector: 'my-map-cmp',
* directives: [AgmMap, AgmDataLayer],
* styles: [`
* .agm-container {
* height: 300px;
* }
* `],
* template: `
* <agm-map [latitude]="lat" [longitude]="lng" [zoom]="zoom">
* <agm-data-layer [geoJson]="geoJsonObject" (layerClick)="clicked($event)" [style]="styleFunc">
* </agm-data-layer>
* </agm-map>
* `
* })
* export class MyMapCmp {
* lat: number = -25.274449;
* lng: number = 133.775060;
* zoom: number = 5;
*
* clicked(clickEvent) {
* console.log(clickEvent);
* }
*
* styleFunc(feature) {
* return ({
* clickable: false,
* fillColor: feature.getProperty('color'),
* strokeWeight: 1
* });
* }
*
* geoJsonObject: Object = {
* "type": "FeatureCollection",
* "features": [
* {
* "type": "Feature",
* "properties": {
* "letter": "G",
* "color": "blue",
* "rank": "7",
* "ascii": "71"
* },
* "geometry": {
* "type": "Polygon",
* "coordinates": [
* [
* [123.61, -22.14], [122.38, -21.73], [121.06, -21.69], [119.66, -22.22], [119.00, -23.40],
* [118.65, -24.76], [118.43, -26.07], [118.78, -27.56], [119.22, -28.57], [120.23, -29.49],
* [121.77, -29.87], [123.57, -29.64], [124.45, -29.03], [124.71, -27.95], [124.80, -26.70],
* [124.80, -25.60], [123.61, -25.64], [122.56, -25.64], [121.72, -25.72], [121.81, -26.62],
* [121.86, -26.98], [122.60, -26.90], [123.57, -27.05], [123.57, -27.68], [123.35, -28.18],
* [122.51, -28.38], [121.77, -28.26], [121.02, -27.91], [120.49, -27.21], [120.14, -26.50],
* [120.10, -25.64], [120.27, -24.52], [120.67, -23.68], [121.72, -23.32], [122.43, -23.48],
* [123.04, -24.04], [124.54, -24.28], [124.58, -23.20], [123.61, -22.14]
* ]
* ]
* }
* },
* {
* "type": "Feature",
* "properties": {
* "letter": "o",
* "color": "red",
* "rank": "15",
* "ascii": "111"
* },
* "geometry": {
* "type": "Polygon",
* "coordinates": [
* [
* [128.84, -25.76], [128.18, -25.60], [127.96, -25.52], [127.88, -25.52], [127.70, -25.60],
* [127.26, -25.79], [126.60, -26.11], [126.16, -26.78], [126.12, -27.68], [126.21, -28.42],
* [126.69, -29.49], [127.74, -29.80], [128.80, -29.72], [129.41, -29.03], [129.72, -27.95],
* [129.68, -27.21], [129.33, -26.23], [128.84, -25.76]
* ],
* [
* [128.45, -27.44], [128.32, -26.94], [127.70, -26.82], [127.35, -27.05], [127.17, -27.80],
* [127.57, -28.22], [128.10, -28.42], [128.49, -27.80], [128.45, -27.44]
* ]
* ]
* }
* },
* {
* "type": "Feature",
* "properties": {
* "letter": "o",
* "color": "yellow",
* "rank": "15",
* "ascii": "111"
* },
* "geometry": {
* "type": "Polygon",
* "coordinates": [
* [
* [131.87, -25.76], [131.35, -26.07], [130.95, -26.78], [130.82, -27.64], [130.86, -28.53],
* [131.26, -29.22], [131.92, -29.76], [132.45, -29.87], [133.06, -29.76], [133.72, -29.34],
* [134.07, -28.80], [134.20, -27.91], [134.07, -27.21], [133.81, -26.31], [133.37, -25.83],
* [132.71, -25.64], [131.87, -25.76]
* ],
* [
* [133.15, -27.17], [132.71, -26.86], [132.09, -26.90], [131.74, -27.56], [131.79, -28.26],
* [132.36, -28.45], [132.93, -28.34], [133.15, -27.76], [133.15, -27.17]
* ]
* ]
* }
* },
* {
* "type": "Feature",
* "properties": {
* "letter": "g",
* "color": "blue",
* "rank": "7",
* "ascii": "103"
* },
* "geometry": {
* "type": "Polygon",
* "coordinates": [
* [
* [138.12, -25.04], [136.84, -25.16], [135.96, -25.36], [135.26, -25.99], [135, -26.90],
* [135.04, -27.91], [135.26, -28.88], [136.05, -29.45], [137.02, -29.49], [137.81, -29.49],
* [137.94, -29.99], [137.90, -31.20], [137.85, -32.24], [136.88, -32.69], [136.45, -32.36],
* [136.27, -31.80], [134.95, -31.84], [135.17, -32.99], [135.52, -33.43], [136.14, -33.76],
* [137.06, -33.83], [138.12, -33.65], [138.86, -33.21], [139.30, -32.28], [139.30, -31.24],
* [139.30, -30.14], [139.21, -28.96], [139.17, -28.22], [139.08, -27.41], [139.08, -26.47],
* [138.99, -25.40], [138.73, -25.00], [138.12, -25.04]
* ],
* [
* [137.50, -26.54], [136.97, -26.47], [136.49, -26.58], [136.31, -27.13], [136.31, -27.72],
* [136.58, -27.99], [137.50, -28.03], [137.68, -27.68], [137.59, -26.78], [137.50, -26.54]
* ]
* ]
* }
* },
* {
* "type": "Feature",
* "properties": {
* "letter": "l",
* "color": "green",
* "rank": "12",
* "ascii": "108"
* },
* "geometry": {
* "type": "Polygon",
* "coordinates": [
* [
* [140.14, -21.04], [140.31, -29.42], [141.67, -29.49], [141.59, -20.92], [140.14, -21.04]
* ]
* ]
* }
* },
* {
* "type": "Feature",
* "properties": {
* "letter": "e",
* "color": "red",
* "rank": "5",
* "ascii": "101"
* },
* "geometry": {
* "type": "Polygon",
* "coordinates": [
* [
* [144.14, -27.41], [145.67, -27.52], [146.86, -27.09], [146.82, -25.64], [146.25, -25.04],
* [145.45, -24.68], [144.66, -24.60], [144.09, -24.76], [143.43, -25.08], [142.99, -25.40],
* [142.64, -26.03], [142.64, -27.05], [142.64, -28.26], [143.30, -29.11], [144.18, -29.57],
* [145.41, -29.64], [146.46, -29.19], [146.64, -28.72], [146.82, -28.14], [144.84, -28.42],
* [144.31, -28.26], [144.14, -27.41]
* ],
* [
* [144.18, -26.39], [144.53, -26.58], [145.19, -26.62], [145.72, -26.35], [145.81, -25.91],
* [145.41, -25.68], [144.97, -25.68], [144.49, -25.64], [144, -25.99], [144.18, -26.39]
* ]
* ]
* }
* }
* ]
* };
* }
* ```
*/
var AgmDataLayer = (function () {
function AgmDataLayer(_manager) {
this._manager = _manager;
this._addedToManager = false;
this._id = (layerId++).toString();
this._subscriptions = [];
/**
* This event is fired when a feature in the layer is clicked.
*/
this.layerClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* The geoJson to be displayed
*/
this.geoJson = null;
}
AgmDataLayer.prototype.ngOnInit = function () {
if (this._addedToManager) {
return;
}
this._manager.addDataLayer(this);
this._addedToManager = true;
this._addEventListeners();
};
AgmDataLayer.prototype._addEventListeners = function () {
var _this = this;
var listeners = [
{ name: 'click', handler: function (ev) { return _this.layerClick.emit(ev); } },
];
listeners.forEach(function (obj) {
var os = _this._manager.createEventObservable(obj.name, _this).subscribe(obj.handler);
_this._subscriptions.push(os);
});
};
/** @internal */
AgmDataLayer.prototype.id = function () { return this._id; };
/** @internal */
AgmDataLayer.prototype.toString = function () { return "AgmDataLayer-" + this._id.toString(); };
/** @internal */
AgmDataLayer.prototype.ngOnDestroy = function () {
this._manager.deleteDataLayer(this);
// unsubscribe all registered observable subscriptions
this._subscriptions.forEach(function (s) { return s.unsubscribe(); });
};
/** @internal */
AgmDataLayer.prototype.ngOnChanges = function (changes) {
var _this = this;
if (!this._addedToManager) {
return;
}
var geoJsonChange = changes['geoJson'];
if (geoJsonChange) {
this._manager.updateGeoJson(this, geoJsonChange.currentValue);
}
var dataOptions = {};
AgmDataLayer._dataOptionsAttributes.forEach(function (k) { return dataOptions[k] = changes.hasOwnProperty(k) ? changes[k].currentValue : _this[k]; });
this._manager.setDataOptions(this, dataOptions);
};
return AgmDataLayer;
}());
AgmDataLayer._dataOptionsAttributes = ['style'];
AgmDataLayer.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'agm-data-layer'
},] },
];
/** @nocollapse */
AgmDataLayer.ctorParameters = function () { return [
{ type: _services_managers_data_layer_manager__WEBPACK_IMPORTED_MODULE_1__["DataLayerManager"], },
]; };
AgmDataLayer.propDecorators = {
'layerClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'geoJson': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'style': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
//# sourceMappingURL=data-layer.js.map
/***/ }),
/***/ "./node_modules/@agm/core/directives/info-window.js":
/*!**********************************************************!*\
!*** ./node_modules/@agm/core/directives/info-window.js ***!
\**********************************************************/
/*! exports provided: AgmInfoWindow */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgmInfoWindow", function() { return AgmInfoWindow; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _services_managers_info_window_manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services/managers/info-window-manager */ "./node_modules/@agm/core/services/managers/info-window-manager.js");
var infoWindowId = 0;
/**
* AgmInfoWindow renders a info window inside a {@link AgmMarker} or standalone.
*
* ### Example
* ```typescript
* import { Component } from '@angular/core';
*
* @Component({
* selector: 'my-map-cmp',
* styles: [`
* .agm-map-container {
* height: 300px;
* }
* `],
* template: `
* <agm-map [latitude]="lat" [longitude]="lng" [zoom]="zoom">
* <agm-marker [latitude]="lat" [longitude]="lng" [label]="'M'">
* <agm-info-window [disableAutoPan]="true">
* Hi, this is the content of the <strong>info window</strong>
* </agm-info-window>
* </agm-marker>
* </agm-map>
* `
* })
* ```
*/
var AgmInfoWindow = (function () {
function AgmInfoWindow(_infoWindowManager, _el) {
this._infoWindowManager = _infoWindowManager;
this._el = _el;
/**
* Sets the open state for the InfoWindow. You can also call the open() and close() methods.
*/
this.isOpen = false;
/**
* Emits an event when the info window is closed.
*/
this.infoWindowClose = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this._infoWindowAddedToManager = false;
this._id = (infoWindowId++).toString();
}
AgmInfoWindow.prototype.ngOnInit = function () {
this.content = this._el.nativeElement.querySelector('.agm-info-window-content');
this._infoWindowManager.addInfoWindow(this);
this._infoWindowAddedToManager = true;
this._updateOpenState();
this._registerEventListeners();
};
/** @internal */
AgmInfoWindow.prototype.ngOnChanges = function (changes) {
if (!this._infoWindowAddedToManager) {
return;
}
if ((changes['latitude'] || changes['longitude']) && typeof this.latitude === 'number' &&
typeof this.longitude === 'number') {
this._infoWindowManager.setPosition(this);
}
if (changes['zIndex']) {
this._infoWindowManager.setZIndex(this);
}
if (changes['isOpen']) {
this._updateOpenState();
}
this._setInfoWindowOptions(changes);
};
AgmInfoWindow.prototype._registerEventListeners = function () {
var _this = this;
this._infoWindowManager.createEventObservable('closeclick', this).subscribe(function () {
_this.isOpen = false;
_this.infoWindowClose.emit();
});
};
AgmInfoWindow.prototype._updateOpenState = function () {
this.isOpen ? this.open() : this.close();
};
AgmInfoWindow.prototype._setInfoWindowOptions = function (changes) {
var options = {};
var optionKeys = Object.keys(changes).filter(function (k) { return AgmInfoWindow._infoWindowOptionsInputs.indexOf(k) !== -1; });
optionKeys.forEach(function (k) { options[k] = changes[k].currentValue; });
this._infoWindowManager.setOptions(this, options);
};
/**
* Opens the info window.
*/
AgmInfoWindow.prototype.open = function () { return this._infoWindowManager.open(this); };
/**
* Closes the info window.
*/
AgmInfoWindow.prototype.close = function () {
var _this = this;
return this._infoWindowManager.close(this).then(function () { _this.infoWindowClose.emit(); });
};
/** @internal */
AgmInfoWindow.prototype.id = function () { return this._id; };
/** @internal */
AgmInfoWindow.prototype.toString = function () { return 'AgmInfoWindow-' + this._id.toString(); };
/** @internal */
AgmInfoWindow.prototype.ngOnDestroy = function () { this._infoWindowManager.deleteInfoWindow(this); };
return AgmInfoWindow;
}());
AgmInfoWindow._infoWindowOptionsInputs = ['disableAutoPan', 'maxWidth'];
AgmInfoWindow.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{
selector: 'agm-info-window',
template: "<div class='agm-info-window-content'>\n <ng-content></ng-content>\n </div>\n "
},] },
];
/** @nocollapse */
AgmInfoWindow.ctorParameters = function () { return [
{ type: _services_managers_info_window_manager__WEBPACK_IMPORTED_MODULE_1__["InfoWindowManager"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
]; };
AgmInfoWindow.propDecorators = {
'latitude': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'longitude': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'disableAutoPan': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'zIndex': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'maxWidth': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'isOpen': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'infoWindowClose': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
//# sourceMappingURL=info-window.js.map
/***/ }),
/***/ "./node_modules/@agm/core/directives/kml-layer.js":
/*!********************************************************!*\
!*** ./node_modules/@agm/core/directives/kml-layer.js ***!
\********************************************************/
/*! exports provided: AgmKmlLayer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgmKmlLayer", function() { return AgmKmlLayer; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _services_managers_kml_layer_manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../services/managers/kml-layer-manager */ "./node_modules/@agm/core/services/managers/kml-layer-manager.js");
var layerId = 0;
var AgmKmlLayer = (function () {
function AgmKmlLayer(_manager) {
this._manager = _manager;
this._addedToManager = false;
this._id = (layerId++).toString();
this._subscriptions = [];
/**
* If true, the layer receives mouse events. Default value is true.
*/
this.clickable = true;
/**
* By default, the input map is centered and zoomed to the bounding box of the contents of the
* layer.
* If this option is set to true, the viewport is left unchanged, unless the map's center and zoom
* were never set.
*/
this.preserveViewport = false;
/**
* Whether to render the screen overlays. Default true.
*/
this.screenOverlays = true;
/**
* Suppress the rendering of info windows when layer features are clicked.
*/
this.suppressInfoWindows = false;
/**
* The URL of the KML document to display.
*/
this.url = null;
/**
* The z-index of the layer.
*/
this.zIndex = null;
/**
* This event is fired when a feature in the layer is clicked.
*/
this.layerClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the KML layers default viewport has changed.
*/
this.defaultViewportChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the KML layer has finished loading.
* At this point it is safe to read the status property to determine if the layer loaded
* successfully.
*/
this.statusChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
}
AgmKmlLayer.prototype.ngOnInit = function () {
if (this._addedToManager) {
return;
}
this._manager.addKmlLayer(this);
this._addedToManager = true;
this._addEventListeners();
};
AgmKmlLayer.prototype.ngOnChanges = function (changes) {
if (!this._addedToManager) {
return;
}
this._updatePolygonOptions(changes);
};
AgmKmlLayer.prototype._updatePolygonOptions = function (changes) {
var options = Object.keys(changes)
.filter(function (k) { return AgmKmlLayer._kmlLayerOptions.indexOf(k) !== -1; })
.reduce(function (obj, k) {
obj[k] = changes[k].currentValue;
return obj;
}, {});
if (Object.keys(options).length > 0) {
this._manager.setOptions(this, options);
}
};
AgmKmlLayer.prototype._addEventListeners = function () {
var _this = this;
var listeners = [
{ name: 'click', handler: function (ev) { return _this.layerClick.emit(ev); } },
{ name: 'defaultviewport_changed', handler: function () { return _this.defaultViewportChange.emit(); } },
{ name: 'status_changed', handler: function () { return _this.statusChange.emit(); } },
];
listeners.forEach(function (obj) {
var os = _this._manager.createEventObservable(obj.name, _this).subscribe(obj.handler);
_this._subscriptions.push(os);
});
};
/** @internal */
AgmKmlLayer.prototype.id = function () { return this._id; };
/** @internal */
AgmKmlLayer.prototype.toString = function () { return "AgmKmlLayer-" + this._id.toString(); };
/** @internal */
AgmKmlLayer.prototype.ngOnDestroy = function () {
this._manager.deleteKmlLayer(this);
// unsubscribe all registered observable subscriptions
this._subscriptions.forEach(function (s) { return s.unsubscribe(); });
};
return AgmKmlLayer;
}());
AgmKmlLayer._kmlLayerOptions = ['clickable', 'preserveViewport', 'screenOverlays', 'suppressInfoWindows', 'url', 'zIndex'];
AgmKmlLayer.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'agm-kml-layer'
},] },
];
/** @nocollapse */
AgmKmlLayer.ctorParameters = function () { return [
{ type: _services_managers_kml_layer_manager__WEBPACK_IMPORTED_MODULE_1__["KmlLayerManager"], },
]; };
AgmKmlLayer.propDecorators = {
'clickable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'preserveViewport': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'screenOverlays': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'suppressInfoWindows': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'url': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'zIndex': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'layerClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'defaultViewportChange': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'statusChange': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
//# sourceMappingURL=kml-layer.js.map
/***/ }),
/***/ "./node_modules/@agm/core/directives/map.js":
/*!**************************************************!*\
!*** ./node_modules/@agm/core/directives/map.js ***!
\**************************************************/
/*! exports provided: AgmMap */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgmMap", function() { return AgmMap; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _services_google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services/google-maps-api-wrapper */ "./node_modules/@agm/core/services/google-maps-api-wrapper.js");
/* harmony import */ var _services_managers_circle_manager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../services/managers/circle-manager */ "./node_modules/@agm/core/services/managers/circle-manager.js");
/* harmony import */ var _services_managers_info_window_manager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services/managers/info-window-manager */ "./node_modules/@agm/core/services/managers/info-window-manager.js");
/* harmony import */ var _services_managers_marker_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../services/managers/marker-manager */ "./node_modules/@agm/core/services/managers/marker-manager.js");
/* harmony import */ var _services_managers_polygon_manager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../services/managers/polygon-manager */ "./node_modules/@agm/core/services/managers/polygon-manager.js");
/* harmony import */ var _services_managers_polyline_manager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/managers/polyline-manager */ "./node_modules/@agm/core/services/managers/polyline-manager.js");
/* harmony import */ var _services_managers_kml_layer_manager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../services/managers/kml-layer-manager */ "./node_modules/@agm/core/services/managers/kml-layer-manager.js");
/* harmony import */ var _services_managers_data_layer_manager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../services/managers/data-layer-manager */ "./node_modules/@agm/core/services/managers/data-layer-manager.js");
/**
* AgmMap renders a Google Map.
* **Important note**: To be able see a map in the browser, you have to define a height for the
* element `agm-map`.
*
* ### Example
* ```typescript
* import { Component } from '@angular/core';
*
* @Component({
* selector: 'my-map-cmp',
* styles: [`
* agm-map {
* height: 300px;
* }
* `],
* template: `
* <agm-map [latitude]="lat" [longitude]="lng" [zoom]="zoom">
* </agm-map>
* `
* })
* ```
*/
var AgmMap = (function () {
function AgmMap(_elem, _mapsWrapper) {
this._elem = _elem;
this._mapsWrapper = _mapsWrapper;
/**
* The longitude that defines the center of the map.
*/
this.longitude = 0;
/**
* The latitude that defines the center of the map.
*/
this.latitude = 0;
/**
* The zoom level of the map. The default zoom level is 8.
*/
this.zoom = 8;
/**
* Enables/disables if map is draggable.
*/
// tslint:disable-next-line:no-input-rename
this.draggable = true;
/**
* Enables/disables zoom and center on double click. Enabled by default.
*/
this.disableDoubleClickZoom = false;
/**
* Enables/disables all default UI of the Google map. Please note: When the map is created, this
* value cannot get updated.
*/
this.disableDefaultUI = false;
/**
* If false, disables scrollwheel zooming on the map. The scrollwheel is enabled by default.
*/
this.scrollwheel = true;
/**
* If false, prevents the map from being controlled by the keyboard. Keyboard shortcuts are
* enabled by default.
*/
this.keyboardShortcuts = true;
/**
* The enabled/disabled state of the Zoom control.
*/
this.zoomControl = true;
/**
* Styles to apply to each of the default map types. Note that for Satellite/Hybrid and Terrain
* modes, these styles will only apply to labels and geometry.
*/
this.styles = [];
/**
* When true and the latitude and/or longitude values changes, the Google Maps panTo method is
* used to
* center the map. See: https://developers.google.com/maps/documentation/javascript/reference#Map
*/
this.usePanning = false;
/**
* The initial enabled/disabled state of the Street View Pegman control.
* This control is part of the default UI, and should be set to false when displaying a map type
* on which the Street View road overlay should not appear (e.g. a non-Earth map type).
*/
this.streetViewControl = true;
/**
* Sets the viewport to contain the given bounds.
*/
this.fitBounds = null;
/**
* The initial enabled/disabled state of the Scale control. This is disabled by default.
*/
this.scaleControl = false;
/**
* The initial enabled/disabled state of the Map type control.
*/
this.mapTypeControl = false;
/**
* The initial enabled/disabled state of the Pan control.
*/
this.panControl = false;
/**
* The initial enabled/disabled state of the Rotate control.
*/
this.rotateControl = false;
/**
* The initial enabled/disabled state of the Fullscreen control.
*/
this.fullscreenControl = false;
/**
* The map mapTypeId. Defaults to 'roadmap'.
*/
this.mapTypeId = 'roadmap';
/**
* When false, map icons are not clickable. A map icon represents a point of interest,
* also known as a POI. By default map icons are clickable.
*/
this.clickableIcons = true;
/**
* This setting controls how gestures on the map are handled.
* Allowed values:
* - 'cooperative' (Two-finger touch gestures pan and zoom the map. One-finger touch gestures are not handled by the map.)
* - 'greedy' (All touch gestures pan or zoom the map.)
* - 'none' (The map cannot be panned or zoomed by user gestures.)
* - 'auto' [default] (Gesture handling is either cooperative or greedy, depending on whether the page is scrollable or not.
*/
this.gestureHandling = 'auto';
this._observableSubscriptions = [];
/**
* This event emitter gets emitted when the user clicks on the map (but not when they click on a
* marker or infoWindow).
*/
this.mapClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event emitter gets emitted when the user right-clicks on the map (but not when they click
* on a marker or infoWindow).
*/
this.mapRightClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event emitter gets emitted when the user double-clicks on the map (but not when they click
* on a marker or infoWindow).
*/
this.mapDblClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event emitter is fired when the map center changes.
*/
this.centerChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the viewport bounds have changed.
*/
this.boundsChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the map becomes idle after panning or zooming.
*/
this.idle = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the zoom level has changed.
*/
this.zoomChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the google map is fully initialized.
* You get the google.maps.Map instance as a result of this EventEmitter.
*/
this.mapReady = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
}
/** @internal */
AgmMap.prototype.ngOnInit = function () {
// todo: this should be solved with a new component and a viewChild decorator
var container = this._elem.nativeElement.querySelector('.agm-map-container-inner');
this._initMapInstance(container);
};
AgmMap.prototype._initMapInstance = function (el) {
var _this = this;
this._mapsWrapper.createMap(el, {
center: { lat: this.latitude || 0, lng: this.longitude || 0 },
zoom: this.zoom,
minZoom: this.minZoom,
maxZoom: this.maxZoom,
disableDefaultUI: this.disableDefaultUI,
disableDoubleClickZoom: this.disableDoubleClickZoom,
scrollwheel: this.scrollwheel,
backgroundColor: this.backgroundColor,
draggable: this.draggable,
draggableCursor: this.draggableCursor,
draggingCursor: this.draggingCursor,
keyboardShortcuts: this.keyboardShortcuts,
styles: this.styles,
zoomControl: this.zoomControl,
zoomControlOptions: this.zoomControlOptions,
streetViewControl: this.streetViewControl,
streetViewControlOptions: this.streetViewControlOptions,
scaleControl: this.scaleControl,
scaleControlOptions: this.scaleControlOptions,
mapTypeControl: this.mapTypeControl,
mapTypeControlOptions: this.mapTypeControlOptions,
panControl: this.panControl,
panControlOptions: this.panControlOptions,
rotateControl: this.rotateControl,
rotateControlOptions: this.rotateControlOptions,
fullscreenControl: this.fullscreenControl,
fullscreenControlOptions: this.fullscreenControlOptions,
mapTypeId: this.mapTypeId,
clickableIcons: this.clickableIcons,
gestureHandling: this.gestureHandling
})
.then(function () { return _this._mapsWrapper.getNativeMap(); })
.then(function (map) { return _this.mapReady.emit(map); });
// register event listeners
this._handleMapCenterChange();
this._handleMapZoomChange();
this._handleMapMouseEvents();
this._handleBoundsChange();
this._handleIdleEvent();
};
/** @internal */
AgmMap.prototype.ngOnDestroy = function () {
// unsubscribe all registered observable subscriptions
this._observableSubscriptions.forEach(function (s) { return s.unsubscribe(); });
};
/* @internal */
AgmMap.prototype.ngOnChanges = function (changes) {
this._updateMapOptionsChanges(changes);
this._updatePosition(changes);
};
AgmMap.prototype._updateMapOptionsChanges = function (changes) {
var options = {};
var optionKeys = Object.keys(changes).filter(function (k) { return AgmMap._mapOptionsAttributes.indexOf(k) !== -1; });
optionKeys.forEach(function (k) { options[k] = changes[k].currentValue; });
this._mapsWrapper.setMapOptions(options);
};
/**
* Triggers a resize event on the google map instance.
* When recenter is true, the of the google map gets called with the current lat/lng values or fitBounds value to recenter the map.
* Returns a promise that gets resolved after the event was triggered.
*/
AgmMap.prototype.triggerResize = function (recenter) {
var _this = this;
if (recenter === void 0) { recenter = true; }
// Note: When we would trigger the resize event and show the map in the same turn (which is a
// common case for triggering a resize event), then the resize event would not
// work (to show the map), so we trigger the event in a timeout.
return new Promise(function (resolve) {
setTimeout(function () {
return _this._mapsWrapper.triggerMapEvent('resize').then(function () {
if (recenter) {
_this.fitBounds != null ? _this._fitBounds() : _this._setCenter();
}
resolve();
});
});
});
};
AgmMap.prototype._updatePosition = function (changes) {
if (changes['latitude'] == null && changes['longitude'] == null &&
changes['fitBounds'] == null) {
// no position update needed
return;
}
// we prefer fitBounds in changes
if (changes['fitBounds'] && this.fitBounds != null) {
this._fitBounds();
return;
}
if (typeof this.latitude !== 'number' || typeof this.longitude !== 'number') {
return;
}
this._setCenter();
};
AgmMap.prototype._setCenter = function () {
var newCenter = {
lat: this.latitude,
lng: this.longitude,
};
if (this.usePanning) {
this._mapsWrapper.panTo(newCenter);
}
else {
this._mapsWrapper.setCenter(newCenter);
}
};
AgmMap.prototype._fitBounds = function () {
if (this.usePanning) {
this._mapsWrapper.panToBounds(this.fitBounds);
return;
}
this._mapsWrapper.fitBounds(this.fitBounds);
};
AgmMap.prototype._handleMapCenterChange = function () {
var _this = this;
var s = this._mapsWrapper.subscribeToMapEvent('center_changed').subscribe(function () {
_this._mapsWrapper.getCenter().then(function (center) {
_this.latitude = center.lat();
_this.longitude = center.lng();
_this.centerChange.emit({ lat: _this.latitude, lng: _this.longitude });
});
});
this._observableSubscriptions.push(s);
};
AgmMap.prototype._handleBoundsChange = function () {
var _this = this;
var s = this._mapsWrapper.subscribeToMapEvent('bounds_changed').subscribe(function () {
_this._mapsWrapper.getBounds().then(function (bounds) { _this.boundsChange.emit(bounds); });
});
this._observableSubscriptions.push(s);
};
AgmMap.prototype._handleMapZoomChange = function () {
var _this = this;
var s = this._mapsWrapper.subscribeToMapEvent('zoom_changed').subscribe(function () {
_this._mapsWrapper.getZoom().then(function (z) {
_this.zoom = z;
_this.zoomChange.emit(z);
});
});
this._observableSubscriptions.push(s);
};
AgmMap.prototype._handleIdleEvent = function () {
var _this = this;
var s = this._mapsWrapper.subscribeToMapEvent('idle').subscribe(function () { _this.idle.emit(void 0); });
this._observableSubscriptions.push(s);
};
AgmMap.prototype._handleMapMouseEvents = function () {
var _this = this;
var events = [
{ name: 'click', emitter: this.mapClick },
{ name: 'rightclick', emitter: this.mapRightClick },
{ name: 'dblclick', emitter: this.mapDblClick },
];
events.forEach(function (e) {
var s = _this._mapsWrapper.subscribeToMapEvent(e.name).subscribe(function (event) {
var value = { coords: { lat: event.latLng.lat(), lng: event.latLng.lng() } };
e.emitter.emit(value);
});
_this._observableSubscriptions.push(s);
});
};
return AgmMap;
}());
/**
* Map option attributes that can change over time
*/
AgmMap._mapOptionsAttributes = [
'disableDoubleClickZoom', 'scrollwheel', 'draggable', 'draggableCursor', 'draggingCursor',
'keyboardShortcuts', 'zoomControl', 'zoomControlOptions', 'styles', 'streetViewControl',
'streetViewControlOptions', 'zoom', 'mapTypeControl', 'mapTypeControlOptions', 'minZoom',
'maxZoom', 'panControl', 'panControlOptions', 'rotateControl', 'rotateControlOptions',
'fullscreenControl', 'fullscreenControlOptions', 'scaleControl', 'scaleControlOptions',
'mapTypeId', 'clickableIcons', 'gestureHandling'
];
AgmMap.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{
selector: 'agm-map',
providers: [
_services_google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_1__["GoogleMapsAPIWrapper"], _services_managers_marker_manager__WEBPACK_IMPORTED_MODULE_4__["MarkerManager"], _services_managers_info_window_manager__WEBPACK_IMPORTED_MODULE_3__["InfoWindowManager"], _services_managers_circle_manager__WEBPACK_IMPORTED_MODULE_2__["CircleManager"], _services_managers_polyline_manager__WEBPACK_IMPORTED_MODULE_6__["PolylineManager"],
_services_managers_polygon_manager__WEBPACK_IMPORTED_MODULE_5__["PolygonManager"], _services_managers_kml_layer_manager__WEBPACK_IMPORTED_MODULE_7__["KmlLayerManager"], _services_managers_data_layer_manager__WEBPACK_IMPORTED_MODULE_8__["DataLayerManager"]
],
host: {
// todo: deprecated - we will remove it with the next version
'[class.sebm-google-map-container]': 'true'
},
styles: ["\n .agm-map-container-inner {\n width: inherit;\n height: inherit;\n }\n .agm-map-content {\n display:none;\n }\n "],
template: "\n <div class='agm-map-container-inner sebm-google-map-container-inner'></div>\n <div class='agm-map-content'>\n <ng-content></ng-content>\n </div>\n "
},] },
];
/** @nocollapse */
AgmMap.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _services_google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_1__["GoogleMapsAPIWrapper"], },
]; };
AgmMap.propDecorators = {
'longitude': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'latitude': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'zoom': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'minZoom': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'maxZoom': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'draggable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['mapDraggable',] },],
'disableDoubleClickZoom': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'disableDefaultUI': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'scrollwheel': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'backgroundColor': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'draggableCursor': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'draggingCursor': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'keyboardShortcuts': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'zoomControl': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'zoomControlOptions': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'styles': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'usePanning': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'streetViewControl': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'streetViewControlOptions': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'fitBounds': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'scaleControl': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'scaleControlOptions': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'mapTypeControl': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'mapTypeControlOptions': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'panControl': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'panControlOptions': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'rotateControl': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'rotateControlOptions': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'fullscreenControl': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'fullscreenControlOptions': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'mapTypeId': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'clickableIcons': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'gestureHandling': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'mapClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'mapRightClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'mapDblClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'centerChange': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'boundsChange': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'idle': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'zoomChange': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'mapReady': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
//# sourceMappingURL=map.js.map
/***/ }),
/***/ "./node_modules/@agm/core/directives/marker.js":
/*!*****************************************************!*\
!*** ./node_modules/@agm/core/directives/marker.js ***!
\*****************************************************/
/*! exports provided: AgmMarker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgmMarker", function() { return AgmMarker; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _services_managers_marker_manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services/managers/marker-manager */ "./node_modules/@agm/core/services/managers/marker-manager.js");
/* harmony import */ var _info_window__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./info-window */ "./node_modules/@agm/core/directives/info-window.js");
var markerId = 0;
/**
* AgmMarker renders a map marker inside a {@link AgmMap}.
*
* ### Example
* ```typescript
* import { Component } from '@angular/core';
*
* @Component({
* selector: 'my-map-cmp',
* styles: [`
* .agm-map-container {
* height: 300px;
* }
* `],
* template: `
* <agm-map [latitude]="lat" [longitude]="lng" [zoom]="zoom">
* <agm-marker [latitude]="lat" [longitude]="lng" [label]="'M'">
* </agm-marker>
* </agm-map>
* `
* })
* ```
*/
var AgmMarker = (function () {
function AgmMarker(_markerManager) {
this._markerManager = _markerManager;
/**
* If true, the marker can be dragged. Default value is false.
*/
// tslint:disable-next-line:no-input-rename
this.draggable = false;
/**
* If true, the marker is visible
*/
this.visible = true;
/**
* Whether to automatically open the child info window when the marker is clicked.
*/
this.openInfoWindow = true;
/**
* The marker's opacity between 0.0 and 1.0.
*/
this.opacity = 1;
/**
* All markers are displayed on the map in order of their zIndex, with higher values displaying in
* front of markers with lower values. By default, markers are displayed according to their
* vertical position on screen, with lower markers appearing in front of markers further up the
* screen.
*/
this.zIndex = 1;
/**
* If true, the marker can be clicked. Default value is true.
*/
// tslint:disable-next-line:no-input-rename
this.clickable = true;
/**
* This event emitter gets emitted when the user clicks on the marker.
*/
this.markerClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the user stops dragging the marker.
*/
this.dragEnd = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the user mouses over the marker.
*/
this.mouseOver = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the user mouses outside the marker.
*/
this.mouseOut = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* @internal
*/
this.infoWindow = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["QueryList"]();
this._markerAddedToManger = false;
this._observableSubscriptions = [];
this._id = (markerId++).toString();
}
/* @internal */
AgmMarker.prototype.ngAfterContentInit = function () {
var _this = this;
this.handleInfoWindowUpdate();
this.infoWindow.changes.subscribe(function () { return _this.handleInfoWindowUpdate(); });
};
AgmMarker.prototype.handleInfoWindowUpdate = function () {
var _this = this;
if (this.infoWindow.length > 1) {
throw new Error('Expected no more than one info window.');
}
this.infoWindow.forEach(function (marker) {
marker.hostMarker = _this;
});
};
/** @internal */
AgmMarker.prototype.ngOnChanges = function (changes) {
if (typeof this.latitude !== 'number' || typeof this.longitude !== 'number') {
return;
}
if (!this._markerAddedToManger) {
this._markerManager.addMarker(this);
this._markerAddedToManger = true;
this._addEventListeners();
return;
}
if (changes['latitude'] || changes['longitude']) {
this._markerManager.updateMarkerPosition(this);
}
if (changes['title']) {
this._markerManager.updateTitle(this);
}
if (changes['label']) {
this._markerManager.updateLabel(this);
}
if (changes['draggable']) {
this._markerManager.updateDraggable(this);
}
if (changes['iconUrl']) {
this._markerManager.updateIcon(this);
}
if (changes['opacity']) {
this._markerManager.updateOpacity(this);
}
if (changes['visible']) {
this._markerManager.updateVisible(this);
}
if (changes['zIndex']) {
this._markerManager.updateZIndex(this);
}
if (changes['clickable']) {
this._markerManager.updateClickable(this);
}
};
AgmMarker.prototype._addEventListeners = function () {
var _this = this;
var cs = this._markerManager.createEventObservable('click', this).subscribe(function () {
if (_this.openInfoWindow) {
_this.infoWindow.forEach(function (infoWindow) { return infoWindow.open(); });
}
_this.markerClick.emit(null);
});
this._observableSubscriptions.push(cs);
var ds = this._markerManager.createEventObservable('dragend', this)
.subscribe(function (e) {
_this.dragEnd.emit({ coords: { lat: e.latLng.lat(), lng: e.latLng.lng() } });
});
this._observableSubscriptions.push(ds);
var mover = this._markerManager.createEventObservable('mouseover', this)
.subscribe(function (e) {
_this.mouseOver.emit({ coords: { lat: e.latLng.lat(), lng: e.latLng.lng() } });
});
this._observableSubscriptions.push(mover);
var mout = this._markerManager.createEventObservable('mouseout', this)
.subscribe(function (e) {
_this.mouseOut.emit({ coords: { lat: e.latLng.lat(), lng: e.latLng.lng() } });
});
this._observableSubscriptions.push(mout);
};
/** @internal */
AgmMarker.prototype.id = function () { return this._id; };
/** @internal */
AgmMarker.prototype.toString = function () { return 'AgmMarker-' + this._id.toString(); };
/** @internal */
AgmMarker.prototype.ngOnDestroy = function () {
this._markerManager.deleteMarker(this);
// unsubscribe all registered observable subscriptions
this._observableSubscriptions.forEach(function (s) { return s.unsubscribe(); });
};
return AgmMarker;
}());
AgmMarker.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'agm-marker'
},] },
];
/** @nocollapse */
AgmMarker.ctorParameters = function () { return [
{ type: _services_managers_marker_manager__WEBPACK_IMPORTED_MODULE_1__["MarkerManager"], },
]; };
AgmMarker.propDecorators = {
'latitude': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'longitude': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'title': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'label': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'draggable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['markerDraggable',] },],
'iconUrl': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'visible': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'openInfoWindow': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'opacity': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'zIndex': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'clickable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['markerClickable',] },],
'markerClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'dragEnd': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'mouseOver': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'mouseOut': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'infoWindow': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [_info_window__WEBPACK_IMPORTED_MODULE_2__["AgmInfoWindow"],] },],
};
//# sourceMappingURL=marker.js.map
/***/ }),
/***/ "./node_modules/@agm/core/directives/polygon.js":
/*!******************************************************!*\
!*** ./node_modules/@agm/core/directives/polygon.js ***!
\******************************************************/
/*! exports provided: AgmPolygon */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgmPolygon", function() { return AgmPolygon; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _services_managers_polygon_manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services/managers/polygon-manager */ "./node_modules/@agm/core/services/managers/polygon-manager.js");
/**
* AgmPolygon renders a polygon on a {@link AgmMap}
*
* ### Example
* ```typescript
* import { Component } from '@angular/core';
*
* @Component({
* selector: 'my-map-cmp',
* styles: [`
* agm-map {
* height: 300px;
* }
* `],
* template: `
* <agm-map [latitude]="lat" [longitude]="lng" [zoom]="zoom">
* <agm-polygon [paths]="paths">
* </agm-polygon>
* </agm-map>
* `
* })
* export class MyMapCmp {
* lat: number = 0;
* lng: number = 0;
* zoom: number = 10;
* paths: Array<LatLngLiteral> = [
* { lat: 0, lng: 10 },
* { lat: 0, lng: 20 },
* { lat: 10, lng: 20 },
* { lat: 10, lng: 10 },
* { lat: 0, lng: 10 }
* ]
* // Nesting paths will create a hole where they overlap;
* nestedPaths: Array<Array<LatLngLiteral>> = [[
* { lat: 0, lng: 10 },
* { lat: 0, lng: 20 },
* { lat: 10, lng: 20 },
* { lat: 10, lng: 10 },
* { lat: 0, lng: 10 }
* ], [
* { lat: 0, lng: 15 },
* { lat: 0, lng: 20 },
* { lat: 5, lng: 20 },
* { lat: 5, lng: 15 },
* { lat: 0, lng: 15 }
* ]]
* }
* ```
*/
var AgmPolygon = (function () {
function AgmPolygon(_polygonManager) {
this._polygonManager = _polygonManager;
/**
* Indicates whether this Polygon handles mouse events. Defaults to true.
*/
this.clickable = true;
/**
* If set to true, the user can drag this shape over the map. The geodesic
* property defines the mode of dragging. Defaults to false.
*/
// tslint:disable-next-line:no-input-rename
this.draggable = false;
/**
* If set to true, the user can edit this shape by dragging the control
* points shown at the vertices and on each segment. Defaults to false.
*/
this.editable = false;
/**
* When true, edges of the polygon are interpreted as geodesic and will
* follow the curvature of the Earth. When false, edges of the polygon are
* rendered as straight lines in screen space. Note that the shape of a
* geodesic polygon may appear to change when dragged, as the dimensions
* are maintained relative to the surface of the earth. Defaults to false.
*/
this.geodesic = false;
/**
* The ordered sequence of coordinates that designates a closed loop.
* Unlike polylines, a polygon may consist of one or more paths.
* As a result, the paths property may specify one or more arrays of
* LatLng coordinates. Paths are closed automatically; do not repeat the
* first vertex of the path as the last vertex. Simple polygons may be
* defined using a single array of LatLngs. More complex polygons may
* specify an array of arrays. Any simple arrays are converted into Arrays.
* Inserting or removing LatLngs from the Array will automatically update
* the polygon on the map.
*/
this.paths = [];
/**
* This event is fired when the DOM click event is fired on the Polygon.
*/
this.polyClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the DOM dblclick event is fired on the Polygon.
*/
this.polyDblClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is repeatedly fired while the user drags the polygon.
*/
this.polyDrag = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the user stops dragging the polygon.
*/
this.polyDragEnd = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the user starts dragging the polygon.
*/
this.polyDragStart = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the DOM mousedown event is fired on the Polygon.
*/
this.polyMouseDown = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the DOM mousemove event is fired on the Polygon.
*/
this.polyMouseMove = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired on Polygon mouseout.
*/
this.polyMouseOut = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired on Polygon mouseover.
*/
this.polyMouseOver = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired whe the DOM mouseup event is fired on the Polygon
*/
this.polyMouseUp = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This even is fired when the Polygon is right-clicked on.
*/
this.polyRightClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this._polygonAddedToManager = false;
this._subscriptions = [];
}
/** @internal */
AgmPolygon.prototype.ngAfterContentInit = function () {
if (!this._polygonAddedToManager) {
this._init();
}
};
AgmPolygon.prototype.ngOnChanges = function (changes) {
if (!this._polygonAddedToManager) {
this._init();
return;
}
this._polygonManager.setPolygonOptions(this, this._updatePolygonOptions(changes));
};
AgmPolygon.prototype._init = function () {
this._polygonManager.addPolygon(this);
this._polygonAddedToManager = true;
this._addEventListeners();
};
AgmPolygon.prototype._addEventListeners = function () {
var _this = this;
var handlers = [
{ name: 'click', handler: function (ev) { return _this.polyClick.emit(ev); } },
{ name: 'dbclick', handler: function (ev) { return _this.polyDblClick.emit(ev); } },
{ name: 'drag', handler: function (ev) { return _this.polyDrag.emit(ev); } },
{ name: 'dragend', handler: function (ev) { return _this.polyDragEnd.emit(ev); } },
{ name: 'dragstart', handler: function (ev) { return _this.polyDragStart.emit(ev); } },
{ name: 'mousedown', handler: function (ev) { return _this.polyMouseDown.emit(ev); } },
{ name: 'mousemove', handler: function (ev) { return _this.polyMouseMove.emit(ev); } },
{ name: 'mouseout', handler: function (ev) { return _this.polyMouseOut.emit(ev); } },
{ name: 'mouseover', handler: function (ev) { return _this.polyMouseOver.emit(ev); } },
{ name: 'mouseup', handler: function (ev) { return _this.polyMouseUp.emit(ev); } },
{ name: 'rightclick', handler: function (ev) { return _this.polyRightClick.emit(ev); } },
];
handlers.forEach(function (obj) {
var os = _this._polygonManager.createEventObservable(obj.name, _this).subscribe(obj.handler);
_this._subscriptions.push(os);
});
};
AgmPolygon.prototype._updatePolygonOptions = function (changes) {
return Object.keys(changes)
.filter(function (k) { return AgmPolygon._polygonOptionsAttributes.indexOf(k) !== -1; })
.reduce(function (obj, k) {
obj[k] = changes[k].currentValue;
return obj;
}, {});
};
/** @internal */
AgmPolygon.prototype.id = function () { return this._id; };
/** @internal */
AgmPolygon.prototype.ngOnDestroy = function () {
this._polygonManager.deletePolygon(this);
// unsubscribe all registered observable subscriptions
this._subscriptions.forEach(function (s) { return s.unsubscribe(); });
};
return AgmPolygon;
}());
AgmPolygon._polygonOptionsAttributes = [
'clickable', 'draggable', 'editable', 'fillColor', 'fillOpacity', 'geodesic', 'icon', 'map',
'paths', 'strokeColor', 'strokeOpacity', 'strokeWeight', 'visible', 'zIndex', 'draggable',
'editable', 'visible'
];
AgmPolygon.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'agm-polygon'
},] },
];
/** @nocollapse */
AgmPolygon.ctorParameters = function () { return [
{ type: _services_managers_polygon_manager__WEBPACK_IMPORTED_MODULE_1__["PolygonManager"], },
]; };
AgmPolygon.propDecorators = {
'clickable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'draggable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['polyDraggable',] },],
'editable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'fillColor': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'fillOpacity': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'geodesic': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'paths': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'strokeColor': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'strokeOpacity': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'strokeWeight': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'visible': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'zIndex': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'polyClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'polyDblClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'polyDrag': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'polyDragEnd': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'polyDragStart': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'polyMouseDown': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'polyMouseMove': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'polyMouseOut': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'polyMouseOver': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'polyMouseUp': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'polyRightClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
//# sourceMappingURL=polygon.js.map
/***/ }),
/***/ "./node_modules/@agm/core/directives/polyline-point.js":
/*!*************************************************************!*\
!*** ./node_modules/@agm/core/directives/polyline-point.js ***!
\*************************************************************/
/*! exports provided: AgmPolylinePoint */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgmPolylinePoint", function() { return AgmPolylinePoint; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/**
* AgmPolylinePoint represents one element of a polyline within a {@link
* SembGoogleMapPolyline}
*/
var AgmPolylinePoint = (function () {
function AgmPolylinePoint() {
/**
* This event emitter gets emitted when the position of the point changed.
*/
this.positionChanged = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
}
AgmPolylinePoint.prototype.ngOnChanges = function (changes) {
if (changes['latitude'] || changes['longitude']) {
var position = {
lat: changes['latitude'].currentValue,
lng: changes['longitude'].currentValue
};
this.positionChanged.emit(position);
}
};
return AgmPolylinePoint;
}());
AgmPolylinePoint.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: 'agm-polyline-point' },] },
];
/** @nocollapse */
AgmPolylinePoint.ctorParameters = function () { return []; };
AgmPolylinePoint.propDecorators = {
'latitude': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'longitude': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'positionChanged': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
//# sourceMappingURL=polyline-point.js.map
/***/ }),
/***/ "./node_modules/@agm/core/directives/polyline.js":
/*!*******************************************************!*\
!*** ./node_modules/@agm/core/directives/polyline.js ***!
\*******************************************************/
/*! exports provided: AgmPolyline */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgmPolyline", function() { return AgmPolyline; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _services_managers_polyline_manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services/managers/polyline-manager */ "./node_modules/@agm/core/services/managers/polyline-manager.js");
/* harmony import */ var _polyline_point__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./polyline-point */ "./node_modules/@agm/core/directives/polyline-point.js");
var polylineId = 0;
/**
* AgmPolyline renders a polyline on a {@link AgmMap}
*
* ### Example
* ```typescript
* import { Component } from '@angular/core';
*
* @Component({
* selector: 'my-map-cmp',
* styles: [`
* .agm-map-container {
* height: 300px;
* }
* `],
* template: `
* <agm-map [latitude]="lat" [longitude]="lng" [zoom]="zoom">
* <agm-polyline>
* <agm-polyline-point [latitude]="latA" [longitude]="lngA">
* </agm-polyline-point>
* <agm-polyline-point [latitude]="latB" [longitude]="lngB">
* </agm-polyline-point>
* </agm-polyline>
* </agm-map>
* `
* })
* ```
*/
var AgmPolyline = (function () {
function AgmPolyline(_polylineManager) {
this._polylineManager = _polylineManager;
/**
* Indicates whether this Polyline handles mouse events. Defaults to true.
*/
this.clickable = true;
/**
* If set to true, the user can drag this shape over the map. The geodesic property defines the
* mode of dragging. Defaults to false.
*/
// tslint:disable-next-line:no-input-rename
this.draggable = false;
/**
* If set to true, the user can edit this shape by dragging the control points shown at the
* vertices and on each segment. Defaults to false.
*/
this.editable = false;
/**
* When true, edges of the polygon are interpreted as geodesic and will follow the curvature of
* the Earth. When false, edges of the polygon are rendered as straight lines in screen space.
* Note that the shape of a geodesic polygon may appear to change when dragged, as the dimensions
* are maintained relative to the surface of the earth. Defaults to false.
*/
this.geodesic = false;
/**
* Whether this polyline is visible on the map. Defaults to true.
*/
this.visible = true;
/**
* This event is fired when the DOM click event is fired on the Polyline.
*/
this.lineClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the DOM dblclick event is fired on the Polyline.
*/
this.lineDblClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is repeatedly fired while the user drags the polyline.
*/
this.lineDrag = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the user stops dragging the polyline.
*/
this.lineDragEnd = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the user starts dragging the polyline.
*/
this.lineDragStart = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the DOM mousedown event is fired on the Polyline.
*/
this.lineMouseDown = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired when the DOM mousemove event is fired on the Polyline.
*/
this.lineMouseMove = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired on Polyline mouseout.
*/
this.lineMouseOut = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired on Polyline mouseover.
*/
this.lineMouseOver = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This event is fired whe the DOM mouseup event is fired on the Polyline
*/
this.lineMouseUp = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* This even is fired when the Polyline is right-clicked on.
*/
this.lineRightClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this._polylineAddedToManager = false;
this._subscriptions = [];
this._id = (polylineId++).toString();
}
/** @internal */
AgmPolyline.prototype.ngAfterContentInit = function () {
var _this = this;
if (this.points.length) {
this.points.forEach(function (point) {
var s = point.positionChanged.subscribe(function () { _this._polylineManager.updatePolylinePoints(_this); });
_this._subscriptions.push(s);
});
}
if (!this._polylineAddedToManager) {
this._init();
}
var s = this.points.changes.subscribe(function () { return _this._polylineManager.updatePolylinePoints(_this); });
this._subscriptions.push(s);
this._polylineManager.updatePolylinePoints(this);
};
AgmPolyline.prototype.ngOnChanges = function (changes) {
if (!this._polylineAddedToManager) {
this._init();
return;
}
var options = {};
var optionKeys = Object.keys(changes).filter(function (k) { return AgmPolyline._polylineOptionsAttributes.indexOf(k) !== -1; });
optionKeys.forEach(function (k) { return options[k] = changes[k].currentValue; });
this._polylineManager.setPolylineOptions(this, options);
};
AgmPolyline.prototype._init = function () {
this._polylineManager.addPolyline(this);
this._polylineAddedToManager = true;
this._addEventListeners();
};
AgmPolyline.prototype._addEventListeners = function () {
var _this = this;
var handlers = [
{ name: 'click', handler: function (ev) { return _this.lineClick.emit(ev); } },
{ name: 'dblclick', handler: function (ev) { return _this.lineDblClick.emit(ev); } },
{ name: 'drag', handler: function (ev) { return _this.lineDrag.emit(ev); } },
{ name: 'dragend', handler: function (ev) { return _this.lineDragEnd.emit(ev); } },
{ name: 'dragstart', handler: function (ev) { return _this.lineDragStart.emit(ev); } },
{ name: 'mousedown', handler: function (ev) { return _this.lineMouseDown.emit(ev); } },
{ name: 'mousemove', handler: function (ev) { return _this.lineMouseMove.emit(ev); } },
{ name: 'mouseout', handler: function (ev) { return _this.lineMouseOut.emit(ev); } },
{ name: 'mouseover', handler: function (ev) { return _this.lineMouseOver.emit(ev); } },
{ name: 'mouseup', handler: function (ev) { return _this.lineMouseUp.emit(ev); } },
{ name: 'rightclick', handler: function (ev) { return _this.lineRightClick.emit(ev); } },
];
handlers.forEach(function (obj) {
var os = _this._polylineManager.createEventObservable(obj.name, _this).subscribe(obj.handler);
_this._subscriptions.push(os);
});
};
/** @internal */
AgmPolyline.prototype._getPoints = function () {
if (this.points) {
return this.points.toArray();
}
return [];
};
/** @internal */
AgmPolyline.prototype.id = function () { return this._id; };
/** @internal */
AgmPolyline.prototype.ngOnDestroy = function () {
this._polylineManager.deletePolyline(this);
// unsubscribe all registered observable subscriptions
this._subscriptions.forEach(function (s) { return s.unsubscribe(); });
};
return AgmPolyline;
}());
AgmPolyline._polylineOptionsAttributes = [
'draggable', 'editable', 'visible', 'geodesic', 'strokeColor', 'strokeOpacity', 'strokeWeight',
'zIndex'
];
AgmPolyline.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'agm-polyline'
},] },
];
/** @nocollapse */
AgmPolyline.ctorParameters = function () { return [
{ type: _services_managers_polyline_manager__WEBPACK_IMPORTED_MODULE_1__["PolylineManager"], },
]; };
AgmPolyline.propDecorators = {
'clickable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'draggable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['polylineDraggable',] },],
'editable': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'geodesic': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'strokeColor': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'strokeOpacity': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'strokeWeight': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'visible': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'zIndex': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
'lineClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'lineDblClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'lineDrag': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'lineDragEnd': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'lineDragStart': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'lineMouseDown': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'lineMouseMove': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'lineMouseOut': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'lineMouseOver': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'lineMouseUp': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'lineRightClick': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
'points': [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [_polyline_point__WEBPACK_IMPORTED_MODULE_2__["AgmPolylinePoint"],] },],
};
//# sourceMappingURL=polyline.js.map
/***/ }),
/***/ "./node_modules/@agm/core/index.js":
/*!*****************************************!*\
!*** ./node_modules/@agm/core/index.js ***!
\*****************************************/
/*! exports provided: AgmCoreModule, AgmMap, AgmCircle, AgmInfoWindow, AgmKmlLayer, AgmDataLayer, AgmMarker, AgmPolygon, AgmPolyline, AgmPolylinePoint, GoogleMapsAPIWrapper, CircleManager, InfoWindowManager, MarkerManager, PolygonManager, PolylineManager, KmlLayerManager, DataLayerManager, GoogleMapsScriptProtocol, LAZY_MAPS_API_CONFIG, LazyMapsAPILoader, MapsAPILoader, NoOpMapsAPILoader */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _directives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./directives */ "./node_modules/@agm/core/directives.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmMap", function() { return _directives__WEBPACK_IMPORTED_MODULE_0__["AgmMap"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmCircle", function() { return _directives__WEBPACK_IMPORTED_MODULE_0__["AgmCircle"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmInfoWindow", function() { return _directives__WEBPACK_IMPORTED_MODULE_0__["AgmInfoWindow"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmKmlLayer", function() { return _directives__WEBPACK_IMPORTED_MODULE_0__["AgmKmlLayer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmDataLayer", function() { return _directives__WEBPACK_IMPORTED_MODULE_0__["AgmDataLayer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmMarker", function() { return _directives__WEBPACK_IMPORTED_MODULE_0__["AgmMarker"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmPolygon", function() { return _directives__WEBPACK_IMPORTED_MODULE_0__["AgmPolygon"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmPolyline", function() { return _directives__WEBPACK_IMPORTED_MODULE_0__["AgmPolyline"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmPolylinePoint", function() { return _directives__WEBPACK_IMPORTED_MODULE_0__["AgmPolylinePoint"]; });
/* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./services */ "./node_modules/@agm/core/services.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GoogleMapsAPIWrapper", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["GoogleMapsAPIWrapper"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CircleManager", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["CircleManager"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InfoWindowManager", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["InfoWindowManager"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkerManager", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["MarkerManager"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PolygonManager", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["PolygonManager"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PolylineManager", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["PolylineManager"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KmlLayerManager", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["KmlLayerManager"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataLayerManager", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["DataLayerManager"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GoogleMapsScriptProtocol", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["GoogleMapsScriptProtocol"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LAZY_MAPS_API_CONFIG", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["LAZY_MAPS_API_CONFIG"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LazyMapsAPILoader", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["LazyMapsAPILoader"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MapsAPILoader", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["MapsAPILoader"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NoOpMapsAPILoader", function() { return _services__WEBPACK_IMPORTED_MODULE_1__["NoOpMapsAPILoader"]; });
/* harmony import */ var _core_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./core.module */ "./node_modules/@agm/core/core.module.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgmCoreModule", function() { return _core_module__WEBPACK_IMPORTED_MODULE_2__["AgmCoreModule"]; });
// main modules
// core module
// we explicitly export the module here to prevent this Ionic 2 bug:
// http://stevemichelotti.com/integrate-angular-2-google-maps-into-ionic-2/
//# sourceMappingURL=index.js.map
/***/ }),
/***/ "./node_modules/@agm/core/services.js":
/*!********************************************!*\
!*** ./node_modules/@agm/core/services.js ***!
\********************************************/
/*! exports provided: GoogleMapsAPIWrapper, CircleManager, InfoWindowManager, MarkerManager, PolygonManager, PolylineManager, KmlLayerManager, DataLayerManager, GoogleMapsScriptProtocol, LAZY_MAPS_API_CONFIG, LazyMapsAPILoader, MapsAPILoader, NoOpMapsAPILoader */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _services_google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./services/google-maps-api-wrapper */ "./node_modules/@agm/core/services/google-maps-api-wrapper.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GoogleMapsAPIWrapper", function() { return _services_google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_0__["GoogleMapsAPIWrapper"]; });
/* harmony import */ var _services_managers_circle_manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./services/managers/circle-manager */ "./node_modules/@agm/core/services/managers/circle-manager.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CircleManager", function() { return _services_managers_circle_manager__WEBPACK_IMPORTED_MODULE_1__["CircleManager"]; });
/* harmony import */ var _services_managers_info_window_manager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/managers/info-window-manager */ "./node_modules/@agm/core/services/managers/info-window-manager.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InfoWindowManager", function() { return _services_managers_info_window_manager__WEBPACK_IMPORTED_MODULE_2__["InfoWindowManager"]; });
/* harmony import */ var _services_managers_marker_manager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/managers/marker-manager */ "./node_modules/@agm/core/services/managers/marker-manager.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkerManager", function() { return _services_managers_marker_manager__WEBPACK_IMPORTED_MODULE_3__["MarkerManager"]; });
/* harmony import */ var _services_managers_polygon_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./services/managers/polygon-manager */ "./node_modules/@agm/core/services/managers/polygon-manager.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PolygonManager", function() { return _services_managers_polygon_manager__WEBPACK_IMPORTED_MODULE_4__["PolygonManager"]; });
/* harmony import */ var _services_managers_polyline_manager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./services/managers/polyline-manager */ "./node_modules/@agm/core/services/managers/polyline-manager.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PolylineManager", function() { return _services_managers_polyline_manager__WEBPACK_IMPORTED_MODULE_5__["PolylineManager"]; });
/* harmony import */ var _services_managers_kml_layer_manager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./services/managers/kml-layer-manager */ "./node_modules/@agm/core/services/managers/kml-layer-manager.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KmlLayerManager", function() { return _services_managers_kml_layer_manager__WEBPACK_IMPORTED_MODULE_6__["KmlLayerManager"]; });
/* harmony import */ var _services_managers_data_layer_manager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./services/managers/data-layer-manager */ "./node_modules/@agm/core/services/managers/data-layer-manager.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataLayerManager", function() { return _services_managers_data_layer_manager__WEBPACK_IMPORTED_MODULE_7__["DataLayerManager"]; });
/* harmony import */ var _services_maps_api_loader_lazy_maps_api_loader__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./services/maps-api-loader/lazy-maps-api-loader */ "./node_modules/@agm/core/services/maps-api-loader/lazy-maps-api-loader.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GoogleMapsScriptProtocol", function() { return _services_maps_api_loader_lazy_maps_api_loader__WEBPACK_IMPORTED_MODULE_8__["GoogleMapsScriptProtocol"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LAZY_MAPS_API_CONFIG", function() { return _services_maps_api_loader_lazy_maps_api_loader__WEBPACK_IMPORTED_MODULE_8__["LAZY_MAPS_API_CONFIG"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LazyMapsAPILoader", function() { return _services_maps_api_loader_lazy_maps_api_loader__WEBPACK_IMPORTED_MODULE_8__["LazyMapsAPILoader"]; });
/* harmony import */ var _services_maps_api_loader_maps_api_loader__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./services/maps-api-loader/maps-api-loader */ "./node_modules/@agm/core/services/maps-api-loader/maps-api-loader.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MapsAPILoader", function() { return _services_maps_api_loader_maps_api_loader__WEBPACK_IMPORTED_MODULE_9__["MapsAPILoader"]; });
/* harmony import */ var _services_maps_api_loader_noop_maps_api_loader__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./services/maps-api-loader/noop-maps-api-loader */ "./node_modules/@agm/core/services/maps-api-loader/noop-maps-api-loader.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NoOpMapsAPILoader", function() { return _services_maps_api_loader_noop_maps_api_loader__WEBPACK_IMPORTED_MODULE_10__["NoOpMapsAPILoader"]; });
//# sourceMappingURL=services.js.map
/***/ }),
/***/ "./node_modules/@agm/core/services/google-maps-api-wrapper.js":
/*!********************************************************************!*\
!*** ./node_modules/@agm/core/services/google-maps-api-wrapper.js ***!
\********************************************************************/
/*! exports provided: GoogleMapsAPIWrapper */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GoogleMapsAPIWrapper", function() { return GoogleMapsAPIWrapper; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/Observable */ "./node_modules/rxjs-compat/_esm5/Observable.js");
/* harmony import */ var _maps_api_loader_maps_api_loader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./maps-api-loader/maps-api-loader */ "./node_modules/@agm/core/services/maps-api-loader/maps-api-loader.js");
/**
* Wrapper class that handles the communication with the Google Maps Javascript
* API v3
*/
var GoogleMapsAPIWrapper = (function () {
function GoogleMapsAPIWrapper(_loader, _zone) {
var _this = this;
this._loader = _loader;
this._zone = _zone;
this._map =
new Promise(function (resolve) { _this._mapResolver = resolve; });
}
GoogleMapsAPIWrapper.prototype.createMap = function (el, mapOptions) {
var _this = this;
return this._loader.load().then(function () {
var map = new google.maps.Map(el, mapOptions);
_this._mapResolver(map);
return;
});
};
GoogleMapsAPIWrapper.prototype.setMapOptions = function (options) {
this._map.then(function (m) { m.setOptions(options); });
};
/**
* Creates a google map marker with the map context
*/
GoogleMapsAPIWrapper.prototype.createMarker = function (options, addToMap) {
if (options === void 0) { options = {}; }
if (addToMap === void 0) { addToMap = true; }
return this._map.then(function (map) {
if (addToMap) {
options.map = map;
}
return new google.maps.Marker(options);
});
};
GoogleMapsAPIWrapper.prototype.createInfoWindow = function (options) {
return this._map.then(function () { return new google.maps.InfoWindow(options); });
};
/**
* Creates a google.map.Circle for the current map.
*/
GoogleMapsAPIWrapper.prototype.createCircle = function (options) {
return this._map.then(function (map) {
options.map = map;
return new google.maps.Circle(options);
});
};
GoogleMapsAPIWrapper.prototype.createPolyline = function (options) {
return this.getNativeMap().then(function (map) {
var line = new google.maps.Polyline(options);
line.setMap(map);
return line;
});
};
GoogleMapsAPIWrapper.prototype.createPolygon = function (options) {
return this.getNativeMap().then(function (map) {
var polygon = new google.maps.Polygon(options);
polygon.setMap(map);
return polygon;
});
};
/**
* Creates a new google.map.Data layer for the current map
*/
GoogleMapsAPIWrapper.prototype.createDataLayer = function (options) {
return this._map.then(function (m) {
var data = new google.maps.Data(options);
data.setMap(m);
return data;
});
};
/**
* Determines if given coordinates are insite a Polygon path.
*/
GoogleMapsAPIWrapper.prototype.containsLocation = function (latLng, polygon) {
return google.maps.geometry.poly.containsLocation(latLng, polygon);
};
GoogleMapsAPIWrapper.prototype.subscribeToMapEvent = function (eventName) {
var _this = this;
return rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"].create(function (observer) {
_this._map.then(function (m) {
m.addListener(eventName, function (arg) { _this._zone.run(function () { return observer.next(arg); }); });
});
});
};
GoogleMapsAPIWrapper.prototype.setCenter = function (latLng) {
return this._map.then(function (map) { return map.setCenter(latLng); });
};
GoogleMapsAPIWrapper.prototype.getZoom = function () { return this._map.then(function (map) { return map.getZoom(); }); };
GoogleMapsAPIWrapper.prototype.getBounds = function () {
return this._map.then(function (map) { return map.getBounds(); });
};
GoogleMapsAPIWrapper.prototype.setZoom = function (zoom) {
return this._map.then(function (map) { return map.setZoom(zoom); });
};
GoogleMapsAPIWrapper.prototype.getCenter = function () {
return this._map.then(function (map) { return map.getCenter(); });
};
GoogleMapsAPIWrapper.prototype.panTo = function (latLng) {
return this._map.then(function (map) { return map.panTo(latLng); });
};
GoogleMapsAPIWrapper.prototype.panBy = function (x, y) {
return this._map.then(function (map) { return map.panBy(x, y); });
};
GoogleMapsAPIWrapper.prototype.fitBounds = function (latLng) {
return this._map.then(function (map) { return map.fitBounds(latLng); });
};
GoogleMapsAPIWrapper.prototype.panToBounds = function (latLng) {
return this._map.then(function (map) { return map.panToBounds(latLng); });
};
/**
* Returns the native Google Maps Map instance. Be careful when using this instance directly.
*/
GoogleMapsAPIWrapper.prototype.getNativeMap = function () { return this._map; };
/**
* Triggers the given event name on the map instance.
*/
GoogleMapsAPIWrapper.prototype.triggerMapEvent = function (eventName) {
return this._map.then(function (m) { return google.maps.event.trigger(m, eventName); });
};
return GoogleMapsAPIWrapper;
}());
GoogleMapsAPIWrapper.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
GoogleMapsAPIWrapper.ctorParameters = function () { return [
{ type: _maps_api_loader_maps_api_loader__WEBPACK_IMPORTED_MODULE_2__["MapsAPILoader"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
]; };
//# sourceMappingURL=google-maps-api-wrapper.js.map
/***/ }),
/***/ "./node_modules/@agm/core/services/managers/circle-manager.js":
/*!********************************************************************!*\
!*** ./node_modules/@agm/core/services/managers/circle-manager.js ***!
\********************************************************************/
/*! exports provided: CircleManager */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CircleManager", function() { return CircleManager; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/Observable */ "./node_modules/rxjs-compat/_esm5/Observable.js");
/* harmony import */ var _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../google-maps-api-wrapper */ "./node_modules/@agm/core/services/google-maps-api-wrapper.js");
var CircleManager = (function () {
function CircleManager(_apiWrapper, _zone) {
this._apiWrapper = _apiWrapper;
this._zone = _zone;
this._circles = new Map();
}
CircleManager.prototype.addCircle = function (circle) {
this._circles.set(circle, this._apiWrapper.createCircle({
center: { lat: circle.latitude, lng: circle.longitude },
clickable: circle.clickable,
draggable: circle.draggable,
editable: circle.editable,
fillColor: circle.fillColor,
fillOpacity: circle.fillOpacity,
radius: circle.radius,
strokeColor: circle.strokeColor,
strokeOpacity: circle.strokeOpacity,
strokePosition: circle.strokePosition,
strokeWeight: circle.strokeWeight,
visible: circle.visible,
zIndex: circle.zIndex
}));
};
/**
* Removes the given circle from the map.
*/
CircleManager.prototype.removeCircle = function (circle) {
var _this = this;
return this._circles.get(circle).then(function (c) {
c.setMap(null);
_this._circles.delete(circle);
});
};
CircleManager.prototype.setOptions = function (circle, options) {
return this._circles.get(circle).then(function (c) { return c.setOptions(options); });
};
CircleManager.prototype.getBounds = function (circle) {
return this._circles.get(circle).then(function (c) { return c.getBounds(); });
};
CircleManager.prototype.getCenter = function (circle) {
return this._circles.get(circle).then(function (c) { return c.getCenter(); });
};
CircleManager.prototype.getRadius = function (circle) {
return this._circles.get(circle).then(function (c) { return c.getRadius(); });
};
CircleManager.prototype.setCenter = function (circle) {
return this._circles.get(circle).then(function (c) { return c.setCenter({ lat: circle.latitude, lng: circle.longitude }); });
};
CircleManager.prototype.setEditable = function (circle) {
return this._circles.get(circle).then(function (c) { return c.setEditable(circle.editable); });
};
CircleManager.prototype.setDraggable = function (circle) {
return this._circles.get(circle).then(function (c) { return c.setDraggable(circle.draggable); });
};
CircleManager.prototype.setVisible = function (circle) {
return this._circles.get(circle).then(function (c) { return c.setVisible(circle.visible); });
};
CircleManager.prototype.setRadius = function (circle) {
return this._circles.get(circle).then(function (c) { return c.setRadius(circle.radius); });
};
CircleManager.prototype.createEventObservable = function (eventName, circle) {
var _this = this;
return rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"].create(function (observer) {
var listener = null;
_this._circles.get(circle).then(function (c) {
listener = c.addListener(eventName, function (e) { return _this._zone.run(function () { return observer.next(e); }); });
});
return function () {
if (listener !== null) {
listener.remove();
}
};
});
};
return CircleManager;
}());
CircleManager.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
CircleManager.ctorParameters = function () { return [
{ type: _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__["GoogleMapsAPIWrapper"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
]; };
//# sourceMappingURL=circle-manager.js.map
/***/ }),
/***/ "./node_modules/@agm/core/services/managers/data-layer-manager.js":
/*!************************************************************************!*\
!*** ./node_modules/@agm/core/services/managers/data-layer-manager.js ***!
\************************************************************************/
/*! exports provided: DataLayerManager */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataLayerManager", function() { return DataLayerManager; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/Observable */ "./node_modules/rxjs-compat/_esm5/Observable.js");
/* harmony import */ var _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../google-maps-api-wrapper */ "./node_modules/@agm/core/services/google-maps-api-wrapper.js");
/**
* Manages all Data Layers for a Google Map instance.
*/
var DataLayerManager = (function () {
function DataLayerManager(_wrapper, _zone) {
this._wrapper = _wrapper;
this._zone = _zone;
this._layers = new Map();
}
/**
* Adds a new Data Layer to the map.
*/
DataLayerManager.prototype.addDataLayer = function (layer) {
var _this = this;
var newLayer = this._wrapper.createDataLayer({
style: layer.style
})
.then(function (d) {
if (layer.geoJson) {
_this.getDataFeatures(d, layer.geoJson).then(function (features) { return d.features = features; });
}
return d;
});
this._layers.set(layer, newLayer);
};
DataLayerManager.prototype.deleteDataLayer = function (layer) {
var _this = this;
this._layers.get(layer).then(function (l) {
l.setMap(null);
_this._layers.delete(layer);
});
};
DataLayerManager.prototype.updateGeoJson = function (layer, geoJson) {
var _this = this;
this._layers.get(layer).then(function (l) {
l.forEach(function (feature) {
l.remove(feature);
var index = l.features.indexOf(feature, 0);
if (index > -1) {
l.features.splice(index, 1);
}
});
_this.getDataFeatures(l, geoJson).then(function (features) { return l.features = features; });
});
};
DataLayerManager.prototype.setDataOptions = function (layer, options) {
this._layers.get(layer).then(function (l) {
l.setControlPosition(options.controlPosition);
l.setControls(options.controls);
l.setDrawingMode(options.drawingMode);
l.setStyle(options.style);
});
};
/**
* Creates a Google Maps event listener for the given DataLayer as an Observable
*/
DataLayerManager.prototype.createEventObservable = function (eventName, layer) {
var _this = this;
return rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"].create(function (observer) {
_this._layers.get(layer).then(function (d) {
d.addListener(eventName, function (e) { return _this._zone.run(function () { return observer.next(e); }); });
});
});
};
/**
* Extract features from a geoJson using google.maps Data Class
* @param d : google.maps.Data class instance
* @param geoJson : url or geojson object
*/
DataLayerManager.prototype.getDataFeatures = function (d, geoJson) {
return new Promise(function (resolve, reject) {
if (typeof geoJson === 'object') {
try {
var features = d.addGeoJson(geoJson);
resolve(features);
}
catch (e) {
reject(e);
}
}
else if (typeof geoJson === 'string') {
d.loadGeoJson(geoJson, null, resolve);
}
else {
reject("Impossible to extract features from geoJson: wrong argument type");
}
});
};
return DataLayerManager;
}());
DataLayerManager.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
DataLayerManager.ctorParameters = function () { return [
{ type: _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__["GoogleMapsAPIWrapper"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
]; };
//# sourceMappingURL=data-layer-manager.js.map
/***/ }),
/***/ "./node_modules/@agm/core/services/managers/info-window-manager.js":
/*!*************************************************************************!*\
!*** ./node_modules/@agm/core/services/managers/info-window-manager.js ***!
\*************************************************************************/
/*! exports provided: InfoWindowManager */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InfoWindowManager", function() { return InfoWindowManager; });
/* harmony import */ var rxjs_Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs/Observable */ "./node_modules/rxjs-compat/_esm5/Observable.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../google-maps-api-wrapper */ "./node_modules/@agm/core/services/google-maps-api-wrapper.js");
/* harmony import */ var _marker_manager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./marker-manager */ "./node_modules/@agm/core/services/managers/marker-manager.js");
var InfoWindowManager = (function () {
function InfoWindowManager(_mapsWrapper, _zone, _markerManager) {
this._mapsWrapper = _mapsWrapper;
this._zone = _zone;
this._markerManager = _markerManager;
this._infoWindows = new Map();
}
InfoWindowManager.prototype.deleteInfoWindow = function (infoWindow) {
var _this = this;
var iWindow = this._infoWindows.get(infoWindow);
if (iWindow == null) {
// info window already deleted
return Promise.resolve();
}
return iWindow.then(function (i) {
return _this._zone.run(function () {
i.close();
_this._infoWindows.delete(infoWindow);
});
});
};
InfoWindowManager.prototype.setPosition = function (infoWindow) {
return this._infoWindows.get(infoWindow).then(function (i) { return i.setPosition({
lat: infoWindow.latitude,
lng: infoWindow.longitude
}); });
};
InfoWindowManager.prototype.setZIndex = function (infoWindow) {
return this._infoWindows.get(infoWindow)
.then(function (i) { return i.setZIndex(infoWindow.zIndex); });
};
InfoWindowManager.prototype.open = function (infoWindow) {
var _this = this;
return this._infoWindows.get(infoWindow).then(function (w) {
if (infoWindow.hostMarker != null) {
return _this._markerManager.getNativeMarker(infoWindow.hostMarker).then(function (marker) {
return _this._mapsWrapper.getNativeMap().then(function (map) { return w.open(map, marker); });
});
}
return _this._mapsWrapper.getNativeMap().then(function (map) { return w.open(map); });
});
};
InfoWindowManager.prototype.close = function (infoWindow) {
return this._infoWindows.get(infoWindow).then(function (w) { return w.close(); });
};
InfoWindowManager.prototype.setOptions = function (infoWindow, options) {
return this._infoWindows.get(infoWindow).then(function (i) { return i.setOptions(options); });
};
InfoWindowManager.prototype.addInfoWindow = function (infoWindow) {
var options = {
content: infoWindow.content,
maxWidth: infoWindow.maxWidth,
zIndex: infoWindow.zIndex,
disableAutoPan: infoWindow.disableAutoPan
};
if (typeof infoWindow.latitude === 'number' && typeof infoWindow.longitude === 'number') {
options.position = { lat: infoWindow.latitude, lng: infoWindow.longitude };
}
var infoWindowPromise = this._mapsWrapper.createInfoWindow(options);
this._infoWindows.set(infoWindow, infoWindowPromise);
};
/**
* Creates a Google Maps event listener for the given InfoWindow as an Observable
*/
InfoWindowManager.prototype.createEventObservable = function (eventName, infoWindow) {
var _this = this;
return rxjs_Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"].create(function (observer) {
_this._infoWindows.get(infoWindow).then(function (i) {
i.addListener(eventName, function (e) { return _this._zone.run(function () { return observer.next(e); }); });
});
});
};
return InfoWindowManager;
}());
InfoWindowManager.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] },
];
/** @nocollapse */
InfoWindowManager.ctorParameters = function () { return [
{ type: _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__["GoogleMapsAPIWrapper"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], },
{ type: _marker_manager__WEBPACK_IMPORTED_MODULE_3__["MarkerManager"], },
]; };
//# sourceMappingURL=info-window-manager.js.map
/***/ }),
/***/ "./node_modules/@agm/core/services/managers/kml-layer-manager.js":
/*!***********************************************************************!*\
!*** ./node_modules/@agm/core/services/managers/kml-layer-manager.js ***!
\***********************************************************************/
/*! exports provided: KmlLayerManager */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KmlLayerManager", function() { return KmlLayerManager; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/Observable */ "./node_modules/rxjs-compat/_esm5/Observable.js");
/* harmony import */ var _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../google-maps-api-wrapper */ "./node_modules/@agm/core/services/google-maps-api-wrapper.js");
/**
* Manages all KML Layers for a Google Map instance.
*/
var KmlLayerManager = (function () {
function KmlLayerManager(_wrapper, _zone) {
this._wrapper = _wrapper;
this._zone = _zone;
this._layers = new Map();
}
/**
* Adds a new KML Layer to the map.
*/
KmlLayerManager.prototype.addKmlLayer = function (layer) {
var newLayer = this._wrapper.getNativeMap().then(function (m) {
return new google.maps.KmlLayer({
clickable: layer.clickable,
map: m,
preserveViewport: layer.preserveViewport,
screenOverlays: layer.screenOverlays,
suppressInfoWindows: layer.suppressInfoWindows,
url: layer.url,
zIndex: layer.zIndex
});
});
this._layers.set(layer, newLayer);
};
KmlLayerManager.prototype.setOptions = function (layer, options) {
this._layers.get(layer).then(function (l) { return l.setOptions(options); });
};
KmlLayerManager.prototype.deleteKmlLayer = function (layer) {
var _this = this;
this._layers.get(layer).then(function (l) {
l.setMap(null);
_this._layers.delete(layer);
});
};
/**
* Creates a Google Maps event listener for the given KmlLayer as an Observable
*/
KmlLayerManager.prototype.createEventObservable = function (eventName, layer) {
var _this = this;
return rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"].create(function (observer) {
_this._layers.get(layer).then(function (m) {
m.addListener(eventName, function (e) { return _this._zone.run(function () { return observer.next(e); }); });
});
});
};
return KmlLayerManager;
}());
KmlLayerManager.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
KmlLayerManager.ctorParameters = function () { return [
{ type: _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__["GoogleMapsAPIWrapper"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
]; };
//# sourceMappingURL=kml-layer-manager.js.map
/***/ }),
/***/ "./node_modules/@agm/core/services/managers/marker-manager.js":
/*!********************************************************************!*\
!*** ./node_modules/@agm/core/services/managers/marker-manager.js ***!
\********************************************************************/
/*! exports provided: MarkerManager */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerManager", function() { return MarkerManager; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/Observable */ "./node_modules/rxjs-compat/_esm5/Observable.js");
/* harmony import */ var _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../google-maps-api-wrapper */ "./node_modules/@agm/core/services/google-maps-api-wrapper.js");
var MarkerManager = (function () {
function MarkerManager(_mapsWrapper, _zone) {
this._mapsWrapper = _mapsWrapper;
this._zone = _zone;
this._markers = new Map();
}
MarkerManager.prototype.deleteMarker = function (marker) {
var _this = this;
var m = this._markers.get(marker);
if (m == null) {
// marker already deleted
return Promise.resolve();
}
return m.then(function (m) {
return _this._zone.run(function () {
m.setMap(null);
_this._markers.delete(marker);
});
});
};
MarkerManager.prototype.updateMarkerPosition = function (marker) {
return this._markers.get(marker).then(function (m) { return m.setPosition({ lat: marker.latitude, lng: marker.longitude }); });
};
MarkerManager.prototype.updateTitle = function (marker) {
return this._markers.get(marker).then(function (m) { return m.setTitle(marker.title); });
};
MarkerManager.prototype.updateLabel = function (marker) {
return this._markers.get(marker).then(function (m) { m.setLabel(marker.label); });
};
MarkerManager.prototype.updateDraggable = function (marker) {
return this._markers.get(marker).then(function (m) { return m.setDraggable(marker.draggable); });
};
MarkerManager.prototype.updateIcon = function (marker) {
return this._markers.get(marker).then(function (m) { return m.setIcon(marker.iconUrl); });
};
MarkerManager.prototype.updateOpacity = function (marker) {
return this._markers.get(marker).then(function (m) { return m.setOpacity(marker.opacity); });
};
MarkerManager.prototype.updateVisible = function (marker) {
return this._markers.get(marker).then(function (m) { return m.setVisible(marker.visible); });
};
MarkerManager.prototype.updateZIndex = function (marker) {
return this._markers.get(marker).then(function (m) { return m.setZIndex(marker.zIndex); });
};
MarkerManager.prototype.updateClickable = function (marker) {
return this._markers.get(marker).then(function (m) { return m.setClickable(marker.clickable); });
};
MarkerManager.prototype.addMarker = function (marker) {
var markerPromise = this._mapsWrapper.createMarker({
position: { lat: marker.latitude, lng: marker.longitude },
label: marker.label,
draggable: marker.draggable,
icon: marker.iconUrl,
opacity: marker.opacity,
visible: marker.visible,
zIndex: marker.zIndex,
title: marker.title,
clickable: marker.clickable
});
this._markers.set(marker, markerPromise);
};
MarkerManager.prototype.getNativeMarker = function (marker) {
return this._markers.get(marker);
};
MarkerManager.prototype.createEventObservable = function (eventName, marker) {
var _this = this;
return rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"].create(function (observer) {
_this._markers.get(marker).then(function (m) {
m.addListener(eventName, function (e) { return _this._zone.run(function () { return observer.next(e); }); });
});
});
};
return MarkerManager;
}());
MarkerManager.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
MarkerManager.ctorParameters = function () { return [
{ type: _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__["GoogleMapsAPIWrapper"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
]; };
//# sourceMappingURL=marker-manager.js.map
/***/ }),
/***/ "./node_modules/@agm/core/services/managers/polygon-manager.js":
/*!*********************************************************************!*\
!*** ./node_modules/@agm/core/services/managers/polygon-manager.js ***!
\*********************************************************************/
/*! exports provided: PolygonManager */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PolygonManager", function() { return PolygonManager; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/Observable */ "./node_modules/rxjs-compat/_esm5/Observable.js");
/* harmony import */ var _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../google-maps-api-wrapper */ "./node_modules/@agm/core/services/google-maps-api-wrapper.js");
var PolygonManager = (function () {
function PolygonManager(_mapsWrapper, _zone) {
this._mapsWrapper = _mapsWrapper;
this._zone = _zone;
this._polygons = new Map();
}
PolygonManager.prototype.addPolygon = function (path) {
var polygonPromise = this._mapsWrapper.createPolygon({
clickable: path.clickable,
draggable: path.draggable,
editable: path.editable,
fillColor: path.fillColor,
fillOpacity: path.fillOpacity,
geodesic: path.geodesic,
paths: path.paths,
strokeColor: path.strokeColor,
strokeOpacity: path.strokeOpacity,
strokeWeight: path.strokeWeight,
visible: path.visible,
zIndex: path.zIndex,
});
this._polygons.set(path, polygonPromise);
};
PolygonManager.prototype.updatePolygon = function (polygon) {
var _this = this;
var m = this._polygons.get(polygon);
if (m == null) {
return Promise.resolve();
}
return m.then(function (l) { return _this._zone.run(function () { l.setPaths(polygon.paths); }); });
};
PolygonManager.prototype.setPolygonOptions = function (path, options) {
return this._polygons.get(path).then(function (l) { l.setOptions(options); });
};
PolygonManager.prototype.deletePolygon = function (paths) {
var _this = this;
var m = this._polygons.get(paths);
if (m == null) {
return Promise.resolve();
}
return m.then(function (l) {
return _this._zone.run(function () {
l.setMap(null);
_this._polygons.delete(paths);
});
});
};
PolygonManager.prototype.createEventObservable = function (eventName, path) {
var _this = this;
return rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"].create(function (observer) {
_this._polygons.get(path).then(function (l) {
l.addListener(eventName, function (e) { return _this._zone.run(function () { return observer.next(e); }); });
});
});
};
return PolygonManager;
}());
PolygonManager.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
PolygonManager.ctorParameters = function () { return [
{ type: _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__["GoogleMapsAPIWrapper"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
]; };
//# sourceMappingURL=polygon-manager.js.map
/***/ }),
/***/ "./node_modules/@agm/core/services/managers/polyline-manager.js":
/*!**********************************************************************!*\
!*** ./node_modules/@agm/core/services/managers/polyline-manager.js ***!
\**********************************************************************/
/*! exports provided: PolylineManager */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PolylineManager", function() { return PolylineManager; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/Observable */ "./node_modules/rxjs-compat/_esm5/Observable.js");
/* harmony import */ var _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../google-maps-api-wrapper */ "./node_modules/@agm/core/services/google-maps-api-wrapper.js");
var PolylineManager = (function () {
function PolylineManager(_mapsWrapper, _zone) {
this._mapsWrapper = _mapsWrapper;
this._zone = _zone;
this._polylines = new Map();
}
PolylineManager._convertPoints = function (line) {
var path = line._getPoints().map(function (point) {
return { lat: point.latitude, lng: point.longitude };
});
return path;
};
PolylineManager.prototype.addPolyline = function (line) {
var path = PolylineManager._convertPoints(line);
var polylinePromise = this._mapsWrapper.createPolyline({
clickable: line.clickable,
draggable: line.draggable,
editable: line.editable,
geodesic: line.geodesic,
strokeColor: line.strokeColor,
strokeOpacity: line.strokeOpacity,
strokeWeight: line.strokeWeight,
visible: line.visible,
zIndex: line.zIndex,
path: path
});
this._polylines.set(line, polylinePromise);
};
PolylineManager.prototype.updatePolylinePoints = function (line) {
var _this = this;
var path = PolylineManager._convertPoints(line);
var m = this._polylines.get(line);
if (m == null) {
return Promise.resolve();
}
return m.then(function (l) { return _this._zone.run(function () { l.setPath(path); }); });
};
PolylineManager.prototype.setPolylineOptions = function (line, options) {
return this._polylines.get(line).then(function (l) { l.setOptions(options); });
};
PolylineManager.prototype.deletePolyline = function (line) {
var _this = this;
var m = this._polylines.get(line);
if (m == null) {
return Promise.resolve();
}
return m.then(function (l) {
return _this._zone.run(function () {
l.setMap(null);
_this._polylines.delete(line);
});
});
};
PolylineManager.prototype.createEventObservable = function (eventName, line) {
var _this = this;
return rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"].create(function (observer) {
_this._polylines.get(line).then(function (l) {
l.addListener(eventName, function (e) { return _this._zone.run(function () { return observer.next(e); }); });
});
});
};
return PolylineManager;
}());
PolylineManager.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
PolylineManager.ctorParameters = function () { return [
{ type: _google_maps_api_wrapper__WEBPACK_IMPORTED_MODULE_2__["GoogleMapsAPIWrapper"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
]; };
//# sourceMappingURL=polyline-manager.js.map
/***/ }),
/***/ "./node_modules/@agm/core/services/maps-api-loader/lazy-maps-api-loader.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@agm/core/services/maps-api-loader/lazy-maps-api-loader.js ***!
\*********************************************************************************/
/*! exports provided: GoogleMapsScriptProtocol, LAZY_MAPS_API_CONFIG, LazyMapsAPILoader */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GoogleMapsScriptProtocol", function() { return GoogleMapsScriptProtocol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LAZY_MAPS_API_CONFIG", function() { return LAZY_MAPS_API_CONFIG; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LazyMapsAPILoader", function() { return LazyMapsAPILoader; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _utils_browser_globals__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/browser-globals */ "./node_modules/@agm/core/utils/browser-globals.js");
/* harmony import */ var _maps_api_loader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./maps-api-loader */ "./node_modules/@agm/core/services/maps-api-loader/maps-api-loader.js");
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var GoogleMapsScriptProtocol;
(function (GoogleMapsScriptProtocol) {
GoogleMapsScriptProtocol[GoogleMapsScriptProtocol["HTTP"] = 1] = "HTTP";
GoogleMapsScriptProtocol[GoogleMapsScriptProtocol["HTTPS"] = 2] = "HTTPS";
GoogleMapsScriptProtocol[GoogleMapsScriptProtocol["AUTO"] = 3] = "AUTO";
})(GoogleMapsScriptProtocol || (GoogleMapsScriptProtocol = {}));
/**
* Token for the config of the LazyMapsAPILoader. Please provide an object of type {@link
* LazyMapsAPILoaderConfig}.
*/
var LAZY_MAPS_API_CONFIG = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('angular-google-maps LAZY_MAPS_API_CONFIG');
var LazyMapsAPILoader = (function (_super) {
__extends(LazyMapsAPILoader, _super);
function LazyMapsAPILoader(config, w, d) {
var _this = _super.call(this) || this;
_this._config = config || {};
_this._windowRef = w;
_this._documentRef = d;
return _this;
}
LazyMapsAPILoader.prototype.load = function () {
var _this = this;
if (this._scriptLoadingPromise) {
return this._scriptLoadingPromise;
}
var script = this._documentRef.getNativeDocument().createElement('script');
script.type = 'text/javascript';
script.async = true;
script.defer = true;
var callbackName = "angular2GoogleMapsLazyMapsAPILoader";
script.src = this._getScriptSrc(callbackName);
this._scriptLoadingPromise = new Promise(function (resolve, reject) {
_this._windowRef.getNativeWindow()[callbackName] = function () {
resolve();
};
script.onerror = function (error) {
reject(error);
};
});
this._documentRef.getNativeDocument().body.appendChild(script);
return this._scriptLoadingPromise;
};
LazyMapsAPILoader.prototype._getScriptSrc = function (callbackName) {
var protocolType = (this._config && this._config.protocol) || GoogleMapsScriptProtocol.HTTPS;
var protocol;
switch (protocolType) {
case GoogleMapsScriptProtocol.AUTO:
protocol = '';
break;
case GoogleMapsScriptProtocol.HTTP:
protocol = 'http:';
break;
case GoogleMapsScriptProtocol.HTTPS:
protocol = 'https:';
break;
}
var hostAndPath = this._config.hostAndPath || 'maps.googleapis.com/maps/api/js';
var queryParams = {
v: this._config.apiVersion || '3',
callback: callbackName,
key: this._config.apiKey,
client: this._config.clientId,
channel: this._config.channel,
libraries: this._config.libraries,
region: this._config.region,
language: this._config.language
};
var params = Object.keys(queryParams)
.filter(function (k) { return queryParams[k] != null; })
.filter(function (k) {
// remove empty arrays
return !Array.isArray(queryParams[k]) ||
(Array.isArray(queryParams[k]) && queryParams[k].length > 0);
})
.map(function (k) {
// join arrays as comma seperated strings
var i = queryParams[k];
if (Array.isArray(i)) {
return { key: k, value: i.join(',') };
}
return { key: k, value: queryParams[k] };
})
.map(function (entry) {
return entry.key + "=" + entry.value;
})
.join('&');
return protocol + "//" + hostAndPath + "?" + params;
};
return LazyMapsAPILoader;
}(_maps_api_loader__WEBPACK_IMPORTED_MODULE_2__["MapsAPILoader"]));
LazyMapsAPILoader.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
LazyMapsAPILoader.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [LAZY_MAPS_API_CONFIG,] },] },
{ type: _utils_browser_globals__WEBPACK_IMPORTED_MODULE_1__["WindowRef"], },
{ type: _utils_browser_globals__WEBPACK_IMPORTED_MODULE_1__["DocumentRef"], },
]; };
//# sourceMappingURL=lazy-maps-api-loader.js.map
/***/ }),
/***/ "./node_modules/@agm/core/services/maps-api-loader/maps-api-loader.js":
/*!****************************************************************************!*\
!*** ./node_modules/@agm/core/services/maps-api-loader/maps-api-loader.js ***!
\****************************************************************************/
/*! exports provided: MapsAPILoader */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MapsAPILoader", function() { return MapsAPILoader; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
var MapsAPILoader = (function () {
function MapsAPILoader() {
}
return MapsAPILoader;
}());
MapsAPILoader.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
MapsAPILoader.ctorParameters = function () { return []; };
//# sourceMappingURL=maps-api-loader.js.map
/***/ }),
/***/ "./node_modules/@agm/core/services/maps-api-loader/noop-maps-api-loader.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@agm/core/services/maps-api-loader/noop-maps-api-loader.js ***!
\*********************************************************************************/
/*! exports provided: NoOpMapsAPILoader */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoOpMapsAPILoader", function() { return NoOpMapsAPILoader; });
/**
* When using the NoOpMapsAPILoader, the Google Maps API must be added to the page via a `<script>`
* Tag.
* It's important that the Google Maps API script gets loaded first on the page.
*/
var NoOpMapsAPILoader = (function () {
function NoOpMapsAPILoader() {
}
NoOpMapsAPILoader.prototype.load = function () {
if (!window.google || !window.google.maps) {
throw new Error('Google Maps API not loaded on page. Make sure window.google.maps is available!');
}
return Promise.resolve();
};
return NoOpMapsAPILoader;
}());
//# sourceMappingURL=noop-maps-api-loader.js.map
/***/ }),
/***/ "./node_modules/@agm/core/utils/browser-globals.js":
/*!*********************************************************!*\
!*** ./node_modules/@agm/core/utils/browser-globals.js ***!
\*********************************************************/
/*! exports provided: WindowRef, DocumentRef, BROWSER_GLOBALS_PROVIDERS */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WindowRef", function() { return WindowRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentRef", function() { return DocumentRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BROWSER_GLOBALS_PROVIDERS", function() { return BROWSER_GLOBALS_PROVIDERS; });
var WindowRef = (function () {
function WindowRef() {
}
WindowRef.prototype.getNativeWindow = function () { return window; };
return WindowRef;
}());
var DocumentRef = (function () {
function DocumentRef() {
}
DocumentRef.prototype.getNativeDocument = function () { return document; };
return DocumentRef;
}());
var BROWSER_GLOBALS_PROVIDERS = [WindowRef, DocumentRef];
//# sourceMappingURL=browser-globals.js.map
/***/ }),
/***/ "./node_modules/@angular/animations/fesm5/animations.js":
/*!**************************************************************!*\
!*** ./node_modules/@angular/animations/fesm5/animations.js ***!
\**************************************************************/
/*! exports provided: AnimationBuilder, AnimationFactory, AUTO_STYLE, animate, animateChild, animation, group, keyframes, query, sequence, stagger, state, style, transition, trigger, useAnimation, NoopAnimationPlayer, ɵPRE_STYLE, ɵAnimationGroupPlayer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationBuilder", function() { return AnimationBuilder; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFactory", function() { return AnimationFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AUTO_STYLE", function() { return AUTO_STYLE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "animate", function() { return animate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "animateChild", function() { return animateChild; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "animation", function() { return animation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "group", function() { return group; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyframes", function() { return keyframes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "query", function() { return query; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sequence", function() { return sequence; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stagger", function() { return stagger; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "state", function() { return state; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "style", function() { return style; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transition", function() { return transition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trigger", function() { return trigger; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useAnimation", function() { return useAnimation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoopAnimationPlayer", function() { return NoopAnimationPlayer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPRE_STYLE", function() { return ɵPRE_STYLE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵAnimationGroupPlayer", function() { return AnimationGroupPlayer; });
/**
* @license Angular v6.0.9
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
/**
* AnimationBuilder is an injectable service that is available when the {@link
* BrowserAnimationsModule BrowserAnimationsModule} or {@link NoopAnimationsModule
* NoopAnimationsModule} modules are used within an application.
*
* The purpose if this service is to produce an animation sequence programmatically within an
* angular component or directive.
*
* Programmatic animations are first built and then a player is created when the build animation is
* attached to an element.
*
* ```ts
* // remember to include the BrowserAnimationsModule module for this to work...
* import {AnimationBuilder} from '@angular/animations';
*
* class MyCmp {
* constructor(private _builder: AnimationBuilder) {}
*
* makeAnimation(element: any) {
* // first build the animation
* const myAnimation = this._builder.build([
* style({ width: 0 }),
* animate(1000, style({ width: '100px' }))
* ]);
*
* // then create a player from it
* const player = myAnimation.create(element);
*
* player.play();
* }
* }
* ```
*
* When an animation is built an instance of {@link AnimationFactory AnimationFactory} will be
* returned. Using that an {@link AnimationPlayer AnimationPlayer} can be created which can then be
* used to start the animation.
*
* @experimental Animation support is experimental.
*/
var AnimationBuilder = /** @class */ (function () {
function AnimationBuilder() {
}
return AnimationBuilder;
}());
/**
* An instance of `AnimationFactory` is returned from {@link AnimationBuilder#build
* AnimationBuilder.build}.
*
* @experimental Animation support is experimental.
*/
var AnimationFactory = /** @class */ (function () {
function AnimationFactory() {
}
return AnimationFactory;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Specifies automatic styling.
*/
var AUTO_STYLE = '*';
/**
* Creates a named animation trigger, containing a list of `state()`
* and `transition()` entries to be evaluated when the expression
* bound to the trigger changes.
*
* @param name An identifying string.
* @param definitions An animation definition object, containing an array of `state()`
* and `transition()` declarations.
*
* @return An object that encapsulates the trigger data.
*
* @usageNotes
* Define an animation trigger in the `animations` section of `@Component` metadata.
* In the template, reference the trigger by name and bind it to a trigger expression that
* evaluates to a defined animation state, using the following format:
*
* `[@triggerName]="expression"`
*
* Animation trigger bindings convert all values to strings, and then match the
* previous and current values against any linked transitions.
* Booleans can be specified as `1` or `true` and `0` or `false`.
*
* ### Usage Example
*
* The following example creates an animation trigger reference based on the provided
* name value.
* The provided animation value is expected to be an array consisting of state and
* transition declarations.
*
* ```typescript
* @Component({
* selector: "my-component",
* templateUrl: "my-component-tpl.html",
* animations: [
* trigger("myAnimationTrigger", [
* state(...),
* state(...),
* transition(...),
* transition(...)
* ])
* ]
* })
* class MyComponent {
* myStatusExp = "something";
* }
* ```
*
* The template associated with this component makes use of the defined trigger
* by binding to an element within its template code.
*
* ```html
* <!-- somewhere inside of my-component-tpl.html -->
* <div [@myAnimationTrigger]="myStatusExp">...</div>
* ```
*
* ### Using an inline function
* The `transition` animation method also supports reading an inline function which can decide
* if its associated animation should be run.
*
* ```typescript
* // this method is run each time the `myAnimationTrigger` trigger value changes.
* function myInlineMatcherFn(fromState: string, toState: string, element: any, params: {[key:
string]: any}): boolean {
* // notice that `element` and `params` are also available here
* return toState == 'yes-please-animate';
* }
*
* @Component({
* selector: 'my-component',
* templateUrl: 'my-component-tpl.html',
* animations: [
* trigger('myAnimationTrigger', [
* transition(myInlineMatcherFn, [
* // the animation sequence code
* ]),
* ])
* ]
* })
* class MyComponent {
* myStatusExp = "yes-please-animate";
* }
* ```
*
* ### Disabling Animations
* When true, the special animation control binding `@.disabled` binding prevents
* all animations from rendering.
* Place the `@.disabled` binding on an element to disable
* animations on the element itself, as well as any inner animation triggers
* within the element.
*
* The following example shows how to use this feature:
*
* ```typescript
* @Component({
* selector: 'my-component',
* template: `
* <div [@.disabled]="isDisabled">
* <div [@childAnimation]="exp"></div>
* </div>
* `,
* animations: [
* trigger("childAnimation", [
* // ...
* ])
* ]
* })
* class MyComponent {
* isDisabled = true;
* exp = '...';
* }
* ```
*
* When `@.disabled` is true, it prevents the `@childAnimation` trigger from animating,
* along with any inner animations.
*
* ### Disable animations application-wide
* When an area of the template is set to have animations disabled,
* **all** inner components have their animations disabled as well.
* This means that you can disable all animations for an app
* by placing a host binding set on `@.disabled` on the topmost Angular component.
*
* ```typescript
* import {Component, HostBinding} from '@angular/core';
*
* @Component({
* selector: 'app-component',
* templateUrl: 'app.component.html',
* })
* class AppComponent {
* @HostBinding('@.disabled')
* public animationsDisabled = true;
* }
* ```
*
* ### Overriding disablement of inner animations
* Despite inner animations being disabled, a parent animation can `query()`
* for inner elements located in disabled areas of the template and still animate
* them if needed. This is also the case for when a sub animation is
* queried by a parent and then later animated using `animateChild()`.
*
* ### Detecting when an animation is disabled
* If a region of the DOM (or the entire application) has its animations disabled, the animation
* trigger callbacks still fire, but for zero seconds. When the callback fires, it provides
* an instance of an `AnimationEvent`. If animations are disabled,
* the `.disabled` flag on the event is true.
*
* @experimental Animation support is experimental.
*/
function trigger(name, definitions) {
return { type: 7 /* Trigger */, name: name, definitions: definitions, options: {} };
}
/**
* Defines an animation step that combines styling information with timing information.
*
* @param timings Sets `AnimateTimings` for the parent animation.
* A string in the format "duration [delay] [easing]".
* - Duration and delay are expressed as a number and optional time unit,
* such as "1s" or "10ms" for one second and 10 milliseconds, respectively.
* The default unit is milliseconds.
* - The easing value controls how the animation accelerates and decelerates
* during its runtime. Value is one of `ease`, `ease-in`, `ease-out`,
* `ease-in-out`, or a `cubic-bezier()` function call.
* If not supplied, no easing is applied.
*
* For example, the string "1s 100ms ease-out" specifies a duration of
* 1000 milliseconds, and delay of 100 ms, and the "ease-out" easing style,
* which decelerates near the end of the duration.
* @param styles Sets AnimationStyles for the parent animation.
* A function call to either `style()` or `keyframes()`
* that returns a collection of CSS style entries to be applied to the parent animation.
* When null, uses the styles from the destination state.
* This is useful when describing an animation step that will complete an animation;
* see "Animating to the final state" in `transitions()`.
* @returns An object that encapsulates the animation step.
*
* @usageNotes
* Call within an animation `sequence()`, `{@link animations/group group()}`, or
* `transition()` call to specify an animation step
* that applies given style data to the parent animation for a given amount of time.
*
* ### Syntax Examples
* **Timing examples**
*
* The following examples show various `timings` specifications.
* - `animate(500)` : Duration is 500 milliseconds.
* - `animate("1s")` : Duration is 1000 milliseconds.
* - `animate("100ms 0.5s")` : Duration is 100 milliseconds, delay is 500 milliseconds.
* - `animate("5s ease-in")` : Duration is 5000 milliseconds, easing in.
* - `animate("5s 10ms cubic-bezier(.17,.67,.88,.1)")` : Duration is 5000 milliseconds, delay is 10
* milliseconds, easing according to a bezier curve.
*
* **Style examples**
*
* The following example calls `style()` to set a single CSS style.
* ```typescript
* animate(500, style({ background: "red" }))
* ```
* The following example calls `keyframes()` to set a CSS style
* to different values for successive keyframes.
* ```typescript
* animate(500, keyframes(
* [
* style({ background: "blue" })),
* style({ background: "red" }))
* ])
* ```
*/
function animate(timings, styles) {
if (styles === void 0) { styles = null; }
return { type: 4 /* Animate */, styles: styles, timings: timings };
}
/**
* @description Defines a list of animation steps to be run in parallel.
*
* @param steps An array of animation step objects.
* - When steps are defined by `style()` or `animate()`
* function calls, each call within the group is executed instantly.
* - To specify offset styles to be applied at a later time, define steps with
* `keyframes()`, or use `animate()` calls with a delay value.
* For example:
*
* ```typescript
* group([
* animate("1s", { background: "black" }))
* animate("2s", { color: "white" }))
* ])
* ```
*
* @param options An options object containing a delay and
* developer-defined parameters that provide styling defaults and
* can be overridden on invocation.
*
* @return An object that encapsulates the group data.
*
* @usageNotes
* Grouped animations are useful when a series of styles must be
* animated at different starting times and closed off at different ending times.
*
* When called within a `sequence()` or a
* `transition()` call, does not continue to the next
* instruction until all of the inner animation steps have completed.
*/
function group(steps, options) {
if (options === void 0) { options = null; }
return { type: 3 /* Group */, steps: steps, options: options };
}
/**
* Defines a list of animation steps to be run sequentially, one by one.
*
* @param steps An array of animation step objects.
* - Steps defined by `style()` calls apply the styling data immediately.
* - Steps defined by `animate()` calls apply the styling data over time
* as specified by the timing data.
*
* ```typescript
* sequence([
* style({ opacity: 0 })),
* animate("1s", { opacity: 1 }))
* ])
* ```
*
* @param options An options object containing a delay and
* developer-defined parameters that provide styling defaults and
* can be overridden on invocation.
*
* @return An object that encapsulates the sequence data.
*
* @usageNotes
* When you pass an array of steps to a
* `transition()` call, the steps run sequentially by default.
* Compare this to the `{@link animations/group group()}` call, which runs animation steps in parallel.
*
* When a sequence is used within a `{@link animations/group group()}` or a `transition()` call,
* execution continues to the next instruction only after each of the inner animation
* steps have completed.
*
**/
function sequence(steps, options) {
if (options === void 0) { options = null; }
return { type: 2 /* Sequence */, steps: steps, options: options };
}
/**
* Declares a key/value object containing CSS properties/styles that
* can then be used for an animation `state`, within an animation `sequence`,
* or as styling data for calls to `animate()` and `keyframes()`.
*
* @param tokens A set of CSS styles or HTML styles associated with an animation state.
* The value can be any of the following:
* - A key-value style pair associating a CSS property with a value.
* - An array of key-value style pairs.
* - An asterisk (*), to use auto-styling, where styles are derived from the element
* being animated and applied to the animation when it starts.
*
* Auto-styling can be used to define a state that depends on layout or other
* environmental factors.
*
* @return An object that encapsulates the style data.
*
* @usageNotes
* The following examples create animation styles that collect a set of
* CSS property values:
*
* ```typescript
* // string values for CSS properties
* style({ background: "red", color: "blue" })
*
* // numerical pixel values
* style({ width: 100, height: 0 })
* ```
*
* The following example uses auto-styling to allow a component to animate from
* a height of 0 up to the height of the parent element:
*
* ```
* style({ height: 0 }),
* animate("1s", style({ height: "*" }))
* ```
*
**/
function style(tokens) {
return { type: 6 /* Style */, styles: tokens, offset: null };
}
/**
* Declares an animation state within a trigger attached to an element.
*
* @param name One or more names for the defined state in a comma-separated string.
* The following reserved state names can be supplied to define a style for specific use
* cases:
*
* - `void` You can associate styles with this name to be used when
* the element is detached from the application. For example, when an `ngIf` evaluates
* to false, the state of the associated element is void.
* - `*` (asterisk) Indicates the default state. You can associate styles with this name
* to be used as the fallback when the state that is being animated is not declared
* within the trigger.
*
* @param styles A set of CSS styles associated with this state, created using the
* `style()` function.
* This set of styles persists on the element once the state has been reached.
* @param options Parameters that can be passed to the state when it is invoked.
* 0 or more key-value pairs.
* @return An object that encapsulates the new state data.
*
* @usageNotes
* Use the `trigger()` function to register states to an animation trigger.
* Use the `transition()` function to animate between states.
* When a state is active within a component, its associated styles persist on the element,
* even when the animation ends.
**/
function state(name, styles, options) {
return { type: 0 /* State */, name: name, styles: styles, options: options };
}
/**
* Defines a set of animation styles, associating each style with an optional `offset` value.
*
* @param steps A set of animation styles with optional offset data.
* The optional `offset` value for a style specifies a percentage of the total animation
* time at which that style is applied.
* @returns An object that encapsulates the keyframes data.
*
* @usageNotes
* Use with the `animate()` call. Instead of applying animations
* from the current state
* to the destination state, keyframes describe how each style entry is applied and at what point
* within the animation arc.
* Compare [CSS Keyframe Animations](https://www.w3schools.com/css/css3_animations.asp).
*
* ### Usage
*
* In the following example, the offset values describe
* when each `backgroundColor` value is applied. The color is red at the start, and changes to
* blue when 20% of the total time has elapsed.
*
* ```typescript
* // the provided offset values
* animate("5s", keyframes([
* style({ backgroundColor: "red", offset: 0 }),
* style({ backgroundColor: "blue", offset: 0.2 }),
* style({ backgroundColor: "orange", offset: 0.3 }),
* style({ backgroundColor: "black", offset: 1 })
* ]))
* ```
*
* If there are no `offset` values specified in the style entries, the offsets
* are calculated automatically.
*
* ```typescript
* animate("5s", keyframes([
* style({ backgroundColor: "red" }) // offset = 0
* style({ backgroundColor: "blue" }) // offset = 0.33
* style({ backgroundColor: "orange" }) // offset = 0.66
* style({ backgroundColor: "black" }) // offset = 1
* ]))
*```
*/
function keyframes(steps) {
return { type: 5 /* Keyframes */, steps: steps };
}
/**
* Declares an animation transition as a sequence of animation steps to run when a given
* condition is satisfied. The condition is a Boolean expression or function that compares
* the previous and current animation states, and returns true if this transition should occur.
* When the state criteria of a defined transition are met, the associated animation is
* triggered.
*
* @param stateChangeExpr A Boolean expression or function that compares the previous and current
* animation states, and returns true if this transition should occur. Note that "true" and "false"
* match 1 and 0, respectively. An expression is evaluated each time a state change occurs in the
* animation trigger element.
* The animation steps run when the expression evaluates to true.
*
* - A state-change string takes the form "state1 => state2", where each side is a defined animation
* state, or an asterix (*) to refer to a dynamic start or end state.
* - The expression string can contain multiple comma-separated statements;
* for example "state1 => state2, state3 => state4".
* - Special values `:enter` and `:leave` initiate a transition on the entry and exit states,
* equivalent to "void => *" and "* => void".
* - Special values `:increment` and `:decrement` initiate a transition when a numeric value has
* increased or decreased in value.
* - A function is executed each time a state change occurs in the animation trigger element.
* The animation steps run when the function returns true.
*
* @param steps One or more animation objects, as returned by the `animate()` or
* `sequence()` function, that form a transformation from one state to another.
* A sequence is used by default when you pass an array.
* @param options An options object that can contain a delay value for the start of the animation,
* and additional developer-defined parameters. Provided values for additional parameters are used
* as defaults, and override values can be passed to the caller on invocation.
* @returns An object that encapsulates the transition data.
*
* @usageNotes
* The template associated with a component binds an animation trigger to an element.
*
* ```HTML
* <!-- somewhere inside of my-component-tpl.html -->
* <div [@myAnimationTrigger]="myStatusExp">...</div>
* ```
*
* All transitions are defined within an animation trigger,
* along with named states that the transitions change to and from.
*
* ```typescript
* trigger("myAnimationTrigger", [
* // define states
* state("on", style({ background: "green" })),
* state("off", style({ background: "grey" })),
* ...]
* ```
*
* Note that when you call the `sequence()` function within a `{@link animations/group group()}`
* or a `transition()` call, execution does not continue to the next instruction
* until each of the inner animation steps have completed.
*
* ### Syntax examples
*
* The following examples define transitions between the two defined states (and default states),
* using various options:
*
* ```typescript
* // Transition occurs when the state value
* // bound to "myAnimationTrigger" changes from "on" to "off"
* transition("on => off", animate(500))
* // Run the same animation for both directions
* transition("on <=> off", animate(500))
* // Define multiple state-change pairs separated by commas
* transition("on => off, off => void", animate(500))
* ```
*
* ### Special values for state-change expressions
*
* - Catch-all state change for when an element is inserted into the page and the
* destination state is unknown:
*
* ```typescript
* transition("void => *", [
* style({ opacity: 0 }),
* animate(500)
* ])
* ```
*
* - Capture a state change between any states:
*
* `transition("* => *", animate("1s 0s"))`
*
* - Entry and exit transitions:
*
* ```typescript
* transition(":enter", [
* style({ opacity: 0 }),
* animate(500, style({ opacity: 1 }))
* ]),
* transition(":leave", [
* animate(500, style({ opacity: 0 }))
* ])
* ```
*
* - Use `:increment` and `:decrement` to initiate transitions:
*
* ```typescript
* transition(":increment", group([
* query(':enter', [
* style({ left: '100%' }),
* animate('0.5s ease-out', style('*'))
* ]),
* query(':leave', [
* animate('0.5s ease-out', style({ left: '-100%' }))
* ])
* ]))
*
* transition(":decrement", group([
* query(':enter', [
* style({ left: '100%' }),
* animate('0.5s ease-out', style('*'))
* ]),
* query(':leave', [
* animate('0.5s ease-out', style({ left: '-100%' }))
* ])
* ]))
* ```
*
* ### State-change functions
*
* Here is an example of a `fromState` specified as a state-change function that invokes an
* animation when true:
*
* ```typescript
* transition((fromState, toState) =>
* {
* return fromState == "off" && toState == "on";
* },
* animate("1s 0s"))
* ```
*
* ### Animating to the final state
*
* If the final step in a transition is a call to `animate()` that uses a timing value
* with no style data, that step is automatically considered the final animation arc,
* for the element to reach the final state. Angular automatically adds or removes
* CSS styles to ensure that the element is in the correct final state.
*
* The following example defines a transition that starts by hiding the element,
* then makes sure that it animates properly to whatever state is currently active for trigger:
*
* ```typescript
* transition("void => *", [
* style({ opacity: 0 }),
* animate(500)
* ])
* ```
* ### Boolean value matching
* If a trigger binding value is a Boolean, it can be matched using a transition expression
* that compares true and false or 1 and 0. For example:
*
* ```
* // in the template
* <div [@openClose]="open ? true : false">...</div>
* // in the component metadata
* trigger('openClose', [
* state('true', style({ height: '*' })),
* state('false', style({ height: '0px' })),
* transition('false <=> true', animate(500))
* ])
* ```
**/
function transition(stateChangeExpr, steps, options) {
if (options === void 0) { options = null; }
return { type: 1 /* Transition */, expr: stateChangeExpr, animation: steps, options: options };
}
/**
* Produces a reusable animation that can be invoked in another animation or sequence,
* by calling the `useAnimation()` function.
*
* @param steps One or more animation objects, as returned by the `animate()`
* or `sequence()` function, that form a transformation from one state to another.
* A sequence is used by default when you pass an array.
* @param options An options object that can contain a delay value for the start of the
* animation, and additional developer-defined parameters.
* Provided values for additional parameters are used as defaults,
* and override values can be passed to the caller on invocation.
* @returns An object that encapsulates the animation data.
*
* @usageNotes
* The following example defines a reusable animation, providing some default parameter
* values.
*
* ```typescript
* var fadeAnimation = animation([
* style({ opacity: '{{ start }}' }),
* animate('{{ time }}',
* style({ opacity: '{{ end }}'}))
* ],
* { params: { time: '1000ms', start: 0, end: 1 }});
* ```
*
* The following invokes the defined animation with a call to `useAnimation()`,
* passing in override parameter values.
*
* ```js
* useAnimation(fadeAnimation, {
* params: {
* time: '2s',
* start: 1,
* end: 0
* }
* })
* ```
*
* If any of the passed-in parameter values are missing from this call,
* the default values are used. If one or more parameter values are missing before a step is
* animated, `useAnimation()` throws an error.
*/
function animation(steps, options) {
if (options === void 0) { options = null; }
return { type: 8 /* Reference */, animation: steps, options: options };
}
/**
* Executes a queried inner animation element within an animation sequence.
*
* @param options An options object that can contain a delay value for the start of the
* animation, and additional override values for developer-defined parameters.
* @return An object that encapsulates the child animation data.
*
* @usageNotes
* Each time an animation is triggered in Angular, the parent animation
* has priority and any child animations are blocked. In order
* for a child animation to run, the parent animation must query each of the elements
* containing child animations, and run them using this function.
*
* Note that this feature designed to be used with `query()` and it will only work
* with animations that are assigned using the Angular animation library. CSS keyframes
* and transitions are not handled by this API.
*/
function animateChild(options) {
if (options === void 0) { options = null; }
return { type: 9 /* AnimateChild */, options: options };
}
/**
* Starts a reusable animation that is created using the `animation()` function.
*
* @param animation The reusable animation to start.
* @param options An options object that can contain a delay value for the start of
* the animation, and additional override values for developer-defined parameters.
* @return An object that contains the animation parameters.
*/
function useAnimation(animation, options) {
if (options === void 0) { options = null; }
return { type: 10 /* AnimateRef */, animation: animation, options: options };
}
/**
* Finds one or more inner elements within the current element that is
* being animated within a sequence. Use with `animateChild()`.
*
* @param selector The element to query, or a set of elements that contain Angular-specific
* characteristics, specified with one or more of the following tokens.
* - `query(":enter")` or `query(":leave")` : Query for newly inserted/removed elements.
* - `query(":animating")` : Query all currently animating elements.
* - `query("@triggerName")` : Query elements that contain an animation trigger.
* - `query("@*")` : Query all elements that contain an animation triggers.
* - `query(":self")` : Include the current element into the animation sequence.
*
* @param animation One or more animation steps to apply to the queried element or elements.
* An array is treated as an animation sequence.
* @param options An options object. Use the 'limit' field to limit the total number of
* items to collect.
* @return An object that encapsulates the query data.
*
* @usageNotes
* Tokens can be merged into a combined query selector string. For example:
*
* ```typescript
* query(':self, .record:enter, .record:leave, @subTrigger', [...])
* ```
*
* The `query()` function collects multiple elements and works internally by using
* `element.querySelectorAll`. Use the `limit` field of an options object to limit
* the total number of items to be collected. For example:
*
* ```js
* query('div', [
* animate(...),
* animate(...)
* ], { limit: 1 })
* ```
*
* By default, throws an error when zero items are found. Set the
* `optional` flag to ignore this error. For example:
*
* ```js
* query('.some-element-that-may-not-be-there', [
* animate(...),
* animate(...)
* ], { optional: true })
* ```
*
* ### Usage Example
*
* The following example queries for inner elements and animates them
* individually using `animateChild()`.
*
* ```typescript
* @Component({
* selector: 'inner',
* template: `
* <div [@queryAnimation]="exp">
* <h1>Title</h1>
* <div class="content">
* Blah blah blah
* </div>
* </div>
* `,
* animations: [
* trigger('queryAnimation', [
* transition('* => goAnimate', [
* // hide the inner elements
* query('h1', style({ opacity: 0 })),
* query('.content', style({ opacity: 0 })),
*
* // animate the inner elements in, one by one
* query('h1', animate(1000, style({ opacity: 1 })),
* query('.content', animate(1000, style({ opacity: 1 })),
* ])
* ])
* ]
* })
* class Cmp {
* exp = '';
*
* goAnimate() {
* this.exp = 'goAnimate';
* }
* }
* ```
*/
function query(selector, animation, options) {
if (options === void 0) { options = null; }
return { type: 11 /* Query */, selector: selector, animation: animation, options: options };
}
/**
* Use within an animation `query()` call to issue a timing gap after
* each queried item is animated.
*
* @param timings A delay value.
* @param animation One ore more animation steps.
* @returns An object that encapsulates the stagger data.
*
* @usageNotes
* In the following example, a container element wraps a list of items stamped out
* by an `ngFor`. The container element contains an animation trigger that will later be set
* to query for each of the inner items.
*
* Each time items are added, the opacity fade-in animation runs,
* and each removed item is faded out.
* When either of these animations occur, the stagger effect is
* applied after each item's animation is started.
*
* ```html
* <!-- list.component.html -->
* <button (click)="toggle()">Show / Hide Items</button>
* <hr />
* <div [@listAnimation]="items.length">
* <div *ngFor="let item of items">
* {{ item }}
* </div>
* </div>
* ```
*
* Here is the component code:
*
* ```typescript
* import {trigger, transition, style, animate, query, stagger} from '@angular/animations';
* @Component({
* templateUrl: 'list.component.html',
* animations: [
* trigger('listAnimation', [
* ...
* ])
* ]
* })
* class ListComponent {
* items = [];
*
* showItems() {
* this.items = [0,1,2,3,4];
* }
*
* hideItems() {
* this.items = [];
* }
*
* toggle() {
* this.items.length ? this.hideItems() : this.showItems();
* }
* }
* ```
*
* Here is the animation trigger code:
*
* ```typescript
* trigger('listAnimation', [
* transition('* => *', [ // each time the binding value changes
* query(':leave', [
* stagger(100, [
* animate('0.5s', style({ opacity: 0 }))
* ])
* ]),
* query(':enter', [
* style({ opacity: 0 }),
* stagger(100, [
* animate('0.5s', style({ opacity: 1 }))
* ])
* ])
* ])
* ])
* ```
*/
function stagger(timings, animation) {
return { type: 12 /* Stagger */, timings: timings, animation: animation };
}
/**
* @license
* Copyright Google Inc. 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
*/
function scheduleMicroTask(cb) {
Promise.resolve(null).then(cb);
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @experimental Animation support is experimental.
*/
var NoopAnimationPlayer = /** @class */ (function () {
function NoopAnimationPlayer(duration, delay) {
if (duration === void 0) { duration = 0; }
if (delay === void 0) { delay = 0; }
this._onDoneFns = [];
this._onStartFns = [];
this._onDestroyFns = [];
this._started = false;
this._destroyed = false;
this._finished = false;
this.parentPlayer = null;
this.totalTime = duration + delay;
}
NoopAnimationPlayer.prototype._onFinish = function () {
if (!this._finished) {
this._finished = true;
this._onDoneFns.forEach(function (fn) { return fn(); });
this._onDoneFns = [];
}
};
NoopAnimationPlayer.prototype.onStart = function (fn) { this._onStartFns.push(fn); };
NoopAnimationPlayer.prototype.onDone = function (fn) { this._onDoneFns.push(fn); };
NoopAnimationPlayer.prototype.onDestroy = function (fn) { this._onDestroyFns.push(fn); };
NoopAnimationPlayer.prototype.hasStarted = function () { return this._started; };
NoopAnimationPlayer.prototype.init = function () { };
NoopAnimationPlayer.prototype.play = function () {
if (!this.hasStarted()) {
this._onStart();
this.triggerMicrotask();
}
this._started = true;
};
/* @internal */
NoopAnimationPlayer.prototype.triggerMicrotask = function () {
var _this = this;
scheduleMicroTask(function () { return _this._onFinish(); });
};
NoopAnimationPlayer.prototype._onStart = function () {
this._onStartFns.forEach(function (fn) { return fn(); });
this._onStartFns = [];
};
NoopAnimationPlayer.prototype.pause = function () { };
NoopAnimationPlayer.prototype.restart = function () { };
NoopAnimationPlayer.prototype.finish = function () { this._onFinish(); };
NoopAnimationPlayer.prototype.destroy = function () {
if (!this._destroyed) {
this._destroyed = true;
if (!this.hasStarted()) {
this._onStart();
}
this.finish();
this._onDestroyFns.forEach(function (fn) { return fn(); });
this._onDestroyFns = [];
}
};
NoopAnimationPlayer.prototype.reset = function () { };
NoopAnimationPlayer.prototype.setPosition = function (p) { };
NoopAnimationPlayer.prototype.getPosition = function () { return 0; };
/* @internal */
NoopAnimationPlayer.prototype.triggerCallback = function (phaseName) {
var methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns;
methods.forEach(function (fn) { return fn(); });
methods.length = 0;
};
return NoopAnimationPlayer;
}());
/**
* @license
* Copyright Google Inc. 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 AnimationGroupPlayer = /** @class */ (function () {
function AnimationGroupPlayer(_players) {
var _this = this;
this._onDoneFns = [];
this._onStartFns = [];
this._finished = false;
this._started = false;
this._destroyed = false;
this._onDestroyFns = [];
this.parentPlayer = null;
this.totalTime = 0;
this.players = _players;
var doneCount = 0;
var destroyCount = 0;
var startCount = 0;
var total = this.players.length;
if (total == 0) {
scheduleMicroTask(function () { return _this._onFinish(); });
}
else {
this.players.forEach(function (player) {
player.onDone(function () {
if (++doneCount == total) {
_this._onFinish();
}
});
player.onDestroy(function () {
if (++destroyCount == total) {
_this._onDestroy();
}
});
player.onStart(function () {
if (++startCount == total) {
_this._onStart();
}
});
});
}
this.totalTime = this.players.reduce(function (time, player) { return Math.max(time, player.totalTime); }, 0);
}
AnimationGroupPlayer.prototype._onFinish = function () {
if (!this._finished) {
this._finished = true;
this._onDoneFns.forEach(function (fn) { return fn(); });
this._onDoneFns = [];
}
};
AnimationGroupPlayer.prototype.init = function () { this.players.forEach(function (player) { return player.init(); }); };
AnimationGroupPlayer.prototype.onStart = function (fn) { this._onStartFns.push(fn); };
AnimationGroupPlayer.prototype._onStart = function () {
if (!this.hasStarted()) {
this._started = true;
this._onStartFns.forEach(function (fn) { return fn(); });
this._onStartFns = [];
}
};
AnimationGroupPlayer.prototype.onDone = function (fn) { this._onDoneFns.push(fn); };
AnimationGroupPlayer.prototype.onDestroy = function (fn) { this._onDestroyFns.push(fn); };
AnimationGroupPlayer.prototype.hasStarted = function () { return this._started; };
AnimationGroupPlayer.prototype.play = function () {
if (!this.parentPlayer) {
this.init();
}
this._onStart();
this.players.forEach(function (player) { return player.play(); });
};
AnimationGroupPlayer.prototype.pause = function () { this.players.forEach(function (player) { return player.pause(); }); };
AnimationGroupPlayer.prototype.restart = function () { this.players.forEach(function (player) { return player.restart(); }); };
AnimationGroupPlayer.prototype.finish = function () {
this._onFinish();
this.players.forEach(function (player) { return player.finish(); });
};
AnimationGroupPlayer.prototype.destroy = function () { this._onDestroy(); };
AnimationGroupPlayer.prototype._onDestroy = function () {
if (!this._destroyed) {
this._destroyed = true;
this._onFinish();
this.players.forEach(function (player) { return player.destroy(); });
this._onDestroyFns.forEach(function (fn) { return fn(); });
this._onDestroyFns = [];
}
};
AnimationGroupPlayer.prototype.reset = function () {
this.players.forEach(function (player) { return player.reset(); });
this._destroyed = false;
this._finished = false;
this._started = false;
};
AnimationGroupPlayer.prototype.setPosition = function (p) {
var timeAtPosition = p * this.totalTime;
this.players.forEach(function (player) {
var position = player.totalTime ? Math.min(1, timeAtPosition / player.totalTime) : 1;
player.setPosition(position);
});
};
AnimationGroupPlayer.prototype.getPosition = function () {
var min = 0;
this.players.forEach(function (player) {
var p = player.getPosition();
min = Math.min(p, min);
});
return min;
};
AnimationGroupPlayer.prototype.beforeDestroy = function () {
this.players.forEach(function (player) {
if (player.beforeDestroy) {
player.beforeDestroy();
}
});
};
/* @internal */
AnimationGroupPlayer.prototype.triggerCallback = function (phaseName) {
var methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns;
methods.forEach(function (fn) { return fn(); });
methods.length = 0;
};
return AnimationGroupPlayer;
}());
/**
* @license
* Copyright Google Inc. 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 ɵPRE_STYLE = '!';
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Generated bundle index. Do not edit.
*/
//# sourceMappingURL=animations.js.map
/***/ }),
/***/ "./node_modules/@angular/animations/fesm5/browser.js":
/*!***********************************************************!*\
!*** ./node_modules/@angular/animations/fesm5/browser.js ***!
\***********************************************************/
/*! exports provided: AnimationDriver, ɵAnimation, ɵAnimationStyleNormalizer, ɵNoopAnimationStyleNormalizer, ɵWebAnimationsStyleNormalizer, ɵAnimationDriver, ɵNoopAnimationDriver, ɵAnimationEngine, ɵCssKeyframesDriver, ɵCssKeyframesPlayer, ɵcontainsElement, ɵinvokeQuery, ɵmatchesElement, ɵvalidateStyleProperty, ɵWebAnimationsDriver, ɵsupportsWebAnimations, ɵWebAnimationsPlayer, ɵallowPreviousPlayerStylesMerge */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationDriver", function() { return AnimationDriver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵAnimation", function() { return Animation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵAnimationStyleNormalizer", function() { return AnimationStyleNormalizer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNoopAnimationStyleNormalizer", function() { return NoopAnimationStyleNormalizer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵWebAnimationsStyleNormalizer", function() { return WebAnimationsStyleNormalizer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵAnimationDriver", function() { return AnimationDriver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNoopAnimationDriver", function() { return NoopAnimationDriver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵAnimationEngine", function() { return AnimationEngine; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCssKeyframesDriver", function() { return CssKeyframesDriver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCssKeyframesPlayer", function() { return CssKeyframesPlayer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcontainsElement", function() { return containsElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinvokeQuery", function() { return invokeQuery; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmatchesElement", function() { return matchesElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵvalidateStyleProperty", function() { return validateStyleProperty; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵWebAnimationsDriver", function() { return WebAnimationsDriver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsupportsWebAnimations", function() { return supportsWebAnimations; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵWebAnimationsPlayer", function() { return WebAnimationsPlayer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵallowPreviousPlayerStylesMerge", function() { return allowPreviousPlayerStylesMerge; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/**
* @license Angular v6.0.9
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
function isBrowser() {
return (typeof window !== 'undefined' && typeof window.document !== 'undefined');
}
function isNode() {
return (typeof process !== 'undefined');
}
function optimizeGroupPlayer(players) {
switch (players.length) {
case 0:
return new _angular_animations__WEBPACK_IMPORTED_MODULE_1__["NoopAnimationPlayer"]();
case 1:
return players[0];
default:
return new _angular_animations__WEBPACK_IMPORTED_MODULE_1__["ɵAnimationGroupPlayer"](players);
}
}
function normalizeKeyframes(driver, normalizer, element, keyframes, preStyles, postStyles) {
if (preStyles === void 0) { preStyles = {}; }
if (postStyles === void 0) { postStyles = {}; }
var errors = [];
var normalizedKeyframes = [];
var previousOffset = -1;
var previousKeyframe = null;
keyframes.forEach(function (kf) {
var offset = kf['offset'];
var isSameOffset = offset == previousOffset;
var normalizedKeyframe = (isSameOffset && previousKeyframe) || {};
Object.keys(kf).forEach(function (prop) {
var normalizedProp = prop;
var normalizedValue = kf[prop];
if (prop !== 'offset') {
normalizedProp = normalizer.normalizePropertyName(normalizedProp, errors);
switch (normalizedValue) {
case _angular_animations__WEBPACK_IMPORTED_MODULE_1__["ɵPRE_STYLE"]:
normalizedValue = preStyles[prop];
break;
case _angular_animations__WEBPACK_IMPORTED_MODULE_1__["AUTO_STYLE"]:
normalizedValue = postStyles[prop];
break;
default:
normalizedValue =
normalizer.normalizeStyleValue(prop, normalizedProp, normalizedValue, errors);
break;
}
}
normalizedKeyframe[normalizedProp] = normalizedValue;
});
if (!isSameOffset) {
normalizedKeyframes.push(normalizedKeyframe);
}
previousKeyframe = normalizedKeyframe;
previousOffset = offset;
});
if (errors.length) {
var LINE_START = '\n - ';
throw new Error("Unable to animate due to the following errors:" + LINE_START + errors.join(LINE_START));
}
return normalizedKeyframes;
}
function listenOnPlayer(player, eventName, event, callback) {
switch (eventName) {
case 'start':
player.onStart(function () { return callback(event && copyAnimationEvent(event, 'start', player)); });
break;
case 'done':
player.onDone(function () { return callback(event && copyAnimationEvent(event, 'done', player)); });
break;
case 'destroy':
player.onDestroy(function () { return callback(event && copyAnimationEvent(event, 'destroy', player)); });
break;
}
}
function copyAnimationEvent(e, phaseName, player) {
var totalTime = player.totalTime;
var disabled = player.disabled ? true : false;
var event = makeAnimationEvent(e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName, totalTime == undefined ? e.totalTime : totalTime, disabled);
var data = e['_data'];
if (data != null) {
event['_data'] = data;
}
return event;
}
function makeAnimationEvent(element, triggerName, fromState, toState, phaseName, totalTime, disabled) {
if (phaseName === void 0) { phaseName = ''; }
if (totalTime === void 0) { totalTime = 0; }
return { element: element, triggerName: triggerName, fromState: fromState, toState: toState, phaseName: phaseName, totalTime: totalTime, disabled: !!disabled };
}
function getOrSetAsInMap(map, key, defaultValue) {
var value;
if (map instanceof Map) {
value = map.get(key);
if (!value) {
map.set(key, value = defaultValue);
}
}
else {
value = map[key];
if (!value) {
value = map[key] = defaultValue;
}
}
return value;
}
function parseTimelineCommand(command) {
var separatorPos = command.indexOf(':');
var id = command.substring(1, separatorPos);
var action = command.substr(separatorPos + 1);
return [id, action];
}
var _contains = function (elm1, elm2) { return false; };
var _matches = function (element, selector) {
return false;
};
var _query = function (element, selector, multi) {
return [];
};
// Define utility methods for browsers and platform-server(domino) where Element
// and utility methods exist.
var _isNode = isNode();
if (_isNode || typeof Element !== 'undefined') {
// this is well supported in all browsers
_contains = function (elm1, elm2) { return elm1.contains(elm2); };
if (_isNode || Element.prototype.matches) {
_matches = function (element, selector) { return element.matches(selector); };
}
else {
var proto = Element.prototype;
var fn_1 = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector ||
proto.oMatchesSelector || proto.webkitMatchesSelector;
if (fn_1) {
_matches = function (element, selector) { return fn_1.apply(element, [selector]); };
}
}
_query = function (element, selector, multi) {
var results = [];
if (multi) {
results.push.apply(results, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(element.querySelectorAll(selector)));
}
else {
var elm = element.querySelector(selector);
if (elm) {
results.push(elm);
}
}
return results;
};
}
function containsVendorPrefix(prop) {
// Webkit is the only real popular vendor prefix nowadays
// cc: http://shouldiprefix.com/
return prop.substring(1, 6) == 'ebkit'; // webkit or Webkit
}
var _CACHED_BODY = null;
var _IS_WEBKIT = false;
function validateStyleProperty(prop) {
if (!_CACHED_BODY) {
_CACHED_BODY = getBodyNode() || {};
_IS_WEBKIT = _CACHED_BODY.style ? ('WebkitAppearance' in _CACHED_BODY.style) : false;
}
var result = true;
if (_CACHED_BODY.style && !containsVendorPrefix(prop)) {
result = prop in _CACHED_BODY.style;
if (!result && _IS_WEBKIT) {
var camelProp = 'Webkit' + prop.charAt(0).toUpperCase() + prop.substr(1);
result = camelProp in _CACHED_BODY.style;
}
}
return result;
}
function getBodyNode() {
if (typeof document != 'undefined') {
return document.body;
}
return null;
}
var matchesElement = _matches;
var containsElement = _contains;
var invokeQuery = _query;
function hypenatePropsObject(object) {
var newObj = {};
Object.keys(object).forEach(function (prop) {
var newProp = prop.replace(/([a-z])([A-Z])/g, '$1-$2');
newObj[newProp] = object[prop];
});
return newObj;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @experimental
*/
var NoopAnimationDriver = /** @class */ (function () {
function NoopAnimationDriver() {
}
NoopAnimationDriver.prototype.validateStyleProperty = function (prop) { return validateStyleProperty(prop); };
NoopAnimationDriver.prototype.matchesElement = function (element, selector) {
return matchesElement(element, selector);
};
NoopAnimationDriver.prototype.containsElement = function (elm1, elm2) { return containsElement(elm1, elm2); };
NoopAnimationDriver.prototype.query = function (element, selector, multi) {
return invokeQuery(element, selector, multi);
};
NoopAnimationDriver.prototype.computeStyle = function (element, prop, defaultValue) {
return defaultValue || '';
};
NoopAnimationDriver.prototype.animate = function (element, keyframes, duration, delay, easing, previousPlayers, scrubberAccessRequested) {
if (previousPlayers === void 0) { previousPlayers = []; }
return new _angular_animations__WEBPACK_IMPORTED_MODULE_1__["NoopAnimationPlayer"](duration, delay);
};
NoopAnimationDriver.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
return NoopAnimationDriver;
}());
/**
* @experimental
*/
var AnimationDriver = /** @class */ (function () {
function AnimationDriver() {
}
AnimationDriver.NOOP = new NoopAnimationDriver();
return AnimationDriver;
}());
/**
* @license
* Copyright Google Inc. 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 ONE_SECOND = 1000;
var SUBSTITUTION_EXPR_START = '{{';
var SUBSTITUTION_EXPR_END = '}}';
var ENTER_CLASSNAME = 'ng-enter';
var LEAVE_CLASSNAME = 'ng-leave';
var NG_TRIGGER_CLASSNAME = 'ng-trigger';
var NG_TRIGGER_SELECTOR = '.ng-trigger';
var NG_ANIMATING_CLASSNAME = 'ng-animating';
var NG_ANIMATING_SELECTOR = '.ng-animating';
function resolveTimingValue(value) {
if (typeof value == 'number')
return value;
var matches = value.match(/^(-?[\.\d]+)(m?s)/);
if (!matches || matches.length < 2)
return 0;
return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
}
function _convertTimeValueToMS(value, unit) {
switch (unit) {
case 's':
return value * ONE_SECOND;
default:// ms or something else
return value;
}
}
function resolveTiming(timings, errors, allowNegativeValues) {
return timings.hasOwnProperty('duration') ?
timings :
parseTimeExpression(timings, errors, allowNegativeValues);
}
function parseTimeExpression(exp, errors, allowNegativeValues) {
var regex = /^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;
var duration;
var delay = 0;
var easing = '';
if (typeof exp === 'string') {
var matches = exp.match(regex);
if (matches === null) {
errors.push("The provided timing value \"" + exp + "\" is invalid.");
return { duration: 0, delay: 0, easing: '' };
}
duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
var delayMatch = matches[3];
if (delayMatch != null) {
delay = _convertTimeValueToMS(Math.floor(parseFloat(delayMatch)), matches[4]);
}
var easingVal = matches[5];
if (easingVal) {
easing = easingVal;
}
}
else {
duration = exp;
}
if (!allowNegativeValues) {
var containsErrors = false;
var startIndex = errors.length;
if (duration < 0) {
errors.push("Duration values below 0 are not allowed for this animation step.");
containsErrors = true;
}
if (delay < 0) {
errors.push("Delay values below 0 are not allowed for this animation step.");
containsErrors = true;
}
if (containsErrors) {
errors.splice(startIndex, 0, "The provided timing value \"" + exp + "\" is invalid.");
}
}
return { duration: duration, delay: delay, easing: easing };
}
function copyObj(obj, destination) {
if (destination === void 0) { destination = {}; }
Object.keys(obj).forEach(function (prop) { destination[prop] = obj[prop]; });
return destination;
}
function normalizeStyles(styles) {
var normalizedStyles = {};
if (Array.isArray(styles)) {
styles.forEach(function (data) { return copyStyles(data, false, normalizedStyles); });
}
else {
copyStyles(styles, false, normalizedStyles);
}
return normalizedStyles;
}
function copyStyles(styles, readPrototype, destination) {
if (destination === void 0) { destination = {}; }
if (readPrototype) {
// we make use of a for-in loop so that the
// prototypically inherited properties are
// revealed from the backFill map
for (var prop in styles) {
destination[prop] = styles[prop];
}
}
else {
copyObj(styles, destination);
}
return destination;
}
function getStyleAttributeString(element, key, value) {
// Return the key-value pair string to be added to the style attribute for the
// given CSS style key.
if (value) {
return key + ':' + value + ';';
}
else {
return '';
}
}
function writeStyleAttribute(element) {
// Read the style property of the element and manually reflect it to the
// style attribute. This is needed because Domino on platform-server doesn't
// understand the full set of allowed CSS properties and doesn't reflect some
// of them automatically.
var styleAttrValue = '';
for (var i = 0; i < element.style.length; i++) {
var key = element.style.item(i);
styleAttrValue += getStyleAttributeString(element, key, element.style.getPropertyValue(key));
}
for (var key in element.style) {
// Skip internal Domino properties that don't need to be reflected.
if (!element.style.hasOwnProperty(key) || key.startsWith('_')) {
continue;
}
var dashKey = camelCaseToDashCase(key);
styleAttrValue += getStyleAttributeString(element, dashKey, element.style[key]);
}
element.setAttribute('style', styleAttrValue);
}
function setStyles(element, styles) {
if (element['style']) {
Object.keys(styles).forEach(function (prop) {
var camelProp = dashCaseToCamelCase(prop);
element.style[camelProp] = styles[prop];
});
// On the server set the 'style' attribute since it's not automatically reflected.
if (isNode()) {
writeStyleAttribute(element);
}
}
}
function eraseStyles(element, styles) {
if (element['style']) {
Object.keys(styles).forEach(function (prop) {
var camelProp = dashCaseToCamelCase(prop);
element.style[camelProp] = '';
});
// On the server set the 'style' attribute since it's not automatically reflected.
if (isNode()) {
writeStyleAttribute(element);
}
}
}
function normalizeAnimationEntry(steps) {
if (Array.isArray(steps)) {
if (steps.length == 1)
return steps[0];
return Object(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["sequence"])(steps);
}
return steps;
}
function validateStyleParams(value, options, errors) {
var params = options.params || {};
var matches = extractStyleParams(value);
if (matches.length) {
matches.forEach(function (varName) {
if (!params.hasOwnProperty(varName)) {
errors.push("Unable to resolve the local animation param " + varName + " in the given list of values");
}
});
}
}
var PARAM_REGEX = new RegExp(SUBSTITUTION_EXPR_START + "\\s*(.+?)\\s*" + SUBSTITUTION_EXPR_END, 'g');
function extractStyleParams(value) {
var params = [];
if (typeof value === 'string') {
var val = value.toString();
var match = void 0;
while (match = PARAM_REGEX.exec(val)) {
params.push(match[1]);
}
PARAM_REGEX.lastIndex = 0;
}
return params;
}
function interpolateParams(value, params, errors) {
var original = value.toString();
var str = original.replace(PARAM_REGEX, function (_, varName) {
var localVal = params[varName];
// this means that the value was never overridden by the data passed in by the user
if (!params.hasOwnProperty(varName)) {
errors.push("Please provide a value for the animation param " + varName);
localVal = '';
}
return localVal.toString();
});
// we do this to assert that numeric values stay as they are
return str == original ? value : str;
}
function iteratorToArray(iterator) {
var arr = [];
var item = iterator.next();
while (!item.done) {
arr.push(item.value);
item = iterator.next();
}
return arr;
}
var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
function dashCaseToCamelCase(input) {
return input.replace(DASH_CASE_REGEXP, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i] = arguments[_i];
}
return m[1].toUpperCase();
});
}
function camelCaseToDashCase(input) {
return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
}
function allowPreviousPlayerStylesMerge(duration, delay) {
return duration === 0 || delay === 0;
}
function balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles) {
var previousStyleProps = Object.keys(previousStyles);
if (previousStyleProps.length && keyframes.length) {
var startingKeyframe_1 = keyframes[0];
var missingStyleProps_1 = [];
previousStyleProps.forEach(function (prop) {
if (!startingKeyframe_1.hasOwnProperty(prop)) {
missingStyleProps_1.push(prop);
}
startingKeyframe_1[prop] = previousStyles[prop];
});
if (missingStyleProps_1.length) {
var _loop_1 = function () {
var kf = keyframes[i];
missingStyleProps_1.forEach(function (prop) { kf[prop] = computeStyle(element, prop); });
};
// tslint:disable-next-line
for (var i = 1; i < keyframes.length; i++) {
_loop_1();
}
}
}
return keyframes;
}
function visitDslNode(visitor, node, context) {
switch (node.type) {
case 7 /* Trigger */:
return visitor.visitTrigger(node, context);
case 0 /* State */:
return visitor.visitState(node, context);
case 1 /* Transition */:
return visitor.visitTransition(node, context);
case 2 /* Sequence */:
return visitor.visitSequence(node, context);
case 3 /* Group */:
return visitor.visitGroup(node, context);
case 4 /* Animate */:
return visitor.visitAnimate(node, context);
case 5 /* Keyframes */:
return visitor.visitKeyframes(node, context);
case 6 /* Style */:
return visitor.visitStyle(node, context);
case 8 /* Reference */:
return visitor.visitReference(node, context);
case 9 /* AnimateChild */:
return visitor.visitAnimateChild(node, context);
case 10 /* AnimateRef */:
return visitor.visitAnimateRef(node, context);
case 11 /* Query */:
return visitor.visitQuery(node, context);
case 12 /* Stagger */:
return visitor.visitStagger(node, context);
default:
throw new Error("Unable to resolve animation metadata node #" + node.type);
}
}
function computeStyle(element, prop) {
return window.getComputedStyle(element)[prop];
}
/**
* @license
* Copyright Google Inc. 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 ANY_STATE = '*';
function parseTransitionExpr(transitionValue, errors) {
var expressions = [];
if (typeof transitionValue == 'string') {
transitionValue
.split(/\s*,\s*/)
.forEach(function (str) { return parseInnerTransitionStr(str, expressions, errors); });
}
else {
expressions.push(transitionValue);
}
return expressions;
}
function parseInnerTransitionStr(eventStr, expressions, errors) {
if (eventStr[0] == ':') {
var result = parseAnimationAlias(eventStr, errors);
if (typeof result == 'function') {
expressions.push(result);
return;
}
eventStr = result;
}
var match = eventStr.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);
if (match == null || match.length < 4) {
errors.push("The provided transition expression \"" + eventStr + "\" is not supported");
return expressions;
}
var fromState = match[1];
var separator = match[2];
var toState = match[3];
expressions.push(makeLambdaFromStates(fromState, toState));
var isFullAnyStateExpr = fromState == ANY_STATE && toState == ANY_STATE;
if (separator[0] == '<' && !isFullAnyStateExpr) {
expressions.push(makeLambdaFromStates(toState, fromState));
}
}
function parseAnimationAlias(alias, errors) {
switch (alias) {
case ':enter':
return 'void => *';
case ':leave':
return '* => void';
case ':increment':
return function (fromState, toState) { return parseFloat(toState) > parseFloat(fromState); };
case ':decrement':
return function (fromState, toState) { return parseFloat(toState) < parseFloat(fromState); };
default:
errors.push("The transition alias value \"" + alias + "\" is not supported");
return '* => *';
}
}
// DO NOT REFACTOR ... keep the follow set instantiations
// with the values intact (closure compiler for some reason
// removes follow-up lines that add the values outside of
// the constructor...
var TRUE_BOOLEAN_VALUES = new Set(['true', '1']);
var FALSE_BOOLEAN_VALUES = new Set(['false', '0']);
function makeLambdaFromStates(lhs, rhs) {
var LHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(lhs) || FALSE_BOOLEAN_VALUES.has(lhs);
var RHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(rhs) || FALSE_BOOLEAN_VALUES.has(rhs);
return function (fromState, toState) {
var lhsMatch = lhs == ANY_STATE || lhs == fromState;
var rhsMatch = rhs == ANY_STATE || rhs == toState;
if (!lhsMatch && LHS_MATCH_BOOLEAN && typeof fromState === 'boolean') {
lhsMatch = fromState ? TRUE_BOOLEAN_VALUES.has(lhs) : FALSE_BOOLEAN_VALUES.has(lhs);
}
if (!rhsMatch && RHS_MATCH_BOOLEAN && typeof toState === 'boolean') {
rhsMatch = toState ? TRUE_BOOLEAN_VALUES.has(rhs) : FALSE_BOOLEAN_VALUES.has(rhs);
}
return lhsMatch && rhsMatch;
};
}
var SELF_TOKEN = ':self';
var SELF_TOKEN_REGEX = new RegExp("s*" + SELF_TOKEN + "s*,?", 'g');
/*
* [Validation]
* The visitor code below will traverse the animation AST generated by the animation verb functions
* (the output is a tree of objects) and attempt to perform a series of validations on the data. The
* following corner-cases will be validated:
*
* 1. Overlap of animations
* Given that a CSS property cannot be animated in more than one place at the same time, it's
* important that this behaviour is detected and validated. The way in which this occurs is that
* each time a style property is examined, a string-map containing the property will be updated with
* the start and end times for when the property is used within an animation step.
*
* If there are two or more parallel animations that are currently running (these are invoked by the
* group()) on the same element then the validator will throw an error. Since the start/end timing
* values are collected for each property then if the current animation step is animating the same
* property and its timing values fall anywhere into the window of time that the property is
* currently being animated within then this is what causes an error.
*
* 2. Timing values
* The validator will validate to see if a timing value of `duration delay easing` or
* `durationNumber` is valid or not.
*
* (note that upon validation the code below will replace the timing data with an object containing
* {duration,delay,easing}.
*
* 3. Offset Validation
* Each of the style() calls are allowed to have an offset value when placed inside of keyframes().
* Offsets within keyframes() are considered valid when:
*
* - No offsets are used at all
* - Each style() entry contains an offset value
* - Each offset is between 0 and 1
* - Each offset is greater to or equal than the previous one
*
* Otherwise an error will be thrown.
*/
function buildAnimationAst(driver, metadata, errors) {
return new AnimationAstBuilderVisitor(driver).build(metadata, errors);
}
var ROOT_SELECTOR = '';
var AnimationAstBuilderVisitor = /** @class */ (function () {
function AnimationAstBuilderVisitor(_driver) {
this._driver = _driver;
}
AnimationAstBuilderVisitor.prototype.build = function (metadata, errors) {
var context = new AnimationAstBuilderContext(errors);
this._resetContextStyleTimingState(context);
return visitDslNode(this, normalizeAnimationEntry(metadata), context);
};
AnimationAstBuilderVisitor.prototype._resetContextStyleTimingState = function (context) {
context.currentQuerySelector = ROOT_SELECTOR;
context.collectedStyles = {};
context.collectedStyles[ROOT_SELECTOR] = {};
context.currentTime = 0;
};
AnimationAstBuilderVisitor.prototype.visitTrigger = function (metadata, context) {
var _this = this;
var queryCount = context.queryCount = 0;
var depCount = context.depCount = 0;
var states = [];
var transitions = [];
if (metadata.name.charAt(0) == '@') {
context.errors.push('animation triggers cannot be prefixed with an `@` sign (e.g. trigger(\'@foo\', [...]))');
}
metadata.definitions.forEach(function (def) {
_this._resetContextStyleTimingState(context);
if (def.type == 0 /* State */) {
var stateDef_1 = def;
var name_1 = stateDef_1.name;
name_1.toString().split(/\s*,\s*/).forEach(function (n) {
stateDef_1.name = n;
states.push(_this.visitState(stateDef_1, context));
});
stateDef_1.name = name_1;
}
else if (def.type == 1 /* Transition */) {
var transition = _this.visitTransition(def, context);
queryCount += transition.queryCount;
depCount += transition.depCount;
transitions.push(transition);
}
else {
context.errors.push('only state() and transition() definitions can sit inside of a trigger()');
}
});
return {
type: 7 /* Trigger */,
name: metadata.name, states: states, transitions: transitions, queryCount: queryCount, depCount: depCount,
options: null
};
};
AnimationAstBuilderVisitor.prototype.visitState = function (metadata, context) {
var styleAst = this.visitStyle(metadata.styles, context);
var astParams = (metadata.options && metadata.options.params) || null;
if (styleAst.containsDynamicStyles) {
var missingSubs_1 = new Set();
var params_1 = astParams || {};
styleAst.styles.forEach(function (value) {
if (isObject(value)) {
var stylesObj_1 = value;
Object.keys(stylesObj_1).forEach(function (prop) {
extractStyleParams(stylesObj_1[prop]).forEach(function (sub) {
if (!params_1.hasOwnProperty(sub)) {
missingSubs_1.add(sub);
}
});
});
}
});
if (missingSubs_1.size) {
var missingSubsArr = iteratorToArray(missingSubs_1.values());
context.errors.push("state(\"" + metadata.name + "\", ...) must define default values for all the following style substitutions: " + missingSubsArr.join(', '));
}
}
return {
type: 0 /* State */,
name: metadata.name,
style: styleAst,
options: astParams ? { params: astParams } : null
};
};
AnimationAstBuilderVisitor.prototype.visitTransition = function (metadata, context) {
context.queryCount = 0;
context.depCount = 0;
var animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);
var matchers = parseTransitionExpr(metadata.expr, context.errors);
return {
type: 1 /* Transition */,
matchers: matchers,
animation: animation,
queryCount: context.queryCount,
depCount: context.depCount,
options: normalizeAnimationOptions(metadata.options)
};
};
AnimationAstBuilderVisitor.prototype.visitSequence = function (metadata, context) {
var _this = this;
return {
type: 2 /* Sequence */,
steps: metadata.steps.map(function (s) { return visitDslNode(_this, s, context); }),
options: normalizeAnimationOptions(metadata.options)
};
};
AnimationAstBuilderVisitor.prototype.visitGroup = function (metadata, context) {
var _this = this;
var currentTime = context.currentTime;
var furthestTime = 0;
var steps = metadata.steps.map(function (step) {
context.currentTime = currentTime;
var innerAst = visitDslNode(_this, step, context);
furthestTime = Math.max(furthestTime, context.currentTime);
return innerAst;
});
context.currentTime = furthestTime;
return {
type: 3 /* Group */,
steps: steps,
options: normalizeAnimationOptions(metadata.options)
};
};
AnimationAstBuilderVisitor.prototype.visitAnimate = function (metadata, context) {
var timingAst = constructTimingAst(metadata.timings, context.errors);
context.currentAnimateTimings = timingAst;
var styleAst;
var styleMetadata = metadata.styles ? metadata.styles : Object(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["style"])({});
if (styleMetadata.type == 5 /* Keyframes */) {
styleAst = this.visitKeyframes(styleMetadata, context);
}
else {
var styleMetadata_1 = metadata.styles;
var isEmpty = false;
if (!styleMetadata_1) {
isEmpty = true;
var newStyleData = {};
if (timingAst.easing) {
newStyleData['easing'] = timingAst.easing;
}
styleMetadata_1 = Object(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["style"])(newStyleData);
}
context.currentTime += timingAst.duration + timingAst.delay;
var _styleAst = this.visitStyle(styleMetadata_1, context);
_styleAst.isEmptyStep = isEmpty;
styleAst = _styleAst;
}
context.currentAnimateTimings = null;
return {
type: 4 /* Animate */,
timings: timingAst,
style: styleAst,
options: null
};
};
AnimationAstBuilderVisitor.prototype.visitStyle = function (metadata, context) {
var ast = this._makeStyleAst(metadata, context);
this._validateStyleAst(ast, context);
return ast;
};
AnimationAstBuilderVisitor.prototype._makeStyleAst = function (metadata, context) {
var styles = [];
if (Array.isArray(metadata.styles)) {
metadata.styles.forEach(function (styleTuple) {
if (typeof styleTuple == 'string') {
if (styleTuple == _angular_animations__WEBPACK_IMPORTED_MODULE_1__["AUTO_STYLE"]) {
styles.push(styleTuple);
}
else {
context.errors.push("The provided style string value " + styleTuple + " is not allowed.");
}
}
else {
styles.push(styleTuple);
}
});
}
else {
styles.push(metadata.styles);
}
var containsDynamicStyles = false;
var collectedEasing = null;
styles.forEach(function (styleData) {
if (isObject(styleData)) {
var styleMap = styleData;
var easing = styleMap['easing'];
if (easing) {
collectedEasing = easing;
delete styleMap['easing'];
}
if (!containsDynamicStyles) {
for (var prop in styleMap) {
var value = styleMap[prop];
if (value.toString().indexOf(SUBSTITUTION_EXPR_START) >= 0) {
containsDynamicStyles = true;
break;
}
}
}
}
});
return {
type: 6 /* Style */,
styles: styles,
easing: collectedEasing,
offset: metadata.offset, containsDynamicStyles: containsDynamicStyles,
options: null
};
};
AnimationAstBuilderVisitor.prototype._validateStyleAst = function (ast, context) {
var _this = this;
var timings = context.currentAnimateTimings;
var endTime = context.currentTime;
var startTime = context.currentTime;
if (timings && startTime > 0) {
startTime -= timings.duration + timings.delay;
}
ast.styles.forEach(function (tuple) {
if (typeof tuple == 'string')
return;
Object.keys(tuple).forEach(function (prop) {
if (!_this._driver.validateStyleProperty(prop)) {
context.errors.push("The provided animation property \"" + prop + "\" is not a supported CSS property for animations");
return;
}
var collectedStyles = context.collectedStyles[context.currentQuerySelector];
var collectedEntry = collectedStyles[prop];
var updateCollectedStyle = true;
if (collectedEntry) {
if (startTime != endTime && startTime >= collectedEntry.startTime &&
endTime <= collectedEntry.endTime) {
context.errors.push("The CSS property \"" + prop + "\" that exists between the times of \"" + collectedEntry.startTime + "ms\" and \"" + collectedEntry.endTime + "ms\" is also being animated in a parallel animation between the times of \"" + startTime + "ms\" and \"" + endTime + "ms\"");
updateCollectedStyle = false;
}
// we always choose the smaller start time value since we
// want to have a record of the entire animation window where
// the style property is being animated in between
startTime = collectedEntry.startTime;
}
if (updateCollectedStyle) {
collectedStyles[prop] = { startTime: startTime, endTime: endTime };
}
if (context.options) {
validateStyleParams(tuple[prop], context.options, context.errors);
}
});
});
};
AnimationAstBuilderVisitor.prototype.visitKeyframes = function (metadata, context) {
var _this = this;
var ast = { type: 5 /* Keyframes */, styles: [], options: null };
if (!context.currentAnimateTimings) {
context.errors.push("keyframes() must be placed inside of a call to animate()");
return ast;
}
var MAX_KEYFRAME_OFFSET = 1;
var totalKeyframesWithOffsets = 0;
var offsets = [];
var offsetsOutOfOrder = false;
var keyframesOutOfRange = false;
var previousOffset = 0;
var keyframes = metadata.steps.map(function (styles) {
var style$$1 = _this._makeStyleAst(styles, context);
var offsetVal = style$$1.offset != null ? style$$1.offset : consumeOffset(style$$1.styles);
var offset = 0;
if (offsetVal != null) {
totalKeyframesWithOffsets++;
offset = style$$1.offset = offsetVal;
}
keyframesOutOfRange = keyframesOutOfRange || offset < 0 || offset > 1;
offsetsOutOfOrder = offsetsOutOfOrder || offset < previousOffset;
previousOffset = offset;
offsets.push(offset);
return style$$1;
});
if (keyframesOutOfRange) {
context.errors.push("Please ensure that all keyframe offsets are between 0 and 1");
}
if (offsetsOutOfOrder) {
context.errors.push("Please ensure that all keyframe offsets are in order");
}
var length = metadata.steps.length;
var generatedOffset = 0;
if (totalKeyframesWithOffsets > 0 && totalKeyframesWithOffsets < length) {
context.errors.push("Not all style() steps within the declared keyframes() contain offsets");
}
else if (totalKeyframesWithOffsets == 0) {
generatedOffset = MAX_KEYFRAME_OFFSET / (length - 1);
}
var limit = length - 1;
var currentTime = context.currentTime;
var currentAnimateTimings = context.currentAnimateTimings;
var animateDuration = currentAnimateTimings.duration;
keyframes.forEach(function (kf, i) {
var offset = generatedOffset > 0 ? (i == limit ? 1 : (generatedOffset * i)) : offsets[i];
var durationUpToThisFrame = offset * animateDuration;
context.currentTime = currentTime + currentAnimateTimings.delay + durationUpToThisFrame;
currentAnimateTimings.duration = durationUpToThisFrame;
_this._validateStyleAst(kf, context);
kf.offset = offset;
ast.styles.push(kf);
});
return ast;
};
AnimationAstBuilderVisitor.prototype.visitReference = function (metadata, context) {
return {
type: 8 /* Reference */,
animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context),
options: normalizeAnimationOptions(metadata.options)
};
};
AnimationAstBuilderVisitor.prototype.visitAnimateChild = function (metadata, context) {
context.depCount++;
return {
type: 9 /* AnimateChild */,
options: normalizeAnimationOptions(metadata.options)
};
};
AnimationAstBuilderVisitor.prototype.visitAnimateRef = function (metadata, context) {
return {
type: 10 /* AnimateRef */,
animation: this.visitReference(metadata.animation, context),
options: normalizeAnimationOptions(metadata.options)
};
};
AnimationAstBuilderVisitor.prototype.visitQuery = function (metadata, context) {
var parentSelector = context.currentQuerySelector;
var options = (metadata.options || {});
context.queryCount++;
context.currentQuery = metadata;
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(normalizeSelector(metadata.selector), 2), selector = _a[0], includeSelf = _a[1];
context.currentQuerySelector =
parentSelector.length ? (parentSelector + ' ' + selector) : selector;
getOrSetAsInMap(context.collectedStyles, context.currentQuerySelector, {});
var animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);
context.currentQuery = null;
context.currentQuerySelector = parentSelector;
return {
type: 11 /* Query */,
selector: selector,
limit: options.limit || 0,
optional: !!options.optional, includeSelf: includeSelf, animation: animation,
originalSelector: metadata.selector,
options: normalizeAnimationOptions(metadata.options)
};
};
AnimationAstBuilderVisitor.prototype.visitStagger = function (metadata, context) {
if (!context.currentQuery) {
context.errors.push("stagger() can only be used inside of query()");
}
var timings = metadata.timings === 'full' ?
{ duration: 0, delay: 0, easing: 'full' } :
resolveTiming(metadata.timings, context.errors, true);
return {
type: 12 /* Stagger */,
animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context), timings: timings,
options: null
};
};
return AnimationAstBuilderVisitor;
}());
function normalizeSelector(selector) {
var hasAmpersand = selector.split(/\s*,\s*/).find(function (token) { return token == SELF_TOKEN; }) ? true : false;
if (hasAmpersand) {
selector = selector.replace(SELF_TOKEN_REGEX, '');
}
// the :enter and :leave selectors are filled in at runtime during timeline building
selector = selector.replace(/@\*/g, NG_TRIGGER_SELECTOR)
.replace(/@\w+/g, function (match) { return NG_TRIGGER_SELECTOR + '-' + match.substr(1); })
.replace(/:animating/g, NG_ANIMATING_SELECTOR);
return [selector, hasAmpersand];
}
function normalizeParams(obj) {
return obj ? copyObj(obj) : null;
}
var AnimationAstBuilderContext = /** @class */ (function () {
function AnimationAstBuilderContext(errors) {
this.errors = errors;
this.queryCount = 0;
this.depCount = 0;
this.currentTransition = null;
this.currentQuery = null;
this.currentQuerySelector = null;
this.currentAnimateTimings = null;
this.currentTime = 0;
this.collectedStyles = {};
this.options = null;
}
return AnimationAstBuilderContext;
}());
function consumeOffset(styles) {
if (typeof styles == 'string')
return null;
var offset = null;
if (Array.isArray(styles)) {
styles.forEach(function (styleTuple) {
if (isObject(styleTuple) && styleTuple.hasOwnProperty('offset')) {
var obj = styleTuple;
offset = parseFloat(obj['offset']);
delete obj['offset'];
}
});
}
else if (isObject(styles) && styles.hasOwnProperty('offset')) {
var obj = styles;
offset = parseFloat(obj['offset']);
delete obj['offset'];
}
return offset;
}
function isObject(value) {
return !Array.isArray(value) && typeof value == 'object';
}
function constructTimingAst(value, errors) {
var timings = null;
if (value.hasOwnProperty('duration')) {
timings = value;
}
else if (typeof value == 'number') {
var duration = resolveTiming(value, errors).duration;
return makeTimingAst(duration, 0, '');
}
var strValue = value;
var isDynamic = strValue.split(/\s+/).some(function (v) { return v.charAt(0) == '{' && v.charAt(1) == '{'; });
if (isDynamic) {
var ast = makeTimingAst(0, 0, '');
ast.dynamic = true;
ast.strValue = strValue;
return ast;
}
timings = timings || resolveTiming(strValue, errors);
return makeTimingAst(timings.duration, timings.delay, timings.easing);
}
function normalizeAnimationOptions(options) {
if (options) {
options = copyObj(options);
if (options['params']) {
options['params'] = normalizeParams(options['params']);
}
}
else {
options = {};
}
return options;
}
function makeTimingAst(duration, delay, easing) {
return { duration: duration, delay: delay, easing: easing };
}
function createTimelineInstruction(element, keyframes, preStyleProps, postStyleProps, duration, delay, easing, subTimeline) {
if (easing === void 0) { easing = null; }
if (subTimeline === void 0) { subTimeline = false; }
return {
type: 1 /* TimelineAnimation */,
element: element,
keyframes: keyframes,
preStyleProps: preStyleProps,
postStyleProps: postStyleProps,
duration: duration,
delay: delay,
totalTime: duration + delay, easing: easing, subTimeline: subTimeline
};
}
var ElementInstructionMap = /** @class */ (function () {
function ElementInstructionMap() {
this._map = new Map();
}
ElementInstructionMap.prototype.consume = function (element) {
var instructions = this._map.get(element);
if (instructions) {
this._map.delete(element);
}
else {
instructions = [];
}
return instructions;
};
ElementInstructionMap.prototype.append = function (element, instructions) {
var existingInstructions = this._map.get(element);
if (!existingInstructions) {
this._map.set(element, existingInstructions = []);
}
existingInstructions.push.apply(existingInstructions, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(instructions));
};
ElementInstructionMap.prototype.has = function (element) { return this._map.has(element); };
ElementInstructionMap.prototype.clear = function () { this._map.clear(); };
return ElementInstructionMap;
}());
var ONE_FRAME_IN_MILLISECONDS = 1;
var ENTER_TOKEN = ':enter';
var ENTER_TOKEN_REGEX = new RegExp(ENTER_TOKEN, 'g');
var LEAVE_TOKEN = ':leave';
var LEAVE_TOKEN_REGEX = new RegExp(LEAVE_TOKEN, 'g');
/*
* The code within this file aims to generate web-animations-compatible keyframes from Angular's
* animation DSL code.
*
* The code below will be converted from:
*
* ```
* sequence([
* style({ opacity: 0 }),
* animate(1000, style({ opacity: 0 }))
* ])
* ```
*
* To:
* ```
* keyframes = [{ opacity: 0, offset: 0 }, { opacity: 1, offset: 1 }]
* duration = 1000
* delay = 0
* easing = ''
* ```
*
* For this operation to cover the combination of animation verbs (style, animate, group, etc...) a
* combination of prototypical inheritance, AST traversal and merge-sort-like algorithms are used.
*
* [AST Traversal]
* Each of the animation verbs, when executed, will return an string-map object representing what
* type of action it is (style, animate, group, etc...) and the data associated with it. This means
* that when functional composition mix of these functions is evaluated (like in the example above)
* then it will end up producing a tree of objects representing the animation itself.
*
* When this animation object tree is processed by the visitor code below it will visit each of the
* verb statements within the visitor. And during each visit it will build the context of the
* animation keyframes by interacting with the `TimelineBuilder`.
*
* [TimelineBuilder]
* This class is responsible for tracking the styles and building a series of keyframe objects for a
* timeline between a start and end time. The builder starts off with an initial timeline and each
* time the AST comes across a `group()`, `keyframes()` or a combination of the two wihtin a
* `sequence()` then it will generate a sub timeline for each step as well as a new one after
* they are complete.
*
* As the AST is traversed, the timing state on each of the timelines will be incremented. If a sub
* timeline was created (based on one of the cases above) then the parent timeline will attempt to
* merge the styles used within the sub timelines into itself (only with group() this will happen).
* This happens with a merge operation (much like how the merge works in mergesort) and it will only
* copy the most recently used styles from the sub timelines into the parent timeline. This ensures
* that if the styles are used later on in another phase of the animation then they will be the most
* up-to-date values.
*
* [How Missing Styles Are Updated]
* Each timeline has a `backFill` property which is responsible for filling in new styles into
* already processed keyframes if a new style shows up later within the animation sequence.
*
* ```
* sequence([
* style({ width: 0 }),
* animate(1000, style({ width: 100 })),
* animate(1000, style({ width: 200 })),
* animate(1000, style({ width: 300 }))
* animate(1000, style({ width: 400, height: 400 })) // notice how `height` doesn't exist anywhere
* else
* ])
* ```
*
* What is happening here is that the `height` value is added later in the sequence, but is missing
* from all previous animation steps. Therefore when a keyframe is created it would also be missing
* from all previous keyframes up until where it is first used. For the timeline keyframe generation
* to properly fill in the style it will place the previous value (the value from the parent
* timeline) or a default value of `*` into the backFill object. Given that each of the keyframe
* styles are objects that prototypically inhert from the backFill object, this means that if a
* value is added into the backFill then it will automatically propagate any missing values to all
* keyframes. Therefore the missing `height` value will be properly filled into the already
* processed keyframes.
*
* When a sub-timeline is created it will have its own backFill property. This is done so that
* styles present within the sub-timeline do not accidentally seep into the previous/future timeline
* keyframes
*
* (For prototypically-inherited contents to be detected a `for(i in obj)` loop must be used.)
*
* [Validation]
* The code in this file is not responsible for validation. That functionality happens with within
* the `AnimationValidatorVisitor` code.
*/
function buildAnimationTimelines(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles, finalStyles, options, subInstructions, errors) {
if (startingStyles === void 0) { startingStyles = {}; }
if (finalStyles === void 0) { finalStyles = {}; }
if (errors === void 0) { errors = []; }
return new AnimationTimelineBuilderVisitor().buildKeyframes(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles, finalStyles, options, subInstructions, errors);
}
var AnimationTimelineBuilderVisitor = /** @class */ (function () {
function AnimationTimelineBuilderVisitor() {
}
AnimationTimelineBuilderVisitor.prototype.buildKeyframes = function (driver, rootElement, ast, enterClassName, leaveClassName, startingStyles, finalStyles, options, subInstructions, errors) {
if (errors === void 0) { errors = []; }
subInstructions = subInstructions || new ElementInstructionMap();
var context = new AnimationTimelineContext(driver, rootElement, subInstructions, enterClassName, leaveClassName, errors, []);
context.options = options;
context.currentTimeline.setStyles([startingStyles], null, context.errors, options);
visitDslNode(this, ast, context);
// this checks to see if an actual animation happened
var timelines = context.timelines.filter(function (timeline) { return timeline.containsAnimation(); });
if (timelines.length && Object.keys(finalStyles).length) {
var tl = timelines[timelines.length - 1];
if (!tl.allowOnlyTimelineStyles()) {
tl.setStyles([finalStyles], null, context.errors, options);
}
}
return timelines.length ? timelines.map(function (timeline) { return timeline.buildKeyframes(); }) :
[createTimelineInstruction(rootElement, [], [], [], 0, 0, '', false)];
};
AnimationTimelineBuilderVisitor.prototype.visitTrigger = function (ast, context) {
// these values are not visited in this AST
};
AnimationTimelineBuilderVisitor.prototype.visitState = function (ast, context) {
// these values are not visited in this AST
};
AnimationTimelineBuilderVisitor.prototype.visitTransition = function (ast, context) {
// these values are not visited in this AST
};
AnimationTimelineBuilderVisitor.prototype.visitAnimateChild = function (ast, context) {
var elementInstructions = context.subInstructions.consume(context.element);
if (elementInstructions) {
var innerContext = context.createSubContext(ast.options);
var startTime = context.currentTimeline.currentTime;
var endTime = this._visitSubInstructions(elementInstructions, innerContext, innerContext.options);
if (startTime != endTime) {
// we do this on the upper context because we created a sub context for
// the sub child animations
context.transformIntoNewTimeline(endTime);
}
}
context.previousNode = ast;
};
AnimationTimelineBuilderVisitor.prototype.visitAnimateRef = function (ast, context) {
var innerContext = context.createSubContext(ast.options);
innerContext.transformIntoNewTimeline();
this.visitReference(ast.animation, innerContext);
context.transformIntoNewTimeline(innerContext.currentTimeline.currentTime);
context.previousNode = ast;
};
AnimationTimelineBuilderVisitor.prototype._visitSubInstructions = function (instructions, context, options) {
var startTime = context.currentTimeline.currentTime;
var furthestTime = startTime;
// this is a special-case for when a user wants to skip a sub
// animation from being fired entirely.
var duration = options.duration != null ? resolveTimingValue(options.duration) : null;
var delay = options.delay != null ? resolveTimingValue(options.delay) : null;
if (duration !== 0) {
instructions.forEach(function (instruction) {
var instructionTimings = context.appendInstructionToTimeline(instruction, duration, delay);
furthestTime =
Math.max(furthestTime, instructionTimings.duration + instructionTimings.delay);
});
}
return furthestTime;
};
AnimationTimelineBuilderVisitor.prototype.visitReference = function (ast, context) {
context.updateOptions(ast.options, true);
visitDslNode(this, ast.animation, context);
context.previousNode = ast;
};
AnimationTimelineBuilderVisitor.prototype.visitSequence = function (ast, context) {
var _this = this;
var subContextCount = context.subContextCount;
var ctx = context;
var options = ast.options;
if (options && (options.params || options.delay)) {
ctx = context.createSubContext(options);
ctx.transformIntoNewTimeline();
if (options.delay != null) {
if (ctx.previousNode.type == 6 /* Style */) {
ctx.currentTimeline.snapshotCurrentStyles();
ctx.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
}
var delay = resolveTimingValue(options.delay);
ctx.delayNextStep(delay);
}
}
if (ast.steps.length) {
ast.steps.forEach(function (s) { return visitDslNode(_this, s, ctx); });
// this is here just incase the inner steps only contain or end with a style() call
ctx.currentTimeline.applyStylesToKeyframe();
// this means that some animation function within the sequence
// ended up creating a sub timeline (which means the current
// timeline cannot overlap with the contents of the sequence)
if (ctx.subContextCount > subContextCount) {
ctx.transformIntoNewTimeline();
}
}
context.previousNode = ast;
};
AnimationTimelineBuilderVisitor.prototype.visitGroup = function (ast, context) {
var _this = this;
var innerTimelines = [];
var furthestTime = context.currentTimeline.currentTime;
var delay = ast.options && ast.options.delay ? resolveTimingValue(ast.options.delay) : 0;
ast.steps.forEach(function (s) {
var innerContext = context.createSubContext(ast.options);
if (delay) {
innerContext.delayNextStep(delay);
}
visitDslNode(_this, s, innerContext);
furthestTime = Math.max(furthestTime, innerContext.currentTimeline.currentTime);
innerTimelines.push(innerContext.currentTimeline);
});
// this operation is run after the AST loop because otherwise
// if the parent timeline's collected styles were updated then
// it would pass in invalid data into the new-to-be forked items
innerTimelines.forEach(function (timeline) { return context.currentTimeline.mergeTimelineCollectedStyles(timeline); });
context.transformIntoNewTimeline(furthestTime);
context.previousNode = ast;
};
AnimationTimelineBuilderVisitor.prototype._visitTiming = function (ast, context) {
if (ast.dynamic) {
var strValue = ast.strValue;
var timingValue = context.params ? interpolateParams(strValue, context.params, context.errors) : strValue;
return resolveTiming(timingValue, context.errors);
}
else {
return { duration: ast.duration, delay: ast.delay, easing: ast.easing };
}
};
AnimationTimelineBuilderVisitor.prototype.visitAnimate = function (ast, context) {
var timings = context.currentAnimateTimings = this._visitTiming(ast.timings, context);
var timeline = context.currentTimeline;
if (timings.delay) {
context.incrementTime(timings.delay);
timeline.snapshotCurrentStyles();
}
var style$$1 = ast.style;
if (style$$1.type == 5 /* Keyframes */) {
this.visitKeyframes(style$$1, context);
}
else {
context.incrementTime(timings.duration);
this.visitStyle(style$$1, context);
timeline.applyStylesToKeyframe();
}
context.currentAnimateTimings = null;
context.previousNode = ast;
};
AnimationTimelineBuilderVisitor.prototype.visitStyle = function (ast, context) {
var timeline = context.currentTimeline;
var timings = context.currentAnimateTimings;
// this is a special case for when a style() call
// directly follows an animate() call (but not inside of an animate() call)
if (!timings && timeline.getCurrentStyleProperties().length) {
timeline.forwardFrame();
}
var easing = (timings && timings.easing) || ast.easing;
if (ast.isEmptyStep) {
timeline.applyEmptyStep(easing);
}
else {
timeline.setStyles(ast.styles, easing, context.errors, context.options);
}
context.previousNode = ast;
};
AnimationTimelineBuilderVisitor.prototype.visitKeyframes = function (ast, context) {
var currentAnimateTimings = context.currentAnimateTimings;
var startTime = (context.currentTimeline).duration;
var duration = currentAnimateTimings.duration;
var innerContext = context.createSubContext();
var innerTimeline = innerContext.currentTimeline;
innerTimeline.easing = currentAnimateTimings.easing;
ast.styles.forEach(function (step) {
var offset = step.offset || 0;
innerTimeline.forwardTime(offset * duration);
innerTimeline.setStyles(step.styles, step.easing, context.errors, context.options);
innerTimeline.applyStylesToKeyframe();
});
// this will ensure that the parent timeline gets all the styles from
// the child even if the new timeline below is not used
context.currentTimeline.mergeTimelineCollectedStyles(innerTimeline);
// we do this because the window between this timeline and the sub timeline
// should ensure that the styles within are exactly the same as they were before
context.transformIntoNewTimeline(startTime + duration);
context.previousNode = ast;
};
AnimationTimelineBuilderVisitor.prototype.visitQuery = function (ast, context) {
var _this = this;
// in the event that the first step before this is a style step we need
// to ensure the styles are applied before the children are animated
var startTime = context.currentTimeline.currentTime;
var options = (ast.options || {});
var delay = options.delay ? resolveTimingValue(options.delay) : 0;
if (delay && (context.previousNode.type === 6 /* Style */ ||
(startTime == 0 && context.currentTimeline.getCurrentStyleProperties().length))) {
context.currentTimeline.snapshotCurrentStyles();
context.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
}
var furthestTime = startTime;
var elms = context.invokeQuery(ast.selector, ast.originalSelector, ast.limit, ast.includeSelf, options.optional ? true : false, context.errors);
context.currentQueryTotal = elms.length;
var sameElementTimeline = null;
elms.forEach(function (element, i) {
context.currentQueryIndex = i;
var innerContext = context.createSubContext(ast.options, element);
if (delay) {
innerContext.delayNextStep(delay);
}
if (element === context.element) {
sameElementTimeline = innerContext.currentTimeline;
}
visitDslNode(_this, ast.animation, innerContext);
// this is here just incase the inner steps only contain or end
// with a style() call (which is here to signal that this is a preparatory
// call to style an element before it is animated again)
innerContext.currentTimeline.applyStylesToKeyframe();
var endTime = innerContext.currentTimeline.currentTime;
furthestTime = Math.max(furthestTime, endTime);
});
context.currentQueryIndex = 0;
context.currentQueryTotal = 0;
context.transformIntoNewTimeline(furthestTime);
if (sameElementTimeline) {
context.currentTimeline.mergeTimelineCollectedStyles(sameElementTimeline);
context.currentTimeline.snapshotCurrentStyles();
}
context.previousNode = ast;
};
AnimationTimelineBuilderVisitor.prototype.visitStagger = function (ast, context) {
var parentContext = context.parentContext;
var tl = context.currentTimeline;
var timings = ast.timings;
var duration = Math.abs(timings.duration);
var maxTime = duration * (context.currentQueryTotal - 1);
var delay = duration * context.currentQueryIndex;
var staggerTransformer = timings.duration < 0 ? 'reverse' : timings.easing;
switch (staggerTransformer) {
case 'reverse':
delay = maxTime - delay;
break;
case 'full':
delay = parentContext.currentStaggerTime;
break;
}
var timeline = context.currentTimeline;
if (delay) {
timeline.delayNextStep(delay);
}
var startingTime = timeline.currentTime;
visitDslNode(this, ast.animation, context);
context.previousNode = ast;
// time = duration + delay
// the reason why this computation is so complex is because
// the inner timeline may either have a delay value or a stretched
// keyframe depending on if a subtimeline is not used or is used.
parentContext.currentStaggerTime =
(tl.currentTime - startingTime) + (tl.startTime - parentContext.currentTimeline.startTime);
};
return AnimationTimelineBuilderVisitor;
}());
var DEFAULT_NOOP_PREVIOUS_NODE = {};
var AnimationTimelineContext = /** @class */ (function () {
function AnimationTimelineContext(_driver, element, subInstructions, _enterClassName, _leaveClassName, errors, timelines, initialTimeline) {
this._driver = _driver;
this.element = element;
this.subInstructions = subInstructions;
this._enterClassName = _enterClassName;
this._leaveClassName = _leaveClassName;
this.errors = errors;
this.timelines = timelines;
this.parentContext = null;
this.currentAnimateTimings = null;
this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
this.subContextCount = 0;
this.options = {};
this.currentQueryIndex = 0;
this.currentQueryTotal = 0;
this.currentStaggerTime = 0;
this.currentTimeline = initialTimeline || new TimelineBuilder(this._driver, element, 0);
timelines.push(this.currentTimeline);
}
Object.defineProperty(AnimationTimelineContext.prototype, "params", {
get: function () { return this.options.params; },
enumerable: true,
configurable: true
});
AnimationTimelineContext.prototype.updateOptions = function (options, skipIfExists) {
var _this = this;
if (!options)
return;
var newOptions = options;
var optionsToUpdate = this.options;
// NOTE: this will get patched up when other animation methods support duration overrides
if (newOptions.duration != null) {
optionsToUpdate.duration = resolveTimingValue(newOptions.duration);
}
if (newOptions.delay != null) {
optionsToUpdate.delay = resolveTimingValue(newOptions.delay);
}
var newParams = newOptions.params;
if (newParams) {
var paramsToUpdate_1 = optionsToUpdate.params;
if (!paramsToUpdate_1) {
paramsToUpdate_1 = this.options.params = {};
}
Object.keys(newParams).forEach(function (name) {
if (!skipIfExists || !paramsToUpdate_1.hasOwnProperty(name)) {
paramsToUpdate_1[name] = interpolateParams(newParams[name], paramsToUpdate_1, _this.errors);
}
});
}
};
AnimationTimelineContext.prototype._copyOptions = function () {
var options = {};
if (this.options) {
var oldParams_1 = this.options.params;
if (oldParams_1) {
var params_1 = options['params'] = {};
Object.keys(oldParams_1).forEach(function (name) { params_1[name] = oldParams_1[name]; });
}
}
return options;
};
AnimationTimelineContext.prototype.createSubContext = function (options, element, newTime) {
if (options === void 0) { options = null; }
var target = element || this.element;
var context = new AnimationTimelineContext(this._driver, target, this.subInstructions, this._enterClassName, this._leaveClassName, this.errors, this.timelines, this.currentTimeline.fork(target, newTime || 0));
context.previousNode = this.previousNode;
context.currentAnimateTimings = this.currentAnimateTimings;
context.options = this._copyOptions();
context.updateOptions(options);
context.currentQueryIndex = this.currentQueryIndex;
context.currentQueryTotal = this.currentQueryTotal;
context.parentContext = this;
this.subContextCount++;
return context;
};
AnimationTimelineContext.prototype.transformIntoNewTimeline = function (newTime) {
this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
this.currentTimeline = this.currentTimeline.fork(this.element, newTime);
this.timelines.push(this.currentTimeline);
return this.currentTimeline;
};
AnimationTimelineContext.prototype.appendInstructionToTimeline = function (instruction, duration, delay) {
var updatedTimings = {
duration: duration != null ? duration : instruction.duration,
delay: this.currentTimeline.currentTime + (delay != null ? delay : 0) + instruction.delay,
easing: ''
};
var builder = new SubTimelineBuilder(this._driver, instruction.element, instruction.keyframes, instruction.preStyleProps, instruction.postStyleProps, updatedTimings, instruction.stretchStartingKeyframe);
this.timelines.push(builder);
return updatedTimings;
};
AnimationTimelineContext.prototype.incrementTime = function (time) {
this.currentTimeline.forwardTime(this.currentTimeline.duration + time);
};
AnimationTimelineContext.prototype.delayNextStep = function (delay) {
// negative delays are not yet supported
if (delay > 0) {
this.currentTimeline.delayNextStep(delay);
}
};
AnimationTimelineContext.prototype.invokeQuery = function (selector, originalSelector, limit, includeSelf, optional, errors) {
var results = [];
if (includeSelf) {
results.push(this.element);
}
if (selector.length > 0) {
selector = selector.replace(ENTER_TOKEN_REGEX, '.' + this._enterClassName);
selector = selector.replace(LEAVE_TOKEN_REGEX, '.' + this._leaveClassName);
var multi = limit != 1;
var elements = this._driver.query(this.element, selector, multi);
if (limit !== 0) {
elements = limit < 0 ? elements.slice(elements.length + limit, elements.length) :
elements.slice(0, limit);
}
results.push.apply(results, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(elements));
}
if (!optional && results.length == 0) {
errors.push("`query(\"" + originalSelector + "\")` returned zero elements. (Use `query(\"" + originalSelector + "\", { optional: true })` if you wish to allow this.)");
}
return results;
};
return AnimationTimelineContext;
}());
var TimelineBuilder = /** @class */ (function () {
function TimelineBuilder(_driver, element, startTime, _elementTimelineStylesLookup) {
this._driver = _driver;
this.element = element;
this.startTime = startTime;
this._elementTimelineStylesLookup = _elementTimelineStylesLookup;
this.duration = 0;
this._previousKeyframe = {};
this._currentKeyframe = {};
this._keyframes = new Map();
this._styleSummary = {};
this._pendingStyles = {};
this._backFill = {};
this._currentEmptyStepKeyframe = null;
if (!this._elementTimelineStylesLookup) {
this._elementTimelineStylesLookup = new Map();
}
this._localTimelineStyles = Object.create(this._backFill, {});
this._globalTimelineStyles = this._elementTimelineStylesLookup.get(element);
if (!this._globalTimelineStyles) {
this._globalTimelineStyles = this._localTimelineStyles;
this._elementTimelineStylesLookup.set(element, this._localTimelineStyles);
}
this._loadKeyframe();
}
TimelineBuilder.prototype.containsAnimation = function () {
switch (this._keyframes.size) {
case 0:
return false;
case 1:
return this.getCurrentStyleProperties().length > 0;
default:
return true;
}
};
TimelineBuilder.prototype.getCurrentStyleProperties = function () { return Object.keys(this._currentKeyframe); };
Object.defineProperty(TimelineBuilder.prototype, "currentTime", {
get: function () { return this.startTime + this.duration; },
enumerable: true,
configurable: true
});
TimelineBuilder.prototype.delayNextStep = function (delay) {
// in the event that a style() step is placed right before a stagger()
// and that style() step is the very first style() value in the animation
// then we need to make a copy of the keyframe [0, copy, 1] so that the delay
// properly applies the style() values to work with the stagger...
var hasPreStyleStep = this._keyframes.size == 1 && Object.keys(this._pendingStyles).length;
if (this.duration || hasPreStyleStep) {
this.forwardTime(this.currentTime + delay);
if (hasPreStyleStep) {
this.snapshotCurrentStyles();
}
}
else {
this.startTime += delay;
}
};
TimelineBuilder.prototype.fork = function (element, currentTime) {
this.applyStylesToKeyframe();
return new TimelineBuilder(this._driver, element, currentTime || this.currentTime, this._elementTimelineStylesLookup);
};
TimelineBuilder.prototype._loadKeyframe = function () {
if (this._currentKeyframe) {
this._previousKeyframe = this._currentKeyframe;
}
this._currentKeyframe = this._keyframes.get(this.duration);
if (!this._currentKeyframe) {
this._currentKeyframe = Object.create(this._backFill, {});
this._keyframes.set(this.duration, this._currentKeyframe);
}
};
TimelineBuilder.prototype.forwardFrame = function () {
this.duration += ONE_FRAME_IN_MILLISECONDS;
this._loadKeyframe();
};
TimelineBuilder.prototype.forwardTime = function (time) {
this.applyStylesToKeyframe();
this.duration = time;
this._loadKeyframe();
};
TimelineBuilder.prototype._updateStyle = function (prop, value) {
this._localTimelineStyles[prop] = value;
this._globalTimelineStyles[prop] = value;
this._styleSummary[prop] = { time: this.currentTime, value: value };
};
TimelineBuilder.prototype.allowOnlyTimelineStyles = function () { return this._currentEmptyStepKeyframe !== this._currentKeyframe; };
TimelineBuilder.prototype.applyEmptyStep = function (easing) {
var _this = this;
if (easing) {
this._previousKeyframe['easing'] = easing;
}
// special case for animate(duration):
// all missing styles are filled with a `*` value then
// if any destination styles are filled in later on the same
// keyframe then they will override the overridden styles
// We use `_globalTimelineStyles` here because there may be
// styles in previous keyframes that are not present in this timeline
Object.keys(this._globalTimelineStyles).forEach(function (prop) {
_this._backFill[prop] = _this._globalTimelineStyles[prop] || _angular_animations__WEBPACK_IMPORTED_MODULE_1__["AUTO_STYLE"];
_this._currentKeyframe[prop] = _angular_animations__WEBPACK_IMPORTED_MODULE_1__["AUTO_STYLE"];
});
this._currentEmptyStepKeyframe = this._currentKeyframe;
};
TimelineBuilder.prototype.setStyles = function (input, easing, errors, options) {
var _this = this;
if (easing) {
this._previousKeyframe['easing'] = easing;
}
var params = (options && options.params) || {};
var styles = flattenStyles(input, this._globalTimelineStyles);
Object.keys(styles).forEach(function (prop) {
var val = interpolateParams(styles[prop], params, errors);
_this._pendingStyles[prop] = val;
if (!_this._localTimelineStyles.hasOwnProperty(prop)) {
_this._backFill[prop] = _this._globalTimelineStyles.hasOwnProperty(prop) ?
_this._globalTimelineStyles[prop] :
_angular_animations__WEBPACK_IMPORTED_MODULE_1__["AUTO_STYLE"];
}
_this._updateStyle(prop, val);
});
};
TimelineBuilder.prototype.applyStylesToKeyframe = function () {
var _this = this;
var styles = this._pendingStyles;
var props = Object.keys(styles);
if (props.length == 0)
return;
this._pendingStyles = {};
props.forEach(function (prop) {
var val = styles[prop];
_this._currentKeyframe[prop] = val;
});
Object.keys(this._localTimelineStyles).forEach(function (prop) {
if (!_this._currentKeyframe.hasOwnProperty(prop)) {
_this._currentKeyframe[prop] = _this._localTimelineStyles[prop];
}
});
};
TimelineBuilder.prototype.snapshotCurrentStyles = function () {
var _this = this;
Object.keys(this._localTimelineStyles).forEach(function (prop) {
var val = _this._localTimelineStyles[prop];
_this._pendingStyles[prop] = val;
_this._updateStyle(prop, val);
});
};
TimelineBuilder.prototype.getFinalKeyframe = function () { return this._keyframes.get(this.duration); };
Object.defineProperty(TimelineBuilder.prototype, "properties", {
get: function () {
var properties = [];
for (var prop in this._currentKeyframe) {
properties.push(prop);
}
return properties;
},
enumerable: true,
configurable: true
});
TimelineBuilder.prototype.mergeTimelineCollectedStyles = function (timeline) {
var _this = this;
Object.keys(timeline._styleSummary).forEach(function (prop) {
var details0 = _this._styleSummary[prop];
var details1 = timeline._styleSummary[prop];
if (!details0 || details1.time > details0.time) {
_this._updateStyle(prop, details1.value);
}
});
};
TimelineBuilder.prototype.buildKeyframes = function () {
var _this = this;
this.applyStylesToKeyframe();
var preStyleProps = new Set();
var postStyleProps = new Set();
var isEmpty = this._keyframes.size === 1 && this.duration === 0;
var finalKeyframes = [];
this._keyframes.forEach(function (keyframe, time) {
var finalKeyframe = copyStyles(keyframe, true);
Object.keys(finalKeyframe).forEach(function (prop) {
var value = finalKeyframe[prop];
if (value == _angular_animations__WEBPACK_IMPORTED_MODULE_1__["ɵPRE_STYLE"]) {
preStyleProps.add(prop);
}
else if (value == _angular_animations__WEBPACK_IMPORTED_MODULE_1__["AUTO_STYLE"]) {
postStyleProps.add(prop);
}
});
if (!isEmpty) {
finalKeyframe['offset'] = time / _this.duration;
}
finalKeyframes.push(finalKeyframe);
});
var preProps = preStyleProps.size ? iteratorToArray(preStyleProps.values()) : [];
var postProps = postStyleProps.size ? iteratorToArray(postStyleProps.values()) : [];
// special case for a 0-second animation (which is designed just to place styles onscreen)
if (isEmpty) {
var kf0 = finalKeyframes[0];
var kf1 = copyObj(kf0);
kf0['offset'] = 0;
kf1['offset'] = 1;
finalKeyframes = [kf0, kf1];
}
return createTimelineInstruction(this.element, finalKeyframes, preProps, postProps, this.duration, this.startTime, this.easing, false);
};
return TimelineBuilder;
}());
var SubTimelineBuilder = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SubTimelineBuilder, _super);
function SubTimelineBuilder(driver, element, keyframes, preStyleProps, postStyleProps, timings, _stretchStartingKeyframe) {
if (_stretchStartingKeyframe === void 0) { _stretchStartingKeyframe = false; }
var _this = _super.call(this, driver, element, timings.delay) || this;
_this.element = element;
_this.keyframes = keyframes;
_this.preStyleProps = preStyleProps;
_this.postStyleProps = postStyleProps;
_this._stretchStartingKeyframe = _stretchStartingKeyframe;
_this.timings = { duration: timings.duration, delay: timings.delay, easing: timings.easing };
return _this;
}
SubTimelineBuilder.prototype.containsAnimation = function () { return this.keyframes.length > 1; };
SubTimelineBuilder.prototype.buildKeyframes = function () {
var keyframes = this.keyframes;
var _a = this.timings, delay = _a.delay, duration = _a.duration, easing = _a.easing;
if (this._stretchStartingKeyframe && delay) {
var newKeyframes = [];
var totalTime = duration + delay;
var startingGap = delay / totalTime;
// the original starting keyframe now starts once the delay is done
var newFirstKeyframe = copyStyles(keyframes[0], false);
newFirstKeyframe['offset'] = 0;
newKeyframes.push(newFirstKeyframe);
var oldFirstKeyframe = copyStyles(keyframes[0], false);
oldFirstKeyframe['offset'] = roundOffset(startingGap);
newKeyframes.push(oldFirstKeyframe);
/*
When the keyframe is stretched then it means that the delay before the animation
starts is gone. Instead the first keyframe is placed at the start of the animation
and it is then copied to where it starts when the original delay is over. This basically
means nothing animates during that delay, but the styles are still renderered. For this
to work the original offset values that exist in the original keyframes must be "warped"
so that they can take the new keyframe + delay into account.
delay=1000, duration=1000, keyframes = 0 .5 1
turns into
delay=0, duration=2000, keyframes = 0 .33 .66 1
*/
// offsets between 1 ... n -1 are all warped by the keyframe stretch
var limit = keyframes.length - 1;
for (var i = 1; i <= limit; i++) {
var kf = copyStyles(keyframes[i], false);
var oldOffset = kf['offset'];
var timeAtKeyframe = delay + oldOffset * duration;
kf['offset'] = roundOffset(timeAtKeyframe / totalTime);
newKeyframes.push(kf);
}
// the new starting keyframe should be added at the start
duration = totalTime;
delay = 0;
easing = '';
keyframes = newKeyframes;
}
return createTimelineInstruction(this.element, keyframes, this.preStyleProps, this.postStyleProps, duration, delay, easing, true);
};
return SubTimelineBuilder;
}(TimelineBuilder));
function roundOffset(offset, decimalPoints) {
if (decimalPoints === void 0) { decimalPoints = 3; }
var mult = Math.pow(10, decimalPoints - 1);
return Math.round(offset * mult) / mult;
}
function flattenStyles(input, allStyles) {
var styles = {};
var allProperties;
input.forEach(function (token) {
if (token === '*') {
allProperties = allProperties || Object.keys(allStyles);
allProperties.forEach(function (prop) { styles[prop] = _angular_animations__WEBPACK_IMPORTED_MODULE_1__["AUTO_STYLE"]; });
}
else {
copyStyles(token, false, styles);
}
});
return styles;
}
var Animation = /** @class */ (function () {
function Animation(_driver, input) {
this._driver = _driver;
var errors = [];
var ast = buildAnimationAst(_driver, input, errors);
if (errors.length) {
var errorMessage = "animation validation failed:\n" + errors.join("\n");
throw new Error(errorMessage);
}
this._animationAst = ast;
}
Animation.prototype.buildTimelines = function (element, startingStyles, destinationStyles, options, subInstructions) {
var start = Array.isArray(startingStyles) ? normalizeStyles(startingStyles) :
startingStyles;
var dest = Array.isArray(destinationStyles) ? normalizeStyles(destinationStyles) :
destinationStyles;
var errors = [];
subInstructions = subInstructions || new ElementInstructionMap();
var result = buildAnimationTimelines(this._driver, element, this._animationAst, ENTER_CLASSNAME, LEAVE_CLASSNAME, start, dest, options, subInstructions, errors);
if (errors.length) {
var errorMessage = "animation building failed:\n" + errors.join("\n");
throw new Error(errorMessage);
}
return result;
};
return Animation;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @experimental Animation support is experimental.
*/
var AnimationStyleNormalizer = /** @class */ (function () {
function AnimationStyleNormalizer() {
}
return AnimationStyleNormalizer;
}());
/**
* @experimental Animation support is experimental.
*/
var NoopAnimationStyleNormalizer = /** @class */ (function () {
function NoopAnimationStyleNormalizer() {
}
NoopAnimationStyleNormalizer.prototype.normalizePropertyName = function (propertyName, errors) { return propertyName; };
NoopAnimationStyleNormalizer.prototype.normalizeStyleValue = function (userProvidedProperty, normalizedProperty, value, errors) {
return value;
};
return NoopAnimationStyleNormalizer;
}());
var WebAnimationsStyleNormalizer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(WebAnimationsStyleNormalizer, _super);
function WebAnimationsStyleNormalizer() {
return _super !== null && _super.apply(this, arguments) || this;
}
WebAnimationsStyleNormalizer.prototype.normalizePropertyName = function (propertyName, errors) {
return dashCaseToCamelCase(propertyName);
};
WebAnimationsStyleNormalizer.prototype.normalizeStyleValue = function (userProvidedProperty, normalizedProperty, value, errors) {
var unit = '';
var strVal = value.toString().trim();
if (DIMENSIONAL_PROP_MAP[normalizedProperty] && value !== 0 && value !== '0') {
if (typeof value === 'number') {
unit = 'px';
}
else {
var valAndSuffixMatch = value.match(/^[+-]?[\d\.]+([a-z]*)$/);
if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {
errors.push("Please provide a CSS unit value for " + userProvidedProperty + ":" + value);
}
}
}
return strVal + unit;
};
return WebAnimationsStyleNormalizer;
}(AnimationStyleNormalizer));
var DIMENSIONAL_PROP_MAP = makeBooleanMap('width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective'
.split(','));
function makeBooleanMap(keys) {
var map = {};
keys.forEach(function (key) { return map[key] = true; });
return map;
}
function createTransitionInstruction(element, triggerName, fromState, toState, isRemovalTransition, fromStyles, toStyles, timelines, queriedElements, preStyleProps, postStyleProps, totalTime, errors) {
return {
type: 0 /* TransitionAnimation */,
element: element,
triggerName: triggerName,
isRemovalTransition: isRemovalTransition,
fromState: fromState,
fromStyles: fromStyles,
toState: toState,
toStyles: toStyles,
timelines: timelines,
queriedElements: queriedElements,
preStyleProps: preStyleProps,
postStyleProps: postStyleProps,
totalTime: totalTime,
errors: errors
};
}
var EMPTY_OBJECT = {};
var AnimationTransitionFactory = /** @class */ (function () {
function AnimationTransitionFactory(_triggerName, ast, _stateStyles) {
this._triggerName = _triggerName;
this.ast = ast;
this._stateStyles = _stateStyles;
}
AnimationTransitionFactory.prototype.match = function (currentState, nextState, element, params) {
return oneOrMoreTransitionsMatch(this.ast.matchers, currentState, nextState, element, params);
};
AnimationTransitionFactory.prototype.buildStyles = function (stateName, params, errors) {
var backupStateStyler = this._stateStyles['*'];
var stateStyler = this._stateStyles[stateName];
var backupStyles = backupStateStyler ? backupStateStyler.buildStyles(params, errors) : {};
return stateStyler ? stateStyler.buildStyles(params, errors) : backupStyles;
};
AnimationTransitionFactory.prototype.build = function (driver, element, currentState, nextState, enterClassName, leaveClassName, currentOptions, nextOptions, subInstructions, skipAstBuild) {
var errors = [];
var transitionAnimationParams = this.ast.options && this.ast.options.params || EMPTY_OBJECT;
var currentAnimationParams = currentOptions && currentOptions.params || EMPTY_OBJECT;
var currentStateStyles = this.buildStyles(currentState, currentAnimationParams, errors);
var nextAnimationParams = nextOptions && nextOptions.params || EMPTY_OBJECT;
var nextStateStyles = this.buildStyles(nextState, nextAnimationParams, errors);
var queriedElements = new Set();
var preStyleMap = new Map();
var postStyleMap = new Map();
var isRemoval = nextState === 'void';
var animationOptions = { params: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, transitionAnimationParams, nextAnimationParams) };
var timelines = skipAstBuild ? [] : buildAnimationTimelines(driver, element, this.ast.animation, enterClassName, leaveClassName, currentStateStyles, nextStateStyles, animationOptions, subInstructions, errors);
var totalTime = 0;
timelines.forEach(function (tl) { totalTime = Math.max(tl.duration + tl.delay, totalTime); });
if (errors.length) {
return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, [], [], preStyleMap, postStyleMap, totalTime, errors);
}
timelines.forEach(function (tl) {
var elm = tl.element;
var preProps = getOrSetAsInMap(preStyleMap, elm, {});
tl.preStyleProps.forEach(function (prop) { return preProps[prop] = true; });
var postProps = getOrSetAsInMap(postStyleMap, elm, {});
tl.postStyleProps.forEach(function (prop) { return postProps[prop] = true; });
if (elm !== element) {
queriedElements.add(elm);
}
});
var queriedElementsList = iteratorToArray(queriedElements.values());
return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, timelines, queriedElementsList, preStyleMap, postStyleMap, totalTime);
};
return AnimationTransitionFactory;
}());
function oneOrMoreTransitionsMatch(matchFns, currentState, nextState, element, params) {
return matchFns.some(function (fn) { return fn(currentState, nextState, element, params); });
}
var AnimationStateStyles = /** @class */ (function () {
function AnimationStateStyles(styles, defaultParams) {
this.styles = styles;
this.defaultParams = defaultParams;
}
AnimationStateStyles.prototype.buildStyles = function (params, errors) {
var finalStyles = {};
var combinedParams = copyObj(this.defaultParams);
Object.keys(params).forEach(function (key) {
var value = params[key];
if (value != null) {
combinedParams[key] = value;
}
});
this.styles.styles.forEach(function (value) {
if (typeof value !== 'string') {
var styleObj_1 = value;
Object.keys(styleObj_1).forEach(function (prop) {
var val = styleObj_1[prop];
if (val.length > 1) {
val = interpolateParams(val, combinedParams, errors);
}
finalStyles[prop] = val;
});
}
});
return finalStyles;
};
return AnimationStateStyles;
}());
/**
* @experimental Animation support is experimental.
*/
function buildTrigger(name, ast) {
return new AnimationTrigger(name, ast);
}
/**
* @experimental Animation support is experimental.
*/
var AnimationTrigger = /** @class */ (function () {
function AnimationTrigger(name, ast) {
var _this = this;
this.name = name;
this.ast = ast;
this.transitionFactories = [];
this.states = {};
ast.states.forEach(function (ast) {
var defaultParams = (ast.options && ast.options.params) || {};
_this.states[ast.name] = new AnimationStateStyles(ast.style, defaultParams);
});
balanceProperties(this.states, 'true', '1');
balanceProperties(this.states, 'false', '0');
ast.transitions.forEach(function (ast) {
_this.transitionFactories.push(new AnimationTransitionFactory(name, ast, _this.states));
});
this.fallbackTransition = createFallbackTransition(name, this.states);
}
Object.defineProperty(AnimationTrigger.prototype, "containsQueries", {
get: function () { return this.ast.queryCount > 0; },
enumerable: true,
configurable: true
});
AnimationTrigger.prototype.matchTransition = function (currentState, nextState, element, params) {
var entry = this.transitionFactories.find(function (f) { return f.match(currentState, nextState, element, params); });
return entry || null;
};
AnimationTrigger.prototype.matchStyles = function (currentState, params, errors) {
return this.fallbackTransition.buildStyles(currentState, params, errors);
};
return AnimationTrigger;
}());
function createFallbackTransition(triggerName, states) {
var matchers = [function (fromState, toState) { return true; }];
var animation = { type: 2 /* Sequence */, steps: [], options: null };
var transition = {
type: 1 /* Transition */,
animation: animation,
matchers: matchers,
options: null,
queryCount: 0,
depCount: 0
};
return new AnimationTransitionFactory(triggerName, transition, states);
}
function balanceProperties(obj, key1, key2) {
if (obj.hasOwnProperty(key1)) {
if (!obj.hasOwnProperty(key2)) {
obj[key2] = obj[key1];
}
}
else if (obj.hasOwnProperty(key2)) {
obj[key1] = obj[key2];
}
}
/**
* @license
* Copyright Google Inc. 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 EMPTY_INSTRUCTION_MAP = new ElementInstructionMap();
var TimelineAnimationEngine = /** @class */ (function () {
function TimelineAnimationEngine(bodyNode, _driver, _normalizer) {
this.bodyNode = bodyNode;
this._driver = _driver;
this._normalizer = _normalizer;
this._animations = {};
this._playersById = {};
this.players = [];
}
TimelineAnimationEngine.prototype.register = function (id, metadata) {
var errors = [];
var ast = buildAnimationAst(this._driver, metadata, errors);
if (errors.length) {
throw new Error("Unable to build the animation due to the following errors: " + errors.join("\n"));
}
else {
this._animations[id] = ast;
}
};
TimelineAnimationEngine.prototype._buildPlayer = function (i, preStyles, postStyles) {
var element = i.element;
var keyframes = normalizeKeyframes(this._driver, this._normalizer, element, i.keyframes, preStyles, postStyles);
return this._driver.animate(element, keyframes, i.duration, i.delay, i.easing, [], true);
};
TimelineAnimationEngine.prototype.create = function (id, element, options) {
var _this = this;
if (options === void 0) { options = {}; }
var errors = [];
var ast = this._animations[id];
var instructions;
var autoStylesMap = new Map();
if (ast) {
instructions = buildAnimationTimelines(this._driver, element, ast, ENTER_CLASSNAME, LEAVE_CLASSNAME, {}, {}, options, EMPTY_INSTRUCTION_MAP, errors);
instructions.forEach(function (inst) {
var styles = getOrSetAsInMap(autoStylesMap, inst.element, {});
inst.postStyleProps.forEach(function (prop) { return styles[prop] = null; });
});
}
else {
errors.push('The requested animation doesn\'t exist or has already been destroyed');
instructions = [];
}
if (errors.length) {
throw new Error("Unable to create the animation due to the following errors: " + errors.join("\n"));
}
autoStylesMap.forEach(function (styles, element) {
Object.keys(styles).forEach(function (prop) { styles[prop] = _this._driver.computeStyle(element, prop, _angular_animations__WEBPACK_IMPORTED_MODULE_1__["AUTO_STYLE"]); });
});
var players = instructions.map(function (i) {
var styles = autoStylesMap.get(i.element);
return _this._buildPlayer(i, {}, styles);
});
var player = optimizeGroupPlayer(players);
this._playersById[id] = player;
player.onDestroy(function () { return _this.destroy(id); });
this.players.push(player);
return player;
};
TimelineAnimationEngine.prototype.destroy = function (id) {
var player = this._getPlayer(id);
player.destroy();
delete this._playersById[id];
var index = this.players.indexOf(player);
if (index >= 0) {
this.players.splice(index, 1);
}
};
TimelineAnimationEngine.prototype._getPlayer = function (id) {
var player = this._playersById[id];
if (!player) {
throw new Error("Unable to find the timeline player referenced by " + id);
}
return player;
};
TimelineAnimationEngine.prototype.listen = function (id, element, eventName, callback) {
// triggerName, fromState, toState are all ignored for timeline animations
var baseEvent = makeAnimationEvent(element, '', '', '');
listenOnPlayer(this._getPlayer(id), eventName, baseEvent, callback);
return function () { };
};
TimelineAnimationEngine.prototype.command = function (id, element, command, args) {
if (command == 'register') {
this.register(id, args[0]);
return;
}
if (command == 'create') {
var options = (args[0] || {});
this.create(id, element, options);
return;
}
var player = this._getPlayer(id);
switch (command) {
case 'play':
player.play();
break;
case 'pause':
player.pause();
break;
case 'reset':
player.reset();
break;
case 'restart':
player.restart();
break;
case 'finish':
player.finish();
break;
case 'init':
player.init();
break;
case 'setPosition':
player.setPosition(parseFloat(args[0]));
break;
case 'destroy':
this.destroy(id);
break;
}
};
return TimelineAnimationEngine;
}());
var QUEUED_CLASSNAME = 'ng-animate-queued';
var QUEUED_SELECTOR = '.ng-animate-queued';
var DISABLED_CLASSNAME = 'ng-animate-disabled';
var DISABLED_SELECTOR = '.ng-animate-disabled';
var STAR_CLASSNAME = 'ng-star-inserted';
var STAR_SELECTOR = '.ng-star-inserted';
var EMPTY_PLAYER_ARRAY = [];
var NULL_REMOVAL_STATE = {
namespaceId: '',
setForRemoval: false,
setForMove: false,
hasAnimation: false,
removedBeforeQueried: false
};
var NULL_REMOVED_QUERIED_STATE = {
namespaceId: '',
setForMove: false,
setForRemoval: false,
hasAnimation: false,
removedBeforeQueried: true
};
var REMOVAL_FLAG = '__ng_removed';
var StateValue = /** @class */ (function () {
function StateValue(input, namespaceId) {
if (namespaceId === void 0) { namespaceId = ''; }
this.namespaceId = namespaceId;
var isObj = input && input.hasOwnProperty('value');
var value = isObj ? input['value'] : input;
this.value = normalizeTriggerValue(value);
if (isObj) {
var options = copyObj(input);
delete options['value'];
this.options = options;
}
else {
this.options = {};
}
if (!this.options.params) {
this.options.params = {};
}
}
Object.defineProperty(StateValue.prototype, "params", {
get: function () { return this.options.params; },
enumerable: true,
configurable: true
});
StateValue.prototype.absorbOptions = function (options) {
var newParams = options.params;
if (newParams) {
var oldParams_1 = this.options.params;
Object.keys(newParams).forEach(function (prop) {
if (oldParams_1[prop] == null) {
oldParams_1[prop] = newParams[prop];
}
});
}
};
return StateValue;
}());
var VOID_VALUE = 'void';
var DEFAULT_STATE_VALUE = new StateValue(VOID_VALUE);
var AnimationTransitionNamespace = /** @class */ (function () {
function AnimationTransitionNamespace(id, hostElement, _engine) {
this.id = id;
this.hostElement = hostElement;
this._engine = _engine;
this.players = [];
this._triggers = {};
this._queue = [];
this._elementListeners = new Map();
this._hostClassName = 'ng-tns-' + id;
addClass(hostElement, this._hostClassName);
}
AnimationTransitionNamespace.prototype.listen = function (element, name, phase, callback) {
var _this = this;
if (!this._triggers.hasOwnProperty(name)) {
throw new Error("Unable to listen on the animation trigger event \"" + phase + "\" because the animation trigger \"" + name + "\" doesn't exist!");
}
if (phase == null || phase.length == 0) {
throw new Error("Unable to listen on the animation trigger \"" + name + "\" because the provided event is undefined!");
}
if (!isTriggerEventValid(phase)) {
throw new Error("The provided animation trigger event \"" + phase + "\" for the animation trigger \"" + name + "\" is not supported!");
}
var listeners = getOrSetAsInMap(this._elementListeners, element, []);
var data = { name: name, phase: phase, callback: callback };
listeners.push(data);
var triggersWithStates = getOrSetAsInMap(this._engine.statesByElement, element, {});
if (!triggersWithStates.hasOwnProperty(name)) {
addClass(element, NG_TRIGGER_CLASSNAME);
addClass(element, NG_TRIGGER_CLASSNAME + '-' + name);
triggersWithStates[name] = DEFAULT_STATE_VALUE;
}
return function () {
// the event listener is removed AFTER the flush has occurred such
// that leave animations callbacks can fire (otherwise if the node
// is removed in between then the listeners would be deregistered)
_this._engine.afterFlush(function () {
var index = listeners.indexOf(data);
if (index >= 0) {
listeners.splice(index, 1);
}
if (!_this._triggers[name]) {
delete triggersWithStates[name];
}
});
};
};
AnimationTransitionNamespace.prototype.register = function (name, ast) {
if (this._triggers[name]) {
// throw
return false;
}
else {
this._triggers[name] = ast;
return true;
}
};
AnimationTransitionNamespace.prototype._getTrigger = function (name) {
var trigger = this._triggers[name];
if (!trigger) {
throw new Error("The provided animation trigger \"" + name + "\" has not been registered!");
}
return trigger;
};
AnimationTransitionNamespace.prototype.trigger = function (element, triggerName, value, defaultToFallback) {
var _this = this;
if (defaultToFallback === void 0) { defaultToFallback = true; }
var trigger = this._getTrigger(triggerName);
var player = new TransitionAnimationPlayer(this.id, triggerName, element);
var triggersWithStates = this._engine.statesByElement.get(element);
if (!triggersWithStates) {
addClass(element, NG_TRIGGER_CLASSNAME);
addClass(element, NG_TRIGGER_CLASSNAME + '-' + triggerName);
this._engine.statesByElement.set(element, triggersWithStates = {});
}
var fromState = triggersWithStates[triggerName];
var toState = new StateValue(value, this.id);
var isObj = value && value.hasOwnProperty('value');
if (!isObj && fromState) {
toState.absorbOptions(fromState.options);
}
triggersWithStates[triggerName] = toState;
if (!fromState) {
fromState = DEFAULT_STATE_VALUE;
}
var isRemoval = toState.value === VOID_VALUE;
// normally this isn't reached by here, however, if an object expression
// is passed in then it may be a new object each time. Comparing the value
// is important since that will stay the same despite there being a new object.
// The removal arc here is special cased because the same element is triggered
// twice in the event that it contains animations on the outer/inner portions
// of the host container
if (!isRemoval && fromState.value === toState.value) {
// this means that despite the value not changing, some inner params
// have changed which means that the animation final styles need to be applied
if (!objEquals(fromState.params, toState.params)) {
var errors = [];
var fromStyles_1 = trigger.matchStyles(fromState.value, fromState.params, errors);
var toStyles_1 = trigger.matchStyles(toState.value, toState.params, errors);
if (errors.length) {
this._engine.reportError(errors);
}
else {
this._engine.afterFlush(function () {
eraseStyles(element, fromStyles_1);
setStyles(element, toStyles_1);
});
}
}
return;
}
var playersOnElement = getOrSetAsInMap(this._engine.playersByElement, element, []);
playersOnElement.forEach(function (player) {
// only remove the player if it is queued on the EXACT same trigger/namespace
// we only also deal with queued players here because if the animation has
// started then we want to keep the player alive until the flush happens
// (which is where the previousPlayers are passed into the new palyer)
if (player.namespaceId == _this.id && player.triggerName == triggerName && player.queued) {
player.destroy();
}
});
var transition = trigger.matchTransition(fromState.value, toState.value, element, toState.params);
var isFallbackTransition = false;
if (!transition) {
if (!defaultToFallback)
return;
transition = trigger.fallbackTransition;
isFallbackTransition = true;
}
this._engine.totalQueuedPlayers++;
this._queue.push({ element: element, triggerName: triggerName, transition: transition, fromState: fromState, toState: toState, player: player, isFallbackTransition: isFallbackTransition });
if (!isFallbackTransition) {
addClass(element, QUEUED_CLASSNAME);
player.onStart(function () { removeClass(element, QUEUED_CLASSNAME); });
}
player.onDone(function () {
var index = _this.players.indexOf(player);
if (index >= 0) {
_this.players.splice(index, 1);
}
var players = _this._engine.playersByElement.get(element);
if (players) {
var index_1 = players.indexOf(player);
if (index_1 >= 0) {
players.splice(index_1, 1);
}
}
});
this.players.push(player);
playersOnElement.push(player);
return player;
};
AnimationTransitionNamespace.prototype.deregister = function (name) {
var _this = this;
delete this._triggers[name];
this._engine.statesByElement.forEach(function (stateMap, element) { delete stateMap[name]; });
this._elementListeners.forEach(function (listeners, element) {
_this._elementListeners.set(element, listeners.filter(function (entry) { return entry.name != name; }));
});
};
AnimationTransitionNamespace.prototype.clearElementCache = function (element) {
this._engine.statesByElement.delete(element);
this._elementListeners.delete(element);
var elementPlayers = this._engine.playersByElement.get(element);
if (elementPlayers) {
elementPlayers.forEach(function (player) { return player.destroy(); });
this._engine.playersByElement.delete(element);
}
};
AnimationTransitionNamespace.prototype._signalRemovalForInnerTriggers = function (rootElement, context, animate) {
var _this = this;
if (animate === void 0) { animate = false; }
// emulate a leave animation for all inner nodes within this node.
// If there are no animations found for any of the nodes then clear the cache
// for the element.
this._engine.driver.query(rootElement, NG_TRIGGER_SELECTOR, true).forEach(function (elm) {
// this means that an inner remove() operation has already kicked off
// the animation on this element...
if (elm[REMOVAL_FLAG])
return;
var namespaces = _this._engine.fetchNamespacesByElement(elm);
if (namespaces.size) {
namespaces.forEach(function (ns) { return ns.triggerLeaveAnimation(elm, context, false, true); });
}
else {
_this.clearElementCache(elm);
}
});
};
AnimationTransitionNamespace.prototype.triggerLeaveAnimation = function (element, context, destroyAfterComplete, defaultToFallback) {
var _this = this;
var triggerStates = this._engine.statesByElement.get(element);
if (triggerStates) {
var players_1 = [];
Object.keys(triggerStates).forEach(function (triggerName) {
// this check is here in the event that an element is removed
// twice (both on the host level and the component level)
if (_this._triggers[triggerName]) {
var player = _this.trigger(element, triggerName, VOID_VALUE, defaultToFallback);
if (player) {
players_1.push(player);
}
}
});
if (players_1.length) {
this._engine.markElementAsRemoved(this.id, element, true, context);
if (destroyAfterComplete) {
optimizeGroupPlayer(players_1).onDone(function () { return _this._engine.processLeaveNode(element); });
}
return true;
}
}
return false;
};
AnimationTransitionNamespace.prototype.prepareLeaveAnimationListeners = function (element) {
var _this = this;
var listeners = this._elementListeners.get(element);
if (listeners) {
var visitedTriggers_1 = new Set();
listeners.forEach(function (listener) {
var triggerName = listener.name;
if (visitedTriggers_1.has(triggerName))
return;
visitedTriggers_1.add(triggerName);
var trigger = _this._triggers[triggerName];
var transition = trigger.fallbackTransition;
var elementStates = _this._engine.statesByElement.get(element);
var fromState = elementStates[triggerName] || DEFAULT_STATE_VALUE;
var toState = new StateValue(VOID_VALUE);
var player = new TransitionAnimationPlayer(_this.id, triggerName, element);
_this._engine.totalQueuedPlayers++;
_this._queue.push({
element: element,
triggerName: triggerName,
transition: transition,
fromState: fromState,
toState: toState,
player: player,
isFallbackTransition: true
});
});
}
};
AnimationTransitionNamespace.prototype.removeNode = function (element, context) {
var _this = this;
var engine = this._engine;
if (element.childElementCount) {
this._signalRemovalForInnerTriggers(element, context, true);
}
// this means that a * => VOID animation was detected and kicked off
if (this.triggerLeaveAnimation(element, context, true))
return;
// find the player that is animating and make sure that the
// removal is delayed until that player has completed
var containsPotentialParentTransition = false;
if (engine.totalAnimations) {
var currentPlayers = engine.players.length ? engine.playersByQueriedElement.get(element) : [];
// when this `if statement` does not continue forward it means that
// a previous animation query has selected the current element and
// is animating it. In this situation want to continue forwards and
// allow the element to be queued up for animation later.
if (currentPlayers && currentPlayers.length) {
containsPotentialParentTransition = true;
}
else {
var parent_1 = element;
while (parent_1 = parent_1.parentNode) {
var triggers = engine.statesByElement.get(parent_1);
if (triggers) {
containsPotentialParentTransition = true;
break;
}
}
}
}
// at this stage we know that the element will either get removed
// during flush or will be picked up by a parent query. Either way
// we need to fire the listeners for this element when it DOES get
// removed (once the query parent animation is done or after flush)
this.prepareLeaveAnimationListeners(element);
// whether or not a parent has an animation we need to delay the deferral of the leave
// operation until we have more information (which we do after flush() has been called)
if (containsPotentialParentTransition) {
engine.markElementAsRemoved(this.id, element, false, context);
}
else {
// we do this after the flush has occurred such
// that the callbacks can be fired
engine.afterFlush(function () { return _this.clearElementCache(element); });
engine.destroyInnerAnimations(element);
engine._onRemovalComplete(element, context);
}
};
AnimationTransitionNamespace.prototype.insertNode = function (element, parent) { addClass(element, this._hostClassName); };
AnimationTransitionNamespace.prototype.drainQueuedTransitions = function (microtaskId) {
var _this = this;
var instructions = [];
this._queue.forEach(function (entry) {
var player = entry.player;
if (player.destroyed)
return;
var element = entry.element;
var listeners = _this._elementListeners.get(element);
if (listeners) {
listeners.forEach(function (listener) {
if (listener.name == entry.triggerName) {
var baseEvent = makeAnimationEvent(element, entry.triggerName, entry.fromState.value, entry.toState.value);
baseEvent['_data'] = microtaskId;
listenOnPlayer(entry.player, listener.phase, baseEvent, listener.callback);
}
});
}
if (player.markedForDestroy) {
_this._engine.afterFlush(function () {
// now we can destroy the element properly since the event listeners have
// been bound to the player
player.destroy();
});
}
else {
instructions.push(entry);
}
});
this._queue = [];
return instructions.sort(function (a, b) {
// if depCount == 0 them move to front
// otherwise if a contains b then move back
var d0 = a.transition.ast.depCount;
var d1 = b.transition.ast.depCount;
if (d0 == 0 || d1 == 0) {
return d0 - d1;
}
return _this._engine.driver.containsElement(a.element, b.element) ? 1 : -1;
});
};
AnimationTransitionNamespace.prototype.destroy = function (context) {
this.players.forEach(function (p) { return p.destroy(); });
this._signalRemovalForInnerTriggers(this.hostElement, context);
};
AnimationTransitionNamespace.prototype.elementContainsData = function (element) {
var containsData = false;
if (this._elementListeners.has(element))
containsData = true;
containsData =
(this._queue.find(function (entry) { return entry.element === element; }) ? true : false) || containsData;
return containsData;
};
return AnimationTransitionNamespace;
}());
var TransitionAnimationEngine = /** @class */ (function () {
function TransitionAnimationEngine(bodyNode, driver, _normalizer) {
this.bodyNode = bodyNode;
this.driver = driver;
this._normalizer = _normalizer;
this.players = [];
this.newHostElements = new Map();
this.playersByElement = new Map();
this.playersByQueriedElement = new Map();
this.statesByElement = new Map();
this.disabledNodes = new Set();
this.totalAnimations = 0;
this.totalQueuedPlayers = 0;
this._namespaceLookup = {};
this._namespaceList = [];
this._flushFns = [];
this._whenQuietFns = [];
this.namespacesByHostElement = new Map();
this.collectedEnterElements = [];
this.collectedLeaveElements = [];
// this method is designed to be overridden by the code that uses this engine
this.onRemovalComplete = function (element, context) { };
}
/** @internal */
TransitionAnimationEngine.prototype._onRemovalComplete = function (element, context) { this.onRemovalComplete(element, context); };
Object.defineProperty(TransitionAnimationEngine.prototype, "queuedPlayers", {
get: function () {
var players = [];
this._namespaceList.forEach(function (ns) {
ns.players.forEach(function (player) {
if (player.queued) {
players.push(player);
}
});
});
return players;
},
enumerable: true,
configurable: true
});
TransitionAnimationEngine.prototype.createNamespace = function (namespaceId, hostElement) {
var ns = new AnimationTransitionNamespace(namespaceId, hostElement, this);
if (hostElement.parentNode) {
this._balanceNamespaceList(ns, hostElement);
}
else {
// defer this later until flush during when the host element has
// been inserted so that we know exactly where to place it in
// the namespace list
this.newHostElements.set(hostElement, ns);
// given that this host element is apart of the animation code, it
// may or may not be inserted by a parent node that is an of an
// animation renderer type. If this happens then we can still have
// access to this item when we query for :enter nodes. If the parent
// is a renderer then the set data-structure will normalize the entry
this.collectEnterElement(hostElement);
}
return this._namespaceLookup[namespaceId] = ns;
};
TransitionAnimationEngine.prototype._balanceNamespaceList = function (ns, hostElement) {
var limit = this._namespaceList.length - 1;
if (limit >= 0) {
var found = false;
for (var i = limit; i >= 0; i--) {
var nextNamespace = this._namespaceList[i];
if (this.driver.containsElement(nextNamespace.hostElement, hostElement)) {
this._namespaceList.splice(i + 1, 0, ns);
found = true;
break;
}
}
if (!found) {
this._namespaceList.splice(0, 0, ns);
}
}
else {
this._namespaceList.push(ns);
}
this.namespacesByHostElement.set(hostElement, ns);
return ns;
};
TransitionAnimationEngine.prototype.register = function (namespaceId, hostElement) {
var ns = this._namespaceLookup[namespaceId];
if (!ns) {
ns = this.createNamespace(namespaceId, hostElement);
}
return ns;
};
TransitionAnimationEngine.prototype.registerTrigger = function (namespaceId, name, trigger) {
var ns = this._namespaceLookup[namespaceId];
if (ns && ns.register(name, trigger)) {
this.totalAnimations++;
}
};
TransitionAnimationEngine.prototype.destroy = function (namespaceId, context) {
var _this = this;
if (!namespaceId)
return;
var ns = this._fetchNamespace(namespaceId);
this.afterFlush(function () {
_this.namespacesByHostElement.delete(ns.hostElement);
delete _this._namespaceLookup[namespaceId];
var index = _this._namespaceList.indexOf(ns);
if (index >= 0) {
_this._namespaceList.splice(index, 1);
}
});
this.afterFlushAnimationsDone(function () { return ns.destroy(context); });
};
TransitionAnimationEngine.prototype._fetchNamespace = function (id) { return this._namespaceLookup[id]; };
TransitionAnimationEngine.prototype.fetchNamespacesByElement = function (element) {
// normally there should only be one namespace per element, however
// if @triggers are placed on both the component element and then
// its host element (within the component code) then there will be
// two namespaces returned. We use a set here to simply the dedupe
// of namespaces incase there are multiple triggers both the elm and host
var namespaces = new Set();
var elementStates = this.statesByElement.get(element);
if (elementStates) {
var keys = Object.keys(elementStates);
for (var i = 0; i < keys.length; i++) {
var nsId = elementStates[keys[i]].namespaceId;
if (nsId) {
var ns = this._fetchNamespace(nsId);
if (ns) {
namespaces.add(ns);
}
}
}
}
return namespaces;
};
TransitionAnimationEngine.prototype.trigger = function (namespaceId, element, name, value) {
if (isElementNode(element)) {
var ns = this._fetchNamespace(namespaceId);
if (ns) {
ns.trigger(element, name, value);
return true;
}
}
return false;
};
TransitionAnimationEngine.prototype.insertNode = function (namespaceId, element, parent, insertBefore) {
if (!isElementNode(element))
return;
// special case for when an element is removed and reinserted (move operation)
// when this occurs we do not want to use the element for deletion later
var details = element[REMOVAL_FLAG];
if (details && details.setForRemoval) {
details.setForRemoval = false;
details.setForMove = true;
var index = this.collectedLeaveElements.indexOf(element);
if (index >= 0) {
this.collectedLeaveElements.splice(index, 1);
}
}
// in the event that the namespaceId is blank then the caller
// code does not contain any animation code in it, but it is
// just being called so that the node is marked as being inserted
if (namespaceId) {
var ns = this._fetchNamespace(namespaceId);
// This if-statement is a workaround for router issue #21947.
// The router sometimes hits a race condition where while a route
// is being instantiated a new navigation arrives, triggering leave
// animation of DOM that has not been fully initialized, until this
// is resolved, we need to handle the scenario when DOM is not in a
// consistent state during the animation.
if (ns) {
ns.insertNode(element, parent);
}
}
// only *directives and host elements are inserted before
if (insertBefore) {
this.collectEnterElement(element);
}
};
TransitionAnimationEngine.prototype.collectEnterElement = function (element) { this.collectedEnterElements.push(element); };
TransitionAnimationEngine.prototype.markElementAsDisabled = function (element, value) {
if (value) {
if (!this.disabledNodes.has(element)) {
this.disabledNodes.add(element);
addClass(element, DISABLED_CLASSNAME);
}
}
else if (this.disabledNodes.has(element)) {
this.disabledNodes.delete(element);
removeClass(element, DISABLED_CLASSNAME);
}
};
TransitionAnimationEngine.prototype.removeNode = function (namespaceId, element, context) {
if (!isElementNode(element)) {
this._onRemovalComplete(element, context);
return;
}
var ns = namespaceId ? this._fetchNamespace(namespaceId) : null;
if (ns) {
ns.removeNode(element, context);
}
else {
this.markElementAsRemoved(namespaceId, element, false, context);
}
};
TransitionAnimationEngine.prototype.markElementAsRemoved = function (namespaceId, element, hasAnimation, context) {
this.collectedLeaveElements.push(element);
element[REMOVAL_FLAG] = {
namespaceId: namespaceId,
setForRemoval: context, hasAnimation: hasAnimation,
removedBeforeQueried: false
};
};
TransitionAnimationEngine.prototype.listen = function (namespaceId, element, name, phase, callback) {
if (isElementNode(element)) {
return this._fetchNamespace(namespaceId).listen(element, name, phase, callback);
}
return function () { };
};
TransitionAnimationEngine.prototype._buildInstruction = function (entry, subTimelines, enterClassName, leaveClassName, skipBuildAst) {
return entry.transition.build(this.driver, entry.element, entry.fromState.value, entry.toState.value, enterClassName, leaveClassName, entry.fromState.options, entry.toState.options, subTimelines, skipBuildAst);
};
TransitionAnimationEngine.prototype.destroyInnerAnimations = function (containerElement) {
var _this = this;
var elements = this.driver.query(containerElement, NG_TRIGGER_SELECTOR, true);
elements.forEach(function (element) { return _this.destroyActiveAnimationsForElement(element); });
if (this.playersByQueriedElement.size == 0)
return;
elements = this.driver.query(containerElement, NG_ANIMATING_SELECTOR, true);
elements.forEach(function (element) { return _this.finishActiveQueriedAnimationOnElement(element); });
};
TransitionAnimationEngine.prototype.destroyActiveAnimationsForElement = function (element) {
var players = this.playersByElement.get(element);
if (players) {
players.forEach(function (player) {
// special case for when an element is set for destruction, but hasn't started.
// in this situation we want to delay the destruction until the flush occurs
// so that any event listeners attached to the player are triggered.
if (player.queued) {
player.markedForDestroy = true;
}
else {
player.destroy();
}
});
}
};
TransitionAnimationEngine.prototype.finishActiveQueriedAnimationOnElement = function (element) {
var players = this.playersByQueriedElement.get(element);
if (players) {
players.forEach(function (player) { return player.finish(); });
}
};
TransitionAnimationEngine.prototype.whenRenderingDone = function () {
var _this = this;
return new Promise(function (resolve) {
if (_this.players.length) {
return optimizeGroupPlayer(_this.players).onDone(function () { return resolve(); });
}
else {
resolve();
}
});
};
TransitionAnimationEngine.prototype.processLeaveNode = function (element) {
var _this = this;
var details = element[REMOVAL_FLAG];
if (details && details.setForRemoval) {
// this will prevent it from removing it twice
element[REMOVAL_FLAG] = NULL_REMOVAL_STATE;
if (details.namespaceId) {
this.destroyInnerAnimations(element);
var ns = this._fetchNamespace(details.namespaceId);
if (ns) {
ns.clearElementCache(element);
}
}
this._onRemovalComplete(element, details.setForRemoval);
}
if (this.driver.matchesElement(element, DISABLED_SELECTOR)) {
this.markElementAsDisabled(element, false);
}
this.driver.query(element, DISABLED_SELECTOR, true).forEach(function (node) {
_this.markElementAsDisabled(element, false);
});
};
TransitionAnimationEngine.prototype.flush = function (microtaskId) {
var _this = this;
if (microtaskId === void 0) { microtaskId = -1; }
var players = [];
if (this.newHostElements.size) {
this.newHostElements.forEach(function (ns, element) { return _this._balanceNamespaceList(ns, element); });
this.newHostElements.clear();
}
if (this.totalAnimations && this.collectedEnterElements.length) {
for (var i = 0; i < this.collectedEnterElements.length; i++) {
var elm = this.collectedEnterElements[i];
addClass(elm, STAR_CLASSNAME);
}
}
if (this._namespaceList.length &&
(this.totalQueuedPlayers || this.collectedLeaveElements.length)) {
var cleanupFns = [];
try {
players = this._flushAnimations(cleanupFns, microtaskId);
}
finally {
for (var i = 0; i < cleanupFns.length; i++) {
cleanupFns[i]();
}
}
}
else {
for (var i = 0; i < this.collectedLeaveElements.length; i++) {
var element = this.collectedLeaveElements[i];
this.processLeaveNode(element);
}
}
this.totalQueuedPlayers = 0;
this.collectedEnterElements.length = 0;
this.collectedLeaveElements.length = 0;
this._flushFns.forEach(function (fn) { return fn(); });
this._flushFns = [];
if (this._whenQuietFns.length) {
// we move these over to a variable so that
// if any new callbacks are registered in another
// flush they do not populate the existing set
var quietFns_1 = this._whenQuietFns;
this._whenQuietFns = [];
if (players.length) {
optimizeGroupPlayer(players).onDone(function () { quietFns_1.forEach(function (fn) { return fn(); }); });
}
else {
quietFns_1.forEach(function (fn) { return fn(); });
}
}
};
TransitionAnimationEngine.prototype.reportError = function (errors) {
throw new Error("Unable to process animations due to the following failed trigger transitions\n " + errors.join('\n'));
};
TransitionAnimationEngine.prototype._flushAnimations = function (cleanupFns, microtaskId) {
var _this = this;
var subTimelines = new ElementInstructionMap();
var skippedPlayers = [];
var skippedPlayersMap = new Map();
var queuedInstructions = [];
var queriedElements = new Map();
var allPreStyleElements = new Map();
var allPostStyleElements = new Map();
var disabledElementsSet = new Set();
this.disabledNodes.forEach(function (node) {
disabledElementsSet.add(node);
var nodesThatAreDisabled = _this.driver.query(node, QUEUED_SELECTOR, true);
for (var i_1 = 0; i_1 < nodesThatAreDisabled.length; i_1++) {
disabledElementsSet.add(nodesThatAreDisabled[i_1]);
}
});
var bodyNode = this.bodyNode;
var allTriggerElements = Array.from(this.statesByElement.keys());
var enterNodeMap = buildRootMap(allTriggerElements, this.collectedEnterElements);
// this must occur before the instructions are built below such that
// the :enter queries match the elements (since the timeline queries
// are fired during instruction building).
var enterNodeMapIds = new Map();
var i = 0;
enterNodeMap.forEach(function (nodes, root) {
var className = ENTER_CLASSNAME + i++;
enterNodeMapIds.set(root, className);
nodes.forEach(function (node) { return addClass(node, className); });
});
var allLeaveNodes = [];
var mergedLeaveNodes = new Set();
var leaveNodesWithoutAnimations = new Set();
for (var i_2 = 0; i_2 < this.collectedLeaveElements.length; i_2++) {
var element = this.collectedLeaveElements[i_2];
var details = element[REMOVAL_FLAG];
if (details && details.setForRemoval) {
allLeaveNodes.push(element);
mergedLeaveNodes.add(element);
if (details.hasAnimation) {
this.driver.query(element, STAR_SELECTOR, true).forEach(function (elm) { return mergedLeaveNodes.add(elm); });
}
else {
leaveNodesWithoutAnimations.add(element);
}
}
}
var leaveNodeMapIds = new Map();
var leaveNodeMap = buildRootMap(allTriggerElements, Array.from(mergedLeaveNodes));
leaveNodeMap.forEach(function (nodes, root) {
var className = LEAVE_CLASSNAME + i++;
leaveNodeMapIds.set(root, className);
nodes.forEach(function (node) { return addClass(node, className); });
});
cleanupFns.push(function () {
enterNodeMap.forEach(function (nodes, root) {
var className = enterNodeMapIds.get(root);
nodes.forEach(function (node) { return removeClass(node, className); });
});
leaveNodeMap.forEach(function (nodes, root) {
var className = leaveNodeMapIds.get(root);
nodes.forEach(function (node) { return removeClass(node, className); });
});
allLeaveNodes.forEach(function (element) { _this.processLeaveNode(element); });
});
var allPlayers = [];
var erroneousTransitions = [];
for (var i_3 = this._namespaceList.length - 1; i_3 >= 0; i_3--) {
var ns = this._namespaceList[i_3];
ns.drainQueuedTransitions(microtaskId).forEach(function (entry) {
var player = entry.player;
var element = entry.element;
allPlayers.push(player);
if (_this.collectedEnterElements.length) {
var details = element[REMOVAL_FLAG];
// move animations are currently not supported...
if (details && details.setForMove) {
player.destroy();
return;
}
}
var nodeIsOrphaned = !bodyNode || !_this.driver.containsElement(bodyNode, element);
var leaveClassName = leaveNodeMapIds.get(element);
var enterClassName = enterNodeMapIds.get(element);
var instruction = _this._buildInstruction(entry, subTimelines, enterClassName, leaveClassName, nodeIsOrphaned);
if (instruction.errors && instruction.errors.length) {
erroneousTransitions.push(instruction);
return;
}
// even though the element may not be apart of the DOM, it may
// still be added at a later point (due to the mechanics of content
// projection and/or dynamic component insertion) therefore it's
// important we still style the element.
if (nodeIsOrphaned) {
player.onStart(function () { return eraseStyles(element, instruction.fromStyles); });
player.onDestroy(function () { return setStyles(element, instruction.toStyles); });
skippedPlayers.push(player);
return;
}
// if a unmatched transition is queued to go then it SHOULD NOT render
// an animation and cancel the previously running animations.
if (entry.isFallbackTransition) {
player.onStart(function () { return eraseStyles(element, instruction.fromStyles); });
player.onDestroy(function () { return setStyles(element, instruction.toStyles); });
skippedPlayers.push(player);
return;
}
// this means that if a parent animation uses this animation as a sub trigger
// then it will instruct the timeline builder to not add a player delay, but
// instead stretch the first keyframe gap up until the animation starts. The
// reason this is important is to prevent extra initialization styles from being
// required by the user in the animation.
instruction.timelines.forEach(function (tl) { return tl.stretchStartingKeyframe = true; });
subTimelines.append(element, instruction.timelines);
var tuple = { instruction: instruction, player: player, element: element };
queuedInstructions.push(tuple);
instruction.queriedElements.forEach(function (element) { return getOrSetAsInMap(queriedElements, element, []).push(player); });
instruction.preStyleProps.forEach(function (stringMap, element) {
var props = Object.keys(stringMap);
if (props.length) {
var setVal_1 = allPreStyleElements.get(element);
if (!setVal_1) {
allPreStyleElements.set(element, setVal_1 = new Set());
}
props.forEach(function (prop) { return setVal_1.add(prop); });
}
});
instruction.postStyleProps.forEach(function (stringMap, element) {
var props = Object.keys(stringMap);
var setVal = allPostStyleElements.get(element);
if (!setVal) {
allPostStyleElements.set(element, setVal = new Set());
}
props.forEach(function (prop) { return setVal.add(prop); });
});
});
}
if (erroneousTransitions.length) {
var errors_1 = [];
erroneousTransitions.forEach(function (instruction) {
errors_1.push("@" + instruction.triggerName + " has failed due to:\n");
instruction.errors.forEach(function (error) { return errors_1.push("- " + error + "\n"); });
});
allPlayers.forEach(function (player) { return player.destroy(); });
this.reportError(errors_1);
}
var allPreviousPlayersMap = new Map();
// this map works to tell which element in the DOM tree is contained by
// which animation. Further down below this map will get populated once
// the players are built and in doing so it can efficiently figure out
// if a sub player is skipped due to a parent player having priority.
var animationElementMap = new Map();
queuedInstructions.forEach(function (entry) {
var element = entry.element;
if (subTimelines.has(element)) {
animationElementMap.set(element, element);
_this._beforeAnimationBuild(entry.player.namespaceId, entry.instruction, allPreviousPlayersMap);
}
});
skippedPlayers.forEach(function (player) {
var element = player.element;
var previousPlayers = _this._getPreviousPlayers(element, false, player.namespaceId, player.triggerName, null);
previousPlayers.forEach(function (prevPlayer) {
getOrSetAsInMap(allPreviousPlayersMap, element, []).push(prevPlayer);
prevPlayer.destroy();
});
});
// this is a special case for nodes that will be removed (either by)
// having their own leave animations or by being queried in a container
// that will be removed once a parent animation is complete. The idea
// here is that * styles must be identical to ! styles because of
// backwards compatibility (* is also filled in by default in many places).
// Otherwise * styles will return an empty value or auto since the element
// that is being getComputedStyle'd will not be visible (since * = destination)
var replaceNodes = allLeaveNodes.filter(function (node) {
return replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements);
});
// POST STAGE: fill the * styles
var postStylesMap = new Map();
var allLeaveQueriedNodes = cloakAndComputeStyles(postStylesMap, this.driver, leaveNodesWithoutAnimations, allPostStyleElements, _angular_animations__WEBPACK_IMPORTED_MODULE_1__["AUTO_STYLE"]);
allLeaveQueriedNodes.forEach(function (node) {
if (replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements)) {
replaceNodes.push(node);
}
});
// PRE STAGE: fill the ! styles
var preStylesMap = new Map();
enterNodeMap.forEach(function (nodes, root) {
cloakAndComputeStyles(preStylesMap, _this.driver, new Set(nodes), allPreStyleElements, _angular_animations__WEBPACK_IMPORTED_MODULE_1__["ɵPRE_STYLE"]);
});
replaceNodes.forEach(function (node) {
var post = postStylesMap.get(node);
var pre = preStylesMap.get(node);
postStylesMap.set(node, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, post, pre));
});
var rootPlayers = [];
var subPlayers = [];
var NO_PARENT_ANIMATION_ELEMENT_DETECTED = {};
queuedInstructions.forEach(function (entry) {
var element = entry.element, player = entry.player, instruction = entry.instruction;
// this means that it was never consumed by a parent animation which
// means that it is independent and therefore should be set for animation
if (subTimelines.has(element)) {
if (disabledElementsSet.has(element)) {
player.onDestroy(function () { return setStyles(element, instruction.toStyles); });
player.disabled = true;
player.overrideTotalTime(instruction.totalTime);
skippedPlayers.push(player);
return;
}
// this will flow up the DOM and query the map to figure out
// if a parent animation has priority over it. In the situation
// that a parent is detected then it will cancel the loop. If
// nothing is detected, or it takes a few hops to find a parent,
// then it will fill in the missing nodes and signal them as having
// a detected parent (or a NO_PARENT value via a special constant).
var parentWithAnimation_1 = NO_PARENT_ANIMATION_ELEMENT_DETECTED;
if (animationElementMap.size > 1) {
var elm = element;
var parentsToAdd = [];
while (elm = elm.parentNode) {
var detectedParent = animationElementMap.get(elm);
if (detectedParent) {
parentWithAnimation_1 = detectedParent;
break;
}
parentsToAdd.push(elm);
}
parentsToAdd.forEach(function (parent) { return animationElementMap.set(parent, parentWithAnimation_1); });
}
var innerPlayer = _this._buildAnimation(player.namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap);
player.setRealPlayer(innerPlayer);
if (parentWithAnimation_1 === NO_PARENT_ANIMATION_ELEMENT_DETECTED) {
rootPlayers.push(player);
}
else {
var parentPlayers = _this.playersByElement.get(parentWithAnimation_1);
if (parentPlayers && parentPlayers.length) {
player.parentPlayer = optimizeGroupPlayer(parentPlayers);
}
skippedPlayers.push(player);
}
}
else {
eraseStyles(element, instruction.fromStyles);
player.onDestroy(function () { return setStyles(element, instruction.toStyles); });
// there still might be a ancestor player animating this
// element therefore we will still add it as a sub player
// even if its animation may be disabled
subPlayers.push(player);
if (disabledElementsSet.has(element)) {
skippedPlayers.push(player);
}
}
});
// find all of the sub players' corresponding inner animation player
subPlayers.forEach(function (player) {
// even if any players are not found for a sub animation then it
// will still complete itself after the next tick since it's Noop
var playersForElement = skippedPlayersMap.get(player.element);
if (playersForElement && playersForElement.length) {
var innerPlayer = optimizeGroupPlayer(playersForElement);
player.setRealPlayer(innerPlayer);
}
});
// the reason why we don't actually play the animation is
// because all that a skipped player is designed to do is to
// fire the start/done transition callback events
skippedPlayers.forEach(function (player) {
if (player.parentPlayer) {
player.syncPlayerEvents(player.parentPlayer);
}
else {
player.destroy();
}
});
// run through all of the queued removals and see if they
// were picked up by a query. If not then perform the removal
// operation right away unless a parent animation is ongoing.
for (var i_4 = 0; i_4 < allLeaveNodes.length; i_4++) {
var element = allLeaveNodes[i_4];
var details = element[REMOVAL_FLAG];
removeClass(element, LEAVE_CLASSNAME);
// this means the element has a removal animation that is being
// taken care of and therefore the inner elements will hang around
// until that animation is over (or the parent queried animation)
if (details && details.hasAnimation)
continue;
var players = [];
// if this element is queried or if it contains queried children
// then we want for the element not to be removed from the page
// until the queried animations have finished
if (queriedElements.size) {
var queriedPlayerResults = queriedElements.get(element);
if (queriedPlayerResults && queriedPlayerResults.length) {
players.push.apply(players, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(queriedPlayerResults));
}
var queriedInnerElements = this.driver.query(element, NG_ANIMATING_SELECTOR, true);
for (var j = 0; j < queriedInnerElements.length; j++) {
var queriedPlayers = queriedElements.get(queriedInnerElements[j]);
if (queriedPlayers && queriedPlayers.length) {
players.push.apply(players, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(queriedPlayers));
}
}
}
var activePlayers = players.filter(function (p) { return !p.destroyed; });
if (activePlayers.length) {
removeNodesAfterAnimationDone(this, element, activePlayers);
}
else {
this.processLeaveNode(element);
}
}
// this is required so the cleanup method doesn't remove them
allLeaveNodes.length = 0;
rootPlayers.forEach(function (player) {
_this.players.push(player);
player.onDone(function () {
player.destroy();
var index = _this.players.indexOf(player);
_this.players.splice(index, 1);
});
player.play();
});
return rootPlayers;
};
TransitionAnimationEngine.prototype.elementContainsData = function (namespaceId, element) {
var containsData = false;
var details = element[REMOVAL_FLAG];
if (details && details.setForRemoval)
containsData = true;
if (this.playersByElement.has(element))
containsData = true;
if (this.playersByQueriedElement.has(element))
containsData = true;
if (this.statesByElement.has(element))
containsData = true;
return this._fetchNamespace(namespaceId).elementContainsData(element) || containsData;
};
TransitionAnimationEngine.prototype.afterFlush = function (callback) { this._flushFns.push(callback); };
TransitionAnimationEngine.prototype.afterFlushAnimationsDone = function (callback) { this._whenQuietFns.push(callback); };
TransitionAnimationEngine.prototype._getPreviousPlayers = function (element, isQueriedElement, namespaceId, triggerName, toStateValue) {
var players = [];
if (isQueriedElement) {
var queriedElementPlayers = this.playersByQueriedElement.get(element);
if (queriedElementPlayers) {
players = queriedElementPlayers;
}
}
else {
var elementPlayers = this.playersByElement.get(element);
if (elementPlayers) {
var isRemovalAnimation_1 = !toStateValue || toStateValue == VOID_VALUE;
elementPlayers.forEach(function (player) {
if (player.queued)
return;
if (!isRemovalAnimation_1 && player.triggerName != triggerName)
return;
players.push(player);
});
}
}
if (namespaceId || triggerName) {
players = players.filter(function (player) {
if (namespaceId && namespaceId != player.namespaceId)
return false;
if (triggerName && triggerName != player.triggerName)
return false;
return true;
});
}
return players;
};
TransitionAnimationEngine.prototype._beforeAnimationBuild = function (namespaceId, instruction, allPreviousPlayersMap) {
var triggerName = instruction.triggerName;
var rootElement = instruction.element;
// when a removal animation occurs, ALL previous players are collected
// and destroyed (even if they are outside of the current namespace)
var targetNameSpaceId = instruction.isRemovalTransition ? undefined : namespaceId;
var targetTriggerName = instruction.isRemovalTransition ? undefined : triggerName;
var _loop_1 = function (timelineInstruction) {
var element = timelineInstruction.element;
var isQueriedElement = element !== rootElement;
var players = getOrSetAsInMap(allPreviousPlayersMap, element, []);
var previousPlayers = this_1._getPreviousPlayers(element, isQueriedElement, targetNameSpaceId, targetTriggerName, instruction.toState);
previousPlayers.forEach(function (player) {
var realPlayer = player.getRealPlayer();
if (realPlayer.beforeDestroy) {
realPlayer.beforeDestroy();
}
player.destroy();
players.push(player);
});
};
var this_1 = this;
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(instruction.timelines), _b = _a.next(); !_b.done; _b = _a.next()) {
var timelineInstruction = _b.value;
_loop_1(timelineInstruction);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_1) throw e_1.error; }
}
// this needs to be done so that the PRE/POST styles can be
// computed properly without interfering with the previous animation
eraseStyles(rootElement, instruction.fromStyles);
var e_1, _c;
};
TransitionAnimationEngine.prototype._buildAnimation = function (namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap) {
var _this = this;
var triggerName = instruction.triggerName;
var rootElement = instruction.element;
// we first run this so that the previous animation player
// data can be passed into the successive animation players
var allQueriedPlayers = [];
var allConsumedElements = new Set();
var allSubElements = new Set();
var allNewPlayers = instruction.timelines.map(function (timelineInstruction) {
var element = timelineInstruction.element;
allConsumedElements.add(element);
// FIXME (matsko): make sure to-be-removed animations are removed properly
var details = element[REMOVAL_FLAG];
if (details && details.removedBeforeQueried)
return new _angular_animations__WEBPACK_IMPORTED_MODULE_1__["NoopAnimationPlayer"](timelineInstruction.duration, timelineInstruction.delay);
var isQueriedElement = element !== rootElement;
var previousPlayers = flattenGroupPlayers((allPreviousPlayersMap.get(element) || EMPTY_PLAYER_ARRAY)
.map(function (p) { return p.getRealPlayer(); }))
.filter(function (p) {
// the `element` is not apart of the AnimationPlayer definition, but
// Mock/WebAnimations
// use the element within their implementation. This will be added in Angular5 to
// AnimationPlayer
var pp = p;
return pp.element ? pp.element === element : false;
});
var preStyles = preStylesMap.get(element);
var postStyles = postStylesMap.get(element);
var keyframes = normalizeKeyframes(_this.driver, _this._normalizer, element, timelineInstruction.keyframes, preStyles, postStyles);
var player = _this._buildPlayer(timelineInstruction, keyframes, previousPlayers);
// this means that this particular player belongs to a sub trigger. It is
// important that we match this player up with the corresponding (@trigger.listener)
if (timelineInstruction.subTimeline && skippedPlayersMap) {
allSubElements.add(element);
}
if (isQueriedElement) {
var wrappedPlayer = new TransitionAnimationPlayer(namespaceId, triggerName, element);
wrappedPlayer.setRealPlayer(player);
allQueriedPlayers.push(wrappedPlayer);
}
return player;
});
allQueriedPlayers.forEach(function (player) {
getOrSetAsInMap(_this.playersByQueriedElement, player.element, []).push(player);
player.onDone(function () { return deleteOrUnsetInMap(_this.playersByQueriedElement, player.element, player); });
});
allConsumedElements.forEach(function (element) { return addClass(element, NG_ANIMATING_CLASSNAME); });
var player = optimizeGroupPlayer(allNewPlayers);
player.onDestroy(function () {
allConsumedElements.forEach(function (element) { return removeClass(element, NG_ANIMATING_CLASSNAME); });
setStyles(rootElement, instruction.toStyles);
});
// this basically makes all of the callbacks for sub element animations
// be dependent on the upper players for when they finish
allSubElements.forEach(function (element) { getOrSetAsInMap(skippedPlayersMap, element, []).push(player); });
return player;
};
TransitionAnimationEngine.prototype._buildPlayer = function (instruction, keyframes, previousPlayers) {
if (keyframes.length > 0) {
return this.driver.animate(instruction.element, keyframes, instruction.duration, instruction.delay, instruction.easing, previousPlayers);
}
// special case for when an empty transition|definition is provided
// ... there is no point in rendering an empty animation
return new _angular_animations__WEBPACK_IMPORTED_MODULE_1__["NoopAnimationPlayer"](instruction.duration, instruction.delay);
};
return TransitionAnimationEngine;
}());
var TransitionAnimationPlayer = /** @class */ (function () {
function TransitionAnimationPlayer(namespaceId, triggerName, element) {
this.namespaceId = namespaceId;
this.triggerName = triggerName;
this.element = element;
this._player = new _angular_animations__WEBPACK_IMPORTED_MODULE_1__["NoopAnimationPlayer"]();
this._containsRealPlayer = false;
this._queuedCallbacks = {};
this.destroyed = false;
this.markedForDestroy = false;
this.disabled = false;
this.queued = true;
this.totalTime = 0;
}
TransitionAnimationPlayer.prototype.setRealPlayer = function (player) {
var _this = this;
if (this._containsRealPlayer)
return;
this._player = player;
Object.keys(this._queuedCallbacks).forEach(function (phase) {
_this._queuedCallbacks[phase].forEach(function (callback) { return listenOnPlayer(player, phase, undefined, callback); });
});
this._queuedCallbacks = {};
this._containsRealPlayer = true;
this.overrideTotalTime(player.totalTime);
this.queued = false;
};
TransitionAnimationPlayer.prototype.getRealPlayer = function () { return this._player; };
TransitionAnimationPlayer.prototype.overrideTotalTime = function (totalTime) { this.totalTime = totalTime; };
TransitionAnimationPlayer.prototype.syncPlayerEvents = function (player) {
var _this = this;
var p = this._player;
if (p.triggerCallback) {
player.onStart(function () { return p.triggerCallback('start'); });
}
player.onDone(function () { return _this.finish(); });
player.onDestroy(function () { return _this.destroy(); });
};
TransitionAnimationPlayer.prototype._queueEvent = function (name, callback) {
getOrSetAsInMap(this._queuedCallbacks, name, []).push(callback);
};
TransitionAnimationPlayer.prototype.onDone = function (fn) {
if (this.queued) {
this._queueEvent('done', fn);
}
this._player.onDone(fn);
};
TransitionAnimationPlayer.prototype.onStart = function (fn) {
if (this.queued) {
this._queueEvent('start', fn);
}
this._player.onStart(fn);
};
TransitionAnimationPlayer.prototype.onDestroy = function (fn) {
if (this.queued) {
this._queueEvent('destroy', fn);
}
this._player.onDestroy(fn);
};
TransitionAnimationPlayer.prototype.init = function () { this._player.init(); };
TransitionAnimationPlayer.prototype.hasStarted = function () { return this.queued ? false : this._player.hasStarted(); };
TransitionAnimationPlayer.prototype.play = function () { !this.queued && this._player.play(); };
TransitionAnimationPlayer.prototype.pause = function () { !this.queued && this._player.pause(); };
TransitionAnimationPlayer.prototype.restart = function () { !this.queued && this._player.restart(); };
TransitionAnimationPlayer.prototype.finish = function () { this._player.finish(); };
TransitionAnimationPlayer.prototype.destroy = function () {
this.destroyed = true;
this._player.destroy();
};
TransitionAnimationPlayer.prototype.reset = function () { !this.queued && this._player.reset(); };
TransitionAnimationPlayer.prototype.setPosition = function (p) {
if (!this.queued) {
this._player.setPosition(p);
}
};
TransitionAnimationPlayer.prototype.getPosition = function () { return this.queued ? 0 : this._player.getPosition(); };
/* @internal */
TransitionAnimationPlayer.prototype.triggerCallback = function (phaseName) {
var p = this._player;
if (p.triggerCallback) {
p.triggerCallback(phaseName);
}
};
return TransitionAnimationPlayer;
}());
function deleteOrUnsetInMap(map, key, value) {
var currentValues;
if (map instanceof Map) {
currentValues = map.get(key);
if (currentValues) {
if (currentValues.length) {
var index = currentValues.indexOf(value);
currentValues.splice(index, 1);
}
if (currentValues.length == 0) {
map.delete(key);
}
}
}
else {
currentValues = map[key];
if (currentValues) {
if (currentValues.length) {
var index = currentValues.indexOf(value);
currentValues.splice(index, 1);
}
if (currentValues.length == 0) {
delete map[key];
}
}
}
return currentValues;
}
function normalizeTriggerValue(value) {
// we use `!= null` here because it's the most simple
// way to test against a "falsy" value without mixing
// in empty strings or a zero value. DO NOT OPTIMIZE.
return value != null ? value : null;
}
function isElementNode(node) {
return node && node['nodeType'] === 1;
}
function isTriggerEventValid(eventName) {
return eventName == 'start' || eventName == 'done';
}
function cloakElement(element, value) {
var oldValue = element.style.display;
element.style.display = value != null ? value : 'none';
return oldValue;
}
function cloakAndComputeStyles(valuesMap, driver, elements, elementPropsMap, defaultStyle) {
var cloakVals = [];
elements.forEach(function (element) { return cloakVals.push(cloakElement(element)); });
var failedElements = [];
elementPropsMap.forEach(function (props, element) {
var styles = {};
props.forEach(function (prop) {
var value = styles[prop] = driver.computeStyle(element, prop, defaultStyle);
// there is no easy way to detect this because a sub element could be removed
// by a parent animation element being detached.
if (!value || value.length == 0) {
element[REMOVAL_FLAG] = NULL_REMOVED_QUERIED_STATE;
failedElements.push(element);
}
});
valuesMap.set(element, styles);
});
// we use a index variable here since Set.forEach(a, i) does not return
// an index value for the closure (but instead just the value)
var i = 0;
elements.forEach(function (element) { return cloakElement(element, cloakVals[i++]); });
return failedElements;
}
/*
Since the Angular renderer code will return a collection of inserted
nodes in all areas of a DOM tree, it's up to this algorithm to figure
out which nodes are roots for each animation @trigger.
By placing each inserted node into a Set and traversing upwards, it
is possible to find the @trigger elements and well any direct *star
insertion nodes, if a @trigger root is found then the enter element
is placed into the Map[@trigger] spot.
*/
function buildRootMap(roots, nodes) {
var rootMap = new Map();
roots.forEach(function (root) { return rootMap.set(root, []); });
if (nodes.length == 0)
return rootMap;
var NULL_NODE = 1;
var nodeSet = new Set(nodes);
var localRootMap = new Map();
function getRoot(node) {
if (!node)
return NULL_NODE;
var root = localRootMap.get(node);
if (root)
return root;
var parent = node.parentNode;
if (rootMap.has(parent)) {
root = parent;
}
else if (nodeSet.has(parent)) {
root = NULL_NODE;
}
else {
root = getRoot(parent);
}
localRootMap.set(node, root);
return root;
}
nodes.forEach(function (node) {
var root = getRoot(node);
if (root !== NULL_NODE) {
rootMap.get(root).push(node);
}
});
return rootMap;
}
var CLASSES_CACHE_KEY = '$$classes';
function addClass(element, className) {
if (element.classList) {
element.classList.add(className);
}
else {
var classes = element[CLASSES_CACHE_KEY];
if (!classes) {
classes = element[CLASSES_CACHE_KEY] = {};
}
classes[className] = true;
}
}
function removeClass(element, className) {
if (element.classList) {
element.classList.remove(className);
}
else {
var classes = element[CLASSES_CACHE_KEY];
if (classes) {
delete classes[className];
}
}
}
function removeNodesAfterAnimationDone(engine, element, players) {
optimizeGroupPlayer(players).onDone(function () { return engine.processLeaveNode(element); });
}
function flattenGroupPlayers(players) {
var finalPlayers = [];
_flattenGroupPlayersRecur(players, finalPlayers);
return finalPlayers;
}
function _flattenGroupPlayersRecur(players, finalPlayers) {
for (var i = 0; i < players.length; i++) {
var player = players[i];
if (player instanceof _angular_animations__WEBPACK_IMPORTED_MODULE_1__["ɵAnimationGroupPlayer"]) {
_flattenGroupPlayersRecur(player.players, finalPlayers);
}
else {
finalPlayers.push(player);
}
}
}
function objEquals(a, b) {
var k1 = Object.keys(a);
var k2 = Object.keys(b);
if (k1.length != k2.length)
return false;
for (var i = 0; i < k1.length; i++) {
var prop = k1[i];
if (!b.hasOwnProperty(prop) || a[prop] !== b[prop])
return false;
}
return true;
}
function replacePostStylesAsPre(element, allPreStyleElements, allPostStyleElements) {
var postEntry = allPostStyleElements.get(element);
if (!postEntry)
return false;
var preEntry = allPreStyleElements.get(element);
if (preEntry) {
postEntry.forEach(function (data) { return preEntry.add(data); });
}
else {
allPreStyleElements.set(element, postEntry);
}
allPostStyleElements.delete(element);
return true;
}
var AnimationEngine = /** @class */ (function () {
function AnimationEngine(bodyNode, _driver, normalizer) {
var _this = this;
this.bodyNode = bodyNode;
this._driver = _driver;
this._triggerCache = {};
// this method is designed to be overridden by the code that uses this engine
this.onRemovalComplete = function (element, context) { };
this._transitionEngine = new TransitionAnimationEngine(bodyNode, _driver, normalizer);
this._timelineEngine = new TimelineAnimationEngine(bodyNode, _driver, normalizer);
this._transitionEngine.onRemovalComplete = function (element, context) {
return _this.onRemovalComplete(element, context);
};
}
AnimationEngine.prototype.registerTrigger = function (componentId, namespaceId, hostElement, name, metadata) {
var cacheKey = componentId + '-' + name;
var trigger = this._triggerCache[cacheKey];
if (!trigger) {
var errors = [];
var ast = buildAnimationAst(this._driver, metadata, errors);
if (errors.length) {
throw new Error("The animation trigger \"" + name + "\" has failed to build due to the following errors:\n - " + errors.join("\n - "));
}
trigger = buildTrigger(name, ast);
this._triggerCache[cacheKey] = trigger;
}
this._transitionEngine.registerTrigger(namespaceId, name, trigger);
};
AnimationEngine.prototype.register = function (namespaceId, hostElement) {
this._transitionEngine.register(namespaceId, hostElement);
};
AnimationEngine.prototype.destroy = function (namespaceId, context) {
this._transitionEngine.destroy(namespaceId, context);
};
AnimationEngine.prototype.onInsert = function (namespaceId, element, parent, insertBefore) {
this._transitionEngine.insertNode(namespaceId, element, parent, insertBefore);
};
AnimationEngine.prototype.onRemove = function (namespaceId, element, context) {
this._transitionEngine.removeNode(namespaceId, element, context);
};
AnimationEngine.prototype.disableAnimations = function (element, disable) {
this._transitionEngine.markElementAsDisabled(element, disable);
};
AnimationEngine.prototype.process = function (namespaceId, element, property, value) {
if (property.charAt(0) == '@') {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(parseTimelineCommand(property), 2), id = _a[0], action = _a[1];
var args = value;
this._timelineEngine.command(id, element, action, args);
}
else {
this._transitionEngine.trigger(namespaceId, element, property, value);
}
};
AnimationEngine.prototype.listen = function (namespaceId, element, eventName, eventPhase, callback) {
// @@listen
if (eventName.charAt(0) == '@') {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(parseTimelineCommand(eventName), 2), id = _a[0], action = _a[1];
return this._timelineEngine.listen(id, element, action, callback);
}
return this._transitionEngine.listen(namespaceId, element, eventName, eventPhase, callback);
};
AnimationEngine.prototype.flush = function (microtaskId) {
if (microtaskId === void 0) { microtaskId = -1; }
this._transitionEngine.flush(microtaskId);
};
Object.defineProperty(AnimationEngine.prototype, "players", {
get: function () {
return this._transitionEngine.players
.concat(this._timelineEngine.players);
},
enumerable: true,
configurable: true
});
AnimationEngine.prototype.whenRenderingDone = function () { return this._transitionEngine.whenRenderingDone(); };
return AnimationEngine;
}());
/**
* @license
* Copyright Google Inc. 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 ELAPSED_TIME_MAX_DECIMAL_PLACES = 3;
var ANIMATION_PROP = 'animation';
var ANIMATIONEND_EVENT = 'animationend';
var ONE_SECOND$1 = 1000;
var ElementAnimationStyleHandler = /** @class */ (function () {
function ElementAnimationStyleHandler(_element, _name, _duration, _delay, _easing, _fillMode, _onDoneFn) {
var _this = this;
this._element = _element;
this._name = _name;
this._duration = _duration;
this._delay = _delay;
this._easing = _easing;
this._fillMode = _fillMode;
this._onDoneFn = _onDoneFn;
this._finished = false;
this._destroyed = false;
this._startTime = 0;
this._position = 0;
this._eventFn = function (e) { return _this._handleCallback(e); };
}
ElementAnimationStyleHandler.prototype.apply = function () {
applyKeyframeAnimation(this._element, this._duration + "ms " + this._easing + " " + this._delay + "ms 1 normal " + this._fillMode + " " + this._name);
addRemoveAnimationEvent(this._element, this._eventFn, false);
this._startTime = Date.now();
};
ElementAnimationStyleHandler.prototype.pause = function () { playPauseAnimation(this._element, this._name, 'paused'); };
ElementAnimationStyleHandler.prototype.resume = function () { playPauseAnimation(this._element, this._name, 'running'); };
ElementAnimationStyleHandler.prototype.setPosition = function (position) {
var index = findIndexForAnimation(this._element, this._name);
this._position = position * this._duration;
setAnimationStyle(this._element, 'Delay', "-" + this._position + "ms", index);
};
ElementAnimationStyleHandler.prototype.getPosition = function () { return this._position; };
ElementAnimationStyleHandler.prototype._handleCallback = function (event) {
var timestamp = event._ngTestManualTimestamp || Date.now();
var elapsedTime = parseFloat(event.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES)) * ONE_SECOND$1;
if (event.animationName == this._name &&
Math.max(timestamp - this._startTime, 0) >= this._delay && elapsedTime >= this._duration) {
this.finish();
}
};
ElementAnimationStyleHandler.prototype.finish = function () {
if (this._finished)
return;
this._finished = true;
this._onDoneFn();
addRemoveAnimationEvent(this._element, this._eventFn, true);
};
ElementAnimationStyleHandler.prototype.destroy = function () {
if (this._destroyed)
return;
this._destroyed = true;
this.finish();
removeKeyframeAnimation(this._element, this._name);
};
return ElementAnimationStyleHandler;
}());
function playPauseAnimation(element, name, status) {
var index = findIndexForAnimation(element, name);
setAnimationStyle(element, 'PlayState', status, index);
}
function applyKeyframeAnimation(element, value) {
var anim = getAnimationStyle(element, '').trim();
var index = 0;
if (anim.length) {
index = countChars(anim, ',') + 1;
value = anim + ", " + value;
}
setAnimationStyle(element, '', value);
return index;
}
function removeKeyframeAnimation(element, name) {
var anim = getAnimationStyle(element, '');
var tokens = anim.split(',');
var index = findMatchingTokenIndex(tokens, name);
if (index >= 0) {
tokens.splice(index, 1);
var newValue = tokens.join(',');
setAnimationStyle(element, '', newValue);
}
}
function findIndexForAnimation(element, value) {
var anim = getAnimationStyle(element, '');
if (anim.indexOf(',') > 0) {
var tokens = anim.split(',');
return findMatchingTokenIndex(tokens, value);
}
return findMatchingTokenIndex([anim], value);
}
function findMatchingTokenIndex(tokens, searchToken) {
for (var i = 0; i < tokens.length; i++) {
if (tokens[i].indexOf(searchToken) >= 0) {
return i;
}
}
return -1;
}
function addRemoveAnimationEvent(element, fn, doRemove) {
doRemove ? element.removeEventListener(ANIMATIONEND_EVENT, fn) :
element.addEventListener(ANIMATIONEND_EVENT, fn);
}
function setAnimationStyle(element, name, value, index) {
var prop = ANIMATION_PROP + name;
if (index != null) {
var oldValue = element.style[prop];
if (oldValue.length) {
var tokens = oldValue.split(',');
tokens[index] = value;
value = tokens.join(',');
}
}
element.style[prop] = value;
}
function getAnimationStyle(element, name) {
return element.style[ANIMATION_PROP + name];
}
function countChars(value, char) {
var count = 0;
for (var i = 0; i < value.length; i++) {
var c = value.charAt(i);
if (c === char)
count++;
}
return count;
}
var DEFAULT_FILL_MODE = 'forwards';
var DEFAULT_EASING = 'linear';
var AnimatorControlState;
(function (AnimatorControlState) {
AnimatorControlState[AnimatorControlState["INITIALIZED"] = 1] = "INITIALIZED";
AnimatorControlState[AnimatorControlState["STARTED"] = 2] = "STARTED";
AnimatorControlState[AnimatorControlState["FINISHED"] = 3] = "FINISHED";
AnimatorControlState[AnimatorControlState["DESTROYED"] = 4] = "DESTROYED";
})(AnimatorControlState || (AnimatorControlState = {}));
var CssKeyframesPlayer = /** @class */ (function () {
function CssKeyframesPlayer(element, keyframes, animationName, _duration, _delay, easing, _finalStyles) {
this.element = element;
this.keyframes = keyframes;
this.animationName = animationName;
this._duration = _duration;
this._delay = _delay;
this._finalStyles = _finalStyles;
this._onDoneFns = [];
this._onStartFns = [];
this._onDestroyFns = [];
this._started = false;
this.currentSnapshot = {};
this.state = 0;
this.easing = easing || DEFAULT_EASING;
this.totalTime = _duration + _delay;
this._buildStyler();
}
CssKeyframesPlayer.prototype.onStart = function (fn) { this._onStartFns.push(fn); };
CssKeyframesPlayer.prototype.onDone = function (fn) { this._onDoneFns.push(fn); };
CssKeyframesPlayer.prototype.onDestroy = function (fn) { this._onDestroyFns.push(fn); };
CssKeyframesPlayer.prototype.destroy = function () {
this.init();
if (this.state >= AnimatorControlState.DESTROYED)
return;
this.state = AnimatorControlState.DESTROYED;
this._styler.destroy();
this._flushStartFns();
this._flushDoneFns();
this._onDestroyFns.forEach(function (fn) { return fn(); });
this._onDestroyFns = [];
};
CssKeyframesPlayer.prototype._flushDoneFns = function () {
this._onDoneFns.forEach(function (fn) { return fn(); });
this._onDoneFns = [];
};
CssKeyframesPlayer.prototype._flushStartFns = function () {
this._onStartFns.forEach(function (fn) { return fn(); });
this._onStartFns = [];
};
CssKeyframesPlayer.prototype.finish = function () {
this.init();
if (this.state >= AnimatorControlState.FINISHED)
return;
this.state = AnimatorControlState.FINISHED;
this._styler.finish();
this._flushStartFns();
this._flushDoneFns();
};
CssKeyframesPlayer.prototype.setPosition = function (value) { this._styler.setPosition(value); };
CssKeyframesPlayer.prototype.getPosition = function () { return this._styler.getPosition(); };
CssKeyframesPlayer.prototype.hasStarted = function () { return this.state >= AnimatorControlState.STARTED; };
CssKeyframesPlayer.prototype.init = function () {
if (this.state >= AnimatorControlState.INITIALIZED)
return;
this.state = AnimatorControlState.INITIALIZED;
var elm = this.element;
this._styler.apply();
if (this._delay) {
this._styler.pause();
}
};
CssKeyframesPlayer.prototype.play = function () {
this.init();
if (!this.hasStarted()) {
this._flushStartFns();
this.state = AnimatorControlState.STARTED;
}
this._styler.resume();
};
CssKeyframesPlayer.prototype.pause = function () {
this.init();
this._styler.pause();
};
CssKeyframesPlayer.prototype.restart = function () {
this.reset();
this.play();
};
CssKeyframesPlayer.prototype.reset = function () {
this._styler.destroy();
this._buildStyler();
this._styler.apply();
};
CssKeyframesPlayer.prototype._buildStyler = function () {
var _this = this;
this._styler = new ElementAnimationStyleHandler(this.element, this.animationName, this._duration, this._delay, this.easing, DEFAULT_FILL_MODE, function () { return _this.finish(); });
};
/* @internal */
CssKeyframesPlayer.prototype.triggerCallback = function (phaseName) {
var methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns;
methods.forEach(function (fn) { return fn(); });
methods.length = 0;
};
CssKeyframesPlayer.prototype.beforeDestroy = function () {
var _this = this;
this.init();
var styles = {};
if (this.hasStarted()) {
var finished_1 = this.state >= AnimatorControlState.FINISHED;
Object.keys(this._finalStyles).forEach(function (prop) {
if (prop != 'offset') {
styles[prop] = finished_1 ? _this._finalStyles[prop] : computeStyle(_this.element, prop);
}
});
}
this.currentSnapshot = styles;
};
return CssKeyframesPlayer;
}());
var DirectStylePlayer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(DirectStylePlayer, _super);
function DirectStylePlayer(element, styles) {
var _this = _super.call(this) || this;
_this.element = element;
_this._startingStyles = {};
_this.__initialized = false;
_this._styles = hypenatePropsObject(styles);
return _this;
}
DirectStylePlayer.prototype.init = function () {
var _this = this;
if (this.__initialized || !this._startingStyles)
return;
this.__initialized = true;
Object.keys(this._styles).forEach(function (prop) {
_this._startingStyles[prop] = _this.element.style[prop];
});
_super.prototype.init.call(this);
};
DirectStylePlayer.prototype.play = function () {
var _this = this;
if (!this._startingStyles)
return;
this.init();
Object.keys(this._styles)
.forEach(function (prop) { return _this.element.style.setProperty(prop, _this._styles[prop]); });
_super.prototype.play.call(this);
};
DirectStylePlayer.prototype.destroy = function () {
var _this = this;
if (!this._startingStyles)
return;
Object.keys(this._startingStyles).forEach(function (prop) {
var value = _this._startingStyles[prop];
if (value) {
_this.element.style.setProperty(prop, value);
}
else {
_this.element.style.removeProperty(prop);
}
});
this._startingStyles = null;
_super.prototype.destroy.call(this);
};
return DirectStylePlayer;
}(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["NoopAnimationPlayer"]));
var KEYFRAMES_NAME_PREFIX = 'gen_css_kf_';
var TAB_SPACE = ' ';
var CssKeyframesDriver = /** @class */ (function () {
function CssKeyframesDriver() {
this._count = 0;
this._head = document.querySelector('head');
this._warningIssued = false;
}
CssKeyframesDriver.prototype.validateStyleProperty = function (prop) { return validateStyleProperty(prop); };
CssKeyframesDriver.prototype.matchesElement = function (element, selector) {
return matchesElement(element, selector);
};
CssKeyframesDriver.prototype.containsElement = function (elm1, elm2) { return containsElement(elm1, elm2); };
CssKeyframesDriver.prototype.query = function (element, selector, multi) {
return invokeQuery(element, selector, multi);
};
CssKeyframesDriver.prototype.computeStyle = function (element, prop, defaultValue) {
return window.getComputedStyle(element)[prop];
};
CssKeyframesDriver.prototype.buildKeyframeElement = function (element, name, keyframes) {
keyframes = keyframes.map(function (kf) { return hypenatePropsObject(kf); });
var keyframeStr = "@keyframes " + name + " {\n";
var tab = '';
keyframes.forEach(function (kf) {
tab = TAB_SPACE;
var offset = parseFloat(kf.offset);
keyframeStr += "" + tab + offset * 100 + "% {\n";
tab += TAB_SPACE;
Object.keys(kf).forEach(function (prop) {
var value = kf[prop];
switch (prop) {
case 'offset':
return;
case 'easing':
if (value) {
keyframeStr += tab + "animation-timing-function: " + value + ";\n";
}
return;
default:
keyframeStr += "" + tab + prop + ": " + value + ";\n";
return;
}
});
keyframeStr += tab + "}\n";
});
keyframeStr += "}\n";
var kfElm = document.createElement('style');
kfElm.innerHTML = keyframeStr;
return kfElm;
};
CssKeyframesDriver.prototype.animate = function (element, keyframes, duration, delay, easing, previousPlayers, scrubberAccessRequested) {
if (previousPlayers === void 0) { previousPlayers = []; }
if (scrubberAccessRequested) {
this._notifyFaultyScrubber();
}
var previousCssKeyframePlayers = previousPlayers.filter(function (player) { return player instanceof CssKeyframesPlayer; });
var previousStyles = {};
if (allowPreviousPlayerStylesMerge(duration, delay)) {
previousCssKeyframePlayers.forEach(function (player) {
var styles = player.currentSnapshot;
Object.keys(styles).forEach(function (prop) { return previousStyles[prop] = styles[prop]; });
});
}
keyframes = balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles);
var finalStyles = flattenKeyframesIntoStyles(keyframes);
// if there is no animation then there is no point in applying
// styles and waiting for an event to get fired. This causes lag.
// It's better to just directly apply the styles to the element
// via the direct styling animation player.
if (duration == 0) {
return new DirectStylePlayer(element, finalStyles);
}
var animationName = "" + KEYFRAMES_NAME_PREFIX + this._count++;
var kfElm = this.buildKeyframeElement(element, animationName, keyframes);
document.querySelector('head').appendChild(kfElm);
var player = new CssKeyframesPlayer(element, keyframes, animationName, duration, delay, easing, finalStyles);
player.onDestroy(function () { return removeElement(kfElm); });
return player;
};
CssKeyframesDriver.prototype._notifyFaultyScrubber = function () {
if (!this._warningIssued) {
console.warn('@angular/animations: please load the web-animations.js polyfill to allow programmatic access...\n', ' visit http://bit.ly/IWukam to learn more about using the web-animation-js polyfill.');
this._warningIssued = true;
}
};
return CssKeyframesDriver;
}());
function flattenKeyframesIntoStyles(keyframes) {
var flatKeyframes = {};
if (keyframes) {
var kfs = Array.isArray(keyframes) ? keyframes : [keyframes];
kfs.forEach(function (kf) {
Object.keys(kf).forEach(function (prop) {
if (prop == 'offset' || prop == 'easing')
return;
flatKeyframes[prop] = kf[prop];
});
});
}
return flatKeyframes;
}
function removeElement(node) {
node.parentNode.removeChild(node);
}
var WebAnimationsPlayer = /** @class */ (function () {
function WebAnimationsPlayer(element, keyframes, options) {
this.element = element;
this.keyframes = keyframes;
this.options = options;
this._onDoneFns = [];
this._onStartFns = [];
this._onDestroyFns = [];
this._initialized = false;
this._finished = false;
this._started = false;
this._destroyed = false;
this.time = 0;
this.parentPlayer = null;
this.currentSnapshot = {};
this._duration = options['duration'];
this._delay = options['delay'] || 0;
this.time = this._duration + this._delay;
}
WebAnimationsPlayer.prototype._onFinish = function () {
if (!this._finished) {
this._finished = true;
this._onDoneFns.forEach(function (fn) { return fn(); });
this._onDoneFns = [];
}
};
WebAnimationsPlayer.prototype.init = function () {
this._buildPlayer();
this._preparePlayerBeforeStart();
};
WebAnimationsPlayer.prototype._buildPlayer = function () {
var _this = this;
if (this._initialized)
return;
this._initialized = true;
var keyframes = this.keyframes;
this.domPlayer =
this._triggerWebAnimation(this.element, keyframes, this.options);
this._finalKeyframe = keyframes.length ? keyframes[keyframes.length - 1] : {};
this.domPlayer.addEventListener('finish', function () { return _this._onFinish(); });
};
WebAnimationsPlayer.prototype._preparePlayerBeforeStart = function () {
// this is required so that the player doesn't start to animate right away
if (this._delay) {
this._resetDomPlayerState();
}
else {
this.domPlayer.pause();
}
};
/** @internal */
WebAnimationsPlayer.prototype._triggerWebAnimation = function (element, keyframes, options) {
// jscompiler doesn't seem to know animate is a native property because it's not fully
// supported yet across common browsers (we polyfill it for Edge/Safari) [CL #143630929]
return element['animate'](keyframes, options);
};
WebAnimationsPlayer.prototype.onStart = function (fn) { this._onStartFns.push(fn); };
WebAnimationsPlayer.prototype.onDone = function (fn) { this._onDoneFns.push(fn); };
WebAnimationsPlayer.prototype.onDestroy = function (fn) { this._onDestroyFns.push(fn); };
WebAnimationsPlayer.prototype.play = function () {
this._buildPlayer();
if (!this.hasStarted()) {
this._onStartFns.forEach(function (fn) { return fn(); });
this._onStartFns = [];
this._started = true;
}
this.domPlayer.play();
};
WebAnimationsPlayer.prototype.pause = function () {
this.init();
this.domPlayer.pause();
};
WebAnimationsPlayer.prototype.finish = function () {
this.init();
this._onFinish();
this.domPlayer.finish();
};
WebAnimationsPlayer.prototype.reset = function () {
this._resetDomPlayerState();
this._destroyed = false;
this._finished = false;
this._started = false;
};
WebAnimationsPlayer.prototype._resetDomPlayerState = function () {
if (this.domPlayer) {
this.domPlayer.cancel();
}
};
WebAnimationsPlayer.prototype.restart = function () {
this.reset();
this.play();
};
WebAnimationsPlayer.prototype.hasStarted = function () { return this._started; };
WebAnimationsPlayer.prototype.destroy = function () {
if (!this._destroyed) {
this._destroyed = true;
this._resetDomPlayerState();
this._onFinish();
this._onDestroyFns.forEach(function (fn) { return fn(); });
this._onDestroyFns = [];
}
};
WebAnimationsPlayer.prototype.setPosition = function (p) { this.domPlayer.currentTime = p * this.time; };
WebAnimationsPlayer.prototype.getPosition = function () { return this.domPlayer.currentTime / this.time; };
Object.defineProperty(WebAnimationsPlayer.prototype, "totalTime", {
get: function () { return this._delay + this._duration; },
enumerable: true,
configurable: true
});
WebAnimationsPlayer.prototype.beforeDestroy = function () {
var _this = this;
var styles = {};
if (this.hasStarted()) {
Object.keys(this._finalKeyframe).forEach(function (prop) {
if (prop != 'offset') {
styles[prop] =
_this._finished ? _this._finalKeyframe[prop] : computeStyle(_this.element, prop);
}
});
}
this.currentSnapshot = styles;
};
/* @internal */
WebAnimationsPlayer.prototype.triggerCallback = function (phaseName) {
var methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns;
methods.forEach(function (fn) { return fn(); });
methods.length = 0;
};
return WebAnimationsPlayer;
}());
var WebAnimationsDriver = /** @class */ (function () {
function WebAnimationsDriver() {
this._isNativeImpl = /\{\s*\[native\s+code\]\s*\}/.test(getElementAnimateFn().toString());
this._cssKeyframesDriver = new CssKeyframesDriver();
}
WebAnimationsDriver.prototype.validateStyleProperty = function (prop) { return validateStyleProperty(prop); };
WebAnimationsDriver.prototype.matchesElement = function (element, selector) {
return matchesElement(element, selector);
};
WebAnimationsDriver.prototype.containsElement = function (elm1, elm2) { return containsElement(elm1, elm2); };
WebAnimationsDriver.prototype.query = function (element, selector, multi) {
return invokeQuery(element, selector, multi);
};
WebAnimationsDriver.prototype.computeStyle = function (element, prop, defaultValue) {
return window.getComputedStyle(element)[prop];
};
WebAnimationsDriver.prototype.overrideWebAnimationsSupport = function (supported) { this._isNativeImpl = supported; };
WebAnimationsDriver.prototype.animate = function (element, keyframes, duration, delay, easing, previousPlayers, scrubberAccessRequested) {
if (previousPlayers === void 0) { previousPlayers = []; }
var useKeyframes = !scrubberAccessRequested && !this._isNativeImpl;
if (useKeyframes) {
return this._cssKeyframesDriver.animate(element, keyframes, duration, delay, easing, previousPlayers);
}
var fill = delay == 0 ? 'both' : 'forwards';
var playerOptions = { duration: duration, delay: delay, fill: fill };
// we check for this to avoid having a null|undefined value be present
// for the easing (which results in an error for certain browsers #9752)
if (easing) {
playerOptions['easing'] = easing;
}
var previousStyles = {};
var previousWebAnimationPlayers = previousPlayers.filter(function (player) { return player instanceof WebAnimationsPlayer; });
if (allowPreviousPlayerStylesMerge(duration, delay)) {
previousWebAnimationPlayers.forEach(function (player) {
var styles = player.currentSnapshot;
Object.keys(styles).forEach(function (prop) { return previousStyles[prop] = styles[prop]; });
});
}
keyframes = keyframes.map(function (styles) { return copyStyles(styles, false); });
keyframes = balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles);
return new WebAnimationsPlayer(element, keyframes, playerOptions);
};
return WebAnimationsDriver;
}());
function supportsWebAnimations() {
return typeof getElementAnimateFn() === 'function';
}
function getElementAnimateFn() {
return (isBrowser() && Element.prototype['animate']) || {};
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Generated bundle index. Do not edit.
*/
//# sourceMappingURL=browser.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/a11y.es5.js":
/*!****************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/a11y.es5.js ***!
\****************************************************/
/*! exports provided: MESSAGES_CONTAINER_ID, CDK_DESCRIBEDBY_ID_PREFIX, CDK_DESCRIBEDBY_HOST_ATTRIBUTE, AriaDescriber, ARIA_DESCRIBER_PROVIDER_FACTORY, ARIA_DESCRIBER_PROVIDER, ActiveDescendantKeyManager, FocusKeyManager, ListKeyManager, FocusTrap, FocusTrapFactory, CdkTrapFocus, InteractivityChecker, LiveAnnouncer, LIVE_ANNOUNCER_PROVIDER_FACTORY, LIVE_ANNOUNCER_PROVIDER, LIVE_ANNOUNCER_ELEMENT_TOKEN, LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY, TOUCH_BUFFER_MS, FocusMonitor, CdkMonitorFocus, FOCUS_MONITOR_PROVIDER_FACTORY, FOCUS_MONITOR_PROVIDER, isFakeMousedownFromScreenReader, A11yModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MESSAGES_CONTAINER_ID", function() { return MESSAGES_CONTAINER_ID; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CDK_DESCRIBEDBY_ID_PREFIX", function() { return CDK_DESCRIBEDBY_ID_PREFIX; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CDK_DESCRIBEDBY_HOST_ATTRIBUTE", function() { return CDK_DESCRIBEDBY_HOST_ATTRIBUTE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AriaDescriber", function() { return AriaDescriber; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARIA_DESCRIBER_PROVIDER_FACTORY", function() { return ARIA_DESCRIBER_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARIA_DESCRIBER_PROVIDER", function() { return ARIA_DESCRIBER_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActiveDescendantKeyManager", function() { return ActiveDescendantKeyManager; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FocusKeyManager", function() { return FocusKeyManager; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListKeyManager", function() { return ListKeyManager; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FocusTrap", function() { return FocusTrap; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FocusTrapFactory", function() { return FocusTrapFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTrapFocus", function() { return CdkTrapFocus; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InteractivityChecker", function() { return InteractivityChecker; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LiveAnnouncer", function() { return LiveAnnouncer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LIVE_ANNOUNCER_PROVIDER_FACTORY", function() { return LIVE_ANNOUNCER_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LIVE_ANNOUNCER_PROVIDER", function() { return LIVE_ANNOUNCER_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LIVE_ANNOUNCER_ELEMENT_TOKEN", function() { return LIVE_ANNOUNCER_ELEMENT_TOKEN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY", function() { return LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TOUCH_BUFFER_MS", function() { return TOUCH_BUFFER_MS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FocusMonitor", function() { return FocusMonitor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkMonitorFocus", function() { return CdkMonitorFocus; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FOCUS_MONITOR_PROVIDER_FACTORY", function() { return FOCUS_MONITOR_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FOCUS_MONITOR_PROVIDER", function() { return FOCUS_MONITOR_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFakeMousedownFromScreenReader", function() { return isFakeMousedownFromScreenReader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A11yModule", function() { return A11yModule; });
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* IDs are deliminated by an empty space, as per the spec.
*/
var /** @type {?} */ ID_DELIMINATOR = ' ';
/**
* Adds the given ID to the specified ARIA attribute on an element.
* Used for attributes such as aria-labelledby, aria-owns, etc.
* @param {?} el
* @param {?} attr
* @param {?} id
* @return {?}
*/
function addAriaReferencedId(el, attr, id) {
var /** @type {?} */ ids = getAriaReferenceIds(el, attr);
if (ids.some(function (existingId) { return existingId.trim() == id.trim(); })) {
return;
}
ids.push(id.trim());
el.setAttribute(attr, ids.join(ID_DELIMINATOR));
}
/**
* Removes the given ID from the specified ARIA attribute on an element.
* Used for attributes such as aria-labelledby, aria-owns, etc.
* @param {?} el
* @param {?} attr
* @param {?} id
* @return {?}
*/
function removeAriaReferencedId(el, attr, id) {
var /** @type {?} */ ids = getAriaReferenceIds(el, attr);
var /** @type {?} */ filteredIds = ids.filter(function (val) { return val != id.trim(); });
el.setAttribute(attr, filteredIds.join(ID_DELIMINATOR));
}
/**
* Gets the list of IDs referenced by the given ARIA attribute on an element.
* Used for attributes such as aria-labelledby, aria-owns, etc.
* @param {?} el
* @param {?} attr
* @return {?}
*/
function getAriaReferenceIds(el, attr) {
// Get string array of all individual ids (whitespace deliminated) in the attribute value
return (el.getAttribute(attr) || '').match(/\S+/g) || [];
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* ID used for the body container where all messages are appended.
*/
var /** @type {?} */ MESSAGES_CONTAINER_ID = 'cdk-describedby-message-container';
/**
* ID prefix used for each created message element.
*/
var /** @type {?} */ CDK_DESCRIBEDBY_ID_PREFIX = 'cdk-describedby-message';
/**
* Attribute given to each host element that is described by a message element.
*/
var /** @type {?} */ CDK_DESCRIBEDBY_HOST_ATTRIBUTE = 'cdk-describedby-host';
/**
* Global incremental identifier for each registered message element.
*/
var /** @type {?} */ nextId = 0;
/**
* Global map of all registered message elements that have been placed into the document.
*/
var /** @type {?} */ messageRegistry = new Map();
/**
* Container for all registered messages.
*/
var /** @type {?} */ messagesContainer = null;
/**
* Utility that creates visually hidden elements with a message content. Useful for elements that
* want to use aria-describedby to further describe themselves without adding additional visual
* content.
* \@docs-private
*/
var AriaDescriber = /** @class */ (function () {
function AriaDescriber(_document) {
this._document = _document;
}
/**
* Adds to the host element an aria-describedby reference to a hidden element that contains
* the message. If the same message has already been registered, then it will reuse the created
* message element.
*/
/**
* Adds to the host element an aria-describedby reference to a hidden element that contains
* the message. If the same message has already been registered, then it will reuse the created
* message element.
* @param {?} hostElement
* @param {?} message
* @return {?}
*/
AriaDescriber.prototype.describe = /**
* Adds to the host element an aria-describedby reference to a hidden element that contains
* the message. If the same message has already been registered, then it will reuse the created
* message element.
* @param {?} hostElement
* @param {?} message
* @return {?}
*/
function (hostElement, message) {
if (!this._canBeDescribed(hostElement, message)) {
return;
}
if (!messageRegistry.has(message)) {
this._createMessageElement(message);
}
if (!this._isElementDescribedByMessage(hostElement, message)) {
this._addMessageReference(hostElement, message);
}
};
/** Removes the host element's aria-describedby reference to the message element. */
/**
* Removes the host element's aria-describedby reference to the message element.
* @param {?} hostElement
* @param {?} message
* @return {?}
*/
AriaDescriber.prototype.removeDescription = /**
* Removes the host element's aria-describedby reference to the message element.
* @param {?} hostElement
* @param {?} message
* @return {?}
*/
function (hostElement, message) {
if (!this._canBeDescribed(hostElement, message)) {
return;
}
if (this._isElementDescribedByMessage(hostElement, message)) {
this._removeMessageReference(hostElement, message);
}
var /** @type {?} */ registeredMessage = messageRegistry.get(message);
if (registeredMessage && registeredMessage.referenceCount === 0) {
this._deleteMessageElement(message);
}
if (messagesContainer && messagesContainer.childNodes.length === 0) {
this._deleteMessagesContainer();
}
};
/** Unregisters all created message elements and removes the message container. */
/**
* Unregisters all created message elements and removes the message container.
* @return {?}
*/
AriaDescriber.prototype.ngOnDestroy = /**
* Unregisters all created message elements and removes the message container.
* @return {?}
*/
function () {
var /** @type {?} */ describedElements = this._document.querySelectorAll("[" + CDK_DESCRIBEDBY_HOST_ATTRIBUTE + "]");
for (var /** @type {?} */ i = 0; i < describedElements.length; i++) {
this._removeCdkDescribedByReferenceIds(describedElements[i]);
describedElements[i].removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);
}
if (messagesContainer) {
this._deleteMessagesContainer();
}
messageRegistry.clear();
};
/**
* Creates a new element in the visually hidden message container element with the message
* as its content and adds it to the message registry.
* @param {?} message
* @return {?}
*/
AriaDescriber.prototype._createMessageElement = /**
* Creates a new element in the visually hidden message container element with the message
* as its content and adds it to the message registry.
* @param {?} message
* @return {?}
*/
function (message) {
var /** @type {?} */ messageElement = this._document.createElement('div');
messageElement.setAttribute('id', CDK_DESCRIBEDBY_ID_PREFIX + "-" + nextId++);
messageElement.appendChild(/** @type {?} */ ((this._document.createTextNode(message))));
if (!messagesContainer) {
this._createMessagesContainer();
} /** @type {?} */
((messagesContainer)).appendChild(messageElement);
messageRegistry.set(message, { messageElement: messageElement, referenceCount: 0 });
};
/**
* Deletes the message element from the global messages container.
* @param {?} message
* @return {?}
*/
AriaDescriber.prototype._deleteMessageElement = /**
* Deletes the message element from the global messages container.
* @param {?} message
* @return {?}
*/
function (message) {
var /** @type {?} */ registeredMessage = messageRegistry.get(message);
var /** @type {?} */ messageElement = registeredMessage && registeredMessage.messageElement;
if (messagesContainer && messageElement) {
messagesContainer.removeChild(messageElement);
}
messageRegistry.delete(message);
};
/**
* Creates the global container for all aria-describedby messages.
* @return {?}
*/
AriaDescriber.prototype._createMessagesContainer = /**
* Creates the global container for all aria-describedby messages.
* @return {?}
*/
function () {
messagesContainer = this._document.createElement('div');
messagesContainer.setAttribute('id', MESSAGES_CONTAINER_ID);
messagesContainer.setAttribute('aria-hidden', 'true');
messagesContainer.style.display = 'none';
this._document.body.appendChild(messagesContainer);
};
/**
* Deletes the global messages container.
* @return {?}
*/
AriaDescriber.prototype._deleteMessagesContainer = /**
* Deletes the global messages container.
* @return {?}
*/
function () {
if (messagesContainer && messagesContainer.parentNode) {
messagesContainer.parentNode.removeChild(messagesContainer);
messagesContainer = null;
}
};
/**
* Removes all cdk-describedby messages that are hosted through the element.
* @param {?} element
* @return {?}
*/
AriaDescriber.prototype._removeCdkDescribedByReferenceIds = /**
* Removes all cdk-describedby messages that are hosted through the element.
* @param {?} element
* @return {?}
*/
function (element) {
// Remove all aria-describedby reference IDs that are prefixed by CDK_DESCRIBEDBY_ID_PREFIX
var /** @type {?} */ originalReferenceIds = getAriaReferenceIds(element, 'aria-describedby')
.filter(function (id) { return id.indexOf(CDK_DESCRIBEDBY_ID_PREFIX) != 0; });
element.setAttribute('aria-describedby', originalReferenceIds.join(' '));
};
/**
* Adds a message reference to the element using aria-describedby and increments the registered
* message's reference count.
* @param {?} element
* @param {?} message
* @return {?}
*/
AriaDescriber.prototype._addMessageReference = /**
* Adds a message reference to the element using aria-describedby and increments the registered
* message's reference count.
* @param {?} element
* @param {?} message
* @return {?}
*/
function (element, message) {
var /** @type {?} */ registeredMessage = /** @type {?} */ ((messageRegistry.get(message)));
// Add the aria-describedby reference and set the
// describedby_host attribute to mark the element.
addAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id);
element.setAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE, '');
registeredMessage.referenceCount++;
};
/**
* Removes a message reference from the element using aria-describedby
* and decrements the registered message's reference count.
* @param {?} element
* @param {?} message
* @return {?}
*/
AriaDescriber.prototype._removeMessageReference = /**
* Removes a message reference from the element using aria-describedby
* and decrements the registered message's reference count.
* @param {?} element
* @param {?} message
* @return {?}
*/
function (element, message) {
var /** @type {?} */ registeredMessage = /** @type {?} */ ((messageRegistry.get(message)));
registeredMessage.referenceCount--;
removeAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id);
element.removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);
};
/**
* Returns true if the element has been described by the provided message ID.
* @param {?} element
* @param {?} message
* @return {?}
*/
AriaDescriber.prototype._isElementDescribedByMessage = /**
* Returns true if the element has been described by the provided message ID.
* @param {?} element
* @param {?} message
* @return {?}
*/
function (element, message) {
var /** @type {?} */ referenceIds = getAriaReferenceIds(element, 'aria-describedby');
var /** @type {?} */ registeredMessage = messageRegistry.get(message);
var /** @type {?} */ messageId = registeredMessage && registeredMessage.messageElement.id;
return !!messageId && referenceIds.indexOf(messageId) != -1;
};
/**
* Determines whether a message can be described on a particular element.
* @param {?} element
* @param {?} message
* @return {?}
*/
AriaDescriber.prototype._canBeDescribed = /**
* Determines whether a message can be described on a particular element.
* @param {?} element
* @param {?} message
* @return {?}
*/
function (element, message) {
return element.nodeType === this._document.ELEMENT_NODE && message != null &&
!!("" + message).trim();
};
AriaDescriber.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
AriaDescriber.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] },] },
]; };
/** @nocollapse */ AriaDescriber.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function AriaDescriber_Factory() { return new AriaDescriber(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); }, token: AriaDescriber, providedIn: "root" });
return AriaDescriber;
}());
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
* @param {?} parentDispatcher
* @param {?} _document
* @return {?}
*/
function ARIA_DESCRIBER_PROVIDER_FACTORY(parentDispatcher, _document) {
return parentDispatcher || new AriaDescriber(_document);
}
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
*/
var /** @type {?} */ ARIA_DESCRIBER_PROVIDER = {
// If there is already an AriaDescriber available, use that. Otherwise, provide a new one.
provide: AriaDescriber,
deps: [
[new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"](), AriaDescriber],
/** @type {?} */ (_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])
],
useFactory: ARIA_DESCRIBER_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
// unsupported: template constraints.
/**
* This class manages keyboard events for selectable lists. If you pass it a query list
* of items, it will set the active item correctly when arrow events occur.
* @template T
*/
var
// unsupported: template constraints.
/**
* This class manages keyboard events for selectable lists. If you pass it a query list
* of items, it will set the active item correctly when arrow events occur.
* @template T
*/
ListKeyManager = /** @class */ (function () {
function ListKeyManager(_items) {
var _this = this;
this._items = _items;
this._activeItemIndex = -1;
this._wrap = false;
this._letterKeyStream = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
this._typeaheadSubscription = rxjs__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY;
this._vertical = true;
/**
* Predicate function that can be used to check whether an item should be skipped
* by the key manager. By default, disabled items are skipped.
*/
this._skipPredicateFn = function (item) { return item.disabled; };
this._pressedLetters = [];
/**
* Stream that emits any time the TAB key is pressed, so components can react
* when focus is shifted off of the list.
*/
this.tabOut = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
/**
* Stream that emits whenever the active item of the list manager changes.
*/
this.change = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
// We allow for the items to be an array because, in some cases, the consumer may
// not have access to a QueryList of the items they want to manage (e.g. when the
// items aren't being collected via `ViewChildren` or `ContentChildren`).
if (_items instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__["QueryList"]) {
_items.changes.subscribe(function (newItems) {
if (_this._activeItem) {
var /** @type {?} */ itemArray = newItems.toArray();
var /** @type {?} */ newIndex = itemArray.indexOf(_this._activeItem);
if (newIndex > -1 && newIndex !== _this._activeItemIndex) {
_this._activeItemIndex = newIndex;
}
}
});
}
}
/**
* Sets the predicate function that determines which items should be skipped by the
* list key manager.
* @param predicate Function that determines whether the given item should be skipped.
*/
/**
* Sets the predicate function that determines which items should be skipped by the
* list key manager.
* @param {?} predicate Function that determines whether the given item should be skipped.
* @return {?}
*/
ListKeyManager.prototype.skipPredicate = /**
* Sets the predicate function that determines which items should be skipped by the
* list key manager.
* @param {?} predicate Function that determines whether the given item should be skipped.
* @return {?}
*/
function (predicate) {
this._skipPredicateFn = predicate;
return this;
};
/**
* Turns on wrapping mode, which ensures that the active item will wrap to
* the other end of list when there are no more items in the given direction.
*/
/**
* Turns on wrapping mode, which ensures that the active item will wrap to
* the other end of list when there are no more items in the given direction.
* @return {?}
*/
ListKeyManager.prototype.withWrap = /**
* Turns on wrapping mode, which ensures that the active item will wrap to
* the other end of list when there are no more items in the given direction.
* @return {?}
*/
function () {
this._wrap = true;
return this;
};
/**
* Configures whether the key manager should be able to move the selection vertically.
* @param enabled Whether vertical selection should be enabled.
*/
/**
* Configures whether the key manager should be able to move the selection vertically.
* @param {?=} enabled Whether vertical selection should be enabled.
* @return {?}
*/
ListKeyManager.prototype.withVerticalOrientation = /**
* Configures whether the key manager should be able to move the selection vertically.
* @param {?=} enabled Whether vertical selection should be enabled.
* @return {?}
*/
function (enabled) {
if (enabled === void 0) { enabled = true; }
this._vertical = enabled;
return this;
};
/**
* Configures the key manager to move the selection horizontally.
* Passing in `null` will disable horizontal movement.
* @param direction Direction in which the selection can be moved.
*/
/**
* Configures the key manager to move the selection horizontally.
* Passing in `null` will disable horizontal movement.
* @param {?} direction Direction in which the selection can be moved.
* @return {?}
*/
ListKeyManager.prototype.withHorizontalOrientation = /**
* Configures the key manager to move the selection horizontally.
* Passing in `null` will disable horizontal movement.
* @param {?} direction Direction in which the selection can be moved.
* @return {?}
*/
function (direction) {
this._horizontal = direction;
return this;
};
/**
* Turns on typeahead mode which allows users to set the active item by typing.
* @param debounceInterval Time to wait after the last keystroke before setting the active item.
*/
/**
* Turns on typeahead mode which allows users to set the active item by typing.
* @param {?=} debounceInterval Time to wait after the last keystroke before setting the active item.
* @return {?}
*/
ListKeyManager.prototype.withTypeAhead = /**
* Turns on typeahead mode which allows users to set the active item by typing.
* @param {?=} debounceInterval Time to wait after the last keystroke before setting the active item.
* @return {?}
*/
function (debounceInterval) {
var _this = this;
if (debounceInterval === void 0) { debounceInterval = 200; }
if (this._items.length && this._items.some(function (item) { return typeof item.getLabel !== 'function'; })) {
throw Error('ListKeyManager items in typeahead mode must implement the `getLabel` method.');
}
this._typeaheadSubscription.unsubscribe();
// Debounce the presses of non-navigational keys, collect the ones that correspond to letters
// and convert those letters back into a string. Afterwards find the first item that starts
// with that string and select it.
this._typeaheadSubscription = this._letterKeyStream.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["tap"])(function (keyCode) { return _this._pressedLetters.push(keyCode); }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["debounceTime"])(debounceInterval), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["filter"])(function () { return _this._pressedLetters.length > 0; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])(function () { return _this._pressedLetters.join(''); })).subscribe(function (inputString) {
var /** @type {?} */ items = _this._getItemsArray();
// Start at 1 because we want to start searching at the item immediately
// following the current active item.
for (var /** @type {?} */ i = 1; i < items.length + 1; i++) {
var /** @type {?} */ index = (_this._activeItemIndex + i) % items.length;
var /** @type {?} */ item = items[index];
if (!_this._skipPredicateFn(item) && /** @type {?} */ ((item.getLabel))().toUpperCase().trim().indexOf(inputString) === 0) {
_this.setActiveItem(index);
break;
}
}
_this._pressedLetters = [];
});
return this;
};
/**
* @param {?} item
* @return {?}
*/
ListKeyManager.prototype.setActiveItem = /**
* @param {?} item
* @return {?}
*/
function (item) {
var /** @type {?} */ previousIndex = this._activeItemIndex;
this.updateActiveItem(item);
if (this._activeItemIndex !== previousIndex) {
this.change.next(this._activeItemIndex);
}
};
/**
* Sets the active item depending on the key event passed in.
* @param event Keyboard event to be used for determining which element should be active.
*/
/**
* Sets the active item depending on the key event passed in.
* @param {?} event Keyboard event to be used for determining which element should be active.
* @return {?}
*/
ListKeyManager.prototype.onKeydown = /**
* Sets the active item depending on the key event passed in.
* @param {?} event Keyboard event to be used for determining which element should be active.
* @return {?}
*/
function (event) {
var /** @type {?} */ keyCode = event.keyCode;
switch (keyCode) {
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["TAB"]:
this.tabOut.next();
return;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["DOWN_ARROW"]:
if (this._vertical) {
this.setNextItemActive();
break;
}
else {
return;
}
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["UP_ARROW"]:
if (this._vertical) {
this.setPreviousItemActive();
break;
}
else {
return;
}
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["RIGHT_ARROW"]:
if (this._horizontal === 'ltr') {
this.setNextItemActive();
break;
}
else if (this._horizontal === 'rtl') {
this.setPreviousItemActive();
break;
}
else {
return;
}
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["LEFT_ARROW"]:
if (this._horizontal === 'ltr') {
this.setPreviousItemActive();
break;
}
else if (this._horizontal === 'rtl') {
this.setNextItemActive();
break;
}
else {
return;
}
default:
// Attempt to use the `event.key` which also maps it to the user's keyboard language,
// otherwise fall back to resolving alphanumeric characters via the keyCode.
if (event.key && event.key.length === 1) {
this._letterKeyStream.next(event.key.toLocaleUpperCase());
}
else if ((keyCode >= _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["A"] && keyCode <= _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["Z"]) || (keyCode >= _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["ZERO"] && keyCode <= _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["NINE"])) {
this._letterKeyStream.next(String.fromCharCode(keyCode));
}
// Note that we return here, in order to avoid preventing
// the default action of non-navigational keys.
return;
}
this._pressedLetters = [];
event.preventDefault();
};
Object.defineProperty(ListKeyManager.prototype, "activeItemIndex", {
/** Index of the currently active item. */
get: /**
* Index of the currently active item.
* @return {?}
*/
function () {
return this._activeItemIndex;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ListKeyManager.prototype, "activeItem", {
/** The active item. */
get: /**
* The active item.
* @return {?}
*/
function () {
return this._activeItem;
},
enumerable: true,
configurable: true
});
/** Sets the active item to the first enabled item in the list. */
/**
* Sets the active item to the first enabled item in the list.
* @return {?}
*/
ListKeyManager.prototype.setFirstItemActive = /**
* Sets the active item to the first enabled item in the list.
* @return {?}
*/
function () {
this._setActiveItemByIndex(0, 1);
};
/** Sets the active item to the last enabled item in the list. */
/**
* Sets the active item to the last enabled item in the list.
* @return {?}
*/
ListKeyManager.prototype.setLastItemActive = /**
* Sets the active item to the last enabled item in the list.
* @return {?}
*/
function () {
this._setActiveItemByIndex(this._items.length - 1, -1);
};
/** Sets the active item to the next enabled item in the list. */
/**
* Sets the active item to the next enabled item in the list.
* @return {?}
*/
ListKeyManager.prototype.setNextItemActive = /**
* Sets the active item to the next enabled item in the list.
* @return {?}
*/
function () {
this._activeItemIndex < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);
};
/** Sets the active item to a previous enabled item in the list. */
/**
* Sets the active item to a previous enabled item in the list.
* @return {?}
*/
ListKeyManager.prototype.setPreviousItemActive = /**
* Sets the active item to a previous enabled item in the list.
* @return {?}
*/
function () {
this._activeItemIndex < 0 && this._wrap ? this.setLastItemActive()
: this._setActiveItemByDelta(-1);
};
/**
* @param {?} item
* @return {?}
*/
ListKeyManager.prototype.updateActiveItem = /**
* @param {?} item
* @return {?}
*/
function (item) {
var /** @type {?} */ itemArray = this._getItemsArray();
var /** @type {?} */ index = typeof item === 'number' ? item : itemArray.indexOf(item);
this._activeItemIndex = index;
this._activeItem = itemArray[index];
};
/**
* Allows setting of the activeItemIndex without any other effects.
* @param index The new activeItemIndex.
* @deprecated Use `updateActiveItem` instead.
* @deletion-target 7.0.0
*/
/**
* Allows setting of the activeItemIndex without any other effects.
* @deprecated Use `updateActiveItem` instead.
* \@deletion-target 7.0.0
* @param {?} index The new activeItemIndex.
* @return {?}
*/
ListKeyManager.prototype.updateActiveItemIndex = /**
* Allows setting of the activeItemIndex without any other effects.
* @deprecated Use `updateActiveItem` instead.
* \@deletion-target 7.0.0
* @param {?} index The new activeItemIndex.
* @return {?}
*/
function (index) {
this.updateActiveItem(index);
};
/**
* This method sets the active item, given a list of items and the delta between the
* currently active item and the new active item. It will calculate differently
* depending on whether wrap mode is turned on.
* @param {?} delta
* @return {?}
*/
ListKeyManager.prototype._setActiveItemByDelta = /**
* This method sets the active item, given a list of items and the delta between the
* currently active item and the new active item. It will calculate differently
* depending on whether wrap mode is turned on.
* @param {?} delta
* @return {?}
*/
function (delta) {
this._wrap ? this._setActiveInWrapMode(delta) : this._setActiveInDefaultMode(delta);
};
/**
* Sets the active item properly given "wrap" mode. In other words, it will continue to move
* down the list until it finds an item that is not disabled, and it will wrap if it
* encounters either end of the list.
* @param {?} delta
* @return {?}
*/
ListKeyManager.prototype._setActiveInWrapMode = /**
* Sets the active item properly given "wrap" mode. In other words, it will continue to move
* down the list until it finds an item that is not disabled, and it will wrap if it
* encounters either end of the list.
* @param {?} delta
* @return {?}
*/
function (delta) {
var /** @type {?} */ items = this._getItemsArray();
for (var /** @type {?} */ i = 1; i <= items.length; i++) {
var /** @type {?} */ index = (this._activeItemIndex + (delta * i) + items.length) % items.length;
var /** @type {?} */ item = items[index];
if (!this._skipPredicateFn(item)) {
this.setActiveItem(index);
return;
}
}
};
/**
* Sets the active item properly given the default mode. In other words, it will
* continue to move down the list until it finds an item that is not disabled. If
* it encounters either end of the list, it will stop and not wrap.
* @param {?} delta
* @return {?}
*/
ListKeyManager.prototype._setActiveInDefaultMode = /**
* Sets the active item properly given the default mode. In other words, it will
* continue to move down the list until it finds an item that is not disabled. If
* it encounters either end of the list, it will stop and not wrap.
* @param {?} delta
* @return {?}
*/
function (delta) {
this._setActiveItemByIndex(this._activeItemIndex + delta, delta);
};
/**
* Sets the active item to the first enabled item starting at the index specified. If the
* item is disabled, it will move in the fallbackDelta direction until it either
* finds an enabled item or encounters the end of the list.
* @param {?} index
* @param {?} fallbackDelta
* @return {?}
*/
ListKeyManager.prototype._setActiveItemByIndex = /**
* Sets the active item to the first enabled item starting at the index specified. If the
* item is disabled, it will move in the fallbackDelta direction until it either
* finds an enabled item or encounters the end of the list.
* @param {?} index
* @param {?} fallbackDelta
* @return {?}
*/
function (index, fallbackDelta) {
var /** @type {?} */ items = this._getItemsArray();
if (!items[index]) {
return;
}
while (this._skipPredicateFn(items[index])) {
index += fallbackDelta;
if (!items[index]) {
return;
}
}
this.setActiveItem(index);
};
/**
* Returns the items as an array.
* @return {?}
*/
ListKeyManager.prototype._getItemsArray = /**
* Returns the items as an array.
* @return {?}
*/
function () {
return this._items instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__["QueryList"] ? this._items.toArray() : this._items;
};
return ListKeyManager;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @template T
*/
var /**
* @template T
*/
ActiveDescendantKeyManager = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_5__["__extends"])(ActiveDescendantKeyManager, _super);
function ActiveDescendantKeyManager() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* @param {?} index
* @return {?}
*/
ActiveDescendantKeyManager.prototype.setActiveItem = /**
* @param {?} index
* @return {?}
*/
function (index) {
if (this.activeItem) {
this.activeItem.setInactiveStyles();
}
_super.prototype.setActiveItem.call(this, index);
if (this.activeItem) {
this.activeItem.setActiveStyles();
}
};
return ActiveDescendantKeyManager;
}(ListKeyManager));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @template T
*/
var /**
* @template T
*/
FocusKeyManager = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_5__["__extends"])(FocusKeyManager, _super);
function FocusKeyManager() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._origin = 'program';
return _this;
}
/**
* Sets the focus origin that will be passed in to the items for any subsequent `focus` calls.
* @param origin Focus origin to be used when focusing items.
*/
/**
* Sets the focus origin that will be passed in to the items for any subsequent `focus` calls.
* @param {?} origin Focus origin to be used when focusing items.
* @return {?}
*/
FocusKeyManager.prototype.setFocusOrigin = /**
* Sets the focus origin that will be passed in to the items for any subsequent `focus` calls.
* @param {?} origin Focus origin to be used when focusing items.
* @return {?}
*/
function (origin) {
this._origin = origin;
return this;
};
/**
* @param {?} item
* @return {?}
*/
FocusKeyManager.prototype.setActiveItem = /**
* @param {?} item
* @return {?}
*/
function (item) {
_super.prototype.setActiveItem.call(this, item);
if (this.activeItem) {
this.activeItem.focus(this._origin);
}
};
return FocusKeyManager;
}(ListKeyManager));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Utility for checking the interactivity of an element, such as whether is is focusable or
* tabbable.
*/
var InteractivityChecker = /** @class */ (function () {
function InteractivityChecker(_platform) {
this._platform = _platform;
}
/**
* Gets whether an element is disabled.
*
* @param element Element to be checked.
* @returns Whether the element is disabled.
*/
/**
* Gets whether an element is disabled.
*
* @param {?} element Element to be checked.
* @return {?} Whether the element is disabled.
*/
InteractivityChecker.prototype.isDisabled = /**
* Gets whether an element is disabled.
*
* @param {?} element Element to be checked.
* @return {?} Whether the element is disabled.
*/
function (element) {
// This does not capture some cases, such as a non-form control with a disabled attribute or
// a form control inside of a disabled form, but should capture the most common cases.
return element.hasAttribute('disabled');
};
/**
* Gets whether an element is visible for the purposes of interactivity.
*
* This will capture states like `display: none` and `visibility: hidden`, but not things like
* being clipped by an `overflow: hidden` parent or being outside the viewport.
*
* @returns Whether the element is visible.
*/
/**
* Gets whether an element is visible for the purposes of interactivity.
*
* This will capture states like `display: none` and `visibility: hidden`, but not things like
* being clipped by an `overflow: hidden` parent or being outside the viewport.
*
* @param {?} element
* @return {?} Whether the element is visible.
*/
InteractivityChecker.prototype.isVisible = /**
* Gets whether an element is visible for the purposes of interactivity.
*
* This will capture states like `display: none` and `visibility: hidden`, but not things like
* being clipped by an `overflow: hidden` parent or being outside the viewport.
*
* @param {?} element
* @return {?} Whether the element is visible.
*/
function (element) {
return hasGeometry(element) && getComputedStyle(element).visibility === 'visible';
};
/**
* Gets whether an element can be reached via Tab key.
* Assumes that the element has already been checked with isFocusable.
*
* @param element Element to be checked.
* @returns Whether the element is tabbable.
*/
/**
* Gets whether an element can be reached via Tab key.
* Assumes that the element has already been checked with isFocusable.
*
* @param {?} element Element to be checked.
* @return {?} Whether the element is tabbable.
*/
InteractivityChecker.prototype.isTabbable = /**
* Gets whether an element can be reached via Tab key.
* Assumes that the element has already been checked with isFocusable.
*
* @param {?} element Element to be checked.
* @return {?} Whether the element is tabbable.
*/
function (element) {
// Nothing is tabbable on the the server 😎
if (!this._platform.isBrowser) {
return false;
}
var /** @type {?} */ frameElement = getFrameElement(getWindow(element));
if (frameElement) {
var /** @type {?} */ frameType = frameElement && frameElement.nodeName.toLowerCase();
// Frame elements inherit their tabindex onto all child elements.
if (getTabIndexValue(frameElement) === -1) {
return false;
}
// Webkit and Blink consider anything inside of an <object> element as non-tabbable.
if ((this._platform.BLINK || this._platform.WEBKIT) && frameType === 'object') {
return false;
}
// Webkit and Blink disable tabbing to an element inside of an invisible frame.
if ((this._platform.BLINK || this._platform.WEBKIT) && !this.isVisible(frameElement)) {
return false;
}
}
var /** @type {?} */ nodeName = element.nodeName.toLowerCase();
var /** @type {?} */ tabIndexValue = getTabIndexValue(element);
if (element.hasAttribute('contenteditable')) {
return tabIndexValue !== -1;
}
if (nodeName === 'iframe') {
// The frames may be tabbable depending on content, but it's not possibly to reliably
// investigate the content of the frames.
return false;
}
if (nodeName === 'audio') {
if (!element.hasAttribute('controls')) {
// By default an <audio> element without the controls enabled is not tabbable.
return false;
}
else if (this._platform.BLINK) {
// In Blink <audio controls> elements are always tabbable.
return true;
}
}
if (nodeName === 'video') {
if (!element.hasAttribute('controls') && this._platform.TRIDENT) {
// In Trident a <video> element without the controls enabled is not tabbable.
return false;
}
else if (this._platform.BLINK || this._platform.FIREFOX) {
// In Chrome and Firefox <video controls> elements are always tabbable.
return true;
}
}
if (nodeName === 'object' && (this._platform.BLINK || this._platform.WEBKIT)) {
// In all Blink and WebKit based browsers <object> elements are never tabbable.
return false;
}
// In iOS the browser only considers some specific elements as tabbable.
if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) {
return false;
}
return element.tabIndex >= 0;
};
/**
* Gets whether an element can be focused by the user.
*
* @param element Element to be checked.
* @returns Whether the element is focusable.
*/
/**
* Gets whether an element can be focused by the user.
*
* @param {?} element Element to be checked.
* @return {?} Whether the element is focusable.
*/
InteractivityChecker.prototype.isFocusable = /**
* Gets whether an element can be focused by the user.
*
* @param {?} element Element to be checked.
* @return {?} Whether the element is focusable.
*/
function (element) {
// Perform checks in order of left to most expensive.
// Again, naive approach that does not capture many edge cases and browser quirks.
return isPotentiallyFocusable(element) && !this.isDisabled(element) && this.isVisible(element);
};
InteractivityChecker.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
InteractivityChecker.ctorParameters = function () { return [
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_6__["Platform"], },
]; };
/** @nocollapse */ InteractivityChecker.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function InteractivityChecker_Factory() { return new InteractivityChecker(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_6__["Platform"])); }, token: InteractivityChecker, providedIn: "root" });
return InteractivityChecker;
}());
/**
* Returns the frame element from a window object. Since browsers like MS Edge throw errors if
* the frameElement property is being accessed from a different host address, this property
* should be accessed carefully.
* @param {?} window
* @return {?}
*/
function getFrameElement(window) {
try {
return /** @type {?} */ (window.frameElement);
}
catch (/** @type {?} */ e) {
return null;
}
}
/**
* Checks whether the specified element has any geometry / rectangles.
* @param {?} element
* @return {?}
*/
function hasGeometry(element) {
// Use logic from jQuery to check for an invisible element.
// See https://github.com/jquery/jquery/blob/master/src/css/hiddenVisibleSelectors.js#L12
return !!(element.offsetWidth || element.offsetHeight ||
(typeof element.getClientRects === 'function' && element.getClientRects().length));
}
/**
* Gets whether an element's
* @param {?} element
* @return {?}
*/
function isNativeFormElement(element) {
var /** @type {?} */ nodeName = element.nodeName.toLowerCase();
return nodeName === 'input' ||
nodeName === 'select' ||
nodeName === 'button' ||
nodeName === 'textarea';
}
/**
* Gets whether an element is an `<input type="hidden">`.
* @param {?} element
* @return {?}
*/
function isHiddenInput(element) {
return isInputElement(element) && element.type == 'hidden';
}
/**
* Gets whether an element is an anchor that has an href attribute.
* @param {?} element
* @return {?}
*/
function isAnchorWithHref(element) {
return isAnchorElement(element) && element.hasAttribute('href');
}
/**
* Gets whether an element is an input element.
* @param {?} element
* @return {?}
*/
function isInputElement(element) {
return element.nodeName.toLowerCase() == 'input';
}
/**
* Gets whether an element is an anchor element.
* @param {?} element
* @return {?}
*/
function isAnchorElement(element) {
return element.nodeName.toLowerCase() == 'a';
}
/**
* Gets whether an element has a valid tabindex.
* @param {?} element
* @return {?}
*/
function hasValidTabIndex(element) {
if (!element.hasAttribute('tabindex') || element.tabIndex === undefined) {
return false;
}
var /** @type {?} */ tabIndex = element.getAttribute('tabindex');
// IE11 parses tabindex="" as the value "-32768"
if (tabIndex == '-32768') {
return false;
}
return !!(tabIndex && !isNaN(parseInt(tabIndex, 10)));
}
/**
* Returns the parsed tabindex from the element attributes instead of returning the
* evaluated tabindex from the browsers defaults.
* @param {?} element
* @return {?}
*/
function getTabIndexValue(element) {
if (!hasValidTabIndex(element)) {
return null;
}
// See browser issue in Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054
var /** @type {?} */ tabIndex = parseInt(element.getAttribute('tabindex') || '', 10);
return isNaN(tabIndex) ? -1 : tabIndex;
}
/**
* Checks whether the specified element is potentially tabbable on iOS
* @param {?} element
* @return {?}
*/
function isPotentiallyTabbableIOS(element) {
var /** @type {?} */ nodeName = element.nodeName.toLowerCase();
var /** @type {?} */ inputType = nodeName === 'input' && (/** @type {?} */ (element)).type;
return inputType === 'text'
|| inputType === 'password'
|| nodeName === 'select'
|| nodeName === 'textarea';
}
/**
* Gets whether an element is potentially focusable without taking current visible/disabled state
* into account.
* @param {?} element
* @return {?}
*/
function isPotentiallyFocusable(element) {
// Inputs are potentially focusable *unless* they're type="hidden".
if (isHiddenInput(element)) {
return false;
}
return isNativeFormElement(element) ||
isAnchorWithHref(element) ||
element.hasAttribute('contenteditable') ||
hasValidTabIndex(element);
}
/**
* Gets the parent window of a DOM node with regards of being inside of an iframe.
* @param {?} node
* @return {?}
*/
function getWindow(node) {
return node.ownerDocument.defaultView || window;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Class that allows for trapping focus within a DOM element.
*
* This class currently uses a relatively simple approach to focus trapping.
* It assumes that the tab order is the same as DOM order, which is not necessarily true.
* Things like `tabIndex > 0`, flex `order`, and shadow roots can cause to two to misalign.
*/
var /**
* Class that allows for trapping focus within a DOM element.
*
* This class currently uses a relatively simple approach to focus trapping.
* It assumes that the tab order is the same as DOM order, which is not necessarily true.
* Things like `tabIndex > 0`, flex `order`, and shadow roots can cause to two to misalign.
*/
FocusTrap = /** @class */ (function () {
function FocusTrap(_element, _checker, _ngZone, _document, deferAnchors) {
if (deferAnchors === void 0) { deferAnchors = false; }
this._element = _element;
this._checker = _checker;
this._ngZone = _ngZone;
this._document = _document;
this._enabled = true;
if (!deferAnchors) {
this.attachAnchors();
}
}
Object.defineProperty(FocusTrap.prototype, "enabled", {
/** Whether the focus trap is active. */
get: /**
* Whether the focus trap is active.
* @return {?}
*/
function () { return this._enabled; },
set: /**
* @param {?} val
* @return {?}
*/
function (val) {
this._enabled = val;
if (this._startAnchor && this._endAnchor) {
this._startAnchor.tabIndex = this._endAnchor.tabIndex = this._enabled ? 0 : -1;
}
},
enumerable: true,
configurable: true
});
/** Destroys the focus trap by cleaning up the anchors. */
/**
* Destroys the focus trap by cleaning up the anchors.
* @return {?}
*/
FocusTrap.prototype.destroy = /**
* Destroys the focus trap by cleaning up the anchors.
* @return {?}
*/
function () {
if (this._startAnchor && this._startAnchor.parentNode) {
this._startAnchor.parentNode.removeChild(this._startAnchor);
}
if (this._endAnchor && this._endAnchor.parentNode) {
this._endAnchor.parentNode.removeChild(this._endAnchor);
}
this._startAnchor = this._endAnchor = null;
};
/**
* Inserts the anchors into the DOM. This is usually done automatically
* in the constructor, but can be deferred for cases like directives with `*ngIf`.
*/
/**
* Inserts the anchors into the DOM. This is usually done automatically
* in the constructor, but can be deferred for cases like directives with `*ngIf`.
* @return {?}
*/
FocusTrap.prototype.attachAnchors = /**
* Inserts the anchors into the DOM. This is usually done automatically
* in the constructor, but can be deferred for cases like directives with `*ngIf`.
* @return {?}
*/
function () {
var _this = this;
if (!this._startAnchor) {
this._startAnchor = this._createAnchor();
}
if (!this._endAnchor) {
this._endAnchor = this._createAnchor();
}
this._ngZone.runOutsideAngular(function () {
/** @type {?} */ ((_this._startAnchor)).addEventListener('focus', function () {
_this.focusLastTabbableElement();
}); /** @type {?} */
((_this._endAnchor)).addEventListener('focus', function () {
_this.focusFirstTabbableElement();
});
if (_this._element.parentNode) {
_this._element.parentNode.insertBefore(/** @type {?} */ ((_this._startAnchor)), _this._element);
_this._element.parentNode.insertBefore(/** @type {?} */ ((_this._endAnchor)), _this._element.nextSibling);
}
});
};
/**
* Waits for the zone to stabilize, then either focuses the first element that the
* user specified, or the first tabbable element.
* @returns Returns a promise that resolves with a boolean, depending
* on whether focus was moved successfuly.
*/
/**
* Waits for the zone to stabilize, then either focuses the first element that the
* user specified, or the first tabbable element.
* @return {?} Returns a promise that resolves with a boolean, depending
* on whether focus was moved successfuly.
*/
FocusTrap.prototype.focusInitialElementWhenReady = /**
* Waits for the zone to stabilize, then either focuses the first element that the
* user specified, or the first tabbable element.
* @return {?} Returns a promise that resolves with a boolean, depending
* on whether focus was moved successfuly.
*/
function () {
var _this = this;
return new Promise(function (resolve) {
_this._executeOnStable(function () { return resolve(_this.focusInitialElement()); });
});
};
/**
* Waits for the zone to stabilize, then focuses
* the first tabbable element within the focus trap region.
* @returns Returns a promise that resolves with a boolean, depending
* on whether focus was moved successfuly.
*/
/**
* Waits for the zone to stabilize, then focuses
* the first tabbable element within the focus trap region.
* @return {?} Returns a promise that resolves with a boolean, depending
* on whether focus was moved successfuly.
*/
FocusTrap.prototype.focusFirstTabbableElementWhenReady = /**
* Waits for the zone to stabilize, then focuses
* the first tabbable element within the focus trap region.
* @return {?} Returns a promise that resolves with a boolean, depending
* on whether focus was moved successfuly.
*/
function () {
var _this = this;
return new Promise(function (resolve) {
_this._executeOnStable(function () { return resolve(_this.focusFirstTabbableElement()); });
});
};
/**
* Waits for the zone to stabilize, then focuses
* the last tabbable element within the focus trap region.
* @returns Returns a promise that resolves with a boolean, depending
* on whether focus was moved successfuly.
*/
/**
* Waits for the zone to stabilize, then focuses
* the last tabbable element within the focus trap region.
* @return {?} Returns a promise that resolves with a boolean, depending
* on whether focus was moved successfuly.
*/
FocusTrap.prototype.focusLastTabbableElementWhenReady = /**
* Waits for the zone to stabilize, then focuses
* the last tabbable element within the focus trap region.
* @return {?} Returns a promise that resolves with a boolean, depending
* on whether focus was moved successfuly.
*/
function () {
var _this = this;
return new Promise(function (resolve) {
_this._executeOnStable(function () { return resolve(_this.focusLastTabbableElement()); });
});
};
/**
* Get the specified boundary element of the trapped region.
* @param {?} bound The boundary to get (start or end of trapped region).
* @return {?} The boundary element.
*/
FocusTrap.prototype._getRegionBoundary = /**
* Get the specified boundary element of the trapped region.
* @param {?} bound The boundary to get (start or end of trapped region).
* @return {?} The boundary element.
*/
function (bound) {
// Contains the deprecated version of selector, for temporary backwards comparability.
var /** @type {?} */ markers = /** @type {?} */ (this._element.querySelectorAll("[cdk-focus-region-" + bound + "], " +
("[cdkFocusRegion" + bound + "], ") +
("[cdk-focus-" + bound + "]")));
for (var /** @type {?} */ i = 0; i < markers.length; i++) {
// @deletion-target 7.0.0
if (markers[i].hasAttribute("cdk-focus-" + bound)) {
console.warn("Found use of deprecated attribute 'cdk-focus-" + bound + "', " +
("use 'cdkFocusRegion" + bound + "' instead. The deprecated ") +
"attribute will be removed in 7.0.0.", markers[i]);
}
else if (markers[i].hasAttribute("cdk-focus-region-" + bound)) {
console.warn("Found use of deprecated attribute 'cdk-focus-region-" + bound + "', " +
("use 'cdkFocusRegion" + bound + "' instead. The deprecated attribute ") +
"will be removed in 7.0.0.", markers[i]);
}
}
if (bound == 'start') {
return markers.length ? markers[0] : this._getFirstTabbableElement(this._element);
}
return markers.length ?
markers[markers.length - 1] : this._getLastTabbableElement(this._element);
};
/**
* Focuses the element that should be focused when the focus trap is initialized.
* @returns Whether focus was moved successfuly.
*/
/**
* Focuses the element that should be focused when the focus trap is initialized.
* @return {?} Whether focus was moved successfuly.
*/
FocusTrap.prototype.focusInitialElement = /**
* Focuses the element that should be focused when the focus trap is initialized.
* @return {?} Whether focus was moved successfuly.
*/
function () {
// Contains the deprecated version of selector, for temporary backwards comparability.
var /** @type {?} */ redirectToElement = /** @type {?} */ (this._element.querySelector("[cdk-focus-initial], " +
"[cdkFocusInitial]"));
if (redirectToElement) {
// @deletion-target 7.0.0
if (redirectToElement.hasAttribute("cdk-focus-initial")) {
console.warn("Found use of deprecated attribute 'cdk-focus-initial', " +
"use 'cdkFocusInitial' instead. The deprecated attribute " +
"will be removed in 7.0.0", redirectToElement);
}
redirectToElement.focus();
return true;
}
return this.focusFirstTabbableElement();
};
/**
* Focuses the first tabbable element within the focus trap region.
* @returns Whether focus was moved successfuly.
*/
/**
* Focuses the first tabbable element within the focus trap region.
* @return {?} Whether focus was moved successfuly.
*/
FocusTrap.prototype.focusFirstTabbableElement = /**
* Focuses the first tabbable element within the focus trap region.
* @return {?} Whether focus was moved successfuly.
*/
function () {
var /** @type {?} */ redirectToElement = this._getRegionBoundary('start');
if (redirectToElement) {
redirectToElement.focus();
}
return !!redirectToElement;
};
/**
* Focuses the last tabbable element within the focus trap region.
* @returns Whether focus was moved successfuly.
*/
/**
* Focuses the last tabbable element within the focus trap region.
* @return {?} Whether focus was moved successfuly.
*/
FocusTrap.prototype.focusLastTabbableElement = /**
* Focuses the last tabbable element within the focus trap region.
* @return {?} Whether focus was moved successfuly.
*/
function () {
var /** @type {?} */ redirectToElement = this._getRegionBoundary('end');
if (redirectToElement) {
redirectToElement.focus();
}
return !!redirectToElement;
};
/**
* Get the first tabbable element from a DOM subtree (inclusive).
* @param {?} root
* @return {?}
*/
FocusTrap.prototype._getFirstTabbableElement = /**
* Get the first tabbable element from a DOM subtree (inclusive).
* @param {?} root
* @return {?}
*/
function (root) {
if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {
return root;
}
// Iterate in DOM order. Note that IE doesn't have `children` for SVG so we fall
// back to `childNodes` which includes text nodes, comments etc.
var /** @type {?} */ children = root.children || root.childNodes;
for (var /** @type {?} */ i = 0; i < children.length; i++) {
var /** @type {?} */ tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE ?
this._getFirstTabbableElement(/** @type {?} */ (children[i])) :
null;
if (tabbableChild) {
return tabbableChild;
}
}
return null;
};
/**
* Get the last tabbable element from a DOM subtree (inclusive).
* @param {?} root
* @return {?}
*/
FocusTrap.prototype._getLastTabbableElement = /**
* Get the last tabbable element from a DOM subtree (inclusive).
* @param {?} root
* @return {?}
*/
function (root) {
if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {
return root;
}
// Iterate in reverse DOM order.
var /** @type {?} */ children = root.children || root.childNodes;
for (var /** @type {?} */ i = children.length - 1; i >= 0; i--) {
var /** @type {?} */ tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE ?
this._getLastTabbableElement(/** @type {?} */ (children[i])) :
null;
if (tabbableChild) {
return tabbableChild;
}
}
return null;
};
/**
* Creates an anchor element.
* @return {?}
*/
FocusTrap.prototype._createAnchor = /**
* Creates an anchor element.
* @return {?}
*/
function () {
var /** @type {?} */ anchor = this._document.createElement('div');
anchor.tabIndex = this._enabled ? 0 : -1;
anchor.classList.add('cdk-visually-hidden');
anchor.classList.add('cdk-focus-trap-anchor');
return anchor;
};
/**
* Executes a function when the zone is stable.
* @param {?} fn
* @return {?}
*/
FocusTrap.prototype._executeOnStable = /**
* Executes a function when the zone is stable.
* @param {?} fn
* @return {?}
*/
function (fn) {
if (this._ngZone.isStable) {
fn();
}
else {
this._ngZone.onStable.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["take"])(1)).subscribe(fn);
}
};
return FocusTrap;
}());
/**
* Factory that allows easy instantiation of focus traps.
*/
var FocusTrapFactory = /** @class */ (function () {
function FocusTrapFactory(_checker, _ngZone, _document) {
this._checker = _checker;
this._ngZone = _ngZone;
this._document = _document;
}
/**
* Creates a focus-trapped region around the given element.
* @param element The element around which focus will be trapped.
* @param deferCaptureElements Defers the creation of focus-capturing elements to be done
* manually by the user.
* @returns The created focus trap instance.
*/
/**
* Creates a focus-trapped region around the given element.
* @param {?} element The element around which focus will be trapped.
* @param {?=} deferCaptureElements Defers the creation of focus-capturing elements to be done
* manually by the user.
* @return {?} The created focus trap instance.
*/
FocusTrapFactory.prototype.create = /**
* Creates a focus-trapped region around the given element.
* @param {?} element The element around which focus will be trapped.
* @param {?=} deferCaptureElements Defers the creation of focus-capturing elements to be done
* manually by the user.
* @return {?} The created focus trap instance.
*/
function (element, deferCaptureElements) {
if (deferCaptureElements === void 0) { deferCaptureElements = false; }
return new FocusTrap(element, this._checker, this._ngZone, this._document, deferCaptureElements);
};
FocusTrapFactory.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
FocusTrapFactory.ctorParameters = function () { return [
{ type: InteractivityChecker, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] },] },
]; };
/** @nocollapse */ FocusTrapFactory.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function FocusTrapFactory_Factory() { return new FocusTrapFactory(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(InteractivityChecker), Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"]), Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); }, token: FocusTrapFactory, providedIn: "root" });
return FocusTrapFactory;
}());
/**
* Directive for trapping focus within a region.
*/
var CdkTrapFocus = /** @class */ (function () {
function CdkTrapFocus(_elementRef, _focusTrapFactory, _document) {
this._elementRef = _elementRef;
this._focusTrapFactory = _focusTrapFactory;
/**
* Previously focused element to restore focus to upon destroy when using autoCapture.
*/
this._previouslyFocusedElement = null;
this._document = _document;
this.focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement, true);
}
Object.defineProperty(CdkTrapFocus.prototype, "enabled", {
get: /**
* Whether the focus trap is active.
* @return {?}
*/
function () { return this.focusTrap.enabled; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this.focusTrap.enabled = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_7__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(CdkTrapFocus.prototype, "autoCapture", {
get: /**
* Whether the directive should automatially move focus into the trapped region upon
* initialization and return focus to the previous activeElement upon destruction.
* @return {?}
*/
function () { return this._autoCapture; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._autoCapture = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_7__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
CdkTrapFocus.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.focusTrap.destroy();
// If we stored a previously focused element when using autoCapture, return focus to that
// element now that the trapped region is being destroyed.
if (this._previouslyFocusedElement) {
this._previouslyFocusedElement.focus();
this._previouslyFocusedElement = null;
}
};
/**
* @return {?}
*/
CdkTrapFocus.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
this.focusTrap.attachAnchors();
if (this.autoCapture) {
this._previouslyFocusedElement = /** @type {?} */ (this._document.activeElement);
this.focusTrap.focusInitialElementWhenReady();
}
};
CdkTrapFocus.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[cdkTrapFocus]',
exportAs: 'cdkTrapFocus',
},] },
];
/** @nocollapse */
CdkTrapFocus.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: FocusTrapFactory, },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] },] },
]; };
CdkTrapFocus.propDecorators = {
"enabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['cdkTrapFocus',] },],
"autoCapture": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['cdkTrapFocusAutoCapture',] },],
};
return CdkTrapFocus;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
// The token for the live announcer element is defined in a separate file from LiveAnnouncer
// as a workaround for https://github.com/angular/angular/issues/22559
var /** @type {?} */ LIVE_ANNOUNCER_ELEMENT_TOKEN = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('liveAnnouncerElement', {
providedIn: 'root',
factory: LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY() {
return null;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var LiveAnnouncer = /** @class */ (function () {
function LiveAnnouncer(elementToken, _document) {
this._document = _document;
// We inject the live element as `any` because the constructor signature cannot reference
// browser globals (HTMLElement) on non-browser environments, since having a class decorator
// causes TypeScript to preserve the constructor signature types.
this._liveElement = elementToken || this._createLiveElement();
}
/**
* Announces a message to screenreaders.
* @param message Message to be announced to the screenreader
* @param politeness The politeness of the announcer element
* @returns Promise that will be resolved when the message is added to the DOM.
*/
/**
* Announces a message to screenreaders.
* @param {?} message Message to be announced to the screenreader
* @param {?=} politeness The politeness of the announcer element
* @return {?} Promise that will be resolved when the message is added to the DOM.
*/
LiveAnnouncer.prototype.announce = /**
* Announces a message to screenreaders.
* @param {?} message Message to be announced to the screenreader
* @param {?=} politeness The politeness of the announcer element
* @return {?} Promise that will be resolved when the message is added to the DOM.
*/
function (message, politeness) {
var _this = this;
if (politeness === void 0) { politeness = 'polite'; }
this._liveElement.textContent = '';
// TODO: ensure changing the politeness works on all environments we support.
this._liveElement.setAttribute('aria-live', politeness);
// This 100ms timeout is necessary for some browser + screen-reader combinations:
// - Both JAWS and NVDA over IE11 will not announce anything without a non-zero timeout.
// - With Chrome and IE11 with NVDA or JAWS, a repeated (identical) message won't be read a
// second time without clearing and then using a non-zero delay.
// (using JAWS 17 at time of this writing).
return new Promise(function (resolve) {
setTimeout(function () {
_this._liveElement.textContent = message;
resolve();
}, 100);
});
};
/**
* @return {?}
*/
LiveAnnouncer.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this._liveElement && this._liveElement.parentNode) {
this._liveElement.parentNode.removeChild(this._liveElement);
}
};
/**
* @return {?}
*/
LiveAnnouncer.prototype._createLiveElement = /**
* @return {?}
*/
function () {
var /** @type {?} */ liveEl = this._document.createElement('div');
liveEl.classList.add('cdk-visually-hidden');
liveEl.setAttribute('aria-atomic', 'true');
liveEl.setAttribute('aria-live', 'polite');
this._document.body.appendChild(liveEl);
return liveEl;
};
LiveAnnouncer.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
LiveAnnouncer.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [LIVE_ANNOUNCER_ELEMENT_TOKEN,] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] },] },
]; };
/** @nocollapse */ LiveAnnouncer.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function LiveAnnouncer_Factory() { return new LiveAnnouncer(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(LIVE_ANNOUNCER_ELEMENT_TOKEN, 8), Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); }, token: LiveAnnouncer, providedIn: "root" });
return LiveAnnouncer;
}());
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
* @param {?} parentDispatcher
* @param {?} liveElement
* @param {?} _document
* @return {?}
*/
function LIVE_ANNOUNCER_PROVIDER_FACTORY(parentDispatcher, liveElement, _document) {
return parentDispatcher || new LiveAnnouncer(liveElement, _document);
}
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
*/
var /** @type {?} */ LIVE_ANNOUNCER_PROVIDER = {
// If there is already a LiveAnnouncer available, use that. Otherwise, provide a new one.
provide: LiveAnnouncer,
deps: [
[new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"](), LiveAnnouncer],
[new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"](LIVE_ANNOUNCER_ELEMENT_TOKEN)],
_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],
],
useFactory: LIVE_ANNOUNCER_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
// This is the value used by AngularJS Material. Through trial and error (on iPhone 6S) they found
// that a value of around 650ms seems appropriate.
var /** @type {?} */ TOUCH_BUFFER_MS = 650;
/**
* Monitors mouse and keyboard events to determine the cause of focus events.
*/
var FocusMonitor = /** @class */ (function () {
function FocusMonitor(_ngZone, _platform) {
this._ngZone = _ngZone;
this._platform = _platform;
/**
* The focus origin that the next focus event is a result of.
*/
this._origin = null;
/**
* Whether the window has just been focused.
*/
this._windowFocused = false;
/**
* Map of elements being monitored to their info.
*/
this._elementInfo = new Map();
/**
* A map of global objects to lists of current listeners.
*/
this._unregisterGlobalListeners = function () { };
/**
* The number of elements currently being monitored.
*/
this._monitoredElementCount = 0;
}
/**
* Monitors focus on an element and applies appropriate CSS classes.
* @param element The element to monitor
* @param checkChildren Whether to count the element as focused when its children are focused.
* @returns An observable that emits when the focus state of the element changes.
* When the element is blurred, null will be emitted.
*/
/**
* Monitors focus on an element and applies appropriate CSS classes.
* @param {?} element The element to monitor
* @param {?=} checkChildren Whether to count the element as focused when its children are focused.
* @return {?} An observable that emits when the focus state of the element changes.
* When the element is blurred, null will be emitted.
*/
FocusMonitor.prototype.monitor = /**
* Monitors focus on an element and applies appropriate CSS classes.
* @param {?} element The element to monitor
* @param {?=} checkChildren Whether to count the element as focused when its children are focused.
* @return {?} An observable that emits when the focus state of the element changes.
* When the element is blurred, null will be emitted.
*/
function (element, checkChildren) {
var _this = this;
if (checkChildren === void 0) { checkChildren = false; }
// Do nothing if we're not on the browser platform.
if (!this._platform.isBrowser) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null);
}
// Check if we're already monitoring this element.
if (this._elementInfo.has(element)) {
var /** @type {?} */ cachedInfo = this._elementInfo.get(element); /** @type {?} */
((cachedInfo)).checkChildren = checkChildren;
return /** @type {?} */ ((cachedInfo)).subject.asObservable();
}
// Create monitored element info.
var /** @type {?} */ info = {
unlisten: function () { },
checkChildren: checkChildren,
subject: new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]()
};
this._elementInfo.set(element, info);
this._incrementMonitoredElementCount();
// Start listening. We need to listen in capture phase since focus events don't bubble.
var /** @type {?} */ focusListener = function (event) { return _this._onFocus(event, element); };
var /** @type {?} */ blurListener = function (event) { return _this._onBlur(event, element); };
this._ngZone.runOutsideAngular(function () {
element.addEventListener('focus', focusListener, true);
element.addEventListener('blur', blurListener, true);
});
// Create an unlisten function for later.
info.unlisten = function () {
element.removeEventListener('focus', focusListener, true);
element.removeEventListener('blur', blurListener, true);
};
return info.subject.asObservable();
};
/**
* Stops monitoring an element and removes all focus classes.
* @param element The element to stop monitoring.
*/
/**
* Stops monitoring an element and removes all focus classes.
* @param {?} element The element to stop monitoring.
* @return {?}
*/
FocusMonitor.prototype.stopMonitoring = /**
* Stops monitoring an element and removes all focus classes.
* @param {?} element The element to stop monitoring.
* @return {?}
*/
function (element) {
var /** @type {?} */ elementInfo = this._elementInfo.get(element);
if (elementInfo) {
elementInfo.unlisten();
elementInfo.subject.complete();
this._setClasses(element);
this._elementInfo.delete(element);
this._decrementMonitoredElementCount();
}
};
/**
* Focuses the element via the specified focus origin.
* @param element The element to focus.
* @param origin The focus origin.
*/
/**
* Focuses the element via the specified focus origin.
* @param {?} element The element to focus.
* @param {?} origin The focus origin.
* @return {?}
*/
FocusMonitor.prototype.focusVia = /**
* Focuses the element via the specified focus origin.
* @param {?} element The element to focus.
* @param {?} origin The focus origin.
* @return {?}
*/
function (element, origin) {
this._setOriginForCurrentEventQueue(origin);
// `focus` isn't available on the server
if (typeof element.focus === 'function') {
element.focus();
}
};
/**
* @return {?}
*/
FocusMonitor.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
var _this = this;
this._elementInfo.forEach(function (_info, element) { return _this.stopMonitoring(element); });
};
/**
* Register necessary event listeners on the document and window.
* @return {?}
*/
FocusMonitor.prototype._registerGlobalListeners = /**
* Register necessary event listeners on the document and window.
* @return {?}
*/
function () {
var _this = this;
// Do nothing if we're not on the browser platform.
if (!this._platform.isBrowser) {
return;
}
// On keydown record the origin and clear any touch event that may be in progress.
var /** @type {?} */ documentKeydownListener = function () {
_this._lastTouchTarget = null;
_this._setOriginForCurrentEventQueue('keyboard');
};
// On mousedown record the origin only if there is not touch target, since a mousedown can
// happen as a result of a touch event.
var /** @type {?} */ documentMousedownListener = function () {
if (!_this._lastTouchTarget) {
_this._setOriginForCurrentEventQueue('mouse');
}
};
// When the touchstart event fires the focus event is not yet in the event queue. This means
// we can't rely on the trick used above (setting timeout of 0ms). Instead we wait 650ms to
// see if a focus happens.
var /** @type {?} */ documentTouchstartListener = function (event) {
if (_this._touchTimeoutId != null) {
clearTimeout(_this._touchTimeoutId);
}
_this._lastTouchTarget = event.target;
_this._touchTimeoutId = setTimeout(function () { return _this._lastTouchTarget = null; }, TOUCH_BUFFER_MS);
};
// Make a note of when the window regains focus, so we can restore the origin info for the
// focused element.
var /** @type {?} */ windowFocusListener = function () {
_this._windowFocused = true;
_this._windowFocusTimeoutId = setTimeout(function () { return _this._windowFocused = false; });
};
// Note: we listen to events in the capture phase so we can detect them even if the user stops
// propagation.
this._ngZone.runOutsideAngular(function () {
document.addEventListener('keydown', documentKeydownListener, true);
document.addEventListener('mousedown', documentMousedownListener, true);
document.addEventListener('touchstart', documentTouchstartListener, Object(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_6__["supportsPassiveEventListeners"])() ? (/** @type {?} */ ({ passive: true, capture: true })) : true);
window.addEventListener('focus', windowFocusListener);
});
this._unregisterGlobalListeners = function () {
document.removeEventListener('keydown', documentKeydownListener, true);
document.removeEventListener('mousedown', documentMousedownListener, true);
document.removeEventListener('touchstart', documentTouchstartListener, Object(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_6__["supportsPassiveEventListeners"])() ? (/** @type {?} */ ({ passive: true, capture: true })) : true);
window.removeEventListener('focus', windowFocusListener);
// Clear timeouts for all potentially pending timeouts to prevent the leaks.
clearTimeout(_this._windowFocusTimeoutId);
clearTimeout(_this._touchTimeoutId);
clearTimeout(_this._originTimeoutId);
};
};
/**
* @param {?} element
* @param {?} className
* @param {?} shouldSet
* @return {?}
*/
FocusMonitor.prototype._toggleClass = /**
* @param {?} element
* @param {?} className
* @param {?} shouldSet
* @return {?}
*/
function (element, className, shouldSet) {
if (shouldSet) {
element.classList.add(className);
}
else {
element.classList.remove(className);
}
};
/**
* Sets the focus classes on the element based on the given focus origin.
* @param {?} element The element to update the classes on.
* @param {?=} origin The focus origin.
* @return {?}
*/
FocusMonitor.prototype._setClasses = /**
* Sets the focus classes on the element based on the given focus origin.
* @param {?} element The element to update the classes on.
* @param {?=} origin The focus origin.
* @return {?}
*/
function (element, origin) {
var /** @type {?} */ elementInfo = this._elementInfo.get(element);
if (elementInfo) {
this._toggleClass(element, 'cdk-focused', !!origin);
this._toggleClass(element, 'cdk-touch-focused', origin === 'touch');
this._toggleClass(element, 'cdk-keyboard-focused', origin === 'keyboard');
this._toggleClass(element, 'cdk-mouse-focused', origin === 'mouse');
this._toggleClass(element, 'cdk-program-focused', origin === 'program');
}
};
/**
* Sets the origin and schedules an async function to clear it at the end of the event queue.
* @param {?} origin The origin to set.
* @return {?}
*/
FocusMonitor.prototype._setOriginForCurrentEventQueue = /**
* Sets the origin and schedules an async function to clear it at the end of the event queue.
* @param {?} origin The origin to set.
* @return {?}
*/
function (origin) {
var _this = this;
this._ngZone.runOutsideAngular(function () {
_this._origin = origin;
_this._originTimeoutId = setTimeout(function () { return _this._origin = null; });
});
};
/**
* Checks whether the given focus event was caused by a touchstart event.
* @param {?} event The focus event to check.
* @return {?} Whether the event was caused by a touch.
*/
FocusMonitor.prototype._wasCausedByTouch = /**
* Checks whether the given focus event was caused by a touchstart event.
* @param {?} event The focus event to check.
* @return {?} Whether the event was caused by a touch.
*/
function (event) {
// Note(mmalerba): This implementation is not quite perfect, there is a small edge case.
// Consider the following dom structure:
//
// <div #parent tabindex="0" cdkFocusClasses>
// <div #child (click)="#parent.focus()"></div>
// </div>
//
// If the user touches the #child element and the #parent is programmatically focused as a
// result, this code will still consider it to have been caused by the touch event and will
// apply the cdk-touch-focused class rather than the cdk-program-focused class. This is a
// relatively small edge-case that can be worked around by using
// focusVia(parentEl, 'program') to focus the parent element.
//
// If we decide that we absolutely must handle this case correctly, we can do so by listening
// for the first focus event after the touchstart, and then the first blur event after that
// focus event. When that blur event fires we know that whatever follows is not a result of the
// touchstart.
var /** @type {?} */ focusTarget = event.target;
return this._lastTouchTarget instanceof Node && focusTarget instanceof Node &&
(focusTarget === this._lastTouchTarget || focusTarget.contains(this._lastTouchTarget));
};
/**
* Handles focus events on a registered element.
* @param {?} event The focus event.
* @param {?} element The monitored element.
* @return {?}
*/
FocusMonitor.prototype._onFocus = /**
* Handles focus events on a registered element.
* @param {?} event The focus event.
* @param {?} element The monitored element.
* @return {?}
*/
function (event, element) {
// NOTE(mmalerba): We currently set the classes based on the focus origin of the most recent
// focus event affecting the monitored element. If we want to use the origin of the first event
// instead we should check for the cdk-focused class here and return if the element already has
// it. (This only matters for elements that have includesChildren = true).
// If we are not counting child-element-focus as focused, make sure that the event target is the
// monitored element itself.
var /** @type {?} */ elementInfo = this._elementInfo.get(element);
if (!elementInfo || (!elementInfo.checkChildren && element !== event.target)) {
return;
}
// If we couldn't detect a cause for the focus event, it's due to one of three reasons:
// 1) The window has just regained focus, in which case we want to restore the focused state of
// the element from before the window blurred.
// 2) It was caused by a touch event, in which case we mark the origin as 'touch'.
// 3) The element was programmatically focused, in which case we should mark the origin as
// 'program'.
var /** @type {?} */ origin = this._origin;
if (!origin) {
if (this._windowFocused && this._lastFocusOrigin) {
origin = this._lastFocusOrigin;
}
else if (this._wasCausedByTouch(event)) {
origin = 'touch';
}
else {
origin = 'program';
}
}
this._setClasses(element, origin);
this._emitOrigin(elementInfo.subject, origin);
this._lastFocusOrigin = origin;
};
/**
* Handles blur events on a registered element.
* @param event The blur event.
* @param element The monitored element.
*/
/**
* Handles blur events on a registered element.
* @param {?} event The blur event.
* @param {?} element The monitored element.
* @return {?}
*/
FocusMonitor.prototype._onBlur = /**
* Handles blur events on a registered element.
* @param {?} event The blur event.
* @param {?} element The monitored element.
* @return {?}
*/
function (event, element) {
// If we are counting child-element-focus as focused, make sure that we aren't just blurring in
// order to focus another child of the monitored element.
var /** @type {?} */ elementInfo = this._elementInfo.get(element);
if (!elementInfo || (elementInfo.checkChildren && event.relatedTarget instanceof Node &&
element.contains(event.relatedTarget))) {
return;
}
this._setClasses(element);
this._emitOrigin(elementInfo.subject, null);
};
/**
* @param {?} subject
* @param {?} origin
* @return {?}
*/
FocusMonitor.prototype._emitOrigin = /**
* @param {?} subject
* @param {?} origin
* @return {?}
*/
function (subject, origin) {
this._ngZone.run(function () { return subject.next(origin); });
};
/**
* @return {?}
*/
FocusMonitor.prototype._incrementMonitoredElementCount = /**
* @return {?}
*/
function () {
// Register global listeners when first element is monitored.
if (++this._monitoredElementCount == 1) {
this._registerGlobalListeners();
}
};
/**
* @return {?}
*/
FocusMonitor.prototype._decrementMonitoredElementCount = /**
* @return {?}
*/
function () {
// Unregister global listeners when last element is unmonitored.
if (!--this._monitoredElementCount) {
this._unregisterGlobalListeners();
this._unregisterGlobalListeners = function () { };
}
};
FocusMonitor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
FocusMonitor.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_6__["Platform"], },
]; };
/** @nocollapse */ FocusMonitor.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function FocusMonitor_Factory() { return new FocusMonitor(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"]), Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_6__["Platform"])); }, token: FocusMonitor, providedIn: "root" });
return FocusMonitor;
}());
/**
* Directive that determines how a particular element was focused (via keyboard, mouse, touch, or
* programmatically) and adds corresponding classes to the element.
*
* There are two variants of this directive:
* 1) cdkMonitorElementFocus: does not consider an element to be focused if one of its children is
* focused.
* 2) cdkMonitorSubtreeFocus: considers an element focused if it or any of its children are focused.
*/
var CdkMonitorFocus = /** @class */ (function () {
function CdkMonitorFocus(_elementRef, _focusMonitor) {
var _this = this;
this._elementRef = _elementRef;
this._focusMonitor = _focusMonitor;
this.cdkFocusChange = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
this._monitorSubscription = this._focusMonitor.monitor(this._elementRef.nativeElement, this._elementRef.nativeElement.hasAttribute('cdkMonitorSubtreeFocus'))
.subscribe(function (origin) { return _this.cdkFocusChange.emit(origin); });
}
/**
* @return {?}
*/
CdkMonitorFocus.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._focusMonitor.stopMonitoring(this._elementRef.nativeElement);
this._monitorSubscription.unsubscribe();
};
CdkMonitorFocus.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]',
},] },
];
/** @nocollapse */
CdkMonitorFocus.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: FocusMonitor, },
]; };
CdkMonitorFocus.propDecorators = {
"cdkFocusChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] },],
};
return CdkMonitorFocus;
}());
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
* @param {?} parentDispatcher
* @param {?} ngZone
* @param {?} platform
* @return {?}
*/
function FOCUS_MONITOR_PROVIDER_FACTORY(parentDispatcher, ngZone, platform) {
return parentDispatcher || new FocusMonitor(ngZone, platform);
}
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
*/
var /** @type {?} */ FOCUS_MONITOR_PROVIDER = {
// If there is already a FocusMonitor available, use that. Otherwise, provide a new one.
provide: FocusMonitor,
deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"](), FocusMonitor], _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_6__["Platform"]],
useFactory: FOCUS_MONITOR_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Screenreaders will often fire fake mousedown events when a focusable element
* is activated using the keyboard. We can typically distinguish between these faked
* mousedown events and real mousedown events using the "buttons" property. While
* real mousedowns will indicate the mouse button that was pressed (e.g. "1" for
* the left mouse button), faked mousedowns will usually set the property value to 0.
* @param {?} event
* @return {?}
*/
function isFakeMousedownFromScreenReader(event) {
return event.buttons === 0;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var A11yModule = /** @class */ (function () {
function A11yModule() {
}
A11yModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["CommonModule"], _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_6__["PlatformModule"]],
declarations: [CdkTrapFocus, CdkMonitorFocus],
exports: [CdkTrapFocus, CdkMonitorFocus],
},] },
];
return A11yModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=a11y.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/accordion.es5.js":
/*!*********************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/accordion.es5.js ***!
\*********************************************************/
/*! exports provided: CdkAccordionItem, CdkAccordion, CdkAccordionModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkAccordionItem", function() { return CdkAccordionItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkAccordion", function() { return CdkAccordion; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkAccordionModule", function() { return CdkAccordionModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm5/collections.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Used to generate unique ID for each accordion.
*/
var /** @type {?} */ nextId = 0;
/**
* Directive whose purpose is to manage the expanded state of CdkAccordionItem children.
*/
var CdkAccordion = /** @class */ (function () {
function CdkAccordion() {
/**
* Stream that emits true/false when openAll/closeAll is triggered.
*/
this._openCloseAllActions = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
/**
* A readonly id value to use for unique selection coordination.
*/
this.id = "cdk-accordion-" + nextId++;
this._multi = false;
}
Object.defineProperty(CdkAccordion.prototype, "multi", {
get: /**
* Whether the accordion should allow multiple expanded accordion items simultaneously.
* @return {?}
*/
function () { return this._multi; },
set: /**
* @param {?} multi
* @return {?}
*/
function (multi) { this._multi = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(multi); },
enumerable: true,
configurable: true
});
/** Opens all enabled accordion items in an accordion where multi is enabled. */
/**
* Opens all enabled accordion items in an accordion where multi is enabled.
* @return {?}
*/
CdkAccordion.prototype.openAll = /**
* Opens all enabled accordion items in an accordion where multi is enabled.
* @return {?}
*/
function () {
this._openCloseAll(true);
};
/** Closes all enabled accordion items in an accordion where multi is enabled. */
/**
* Closes all enabled accordion items in an accordion where multi is enabled.
* @return {?}
*/
CdkAccordion.prototype.closeAll = /**
* Closes all enabled accordion items in an accordion where multi is enabled.
* @return {?}
*/
function () {
this._openCloseAll(false);
};
/**
* @param {?} expanded
* @return {?}
*/
CdkAccordion.prototype._openCloseAll = /**
* @param {?} expanded
* @return {?}
*/
function (expanded) {
if (this.multi) {
this._openCloseAllActions.next(expanded);
}
};
CdkAccordion.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'cdk-accordion, [cdkAccordion]',
exportAs: 'cdkAccordion',
},] },
];
/** @nocollapse */
CdkAccordion.propDecorators = {
"multi": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return CdkAccordion;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Used to generate unique ID for each accordion item.
*/
var /** @type {?} */ nextId$1 = 0;
/**
* An basic directive expected to be extended and decorated as a component. Sets up all
* events and attributes needed to be managed by a CdkAccordion parent.
*/
var CdkAccordionItem = /** @class */ (function () {
function CdkAccordionItem(accordion, _changeDetectorRef, _expansionDispatcher) {
var _this = this;
this.accordion = accordion;
this._changeDetectorRef = _changeDetectorRef;
this._expansionDispatcher = _expansionDispatcher;
/**
* Subscription to openAll/closeAll events.
*/
this._openCloseAllSubscription = rxjs__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY;
/**
* Event emitted every time the AccordionItem is closed.
*/
this.closed = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted every time the AccordionItem is opened.
*/
this.opened = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when the AccordionItem is destroyed.
*/
this.destroyed = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits whenever the expanded state of the accordion changes.
* Primarily used to facilitate two-way binding.
* \@docs-private
*/
this.expandedChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* The unique AccordionItem id.
*/
this.id = "cdk-accordion-child-" + nextId$1++;
this._expanded = false;
this._disabled = false;
/**
* Unregister function for _expansionDispatcher.
*/
this._removeUniqueSelectionListener = function () { };
this._removeUniqueSelectionListener =
_expansionDispatcher.listen(function (id, accordionId) {
if (_this.accordion && !_this.accordion.multi &&
_this.accordion.id === accordionId && _this.id !== id) {
_this.expanded = false;
}
});
// When an accordion item is hosted in an accordion, subscribe to open/close events.
if (this.accordion) {
this._openCloseAllSubscription = this._subscribeToOpenCloseAllActions();
}
}
Object.defineProperty(CdkAccordionItem.prototype, "expanded", {
get: /**
* Whether the AccordionItem is expanded.
* @return {?}
*/
function () { return this._expanded; },
set: /**
* @param {?} expanded
* @return {?}
*/
function (expanded) {
expanded = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(expanded);
// Only emit events and update the internal value if the value changes.
if (this._expanded !== expanded) {
this._expanded = expanded;
this.expandedChange.emit(expanded);
if (expanded) {
this.opened.emit();
/**
* In the unique selection dispatcher, the id parameter is the id of the CdkAccordionItem,
* the name value is the id of the accordion.
*/
var /** @type {?} */ accordionId = this.accordion ? this.accordion.id : this.id;
this._expansionDispatcher.notify(this.id, accordionId);
}
else {
this.closed.emit();
}
// Ensures that the animation will run when the value is set outside of an `@Input`.
// This includes cases like the open, close and toggle methods.
this._changeDetectorRef.markForCheck();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkAccordionItem.prototype, "disabled", {
get: /**
* Whether the AccordionItem is disabled.
* @return {?}
*/
function () { return this._disabled; },
set: /**
* @param {?} disabled
* @return {?}
*/
function (disabled) { this._disabled = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(disabled); },
enumerable: true,
configurable: true
});
/** Emits an event for the accordion item being destroyed. */
/**
* Emits an event for the accordion item being destroyed.
* @return {?}
*/
CdkAccordionItem.prototype.ngOnDestroy = /**
* Emits an event for the accordion item being destroyed.
* @return {?}
*/
function () {
this.opened.complete();
this.closed.complete();
this.destroyed.emit();
this.destroyed.complete();
this._removeUniqueSelectionListener();
this._openCloseAllSubscription.unsubscribe();
};
/** Toggles the expanded state of the accordion item. */
/**
* Toggles the expanded state of the accordion item.
* @return {?}
*/
CdkAccordionItem.prototype.toggle = /**
* Toggles the expanded state of the accordion item.
* @return {?}
*/
function () {
if (!this.disabled) {
this.expanded = !this.expanded;
}
};
/** Sets the expanded state of the accordion item to false. */
/**
* Sets the expanded state of the accordion item to false.
* @return {?}
*/
CdkAccordionItem.prototype.close = /**
* Sets the expanded state of the accordion item to false.
* @return {?}
*/
function () {
if (!this.disabled) {
this.expanded = false;
}
};
/** Sets the expanded state of the accordion item to true. */
/**
* Sets the expanded state of the accordion item to true.
* @return {?}
*/
CdkAccordionItem.prototype.open = /**
* Sets the expanded state of the accordion item to true.
* @return {?}
*/
function () {
if (!this.disabled) {
this.expanded = true;
}
};
/**
* @return {?}
*/
CdkAccordionItem.prototype._subscribeToOpenCloseAllActions = /**
* @return {?}
*/
function () {
var _this = this;
return this.accordion._openCloseAllActions.subscribe(function (expanded) {
// Only change expanded state if item is enabled
if (!_this.disabled) {
_this.expanded = expanded;
}
});
};
CdkAccordionItem.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'cdk-accordion-item, [cdkAccordionItem]',
exportAs: 'cdkAccordionItem',
},] },
];
/** @nocollapse */
CdkAccordionItem.ctorParameters = function () { return [
{ type: CdkAccordion, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
{ type: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_3__["UniqueSelectionDispatcher"], },
]; };
CdkAccordionItem.propDecorators = {
"closed": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"opened": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"destroyed": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"expandedChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"expanded": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return CdkAccordionItem;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var CdkAccordionModule = /** @class */ (function () {
function CdkAccordionModule() {
}
CdkAccordionModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
exports: [CdkAccordion, CdkAccordionItem],
declarations: [CdkAccordion, CdkAccordionItem],
},] },
];
return CdkAccordionModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=accordion.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/bidi.es5.js":
/*!****************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/bidi.es5.js ***!
\****************************************************/
/*! exports provided: Directionality, DIR_DOCUMENT, Dir, BidiModule, ɵa */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Directionality", function() { return Directionality; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DIR_DOCUMENT", function() { return DIR_DOCUMENT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dir", function() { return Dir; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BidiModule", function() { return BidiModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵa", function() { return DIR_DOCUMENT_FACTORY; });
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token used to inject the document into Directionality.
* This is used so that the value can be faked in tests.
*
* We can't use the real document in tests because changing the real `dir` causes geometry-based
* tests in Safari to fail.
*
* We also can't re-provide the DOCUMENT token from platform-brower because the unit tests
* themselves use things like `querySelector` in test code.
*
* This token is defined in a separate file from Directionality as a workaround for
* https://github.com/angular/angular/issues/22559
*
* \@docs-private
*/
var /** @type {?} */ DIR_DOCUMENT = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('cdk-dir-doc', {
providedIn: 'root',
factory: DIR_DOCUMENT_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function DIR_DOCUMENT_FACTORY() {
return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* The directionality (LTR / RTL) context for the application (or a subtree of it).
* Exposes the current direction and a stream of direction changes.
*/
var Directionality = /** @class */ (function () {
function Directionality(_document) {
/**
* The current 'ltr' or 'rtl' value.
*/
this.value = 'ltr';
/**
* Stream that emits whenever the 'ltr' / 'rtl' state changes.
*/
this.change = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
if (_document) {
// TODO: handle 'auto' value -
// We still need to account for dir="auto".
// It looks like HTMLElemenet.dir is also "auto" when that's set to the attribute,
// but getComputedStyle return either "ltr" or "rtl". avoiding getComputedStyle for now
var /** @type {?} */ bodyDir = _document.body ? _document.body.dir : null;
var /** @type {?} */ htmlDir = _document.documentElement ? _document.documentElement.dir : null;
this.value = /** @type {?} */ ((bodyDir || htmlDir || 'ltr'));
}
}
/**
* @return {?}
*/
Directionality.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.change.complete();
};
Directionality.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
Directionality.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [DIR_DOCUMENT,] },] },
]; };
/** @nocollapse */ Directionality.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function Directionality_Factory() { return new Directionality(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(DIR_DOCUMENT, 8)); }, token: Directionality, providedIn: "root" });
return Directionality;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Directive to listen for changes of direction of part of the DOM.
*
* Provides itself as Directionality such that descendant directives only need to ever inject
* Directionality to get the closest direction.
*/
var Dir = /** @class */ (function () {
function Dir() {
this._dir = 'ltr';
/**
* Whether the `value` has been set to its initial value.
*/
this._isInitialized = false;
/**
* Event emitted when the direction changes.
*/
this.change = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
}
Object.defineProperty(Dir.prototype, "dir", {
get: /**
* \@docs-private
* @return {?}
*/
function () { return this._dir; },
set: /**
* @param {?} v
* @return {?}
*/
function (v) {
var /** @type {?} */ old = this._dir;
this._dir = v;
if (old !== this._dir && this._isInitialized) {
this.change.emit(this._dir);
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(Dir.prototype, "value", {
/** Current layout direction of the element. */
get: /**
* Current layout direction of the element.
* @return {?}
*/
function () { return this.dir; },
enumerable: true,
configurable: true
});
/** Initialize once default value has been set. */
/**
* Initialize once default value has been set.
* @return {?}
*/
Dir.prototype.ngAfterContentInit = /**
* Initialize once default value has been set.
* @return {?}
*/
function () {
this._isInitialized = true;
};
/**
* @return {?}
*/
Dir.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.change.complete();
};
Dir.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[dir]',
providers: [{ provide: Directionality, useExisting: Dir }],
host: { '[dir]': 'dir' },
exportAs: 'dir',
},] },
];
/** @nocollapse */
Dir.propDecorators = {
"change": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"], args: ['dirChange',] },],
"dir": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
};
return Dir;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var BidiModule = /** @class */ (function () {
function BidiModule() {
}
BidiModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
exports: [Dir],
declarations: [Dir],
},] },
];
return BidiModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=bidi.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/coercion.es5.js":
/*!********************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/coercion.es5.js ***!
\********************************************************/
/*! exports provided: coerceBooleanProperty, coerceNumberProperty, _isNumberValue, coerceArray, coerceCssPixelValue */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coerceBooleanProperty", function() { return coerceBooleanProperty; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coerceNumberProperty", function() { return coerceNumberProperty; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_isNumberValue", function() { return _isNumberValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coerceArray", function() { return coerceArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coerceCssPixelValue", function() { return coerceCssPixelValue; });
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Coerces a data-bound value (typically a string) to a boolean.
* @param {?} value
* @return {?}
*/
function coerceBooleanProperty(value) {
return value != null && "" + value !== 'false';
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @param {?} value
* @param {?=} fallbackValue
* @return {?}
*/
function coerceNumberProperty(value, fallbackValue) {
if (fallbackValue === void 0) { fallbackValue = 0; }
return _isNumberValue(value) ? Number(value) : fallbackValue;
}
/**
* Whether the provided value is considered a number.
* \@docs-private
* @param {?} value
* @return {?}
*/
function _isNumberValue(value) {
// parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,
// and other non-number values as NaN, where Number just uses 0) but it considers the string
// '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.
return !isNaN(parseFloat(/** @type {?} */ (value))) && !isNaN(Number(value));
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Wraps the provided value in an array, unless the provided value is an array.
* @template T
* @param {?} value
* @return {?}
*/
function coerceArray(value) {
return Array.isArray(value) ? value : [value];
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Coerces a value to a CSS pixel value.
* @param {?} value
* @return {?}
*/
function coerceCssPixelValue(value) {
if (value == null) {
return '';
}
return typeof value === 'string' ? value : value + "px";
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=coercion.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/collections.es5.js":
/*!***********************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/collections.es5.js ***!
\***********************************************************/
/*! exports provided: UniqueSelectionDispatcher, DataSource, SelectionModel, getMultipleValuesInSingleSelectionError */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UniqueSelectionDispatcher", function() { return UniqueSelectionDispatcher; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataSource", function() { return DataSource; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionModel", function() { return SelectionModel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMultipleValuesInSingleSelectionError", function() { return getMultipleValuesInSingleSelectionError; });
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @abstract
* @template T
*/
var /**
* @abstract
* @template T
*/
DataSource = /** @class */ (function () {
function DataSource() {
}
return DataSource;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Class to be used to power selecting one or more options from a list.
* @template T
*/
var /**
* Class to be used to power selecting one or more options from a list.
* @template T
*/
SelectionModel = /** @class */ (function () {
function SelectionModel(_multiple, initiallySelectedValues, _emitChanges) {
if (_multiple === void 0) { _multiple = false; }
if (_emitChanges === void 0) { _emitChanges = true; }
var _this = this;
this._multiple = _multiple;
this._emitChanges = _emitChanges;
/**
* Currently-selected values.
*/
this._selection = new Set();
/**
* Keeps track of the deselected options that haven't been emitted by the change event.
*/
this._deselectedToEmit = [];
/**
* Keeps track of the selected options that haven't been emitted by the change event.
*/
this._selectedToEmit = [];
/**
* Event emitted when the value has changed.
*/
this.onChange = this._emitChanges ? new rxjs__WEBPACK_IMPORTED_MODULE_0__["Subject"]() : null;
if (initiallySelectedValues && initiallySelectedValues.length) {
if (_multiple) {
initiallySelectedValues.forEach(function (value) { return _this._markSelected(value); });
}
else {
this._markSelected(initiallySelectedValues[0]);
}
// Clear the array in order to avoid firing the change event for preselected values.
this._selectedToEmit.length = 0;
}
}
Object.defineProperty(SelectionModel.prototype, "selected", {
/** Selected values. */
get: /**
* Selected values.
* @return {?}
*/
function () {
if (!this._selected) {
this._selected = Array.from(this._selection.values());
}
return this._selected;
},
enumerable: true,
configurable: true
});
/**
* Selects a value or an array of values.
*/
/**
* Selects a value or an array of values.
* @param {...?} values
* @return {?}
*/
SelectionModel.prototype.select = /**
* Selects a value or an array of values.
* @param {...?} values
* @return {?}
*/
function () {
var _this = this;
var values = [];
for (var _i = 0; _i < arguments.length; _i++) {
values[_i] = arguments[_i];
}
this._verifyValueAssignment(values);
values.forEach(function (value) { return _this._markSelected(value); });
this._emitChangeEvent();
};
/**
* Deselects a value or an array of values.
*/
/**
* Deselects a value or an array of values.
* @param {...?} values
* @return {?}
*/
SelectionModel.prototype.deselect = /**
* Deselects a value or an array of values.
* @param {...?} values
* @return {?}
*/
function () {
var _this = this;
var values = [];
for (var _i = 0; _i < arguments.length; _i++) {
values[_i] = arguments[_i];
}
this._verifyValueAssignment(values);
values.forEach(function (value) { return _this._unmarkSelected(value); });
this._emitChangeEvent();
};
/**
* Toggles a value between selected and deselected.
*/
/**
* Toggles a value between selected and deselected.
* @param {?} value
* @return {?}
*/
SelectionModel.prototype.toggle = /**
* Toggles a value between selected and deselected.
* @param {?} value
* @return {?}
*/
function (value) {
this.isSelected(value) ? this.deselect(value) : this.select(value);
};
/**
* Clears all of the selected values.
*/
/**
* Clears all of the selected values.
* @return {?}
*/
SelectionModel.prototype.clear = /**
* Clears all of the selected values.
* @return {?}
*/
function () {
this._unmarkAll();
this._emitChangeEvent();
};
/**
* Determines whether a value is selected.
*/
/**
* Determines whether a value is selected.
* @param {?} value
* @return {?}
*/
SelectionModel.prototype.isSelected = /**
* Determines whether a value is selected.
* @param {?} value
* @return {?}
*/
function (value) {
return this._selection.has(value);
};
/**
* Determines whether the model does not have a value.
*/
/**
* Determines whether the model does not have a value.
* @return {?}
*/
SelectionModel.prototype.isEmpty = /**
* Determines whether the model does not have a value.
* @return {?}
*/
function () {
return this._selection.size === 0;
};
/**
* Determines whether the model has a value.
*/
/**
* Determines whether the model has a value.
* @return {?}
*/
SelectionModel.prototype.hasValue = /**
* Determines whether the model has a value.
* @return {?}
*/
function () {
return !this.isEmpty();
};
/**
* Sorts the selected values based on a predicate function.
*/
/**
* Sorts the selected values based on a predicate function.
* @param {?=} predicate
* @return {?}
*/
SelectionModel.prototype.sort = /**
* Sorts the selected values based on a predicate function.
* @param {?=} predicate
* @return {?}
*/
function (predicate) {
if (this._multiple && this._selected) {
this._selected.sort(predicate);
}
};
/**
* Emits a change event and clears the records of selected and deselected values.
* @return {?}
*/
SelectionModel.prototype._emitChangeEvent = /**
* Emits a change event and clears the records of selected and deselected values.
* @return {?}
*/
function () {
// Clear the selected values so they can be re-cached.
this._selected = null;
if (this._selectedToEmit.length || this._deselectedToEmit.length) {
if (this.onChange) {
this.onChange.next({
source: this,
added: this._selectedToEmit,
removed: this._deselectedToEmit
});
}
this._deselectedToEmit = [];
this._selectedToEmit = [];
}
};
/**
* Selects a value.
* @param {?} value
* @return {?}
*/
SelectionModel.prototype._markSelected = /**
* Selects a value.
* @param {?} value
* @return {?}
*/
function (value) {
if (!this.isSelected(value)) {
if (!this._multiple) {
this._unmarkAll();
}
this._selection.add(value);
if (this._emitChanges) {
this._selectedToEmit.push(value);
}
}
};
/**
* Deselects a value.
* @param {?} value
* @return {?}
*/
SelectionModel.prototype._unmarkSelected = /**
* Deselects a value.
* @param {?} value
* @return {?}
*/
function (value) {
if (this.isSelected(value)) {
this._selection.delete(value);
if (this._emitChanges) {
this._deselectedToEmit.push(value);
}
}
};
/**
* Clears out the selected values.
* @return {?}
*/
SelectionModel.prototype._unmarkAll = /**
* Clears out the selected values.
* @return {?}
*/
function () {
var _this = this;
if (!this.isEmpty()) {
this._selection.forEach(function (value) { return _this._unmarkSelected(value); });
}
};
/**
* Verifies the value assignment and throws an error if the specified value array is
* including multiple values while the selection model is not supporting multiple values.
* @param {?} values
* @return {?}
*/
SelectionModel.prototype._verifyValueAssignment = /**
* Verifies the value assignment and throws an error if the specified value array is
* including multiple values while the selection model is not supporting multiple values.
* @param {?} values
* @return {?}
*/
function (values) {
if (values.length > 1 && !this._multiple) {
throw getMultipleValuesInSingleSelectionError();
}
};
return SelectionModel;
}());
/**
* Returns an error that reports that multiple values are passed into a selection model
* with a single value.
* @return {?}
*/
function getMultipleValuesInSingleSelectionError() {
return Error('Cannot pass multiple values into SelectionModel with single-value mode.');
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Class to coordinate unique selection based on name.
* Intended to be consumed as an Angular service.
* This service is needed because native radio change events are only fired on the item currently
* being selected, and we still need to uncheck the previous selection.
*
* This service does not *store* any IDs and names because they may change at any time, so it is
* less error-prone if they are simply passed through when the events occur.
*/
var UniqueSelectionDispatcher = /** @class */ (function () {
function UniqueSelectionDispatcher() {
this._listeners = [];
}
/**
* Notify other items that selection for the given name has been set.
* @param id ID of the item.
* @param name Name of the item.
*/
/**
* Notify other items that selection for the given name has been set.
* @param {?} id ID of the item.
* @param {?} name Name of the item.
* @return {?}
*/
UniqueSelectionDispatcher.prototype.notify = /**
* Notify other items that selection for the given name has been set.
* @param {?} id ID of the item.
* @param {?} name Name of the item.
* @return {?}
*/
function (id, name) {
for (var _i = 0, _a = this._listeners; _i < _a.length; _i++) {
var listener = _a[_i];
listener(id, name);
}
};
/**
* Listen for future changes to item selection.
* @return Function used to deregister listener
*/
/**
* Listen for future changes to item selection.
* @param {?} listener
* @return {?} Function used to deregister listener
*/
UniqueSelectionDispatcher.prototype.listen = /**
* Listen for future changes to item selection.
* @param {?} listener
* @return {?} Function used to deregister listener
*/
function (listener) {
var _this = this;
this._listeners.push(listener);
return function () {
_this._listeners = _this._listeners.filter(function (registered) {
return listener !== registered;
});
};
};
/**
* @return {?}
*/
UniqueSelectionDispatcher.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._listeners = [];
};
UniqueSelectionDispatcher.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */ UniqueSelectionDispatcher.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function UniqueSelectionDispatcher_Factory() { return new UniqueSelectionDispatcher(); }, token: UniqueSelectionDispatcher, providedIn: "root" });
return UniqueSelectionDispatcher;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=collections.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/keycodes.es5.js":
/*!********************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/keycodes.es5.js ***!
\********************************************************/
/*! exports provided: MAC_ENTER, BACKSPACE, TAB, NUM_CENTER, ENTER, SHIFT, CONTROL, ALT, PAUSE, CAPS_LOCK, ESCAPE, SPACE, PAGE_UP, PAGE_DOWN, END, HOME, LEFT_ARROW, UP_ARROW, RIGHT_ARROW, DOWN_ARROW, PLUS_SIGN, PRINT_SCREEN, INSERT, DELETE, ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, FF_SEMICOLON, FF_EQUALS, QUESTION_MARK, AT_SIGN, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, CONTEXT_MENU, NUMPAD_ZERO, NUMPAD_ONE, NUMPAD_TWO, NUMPAD_THREE, NUMPAD_FOUR, NUMPAD_FIVE, NUMPAD_SIX, NUMPAD_SEVEN, NUMPAD_EIGHT, NUMPAD_NINE, NUMPAD_MULTIPLY, NUMPAD_PLUS, NUMPAD_MINUS, NUMPAD_PERIOD, NUMPAD_DIVIDE, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, NUM_LOCK, SCROLL_LOCK, FIRST_MEDIA, FF_MINUS, MUTE, VOLUME_DOWN, VOLUME_UP, FF_MUTE, FF_VOLUME_DOWN, LAST_MEDIA, FF_VOLUME_UP, SEMICOLON, EQUALS, COMMA, DASH, SLASH, APOSTROPHE, TILDE, OPEN_SQUARE_BRACKET, BACKSLASH, CLOSE_SQUARE_BRACKET, SINGLE_QUOTE, MAC_META */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAC_ENTER", function() { return MAC_ENTER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BACKSPACE", function() { return BACKSPACE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TAB", function() { return TAB; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUM_CENTER", function() { return NUM_CENTER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENTER", function() { return ENTER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SHIFT", function() { return SHIFT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTROL", function() { return CONTROL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ALT", function() { return ALT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PAUSE", function() { return PAUSE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CAPS_LOCK", function() { return CAPS_LOCK; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ESCAPE", function() { return ESCAPE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SPACE", function() { return SPACE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PAGE_UP", function() { return PAGE_UP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PAGE_DOWN", function() { return PAGE_DOWN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "END", function() { return END; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HOME", function() { return HOME; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LEFT_ARROW", function() { return LEFT_ARROW; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UP_ARROW", function() { return UP_ARROW; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RIGHT_ARROW", function() { return RIGHT_ARROW; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOWN_ARROW", function() { return DOWN_ARROW; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUS_SIGN", function() { return PLUS_SIGN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PRINT_SCREEN", function() { return PRINT_SCREEN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INSERT", function() { return INSERT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DELETE", function() { return DELETE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZERO", function() { return ZERO; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ONE", function() { return ONE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TWO", function() { return TWO; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "THREE", function() { return THREE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FOUR", function() { return FOUR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FIVE", function() { return FIVE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SIX", function() { return SIX; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SEVEN", function() { return SEVEN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EIGHT", function() { return EIGHT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NINE", function() { return NINE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FF_SEMICOLON", function() { return FF_SEMICOLON; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FF_EQUALS", function() { return FF_EQUALS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUESTION_MARK", function() { return QUESTION_MARK; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AT_SIGN", function() { return AT_SIGN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return A; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return B; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return C; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return D; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return E; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return F; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return G; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return H; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I", function() { return I; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return J; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return K; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return L; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return M; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return N; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return O; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "P", function() { return P; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return Q; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return R; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return S; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return T; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return U; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return V; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return W; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return X; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Y", function() { return Y; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Z", function() { return Z; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "META", function() { return META; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAC_WK_CMD_LEFT", function() { return MAC_WK_CMD_LEFT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAC_WK_CMD_RIGHT", function() { return MAC_WK_CMD_RIGHT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTEXT_MENU", function() { return CONTEXT_MENU; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_ZERO", function() { return NUMPAD_ZERO; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_ONE", function() { return NUMPAD_ONE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_TWO", function() { return NUMPAD_TWO; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_THREE", function() { return NUMPAD_THREE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_FOUR", function() { return NUMPAD_FOUR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_FIVE", function() { return NUMPAD_FIVE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_SIX", function() { return NUMPAD_SIX; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_SEVEN", function() { return NUMPAD_SEVEN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_EIGHT", function() { return NUMPAD_EIGHT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_NINE", function() { return NUMPAD_NINE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_MULTIPLY", function() { return NUMPAD_MULTIPLY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_PLUS", function() { return NUMPAD_PLUS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_MINUS", function() { return NUMPAD_MINUS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_PERIOD", function() { return NUMPAD_PERIOD; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUMPAD_DIVIDE", function() { return NUMPAD_DIVIDE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F1", function() { return F1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F2", function() { return F2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F3", function() { return F3; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F4", function() { return F4; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F5", function() { return F5; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F6", function() { return F6; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F7", function() { return F7; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F8", function() { return F8; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F9", function() { return F9; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F10", function() { return F10; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F11", function() { return F11; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F12", function() { return F12; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NUM_LOCK", function() { return NUM_LOCK; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCROLL_LOCK", function() { return SCROLL_LOCK; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FIRST_MEDIA", function() { return FIRST_MEDIA; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FF_MINUS", function() { return FF_MINUS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MUTE", function() { return MUTE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VOLUME_DOWN", function() { return VOLUME_DOWN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VOLUME_UP", function() { return VOLUME_UP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FF_MUTE", function() { return FF_MUTE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FF_VOLUME_DOWN", function() { return FF_VOLUME_DOWN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LAST_MEDIA", function() { return LAST_MEDIA; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FF_VOLUME_UP", function() { return FF_VOLUME_UP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SEMICOLON", function() { return SEMICOLON; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EQUALS", function() { return EQUALS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMA", function() { return COMMA; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DASH", function() { return DASH; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SLASH", function() { return SLASH; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APOSTROPHE", function() { return APOSTROPHE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TILDE", function() { return TILDE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OPEN_SQUARE_BRACKET", function() { return OPEN_SQUARE_BRACKET; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BACKSLASH", function() { return BACKSLASH; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CLOSE_SQUARE_BRACKET", function() { return CLOSE_SQUARE_BRACKET; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SINGLE_QUOTE", function() { return SINGLE_QUOTE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAC_META", function() { return MAC_META; });
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ MAC_ENTER = 3;
var /** @type {?} */ BACKSPACE = 8;
var /** @type {?} */ TAB = 9;
var /** @type {?} */ NUM_CENTER = 12;
var /** @type {?} */ ENTER = 13;
var /** @type {?} */ SHIFT = 16;
var /** @type {?} */ CONTROL = 17;
var /** @type {?} */ ALT = 18;
var /** @type {?} */ PAUSE = 19;
var /** @type {?} */ CAPS_LOCK = 20;
var /** @type {?} */ ESCAPE = 27;
var /** @type {?} */ SPACE = 32;
var /** @type {?} */ PAGE_UP = 33;
var /** @type {?} */ PAGE_DOWN = 34;
var /** @type {?} */ END = 35;
var /** @type {?} */ HOME = 36;
var /** @type {?} */ LEFT_ARROW = 37;
var /** @type {?} */ UP_ARROW = 38;
var /** @type {?} */ RIGHT_ARROW = 39;
var /** @type {?} */ DOWN_ARROW = 40;
var /** @type {?} */ PLUS_SIGN = 43;
var /** @type {?} */ PRINT_SCREEN = 44;
var /** @type {?} */ INSERT = 45;
var /** @type {?} */ DELETE = 46;
var /** @type {?} */ ZERO = 48;
var /** @type {?} */ ONE = 49;
var /** @type {?} */ TWO = 50;
var /** @type {?} */ THREE = 51;
var /** @type {?} */ FOUR = 52;
var /** @type {?} */ FIVE = 53;
var /** @type {?} */ SIX = 54;
var /** @type {?} */ SEVEN = 55;
var /** @type {?} */ EIGHT = 56;
var /** @type {?} */ NINE = 57;
var /** @type {?} */ FF_SEMICOLON = 59; // Firefox (Gecko) fires this for semicolon instead of 186
var /** @type {?} */ FF_EQUALS = 61; // Firefox (Gecko) fires this for equals instead of 187
var /** @type {?} */ QUESTION_MARK = 63;
var /** @type {?} */ AT_SIGN = 64;
var /** @type {?} */ A = 65;
var /** @type {?} */ B = 66;
var /** @type {?} */ C = 67;
var /** @type {?} */ D = 68;
var /** @type {?} */ E = 69;
var /** @type {?} */ F = 70;
var /** @type {?} */ G = 71;
var /** @type {?} */ H = 72;
var /** @type {?} */ I = 73;
var /** @type {?} */ J = 74;
var /** @type {?} */ K = 75;
var /** @type {?} */ L = 76;
var /** @type {?} */ M = 77;
var /** @type {?} */ N = 78;
var /** @type {?} */ O = 79;
var /** @type {?} */ P = 80;
var /** @type {?} */ Q = 81;
var /** @type {?} */ R = 82;
var /** @type {?} */ S = 83;
var /** @type {?} */ T = 84;
var /** @type {?} */ U = 85;
var /** @type {?} */ V = 86;
var /** @type {?} */ W = 87;
var /** @type {?} */ X = 88;
var /** @type {?} */ Y = 89;
var /** @type {?} */ Z = 90;
var /** @type {?} */ META = 91; // WIN_KEY_LEFT
var /** @type {?} */ MAC_WK_CMD_LEFT = 91;
var /** @type {?} */ MAC_WK_CMD_RIGHT = 93;
var /** @type {?} */ CONTEXT_MENU = 93;
var /** @type {?} */ NUMPAD_ZERO = 96;
var /** @type {?} */ NUMPAD_ONE = 97;
var /** @type {?} */ NUMPAD_TWO = 98;
var /** @type {?} */ NUMPAD_THREE = 99;
var /** @type {?} */ NUMPAD_FOUR = 100;
var /** @type {?} */ NUMPAD_FIVE = 101;
var /** @type {?} */ NUMPAD_SIX = 102;
var /** @type {?} */ NUMPAD_SEVEN = 103;
var /** @type {?} */ NUMPAD_EIGHT = 104;
var /** @type {?} */ NUMPAD_NINE = 105;
var /** @type {?} */ NUMPAD_MULTIPLY = 106;
var /** @type {?} */ NUMPAD_PLUS = 107;
var /** @type {?} */ NUMPAD_MINUS = 109;
var /** @type {?} */ NUMPAD_PERIOD = 110;
var /** @type {?} */ NUMPAD_DIVIDE = 111;
var /** @type {?} */ F1 = 112;
var /** @type {?} */ F2 = 113;
var /** @type {?} */ F3 = 114;
var /** @type {?} */ F4 = 115;
var /** @type {?} */ F5 = 116;
var /** @type {?} */ F6 = 117;
var /** @type {?} */ F7 = 118;
var /** @type {?} */ F8 = 119;
var /** @type {?} */ F9 = 120;
var /** @type {?} */ F10 = 121;
var /** @type {?} */ F11 = 122;
var /** @type {?} */ F12 = 123;
var /** @type {?} */ NUM_LOCK = 144;
var /** @type {?} */ SCROLL_LOCK = 145;
var /** @type {?} */ FIRST_MEDIA = 166;
var /** @type {?} */ FF_MINUS = 173;
var /** @type {?} */ MUTE = 173; // Firefox (Gecko) fires 181 for MUTE
var /** @type {?} */ VOLUME_DOWN = 174; // Firefox (Gecko) fires 182 for VOLUME_DOWN
var /** @type {?} */ VOLUME_UP = 175; // Firefox (Gecko) fires 183 for VOLUME_UP
var /** @type {?} */ FF_MUTE = 181;
var /** @type {?} */ FF_VOLUME_DOWN = 182;
var /** @type {?} */ LAST_MEDIA = 183;
var /** @type {?} */ FF_VOLUME_UP = 183;
var /** @type {?} */ SEMICOLON = 186; // Firefox (Gecko) fires 59 for SEMICOLON
var /** @type {?} */ EQUALS = 187; // Firefox (Gecko) fires 61 for EQUALS
var /** @type {?} */ COMMA = 188;
var /** @type {?} */ DASH = 189; // Firefox (Gecko) fires 173 for DASH/MINUS
var /** @type {?} */ SLASH = 191;
var /** @type {?} */ APOSTROPHE = 192;
var /** @type {?} */ TILDE = 192;
var /** @type {?} */ OPEN_SQUARE_BRACKET = 219;
var /** @type {?} */ BACKSLASH = 220;
var /** @type {?} */ CLOSE_SQUARE_BRACKET = 221;
var /** @type {?} */ SINGLE_QUOTE = 222;
var /** @type {?} */ MAC_META = 224;
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=keycodes.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/layout.es5.js":
/*!******************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/layout.es5.js ***!
\******************************************************/
/*! exports provided: LayoutModule, BreakpointObserver, Breakpoints, MediaMatcher */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LayoutModule", function() { return LayoutModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BreakpointObserver", function() { return BreakpointObserver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Breakpoints", function() { return Breakpoints; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MediaMatcher", function() { return MediaMatcher; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var LayoutModule = /** @class */ (function () {
function LayoutModule() {
}
LayoutModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"] },
];
return LayoutModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Global registry for all dynamically-created, injected media queries.
*/
var /** @type {?} */ mediaQueriesForWebkitCompatibility = new Set();
/**
* Style tag that holds all of the dynamically-created media queries.
*/
var /** @type {?} */ mediaQueryStyleNode;
/**
* A utility for calling matchMedia queries.
*/
var MediaMatcher = /** @class */ (function () {
function MediaMatcher(platform) {
this.platform = platform;
this._matchMedia = this.platform.isBrowser && window.matchMedia ?
// matchMedia is bound to the window scope intentionally as it is an illegal invocation to
// call it from a different scope.
window.matchMedia.bind(window) :
noopMatchMedia;
}
/**
* Evaluates the given media query and returns the native MediaQueryList from which results
* can be retrieved.
* Confirms the layout engine will trigger for the selector query provided and returns the
* MediaQueryList for the query provided.
*/
/**
* Evaluates the given media query and returns the native MediaQueryList from which results
* can be retrieved.
* Confirms the layout engine will trigger for the selector query provided and returns the
* MediaQueryList for the query provided.
* @param {?} query
* @return {?}
*/
MediaMatcher.prototype.matchMedia = /**
* Evaluates the given media query and returns the native MediaQueryList from which results
* can be retrieved.
* Confirms the layout engine will trigger for the selector query provided and returns the
* MediaQueryList for the query provided.
* @param {?} query
* @return {?}
*/
function (query) {
if (this.platform.WEBKIT) {
createEmptyStyleRule(query);
}
return this._matchMedia(query);
};
MediaMatcher.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
MediaMatcher.ctorParameters = function () { return [
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_1__["Platform"], },
]; };
/** @nocollapse */ MediaMatcher.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["defineInjectable"])({ factory: function MediaMatcher_Factory() { return new MediaMatcher(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_1__["Platform"])); }, token: MediaMatcher, providedIn: "root" });
return MediaMatcher;
}());
/**
* For Webkit engines that only trigger the MediaQueryListListener when
* there is at least one CSS selector for the respective media query.
* @param {?} query
* @return {?}
*/
function createEmptyStyleRule(query) {
if (mediaQueriesForWebkitCompatibility.has(query)) {
return;
}
try {
if (!mediaQueryStyleNode) {
mediaQueryStyleNode = document.createElement('style');
mediaQueryStyleNode.setAttribute('type', 'text/css');
document.head.appendChild(mediaQueryStyleNode);
}
if (mediaQueryStyleNode.sheet) {
(/** @type {?} */ (mediaQueryStyleNode.sheet))
.insertRule("@media " + query + " {.fx-query-test{ }}", 0);
mediaQueriesForWebkitCompatibility.add(query);
}
}
catch (/** @type {?} */ e) {
console.error(e);
}
}
/**
* No-op matchMedia replacement for non-browser platforms.
* @param {?} query
* @return {?}
*/
function noopMatchMedia(query) {
return {
matches: query === 'all' || query === '',
media: query,
addListener: function () { },
removeListener: function () { }
};
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Utility for checking the matching state of \@media queries.
*/
var BreakpointObserver = /** @class */ (function () {
function BreakpointObserver(mediaMatcher, zone) {
this.mediaMatcher = mediaMatcher;
this.zone = zone;
/**
* A map of all media queries currently being listened for.
*/
this._queries = new Map();
/**
* A subject for all other observables to takeUntil based on.
*/
this._destroySubject = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
}
/** Completes the active subject, signalling to all other observables to complete. */
/**
* Completes the active subject, signalling to all other observables to complete.
* @return {?}
*/
BreakpointObserver.prototype.ngOnDestroy = /**
* Completes the active subject, signalling to all other observables to complete.
* @return {?}
*/
function () {
this._destroySubject.next();
this._destroySubject.complete();
};
/**
* Whether one or more media queries match the current viewport size.
* @param value One or more media queries to check.
* @returns Whether any of the media queries match.
*/
/**
* Whether one or more media queries match the current viewport size.
* @param {?} value One or more media queries to check.
* @return {?} Whether any of the media queries match.
*/
BreakpointObserver.prototype.isMatched = /**
* Whether one or more media queries match the current viewport size.
* @param {?} value One or more media queries to check.
* @return {?} Whether any of the media queries match.
*/
function (value) {
var _this = this;
var /** @type {?} */ queries = splitQueries(Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__["coerceArray"])(value));
return queries.some(function (mediaQuery) { return _this._registerQuery(mediaQuery).mql.matches; });
};
/**
* Gets an observable of results for the given queries that will emit new results for any changes
* in matching of the given queries.
* @param value One or more media queries to check.
* @returns A stream of matches for the given queries.
*/
/**
* Gets an observable of results for the given queries that will emit new results for any changes
* in matching of the given queries.
* @param {?} value One or more media queries to check.
* @return {?} A stream of matches for the given queries.
*/
BreakpointObserver.prototype.observe = /**
* Gets an observable of results for the given queries that will emit new results for any changes
* in matching of the given queries.
* @param {?} value One or more media queries to check.
* @return {?} A stream of matches for the given queries.
*/
function (value) {
var _this = this;
var /** @type {?} */ queries = splitQueries(Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__["coerceArray"])(value));
var /** @type {?} */ observables = queries.map(function (query) { return _this._registerQuery(query).observable; });
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["combineLatest"])(observables).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (breakpointStates) {
return {
matches: breakpointStates.some(function (state) { return state && state.matches; })
};
}));
};
/**
* Registers a specific query to be listened for.
* @param {?} query
* @return {?}
*/
BreakpointObserver.prototype._registerQuery = /**
* Registers a specific query to be listened for.
* @param {?} query
* @return {?}
*/
function (query) {
var _this = this;
// Only set up a new MediaQueryList if it is not already being listened for.
if (this._queries.has(query)) {
return /** @type {?} */ ((this._queries.get(query)));
}
var /** @type {?} */ mql = this.mediaMatcher.matchMedia(query);
// Create callback for match changes and add it is as a listener.
var /** @type {?} */ queryObservable = Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["fromEventPattern"])(
// Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed
// back into the zone because matchMedia is only included in Zone.js by loading the
// webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not
// have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js
// patches it.
// Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed
// back into the zone because matchMedia is only included in Zone.js by loading the
// webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not
// have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js
// patches it.
function (listener) {
mql.addListener(function (e) { return _this.zone.run(function () { return listener(e); }); });
}, function (listener) {
mql.removeListener(function (e) { return _this.zone.run(function () { return listener(e); }); });
})
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(this._destroySubject), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["startWith"])(mql), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (nextMql) { return ({ matches: nextMql.matches }); }));
// Add the MediaQueryList to the set of queries.
var /** @type {?} */ output = { observable: queryObservable, mql: mql };
this._queries.set(query, output);
return output;
};
BreakpointObserver.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
BreakpointObserver.ctorParameters = function () { return [
{ type: MediaMatcher, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
]; };
/** @nocollapse */ BreakpointObserver.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["defineInjectable"])({ factory: function BreakpointObserver_Factory() { return new BreakpointObserver(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(MediaMatcher), Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"])); }, token: BreakpointObserver, providedIn: "root" });
return BreakpointObserver;
}());
/**
* Split each query string into separate query strings if two queries are provided as comma
* separated.
* @param {?} queries
* @return {?}
*/
function splitQueries(queries) {
return queries.map(function (query) { return query.split(','); })
.reduce(function (a1, a2) { return a1.concat(a2); })
.map(function (query) { return query.trim(); });
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ Breakpoints = {
XSmall: '(max-width: 599px)',
Small: '(min-width: 600px) and (max-width: 959px)',
Medium: '(min-width: 960px) and (max-width: 1279px)',
Large: '(min-width: 1280px) and (max-width: 1919px)',
XLarge: '(min-width: 1920px)',
Handset: '(max-width: 599px) and (orientation: portrait), ' +
'(max-width: 959px) and (orientation: landscape)',
Tablet: '(min-width: 600px) and (max-width: 839px) and (orientation: portrait), ' +
'(min-width: 960px) and (max-width: 1279px) and (orientation: landscape)',
Web: '(min-width: 840px) and (orientation: portrait), ' +
'(min-width: 1280px) and (orientation: landscape)',
HandsetPortrait: '(max-width: 599px) and (orientation: portrait)',
TabletPortrait: '(min-width: 600px) and (max-width: 839px) and (orientation: portrait)',
WebPortrait: '(min-width: 840px) and (orientation: portrait)',
HandsetLandscape: '(max-width: 959px) and (orientation: landscape)',
TabletLandscape: '(min-width: 960px) and (max-width: 1279px) and (orientation: landscape)',
WebLandscape: '(min-width: 1280px) and (orientation: landscape)',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=layout.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/observers.es5.js":
/*!*********************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/observers.es5.js ***!
\*********************************************************/
/*! exports provided: MutationObserverFactory, CdkObserveContent, ObserversModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MutationObserverFactory", function() { return MutationObserverFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkObserveContent", function() { return CdkObserveContent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserversModule", function() { return ObserversModule; });
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Factory that creates a new MutationObserver and allows us to stub it out in unit tests.
* \@docs-private
*/
var MutationObserverFactory = /** @class */ (function () {
function MutationObserverFactory() {
}
/**
* @param {?} callback
* @return {?}
*/
MutationObserverFactory.prototype.create = /**
* @param {?} callback
* @return {?}
*/
function (callback) {
return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
};
MutationObserverFactory.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */ MutationObserverFactory.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function MutationObserverFactory_Factory() { return new MutationObserverFactory(); }, token: MutationObserverFactory, providedIn: "root" });
return MutationObserverFactory;
}());
/**
* Directive that triggers a callback whenever the content of
* its associated element has changed.
*/
var CdkObserveContent = /** @class */ (function () {
function CdkObserveContent(_mutationObserverFactory, _elementRef, _ngZone) {
this._mutationObserverFactory = _mutationObserverFactory;
this._elementRef = _elementRef;
this._ngZone = _ngZone;
this._disabled = false;
/**
* Event emitted for each change in the element's content.
*/
this.event = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
/**
* Used for debouncing the emitted values to the observeContent event.
*/
this._debouncer = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
}
Object.defineProperty(CdkObserveContent.prototype, "disabled", {
get: /**
* Whether observing content is disabled. This option can be used
* to disconnect the underlying MutationObserver until it is needed.
* @return {?}
*/
function () { return this._disabled; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._disabled = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_0__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
CdkObserveContent.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
if (this.debounce > 0) {
this._ngZone.runOutsideAngular(function () {
_this._debouncer.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["debounceTime"])(_this.debounce))
.subscribe(function (mutations) { return _this.event.emit(mutations); });
});
}
else {
this._debouncer.subscribe(function (mutations) { return _this.event.emit(mutations); });
}
this._observer = this._ngZone.runOutsideAngular(function () {
return _this._mutationObserverFactory.create(function (mutations) {
_this._debouncer.next(mutations);
});
});
if (!this.disabled) {
this._enable();
}
};
/**
* @param {?} changes
* @return {?}
*/
CdkObserveContent.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes['disabled']) {
changes['disabled'].currentValue ? this._disable() : this._enable();
}
};
/**
* @return {?}
*/
CdkObserveContent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._disable();
this._debouncer.complete();
};
/**
* @return {?}
*/
CdkObserveContent.prototype._disable = /**
* @return {?}
*/
function () {
if (this._observer) {
this._observer.disconnect();
}
};
/**
* @return {?}
*/
CdkObserveContent.prototype._enable = /**
* @return {?}
*/
function () {
if (this._observer) {
this._observer.observe(this._elementRef.nativeElement, {
characterData: true,
childList: true,
subtree: true
});
}
};
CdkObserveContent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[cdkObserveContent]',
exportAs: 'cdkObserveContent',
},] },
];
/** @nocollapse */
CdkObserveContent.ctorParameters = function () { return [
{ type: MutationObserverFactory, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], },
]; };
CdkObserveContent.propDecorators = {
"event": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"], args: ['cdkObserveContent',] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['cdkObserveContentDisabled',] },],
"debounce": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
};
return CdkObserveContent;
}());
var ObserversModule = /** @class */ (function () {
function ObserversModule() {
}
ObserversModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
exports: [CdkObserveContent],
declarations: [CdkObserveContent],
providers: [MutationObserverFactory]
},] },
];
return ObserversModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=observers.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/overlay.es5.js":
/*!*******************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/overlay.es5.js ***!
\*******************************************************/
/*! exports provided: ViewportRuler, VIEWPORT_RULER_PROVIDER, CdkScrollable, ScrollDispatcher, Overlay, OverlayContainer, CdkOverlayOrigin, CdkConnectedOverlay, FullscreenOverlayContainer, OverlayRef, OverlayKeyboardDispatcher, OverlayPositionBuilder, GlobalPositionStrategy, ConnectedPositionStrategy, FlexibleConnectedPositionStrategy, OverlayConfig, ConnectionPositionPair, ScrollingVisibility, ConnectedOverlayPositionChange, validateVerticalPosition, validateHorizontalPosition, ScrollStrategyOptions, RepositionScrollStrategy, CloseScrollStrategy, NoopScrollStrategy, BlockScrollStrategy, OverlayModule, OVERLAY_PROVIDERS, ɵh, ɵg, ɵb, ɵa, ɵc, ɵd, ɵf, ɵe */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Overlay", function() { return Overlay; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayContainer", function() { return OverlayContainer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkOverlayOrigin", function() { return CdkOverlayOrigin; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkConnectedOverlay", function() { return CdkConnectedOverlay; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FullscreenOverlayContainer", function() { return FullscreenOverlayContainer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayRef", function() { return OverlayRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayKeyboardDispatcher", function() { return OverlayKeyboardDispatcher; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayPositionBuilder", function() { return OverlayPositionBuilder; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlobalPositionStrategy", function() { return GlobalPositionStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectedPositionStrategy", function() { return ConnectedPositionStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FlexibleConnectedPositionStrategy", function() { return FlexibleConnectedPositionStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayConfig", function() { return OverlayConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectionPositionPair", function() { return ConnectionPositionPair; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollingVisibility", function() { return ScrollingVisibility; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectedOverlayPositionChange", function() { return ConnectedOverlayPositionChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateVerticalPosition", function() { return validateVerticalPosition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateHorizontalPosition", function() { return validateHorizontalPosition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollStrategyOptions", function() { return ScrollStrategyOptions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepositionScrollStrategy", function() { return RepositionScrollStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CloseScrollStrategy", function() { return CloseScrollStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoopScrollStrategy", function() { return NoopScrollStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockScrollStrategy", function() { return BlockScrollStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayModule", function() { return OverlayModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OVERLAY_PROVIDERS", function() { return OVERLAY_PROVIDERS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵh", function() { return OVERLAY_KEYBOARD_DISPATCHER_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵg", function() { return OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵb", function() { return OVERLAY_CONTAINER_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵa", function() { return OVERLAY_CONTAINER_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵc", function() { return CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵd", function() { return CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵf", function() { return CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵe", function() { return CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/scrolling */ "./node_modules/@angular/cdk/esm5/scrolling.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewportRuler", function() { return _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["ViewportRuler"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VIEWPORT_RULER_PROVIDER", function() { return _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["VIEWPORT_RULER_PROVIDER"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CdkScrollable", function() { return _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["CdkScrollable"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ScrollDispatcher", function() { return _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["ScrollDispatcher"]; });
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/cdk/portal */ "./node_modules/@angular/cdk/esm5/portal.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Scroll strategy that doesn't do anything.
*/
var /**
* Scroll strategy that doesn't do anything.
*/
NoopScrollStrategy = /** @class */ (function () {
function NoopScrollStrategy() {
}
/** Does nothing, as this scroll strategy is a no-op. */
/**
* Does nothing, as this scroll strategy is a no-op.
* @return {?}
*/
NoopScrollStrategy.prototype.enable = /**
* Does nothing, as this scroll strategy is a no-op.
* @return {?}
*/
function () { };
/** Does nothing, as this scroll strategy is a no-op. */
/**
* Does nothing, as this scroll strategy is a no-op.
* @return {?}
*/
NoopScrollStrategy.prototype.disable = /**
* Does nothing, as this scroll strategy is a no-op.
* @return {?}
*/
function () { };
/** Does nothing, as this scroll strategy is a no-op. */
/**
* Does nothing, as this scroll strategy is a no-op.
* @return {?}
*/
NoopScrollStrategy.prototype.attach = /**
* Does nothing, as this scroll strategy is a no-op.
* @return {?}
*/
function () { };
return NoopScrollStrategy;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Initial configuration used when creating an overlay.
*/
var /**
* Initial configuration used when creating an overlay.
*/
OverlayConfig = /** @class */ (function () {
function OverlayConfig(config) {
var _this = this;
/**
* Strategy to be used when handling scroll events while the overlay is open.
*/
this.scrollStrategy = new NoopScrollStrategy();
/**
* Custom class to add to the overlay pane.
*/
this.panelClass = '';
/**
* Whether the overlay has a backdrop.
*/
this.hasBackdrop = false;
/**
* Custom class to add to the backdrop
*/
this.backdropClass = 'cdk-overlay-dark-backdrop';
if (config) {
Object.keys(config)
.filter(function (key) { return typeof config[key] !== 'undefined'; })
.forEach(function (key) { return _this[key] = config[key]; });
}
}
return OverlayConfig;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* The points of the origin element and the overlay element to connect.
*/
var /**
* The points of the origin element and the overlay element to connect.
*/
ConnectionPositionPair = /** @class */ (function () {
function ConnectionPositionPair(origin, overlay, offsetX, offsetY) {
this.offsetX = offsetX;
this.offsetY = offsetY;
this.originX = origin.originX;
this.originY = origin.originY;
this.overlayX = overlay.overlayX;
this.overlayY = overlay.overlayY;
}
return ConnectionPositionPair;
}());
/**
* Set of properties regarding the position of the origin and overlay relative to the viewport
* with respect to the containing Scrollable elements.
*
* The overlay and origin are clipped if any part of their bounding client rectangle exceeds the
* bounds of any one of the strategy's Scrollable's bounding client rectangle.
*
* The overlay and origin are outside view if there is no overlap between their bounding client
* rectangle and any one of the strategy's Scrollable's bounding client rectangle.
*
* ----------- -----------
* | outside | | clipped |
* | view | --------------------------
* | | | | | |
* ---------- | ----------- |
* -------------------------- | |
* | | | Scrollable |
* | | | |
* | | --------------------------
* | Scrollable |
* | |
* --------------------------
*
* \@docs-private
*/
var /**
* Set of properties regarding the position of the origin and overlay relative to the viewport
* with respect to the containing Scrollable elements.
*
* The overlay and origin are clipped if any part of their bounding client rectangle exceeds the
* bounds of any one of the strategy's Scrollable's bounding client rectangle.
*
* The overlay and origin are outside view if there is no overlap between their bounding client
* rectangle and any one of the strategy's Scrollable's bounding client rectangle.
*
* ----------- -----------
* | outside | | clipped |
* | view | --------------------------
* | | | | | |
* ---------- | ----------- |
* -------------------------- | |
* | | | Scrollable |
* | | | |
* | | --------------------------
* | Scrollable |
* | |
* --------------------------
*
* \@docs-private
*/
ScrollingVisibility = /** @class */ (function () {
function ScrollingVisibility() {
}
return ScrollingVisibility;
}());
/**
* The change event emitted by the strategy when a fallback position is used.
*/
var ConnectedOverlayPositionChange = /** @class */ (function () {
function ConnectedOverlayPositionChange(connectionPair, /** @docs-private */
scrollableViewProperties) {
this.connectionPair = connectionPair;
this.scrollableViewProperties = scrollableViewProperties;
}
/** @nocollapse */
ConnectedOverlayPositionChange.ctorParameters = function () { return [
{ type: ConnectionPositionPair, },
{ type: ScrollingVisibility, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
return ConnectedOverlayPositionChange;
}());
/**
* Validates whether a vertical position property matches the expected values.
* \@docs-private
* @param {?} property Name of the property being validated.
* @param {?} value Value of the property being validated.
* @return {?}
*/
function validateVerticalPosition(property, value) {
if (value !== 'top' && value !== 'bottom' && value !== 'center') {
throw Error("ConnectedPosition: Invalid " + property + " \"" + value + "\". " +
"Expected \"top\", \"bottom\" or \"center\".");
}
}
/**
* Validates whether a horizontal position property matches the expected values.
* \@docs-private
* @param {?} property Name of the property being validated.
* @param {?} value Value of the property being validated.
* @return {?}
*/
function validateHorizontalPosition(property, value) {
if (value !== 'start' && value !== 'end' && value !== 'center') {
throw Error("ConnectedPosition: Invalid " + property + " \"" + value + "\". " +
"Expected \"start\", \"end\" or \"center\".");
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Strategy that will prevent the user from scrolling while the overlay is visible.
*/
var /**
* Strategy that will prevent the user from scrolling while the overlay is visible.
*/
BlockScrollStrategy = /** @class */ (function () {
function BlockScrollStrategy(_viewportRuler, document) {
this._viewportRuler = _viewportRuler;
this._previousHTMLStyles = { top: '', left: '' };
this._isEnabled = false;
this._document = document;
}
/** Attaches this scroll strategy to an overlay. */
/**
* Attaches this scroll strategy to an overlay.
* @return {?}
*/
BlockScrollStrategy.prototype.attach = /**
* Attaches this scroll strategy to an overlay.
* @return {?}
*/
function () { };
/** Blocks page-level scroll while the attached overlay is open. */
/**
* Blocks page-level scroll while the attached overlay is open.
* @return {?}
*/
BlockScrollStrategy.prototype.enable = /**
* Blocks page-level scroll while the attached overlay is open.
* @return {?}
*/
function () {
if (this._canBeEnabled()) {
var /** @type {?} */ root = this._document.documentElement;
this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();
// Cache the previous inline styles in case the user had set them.
this._previousHTMLStyles.left = root.style.left || '';
this._previousHTMLStyles.top = root.style.top || '';
// Note: we're using the `html` node, instead of the `body`, because the `body` may
// have the user agent margin, whereas the `html` is guaranteed not to have one.
root.style.left = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(-this._previousScrollPosition.left);
root.style.top = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(-this._previousScrollPosition.top);
root.classList.add('cdk-global-scrollblock');
this._isEnabled = true;
}
};
/** Unblocks page-level scroll while the attached overlay is open. */
/**
* Unblocks page-level scroll while the attached overlay is open.
* @return {?}
*/
BlockScrollStrategy.prototype.disable = /**
* Unblocks page-level scroll while the attached overlay is open.
* @return {?}
*/
function () {
if (this._isEnabled) {
var /** @type {?} */ html = this._document.documentElement;
var /** @type {?} */ body = this._document.body;
var /** @type {?} */ previousHtmlScrollBehavior = html.style['scrollBehavior'] || '';
var /** @type {?} */ previousBodyScrollBehavior = body.style['scrollBehavior'] || '';
this._isEnabled = false;
html.style.left = this._previousHTMLStyles.left;
html.style.top = this._previousHTMLStyles.top;
html.classList.remove('cdk-global-scrollblock');
// Disable user-defined smooth scrolling temporarily while we restore the scroll position.
// See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior
html.style['scrollBehavior'] = body.style['scrollBehavior'] = 'auto';
window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);
html.style['scrollBehavior'] = previousHtmlScrollBehavior;
body.style['scrollBehavior'] = previousBodyScrollBehavior;
}
};
/**
* @return {?}
*/
BlockScrollStrategy.prototype._canBeEnabled = /**
* @return {?}
*/
function () {
// Since the scroll strategies can't be singletons, we have to use a global CSS class
// (`cdk-global-scrollblock`) to make sure that we don't try to disable global
// scrolling multiple times.
var /** @type {?} */ html = this._document.documentElement;
if (html.classList.contains('cdk-global-scrollblock') || this._isEnabled) {
return false;
}
var /** @type {?} */ body = this._document.body;
var /** @type {?} */ viewport = this._viewportRuler.getViewportSize();
return body.scrollHeight > viewport.height || body.scrollWidth > viewport.width;
};
return BlockScrollStrategy;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Returns an error to be thrown when attempting to attach an already-attached scroll strategy.
* @return {?}
*/
function getMatScrollStrategyAlreadyAttachedError() {
return Error("Scroll strategy has already been attached.");
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Strategy that will close the overlay as soon as the user starts scrolling.
*/
var /**
* Strategy that will close the overlay as soon as the user starts scrolling.
*/
CloseScrollStrategy = /** @class */ (function () {
function CloseScrollStrategy(_scrollDispatcher, _ngZone, _viewportRuler, _config) {
var _this = this;
this._scrollDispatcher = _scrollDispatcher;
this._ngZone = _ngZone;
this._viewportRuler = _viewportRuler;
this._config = _config;
this._scrollSubscription = null;
/**
* Detaches the overlay ref and disables the scroll strategy.
*/
this._detach = function () {
_this.disable();
if (_this._overlayRef.hasAttached()) {
_this._ngZone.run(function () { return _this._overlayRef.detach(); });
}
};
}
/** Attaches this scroll strategy to an overlay. */
/**
* Attaches this scroll strategy to an overlay.
* @param {?} overlayRef
* @return {?}
*/
CloseScrollStrategy.prototype.attach = /**
* Attaches this scroll strategy to an overlay.
* @param {?} overlayRef
* @return {?}
*/
function (overlayRef) {
if (this._overlayRef) {
throw getMatScrollStrategyAlreadyAttachedError();
}
this._overlayRef = overlayRef;
};
/** Enables the closing of the attached overlay on scroll. */
/**
* Enables the closing of the attached overlay on scroll.
* @return {?}
*/
CloseScrollStrategy.prototype.enable = /**
* Enables the closing of the attached overlay on scroll.
* @return {?}
*/
function () {
var _this = this;
if (this._scrollSubscription) {
return;
}
var /** @type {?} */ stream = this._scrollDispatcher.scrolled(0);
if (this._config && this._config.threshold && this._config.threshold > 1) {
this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;
this._scrollSubscription = stream.subscribe(function () {
var /** @type {?} */ scrollPosition = _this._viewportRuler.getViewportScrollPosition().top;
if (Math.abs(scrollPosition - _this._initialScrollPosition) > /** @type {?} */ ((/** @type {?} */ ((_this._config)).threshold))) {
_this._detach();
}
else {
_this._overlayRef.updatePosition();
}
});
}
else {
this._scrollSubscription = stream.subscribe(this._detach);
}
};
/** Disables the closing the attached overlay on scroll. */
/**
* Disables the closing the attached overlay on scroll.
* @return {?}
*/
CloseScrollStrategy.prototype.disable = /**
* Disables the closing the attached overlay on scroll.
* @return {?}
*/
function () {
if (this._scrollSubscription) {
this._scrollSubscription.unsubscribe();
this._scrollSubscription = null;
}
};
return CloseScrollStrategy;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
// TODO(jelbourn): move this to live with the rest of the scrolling code
// TODO(jelbourn): someday replace this with IntersectionObservers
/**
* Gets whether an element is scrolled outside of view by any of its parent scrolling containers.
* \@docs-private
* @param {?} element Dimensions of the element (from getBoundingClientRect)
* @param {?} scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect)
* @return {?} Whether the element is scrolled out of view
*/
function isElementScrolledOutsideView(element, scrollContainers) {
return scrollContainers.some(function (containerBounds) {
var /** @type {?} */ outsideAbove = element.bottom < containerBounds.top;
var /** @type {?} */ outsideBelow = element.top > containerBounds.bottom;
var /** @type {?} */ outsideLeft = element.right < containerBounds.left;
var /** @type {?} */ outsideRight = element.left > containerBounds.right;
return outsideAbove || outsideBelow || outsideLeft || outsideRight;
});
}
/**
* Gets whether an element is clipped by any of its scrolling containers.
* \@docs-private
* @param {?} element Dimensions of the element (from getBoundingClientRect)
* @param {?} scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect)
* @return {?} Whether the element is clipped
*/
function isElementClippedByScrolling(element, scrollContainers) {
return scrollContainers.some(function (scrollContainerRect) {
var /** @type {?} */ clippedAbove = element.top < scrollContainerRect.top;
var /** @type {?} */ clippedBelow = element.bottom > scrollContainerRect.bottom;
var /** @type {?} */ clippedLeft = element.left < scrollContainerRect.left;
var /** @type {?} */ clippedRight = element.right > scrollContainerRect.right;
return clippedAbove || clippedBelow || clippedLeft || clippedRight;
});
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Strategy that will update the element position as the user is scrolling.
*/
var /**
* Strategy that will update the element position as the user is scrolling.
*/
RepositionScrollStrategy = /** @class */ (function () {
function RepositionScrollStrategy(_scrollDispatcher, _viewportRuler, _ngZone, _config) {
this._scrollDispatcher = _scrollDispatcher;
this._viewportRuler = _viewportRuler;
this._ngZone = _ngZone;
this._config = _config;
this._scrollSubscription = null;
}
/** Attaches this scroll strategy to an overlay. */
/**
* Attaches this scroll strategy to an overlay.
* @param {?} overlayRef
* @return {?}
*/
RepositionScrollStrategy.prototype.attach = /**
* Attaches this scroll strategy to an overlay.
* @param {?} overlayRef
* @return {?}
*/
function (overlayRef) {
if (this._overlayRef) {
throw getMatScrollStrategyAlreadyAttachedError();
}
this._overlayRef = overlayRef;
};
/** Enables repositioning of the attached overlay on scroll. */
/**
* Enables repositioning of the attached overlay on scroll.
* @return {?}
*/
RepositionScrollStrategy.prototype.enable = /**
* Enables repositioning of the attached overlay on scroll.
* @return {?}
*/
function () {
var _this = this;
if (!this._scrollSubscription) {
var /** @type {?} */ throttle = this._config ? this._config.scrollThrottle : 0;
this._scrollSubscription = this._scrollDispatcher.scrolled(throttle).subscribe(function () {
_this._overlayRef.updatePosition();
// TODO(crisbeto): make `close` on by default once all components can handle it.
if (_this._config && _this._config.autoClose) {
var /** @type {?} */ overlayRect = _this._overlayRef.overlayElement.getBoundingClientRect();
var _a = _this._viewportRuler.getViewportSize(), width = _a.width, height = _a.height;
// TODO(crisbeto): include all ancestor scroll containers here once
// we have a way of exposing the trigger element to the scroll strategy.
var /** @type {?} */ parentRects = [{ width: width, height: height, bottom: height, right: width, top: 0, left: 0 }];
if (isElementScrolledOutsideView(overlayRect, parentRects)) {
_this.disable();
_this._ngZone.run(function () { return _this._overlayRef.detach(); });
}
}
});
}
};
/** Disables repositioning of the attached overlay on scroll. */
/**
* Disables repositioning of the attached overlay on scroll.
* @return {?}
*/
RepositionScrollStrategy.prototype.disable = /**
* Disables repositioning of the attached overlay on scroll.
* @return {?}
*/
function () {
if (this._scrollSubscription) {
this._scrollSubscription.unsubscribe();
this._scrollSubscription = null;
}
};
return RepositionScrollStrategy;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Options for how an overlay will handle scrolling.
*
* Users can provide a custom value for `ScrollStrategyOptions` to replace the default
* behaviors. This class primarily acts as a factory for ScrollStrategy instances.
*/
var ScrollStrategyOptions = /** @class */ (function () {
function ScrollStrategyOptions(_scrollDispatcher, _viewportRuler, _ngZone, document) {
var _this = this;
this._scrollDispatcher = _scrollDispatcher;
this._viewportRuler = _viewportRuler;
this._ngZone = _ngZone;
/**
* Do nothing on scroll.
*/
this.noop = function () { return new NoopScrollStrategy(); };
/**
* Close the overlay as soon as the user scrolls.
* @param config Configuration to be used inside the scroll strategy.
*/
this.close = function (config) {
return new CloseScrollStrategy(_this._scrollDispatcher, _this._ngZone, _this._viewportRuler, config);
};
/**
* Block scrolling.
*/
this.block = function () { return new BlockScrollStrategy(_this._viewportRuler, _this._document); };
/**
* Update the overlay's position on scroll.
* @param config Configuration to be used inside the scroll strategy.
* Allows debouncing the reposition calls.
*/
this.reposition = function (config) {
return new RepositionScrollStrategy(_this._scrollDispatcher, _this._viewportRuler, _this._ngZone, config);
};
this._document = document;
}
ScrollStrategyOptions.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
ScrollStrategyOptions.ctorParameters = function () { return [
{ type: _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["ScrollDispatcher"], },
{ type: _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["ViewportRuler"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"],] },] },
]; };
/** @nocollapse */ ScrollStrategyOptions.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["defineInjectable"])({ factory: function ScrollStrategyOptions_Factory() { return new ScrollStrategyOptions(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["ScrollDispatcher"]), Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["ViewportRuler"]), Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"]), Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"])); }, token: ScrollStrategyOptions, providedIn: "root" });
return ScrollStrategyOptions;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Service for dispatching keyboard events that land on the body to appropriate overlay ref,
* if any. It maintains a list of attached overlays to determine best suited overlay based
* on event target and order of overlay opens.
*/
var OverlayKeyboardDispatcher = /** @class */ (function () {
function OverlayKeyboardDispatcher(document) {
var _this = this;
/**
* Currently attached overlays in the order they were attached.
*/
this._attachedOverlays = [];
/**
* Keyboard event listener that will be attached to the body.
*/
this._keydownListener = function (event) {
if (_this._attachedOverlays.length) {
// Dispatch the keydown event to the top overlay. We want to target the most recent overlay,
// rather than trying to match where the event came from, because some components might open
// an overlay, but keep focus on a trigger element (e.g. for select and autocomplete).
// Dispatch the keydown event to the top overlay. We want to target the most recent overlay,
// rather than trying to match where the event came from, because some components might open
// an overlay, but keep focus on a trigger element (e.g. for select and autocomplete).
_this._attachedOverlays[_this._attachedOverlays.length - 1]._keydownEvents.next(event);
}
};
this._document = document;
}
/**
* @return {?}
*/
OverlayKeyboardDispatcher.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._detach();
};
/** Add a new overlay to the list of attached overlay refs. */
/**
* Add a new overlay to the list of attached overlay refs.
* @param {?} overlayRef
* @return {?}
*/
OverlayKeyboardDispatcher.prototype.add = /**
* Add a new overlay to the list of attached overlay refs.
* @param {?} overlayRef
* @return {?}
*/
function (overlayRef) {
// Lazily start dispatcher once first overlay is added
if (!this._isAttached) {
this._document.body.addEventListener('keydown', this._keydownListener, true);
this._isAttached = true;
}
this._attachedOverlays.push(overlayRef);
};
/** Remove an overlay from the list of attached overlay refs. */
/**
* Remove an overlay from the list of attached overlay refs.
* @param {?} overlayRef
* @return {?}
*/
OverlayKeyboardDispatcher.prototype.remove = /**
* Remove an overlay from the list of attached overlay refs.
* @param {?} overlayRef
* @return {?}
*/
function (overlayRef) {
var /** @type {?} */ index = this._attachedOverlays.indexOf(overlayRef);
if (index > -1) {
this._attachedOverlays.splice(index, 1);
}
// Remove the global listener once there are no more overlays.
if (this._attachedOverlays.length === 0) {
this._detach();
}
};
/**
* Detaches the global keyboard event listener.
* @return {?}
*/
OverlayKeyboardDispatcher.prototype._detach = /**
* Detaches the global keyboard event listener.
* @return {?}
*/
function () {
if (this._isAttached) {
this._document.body.removeEventListener('keydown', this._keydownListener, true);
this._isAttached = false;
}
};
OverlayKeyboardDispatcher.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
OverlayKeyboardDispatcher.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"],] },] },
]; };
/** @nocollapse */ OverlayKeyboardDispatcher.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["defineInjectable"])({ factory: function OverlayKeyboardDispatcher_Factory() { return new OverlayKeyboardDispatcher(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"])); }, token: OverlayKeyboardDispatcher, providedIn: "root" });
return OverlayKeyboardDispatcher;
}());
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
* @param {?} dispatcher
* @param {?} _document
* @return {?}
*/
function OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY(dispatcher, _document) {
return dispatcher || new OverlayKeyboardDispatcher(_document);
}
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
*/
var /** @type {?} */ OVERLAY_KEYBOARD_DISPATCHER_PROVIDER = {
// If there is already an OverlayKeyboardDispatcher available, use that.
// Otherwise, provide a new one.
provide: OverlayKeyboardDispatcher,
deps: [
[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"](), OverlayKeyboardDispatcher],
/** @type {?} */ (
// Coerce to `InjectionToken` so that the `deps` match the "shape"
// of the type expected by Angular
_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"])
],
useFactory: OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Container inside which all overlays will render.
*/
var OverlayContainer = /** @class */ (function () {
function OverlayContainer(_document) {
this._document = _document;
}
/**
* @return {?}
*/
OverlayContainer.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this._containerElement && this._containerElement.parentNode) {
this._containerElement.parentNode.removeChild(this._containerElement);
}
};
/**
* This method returns the overlay container element. It will lazily
* create the element the first time it is called to facilitate using
* the container in non-browser environments.
* @returns the container element
*/
/**
* This method returns the overlay container element. It will lazily
* create the element the first time it is called to facilitate using
* the container in non-browser environments.
* @return {?} the container element
*/
OverlayContainer.prototype.getContainerElement = /**
* This method returns the overlay container element. It will lazily
* create the element the first time it is called to facilitate using
* the container in non-browser environments.
* @return {?} the container element
*/
function () {
if (!this._containerElement) {
this._createContainer();
}
return this._containerElement;
};
/**
* Create the overlay container element, which is simply a div
* with the 'cdk-overlay-container' class on the document body.
*/
/**
* Create the overlay container element, which is simply a div
* with the 'cdk-overlay-container' class on the document body.
* @return {?}
*/
OverlayContainer.prototype._createContainer = /**
* Create the overlay container element, which is simply a div
* with the 'cdk-overlay-container' class on the document body.
* @return {?}
*/
function () {
var /** @type {?} */ container = this._document.createElement('div');
container.classList.add('cdk-overlay-container');
this._document.body.appendChild(container);
this._containerElement = container;
};
OverlayContainer.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
OverlayContainer.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"],] },] },
]; };
/** @nocollapse */ OverlayContainer.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["defineInjectable"])({ factory: function OverlayContainer_Factory() { return new OverlayContainer(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"])); }, token: OverlayContainer, providedIn: "root" });
return OverlayContainer;
}());
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
* @param {?} parentContainer
* @param {?} _document
* @return {?}
*/
function OVERLAY_CONTAINER_PROVIDER_FACTORY(parentContainer, _document) {
return parentContainer || new OverlayContainer(_document);
}
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
*/
var /** @type {?} */ OVERLAY_CONTAINER_PROVIDER = {
// If there is already an OverlayContainer available, use that. Otherwise, provide a new one.
provide: OverlayContainer,
deps: [
[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"](), OverlayContainer],
/** @type {?} */ (_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"] // We need to use the InjectionToken somewhere to keep TS happy
) // We need to use the InjectionToken somewhere to keep TS happy
],
useFactory: OVERLAY_CONTAINER_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Reference to an overlay that has been created with the Overlay service.
* Used to manipulate or dispose of said overlay.
*/
var /**
* Reference to an overlay that has been created with the Overlay service.
* Used to manipulate or dispose of said overlay.
*/
OverlayRef = /** @class */ (function () {
function OverlayRef(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document) {
this._portalOutlet = _portalOutlet;
this._host = _host;
this._pane = _pane;
this._config = _config;
this._ngZone = _ngZone;
this._keyboardDispatcher = _keyboardDispatcher;
this._document = _document;
this._backdropElement = null;
this._backdropClick = new rxjs__WEBPACK_IMPORTED_MODULE_5__["Subject"]();
this._attachments = new rxjs__WEBPACK_IMPORTED_MODULE_5__["Subject"]();
this._detachments = new rxjs__WEBPACK_IMPORTED_MODULE_5__["Subject"]();
/**
* Stream of keydown events dispatched to this overlay.
*/
this._keydownEvents = new rxjs__WEBPACK_IMPORTED_MODULE_5__["Subject"]();
if (_config.scrollStrategy) {
_config.scrollStrategy.attach(this);
}
}
Object.defineProperty(OverlayRef.prototype, "overlayElement", {
/** The overlay's HTML element */
get: /**
* The overlay's HTML element
* @return {?}
*/
function () {
return this._pane;
},
enumerable: true,
configurable: true
});
Object.defineProperty(OverlayRef.prototype, "backdropElement", {
/** The overlay's backdrop HTML element. */
get: /**
* The overlay's backdrop HTML element.
* @return {?}
*/
function () {
return this._backdropElement;
},
enumerable: true,
configurable: true
});
Object.defineProperty(OverlayRef.prototype, "hostElement", {
/**
* Wrapper around the panel element. Can be used for advanced
* positioning where a wrapper with specific styling is
* required around the overlay pane.
*/
get: /**
* Wrapper around the panel element. Can be used for advanced
* positioning where a wrapper with specific styling is
* required around the overlay pane.
* @return {?}
*/
function () {
return this._host;
},
enumerable: true,
configurable: true
});
/**
* Attaches content, given via a Portal, to the overlay.
* If the overlay is configured to have a backdrop, it will be created.
*
* @param portal Portal instance to which to attach the overlay.
* @returns The portal attachment result.
*/
/**
* Attaches content, given via a Portal, to the overlay.
* If the overlay is configured to have a backdrop, it will be created.
*
* @param {?} portal Portal instance to which to attach the overlay.
* @return {?} The portal attachment result.
*/
OverlayRef.prototype.attach = /**
* Attaches content, given via a Portal, to the overlay.
* If the overlay is configured to have a backdrop, it will be created.
*
* @param {?} portal Portal instance to which to attach the overlay.
* @return {?} The portal attachment result.
*/
function (portal) {
var _this = this;
var /** @type {?} */ attachResult = this._portalOutlet.attach(portal);
if (this._config.positionStrategy) {
this._config.positionStrategy.attach(this);
}
// Update the pane element with the given configuration.
this._updateStackingOrder();
this._updateElementSize();
this._updateElementDirection();
if (this._config.scrollStrategy) {
this._config.scrollStrategy.enable();
}
// Update the position once the zone is stable so that the overlay will be fully rendered
// before attempting to position it, as the position may depend on the size of the rendered
// content.
this._ngZone.onStable
.asObservable()
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["take"])(1))
.subscribe(function () {
// The overlay could've been detached before the zone has stabilized.
if (_this.hasAttached()) {
_this.updatePosition();
}
});
// Enable pointer events for the overlay pane element.
this._togglePointerEvents(true);
if (this._config.hasBackdrop) {
this._attachBackdrop();
}
if (this._config.panelClass) {
this._toggleClasses(this._pane, this._config.panelClass, true);
}
// Only emit the `attachments` event once all other setup is done.
this._attachments.next();
// Track this overlay by the keyboard dispatcher
this._keyboardDispatcher.add(this);
return attachResult;
};
/**
* Detaches an overlay from a portal.
* @returns The portal detachment result.
*/
/**
* Detaches an overlay from a portal.
* @return {?} The portal detachment result.
*/
OverlayRef.prototype.detach = /**
* Detaches an overlay from a portal.
* @return {?} The portal detachment result.
*/
function () {
if (!this.hasAttached()) {
return;
}
this.detachBackdrop();
// When the overlay is detached, the pane element should disable pointer events.
// This is necessary because otherwise the pane element will cover the page and disable
// pointer events therefore. Depends on the position strategy and the applied pane boundaries.
this._togglePointerEvents(false);
if (this._config.positionStrategy && this._config.positionStrategy.detach) {
this._config.positionStrategy.detach();
}
if (this._config.scrollStrategy) {
this._config.scrollStrategy.disable();
}
var /** @type {?} */ detachmentResult = this._portalOutlet.detach();
// Only emit after everything is detached.
this._detachments.next();
// Remove this overlay from keyboard dispatcher tracking
this._keyboardDispatcher.remove(this);
return detachmentResult;
};
/** Cleans up the overlay from the DOM. */
/**
* Cleans up the overlay from the DOM.
* @return {?}
*/
OverlayRef.prototype.dispose = /**
* Cleans up the overlay from the DOM.
* @return {?}
*/
function () {
var /** @type {?} */ isAttached = this.hasAttached();
if (this._config.positionStrategy) {
this._config.positionStrategy.dispose();
}
if (this._config.scrollStrategy) {
this._config.scrollStrategy.disable();
}
this.detachBackdrop();
this._keyboardDispatcher.remove(this);
this._portalOutlet.dispose();
this._attachments.complete();
this._backdropClick.complete();
this._keydownEvents.complete();
if (this._host && this._host.parentNode) {
this._host.parentNode.removeChild(this._host);
this._host = /** @type {?} */ ((null));
}
this._pane = /** @type {?} */ ((null));
if (isAttached) {
this._detachments.next();
}
this._detachments.complete();
};
/** Whether the overlay has attached content. */
/**
* Whether the overlay has attached content.
* @return {?}
*/
OverlayRef.prototype.hasAttached = /**
* Whether the overlay has attached content.
* @return {?}
*/
function () {
return this._portalOutlet.hasAttached();
};
/** Gets an observable that emits when the backdrop has been clicked. */
/**
* Gets an observable that emits when the backdrop has been clicked.
* @return {?}
*/
OverlayRef.prototype.backdropClick = /**
* Gets an observable that emits when the backdrop has been clicked.
* @return {?}
*/
function () {
return this._backdropClick.asObservable();
};
/** Gets an observable that emits when the overlay has been attached. */
/**
* Gets an observable that emits when the overlay has been attached.
* @return {?}
*/
OverlayRef.prototype.attachments = /**
* Gets an observable that emits when the overlay has been attached.
* @return {?}
*/
function () {
return this._attachments.asObservable();
};
/** Gets an observable that emits when the overlay has been detached. */
/**
* Gets an observable that emits when the overlay has been detached.
* @return {?}
*/
OverlayRef.prototype.detachments = /**
* Gets an observable that emits when the overlay has been detached.
* @return {?}
*/
function () {
return this._detachments.asObservable();
};
/** Gets an observable of keydown events targeted to this overlay. */
/**
* Gets an observable of keydown events targeted to this overlay.
* @return {?}
*/
OverlayRef.prototype.keydownEvents = /**
* Gets an observable of keydown events targeted to this overlay.
* @return {?}
*/
function () {
return this._keydownEvents.asObservable();
};
/** Gets the the current overlay configuration, which is immutable. */
/**
* Gets the the current overlay configuration, which is immutable.
* @return {?}
*/
OverlayRef.prototype.getConfig = /**
* Gets the the current overlay configuration, which is immutable.
* @return {?}
*/
function () {
return this._config;
};
/** Updates the position of the overlay based on the position strategy. */
/**
* Updates the position of the overlay based on the position strategy.
* @return {?}
*/
OverlayRef.prototype.updatePosition = /**
* Updates the position of the overlay based on the position strategy.
* @return {?}
*/
function () {
if (this._config.positionStrategy) {
this._config.positionStrategy.apply();
}
};
/** Update the size properties of the overlay. */
/**
* Update the size properties of the overlay.
* @param {?} sizeConfig
* @return {?}
*/
OverlayRef.prototype.updateSize = /**
* Update the size properties of the overlay.
* @param {?} sizeConfig
* @return {?}
*/
function (sizeConfig) {
this._config = Object(tslib__WEBPACK_IMPORTED_MODULE_4__["__assign"])({}, this._config, sizeConfig);
this._updateElementSize();
};
/** Sets the LTR/RTL direction for the overlay. */
/**
* Sets the LTR/RTL direction for the overlay.
* @param {?} dir
* @return {?}
*/
OverlayRef.prototype.setDirection = /**
* Sets the LTR/RTL direction for the overlay.
* @param {?} dir
* @return {?}
*/
function (dir) {
this._config = Object(tslib__WEBPACK_IMPORTED_MODULE_4__["__assign"])({}, this._config, { direction: dir });
this._updateElementDirection();
};
/**
* Updates the text direction of the overlay panel.
* @return {?}
*/
OverlayRef.prototype._updateElementDirection = /**
* Updates the text direction of the overlay panel.
* @return {?}
*/
function () {
this._pane.setAttribute('dir', /** @type {?} */ ((this._config.direction)));
};
/**
* Updates the size of the overlay element based on the overlay config.
* @return {?}
*/
OverlayRef.prototype._updateElementSize = /**
* Updates the size of the overlay element based on the overlay config.
* @return {?}
*/
function () {
if (this._config.width || this._config.width === 0) {
this._pane.style.width = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(this._config.width);
}
if (this._config.height || this._config.height === 0) {
this._pane.style.height = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(this._config.height);
}
if (this._config.minWidth || this._config.minWidth === 0) {
this._pane.style.minWidth = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(this._config.minWidth);
}
if (this._config.minHeight || this._config.minHeight === 0) {
this._pane.style.minHeight = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(this._config.minHeight);
}
if (this._config.maxWidth || this._config.maxWidth === 0) {
this._pane.style.maxWidth = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(this._config.maxWidth);
}
if (this._config.maxHeight || this._config.maxHeight === 0) {
this._pane.style.maxHeight = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(this._config.maxHeight);
}
};
/**
* Toggles the pointer events for the overlay pane element.
* @param {?} enablePointer
* @return {?}
*/
OverlayRef.prototype._togglePointerEvents = /**
* Toggles the pointer events for the overlay pane element.
* @param {?} enablePointer
* @return {?}
*/
function (enablePointer) {
this._pane.style.pointerEvents = enablePointer ? 'auto' : 'none';
};
/**
* Attaches a backdrop for this overlay.
* @return {?}
*/
OverlayRef.prototype._attachBackdrop = /**
* Attaches a backdrop for this overlay.
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ showingClass = 'cdk-overlay-backdrop-showing';
this._backdropElement = this._document.createElement('div');
this._backdropElement.classList.add('cdk-overlay-backdrop');
if (this._config.backdropClass) {
this._toggleClasses(this._backdropElement, this._config.backdropClass, true);
} /** @type {?} */
((
// Insert the backdrop before the pane in the DOM order,
// in order to handle stacked overlays properly.
this._host.parentElement)).insertBefore(this._backdropElement, this._host);
// Forward backdrop clicks such that the consumer of the overlay can perform whatever
// action desired when such a click occurs (usually closing the overlay).
this._backdropElement.addEventListener('click', function (event) { return _this._backdropClick.next(event); });
// Add class to fade-in the backdrop after one frame.
if (typeof requestAnimationFrame !== 'undefined') {
this._ngZone.runOutsideAngular(function () {
requestAnimationFrame(function () {
if (_this._backdropElement) {
_this._backdropElement.classList.add(showingClass);
}
});
});
}
else {
this._backdropElement.classList.add(showingClass);
}
};
/**
* Updates the stacking order of the element, moving it to the top if necessary.
* This is required in cases where one overlay was detached, while another one,
* that should be behind it, was destroyed. The next time both of them are opened,
* the stacking will be wrong, because the detached element's pane will still be
* in its original DOM position.
* @return {?}
*/
OverlayRef.prototype._updateStackingOrder = /**
* Updates the stacking order of the element, moving it to the top if necessary.
* This is required in cases where one overlay was detached, while another one,
* that should be behind it, was destroyed. The next time both of them are opened,
* the stacking will be wrong, because the detached element's pane will still be
* in its original DOM position.
* @return {?}
*/
function () {
if (this._host.nextSibling) {
/** @type {?} */ ((this._host.parentNode)).appendChild(this._host);
}
};
/** Detaches the backdrop (if any) associated with the overlay. */
/**
* Detaches the backdrop (if any) associated with the overlay.
* @return {?}
*/
OverlayRef.prototype.detachBackdrop = /**
* Detaches the backdrop (if any) associated with the overlay.
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ backdropToDetach = this._backdropElement;
if (backdropToDetach) {
var /** @type {?} */ finishDetach_1 = function () {
// It may not be attached to anything in certain cases (e.g. unit tests).
if (backdropToDetach && backdropToDetach.parentNode) {
backdropToDetach.parentNode.removeChild(backdropToDetach);
}
// It is possible that a new portal has been attached to this overlay since we started
// removing the backdrop. If that is the case, only clear the backdrop reference if it
// is still the same instance that we started to remove.
if (_this._backdropElement == backdropToDetach) {
_this._backdropElement = null;
}
};
backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');
if (this._config.backdropClass) {
this._toggleClasses(backdropToDetach, this._config.backdropClass, false);
}
backdropToDetach.addEventListener('transitionend', finishDetach_1);
// If the backdrop doesn't have a transition, the `transitionend` event won't fire.
// In this case we make it unclickable and we try to remove it after a delay.
backdropToDetach.style.pointerEvents = 'none';
// Run this outside the Angular zone because there's nothing that Angular cares about.
// If it were to run inside the Angular zone, every test that used Overlay would have to be
// either async or fakeAsync.
this._ngZone.runOutsideAngular(function () { return setTimeout(finishDetach_1, 500); });
}
};
/**
* Toggles a single CSS class or an array of classes on an element.
* @param {?} element
* @param {?} cssClasses
* @param {?} isAdd
* @return {?}
*/
OverlayRef.prototype._toggleClasses = /**
* Toggles a single CSS class or an array of classes on an element.
* @param {?} element
* @param {?} cssClasses
* @param {?} isAdd
* @return {?}
*/
function (element, cssClasses, isAdd) {
var /** @type {?} */ classList = element.classList;
Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceArray"])(cssClasses).forEach(function (cssClass) {
// We can't do a spread here, because IE doesn't support setting multiple classes.
isAdd ? classList.add(cssClass) : classList.remove(cssClass);
});
};
return OverlayRef;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* A strategy for positioning overlays. Using this strategy, an overlay is given an
* implicit position relative some origin element. The relative position is defined in terms of
* a point on the origin element that is connected to a point on the overlay element. For example,
* a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner
* of the overlay.
*/
var /**
* A strategy for positioning overlays. Using this strategy, an overlay is given an
* implicit position relative some origin element. The relative position is defined in terms of
* a point on the origin element that is connected to a point on the overlay element. For example,
* a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner
* of the overlay.
*/
FlexibleConnectedPositionStrategy = /** @class */ (function () {
function FlexibleConnectedPositionStrategy(_connectedTo, _viewportRuler, _document, _platform) {
this._connectedTo = _connectedTo;
this._viewportRuler = _viewportRuler;
this._document = _document;
this._platform = _platform;
/**
* Whether we're performing the very first positioning of the overlay.
*/
this._isInitialRender = true;
/**
* Last size used for the bounding box. Used to avoid resizing the overlay after open.
*/
this._lastBoundingBoxSize = { width: 0, height: 0 };
/**
* Whether the overlay was pushed in a previous positioning.
*/
this._isPushed = false;
/**
* Whether the overlay can be pushed on-screen on the initial open.
*/
this._canPush = true;
/**
* Whether the overlay can grow via flexible width/height after the initial open.
*/
this._growAfterOpen = false;
/**
* Whether the overlay's width and height can be constrained to fit within the viewport.
*/
this._hasFlexibleDimensions = true;
/**
* Whether the overlay position is locked.
*/
this._positionLocked = false;
/**
* Amount of space that must be maintained between the overlay and the edge of the viewport.
*/
this._viewportMargin = 0;
/**
* The Scrollable containers used to check scrollable view properties on position change.
*/
this.scrollables = [];
/**
* Ordered list of preferred positions, from most to least desirable.
*/
this._preferredPositions = [];
/**
* Subject that emits whenever the position changes.
*/
this._positionChanges = new rxjs__WEBPACK_IMPORTED_MODULE_5__["Subject"]();
/**
* Subscription to viewport size changes.
*/
this._resizeSubscription = rxjs__WEBPACK_IMPORTED_MODULE_5__["Subscription"].EMPTY;
/**
* Default offset for the overlay along the x axis.
*/
this._offsetX = 0;
/**
* Default offset for the overlay along the y axis.
*/
this._offsetY = 0;
/**
* Observable sequence of position changes.
*/
this.positionChanges = this._positionChanges.asObservable();
this._origin = this._connectedTo.nativeElement;
}
Object.defineProperty(FlexibleConnectedPositionStrategy.prototype, "positions", {
/** Ordered list of preferred positions, from most to least desirable. */
get: /**
* Ordered list of preferred positions, from most to least desirable.
* @return {?}
*/
function () {
return this._preferredPositions;
},
enumerable: true,
configurable: true
});
/** Attaches this position strategy to an overlay. */
/**
* Attaches this position strategy to an overlay.
* @param {?} overlayRef
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.attach = /**
* Attaches this position strategy to an overlay.
* @param {?} overlayRef
* @return {?}
*/
function (overlayRef) {
var _this = this;
if (this._overlayRef && overlayRef !== this._overlayRef) {
throw Error('This position strategy is already attached to an overlay');
}
this._validatePositions();
overlayRef.hostElement.classList.add('cdk-overlay-connected-position-bounding-box');
this._overlayRef = overlayRef;
this._boundingBox = /** @type {?} */ ((overlayRef.hostElement));
this._pane = overlayRef.overlayElement;
this._resizeSubscription.unsubscribe();
this._resizeSubscription = this._viewportRuler.change().subscribe(function () { return _this.apply(); });
};
/**
* Updates the position of the overlay element, using whichever preferred position relative
* to the origin best fits on-screen.
*
* The selection of a position goes as follows:
* - If any positions fit completely within the viewport as-is,
* choose the first position that does so.
* - If flexible dimensions are enabled and at least one satifies the given minimum width/height,
* choose the position with the greatest available size modified by the positions' weight.
* - If pushing is enabled, take the position that went off-screen the least and push it
* on-screen.
* - If none of the previous criteria were met, use the position that goes off-screen the least.
* @docs-private
*/
/**
* Updates the position of the overlay element, using whichever preferred position relative
* to the origin best fits on-screen.
*
* The selection of a position goes as follows:
* - If any positions fit completely within the viewport as-is,
* choose the first position that does so.
* - If flexible dimensions are enabled and at least one satifies the given minimum width/height,
* choose the position with the greatest available size modified by the positions' weight.
* - If pushing is enabled, take the position that went off-screen the least and push it
* on-screen.
* - If none of the previous criteria were met, use the position that goes off-screen the least.
* \@docs-private
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.apply = /**
* Updates the position of the overlay element, using whichever preferred position relative
* to the origin best fits on-screen.
*
* The selection of a position goes as follows:
* - If any positions fit completely within the viewport as-is,
* choose the first position that does so.
* - If flexible dimensions are enabled and at least one satifies the given minimum width/height,
* choose the position with the greatest available size modified by the positions' weight.
* - If pushing is enabled, take the position that went off-screen the least and push it
* on-screen.
* - If none of the previous criteria were met, use the position that goes off-screen the least.
* \@docs-private
* @return {?}
*/
function () {
// We shouldn't do anything if the strategy was disposed or we're on the server.
if (this._isDisposed || (this._platform && !this._platform.isBrowser)) {
return;
}
// If the position has been applied already (e.g. when the overlay was opened) and the
// consumer opted into locking in the position, re-use the old position, in order to
// prevent the overlay from jumping around.
if (!this._isInitialRender && this._positionLocked && this._lastPosition) {
this.reapplyLastPosition();
return;
}
this._resetOverlayElementStyles();
this._resetBoundingBoxStyles();
// We need the bounding rects for the origin and the overlay to determine how to position
// the overlay relative to the origin.
// We use the viewport rect to determine whether a position would go off-screen.
this._viewportRect = this._getNarrowedViewportRect();
this._originRect = this._origin.getBoundingClientRect();
this._overlayRect = this._pane.getBoundingClientRect();
var /** @type {?} */ originRect = this._originRect;
var /** @type {?} */ overlayRect = this._overlayRect;
var /** @type {?} */ viewportRect = this._viewportRect;
// Positions where the overlay will fit with flexible dimensions.
var /** @type {?} */ flexibleFits = [];
// Fallback if none of the preferred positions fit within the viewport.
var /** @type {?} */ fallback;
// Go through each of the preferred positions looking for a good fit.
// If a good fit is found, it will be applied immediately.
for (var _i = 0, _a = this._preferredPositions; _i < _a.length; _i++) {
var pos = _a[_i];
// Get the exact (x, y) coordinate for the point-of-origin on the origin element.
var /** @type {?} */ originPoint = this._getOriginPoint(originRect, pos);
// From that point-of-origin, get the exact (x, y) coordinate for the top-left corner of the
// overlay in this position. We use the top-left corner for calculations and later translate
// this into an appropriate (top, left, bottom, right) style.
var /** @type {?} */ overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos);
// Calculate how well the overlay would fit into the viewport with this point.
var /** @type {?} */ overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);
// If the overlay, without any further work, fits into the viewport, use this position.
if (overlayFit.isCompletelyWithinViewport) {
this._isPushed = false;
this._applyPosition(pos, originPoint);
return;
}
// If the overlay has flexible dimensions, we can use this position
// so long as there's enough space for the minimum dimensions.
if (this._canFitWithFlexibleDimensions(overlayFit, overlayPoint, viewportRect)) {
// Save positions where the overlay will fit with flexible dimensions. We will use these
// if none of the positions fit *without* flexible dimensions.
flexibleFits.push({
position: pos,
origin: originPoint,
overlayRect: overlayRect,
boundingBoxRect: this._calculateBoundingBoxRect(originPoint, pos)
});
continue;
}
// If the current preferred position does not fit on the screen, remember the position
// if it has more visible area on-screen than we've seen and move onto the next preferred
// position.
if (!fallback || fallback.overlayFit.visibleArea < overlayFit.visibleArea) {
fallback = { overlayFit: overlayFit, overlayPoint: overlayPoint, originPoint: originPoint, position: pos, overlayRect: overlayRect };
}
}
// If there are any positions where the overlay would fit with flexible dimensions, choose the
// one that has the greatest area available modified by the position's weight
if (flexibleFits.length) {
var /** @type {?} */ bestFit = null;
var /** @type {?} */ bestScore = -1;
for (var _b = 0, flexibleFits_1 = flexibleFits; _b < flexibleFits_1.length; _b++) {
var fit_1 = flexibleFits_1[_b];
var /** @type {?} */ score = fit_1.boundingBoxRect.width * fit_1.boundingBoxRect.height * (fit_1.position.weight || 1);
if (score > bestScore) {
bestScore = score;
bestFit = fit_1;
}
}
this._isPushed = false;
this._applyPosition(/** @type {?} */ ((bestFit)).position, /** @type {?} */ ((bestFit)).origin);
return;
}
// When none of the preferred positions fit within the viewport, take the position
// that went off-screen the least and attempt to push it on-screen.
if (this._canPush) {
// TODO(jelbourn): after pushing, the opening "direction" of the overlay might not make sense.
this._isPushed = true;
this._applyPosition(/** @type {?} */ ((fallback)).position, /** @type {?} */ ((fallback)).originPoint);
return;
}
// All options for getting the overlay within the viewport have been exhausted, so go with the
// position that went off-screen the least.
this._applyPosition(/** @type {?} */ ((fallback)).position, /** @type {?} */ ((fallback)).originPoint);
};
/**
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.detach = /**
* @return {?}
*/
function () {
this._resizeSubscription.unsubscribe();
};
/** Cleanup after the element gets destroyed. */
/**
* Cleanup after the element gets destroyed.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.dispose = /**
* Cleanup after the element gets destroyed.
* @return {?}
*/
function () {
if (!this._isDisposed) {
this.detach();
this._boundingBox = null;
this._positionChanges.complete();
this._isDisposed = true;
}
};
/**
* This re-aligns the overlay element with the trigger in its last calculated position,
* even if a position higher in the "preferred positions" list would now fit. This
* allows one to re-align the panel without changing the orientation of the panel.
*/
/**
* This re-aligns the overlay element with the trigger in its last calculated position,
* even if a position higher in the "preferred positions" list would now fit. This
* allows one to re-align the panel without changing the orientation of the panel.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.reapplyLastPosition = /**
* This re-aligns the overlay element with the trigger in its last calculated position,
* even if a position higher in the "preferred positions" list would now fit. This
* allows one to re-align the panel without changing the orientation of the panel.
* @return {?}
*/
function () {
if (!this._isDisposed && (!this._platform || this._platform.isBrowser)) {
this._originRect = this._origin.getBoundingClientRect();
this._overlayRect = this._pane.getBoundingClientRect();
this._viewportRect = this._getNarrowedViewportRect();
var /** @type {?} */ lastPosition = this._lastPosition || this._preferredPositions[0];
var /** @type {?} */ originPoint = this._getOriginPoint(this._originRect, lastPosition);
this._applyPosition(lastPosition, originPoint);
}
};
/**
* Sets the list of Scrollable containers that host the origin element so that
* on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
* Scrollable must be an ancestor element of the strategy's origin element.
*/
/**
* Sets the list of Scrollable containers that host the origin element so that
* on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
* Scrollable must be an ancestor element of the strategy's origin element.
* @param {?} scrollables
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.withScrollableContainers = /**
* Sets the list of Scrollable containers that host the origin element so that
* on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
* Scrollable must be an ancestor element of the strategy's origin element.
* @param {?} scrollables
* @return {?}
*/
function (scrollables) {
this.scrollables = scrollables;
};
/**
* Adds new preferred positions.
* @param positions List of positions options for this overlay.
*/
/**
* Adds new preferred positions.
* @param {?} positions List of positions options for this overlay.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.withPositions = /**
* Adds new preferred positions.
* @param {?} positions List of positions options for this overlay.
* @return {?}
*/
function (positions) {
this._preferredPositions = positions;
// If the last calculated position object isn't part of the positions anymore, clear
// it in order to avoid it being picked up if the consumer tries to re-apply.
if (positions.indexOf(/** @type {?} */ ((this._lastPosition))) === -1) {
this._lastPosition = null;
}
this._validatePositions();
return this;
};
/**
* Sets a minimum distance the overlay may be positioned to the edge of the viewport.
* @param margin Required margin between the overlay and the viewport edge in pixels.
*/
/**
* Sets a minimum distance the overlay may be positioned to the edge of the viewport.
* @param {?} margin Required margin between the overlay and the viewport edge in pixels.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.withViewportMargin = /**
* Sets a minimum distance the overlay may be positioned to the edge of the viewport.
* @param {?} margin Required margin between the overlay and the viewport edge in pixels.
* @return {?}
*/
function (margin) {
this._viewportMargin = margin;
return this;
};
/** Sets whether the overlay's width and height can be constrained to fit within the viewport. */
/**
* Sets whether the overlay's width and height can be constrained to fit within the viewport.
* @param {?=} flexibleDimensions
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.withFlexibleDimensions = /**
* Sets whether the overlay's width and height can be constrained to fit within the viewport.
* @param {?=} flexibleDimensions
* @return {?}
*/
function (flexibleDimensions) {
if (flexibleDimensions === void 0) { flexibleDimensions = true; }
this._hasFlexibleDimensions = flexibleDimensions;
return this;
};
/** Sets whether the overlay can grow after the initial open via flexible width/height. */
/**
* Sets whether the overlay can grow after the initial open via flexible width/height.
* @param {?=} growAfterOpen
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.withGrowAfterOpen = /**
* Sets whether the overlay can grow after the initial open via flexible width/height.
* @param {?=} growAfterOpen
* @return {?}
*/
function (growAfterOpen) {
if (growAfterOpen === void 0) { growAfterOpen = true; }
this._growAfterOpen = growAfterOpen;
return this;
};
/** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */
/**
* Sets whether the overlay can be pushed on-screen if none of the provided positions fit.
* @param {?=} canPush
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.withPush = /**
* Sets whether the overlay can be pushed on-screen if none of the provided positions fit.
* @param {?=} canPush
* @return {?}
*/
function (canPush) {
if (canPush === void 0) { canPush = true; }
this._canPush = canPush;
return this;
};
/**
* Sets whether the overlay's position should be locked in after it is positioned
* initially. When an overlay is locked in, it won't attempt to reposition itself
* when the position is re-applied (e.g. when the user scrolls away).
* @param isLocked Whether the overlay should locked in.
*/
/**
* Sets whether the overlay's position should be locked in after it is positioned
* initially. When an overlay is locked in, it won't attempt to reposition itself
* when the position is re-applied (e.g. when the user scrolls away).
* @param {?=} isLocked Whether the overlay should locked in.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.withLockedPosition = /**
* Sets whether the overlay's position should be locked in after it is positioned
* initially. When an overlay is locked in, it won't attempt to reposition itself
* when the position is re-applied (e.g. when the user scrolls away).
* @param {?=} isLocked Whether the overlay should locked in.
* @return {?}
*/
function (isLocked) {
if (isLocked === void 0) { isLocked = true; }
this._positionLocked = isLocked;
return this;
};
/**
* Sets the origin element, relative to which to position the overlay.
* @param origin Reference to the new origin element.
*/
/**
* Sets the origin element, relative to which to position the overlay.
* @param {?} origin Reference to the new origin element.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.setOrigin = /**
* Sets the origin element, relative to which to position the overlay.
* @param {?} origin Reference to the new origin element.
* @return {?}
*/
function (origin) {
this._origin = origin.nativeElement;
return this;
};
/**
* Sets the default offset for the overlay's connection point on the x-axis.
* @param offset New offset in the X axis.
*/
/**
* Sets the default offset for the overlay's connection point on the x-axis.
* @param {?} offset New offset in the X axis.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.withDefaultOffsetX = /**
* Sets the default offset for the overlay's connection point on the x-axis.
* @param {?} offset New offset in the X axis.
* @return {?}
*/
function (offset) {
this._offsetX = offset;
return this;
};
/**
* Sets the default offset for the overlay's connection point on the y-axis.
* @param offset New offset in the Y axis.
*/
/**
* Sets the default offset for the overlay's connection point on the y-axis.
* @param {?} offset New offset in the Y axis.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype.withDefaultOffsetY = /**
* Sets the default offset for the overlay's connection point on the y-axis.
* @param {?} offset New offset in the Y axis.
* @return {?}
*/
function (offset) {
this._offsetY = offset;
return this;
};
/**
* Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
* @param {?} originRect
* @param {?} pos
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._getOriginPoint = /**
* Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
* @param {?} originRect
* @param {?} pos
* @return {?}
*/
function (originRect, pos) {
var /** @type {?} */ x;
if (pos.originX == 'center') {
// Note: when centering we should always use the `left`
// offset, otherwise the position will be wrong in RTL.
x = originRect.left + (originRect.width / 2);
}
else {
var /** @type {?} */ startX = this._isRtl() ? originRect.right : originRect.left;
var /** @type {?} */ endX = this._isRtl() ? originRect.left : originRect.right;
x = pos.originX == 'start' ? startX : endX;
}
var /** @type {?} */ y;
if (pos.originY == 'center') {
y = originRect.top + (originRect.height / 2);
}
else {
y = pos.originY == 'top' ? originRect.top : originRect.bottom;
}
return { x: x, y: y };
};
/**
* Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
* origin point to which the overlay should be connected.
* @param {?} originPoint
* @param {?} overlayRect
* @param {?} pos
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._getOverlayPoint = /**
* Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
* origin point to which the overlay should be connected.
* @param {?} originPoint
* @param {?} overlayRect
* @param {?} pos
* @return {?}
*/
function (originPoint, overlayRect, pos) {
// Calculate the (overlayStartX, overlayStartY), the start of the
// potential overlay position relative to the origin point.
var /** @type {?} */ overlayStartX;
if (pos.overlayX == 'center') {
overlayStartX = -overlayRect.width / 2;
}
else if (pos.overlayX === 'start') {
overlayStartX = this._isRtl() ? -overlayRect.width : 0;
}
else {
overlayStartX = this._isRtl() ? 0 : -overlayRect.width;
}
var /** @type {?} */ overlayStartY;
if (pos.overlayY == 'center') {
overlayStartY = -overlayRect.height / 2;
}
else {
overlayStartY = pos.overlayY == 'top' ? 0 : -overlayRect.height;
}
// The (x, y) coordinates of the overlay.
return {
x: originPoint.x + overlayStartX,
y: originPoint.y + overlayStartY,
};
};
/**
* Gets how well an overlay at the given point will fit within the viewport.
* @param {?} point
* @param {?} overlay
* @param {?} viewport
* @param {?} position
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._getOverlayFit = /**
* Gets how well an overlay at the given point will fit within the viewport.
* @param {?} point
* @param {?} overlay
* @param {?} viewport
* @param {?} position
* @return {?}
*/
function (point, overlay, viewport, position) {
var x = point.x, y = point.y;
var /** @type {?} */ offsetX = this._getOffset(position, 'x');
var /** @type {?} */ offsetY = this._getOffset(position, 'y');
// Account for the offsets since they could push the overlay out of the viewport.
if (offsetX) {
x += offsetX;
}
if (offsetY) {
y += offsetY;
}
// How much the overlay would overflow at this position, on each side.
var /** @type {?} */ leftOverflow = 0 - x;
var /** @type {?} */ rightOverflow = (x + overlay.width) - viewport.width;
var /** @type {?} */ topOverflow = 0 - y;
var /** @type {?} */ bottomOverflow = (y + overlay.height) - viewport.height;
// Visible parts of the element on each axis.
var /** @type {?} */ visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow);
var /** @type {?} */ visibleHeight = this._subtractOverflows(overlay.height, topOverflow, bottomOverflow);
var /** @type {?} */ visibleArea = visibleWidth * visibleHeight;
return {
visibleArea: visibleArea,
isCompletelyWithinViewport: (overlay.width * overlay.height) === visibleArea,
fitsInViewportVertically: visibleHeight === overlay.height,
fitsInViewportHorizontally: visibleWidth == overlay.width,
};
};
/**
* Whether the overlay can fit within the viewport when it may resize either its width or height.
* @param {?} fit How well the overlay fits in the viewport at some position.
* @param {?} point The (x, y) coordinates of the overlat at some position.
* @param {?} viewport The geometry of the viewport.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._canFitWithFlexibleDimensions = /**
* Whether the overlay can fit within the viewport when it may resize either its width or height.
* @param {?} fit How well the overlay fits in the viewport at some position.
* @param {?} point The (x, y) coordinates of the overlat at some position.
* @param {?} viewport The geometry of the viewport.
* @return {?}
*/
function (fit, point, viewport) {
if (this._hasFlexibleDimensions) {
var /** @type {?} */ availableHeight = viewport.bottom - point.y;
var /** @type {?} */ availableWidth = viewport.right - point.x;
var /** @type {?} */ minHeight = this._overlayRef.getConfig().minHeight;
var /** @type {?} */ minWidth = this._overlayRef.getConfig().minWidth;
var /** @type {?} */ verticalFit = fit.fitsInViewportVertically ||
(minHeight != null && minHeight <= availableHeight);
var /** @type {?} */ horizontalFit = fit.fitsInViewportHorizontally ||
(minWidth != null && minWidth <= availableWidth);
return verticalFit && horizontalFit;
}
};
/**
* Gets the point at which the overlay can be "pushed" on-screen. If the overlay is larger than
* the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the
* right and bottom).
*
* @param {?} start The starting point from which the overlay is pushed.
* @param {?} overlay The overlay dimensions.
* @return {?} The point at which to position the overlay after pushing. This is effectively a new
* originPoint.
*/
FlexibleConnectedPositionStrategy.prototype._pushOverlayOnScreen = /**
* Gets the point at which the overlay can be "pushed" on-screen. If the overlay is larger than
* the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the
* right and bottom).
*
* @param {?} start The starting point from which the overlay is pushed.
* @param {?} overlay The overlay dimensions.
* @return {?} The point at which to position the overlay after pushing. This is effectively a new
* originPoint.
*/
function (start, overlay) {
var /** @type {?} */ viewport = this._viewportRect;
// Determine how much the overlay goes outside the viewport on each side, which we'll use to
// decide which direction to push it.
var /** @type {?} */ overflowRight = Math.max(start.x + overlay.width - viewport.right, 0);
var /** @type {?} */ overflowBottom = Math.max(start.y + overlay.height - viewport.bottom, 0);
var /** @type {?} */ overflowTop = Math.max(viewport.top - start.y, 0);
var /** @type {?} */ overflowLeft = Math.max(viewport.left - start.x, 0);
// Amount by which to push the overlay in each direction such that it remains on-screen.
var /** @type {?} */ pushX, /** @type {?} */ pushY = 0;
// If the overlay fits completely within the bounds of the viewport, push it from whichever
// direction is goes off-screen. Otherwise, push the top-left corner such that its in the
// viewport and allow for the trailing end of the overlay to go out of bounds.
if (overlay.width <= viewport.width) {
pushX = overflowLeft || -overflowRight;
}
else {
pushX = viewport.left - start.x;
}
if (overlay.height <= viewport.height) {
pushY = overflowTop || -overflowBottom;
}
else {
pushY = viewport.top - start.y;
}
return {
x: start.x + pushX,
y: start.y + pushY,
};
};
/**
* Applies a computed position to the overlay and emits a position change.
*
* @param {?} position The position preference
* @param {?} originPoint The point on the origin element where the overlay is connected.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._applyPosition = /**
* Applies a computed position to the overlay and emits a position change.
*
* @param {?} position The position preference
* @param {?} originPoint The point on the origin element where the overlay is connected.
* @return {?}
*/
function (position, originPoint) {
this._setOverlayElementStyles(originPoint, position);
this._setBoundingBoxStyles(originPoint, position);
// Save the last connected position in case the position needs to be re-calculated.
this._lastPosition = position;
// Notify that the position has been changed along with its change properties.
var /** @type {?} */ scrollableViewProperties = this._getScrollVisibility();
var /** @type {?} */ changeEvent = new ConnectedOverlayPositionChange(position, scrollableViewProperties);
this._positionChanges.next(changeEvent);
this._isInitialRender = false;
};
/**
* Gets the position and size of the overlay's sizing container.
*
* This method does no measuring and applies no styles so that we can cheaply compute the
* bounds for all positions and choose the best fit based on these results.
* @param {?} origin
* @param {?} position
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._calculateBoundingBoxRect = /**
* Gets the position and size of the overlay's sizing container.
*
* This method does no measuring and applies no styles so that we can cheaply compute the
* bounds for all positions and choose the best fit based on these results.
* @param {?} origin
* @param {?} position
* @return {?}
*/
function (origin, position) {
var /** @type {?} */ viewport = this._viewportRect;
var /** @type {?} */ isRtl = this._isRtl();
var /** @type {?} */ height, /** @type {?} */ top, /** @type {?} */ bottom;
if (position.overlayY === 'top') {
// Overlay is opening "downward" and thus is bound by the bottom viewport edge.
top = origin.y;
height = viewport.bottom - origin.y;
}
else if (position.overlayY === 'bottom') {
// Overlay is opening "upward" and thus is bound by the top viewport edge. We need to add
// the viewport margin back in, because the viewport rect is narrowed down to remove the
// margin, whereas the `origin` position is calculated based on its `ClientRect`.
bottom = viewport.height - origin.y + this._viewportMargin * 2;
height = viewport.height - bottom + this._viewportMargin;
}
else {
// If neither top nor bottom, it means that the overlay
// is vertically centered on the origin point.
var /** @type {?} */ smallestDistanceToViewportEdge = Math.min(viewport.bottom - origin.y, origin.y - viewport.left);
var /** @type {?} */ previousHeight = this._lastBoundingBoxSize.height;
height = smallestDistanceToViewportEdge * 2;
top = origin.y - smallestDistanceToViewportEdge;
if (height > previousHeight && !this._isInitialRender && !this._growAfterOpen) {
top = origin.y - (previousHeight / 2);
}
}
// The overlay is opening 'right-ward' (the content flows to the right).
var /** @type {?} */ isBoundedByRightViewportEdge = (position.overlayX === 'start' && !isRtl) ||
(position.overlayX === 'end' && isRtl);
// The overlay is opening 'left-ward' (the content flows to the left).
var /** @type {?} */ isBoundedByLeftViewportEdge = (position.overlayX === 'end' && !isRtl) ||
(position.overlayX === 'start' && isRtl);
var /** @type {?} */ width, /** @type {?} */ left, /** @type {?} */ right;
if (isBoundedByLeftViewportEdge) {
right = viewport.right - origin.x + this._viewportMargin;
width = origin.x - viewport.left;
}
else if (isBoundedByRightViewportEdge) {
left = origin.x;
width = viewport.right - origin.x;
}
else {
// If neither start nor end, it means that the overlay
// is horizontally centered on the origin point.
var /** @type {?} */ smallestDistanceToViewportEdge = Math.min(viewport.right - origin.x, origin.x - viewport.top);
var /** @type {?} */ previousWidth = this._lastBoundingBoxSize.width;
width = smallestDistanceToViewportEdge * 2;
left = origin.x - smallestDistanceToViewportEdge;
if (width > previousWidth && !this._isInitialRender && !this._growAfterOpen) {
left = origin.x - (previousWidth / 2);
}
}
return { top: top, left: left, bottom: bottom, right: right, width: width, height: height };
};
/**
* Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
* origin's connection point and stetches to the bounds of the viewport.
*
* @param {?} origin The point on the origin element where the overlay is connected.
* @param {?} position The position preference
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._setBoundingBoxStyles = /**
* Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
* origin's connection point and stetches to the bounds of the viewport.
*
* @param {?} origin The point on the origin element where the overlay is connected.
* @param {?} position The position preference
* @return {?}
*/
function (origin, position) {
var /** @type {?} */ boundingBoxRect = this._calculateBoundingBoxRect(origin, position);
// It's weird if the overlay *grows* while scrolling, so we take the last size into account
// when applying a new size.
if (!this._isInitialRender && !this._growAfterOpen) {
boundingBoxRect.height = Math.min(boundingBoxRect.height, this._lastBoundingBoxSize.height);
boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);
}
var /** @type {?} */ styles = /** @type {?} */ ({});
if (this._hasExactPosition()) {
styles.top = styles.left = '0';
styles.bottom = styles.right = '';
styles.width = styles.height = '100%';
}
else {
var /** @type {?} */ maxHeight = this._overlayRef.getConfig().maxHeight;
var /** @type {?} */ maxWidth = this._overlayRef.getConfig().maxWidth;
styles.height = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(boundingBoxRect.height);
styles.top = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(boundingBoxRect.top);
styles.bottom = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(boundingBoxRect.bottom);
styles.width = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(boundingBoxRect.width);
styles.left = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(boundingBoxRect.left);
styles.right = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(boundingBoxRect.right);
// Push the pane content towards the proper direction.
if (position.overlayX === 'center') {
styles.alignItems = 'center';
}
else if (this._isRtl()) {
styles.alignItems = position.overlayX === 'end' ? 'flex-start' : 'flex-end';
}
else {
styles.alignItems = position.overlayX === 'end' ? 'flex-end' : 'flex-start';
}
if (position.overlayY === 'center') {
styles.justifyContent = 'center';
}
else {
styles.justifyContent = position.overlayY === 'bottom' ? 'flex-end' : 'flex-start';
}
if (maxHeight) {
styles.maxHeight = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(maxHeight);
}
if (maxWidth) {
styles.maxWidth = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(maxWidth);
}
}
this._lastBoundingBoxSize = boundingBoxRect;
extendStyles(/** @type {?} */ ((this._boundingBox)).style, styles);
};
/**
* Resets the styles for the bounding box so that a new positioning can be computed.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._resetBoundingBoxStyles = /**
* Resets the styles for the bounding box so that a new positioning can be computed.
* @return {?}
*/
function () {
extendStyles(/** @type {?} */ ((this._boundingBox)).style, /** @type {?} */ ({
top: '0',
left: '0',
right: '0',
bottom: '0',
height: '',
width: '',
alignItems: '',
justifyContent: '',
}));
};
/**
* Resets the styles for the overlay pane so that a new positioning can be computed.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._resetOverlayElementStyles = /**
* Resets the styles for the overlay pane so that a new positioning can be computed.
* @return {?}
*/
function () {
extendStyles(this._pane.style, /** @type {?} */ ({
top: '',
left: '',
bottom: '',
right: '',
position: '',
}));
};
/**
* Sets positioning styles to the overlay element.
* @param {?} originPoint
* @param {?} position
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._setOverlayElementStyles = /**
* Sets positioning styles to the overlay element.
* @param {?} originPoint
* @param {?} position
* @return {?}
*/
function (originPoint, position) {
var /** @type {?} */ styles = /** @type {?} */ ({});
if (this._hasExactPosition()) {
extendStyles(styles, this._getExactOverlayY(position, originPoint));
extendStyles(styles, this._getExactOverlayX(position, originPoint));
}
else {
styles.position = 'static';
}
// Use a transform to apply the offsets. We do this because the `center` positions rely on
// being in the normal flex flow and setting a `top` / `left` at all will completely throw
// off the position. We also can't use margins, because they won't have an effect in some
// cases where the element doesn't have anything to "push off of". Finally, this works
// better both with flexible and non-flexible positioning.
var /** @type {?} */ transformString = '';
var /** @type {?} */ offsetX = this._getOffset(position, 'x');
var /** @type {?} */ offsetY = this._getOffset(position, 'y');
if (offsetX) {
transformString += "translateX(" + offsetX + "px) ";
}
if (offsetY) {
transformString += "translateY(" + offsetY + "px)";
}
styles.transform = transformString.trim();
// If a maxWidth or maxHeight is specified on the overlay, we remove them. We do this because
// we need these values to both be set to "100%" for the automatic flexible sizing to work.
// The maxHeight and maxWidth are set on the boundingBox in order to enforce the constraint.
if (this._hasFlexibleDimensions && this._overlayRef.getConfig().maxHeight) {
styles.maxHeight = '';
}
if (this._hasFlexibleDimensions && this._overlayRef.getConfig().maxWidth) {
styles.maxWidth = '';
}
extendStyles(this._pane.style, styles);
};
/**
* Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing.
* @param {?} position
* @param {?} originPoint
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._getExactOverlayY = /**
* Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing.
* @param {?} position
* @param {?} originPoint
* @return {?}
*/
function (position, originPoint) {
// Reset any existing styles. This is necessary in case the
// preferred position has changed since the last `apply`.
var /** @type {?} */ styles = /** @type {?} */ ({ top: null, bottom: null });
var /** @type {?} */ overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
if (this._isPushed) {
overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect);
}
// We want to set either `top` or `bottom` based on whether the overlay wants to appear
// above or below the origin and the direction in which the element will expand.
if (position.overlayY === 'bottom') {
// When using `bottom`, we adjust the y position such that it is the distance
// from the bottom of the viewport rather than the top.
var /** @type {?} */ documentHeight = this._document.documentElement.clientHeight;
styles.bottom = documentHeight - (overlayPoint.y + this._overlayRect.height) + "px";
}
else {
styles.top = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(overlayPoint.y);
}
return styles;
};
/**
* Gets the exact left/right for the overlay when not using flexible sizing or when pushing.
* @param {?} position
* @param {?} originPoint
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._getExactOverlayX = /**
* Gets the exact left/right for the overlay when not using flexible sizing or when pushing.
* @param {?} position
* @param {?} originPoint
* @return {?}
*/
function (position, originPoint) {
// Reset any existing styles. This is necessary in case the preferred position has
// changed since the last `apply`.
var /** @type {?} */ styles = /** @type {?} */ ({ left: null, right: null });
var /** @type {?} */ overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
if (this._isPushed) {
overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect);
}
// We want to set either `left` or `right` based on whether the overlay wants to appear "before"
// or "after" the origin, which determines the direction in which the element will expand.
// For the horizontal axis, the meaning of "before" and "after" change based on whether the
// page is in RTL or LTR.
var /** @type {?} */ horizontalStyleProperty;
if (this._isRtl()) {
horizontalStyleProperty = position.overlayX === 'end' ? 'left' : 'right';
}
else {
horizontalStyleProperty = position.overlayX === 'end' ? 'right' : 'left';
}
// When we're setting `right`, we adjust the x position such that it is the distance
// from the right edge of the viewport rather than the left edge.
if (horizontalStyleProperty === 'right') {
var /** @type {?} */ documentWidth = this._document.documentElement.clientWidth;
styles.right = documentWidth - (overlayPoint.x + this._overlayRect.width) + "px";
}
else {
styles.left = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceCssPixelValue"])(overlayPoint.x);
}
return styles;
};
/**
* Gets the view properties of the trigger and overlay, including whether they are clipped
* or completely outside the view of any of the strategy's scrollables.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._getScrollVisibility = /**
* Gets the view properties of the trigger and overlay, including whether they are clipped
* or completely outside the view of any of the strategy's scrollables.
* @return {?}
*/
function () {
// Note: needs fresh rects since the position could've changed.
var /** @type {?} */ originBounds = this._origin.getBoundingClientRect();
var /** @type {?} */ overlayBounds = this._pane.getBoundingClientRect();
// TODO(jelbourn): instead of needing all of the client rects for these scrolling containers
// every time, we should be able to use the scrollTop of the containers if the size of those
// containers hasn't changed.
var /** @type {?} */ scrollContainerBounds = this.scrollables.map(function (scrollable) {
return scrollable.getElementRef().nativeElement.getBoundingClientRect();
});
return {
isOriginClipped: isElementClippedByScrolling(originBounds, scrollContainerBounds),
isOriginOutsideView: isElementScrolledOutsideView(originBounds, scrollContainerBounds),
isOverlayClipped: isElementClippedByScrolling(overlayBounds, scrollContainerBounds),
isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds),
};
};
/**
* Subtracts the amount that an element is overflowing on an axis from it's length.
* @param {?} length
* @param {...?} overflows
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._subtractOverflows = /**
* Subtracts the amount that an element is overflowing on an axis from it's length.
* @param {?} length
* @param {...?} overflows
* @return {?}
*/
function (length) {
var overflows = [];
for (var _i = 1; _i < arguments.length; _i++) {
overflows[_i - 1] = arguments[_i];
}
return overflows.reduce(function (currentValue, currentOverflow) {
return currentValue - Math.max(currentOverflow, 0);
}, length);
};
/**
* Narrows the given viewport rect by the current _viewportMargin.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._getNarrowedViewportRect = /**
* Narrows the given viewport rect by the current _viewportMargin.
* @return {?}
*/
function () {
// We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,
// because we want to use the `clientWidth` and `clientHeight` as the base. The difference
// being that the client properties don't include the scrollbar, as opposed to `innerWidth`
// and `innerHeight` that do. This is necessary, because the overlay container uses
// 100% `width` and `height` which don't include the scrollbar either.
var /** @type {?} */ width = this._document.documentElement.clientWidth;
var /** @type {?} */ height = this._document.documentElement.clientHeight;
var /** @type {?} */ scrollPosition = this._viewportRuler.getViewportScrollPosition();
return {
top: scrollPosition.top + this._viewportMargin,
left: scrollPosition.left + this._viewportMargin,
right: scrollPosition.left + width - this._viewportMargin,
bottom: scrollPosition.top + height - this._viewportMargin,
width: width - (2 * this._viewportMargin),
height: height - (2 * this._viewportMargin),
};
};
/**
* Whether the we're dealing with an RTL context
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._isRtl = /**
* Whether the we're dealing with an RTL context
* @return {?}
*/
function () {
return this._overlayRef.getConfig().direction === 'rtl';
};
/**
* Determines whether the overlay uses exact or flexible positioning.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._hasExactPosition = /**
* Determines whether the overlay uses exact or flexible positioning.
* @return {?}
*/
function () {
return !this._hasFlexibleDimensions || this._isPushed;
};
/**
* Retrieves the offset of a position along the x or y axis.
* @param {?} position
* @param {?} axis
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._getOffset = /**
* Retrieves the offset of a position along the x or y axis.
* @param {?} position
* @param {?} axis
* @return {?}
*/
function (position, axis) {
if (axis === 'x') {
// We don't do something like `position['offset' + axis]` in
// order to avoid breking minifiers that rename properties.
return position.offsetX == null ? this._offsetX : position.offsetX;
}
return position.offsetY == null ? this._offsetY : position.offsetY;
};
/**
* Validates that the current position match the expected values.
* @return {?}
*/
FlexibleConnectedPositionStrategy.prototype._validatePositions = /**
* Validates that the current position match the expected values.
* @return {?}
*/
function () {
if (!this._preferredPositions.length) {
throw Error('FlexibleConnectedPositionStrategy: At least one position is required.');
}
// TODO(crisbeto): remove these once Angular's template type
// checking is advanced enough to catch these cases.
this._preferredPositions.forEach(function (pair) {
validateHorizontalPosition('originX', pair.originX);
validateVerticalPosition('originY', pair.originY);
validateHorizontalPosition('overlayX', pair.overlayX);
validateVerticalPosition('overlayY', pair.overlayY);
});
};
return FlexibleConnectedPositionStrategy;
}());
/**
* Shallow-extends a stylesheet object with another stylesheet object.
* @param {?} dest
* @param {?} source
* @return {?}
*/
function extendStyles(dest, source) {
for (var /** @type {?} */ key in source) {
if (source.hasOwnProperty(key)) {
dest[key] = source[key];
}
}
return dest;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* A strategy for positioning overlays. Using this strategy, an overlay is given an
* implicit position relative to some origin element. The relative position is defined in terms of
* a point on the origin element that is connected to a point on the overlay element. For example,
* a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner
* of the overlay.
* @deprecated Use `FlexibleConnectedPositionStrategy` instead.
* \@deletion-target 7.0.0
*/
var /**
* A strategy for positioning overlays. Using this strategy, an overlay is given an
* implicit position relative to some origin element. The relative position is defined in terms of
* a point on the origin element that is connected to a point on the overlay element. For example,
* a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner
* of the overlay.
* @deprecated Use `FlexibleConnectedPositionStrategy` instead.
* \@deletion-target 7.0.0
*/
ConnectedPositionStrategy = /** @class */ (function () {
function ConnectedPositionStrategy(originPos, overlayPos, connectedTo, viewportRuler, document,
// @deletion-target 7.0.0 `platform` parameter to be made required.
// @deletion-target 7.0.0 `platform` parameter to be made required.
platform) {
/**
* Ordered list of preferred positions, from most to least desirable.
*/
this._preferredPositions = [];
// Since the `ConnectedPositionStrategy` is deprecated and we don't want to maintain
// the extra logic, we create an instance of the positioning strategy that has some
// defaults that make it behave as the old position strategy and to which we'll
// proxy all of the API calls.
this._positionStrategy =
new FlexibleConnectedPositionStrategy(connectedTo, viewportRuler, document, platform)
.withFlexibleDimensions(false)
.withPush(false)
.withViewportMargin(0);
this.withFallbackPosition(originPos, overlayPos);
}
Object.defineProperty(ConnectedPositionStrategy.prototype, "_isRtl", {
/** Whether the we're dealing with an RTL context */
get: /**
* Whether the we're dealing with an RTL context
* @return {?}
*/
function () {
return this._overlayRef.getConfig().direction === 'rtl';
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConnectedPositionStrategy.prototype, "onPositionChange", {
/** Emits an event when the connection point changes. */
get: /**
* Emits an event when the connection point changes.
* @return {?}
*/
function () {
return this._positionStrategy.positionChanges;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConnectedPositionStrategy.prototype, "positions", {
/** Ordered list of preferred positions, from most to least desirable. */
get: /**
* Ordered list of preferred positions, from most to least desirable.
* @return {?}
*/
function () {
return this._preferredPositions;
},
enumerable: true,
configurable: true
});
/** Attach this position strategy to an overlay. */
/**
* Attach this position strategy to an overlay.
* @param {?} overlayRef
* @return {?}
*/
ConnectedPositionStrategy.prototype.attach = /**
* Attach this position strategy to an overlay.
* @param {?} overlayRef
* @return {?}
*/
function (overlayRef) {
this._overlayRef = overlayRef;
this._positionStrategy.attach(overlayRef);
if (this._direction) {
overlayRef.setDirection(this._direction);
this._direction = null;
}
};
/** Disposes all resources used by the position strategy. */
/**
* Disposes all resources used by the position strategy.
* @return {?}
*/
ConnectedPositionStrategy.prototype.dispose = /**
* Disposes all resources used by the position strategy.
* @return {?}
*/
function () {
this._positionStrategy.dispose();
};
/** @docs-private */
/**
* \@docs-private
* @return {?}
*/
ConnectedPositionStrategy.prototype.detach = /**
* \@docs-private
* @return {?}
*/
function () {
this._positionStrategy.detach();
};
/**
* Updates the position of the overlay element, using whichever preferred position relative
* to the origin fits on-screen.
* @docs-private
*/
/**
* Updates the position of the overlay element, using whichever preferred position relative
* to the origin fits on-screen.
* \@docs-private
* @return {?}
*/
ConnectedPositionStrategy.prototype.apply = /**
* Updates the position of the overlay element, using whichever preferred position relative
* to the origin fits on-screen.
* \@docs-private
* @return {?}
*/
function () {
this._positionStrategy.apply();
};
/**
* Re-positions the overlay element with the trigger in its last calculated position,
* even if a position higher in the "preferred positions" list would now fit. This
* allows one to re-align the panel without changing the orientation of the panel.
*/
/**
* Re-positions the overlay element with the trigger in its last calculated position,
* even if a position higher in the "preferred positions" list would now fit. This
* allows one to re-align the panel without changing the orientation of the panel.
* @return {?}
*/
ConnectedPositionStrategy.prototype.recalculateLastPosition = /**
* Re-positions the overlay element with the trigger in its last calculated position,
* even if a position higher in the "preferred positions" list would now fit. This
* allows one to re-align the panel without changing the orientation of the panel.
* @return {?}
*/
function () {
this._positionStrategy.reapplyLastPosition();
};
/**
* Sets the list of Scrollable containers that host the origin element so that
* on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
* Scrollable must be an ancestor element of the strategy's origin element.
*/
/**
* Sets the list of Scrollable containers that host the origin element so that
* on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
* Scrollable must be an ancestor element of the strategy's origin element.
* @param {?} scrollables
* @return {?}
*/
ConnectedPositionStrategy.prototype.withScrollableContainers = /**
* Sets the list of Scrollable containers that host the origin element so that
* on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
* Scrollable must be an ancestor element of the strategy's origin element.
* @param {?} scrollables
* @return {?}
*/
function (scrollables) {
this._positionStrategy.withScrollableContainers(scrollables);
};
/**
* Adds a new preferred fallback position.
* @param originPos
* @param overlayPos
*/
/**
* Adds a new preferred fallback position.
* @param {?} originPos
* @param {?} overlayPos
* @param {?=} offsetX
* @param {?=} offsetY
* @return {?}
*/
ConnectedPositionStrategy.prototype.withFallbackPosition = /**
* Adds a new preferred fallback position.
* @param {?} originPos
* @param {?} overlayPos
* @param {?=} offsetX
* @param {?=} offsetY
* @return {?}
*/
function (originPos, overlayPos, offsetX, offsetY) {
var /** @type {?} */ position = new ConnectionPositionPair(originPos, overlayPos, offsetX, offsetY);
this._preferredPositions.push(position);
this._positionStrategy.withPositions(this._preferredPositions);
return this;
};
/**
* Sets the layout direction so the overlay's position can be adjusted to match.
* @param dir New layout direction.
*/
/**
* Sets the layout direction so the overlay's position can be adjusted to match.
* @param {?} dir New layout direction.
* @return {?}
*/
ConnectedPositionStrategy.prototype.withDirection = /**
* Sets the layout direction so the overlay's position can be adjusted to match.
* @param {?} dir New layout direction.
* @return {?}
*/
function (dir) {
// Since the direction might be declared before the strategy is attached,
// we save the value in a temporary property and we'll transfer it to the
// overlay ref on attachment.
if (this._overlayRef) {
this._overlayRef.setDirection(dir);
}
else {
this._direction = dir;
}
return this;
};
/**
* Sets an offset for the overlay's connection point on the x-axis
* @param offset New offset in the X axis.
*/
/**
* Sets an offset for the overlay's connection point on the x-axis
* @param {?} offset New offset in the X axis.
* @return {?}
*/
ConnectedPositionStrategy.prototype.withOffsetX = /**
* Sets an offset for the overlay's connection point on the x-axis
* @param {?} offset New offset in the X axis.
* @return {?}
*/
function (offset) {
this._positionStrategy.withDefaultOffsetX(offset);
return this;
};
/**
* Sets an offset for the overlay's connection point on the y-axis
* @param offset New offset in the Y axis.
*/
/**
* Sets an offset for the overlay's connection point on the y-axis
* @param {?} offset New offset in the Y axis.
* @return {?}
*/
ConnectedPositionStrategy.prototype.withOffsetY = /**
* Sets an offset for the overlay's connection point on the y-axis
* @param {?} offset New offset in the Y axis.
* @return {?}
*/
function (offset) {
this._positionStrategy.withDefaultOffsetY(offset);
return this;
};
/**
* Sets whether the overlay's position should be locked in after it is positioned
* initially. When an overlay is locked in, it won't attempt to reposition itself
* when the position is re-applied (e.g. when the user scrolls away).
* @param isLocked Whether the overlay should locked in.
*/
/**
* Sets whether the overlay's position should be locked in after it is positioned
* initially. When an overlay is locked in, it won't attempt to reposition itself
* when the position is re-applied (e.g. when the user scrolls away).
* @param {?} isLocked Whether the overlay should locked in.
* @return {?}
*/
ConnectedPositionStrategy.prototype.withLockedPosition = /**
* Sets whether the overlay's position should be locked in after it is positioned
* initially. When an overlay is locked in, it won't attempt to reposition itself
* when the position is re-applied (e.g. when the user scrolls away).
* @param {?} isLocked Whether the overlay should locked in.
* @return {?}
*/
function (isLocked) {
this._positionStrategy.withLockedPosition(isLocked);
return this;
};
/**
* Overwrites the current set of positions with an array of new ones.
* @param positions Position pairs to be set on the strategy.
*/
/**
* Overwrites the current set of positions with an array of new ones.
* @param {?} positions Position pairs to be set on the strategy.
* @return {?}
*/
ConnectedPositionStrategy.prototype.withPositions = /**
* Overwrites the current set of positions with an array of new ones.
* @param {?} positions Position pairs to be set on the strategy.
* @return {?}
*/
function (positions) {
this._preferredPositions = positions.slice();
this._positionStrategy.withPositions(this._preferredPositions);
return this;
};
/**
* Sets the origin element, relative to which to position the overlay.
* @param origin Reference to the new origin element.
*/
/**
* Sets the origin element, relative to which to position the overlay.
* @param {?} origin Reference to the new origin element.
* @return {?}
*/
ConnectedPositionStrategy.prototype.setOrigin = /**
* Sets the origin element, relative to which to position the overlay.
* @param {?} origin Reference to the new origin element.
* @return {?}
*/
function (origin) {
this._positionStrategy.setOrigin(origin);
return this;
};
return ConnectedPositionStrategy;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* A strategy for positioning overlays. Using this strategy, an overlay is given an
* explicit position relative to the browser's viewport. We use flexbox, instead of
* transforms, in order to avoid issues with subpixel rendering which can cause the
* element to become blurry.
*/
var /**
* A strategy for positioning overlays. Using this strategy, an overlay is given an
* explicit position relative to the browser's viewport. We use flexbox, instead of
* transforms, in order to avoid issues with subpixel rendering which can cause the
* element to become blurry.
*/
GlobalPositionStrategy = /** @class */ (function () {
function GlobalPositionStrategy() {
this._cssPosition = 'static';
this._topOffset = '';
this._bottomOffset = '';
this._leftOffset = '';
this._rightOffset = '';
this._alignItems = '';
this._justifyContent = '';
this._width = '';
this._height = '';
}
/**
* @param {?} overlayRef
* @return {?}
*/
GlobalPositionStrategy.prototype.attach = /**
* @param {?} overlayRef
* @return {?}
*/
function (overlayRef) {
var /** @type {?} */ config = overlayRef.getConfig();
this._overlayRef = overlayRef;
if (this._width && !config.width) {
overlayRef.updateSize({ width: this._width });
}
if (this._height && !config.height) {
overlayRef.updateSize({ height: this._height });
}
overlayRef.hostElement.classList.add('cdk-global-overlay-wrapper');
};
/**
* Sets the top position of the overlay. Clears any previously set vertical position.
* @param value New top offset.
*/
/**
* Sets the top position of the overlay. Clears any previously set vertical position.
* @param {?=} value New top offset.
* @return {?}
*/
GlobalPositionStrategy.prototype.top = /**
* Sets the top position of the overlay. Clears any previously set vertical position.
* @param {?=} value New top offset.
* @return {?}
*/
function (value) {
if (value === void 0) { value = ''; }
this._bottomOffset = '';
this._topOffset = value;
this._alignItems = 'flex-start';
return this;
};
/**
* Sets the left position of the overlay. Clears any previously set horizontal position.
* @param value New left offset.
*/
/**
* Sets the left position of the overlay. Clears any previously set horizontal position.
* @param {?=} value New left offset.
* @return {?}
*/
GlobalPositionStrategy.prototype.left = /**
* Sets the left position of the overlay. Clears any previously set horizontal position.
* @param {?=} value New left offset.
* @return {?}
*/
function (value) {
if (value === void 0) { value = ''; }
this._rightOffset = '';
this._leftOffset = value;
this._justifyContent = 'flex-start';
return this;
};
/**
* Sets the bottom position of the overlay. Clears any previously set vertical position.
* @param value New bottom offset.
*/
/**
* Sets the bottom position of the overlay. Clears any previously set vertical position.
* @param {?=} value New bottom offset.
* @return {?}
*/
GlobalPositionStrategy.prototype.bottom = /**
* Sets the bottom position of the overlay. Clears any previously set vertical position.
* @param {?=} value New bottom offset.
* @return {?}
*/
function (value) {
if (value === void 0) { value = ''; }
this._topOffset = '';
this._bottomOffset = value;
this._alignItems = 'flex-end';
return this;
};
/**
* Sets the right position of the overlay. Clears any previously set horizontal position.
* @param value New right offset.
*/
/**
* Sets the right position of the overlay. Clears any previously set horizontal position.
* @param {?=} value New right offset.
* @return {?}
*/
GlobalPositionStrategy.prototype.right = /**
* Sets the right position of the overlay. Clears any previously set horizontal position.
* @param {?=} value New right offset.
* @return {?}
*/
function (value) {
if (value === void 0) { value = ''; }
this._leftOffset = '';
this._rightOffset = value;
this._justifyContent = 'flex-end';
return this;
};
/**
* Sets the overlay width and clears any previously set width.
* @param value New width for the overlay
* @deprecated Pass the `width` through the `OverlayConfig`.
* @deletion-target 7.0.0
*/
/**
* Sets the overlay width and clears any previously set width.
* @deprecated Pass the `width` through the `OverlayConfig`.
* \@deletion-target 7.0.0
* @param {?=} value New width for the overlay
* @return {?}
*/
GlobalPositionStrategy.prototype.width = /**
* Sets the overlay width and clears any previously set width.
* @deprecated Pass the `width` through the `OverlayConfig`.
* \@deletion-target 7.0.0
* @param {?=} value New width for the overlay
* @return {?}
*/
function (value) {
if (value === void 0) { value = ''; }
if (this._overlayRef) {
this._overlayRef.updateSize({ width: value });
}
else {
this._width = value;
}
return this;
};
/**
* Sets the overlay height and clears any previously set height.
* @param value New height for the overlay
* @deprecated Pass the `height` through the `OverlayConfig`.
* @deletion-target 7.0.0
*/
/**
* Sets the overlay height and clears any previously set height.
* @deprecated Pass the `height` through the `OverlayConfig`.
* \@deletion-target 7.0.0
* @param {?=} value New height for the overlay
* @return {?}
*/
GlobalPositionStrategy.prototype.height = /**
* Sets the overlay height and clears any previously set height.
* @deprecated Pass the `height` through the `OverlayConfig`.
* \@deletion-target 7.0.0
* @param {?=} value New height for the overlay
* @return {?}
*/
function (value) {
if (value === void 0) { value = ''; }
if (this._overlayRef) {
this._overlayRef.updateSize({ height: value });
}
else {
this._height = value;
}
return this;
};
/**
* Centers the overlay horizontally with an optional offset.
* Clears any previously set horizontal position.
*
* @param offset Overlay offset from the horizontal center.
*/
/**
* Centers the overlay horizontally with an optional offset.
* Clears any previously set horizontal position.
*
* @param {?=} offset Overlay offset from the horizontal center.
* @return {?}
*/
GlobalPositionStrategy.prototype.centerHorizontally = /**
* Centers the overlay horizontally with an optional offset.
* Clears any previously set horizontal position.
*
* @param {?=} offset Overlay offset from the horizontal center.
* @return {?}
*/
function (offset) {
if (offset === void 0) { offset = ''; }
this.left(offset);
this._justifyContent = 'center';
return this;
};
/**
* Centers the overlay vertically with an optional offset.
* Clears any previously set vertical position.
*
* @param offset Overlay offset from the vertical center.
*/
/**
* Centers the overlay vertically with an optional offset.
* Clears any previously set vertical position.
*
* @param {?=} offset Overlay offset from the vertical center.
* @return {?}
*/
GlobalPositionStrategy.prototype.centerVertically = /**
* Centers the overlay vertically with an optional offset.
* Clears any previously set vertical position.
*
* @param {?=} offset Overlay offset from the vertical center.
* @return {?}
*/
function (offset) {
if (offset === void 0) { offset = ''; }
this.top(offset);
this._alignItems = 'center';
return this;
};
/**
* Apply the position to the element.
* @docs-private
*/
/**
* Apply the position to the element.
* \@docs-private
* @return {?}
*/
GlobalPositionStrategy.prototype.apply = /**
* Apply the position to the element.
* \@docs-private
* @return {?}
*/
function () {
// Since the overlay ref applies the strategy asynchronously, it could
// have been disposed before it ends up being applied. If that is the
// case, we shouldn't do anything.
if (!this._overlayRef.hasAttached()) {
return;
}
var /** @type {?} */ styles = this._overlayRef.overlayElement.style;
var /** @type {?} */ parentStyles = this._overlayRef.hostElement.style;
var /** @type {?} */ config = this._overlayRef.getConfig();
styles.position = this._cssPosition;
styles.marginLeft = config.width === '100%' ? '0' : this._leftOffset;
styles.marginTop = config.height === '100%' ? '0' : this._topOffset;
styles.marginBottom = this._bottomOffset;
styles.marginRight = this._rightOffset;
parentStyles.justifyContent = config.width === '100%' ? 'flex-start' : this._justifyContent;
parentStyles.alignItems = config.height === '100%' ? 'flex-start' : this._alignItems;
};
/**
* Noop implemented as a part of the PositionStrategy interface.
* @docs-private
*/
/**
* Noop implemented as a part of the PositionStrategy interface.
* \@docs-private
* @return {?}
*/
GlobalPositionStrategy.prototype.dispose = /**
* Noop implemented as a part of the PositionStrategy interface.
* \@docs-private
* @return {?}
*/
function () { };
return GlobalPositionStrategy;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Builder for overlay position strategy.
*/
var OverlayPositionBuilder = /** @class */ (function () {
function OverlayPositionBuilder(_viewportRuler, _document,
// @deletion-target 7.0.0 `_platform` parameter to be made required.
_platform) {
this._viewportRuler = _viewportRuler;
this._document = _document;
this._platform = _platform;
}
/**
* Creates a global position strategy.
*/
/**
* Creates a global position strategy.
* @return {?}
*/
OverlayPositionBuilder.prototype.global = /**
* Creates a global position strategy.
* @return {?}
*/
function () {
return new GlobalPositionStrategy();
};
/**
* Creates a relative position strategy.
* @param elementRef
* @param originPos
* @param overlayPos
* @deprecated Use `flexibleConnectedTo` instead.
* @deletion-target 7.0.0
*/
/**
* Creates a relative position strategy.
* @deprecated Use `flexibleConnectedTo` instead.
* \@deletion-target 7.0.0
* @param {?} elementRef
* @param {?} originPos
* @param {?} overlayPos
* @return {?}
*/
OverlayPositionBuilder.prototype.connectedTo = /**
* Creates a relative position strategy.
* @deprecated Use `flexibleConnectedTo` instead.
* \@deletion-target 7.0.0
* @param {?} elementRef
* @param {?} originPos
* @param {?} overlayPos
* @return {?}
*/
function (elementRef, originPos, overlayPos) {
return new ConnectedPositionStrategy(originPos, overlayPos, elementRef, this._viewportRuler, this._document);
};
/**
* Creates a flexible position strategy.
* @param elementRef
*/
/**
* Creates a flexible position strategy.
* @param {?} elementRef
* @return {?}
*/
OverlayPositionBuilder.prototype.flexibleConnectedTo = /**
* Creates a flexible position strategy.
* @param {?} elementRef
* @return {?}
*/
function (elementRef) {
return new FlexibleConnectedPositionStrategy(elementRef, this._viewportRuler, this._document, this._platform);
};
OverlayPositionBuilder.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
OverlayPositionBuilder.ctorParameters = function () { return [
{ type: _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["ViewportRuler"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"],] },] },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_7__["Platform"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
/** @nocollapse */ OverlayPositionBuilder.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["defineInjectable"])({ factory: function OverlayPositionBuilder_Factory() { return new OverlayPositionBuilder(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["ViewportRuler"]), Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"]), Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_7__["Platform"], 8)); }, token: OverlayPositionBuilder, providedIn: "root" });
return OverlayPositionBuilder;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Next overlay unique ID.
*/
var /** @type {?} */ nextUniqueId = 0;
/**
* Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
* used as a low-level building block for other components. Dialogs, tooltips, menus,
* selects, etc. can all be built using overlays. The service should primarily be used by authors
* of re-usable components rather than developers building end-user applications.
*
* An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one.
*/
var Overlay = /** @class */ (function () {
function Overlay(scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality) {
this.scrollStrategies = scrollStrategies;
this._overlayContainer = _overlayContainer;
this._componentFactoryResolver = _componentFactoryResolver;
this._positionBuilder = _positionBuilder;
this._keyboardDispatcher = _keyboardDispatcher;
this._injector = _injector;
this._ngZone = _ngZone;
this._document = _document;
this._directionality = _directionality;
}
/**
* Creates an overlay.
* @param config Configuration applied to the overlay.
* @returns Reference to the created overlay.
*/
/**
* Creates an overlay.
* @param {?=} config Configuration applied to the overlay.
* @return {?} Reference to the created overlay.
*/
Overlay.prototype.create = /**
* Creates an overlay.
* @param {?=} config Configuration applied to the overlay.
* @return {?} Reference to the created overlay.
*/
function (config) {
var /** @type {?} */ host = this._createHostElement();
var /** @type {?} */ pane = this._createPaneElement(host);
var /** @type {?} */ portalOutlet = this._createPortalOutlet(pane);
var /** @type {?} */ overlayConfig = new OverlayConfig(config);
overlayConfig.direction = overlayConfig.direction || this._directionality.value;
return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document);
};
/**
* Gets a position builder that can be used, via fluent API,
* to construct and configure a position strategy.
* @returns An overlay position builder.
*/
/**
* Gets a position builder that can be used, via fluent API,
* to construct and configure a position strategy.
* @return {?} An overlay position builder.
*/
Overlay.prototype.position = /**
* Gets a position builder that can be used, via fluent API,
* to construct and configure a position strategy.
* @return {?} An overlay position builder.
*/
function () {
return this._positionBuilder;
};
/**
* Creates the DOM element for an overlay and appends it to the overlay container.
* @param {?} host
* @return {?} Newly-created pane element
*/
Overlay.prototype._createPaneElement = /**
* Creates the DOM element for an overlay and appends it to the overlay container.
* @param {?} host
* @return {?} Newly-created pane element
*/
function (host) {
var /** @type {?} */ pane = this._document.createElement('div');
pane.id = "cdk-overlay-" + nextUniqueId++;
pane.classList.add('cdk-overlay-pane');
host.appendChild(pane);
return pane;
};
/**
* Creates the host element that wraps around an overlay
* and can be used for advanced positioning.
* @return {?} Newly-create host element.
*/
Overlay.prototype._createHostElement = /**
* Creates the host element that wraps around an overlay
* and can be used for advanced positioning.
* @return {?} Newly-create host element.
*/
function () {
var /** @type {?} */ host = this._document.createElement('div');
this._overlayContainer.getContainerElement().appendChild(host);
return host;
};
/**
* Create a DomPortalOutlet into which the overlay content can be loaded.
* @param {?} pane The DOM element to turn into a portal outlet.
* @return {?} A portal outlet for the given DOM element.
*/
Overlay.prototype._createPortalOutlet = /**
* Create a DomPortalOutlet into which the overlay content can be loaded.
* @param {?} pane The DOM element to turn into a portal outlet.
* @return {?} A portal outlet for the given DOM element.
*/
function (pane) {
// We have to resolve the ApplicationRef later in order to allow people
// to use overlay-based providers during app initialization.
if (!this._appRef) {
this._appRef = this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ApplicationRef"]);
}
return new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_9__["DomPortalOutlet"](pane, this._componentFactoryResolver, this._appRef, this._injector);
};
Overlay.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
Overlay.ctorParameters = function () { return [
{ type: ScrollStrategyOptions, },
{ type: OverlayContainer, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ComponentFactoryResolver"], },
{ type: OverlayPositionBuilder, },
{ type: OverlayKeyboardDispatcher, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injector"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"],] },] },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_8__["Directionality"], },
]; };
return Overlay;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Default set of positions for the overlay. Follows the behavior of a dropdown.
*/
var /** @type {?} */ defaultPositionList = [
{
originX: 'start',
originY: 'bottom',
overlayX: 'start',
overlayY: 'top'
},
{
originX: 'start',
originY: 'top',
overlayX: 'start',
overlayY: 'bottom'
},
{
originX: 'end',
originY: 'top',
overlayX: 'end',
overlayY: 'bottom'
},
{
originX: 'end',
originY: 'bottom',
overlayX: 'end',
overlayY: 'top'
}
];
/**
* Injection token that determines the scroll handling while the connected overlay is open.
*/
var /** @type {?} */ CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('cdk-connected-overlay-scroll-strategy', {
providedIn: 'root',
factory: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_FACTORY() {
// Store the injected deps here because we can't use the `inject` function outside
// this function's context (including the inner function).
var /** @type {?} */ scrollDispatcher = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["ScrollDispatcher"]);
var /** @type {?} */ viewportRuler = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["ViewportRuler"]);
var /** @type {?} */ ngZone = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"]);
return function (config) {
return new RepositionScrollStrategy(scrollDispatcher, viewportRuler, ngZone, config);
};
}
/**
* Directive applied to an element to make it usable as an origin for an Overlay using a
* ConnectedPositionStrategy.
*/
var CdkOverlayOrigin = /** @class */ (function () {
function CdkOverlayOrigin(elementRef) {
this.elementRef = elementRef;
}
CdkOverlayOrigin.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]',
exportAs: 'cdkOverlayOrigin',
},] },
];
/** @nocollapse */
CdkOverlayOrigin.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
]; };
return CdkOverlayOrigin;
}());
/**
* Directive to facilitate declarative creation of an Overlay using a ConnectedPositionStrategy.
*/
var CdkConnectedOverlay = /** @class */ (function () {
// TODO(jelbourn): inputs for size, scroll behavior, animation, etc.
function CdkConnectedOverlay(_overlay, templateRef, viewContainerRef, _scrollStrategy, _dir) {
this._overlay = _overlay;
this._scrollStrategy = _scrollStrategy;
this._dir = _dir;
this._hasBackdrop = false;
this._lockPosition = false;
this._backdropSubscription = rxjs__WEBPACK_IMPORTED_MODULE_5__["Subscription"].EMPTY;
/**
* Strategy to be used when handling scroll events while the overlay is open.
*/
this.scrollStrategy = this._scrollStrategy();
/**
* Whether the overlay is open.
*/
this.open = false;
/**
* Event emitted when the backdrop is clicked.
*/
this.backdropClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when the position has changed.
*/
this.positionChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when the overlay has been attached.
*/
this.attach = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when the overlay has been detached.
*/
this.detach = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this._templatePortal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_9__["TemplatePortal"](templateRef, viewContainerRef);
}
Object.defineProperty(CdkConnectedOverlay.prototype, "offsetX", {
get: /**
* The offset in pixels for the overlay connection point on the x-axis
* @return {?}
*/
function () { return this._offsetX; },
set: /**
* @param {?} offsetX
* @return {?}
*/
function (offsetX) {
this._offsetX = offsetX;
if (this._position) {
this._setPositions(this._position);
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkConnectedOverlay.prototype, "offsetY", {
get: /**
* The offset in pixels for the overlay connection point on the y-axis
* @return {?}
*/
function () { return this._offsetY; },
set: /**
* @param {?} offsetY
* @return {?}
*/
function (offsetY) {
this._offsetY = offsetY;
if (this._position) {
this._setPositions(this._position);
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkConnectedOverlay.prototype, "hasBackdrop", {
get: /**
* Whether or not the overlay should attach a backdrop.
* @return {?}
*/
function () { return this._hasBackdrop; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._hasBackdrop = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(CdkConnectedOverlay.prototype, "lockPosition", {
get: /**
* Whether or not the overlay should be locked when scrolling.
* @return {?}
*/
function () { return this._lockPosition; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._lockPosition = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(CdkConnectedOverlay.prototype, "overlayRef", {
/** The associated overlay reference. */
get: /**
* The associated overlay reference.
* @return {?}
*/
function () {
return this._overlayRef;
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkConnectedOverlay.prototype, "dir", {
/** The element's layout direction. */
get: /**
* The element's layout direction.
* @return {?}
*/
function () {
return this._dir ? this._dir.value : 'ltr';
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
CdkConnectedOverlay.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._destroyOverlay();
};
/**
* @param {?} changes
* @return {?}
*/
CdkConnectedOverlay.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
if (this._position) {
if (changes['positions'] || changes['_deprecatedPositions']) {
this._position.withPositions(this.positions);
}
if (changes['lockPosition']) {
this._position.withLockedPosition(this.lockPosition);
}
if (changes['origin'] || changes['_deprecatedOrigin']) {
this._position.setOrigin(this.origin.elementRef);
if (this.open) {
this._position.apply();
}
}
}
if (changes['open'] || changes['_deprecatedOpen']) {
this.open ? this._attachOverlay() : this._detachOverlay();
}
};
/**
* Creates an overlay
* @return {?}
*/
CdkConnectedOverlay.prototype._createOverlay = /**
* Creates an overlay
* @return {?}
*/
function () {
if (!this.positions || !this.positions.length) {
this.positions = defaultPositionList;
}
this._overlayRef = this._overlay.create(this._buildConfig());
};
/**
* Builds the overlay config based on the directive's inputs
* @return {?}
*/
CdkConnectedOverlay.prototype._buildConfig = /**
* Builds the overlay config based on the directive's inputs
* @return {?}
*/
function () {
var /** @type {?} */ positionStrategy = this._position = this._createPositionStrategy();
var /** @type {?} */ overlayConfig = new OverlayConfig({
positionStrategy: positionStrategy,
scrollStrategy: this.scrollStrategy,
hasBackdrop: this.hasBackdrop
});
if (this.width || this.width === 0) {
overlayConfig.width = this.width;
}
if (this.height || this.height === 0) {
overlayConfig.height = this.height;
}
if (this.minWidth || this.minWidth === 0) {
overlayConfig.minWidth = this.minWidth;
}
if (this.minHeight || this.minHeight === 0) {
overlayConfig.minHeight = this.minHeight;
}
if (this.backdropClass) {
overlayConfig.backdropClass = this.backdropClass;
}
return overlayConfig;
};
/**
* Returns the position strategy of the overlay to be set on the overlay config
* @return {?}
*/
CdkConnectedOverlay.prototype._createPositionStrategy = /**
* Returns the position strategy of the overlay to be set on the overlay config
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ strategy = this._overlay.position()
.flexibleConnectedTo(this.origin.elementRef)
.withFlexibleDimensions(false)
.withPush(false)
.withGrowAfterOpen(false)
.withLockedPosition(this.lockPosition);
this._setPositions(strategy);
strategy.positionChanges.subscribe(function (p) { return _this.positionChange.emit(p); });
return strategy;
};
/**
* Sets the primary and fallback positions of a positions strategy,
* based on the current directive inputs.
* @param {?} positionStrategy
* @return {?}
*/
CdkConnectedOverlay.prototype._setPositions = /**
* Sets the primary and fallback positions of a positions strategy,
* based on the current directive inputs.
* @param {?} positionStrategy
* @return {?}
*/
function (positionStrategy) {
var _this = this;
var /** @type {?} */ positions = this.positions.map(function (pos) {
return ({
originX: pos.originX,
originY: pos.originY,
overlayX: pos.overlayX,
overlayY: pos.overlayY,
offsetX: pos.offsetX || _this.offsetX,
offsetY: pos.offsetY || _this.offsetY
});
});
positionStrategy.withPositions(positions);
};
/**
* Attaches the overlay and subscribes to backdrop clicks if backdrop exists
* @return {?}
*/
CdkConnectedOverlay.prototype._attachOverlay = /**
* Attaches the overlay and subscribes to backdrop clicks if backdrop exists
* @return {?}
*/
function () {
var _this = this;
if (!this._overlayRef) {
this._createOverlay(); /** @type {?} */
((this._overlayRef)).keydownEvents().subscribe(function (event) {
if (event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__["ESCAPE"]) {
_this._detachOverlay();
}
});
}
else {
// Update the overlay size, in case the directive's inputs have changed
this._overlayRef.updateSize({
width: this.width,
minWidth: this.minWidth,
height: this.height,
minHeight: this.minHeight,
});
}
this._overlayRef.setDirection(this.dir);
if (!this._overlayRef.hasAttached()) {
this._overlayRef.attach(this._templatePortal);
this.attach.emit();
}
if (this.hasBackdrop) {
this._backdropSubscription = this._overlayRef.backdropClick().subscribe(function (event) {
_this.backdropClick.emit(event);
});
}
};
/**
* Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists
* @return {?}
*/
CdkConnectedOverlay.prototype._detachOverlay = /**
* Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists
* @return {?}
*/
function () {
if (this._overlayRef) {
this._overlayRef.detach();
this.detach.emit();
}
this._backdropSubscription.unsubscribe();
};
/**
* Destroys the overlay created by this directive.
* @return {?}
*/
CdkConnectedOverlay.prototype._destroyOverlay = /**
* Destroys the overlay created by this directive.
* @return {?}
*/
function () {
if (this._overlayRef) {
this._overlayRef.dispose();
}
this._backdropSubscription.unsubscribe();
};
CdkConnectedOverlay.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',
exportAs: 'cdkConnectedOverlay'
},] },
];
/** @nocollapse */
CdkConnectedOverlay.ctorParameters = function () { return [
{ type: Overlay, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,] },] },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_8__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
CdkConnectedOverlay.propDecorators = {
"origin": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayOrigin',] },],
"positions": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayPositions',] },],
"offsetX": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayOffsetX',] },],
"offsetY": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayOffsetY',] },],
"width": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayWidth',] },],
"height": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayHeight',] },],
"minWidth": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayMinWidth',] },],
"minHeight": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayMinHeight',] },],
"backdropClass": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayBackdropClass',] },],
"scrollStrategy": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayScrollStrategy',] },],
"open": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayOpen',] },],
"hasBackdrop": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayHasBackdrop',] },],
"lockPosition": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['cdkConnectedOverlayLockPosition',] },],
"backdropClick": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"positionChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"attach": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"detach": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
return CdkConnectedOverlay;
}());
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
* @param {?} overlay
* @return {?}
*/
function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
return function () { return overlay.scrollStrategies.reposition(); };
}
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
*/
var /** @type {?} */ CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,
deps: [Overlay],
useFactory: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY,
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var OverlayModule = /** @class */ (function () {
function OverlayModule() {
}
OverlayModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_8__["BidiModule"], _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_9__["PortalModule"], _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["ScrollDispatchModule"]],
exports: [CdkConnectedOverlay, CdkOverlayOrigin, _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["ScrollDispatchModule"]],
declarations: [CdkConnectedOverlay, CdkOverlayOrigin],
providers: [Overlay],
},] },
];
return OverlayModule;
}());
/**
* @deprecated Use `OverlayModule` instead.
* \@deletion-target 7.0.0
*/
var /** @type {?} */ OVERLAY_PROVIDERS = [
Overlay,
OverlayPositionBuilder,
OVERLAY_KEYBOARD_DISPATCHER_PROVIDER,
_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_2__["VIEWPORT_RULER_PROVIDER"],
OVERLAY_CONTAINER_PROVIDER,
CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER,
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Alternative to OverlayContainer that supports correct displaying of overlay elements in
* Fullscreen mode
* https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen
*
* Should be provided in the root component.
*/
var FullscreenOverlayContainer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_4__["__extends"])(FullscreenOverlayContainer, _super);
function FullscreenOverlayContainer(_document) {
return _super.call(this, _document) || this;
}
/**
* @return {?}
*/
FullscreenOverlayContainer.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
_super.prototype.ngOnDestroy.call(this);
if (this._fullScreenEventName && this._fullScreenListener) {
this._document.removeEventListener(this._fullScreenEventName, this._fullScreenListener);
}
};
/**
* @return {?}
*/
FullscreenOverlayContainer.prototype._createContainer = /**
* @return {?}
*/
function () {
var _this = this;
_super.prototype._createContainer.call(this);
this._adjustParentForFullscreenChange();
this._addFullscreenChangeListener(function () { return _this._adjustParentForFullscreenChange(); });
};
/**
* @return {?}
*/
FullscreenOverlayContainer.prototype._adjustParentForFullscreenChange = /**
* @return {?}
*/
function () {
if (!this._containerElement) {
return;
}
var /** @type {?} */ fullscreenElement = this.getFullscreenElement();
var /** @type {?} */ parent = fullscreenElement || this._document.body;
parent.appendChild(this._containerElement);
};
/**
* @param {?} fn
* @return {?}
*/
FullscreenOverlayContainer.prototype._addFullscreenChangeListener = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
var /** @type {?} */ eventName = this._getEventName();
if (eventName) {
if (this._fullScreenListener) {
this._document.removeEventListener(eventName, this._fullScreenListener);
}
this._document.addEventListener(eventName, fn);
this._fullScreenListener = fn;
}
};
/**
* @return {?}
*/
FullscreenOverlayContainer.prototype._getEventName = /**
* @return {?}
*/
function () {
if (!this._fullScreenEventName) {
if (this._document.fullscreenEnabled) {
this._fullScreenEventName = 'fullscreenchange';
}
else if (this._document.webkitFullscreenEnabled) {
this._fullScreenEventName = 'webkitfullscreenchange';
}
else if ((/** @type {?} */ (this._document)).mozFullScreenEnabled) {
this._fullScreenEventName = 'mozfullscreenchange';
}
else if ((/** @type {?} */ (this._document)).msFullscreenEnabled) {
this._fullScreenEventName = 'MSFullscreenChange';
}
}
return this._fullScreenEventName;
};
/**
* When the page is put into fullscreen mode, a specific element is specified.
* Only that element and its children are visible when in fullscreen mode.
*/
/**
* When the page is put into fullscreen mode, a specific element is specified.
* Only that element and its children are visible when in fullscreen mode.
* @return {?}
*/
FullscreenOverlayContainer.prototype.getFullscreenElement = /**
* When the page is put into fullscreen mode, a specific element is specified.
* Only that element and its children are visible when in fullscreen mode.
* @return {?}
*/
function () {
return this._document.fullscreenElement ||
this._document.webkitFullscreenElement ||
(/** @type {?} */ (this._document)).mozFullScreenElement ||
(/** @type {?} */ (this._document)).msFullscreenElement ||
null;
};
FullscreenOverlayContainer.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
FullscreenOverlayContainer.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"],] },] },
]; };
return FullscreenOverlayContainer;
}(OverlayContainer));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=overlay.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/platform.es5.js":
/*!********************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/platform.es5.js ***!
\********************************************************/
/*! exports provided: Platform, supportsPassiveEventListeners, getSupportedInputTypes, PlatformModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Platform", function() { return Platform; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsPassiveEventListeners", function() { return supportsPassiveEventListeners; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSupportedInputTypes", function() { return getSupportedInputTypes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlatformModule", function() { return PlatformModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
// Whether the current platform supports the V8 Break Iterator. The V8 check
// is necessary to detect all Blink based browsers.
var /** @type {?} */ hasV8BreakIterator = (typeof Intl !== 'undefined' && (/** @type {?} */ (Intl)).v8BreakIterator);
/**
* Service to detect the current platform by comparing the userAgent strings and
* checking browser-specific global properties.
*/
var Platform = /** @class */ (function () {
/**
* @deletion-target v7.0.0 remove optional decorator
*/
function Platform(_platformId) {
this._platformId = _platformId;
/**
* Whether the Angular application is being rendered in the browser.
* We want to use the Angular platform check because if the Document is shimmed
* without the navigator, the following checks will fail. This is preferred because
* sometimes the Document may be shimmed without the user's knowledge or intention
*/
this.isBrowser = this._platformId ?
Object(_angular_common__WEBPACK_IMPORTED_MODULE_1__["isPlatformBrowser"])(this._platformId) : typeof document === 'object' && !!document;
/**
* Whether the current browser is Microsoft Edge.
*/
this.EDGE = this.isBrowser && /(edge)/i.test(navigator.userAgent);
/**
* Whether the current rendering engine is Microsoft Trident.
*/
this.TRIDENT = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);
/**
* Whether the current rendering engine is Blink.
*/
this.BLINK = this.isBrowser && (!!((/** @type {?} */ (window)).chrome || hasV8BreakIterator) &&
typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT);
/**
* Whether the current rendering engine is WebKit.
*/
this.WEBKIT = this.isBrowser &&
/AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;
/**
* Whether the current platform is Apple iOS.
*/
this.IOS = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) &&
!(/** @type {?} */ (window)).MSStream;
/**
* Whether the current browser is Firefox.
*/
this.FIREFOX = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);
/**
* Whether the current platform is Android.
*/
this.ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;
/**
* Whether the current browser is Safari.
*/
this.SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;
}
Platform.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
Platform.ctorParameters = function () { return [
{ type: Object, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"],] },] },
]; };
/** @nocollapse */ Platform.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["defineInjectable"])({ factory: function Platform_Factory() { return new Platform(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"], 8)); }, token: Platform, providedIn: "root" });
return Platform;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Cached result of whether the user's browser supports passive event listeners.
*/
var /** @type {?} */ supportsPassiveEvents;
/**
* Checks whether the user's browser supports passive event listeners.
* See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
* @return {?}
*/
function supportsPassiveEventListeners() {
if (supportsPassiveEvents == null && typeof window !== 'undefined') {
try {
window.addEventListener('test', /** @type {?} */ ((null)), Object.defineProperty({}, 'passive', {
get: function () { return supportsPassiveEvents = true; }
}));
}
finally {
supportsPassiveEvents = supportsPassiveEvents || false;
}
}
return supportsPassiveEvents;
}
/**
* Cached result Set of input types support by the current browser.
*/
var /** @type {?} */ supportedInputTypes;
/**
* Types of `<input>` that *might* be supported.
*/
var /** @type {?} */ candidateInputTypes = [
'color',
'button',
'checkbox',
'date',
'datetime-local',
'email',
'file',
'hidden',
'image',
'month',
'number',
'password',
'radio',
'range',
'reset',
'search',
'submit',
'tel',
'text',
'time',
'url',
'week',
];
/**
* @return {?} The input types supported by this browser.
*/
function getSupportedInputTypes() {
// Result is cached.
if (supportedInputTypes) {
return supportedInputTypes;
}
// We can't check if an input type is not supported until we're on the browser, so say that
// everything is supported when not on the browser. We don't use `Platform` here since it's
// just a helper function and can't inject it.
if (typeof document !== 'object' || !document) {
supportedInputTypes = new Set(candidateInputTypes);
return supportedInputTypes;
}
var /** @type {?} */ featureTestInput = document.createElement('input');
supportedInputTypes = new Set(candidateInputTypes.filter(function (value) {
featureTestInput.setAttribute('type', value);
return featureTestInput.type === value;
}));
return supportedInputTypes;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var PlatformModule = /** @class */ (function () {
function PlatformModule() {
}
PlatformModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"] },
];
return PlatformModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=platform.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/portal.es5.js":
/*!******************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/portal.es5.js ***!
\******************************************************/
/*! exports provided: DomPortalHost, PortalHostDirective, TemplatePortalDirective, BasePortalHost, Portal, ComponentPortal, TemplatePortal, BasePortalOutlet, DomPortalOutlet, CdkPortal, CdkPortalOutlet, PortalModule, PortalInjector */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DomPortalHost", function() { return DomPortalOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortalHostDirective", function() { return CdkPortalOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplatePortalDirective", function() { return CdkPortal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasePortalHost", function() { return BasePortalOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Portal", function() { return Portal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentPortal", function() { return ComponentPortal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplatePortal", function() { return TemplatePortal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasePortalOutlet", function() { return BasePortalOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DomPortalOutlet", function() { return DomPortalOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkPortal", function() { return CdkPortal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkPortalOutlet", function() { return CdkPortalOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortalModule", function() { return PortalModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortalInjector", function() { return PortalInjector; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Throws an exception when attempting to attach a null portal to a host.
* \@docs-private
* @return {?}
*/
function throwNullPortalError() {
throw Error('Must provide a portal to attach');
}
/**
* Throws an exception when attempting to attach a portal to a host that is already attached.
* \@docs-private
* @return {?}
*/
function throwPortalAlreadyAttachedError() {
throw Error('Host already has a portal attached');
}
/**
* Throws an exception when attempting to attach a portal to an already-disposed host.
* \@docs-private
* @return {?}
*/
function throwPortalOutletAlreadyDisposedError() {
throw Error('This PortalOutlet has already been disposed');
}
/**
* Throws an exception when attempting to attach an unknown portal type.
* \@docs-private
* @return {?}
*/
function throwUnknownPortalTypeError() {
throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +
'a ComponentPortal or a TemplatePortal.');
}
/**
* Throws an exception when attempting to attach a portal to a null host.
* \@docs-private
* @return {?}
*/
function throwNullPortalOutletError() {
throw Error('Attempting to attach a portal to a null PortalOutlet');
}
/**
* Throws an exception when attempting to detach a portal that is not attached.
* \@docs-private
* @return {?}
*/
function throwNoPortalAttachedError() {
throw Error('Attempting to detach a portal that is not attached to a host');
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* A `Portal` is something that you want to render somewhere else.
* It can be attach to / detached from a `PortalOutlet`.
* @abstract
* @template T
*/
var /**
* A `Portal` is something that you want to render somewhere else.
* It can be attach to / detached from a `PortalOutlet`.
* @abstract
* @template T
*/
Portal = /** @class */ (function () {
function Portal() {
}
/** Attach this portal to a host. */
/**
* Attach this portal to a host.
* @param {?} host
* @return {?}
*/
Portal.prototype.attach = /**
* Attach this portal to a host.
* @param {?} host
* @return {?}
*/
function (host) {
if (host == null) {
throwNullPortalOutletError();
}
if (host.hasAttached()) {
throwPortalAlreadyAttachedError();
}
this._attachedHost = host;
return /** @type {?} */ (host.attach(this));
};
/** Detach this portal from its host */
/**
* Detach this portal from its host
* @return {?}
*/
Portal.prototype.detach = /**
* Detach this portal from its host
* @return {?}
*/
function () {
var /** @type {?} */ host = this._attachedHost;
if (host == null) {
throwNoPortalAttachedError();
}
else {
this._attachedHost = null;
host.detach();
}
};
Object.defineProperty(Portal.prototype, "isAttached", {
/** Whether this portal is attached to a host. */
get: /**
* Whether this portal is attached to a host.
* @return {?}
*/
function () {
return this._attachedHost != null;
},
enumerable: true,
configurable: true
});
/**
* Sets the PortalOutlet reference without performing `attach()`. This is used directly by
* the PortalOutlet when it is performing an `attach()` or `detach()`.
*/
/**
* Sets the PortalOutlet reference without performing `attach()`. This is used directly by
* the PortalOutlet when it is performing an `attach()` or `detach()`.
* @param {?} host
* @return {?}
*/
Portal.prototype.setAttachedHost = /**
* Sets the PortalOutlet reference without performing `attach()`. This is used directly by
* the PortalOutlet when it is performing an `attach()` or `detach()`.
* @param {?} host
* @return {?}
*/
function (host) {
this._attachedHost = host;
};
return Portal;
}());
/**
* A `ComponentPortal` is a portal that instantiates some Component upon attachment.
* @template T
*/
var /**
* A `ComponentPortal` is a portal that instantiates some Component upon attachment.
* @template T
*/
ComponentPortal = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ComponentPortal, _super);
function ComponentPortal(component, viewContainerRef, injector) {
var _this = _super.call(this) || this;
_this.component = component;
_this.viewContainerRef = viewContainerRef;
_this.injector = injector;
return _this;
}
return ComponentPortal;
}(Portal));
/**
* A `TemplatePortal` is a portal that represents some embedded template (TemplateRef).
* @template C
*/
var /**
* A `TemplatePortal` is a portal that represents some embedded template (TemplateRef).
* @template C
*/
TemplatePortal = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TemplatePortal, _super);
function TemplatePortal(template, viewContainerRef, context) {
var _this = _super.call(this) || this;
_this.templateRef = template;
_this.viewContainerRef = viewContainerRef;
_this.context = context;
return _this;
}
Object.defineProperty(TemplatePortal.prototype, "origin", {
get: /**
* @return {?}
*/
function () {
return this.templateRef.elementRef;
},
enumerable: true,
configurable: true
});
/**
* Attach the the portal to the provided `PortalOutlet`.
* When a context is provided it will override the `context` property of the `TemplatePortal`
* instance.
*/
/**
* Attach the the portal to the provided `PortalOutlet`.
* When a context is provided it will override the `context` property of the `TemplatePortal`
* instance.
* @param {?} host
* @param {?=} context
* @return {?}
*/
TemplatePortal.prototype.attach = /**
* Attach the the portal to the provided `PortalOutlet`.
* When a context is provided it will override the `context` property of the `TemplatePortal`
* instance.
* @param {?} host
* @param {?=} context
* @return {?}
*/
function (host, context) {
if (context === void 0) { context = this.context; }
this.context = context;
return _super.prototype.attach.call(this, host);
};
/**
* @return {?}
*/
TemplatePortal.prototype.detach = /**
* @return {?}
*/
function () {
this.context = undefined;
return _super.prototype.detach.call(this);
};
return TemplatePortal;
}(Portal));
/**
* Partial implementation of PortalOutlet that handles attaching
* ComponentPortal and TemplatePortal.
* @abstract
*/
var /**
* Partial implementation of PortalOutlet that handles attaching
* ComponentPortal and TemplatePortal.
* @abstract
*/
BasePortalOutlet = /** @class */ (function () {
function BasePortalOutlet() {
/**
* Whether this host has already been permanently disposed.
*/
this._isDisposed = false;
}
/** Whether this host has an attached portal. */
/**
* Whether this host has an attached portal.
* @return {?}
*/
BasePortalOutlet.prototype.hasAttached = /**
* Whether this host has an attached portal.
* @return {?}
*/
function () {
return !!this._attachedPortal;
};
/** Attaches a portal. */
/**
* Attaches a portal.
* @param {?} portal
* @return {?}
*/
BasePortalOutlet.prototype.attach = /**
* Attaches a portal.
* @param {?} portal
* @return {?}
*/
function (portal) {
if (!portal) {
throwNullPortalError();
}
if (this.hasAttached()) {
throwPortalAlreadyAttachedError();
}
if (this._isDisposed) {
throwPortalOutletAlreadyDisposedError();
}
if (portal instanceof ComponentPortal) {
this._attachedPortal = portal;
return this.attachComponentPortal(portal);
}
else if (portal instanceof TemplatePortal) {
this._attachedPortal = portal;
return this.attachTemplatePortal(portal);
}
throwUnknownPortalTypeError();
};
/** Detaches a previously attached portal. */
/**
* Detaches a previously attached portal.
* @return {?}
*/
BasePortalOutlet.prototype.detach = /**
* Detaches a previously attached portal.
* @return {?}
*/
function () {
if (this._attachedPortal) {
this._attachedPortal.setAttachedHost(null);
this._attachedPortal = null;
}
this._invokeDisposeFn();
};
/** Permanently dispose of this portal host. */
/**
* Permanently dispose of this portal host.
* @return {?}
*/
BasePortalOutlet.prototype.dispose = /**
* Permanently dispose of this portal host.
* @return {?}
*/
function () {
if (this.hasAttached()) {
this.detach();
}
this._invokeDisposeFn();
this._isDisposed = true;
};
/** @docs-private */
/**
* \@docs-private
* @param {?} fn
* @return {?}
*/
BasePortalOutlet.prototype.setDisposeFn = /**
* \@docs-private
* @param {?} fn
* @return {?}
*/
function (fn) {
this._disposeFn = fn;
};
/**
* @return {?}
*/
BasePortalOutlet.prototype._invokeDisposeFn = /**
* @return {?}
*/
function () {
if (this._disposeFn) {
this._disposeFn();
this._disposeFn = null;
}
};
return BasePortalOutlet;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* A PortalOutlet for attaching portals to an arbitrary DOM element outside of the Angular
* application context.
*/
var /**
* A PortalOutlet for attaching portals to an arbitrary DOM element outside of the Angular
* application context.
*/
DomPortalOutlet = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(DomPortalOutlet, _super);
function DomPortalOutlet(outletElement, _componentFactoryResolver, _appRef, _defaultInjector) {
var _this = _super.call(this) || this;
_this.outletElement = outletElement;
_this._componentFactoryResolver = _componentFactoryResolver;
_this._appRef = _appRef;
_this._defaultInjector = _defaultInjector;
return _this;
}
/**
* Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver.
* @param portal Portal to be attached
* @returns Reference to the created component.
*/
/**
* Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver.
* @template T
* @param {?} portal Portal to be attached
* @return {?} Reference to the created component.
*/
DomPortalOutlet.prototype.attachComponentPortal = /**
* Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver.
* @template T
* @param {?} portal Portal to be attached
* @return {?} Reference to the created component.
*/
function (portal) {
var _this = this;
var /** @type {?} */ componentFactory = this._componentFactoryResolver.resolveComponentFactory(portal.component);
var /** @type {?} */ componentRef;
// If the portal specifies a ViewContainerRef, we will use that as the attachment point
// for the component (in terms of Angular's component tree, not rendering).
// When the ViewContainerRef is missing, we use the factory to create the component directly
// and then manually attach the view to the application.
if (portal.viewContainerRef) {
componentRef = portal.viewContainerRef.createComponent(componentFactory, portal.viewContainerRef.length, portal.injector || portal.viewContainerRef.parentInjector);
this.setDisposeFn(function () { return componentRef.destroy(); });
}
else {
componentRef = componentFactory.create(portal.injector || this._defaultInjector);
this._appRef.attachView(componentRef.hostView);
this.setDisposeFn(function () {
_this._appRef.detachView(componentRef.hostView);
componentRef.destroy();
});
}
// At this point the component has been instantiated, so we move it to the location in the DOM
// where we want it to be rendered.
this.outletElement.appendChild(this._getComponentRootNode(componentRef));
return componentRef;
};
/**
* Attaches a template portal to the DOM as an embedded view.
* @param portal Portal to be attached.
* @returns Reference to the created embedded view.
*/
/**
* Attaches a template portal to the DOM as an embedded view.
* @template C
* @param {?} portal Portal to be attached.
* @return {?} Reference to the created embedded view.
*/
DomPortalOutlet.prototype.attachTemplatePortal = /**
* Attaches a template portal to the DOM as an embedded view.
* @template C
* @param {?} portal Portal to be attached.
* @return {?} Reference to the created embedded view.
*/
function (portal) {
var _this = this;
var /** @type {?} */ viewContainer = portal.viewContainerRef;
var /** @type {?} */ viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context);
viewRef.detectChanges();
// The method `createEmbeddedView` will add the view as a child of the viewContainer.
// But for the DomPortalOutlet the view can be added everywhere in the DOM
// (e.g Overlay Container) To move the view to the specified host element. We just
// re-append the existing root nodes.
viewRef.rootNodes.forEach(function (rootNode) { return _this.outletElement.appendChild(rootNode); });
this.setDisposeFn((function () {
var /** @type {?} */ index = viewContainer.indexOf(viewRef);
if (index !== -1) {
viewContainer.remove(index);
}
}));
// TODO(jelbourn): Return locals from view.
return viewRef;
};
/**
* Clears out a portal from the DOM.
*/
/**
* Clears out a portal from the DOM.
* @return {?}
*/
DomPortalOutlet.prototype.dispose = /**
* Clears out a portal from the DOM.
* @return {?}
*/
function () {
_super.prototype.dispose.call(this);
if (this.outletElement.parentNode != null) {
this.outletElement.parentNode.removeChild(this.outletElement);
}
};
/**
* Gets the root HTMLElement for an instantiated component.
* @param {?} componentRef
* @return {?}
*/
DomPortalOutlet.prototype._getComponentRootNode = /**
* Gets the root HTMLElement for an instantiated component.
* @param {?} componentRef
* @return {?}
*/
function (componentRef) {
return /** @type {?} */ ((/** @type {?} */ (componentRef.hostView)).rootNodes[0]);
};
return DomPortalOutlet;
}(BasePortalOutlet));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal,
* the directive instance itself can be attached to a host, enabling declarative use of portals.
*/
var CdkPortal = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CdkPortal, _super);
function CdkPortal(templateRef, viewContainerRef) {
return _super.call(this, templateRef, viewContainerRef) || this;
}
CdkPortal.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[cdk-portal], [cdkPortal], [portal]',
exportAs: 'cdkPortal',
},] },
];
/** @nocollapse */
CdkPortal.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"], },
]; };
return CdkPortal;
}(TemplatePortal));
/**
* Directive version of a PortalOutlet. Because the directive *is* a PortalOutlet, portals can be
* directly attached to it, enabling declarative use.
*
* Usage:
* `<ng-template [cdkPortalOutlet]="greeting"></ng-template>`
*/
var CdkPortalOutlet = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CdkPortalOutlet, _super);
function CdkPortalOutlet(_componentFactoryResolver, _viewContainerRef) {
var _this = _super.call(this) || this;
_this._componentFactoryResolver = _componentFactoryResolver;
_this._viewContainerRef = _viewContainerRef;
/**
* Whether the portal component is initialized.
*/
_this._isInitialized = false;
_this.attached = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
return _this;
}
Object.defineProperty(CdkPortalOutlet.prototype, "portal", {
/** Portal associated with the Portal outlet. */
get: /**
* Portal associated with the Portal outlet.
* @return {?}
*/
function () {
return this._attachedPortal;
},
set: /**
* @param {?} portal
* @return {?}
*/
function (portal) {
// Ignore the cases where the `portal` is set to a falsy value before the lifecycle hooks have
// run. This handles the cases where the user might do something like `<div cdkPortalOutlet>`
// and attach a portal programmatically in the parent component. When Angular does the first CD
// round, it will fire the setter with empty string, causing the user's content to be cleared.
if (this.hasAttached() && !portal && !this._isInitialized) {
return;
}
if (this.hasAttached()) {
_super.prototype.detach.call(this);
}
if (portal) {
_super.prototype.attach.call(this, portal);
}
this._attachedPortal = portal;
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkPortalOutlet.prototype, "attachedRef", {
/** Component or view reference that is attached to the portal. */
get: /**
* Component or view reference that is attached to the portal.
* @return {?}
*/
function () {
return this._attachedRef;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
CdkPortalOutlet.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._isInitialized = true;
};
/**
* @return {?}
*/
CdkPortalOutlet.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
_super.prototype.dispose.call(this);
this._attachedPortal = null;
this._attachedRef = null;
};
/**
* Attach the given ComponentPortal to this PortalOutlet using the ComponentFactoryResolver.
*
* @param portal Portal to be attached to the portal outlet.
* @returns Reference to the created component.
*/
/**
* Attach the given ComponentPortal to this PortalOutlet using the ComponentFactoryResolver.
*
* @template T
* @param {?} portal Portal to be attached to the portal outlet.
* @return {?} Reference to the created component.
*/
CdkPortalOutlet.prototype.attachComponentPortal = /**
* Attach the given ComponentPortal to this PortalOutlet using the ComponentFactoryResolver.
*
* @template T
* @param {?} portal Portal to be attached to the portal outlet.
* @return {?} Reference to the created component.
*/
function (portal) {
portal.setAttachedHost(this);
// If the portal specifies an origin, use that as the logical location of the component
// in the application tree. Otherwise use the location of this PortalOutlet.
var /** @type {?} */ viewContainerRef = portal.viewContainerRef != null ?
portal.viewContainerRef :
this._viewContainerRef;
var /** @type {?} */ componentFactory = this._componentFactoryResolver.resolveComponentFactory(portal.component);
var /** @type {?} */ ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.parentInjector);
_super.prototype.setDisposeFn.call(this, function () { return ref.destroy(); });
this._attachedPortal = portal;
this._attachedRef = ref;
this.attached.emit(ref);
return ref;
};
/**
* Attach the given TemplatePortal to this PortlHost as an embedded View.
* @param portal Portal to be attached.
* @returns Reference to the created embedded view.
*/
/**
* Attach the given TemplatePortal to this PortlHost as an embedded View.
* @template C
* @param {?} portal Portal to be attached.
* @return {?} Reference to the created embedded view.
*/
CdkPortalOutlet.prototype.attachTemplatePortal = /**
* Attach the given TemplatePortal to this PortlHost as an embedded View.
* @template C
* @param {?} portal Portal to be attached.
* @return {?} Reference to the created embedded view.
*/
function (portal) {
var _this = this;
portal.setAttachedHost(this);
var /** @type {?} */ viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context);
_super.prototype.setDisposeFn.call(this, function () { return _this._viewContainerRef.clear(); });
this._attachedPortal = portal;
this._attachedRef = viewRef;
this.attached.emit(viewRef);
return viewRef;
};
CdkPortalOutlet.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[cdkPortalOutlet], [cdkPortalHost], [portalHost]',
exportAs: 'cdkPortalOutlet, cdkPortalHost',
inputs: ['portal: cdkPortalOutlet']
},] },
];
/** @nocollapse */
CdkPortalOutlet.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactoryResolver"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"], },
]; };
CdkPortalOutlet.propDecorators = {
"attached": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"], args: ['attached',] },],
};
return CdkPortalOutlet;
}(BasePortalOutlet));
var PortalModule = /** @class */ (function () {
function PortalModule() {
}
PortalModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
exports: [CdkPortal, CdkPortalOutlet],
declarations: [CdkPortal, CdkPortalOutlet],
},] },
];
return PortalModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Custom injector to be used when providing custom
* injection tokens to components inside a portal.
* \@docs-private
*/
var /**
* Custom injector to be used when providing custom
* injection tokens to components inside a portal.
* \@docs-private
*/
PortalInjector = /** @class */ (function () {
function PortalInjector(_parentInjector, _customTokens) {
this._parentInjector = _parentInjector;
this._customTokens = _customTokens;
}
/**
* @param {?} token
* @param {?=} notFoundValue
* @return {?}
*/
PortalInjector.prototype.get = /**
* @param {?} token
* @param {?=} notFoundValue
* @return {?}
*/
function (token, notFoundValue) {
var /** @type {?} */ value = this._customTokens.get(token);
if (typeof value !== 'undefined') {
return value;
}
return this._parentInjector.get(token, notFoundValue);
};
return PortalInjector;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=portal.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/scrolling.es5.js":
/*!*********************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/scrolling.es5.js ***!
\*********************************************************/
/*! exports provided: DEFAULT_SCROLL_TIME, ScrollDispatcher, SCROLL_DISPATCHER_PROVIDER_FACTORY, SCROLL_DISPATCHER_PROVIDER, CdkScrollable, DEFAULT_RESIZE_TIME, ViewportRuler, VIEWPORT_RULER_PROVIDER_FACTORY, VIEWPORT_RULER_PROVIDER, ScrollDispatchModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_SCROLL_TIME", function() { return DEFAULT_SCROLL_TIME; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollDispatcher", function() { return ScrollDispatcher; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCROLL_DISPATCHER_PROVIDER_FACTORY", function() { return SCROLL_DISPATCHER_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCROLL_DISPATCHER_PROVIDER", function() { return SCROLL_DISPATCHER_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkScrollable", function() { return CdkScrollable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_RESIZE_TIME", function() { return DEFAULT_RESIZE_TIME; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewportRuler", function() { return ViewportRuler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VIEWPORT_RULER_PROVIDER_FACTORY", function() { return VIEWPORT_RULER_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VIEWPORT_RULER_PROVIDER", function() { return VIEWPORT_RULER_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollDispatchModule", function() { return ScrollDispatchModule; });
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Time in ms to throttle the scrolling events by default.
*/
var /** @type {?} */ DEFAULT_SCROLL_TIME = 20;
/**
* Service contained all registered Scrollable references and emits an event when any one of the
* Scrollable references emit a scrolled event.
*/
var ScrollDispatcher = /** @class */ (function () {
function ScrollDispatcher(_ngZone, _platform) {
this._ngZone = _ngZone;
this._platform = _platform;
/**
* Subject for notifying that a registered scrollable reference element has been scrolled.
*/
this._scrolled = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
/**
* Keeps track of the global `scroll` and `resize` subscriptions.
*/
this._globalSubscription = null;
/**
* Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards.
*/
this._scrolledCount = 0;
/**
* Map of all the scrollable references that are registered with the service and their
* scroll event subscriptions.
*/
this.scrollContainers = new Map();
}
/**
* Registers a scrollable instance with the service and listens for its scrolled events. When the
* scrollable is scrolled, the service emits the event to its scrolled observable.
* @param scrollable Scrollable instance to be registered.
*/
/**
* Registers a scrollable instance with the service and listens for its scrolled events. When the
* scrollable is scrolled, the service emits the event to its scrolled observable.
* @param {?} scrollable Scrollable instance to be registered.
* @return {?}
*/
ScrollDispatcher.prototype.register = /**
* Registers a scrollable instance with the service and listens for its scrolled events. When the
* scrollable is scrolled, the service emits the event to its scrolled observable.
* @param {?} scrollable Scrollable instance to be registered.
* @return {?}
*/
function (scrollable) {
var _this = this;
var /** @type {?} */ scrollSubscription = scrollable.elementScrolled()
.subscribe(function () { return _this._scrolled.next(scrollable); });
this.scrollContainers.set(scrollable, scrollSubscription);
};
/**
* Deregisters a Scrollable reference and unsubscribes from its scroll event observable.
* @param scrollable Scrollable instance to be deregistered.
*/
/**
* Deregisters a Scrollable reference and unsubscribes from its scroll event observable.
* @param {?} scrollable Scrollable instance to be deregistered.
* @return {?}
*/
ScrollDispatcher.prototype.deregister = /**
* Deregisters a Scrollable reference and unsubscribes from its scroll event observable.
* @param {?} scrollable Scrollable instance to be deregistered.
* @return {?}
*/
function (scrollable) {
var /** @type {?} */ scrollableReference = this.scrollContainers.get(scrollable);
if (scrollableReference) {
scrollableReference.unsubscribe();
this.scrollContainers.delete(scrollable);
}
};
/**
* Returns an observable that emits an event whenever any of the registered Scrollable
* references (or window, document, or body) fire a scrolled event. Can provide a time in ms
* to override the default "throttle" time.
*
* **Note:** in order to avoid hitting change detection for every scroll event,
* all of the events emitted from this stream will be run outside the Angular zone.
* If you need to update any data bindings as a result of a scroll event, you have
* to run the callback using `NgZone.run`.
*/
/**
* Returns an observable that emits an event whenever any of the registered Scrollable
* references (or window, document, or body) fire a scrolled event. Can provide a time in ms
* to override the default "throttle" time.
*
* **Note:** in order to avoid hitting change detection for every scroll event,
* all of the events emitted from this stream will be run outside the Angular zone.
* If you need to update any data bindings as a result of a scroll event, you have
* to run the callback using `NgZone.run`.
* @param {?=} auditTimeInMs
* @return {?}
*/
ScrollDispatcher.prototype.scrolled = /**
* Returns an observable that emits an event whenever any of the registered Scrollable
* references (or window, document, or body) fire a scrolled event. Can provide a time in ms
* to override the default "throttle" time.
*
* **Note:** in order to avoid hitting change detection for every scroll event,
* all of the events emitted from this stream will be run outside the Angular zone.
* If you need to update any data bindings as a result of a scroll event, you have
* to run the callback using `NgZone.run`.
* @param {?=} auditTimeInMs
* @return {?}
*/
function (auditTimeInMs) {
var _this = this;
if (auditTimeInMs === void 0) { auditTimeInMs = DEFAULT_SCROLL_TIME; }
return this._platform.isBrowser ? rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"].create(function (observer) {
if (!_this._globalSubscription) {
_this._addGlobalListener();
}
// In the case of a 0ms delay, use an observable without auditTime
// since it does add a perceptible delay in processing overhead.
var /** @type {?} */ subscription = auditTimeInMs > 0 ?
_this._scrolled.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["auditTime"])(auditTimeInMs)).subscribe(observer) :
_this._scrolled.subscribe(observer);
_this._scrolledCount++;
return function () {
subscription.unsubscribe();
_this._scrolledCount--;
if (!_this._scrolledCount) {
_this._removeGlobalListener();
}
};
}) : Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])();
};
/**
* @return {?}
*/
ScrollDispatcher.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
var _this = this;
this._removeGlobalListener();
this.scrollContainers.forEach(function (_, container) { return _this.deregister(container); });
this._scrolled.complete();
};
/**
* Returns an observable that emits whenever any of the
* scrollable ancestors of an element are scrolled.
* @param elementRef Element whose ancestors to listen for.
* @param auditTimeInMs Time to throttle the scroll events.
*/
/**
* Returns an observable that emits whenever any of the
* scrollable ancestors of an element are scrolled.
* @param {?} elementRef Element whose ancestors to listen for.
* @param {?=} auditTimeInMs Time to throttle the scroll events.
* @return {?}
*/
ScrollDispatcher.prototype.ancestorScrolled = /**
* Returns an observable that emits whenever any of the
* scrollable ancestors of an element are scrolled.
* @param {?} elementRef Element whose ancestors to listen for.
* @param {?=} auditTimeInMs Time to throttle the scroll events.
* @return {?}
*/
function (elementRef, auditTimeInMs) {
var /** @type {?} */ ancestors = this.getAncestorScrollContainers(elementRef);
return this.scrolled(auditTimeInMs).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])(function (target) {
return !target || ancestors.indexOf(target) > -1;
}));
};
/** Returns all registered Scrollables that contain the provided element. */
/**
* Returns all registered Scrollables that contain the provided element.
* @param {?} elementRef
* @return {?}
*/
ScrollDispatcher.prototype.getAncestorScrollContainers = /**
* Returns all registered Scrollables that contain the provided element.
* @param {?} elementRef
* @return {?}
*/
function (elementRef) {
var _this = this;
var /** @type {?} */ scrollingContainers = [];
this.scrollContainers.forEach(function (_subscription, scrollable) {
if (_this._scrollableContainsElement(scrollable, elementRef)) {
scrollingContainers.push(scrollable);
}
});
return scrollingContainers;
};
/**
* Returns true if the element is contained within the provided Scrollable.
* @param {?} scrollable
* @param {?} elementRef
* @return {?}
*/
ScrollDispatcher.prototype._scrollableContainsElement = /**
* Returns true if the element is contained within the provided Scrollable.
* @param {?} scrollable
* @param {?} elementRef
* @return {?}
*/
function (scrollable, elementRef) {
var /** @type {?} */ element = elementRef.nativeElement;
var /** @type {?} */ scrollableElement = scrollable.getElementRef().nativeElement;
// Traverse through the element parents until we reach null, checking if any of the elements
// are the scrollable's element.
do {
if (element == scrollableElement) {
return true;
}
} while (element = element.parentElement);
return false;
};
/**
* Sets up the global scroll listeners.
* @return {?}
*/
ScrollDispatcher.prototype._addGlobalListener = /**
* Sets up the global scroll listeners.
* @return {?}
*/
function () {
var _this = this;
this._globalSubscription = this._ngZone.runOutsideAngular(function () {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["fromEvent"])(window.document, 'scroll').subscribe(function () { return _this._scrolled.next(); });
});
};
/**
* Cleans up the global scroll listener.
* @return {?}
*/
ScrollDispatcher.prototype._removeGlobalListener = /**
* Cleans up the global scroll listener.
* @return {?}
*/
function () {
if (this._globalSubscription) {
this._globalSubscription.unsubscribe();
this._globalSubscription = null;
}
};
ScrollDispatcher.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
ScrollDispatcher.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__["Platform"], },
]; };
/** @nocollapse */ ScrollDispatcher.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function ScrollDispatcher_Factory() { return new ScrollDispatcher(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"]), Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__["Platform"])); }, token: ScrollDispatcher, providedIn: "root" });
return ScrollDispatcher;
}());
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
* @param {?} parentDispatcher
* @param {?} ngZone
* @param {?} platform
* @return {?}
*/
function SCROLL_DISPATCHER_PROVIDER_FACTORY(parentDispatcher, ngZone, platform) {
return parentDispatcher || new ScrollDispatcher(ngZone, platform);
}
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
*/
var /** @type {?} */ SCROLL_DISPATCHER_PROVIDER = {
// If there is already a ScrollDispatcher available, use that. Otherwise, provide a new one.
provide: ScrollDispatcher,
deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"](), ScrollDispatcher], _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__["Platform"]],
useFactory: SCROLL_DISPATCHER_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Sends an event when the directive's element is scrolled. Registers itself with the
* ScrollDispatcher service to include itself as part of its collection of scrolling events that it
* can be listened to through the service.
*/
var CdkScrollable = /** @class */ (function () {
function CdkScrollable(_elementRef, _scroll, _ngZone) {
var _this = this;
this._elementRef = _elementRef;
this._scroll = _scroll;
this._ngZone = _ngZone;
this._elementScrolled = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
this._scrollListener = function (event) { return _this._elementScrolled.next(event); };
}
/**
* @return {?}
*/
CdkScrollable.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
this._ngZone.runOutsideAngular(function () {
_this.getElementRef().nativeElement.addEventListener('scroll', _this._scrollListener);
});
this._scroll.register(this);
};
/**
* @return {?}
*/
CdkScrollable.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._scroll.deregister(this);
if (this._scrollListener) {
this.getElementRef().nativeElement.removeEventListener('scroll', this._scrollListener);
}
};
/**
* Returns observable that emits when a scroll event is fired on the host element.
*/
/**
* Returns observable that emits when a scroll event is fired on the host element.
* @return {?}
*/
CdkScrollable.prototype.elementScrolled = /**
* Returns observable that emits when a scroll event is fired on the host element.
* @return {?}
*/
function () {
return this._elementScrolled.asObservable();
};
/**
* @return {?}
*/
CdkScrollable.prototype.getElementRef = /**
* @return {?}
*/
function () {
return this._elementRef;
};
CdkScrollable.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[cdk-scrollable], [cdkScrollable]'
},] },
];
/** @nocollapse */
CdkScrollable.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: ScrollDispatcher, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], },
]; };
return CdkScrollable;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Time in ms to throttle the resize events by default.
*/
var /** @type {?} */ DEFAULT_RESIZE_TIME = 20;
/**
* Simple utility for getting the bounds of the browser viewport.
* \@docs-private
*/
var ViewportRuler = /** @class */ (function () {
function ViewportRuler(_platform, ngZone) {
var _this = this;
this._platform = _platform;
this._change = _platform.isBrowser ? ngZone.runOutsideAngular(function () {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["merge"])(Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["fromEvent"])(window, 'resize'), Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["fromEvent"])(window, 'orientationchange'));
}) : Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])();
this._invalidateCache = this.change().subscribe(function () { return _this._updateViewportSize(); });
}
/**
* @return {?}
*/
ViewportRuler.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._invalidateCache.unsubscribe();
};
/** Returns the viewport's width and height. */
/**
* Returns the viewport's width and height.
* @return {?}
*/
ViewportRuler.prototype.getViewportSize = /**
* Returns the viewport's width and height.
* @return {?}
*/
function () {
if (!this._viewportSize) {
this._updateViewportSize();
}
var /** @type {?} */ output = { width: this._viewportSize.width, height: this._viewportSize.height };
// If we're not on a browser, don't cache the size since it'll be mocked out anyway.
if (!this._platform.isBrowser) {
this._viewportSize = /** @type {?} */ ((null));
}
return output;
};
/** Gets a ClientRect for the viewport's bounds. */
/**
* Gets a ClientRect for the viewport's bounds.
* @return {?}
*/
ViewportRuler.prototype.getViewportRect = /**
* Gets a ClientRect for the viewport's bounds.
* @return {?}
*/
function () {
// Use the document element's bounding rect rather than the window scroll properties
// (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll
// properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different
// conceptual viewports. Under most circumstances these viewports are equivalent, but they
// can disagree when the page is pinch-zoomed (on devices that support touch).
// See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4
// We use the documentElement instead of the body because, by default (without a css reset)
// browsers typically give the document body an 8px margin, which is not included in
// getBoundingClientRect().
var /** @type {?} */ scrollPosition = this.getViewportScrollPosition();
var _a = this.getViewportSize(), width = _a.width, height = _a.height;
return {
top: scrollPosition.top,
left: scrollPosition.left,
bottom: scrollPosition.top + height,
right: scrollPosition.left + width,
height: height,
width: width,
};
};
/** Gets the (top, left) scroll position of the viewport. */
/**
* Gets the (top, left) scroll position of the viewport.
* @return {?}
*/
ViewportRuler.prototype.getViewportScrollPosition = /**
* Gets the (top, left) scroll position of the viewport.
* @return {?}
*/
function () {
// While we can get a reference to the fake document
// during SSR, it doesn't have getBoundingClientRect.
if (!this._platform.isBrowser) {
return { top: 0, left: 0 };
}
// The top-left-corner of the viewport is determined by the scroll position of the document
// body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about
// whether `document.body` or `document.documentElement` is the scrolled element, so reading
// `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of
// `document.documentElement` works consistently, where the `top` and `left` values will
// equal negative the scroll position.
var /** @type {?} */ documentRect = document.documentElement.getBoundingClientRect();
var /** @type {?} */ top = -documentRect.top || document.body.scrollTop || window.scrollY ||
document.documentElement.scrollTop || 0;
var /** @type {?} */ left = -documentRect.left || document.body.scrollLeft || window.scrollX ||
document.documentElement.scrollLeft || 0;
return { top: top, left: left };
};
/**
* Returns a stream that emits whenever the size of the viewport changes.
* @param throttleTime Time in milliseconds to throttle the stream.
*/
/**
* Returns a stream that emits whenever the size of the viewport changes.
* @param {?=} throttleTime Time in milliseconds to throttle the stream.
* @return {?}
*/
ViewportRuler.prototype.change = /**
* Returns a stream that emits whenever the size of the viewport changes.
* @param {?=} throttleTime Time in milliseconds to throttle the stream.
* @return {?}
*/
function (throttleTime) {
if (throttleTime === void 0) { throttleTime = DEFAULT_RESIZE_TIME; }
return throttleTime > 0 ? this._change.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["auditTime"])(throttleTime)) : this._change;
};
/**
* Updates the cached viewport size.
* @return {?}
*/
ViewportRuler.prototype._updateViewportSize = /**
* Updates the cached viewport size.
* @return {?}
*/
function () {
this._viewportSize = this._platform.isBrowser ?
{ width: window.innerWidth, height: window.innerHeight } :
{ width: 0, height: 0 };
};
ViewportRuler.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
ViewportRuler.ctorParameters = function () { return [
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__["Platform"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], },
]; };
/** @nocollapse */ ViewportRuler.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function ViewportRuler_Factory() { return new ViewportRuler(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__["Platform"]), Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"])); }, token: ViewportRuler, providedIn: "root" });
return ViewportRuler;
}());
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
* @param {?} parentRuler
* @param {?} platform
* @param {?} ngZone
* @return {?}
*/
function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler, platform, ngZone) {
return parentRuler || new ViewportRuler(platform, ngZone);
}
/**
* \@docs-private \@deprecated \@deletion-target 7.0.0
*/
var /** @type {?} */ VIEWPORT_RULER_PROVIDER = {
// If there is already a ViewportRuler available, use that. Otherwise, provide a new one.
provide: ViewportRuler,
deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"](), ViewportRuler], _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__["Platform"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"]],
useFactory: VIEWPORT_RULER_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var ScrollDispatchModule = /** @class */ (function () {
function ScrollDispatchModule() {
}
ScrollDispatchModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__["PlatformModule"]],
exports: [CdkScrollable],
declarations: [CdkScrollable],
},] },
];
return ScrollDispatchModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=scrolling.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/stepper.es5.js":
/*!*******************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/stepper.es5.js ***!
\*******************************************************/
/*! exports provided: StepperSelectionEvent, CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious, CdkStepperModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StepperSelectionEvent", function() { return StepperSelectionEvent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkStep", function() { return CdkStep; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkStepper", function() { return CdkStepper; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkStepLabel", function() { return CdkStepLabel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkStepperNext", function() { return CdkStepperNext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkStepperPrevious", function() { return CdkStepperPrevious; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkStepperModule", function() { return CdkStepperModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var CdkStepLabel = /** @class */ (function () {
function CdkStepLabel(template) {
this.template = template;
}
CdkStepLabel.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[cdkStepLabel]',
},] },
];
/** @nocollapse */
CdkStepLabel.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"], },
]; };
return CdkStepLabel;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Used to generate unique ID for each stepper component.
*/
var /** @type {?} */ nextId = 0;
/**
* Change event emitted on selection changes.
*/
var /**
* Change event emitted on selection changes.
*/
StepperSelectionEvent = /** @class */ (function () {
function StepperSelectionEvent() {
}
return StepperSelectionEvent;
}());
var CdkStep = /** @class */ (function () {
function CdkStep(_stepper) {
this._stepper = _stepper;
/**
* Whether user has seen the expanded step content or not.
*/
this.interacted = false;
this._editable = true;
this._optional = false;
this._customCompleted = null;
}
Object.defineProperty(CdkStep.prototype, "editable", {
get: /**
* Whether the user can return to this step once it has been marked as complted.
* @return {?}
*/
function () { return this._editable; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._editable = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkStep.prototype, "optional", {
get: /**
* Whether the completion of step is optional.
* @return {?}
*/
function () { return this._optional; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._optional = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkStep.prototype, "completed", {
get: /**
* Whether step is marked as completed.
* @return {?}
*/
function () {
return this._customCompleted == null ? this._defaultCompleted : this._customCompleted;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._customCompleted = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkStep.prototype, "_defaultCompleted", {
get: /**
* @return {?}
*/
function () {
return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;
},
enumerable: true,
configurable: true
});
/** Selects this step component. */
/**
* Selects this step component.
* @return {?}
*/
CdkStep.prototype.select = /**
* Selects this step component.
* @return {?}
*/
function () {
this._stepper.selected = this;
};
/** Resets the step to its initial state. Note that this includes resetting form data. */
/**
* Resets the step to its initial state. Note that this includes resetting form data.
* @return {?}
*/
CdkStep.prototype.reset = /**
* Resets the step to its initial state. Note that this includes resetting form data.
* @return {?}
*/
function () {
this.interacted = false;
if (this._customCompleted != null) {
this._customCompleted = false;
}
if (this.stepControl) {
this.stepControl.reset();
}
};
/**
* @return {?}
*/
CdkStep.prototype.ngOnChanges = /**
* @return {?}
*/
function () {
// Since basically all inputs of the MatStep get proxied through the view down to the
// underlying MatStepHeader, we have to make sure that change detection runs correctly.
this._stepper._stateChanged();
};
CdkStep.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'cdk-step',
exportAs: 'cdkStep',
template: '<ng-template><ng-content></ng-content></ng-template>',
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
CdkStep.ctorParameters = function () { return [
{ type: CdkStepper, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(function () { return CdkStepper; }),] },] },
]; };
CdkStep.propDecorators = {
"stepLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChild"], args: [CdkStepLabel,] },],
"content": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"],] },],
"stepControl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"label": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"editable": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"optional": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"completed": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return CdkStep;
}());
var CdkStepper = /** @class */ (function () {
function CdkStepper(_dir, _changeDetectorRef) {
this._dir = _dir;
this._changeDetectorRef = _changeDetectorRef;
/**
* Emits when the component is destroyed.
*/
this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_6__["Subject"]();
this._linear = false;
this._selectedIndex = 0;
/**
* Event emitted when the selected step has changed.
*/
this.selectionChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this._orientation = 'horizontal';
this._groupId = nextId++;
}
Object.defineProperty(CdkStepper.prototype, "linear", {
get: /**
* Whether the validity of previous steps should be checked or not.
* @return {?}
*/
function () { return this._linear; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._linear = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(CdkStepper.prototype, "selectedIndex", {
get: /**
* The index of the selected step.
* @return {?}
*/
function () { return this._selectedIndex; },
set: /**
* @param {?} index
* @return {?}
*/
function (index) {
if (this._steps) {
// Ensure that the index can't be out of bounds.
if (index < 0 || index > this._steps.length - 1) {
throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');
}
if (this._selectedIndex != index &&
!this._anyControlsInvalidOrPending(index) &&
(index >= this._selectedIndex || this._steps.toArray()[index].editable)) {
this._updateSelectedItemIndex(index);
}
}
else {
this._selectedIndex = index;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkStepper.prototype, "selected", {
get: /**
* The step that is selected.
* @return {?}
*/
function () {
// @deletion-target 7.0.0 Change return type to `CdkStep | undefined`.
return this._steps ? this._steps.toArray()[this.selectedIndex] : /** @type {?} */ ((undefined));
},
set: /**
* @param {?} step
* @return {?}
*/
function (step) {
this.selectedIndex = this._steps ? this._steps.toArray().indexOf(step) : -1;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
CdkStepper.prototype.ngAfterViewInit = /**
* @return {?}
*/
function () {
var _this = this;
this._keyManager = new _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__["FocusKeyManager"](this._stepHeader)
.withWrap()
.withVerticalOrientation(this._orientation === 'vertical');
(this._dir ? /** @type {?} */ (this._dir.change) : Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["of"])())
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["startWith"])(this._layoutDirection()), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["takeUntil"])(this._destroyed))
.subscribe(function (direction) { return _this._keyManager.withHorizontalOrientation(direction); });
this._keyManager.updateActiveItemIndex(this._selectedIndex);
};
/**
* @return {?}
*/
CdkStepper.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._destroyed.next();
this._destroyed.complete();
};
/** Selects and focuses the next step in list. */
/**
* Selects and focuses the next step in list.
* @return {?}
*/
CdkStepper.prototype.next = /**
* Selects and focuses the next step in list.
* @return {?}
*/
function () {
this.selectedIndex = Math.min(this._selectedIndex + 1, this._steps.length - 1);
};
/** Selects and focuses the previous step in list. */
/**
* Selects and focuses the previous step in list.
* @return {?}
*/
CdkStepper.prototype.previous = /**
* Selects and focuses the previous step in list.
* @return {?}
*/
function () {
this.selectedIndex = Math.max(this._selectedIndex - 1, 0);
};
/** Resets the stepper to its initial state. Note that this includes clearing form data. */
/**
* Resets the stepper to its initial state. Note that this includes clearing form data.
* @return {?}
*/
CdkStepper.prototype.reset = /**
* Resets the stepper to its initial state. Note that this includes clearing form data.
* @return {?}
*/
function () {
this._updateSelectedItemIndex(0);
this._steps.forEach(function (step) { return step.reset(); });
this._stateChanged();
};
/** Returns a unique id for each step label element. */
/**
* Returns a unique id for each step label element.
* @param {?} i
* @return {?}
*/
CdkStepper.prototype._getStepLabelId = /**
* Returns a unique id for each step label element.
* @param {?} i
* @return {?}
*/
function (i) {
return "cdk-step-label-" + this._groupId + "-" + i;
};
/** Returns unique id for each step content element. */
/**
* Returns unique id for each step content element.
* @param {?} i
* @return {?}
*/
CdkStepper.prototype._getStepContentId = /**
* Returns unique id for each step content element.
* @param {?} i
* @return {?}
*/
function (i) {
return "cdk-step-content-" + this._groupId + "-" + i;
};
/** Marks the component to be change detected. */
/**
* Marks the component to be change detected.
* @return {?}
*/
CdkStepper.prototype._stateChanged = /**
* Marks the component to be change detected.
* @return {?}
*/
function () {
this._changeDetectorRef.markForCheck();
};
/** Returns position state of the step with the given index. */
/**
* Returns position state of the step with the given index.
* @param {?} index
* @return {?}
*/
CdkStepper.prototype._getAnimationDirection = /**
* Returns position state of the step with the given index.
* @param {?} index
* @return {?}
*/
function (index) {
var /** @type {?} */ position = index - this._selectedIndex;
if (position < 0) {
return this._layoutDirection() === 'rtl' ? 'next' : 'previous';
}
else if (position > 0) {
return this._layoutDirection() === 'rtl' ? 'previous' : 'next';
}
return 'current';
};
/** Returns the type of icon to be displayed. */
/**
* Returns the type of icon to be displayed.
* @param {?} index
* @return {?}
*/
CdkStepper.prototype._getIndicatorType = /**
* Returns the type of icon to be displayed.
* @param {?} index
* @return {?}
*/
function (index) {
var /** @type {?} */ step = this._steps.toArray()[index];
if (!step.completed || this._selectedIndex == index) {
return 'number';
}
else {
return step.editable ? 'edit' : 'done';
}
};
/** Returns the index of the currently-focused step header. */
/**
* Returns the index of the currently-focused step header.
* @return {?}
*/
CdkStepper.prototype._getFocusIndex = /**
* Returns the index of the currently-focused step header.
* @return {?}
*/
function () {
return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;
};
/**
* @param {?} newIndex
* @return {?}
*/
CdkStepper.prototype._updateSelectedItemIndex = /**
* @param {?} newIndex
* @return {?}
*/
function (newIndex) {
var /** @type {?} */ stepsArray = this._steps.toArray();
this.selectionChange.emit({
selectedIndex: newIndex,
previouslySelectedIndex: this._selectedIndex,
selectedStep: stepsArray[newIndex],
previouslySelectedStep: stepsArray[this._selectedIndex],
});
this._keyManager.updateActiveItemIndex(newIndex);
this._selectedIndex = newIndex;
this._stateChanged();
};
/**
* @param {?} event
* @return {?}
*/
CdkStepper.prototype._onKeydown = /**
* @param {?} event
* @return {?}
*/
function (event) {
var /** @type {?} */ keyCode = event.keyCode;
if (this._keyManager.activeItemIndex != null && (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["SPACE"] || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["ENTER"])) {
this.selectedIndex = this._keyManager.activeItemIndex;
event.preventDefault();
}
else if (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["HOME"]) {
this._keyManager.setFirstItemActive();
event.preventDefault();
}
else if (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["END"]) {
this._keyManager.setLastItemActive();
event.preventDefault();
}
else {
this._keyManager.onKeydown(event);
}
};
/**
* @param {?} index
* @return {?}
*/
CdkStepper.prototype._anyControlsInvalidOrPending = /**
* @param {?} index
* @return {?}
*/
function (index) {
var /** @type {?} */ steps = this._steps.toArray();
steps[this._selectedIndex].interacted = true;
if (this._linear && index >= 0) {
return steps.slice(0, index).some(function (step) {
var /** @type {?} */ control = step.stepControl;
var /** @type {?} */ isIncomplete = control ?
(control.invalid || control.pending || !step.interacted) :
!step.completed;
return isIncomplete && !step.optional;
});
}
return false;
};
/**
* @return {?}
*/
CdkStepper.prototype._layoutDirection = /**
* @return {?}
*/
function () {
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
};
CdkStepper.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[cdkStepper]',
exportAs: 'cdkStepper',
},] },
];
/** @nocollapse */
CdkStepper.ctorParameters = function () { return [
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_2__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
]; };
CdkStepper.propDecorators = {
"_steps": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [CdkStep,] },],
"linear": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selectedIndex": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selectionChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
return CdkStepper;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Button that moves to the next step in a stepper workflow.
*/
var CdkStepperNext = /** @class */ (function () {
function CdkStepperNext(_stepper) {
this._stepper = _stepper;
/**
* Type of the next button. Defaults to "submit" if not specified.
*/
this.type = 'submit';
}
CdkStepperNext.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'button[cdkStepperNext]',
host: {
'(click)': '_stepper.next()',
'[type]': 'type',
}
},] },
];
/** @nocollapse */
CdkStepperNext.ctorParameters = function () { return [
{ type: CdkStepper, },
]; };
CdkStepperNext.propDecorators = {
"type": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return CdkStepperNext;
}());
/**
* Button that moves to the previous step in a stepper workflow.
*/
var CdkStepperPrevious = /** @class */ (function () {
function CdkStepperPrevious(_stepper) {
this._stepper = _stepper;
/**
* Type of the previous button. Defaults to "button" if not specified.
*/
this.type = 'button';
}
CdkStepperPrevious.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'button[cdkStepperPrevious]',
host: {
'(click)': '_stepper.previous()',
'[type]': 'type',
}
},] },
];
/** @nocollapse */
CdkStepperPrevious.ctorParameters = function () { return [
{ type: CdkStepper, },
]; };
CdkStepperPrevious.propDecorators = {
"type": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return CdkStepperPrevious;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var CdkStepperModule = /** @class */ (function () {
function CdkStepperModule() {
}
CdkStepperModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_2__["BidiModule"], _angular_common__WEBPACK_IMPORTED_MODULE_8__["CommonModule"]],
exports: [CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious],
declarations: [CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious]
},] },
];
return CdkStepperModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=stepper.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/table.es5.js":
/*!*****************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/table.es5.js ***!
\*****************************************************/
/*! exports provided: DataSource, DataRowOutlet, HeaderRowOutlet, FooterRowOutlet, CDK_TABLE_TEMPLATE, CdkTable, CdkCellDef, CdkHeaderCellDef, CdkFooterCellDef, CdkColumnDef, BaseCdkCell, CdkHeaderCell, CdkFooterCell, CdkCell, CDK_ROW_TEMPLATE, BaseRowDef, CdkHeaderRowDef, CdkFooterRowDef, CdkRowDef, CdkCellOutlet, CdkHeaderRow, CdkFooterRow, CdkRow, CdkTableModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataRowOutlet", function() { return DataRowOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderRowOutlet", function() { return HeaderRowOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FooterRowOutlet", function() { return FooterRowOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CDK_TABLE_TEMPLATE", function() { return CDK_TABLE_TEMPLATE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTable", function() { return CdkTable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkCellDef", function() { return CdkCellDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkHeaderCellDef", function() { return CdkHeaderCellDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkFooterCellDef", function() { return CdkFooterCellDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkColumnDef", function() { return CdkColumnDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseCdkCell", function() { return BaseCdkCell; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkHeaderCell", function() { return CdkHeaderCell; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkFooterCell", function() { return CdkFooterCell; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkCell", function() { return CdkCell; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CDK_ROW_TEMPLATE", function() { return CDK_ROW_TEMPLATE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseRowDef", function() { return BaseRowDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkHeaderRowDef", function() { return CdkHeaderRowDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkFooterRowDef", function() { return CdkFooterRowDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkRowDef", function() { return CdkRowDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkCellOutlet", function() { return CdkCellOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkHeaderRow", function() { return CdkHeaderRow; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkFooterRow", function() { return CdkFooterRow; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkRow", function() { return CdkRow; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTableModule", function() { return CdkTableModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm5/collections.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataSource", function() { return _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_2__["DataSource"]; });
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* The row template that can be used by the mat-table. Should not be used outside of the
* material library.
*/
var /** @type {?} */ CDK_ROW_TEMPLATE = "<ng-container cdkCellOutlet></ng-container>";
/**
* Base class for the CdkHeaderRowDef and CdkRowDef that handles checking their columns inputs
* for changes and notifying the table.
* @abstract
*/
var /**
* Base class for the CdkHeaderRowDef and CdkRowDef that handles checking their columns inputs
* for changes and notifying the table.
* @abstract
*/
BaseRowDef = /** @class */ (function () {
function BaseRowDef(template, _differs) {
this.template = template;
this._differs = _differs;
}
/**
* @param {?} changes
* @return {?}
*/
BaseRowDef.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
// Create a new columns differ if one does not yet exist. Initialize it based on initial value
// of the columns property or an empty array if none is provided.
var /** @type {?} */ columns = changes['columns'].currentValue || [];
if (!this._columnsDiffer) {
this._columnsDiffer = this._differs.find(columns).create();
this._columnsDiffer.diff(columns);
}
};
/**
* Returns the difference between the current columns and the columns from the last diff, or null
* if there is no difference.
*/
/**
* Returns the difference between the current columns and the columns from the last diff, or null
* if there is no difference.
* @return {?}
*/
BaseRowDef.prototype.getColumnsDiff = /**
* Returns the difference between the current columns and the columns from the last diff, or null
* if there is no difference.
* @return {?}
*/
function () {
return this._columnsDiffer.diff(this.columns);
};
return BaseRowDef;
}());
/**
* Header row definition for the CDK table.
* Captures the header row's template and other header properties such as the columns to display.
*/
var CdkHeaderRowDef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CdkHeaderRowDef, _super);
function CdkHeaderRowDef(template, _differs) {
return _super.call(this, template, _differs) || this;
}
/** Gets this row def's relevant cell template from the provided column def. */
/**
* Gets this row def's relevant cell template from the provided column def.
* @param {?} column
* @return {?}
*/
CdkHeaderRowDef.prototype.extractCellTemplate = /**
* Gets this row def's relevant cell template from the provided column def.
* @param {?} column
* @return {?}
*/
function (column) {
return column.headerCell.template;
};
CdkHeaderRowDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[cdkHeaderRowDef]',
inputs: ['columns: cdkHeaderRowDef'],
},] },
];
/** @nocollapse */
CdkHeaderRowDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"], },
]; };
return CdkHeaderRowDef;
}(BaseRowDef));
/**
* Footer row definition for the CDK table.
* Captures the footer row's template and other footer properties such as the columns to display.
*/
var CdkFooterRowDef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CdkFooterRowDef, _super);
function CdkFooterRowDef(template, _differs) {
return _super.call(this, template, _differs) || this;
}
/** Gets this row def's relevant cell template from the provided column def. */
/**
* Gets this row def's relevant cell template from the provided column def.
* @param {?} column
* @return {?}
*/
CdkFooterRowDef.prototype.extractCellTemplate = /**
* Gets this row def's relevant cell template from the provided column def.
* @param {?} column
* @return {?}
*/
function (column) {
return column.footerCell.template;
};
CdkFooterRowDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[cdkFooterRowDef]',
inputs: ['columns: cdkFooterRowDef'],
},] },
];
/** @nocollapse */
CdkFooterRowDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"], },
]; };
return CdkFooterRowDef;
}(BaseRowDef));
/**
* Data row definition for the CDK table.
* Captures the header row's template and other row properties such as the columns to display and
* a when predicate that describes when this row should be used.
* @template T
*/
var CdkRowDef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CdkRowDef, _super);
// TODO(andrewseguin): Add an input for providing a switch function to determine
// if this template should be used.
function CdkRowDef(template, _differs) {
return _super.call(this, template, _differs) || this;
}
/** Gets this row def's relevant cell template from the provided column def. */
/**
* Gets this row def's relevant cell template from the provided column def.
* @param {?} column
* @return {?}
*/
CdkRowDef.prototype.extractCellTemplate = /**
* Gets this row def's relevant cell template from the provided column def.
* @param {?} column
* @return {?}
*/
function (column) {
return column.cell.template;
};
CdkRowDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[cdkRowDef]',
inputs: ['columns: cdkRowDefColumns', 'when: cdkRowDefWhen'],
},] },
];
/** @nocollapse */
CdkRowDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"], },
]; };
return CdkRowDef;
}(BaseRowDef));
/**
* Outlet for rendering cells inside of a row or header row.
* \@docs-private
*/
var CdkCellOutlet = /** @class */ (function () {
function CdkCellOutlet(_viewContainer) {
this._viewContainer = _viewContainer;
CdkCellOutlet.mostRecentCellOutlet = this;
}
/**
* Static property containing the latest constructed instance of this class.
* Used by the CDK table when each CdkHeaderRow and CdkRow component is created using
* createEmbeddedView. After one of these components are created, this property will provide
* a handle to provide that component's cells and context. After init, the CdkCellOutlet will
* construct the cells with the provided context.
*/
CdkCellOutlet.mostRecentCellOutlet = null;
CdkCellOutlet.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkCellOutlet]' },] },
];
/** @nocollapse */
CdkCellOutlet.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"], },
]; };
return CdkCellOutlet;
}());
/**
* Header template container that contains the cell outlet. Adds the right class and role.
*/
var CdkHeaderRow = /** @class */ (function () {
function CdkHeaderRow() {
}
CdkHeaderRow.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'cdk-header-row, tr[cdk-header-row]',
template: CDK_ROW_TEMPLATE,
host: {
'class': 'cdk-header-row',
'role': 'row',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
},] },
];
return CdkHeaderRow;
}());
/**
* Footer template container that contains the cell outlet. Adds the right class and role.
*/
var CdkFooterRow = /** @class */ (function () {
function CdkFooterRow() {
}
CdkFooterRow.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'cdk-footer-row, tr[cdk-footer-row]',
template: CDK_ROW_TEMPLATE,
host: {
'class': 'cdk-footer-row',
'role': 'row',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
},] },
];
return CdkFooterRow;
}());
/**
* Data row template container that contains the cell outlet. Adds the right class and role.
*/
var CdkRow = /** @class */ (function () {
function CdkRow() {
}
CdkRow.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'cdk-row, tr[cdk-row]',
template: CDK_ROW_TEMPLATE,
host: {
'class': 'cdk-row',
'role': 'row',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
},] },
];
return CdkRow;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Cell definition for a CDK table.
* Captures the template of a column's data row cell as well as cell-specific properties.
*/
var CdkCellDef = /** @class */ (function () {
function CdkCellDef(template) {
this.template = template;
}
CdkCellDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkCellDef]' },] },
];
/** @nocollapse */
CdkCellDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
]; };
return CdkCellDef;
}());
/**
* Header cell definition for a CDK table.
* Captures the template of a column's header cell and as well as cell-specific properties.
*/
var CdkHeaderCellDef = /** @class */ (function () {
function CdkHeaderCellDef(template) {
this.template = template;
}
CdkHeaderCellDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkHeaderCellDef]' },] },
];
/** @nocollapse */
CdkHeaderCellDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
]; };
return CdkHeaderCellDef;
}());
/**
* Footer cell definition for a CDK table.
* Captures the template of a column's footer cell and as well as cell-specific properties.
*/
var CdkFooterCellDef = /** @class */ (function () {
function CdkFooterCellDef(template) {
this.template = template;
}
CdkFooterCellDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkFooterCellDef]' },] },
];
/** @nocollapse */
CdkFooterCellDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
]; };
return CdkFooterCellDef;
}());
/**
* Column definition for the CDK table.
* Defines a set of cells available for a table column.
*/
var CdkColumnDef = /** @class */ (function () {
function CdkColumnDef() {
}
Object.defineProperty(CdkColumnDef.prototype, "name", {
get: /**
* Unique name for this column.
* @return {?}
*/
function () { return this._name; },
set: /**
* @param {?} name
* @return {?}
*/
function (name) {
// If the directive is set without a name (updated programatically), then this setter will
// trigger with an empty string and should not overwrite the programatically set value.
if (!name) {
return;
}
this._name = name;
this.cssClassFriendlyName = name.replace(/[^a-z0-9_-]/ig, '-');
},
enumerable: true,
configurable: true
});
CdkColumnDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkColumnDef]' },] },
];
/** @nocollapse */
CdkColumnDef.propDecorators = {
"name": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['cdkColumnDef',] },],
"cell": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChild"], args: [CdkCellDef,] },],
"headerCell": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChild"], args: [CdkHeaderCellDef,] },],
"footerCell": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChild"], args: [CdkFooterCellDef,] },],
};
return CdkColumnDef;
}());
/**
* Base class for the cells. Adds a CSS classname that identifies the column it renders in.
*/
var /**
* Base class for the cells. Adds a CSS classname that identifies the column it renders in.
*/
BaseCdkCell = /** @class */ (function () {
function BaseCdkCell(columnDef, elementRef) {
var /** @type {?} */ columnClassName = "cdk-column-" + columnDef.cssClassFriendlyName;
elementRef.nativeElement.classList.add(columnClassName);
}
return BaseCdkCell;
}());
/**
* Header cell template container that adds the right classes and role.
*/
var CdkHeaderCell = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CdkHeaderCell, _super);
function CdkHeaderCell(columnDef, elementRef) {
return _super.call(this, columnDef, elementRef) || this;
}
CdkHeaderCell.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'cdk-header-cell, th[cdk-header-cell]',
host: {
'class': 'cdk-header-cell',
'role': 'columnheader',
},
},] },
];
/** @nocollapse */
CdkHeaderCell.ctorParameters = function () { return [
{ type: CdkColumnDef, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
]; };
return CdkHeaderCell;
}(BaseCdkCell));
/**
* Footer cell template container that adds the right classes and role.
*/
var CdkFooterCell = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CdkFooterCell, _super);
function CdkFooterCell(columnDef, elementRef) {
return _super.call(this, columnDef, elementRef) || this;
}
CdkFooterCell.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'cdk-footer-cell, td[cdk-footer-cell]',
host: {
'class': 'cdk-footer-cell',
'role': 'gridcell',
},
},] },
];
/** @nocollapse */
CdkFooterCell.ctorParameters = function () { return [
{ type: CdkColumnDef, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
]; };
return CdkFooterCell;
}(BaseCdkCell));
/**
* Cell template container that adds the right classes and role.
*/
var CdkCell = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CdkCell, _super);
function CdkCell(columnDef, elementRef) {
return _super.call(this, columnDef, elementRef) || this;
}
CdkCell.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'cdk-cell, td[cdk-cell]',
host: {
'class': 'cdk-cell',
'role': 'gridcell',
},
},] },
];
/** @nocollapse */
CdkCell.ctorParameters = function () { return [
{ type: CdkColumnDef, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
]; };
return CdkCell;
}(BaseCdkCell));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Returns an error to be thrown when attempting to find an unexisting column.
* \@docs-private
* @param {?} id Id whose lookup failed.
* @return {?}
*/
function getTableUnknownColumnError(id) {
return Error("Could not find column with id \"" + id + "\".");
}
/**
* Returns an error to be thrown when two column definitions have the same name.
* \@docs-private
* @param {?} name
* @return {?}
*/
function getTableDuplicateColumnNameError(name) {
return Error("Duplicate column definition name provided: \"" + name + "\".");
}
/**
* Returns an error to be thrown when there are multiple rows that are missing a when function.
* \@docs-private
* @return {?}
*/
function getTableMultipleDefaultRowDefsError() {
return Error("There can only be one default row without a when predicate function.");
}
/**
* Returns an error to be thrown when there are no matching row defs for a particular set of data.
* \@docs-private
* @return {?}
*/
function getTableMissingMatchingRowDefError() {
return Error("Could not find a matching row definition for the provided row data.");
}
/**
* Returns an error to be thrown when there is no row definitions present in the content.
* \@docs-private
* @return {?}
*/
function getTableMissingRowDefsError() {
return Error('Missing definitions for header and row, ' +
'cannot determine which columns should be rendered.');
}
/**
* Returns an error to be thrown when the data source does not match the compatible types.
* \@docs-private
* @return {?}
*/
function getTableUnknownDataSourceError() {
return Error("Provided data source did not match an array, Observable, or DataSource");
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Provides a handle for the table to grab the view container's ng-container to insert data rows.
* \@docs-private
*/
var DataRowOutlet = /** @class */ (function () {
function DataRowOutlet(viewContainer, elementRef) {
this.viewContainer = viewContainer;
this.elementRef = elementRef;
}
DataRowOutlet.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[rowOutlet]' },] },
];
/** @nocollapse */
DataRowOutlet.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
]; };
return DataRowOutlet;
}());
/**
* Provides a handle for the table to grab the view container's ng-container to insert the header.
* \@docs-private
*/
var HeaderRowOutlet = /** @class */ (function () {
function HeaderRowOutlet(viewContainer, elementRef) {
this.viewContainer = viewContainer;
this.elementRef = elementRef;
}
HeaderRowOutlet.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[headerRowOutlet]' },] },
];
/** @nocollapse */
HeaderRowOutlet.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
]; };
return HeaderRowOutlet;
}());
/**
* Provides a handle for the table to grab the view container's ng-container to insert the footer.
* \@docs-private
*/
var FooterRowOutlet = /** @class */ (function () {
function FooterRowOutlet(viewContainer, elementRef) {
this.viewContainer = viewContainer;
this.elementRef = elementRef;
}
FooterRowOutlet.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[footerRowOutlet]' },] },
];
/** @nocollapse */
FooterRowOutlet.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
]; };
return FooterRowOutlet;
}());
/**
* The table template that can be used by the mat-table. Should not be used outside of the
* material library.
* \@docs-private
*/
var /** @type {?} */ CDK_TABLE_TEMPLATE = "\n <ng-container headerRowOutlet></ng-container>\n <ng-container rowOutlet></ng-container>\n <ng-container footerRowOutlet></ng-container>";
/**
* Class used to conveniently type the embedded view ref for rows with a context.
* \@docs-private
* @abstract
* @template T
*/
var /**
* Class used to conveniently type the embedded view ref for rows with a context.
* \@docs-private
* @abstract
* @template T
*/
RowViewRef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(RowViewRef, _super);
function RowViewRef() {
return _super !== null && _super.apply(this, arguments) || this;
}
return RowViewRef;
}(_angular_core__WEBPACK_IMPORTED_MODULE_1__["EmbeddedViewRef"]));
/**
* A data table that can render a header row, data rows, and a footer row.
* Uses the dataSource input to determine the data to be rendered. The data can be provided either
* as a data array, an Observable stream that emits the data array to render, or a DataSource with a
* connect function that will return an Observable stream that emits the data array to render.
* @template T
*/
var CdkTable = /** @class */ (function () {
function CdkTable(_differs, _changeDetectorRef, _elementRef, role) {
this._differs = _differs;
this._changeDetectorRef = _changeDetectorRef;
this._elementRef = _elementRef;
/**
* Subject that emits when the component has been destroyed.
*/
this._onDestroy = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
/**
* Map of all the user's defined columns (header, data, and footer cell template) identified by
* name. Collection populated by the column definitions gathered by `ContentChildren` as well as
* any custom column definitions added to `_customColumnDefs`.
*/
this._columnDefsByName = new Map();
/**
* Column definitions that were defined outside of the direct content children of the table.
*/
this._customColumnDefs = new Set();
/**
* Row definitions that were defined outside of the direct content children of the table.
*/
this._customRowDefs = new Set();
/**
* Whether the header row definition has been changed. Triggers an update to the header row after
* content is checked.
*/
this._headerRowDefChanged = false;
/**
* Whether the footer row definition has been changed. Triggers an update to the footer row after
* content is checked.
*/
this._footerRowDefChanged = false;
/**
* Stream containing the latest information on what rows are being displayed on screen.
* Can be used by the data source to as a heuristic of what data should be provided.
*/
this.viewChange = new rxjs__WEBPACK_IMPORTED_MODULE_4__["BehaviorSubject"]({ start: 0, end: Number.MAX_VALUE });
if (!role) {
this._elementRef.nativeElement.setAttribute('role', 'grid');
}
}
Object.defineProperty(CdkTable.prototype, "trackBy", {
get: /**
* Tracking function that will be used to check the differences in data changes. Used similarly
* to `ngFor` `trackBy` function. Optimize row operations by identifying a row based on its data
* relative to the function to know if a row should be added/removed/moved.
* Accepts a function that takes two parameters, `index` and `item`.
* @return {?}
*/
function () { return this._trackByFn; },
set: /**
* @param {?} fn
* @return {?}
*/
function (fn) {
if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["isDevMode"])() &&
fn != null && typeof fn !== 'function' && /** @type {?} */ (console) && /** @type {?} */ (console.warn)) {
console.warn("trackBy must be a function, but received " + JSON.stringify(fn) + ".");
}
this._trackByFn = fn;
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkTable.prototype, "dataSource", {
get: /**
* The table's source of data, which can be provided in three ways (in order of complexity):
* - Simple data array (each object represents one table row)
* - Stream that emits a data array each time the array changes
* - `DataSource` object that implements the connect/disconnect interface.
*
* If a data array is provided, the table must be notified when the array's objects are
* added, removed, or moved. This can be done by calling the `renderRows()` function which will
* render the diff since the last table render. If the data array reference is changed, the table
* will automatically trigger an update to the rows.
*
* When providing an Observable stream, the table will trigger an update automatically when the
* stream emits a new array of data.
*
* Finally, when providing a `DataSource` object, the table will use the Observable stream
* provided by the connect function and trigger updates when that stream emits new data array
* values. During the table's ngOnDestroy or when the data source is removed from the table, the
* table will call the DataSource's `disconnect` function (may be useful for cleaning up any
* subscriptions registered during the connect process).
* @return {?}
*/
function () { return this._dataSource; },
set: /**
* @param {?} dataSource
* @return {?}
*/
function (dataSource) {
if (this._dataSource !== dataSource) {
this._switchDataSource(dataSource);
}
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
CdkTable.prototype.ngOnInit = /**
* @return {?}
*/
function () {
if (this._elementRef.nativeElement.nodeName === 'TABLE') {
this._applyNativeTableSections();
}
// TODO(andrewseguin): Setup a listener for scrolling, emit the calculated view to viewChange
this._dataDiffer = this._differs.find([]).create(this._trackByFn);
// If the table has header or footer row definitions defined as part of its content, mark that
// there is a change so that the content check will render the row.
this._headerRowDefChanged = !!this._headerRowDef;
this._footerRowDefChanged = !!this._footerRowDef;
};
/**
* @return {?}
*/
CdkTable.prototype.ngAfterContentChecked = /**
* @return {?}
*/
function () {
// Cache the row and column definitions gathered by ContentChildren and programmatic injection.
this._cacheRowDefs();
this._cacheColumnDefs();
// Make sure that the user has at least added header, footer, or data row def.
if (!this._headerRowDef && !this._footerRowDef && !this._rowDefs.length) {
throw getTableMissingRowDefsError();
}
// Render updates if the list of columns have been changed for the header, row, or footer defs.
this._renderUpdatedColumns();
// If the header row definition has been changed, trigger a render to the header row.
if (this._headerRowDefChanged) {
this._renderHeaderRow();
this._headerRowDefChanged = false;
}
// If the footer row definition has been changed, trigger a render to the footer row.
if (this._footerRowDefChanged) {
this._renderFooterRow();
this._footerRowDefChanged = false;
}
// If there is a data source and row definitions, connect to the data source unless a
// connection has already been made.
if (this.dataSource && this._rowDefs.length > 0 && !this._renderChangeSubscription) {
this._observeRenderChanges();
}
};
/**
* @return {?}
*/
CdkTable.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._rowOutlet.viewContainer.clear();
this._headerRowOutlet.viewContainer.clear();
this._footerRowOutlet.viewContainer.clear();
this._onDestroy.next();
this._onDestroy.complete();
if (this.dataSource instanceof _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_2__["DataSource"]) {
this.dataSource.disconnect(this);
}
};
/**
* Renders rows based on the table's latest set of data, which was either provided directly as an
* input or retrieved through an Observable stream (directly or from a DataSource).
* Checks for differences in the data since the last diff to perform only the necessary
* changes (add/remove/move rows).
*
* If the table's data source is a DataSource or Observable, this will be invoked automatically
* each time the provided Observable stream emits a new data array. Otherwise if your data is
* an array, this function will need to be called to render any changes.
*/
/**
* Renders rows based on the table's latest set of data, which was either provided directly as an
* input or retrieved through an Observable stream (directly or from a DataSource).
* Checks for differences in the data since the last diff to perform only the necessary
* changes (add/remove/move rows).
*
* If the table's data source is a DataSource or Observable, this will be invoked automatically
* each time the provided Observable stream emits a new data array. Otherwise if your data is
* an array, this function will need to be called to render any changes.
* @return {?}
*/
CdkTable.prototype.renderRows = /**
* Renders rows based on the table's latest set of data, which was either provided directly as an
* input or retrieved through an Observable stream (directly or from a DataSource).
* Checks for differences in the data since the last diff to perform only the necessary
* changes (add/remove/move rows).
*
* If the table's data source is a DataSource or Observable, this will be invoked automatically
* each time the provided Observable stream emits a new data array. Otherwise if your data is
* an array, this function will need to be called to render any changes.
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ changes = this._dataDiffer.diff(this._data);
if (!changes) {
return;
}
var /** @type {?} */ viewContainer = this._rowOutlet.viewContainer;
changes.forEachOperation(function (record, adjustedPreviousIndex, currentIndex) {
if (record.previousIndex == null) {
_this._insertRow(record.item, currentIndex);
}
else if (currentIndex == null) {
viewContainer.remove(adjustedPreviousIndex);
}
else {
var /** @type {?} */ view = /** @type {?} */ (viewContainer.get(adjustedPreviousIndex));
viewContainer.move(/** @type {?} */ ((view)), currentIndex);
}
});
// Update the meta context of a row's context data (index, count, first, last, ...)
this._updateRowIndexContext();
// Update rows that did not get added/removed/moved but may have had their identity changed,
// e.g. if trackBy matched data on some property but the actual data reference changed.
changes.forEachIdentityChange(function (record) {
var /** @type {?} */ rowView = /** @type {?} */ (viewContainer.get(/** @type {?} */ ((record.currentIndex))));
rowView.context.$implicit = record.item;
});
};
/**
* Sets the header row definition to be used. Overrides the header row definition gathered by
* using `ContentChild`, if one exists. Sets a flag that will re-render the header row after the
* table's content is checked.
*/
/**
* Sets the header row definition to be used. Overrides the header row definition gathered by
* using `ContentChild`, if one exists. Sets a flag that will re-render the header row after the
* table's content is checked.
* @param {?} headerRowDef
* @return {?}
*/
CdkTable.prototype.setHeaderRowDef = /**
* Sets the header row definition to be used. Overrides the header row definition gathered by
* using `ContentChild`, if one exists. Sets a flag that will re-render the header row after the
* table's content is checked.
* @param {?} headerRowDef
* @return {?}
*/
function (headerRowDef) {
this._headerRowDef = headerRowDef;
this._headerRowDefChanged = true;
};
/**
* Sets the footer row definition to be used. Overrides the footer row definition gathered by
* using `ContentChild`, if one exists. Sets a flag that will re-render the footer row after the
* table's content is checked.
*/
/**
* Sets the footer row definition to be used. Overrides the footer row definition gathered by
* using `ContentChild`, if one exists. Sets a flag that will re-render the footer row after the
* table's content is checked.
* @param {?} footerRowDef
* @return {?}
*/
CdkTable.prototype.setFooterRowDef = /**
* Sets the footer row definition to be used. Overrides the footer row definition gathered by
* using `ContentChild`, if one exists. Sets a flag that will re-render the footer row after the
* table's content is checked.
* @param {?} footerRowDef
* @return {?}
*/
function (footerRowDef) {
this._footerRowDef = footerRowDef;
this._footerRowDefChanged = true;
};
/** Adds a column definition that was not included as part of the direct content children. */
/**
* Adds a column definition that was not included as part of the direct content children.
* @param {?} columnDef
* @return {?}
*/
CdkTable.prototype.addColumnDef = /**
* Adds a column definition that was not included as part of the direct content children.
* @param {?} columnDef
* @return {?}
*/
function (columnDef) {
this._customColumnDefs.add(columnDef);
};
/** Removes a column definition that was not included as part of the direct content children. */
/**
* Removes a column definition that was not included as part of the direct content children.
* @param {?} columnDef
* @return {?}
*/
CdkTable.prototype.removeColumnDef = /**
* Removes a column definition that was not included as part of the direct content children.
* @param {?} columnDef
* @return {?}
*/
function (columnDef) {
this._customColumnDefs.delete(columnDef);
};
/** Adds a row definition that was not included as part of the direct content children. */
/**
* Adds a row definition that was not included as part of the direct content children.
* @param {?} rowDef
* @return {?}
*/
CdkTable.prototype.addRowDef = /**
* Adds a row definition that was not included as part of the direct content children.
* @param {?} rowDef
* @return {?}
*/
function (rowDef) {
this._customRowDefs.add(rowDef);
};
/** Removes a row definition that was not included as part of the direct content children. */
/**
* Removes a row definition that was not included as part of the direct content children.
* @param {?} rowDef
* @return {?}
*/
CdkTable.prototype.removeRowDef = /**
* Removes a row definition that was not included as part of the direct content children.
* @param {?} rowDef
* @return {?}
*/
function (rowDef) {
this._customRowDefs.delete(rowDef);
};
/**
* Update the map containing the content's column definitions.
* @return {?}
*/
CdkTable.prototype._cacheColumnDefs = /**
* Update the map containing the content's column definitions.
* @return {?}
*/
function () {
var _this = this;
this._columnDefsByName.clear();
var /** @type {?} */ columnDefs = this._contentColumnDefs ? this._contentColumnDefs.toArray() : [];
this._customColumnDefs.forEach(function (columnDef) { return columnDefs.push(columnDef); });
columnDefs.forEach(function (columnDef) {
if (_this._columnDefsByName.has(columnDef.name)) {
throw getTableDuplicateColumnNameError(columnDef.name);
}
_this._columnDefsByName.set(columnDef.name, columnDef);
});
};
/**
* Update the list of all available row definitions that can be used.
* @return {?}
*/
CdkTable.prototype._cacheRowDefs = /**
* Update the list of all available row definitions that can be used.
* @return {?}
*/
function () {
var _this = this;
this._rowDefs = this._contentRowDefs ? this._contentRowDefs.toArray() : [];
this._customRowDefs.forEach(function (rowDef) { return _this._rowDefs.push(rowDef); });
var /** @type {?} */ defaultRowDefs = this._rowDefs.filter(function (def) { return !def.when; });
if (defaultRowDefs.length > 1) {
throw getTableMultipleDefaultRowDefsError();
}
this._defaultRowDef = defaultRowDefs[0];
};
/**
* Check if the header, data, or footer rows have changed what columns they want to display.
* If there is a diff, then re-render that section.
* @return {?}
*/
CdkTable.prototype._renderUpdatedColumns = /**
* Check if the header, data, or footer rows have changed what columns they want to display.
* If there is a diff, then re-render that section.
* @return {?}
*/
function () {
var _this = this;
// Re-render the rows when the row definition columns change.
this._rowDefs.forEach(function (def) {
if (!!def.getColumnsDiff()) {
// Reset the data to an empty array so that renderRowChanges will re-render all new rows.
// Reset the data to an empty array so that renderRowChanges will re-render all new rows.
_this._dataDiffer.diff([]);
_this._rowOutlet.viewContainer.clear();
_this.renderRows();
}
});
// Re-render the header row if there is a difference in its columns.
if (this._headerRowDef && this._headerRowDef.getColumnsDiff()) {
this._renderHeaderRow();
}
// Re-render the footer row if there is a difference in its columns.
if (this._footerRowDef && this._footerRowDef.getColumnsDiff()) {
this._renderFooterRow();
}
};
/**
* Switch to the provided data source by resetting the data and unsubscribing from the current
* render change subscription if one exists. If the data source is null, interpret this by
* clearing the row outlet. Otherwise start listening for new data.
* @param {?} dataSource
* @return {?}
*/
CdkTable.prototype._switchDataSource = /**
* Switch to the provided data source by resetting the data and unsubscribing from the current
* render change subscription if one exists. If the data source is null, interpret this by
* clearing the row outlet. Otherwise start listening for new data.
* @param {?} dataSource
* @return {?}
*/
function (dataSource) {
this._data = [];
if (this.dataSource instanceof _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_2__["DataSource"]) {
this.dataSource.disconnect(this);
}
// Stop listening for data from the previous data source.
if (this._renderChangeSubscription) {
this._renderChangeSubscription.unsubscribe();
this._renderChangeSubscription = null;
}
if (!dataSource) {
if (this._dataDiffer) {
this._dataDiffer.diff([]);
}
this._rowOutlet.viewContainer.clear();
}
this._dataSource = dataSource;
};
/**
* Set up a subscription for the data provided by the data source.
* @return {?}
*/
CdkTable.prototype._observeRenderChanges = /**
* Set up a subscription for the data provided by the data source.
* @return {?}
*/
function () {
var _this = this;
// If no data source has been set, there is nothing to observe for changes.
if (!this.dataSource) {
return;
}
var /** @type {?} */ dataStream;
// Check if the datasource is a DataSource object by observing if it has a connect function.
// Cannot check this.dataSource['connect'] due to potential property renaming, nor can it
// checked as an instanceof DataSource<T> since the table should allow for data sources
// that did not explicitly extend DataSource<T>.
if ((/** @type {?} */ (this.dataSource)).connect instanceof Function) {
dataStream = (/** @type {?} */ (this.dataSource)).connect(this);
}
else if (this.dataSource instanceof rxjs__WEBPACK_IMPORTED_MODULE_4__["Observable"]) {
dataStream = this.dataSource;
}
else if (Array.isArray(this.dataSource)) {
dataStream = Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["of"])(this.dataSource);
}
if (dataStream === undefined) {
throw getTableUnknownDataSourceError();
}
this._renderChangeSubscription = dataStream
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(this._onDestroy))
.subscribe(function (data) {
_this._data = data;
_this.renderRows();
});
};
/**
* Clears any existing content in the header row outlet and creates a new embedded view
* in the outlet using the header row definition.
* @return {?}
*/
CdkTable.prototype._renderHeaderRow = /**
* Clears any existing content in the header row outlet and creates a new embedded view
* in the outlet using the header row definition.
* @return {?}
*/
function () {
// Clear the footer row outlet if any content exists.
if (this._headerRowOutlet.viewContainer.length > 0) {
this._headerRowOutlet.viewContainer.clear();
}
this._renderRow(this._headerRowOutlet, this._headerRowDef);
};
/**
* Clears any existing content in the footer row outlet and creates a new embedded view
* in the outlet using the footer row definition.
* @return {?}
*/
CdkTable.prototype._renderFooterRow = /**
* Clears any existing content in the footer row outlet and creates a new embedded view
* in the outlet using the footer row definition.
* @return {?}
*/
function () {
// Clear the footer row outlet if any content exists.
if (this._footerRowOutlet.viewContainer.length > 0) {
this._footerRowOutlet.viewContainer.clear();
}
this._renderRow(this._footerRowOutlet, this._footerRowDef);
};
/**
* Finds the matching row definition that should be used for this row data. If there is only
* one row definition, it is returned. Otherwise, find the row definition that has a when
* predicate that returns true with the data. If none return true, return the default row
* definition.
*/
/**
* Finds the matching row definition that should be used for this row data. If there is only
* one row definition, it is returned. Otherwise, find the row definition that has a when
* predicate that returns true with the data. If none return true, return the default row
* definition.
* @param {?} data
* @param {?} i
* @return {?}
*/
CdkTable.prototype._getRowDef = /**
* Finds the matching row definition that should be used for this row data. If there is only
* one row definition, it is returned. Otherwise, find the row definition that has a when
* predicate that returns true with the data. If none return true, return the default row
* definition.
* @param {?} data
* @param {?} i
* @return {?}
*/
function (data, i) {
if (this._rowDefs.length == 1) {
return this._rowDefs[0];
}
var /** @type {?} */ rowDef = this._rowDefs.find(function (def) { return def.when && def.when(i, data); }) || this._defaultRowDef;
if (!rowDef) {
throw getTableMissingMatchingRowDefError();
}
return rowDef;
};
/**
* Create the embedded view for the data row template and place it in the correct index location
* within the data row view container.
* @param {?} rowData
* @param {?} index
* @return {?}
*/
CdkTable.prototype._insertRow = /**
* Create the embedded view for the data row template and place it in the correct index location
* within the data row view container.
* @param {?} rowData
* @param {?} index
* @return {?}
*/
function (rowData, index) {
var /** @type {?} */ rowDef = this._getRowDef(rowData, index);
var /** @type {?} */ context = { $implicit: rowData };
this._renderRow(this._rowOutlet, rowDef, context, index);
};
/**
* Creates a new row template in the outlet and fills it with the set of cell templates.
* Optionally takes a context to provide to the row and cells, as well as an optional index
* of where to place the new row template in the outlet.
* @param {?} outlet
* @param {?} rowDef
* @param {?=} context
* @param {?=} index
* @return {?}
*/
CdkTable.prototype._renderRow = /**
* Creates a new row template in the outlet and fills it with the set of cell templates.
* Optionally takes a context to provide to the row and cells, as well as an optional index
* of where to place the new row template in the outlet.
* @param {?} outlet
* @param {?} rowDef
* @param {?=} context
* @param {?=} index
* @return {?}
*/
function (outlet, rowDef, context, index) {
if (context === void 0) { context = {}; }
if (index === void 0) { index = 0; }
// TODO(andrewseguin): enforce that one outlet was instantiated from createEmbeddedView
outlet.viewContainer.createEmbeddedView(rowDef.template, context, index);
for (var _i = 0, _a = this._getCellTemplates(rowDef); _i < _a.length; _i++) {
var cellTemplate = _a[_i];
if (CdkCellOutlet.mostRecentCellOutlet) {
CdkCellOutlet.mostRecentCellOutlet._viewContainer.createEmbeddedView(cellTemplate, context);
}
}
this._changeDetectorRef.markForCheck();
};
/**
* Updates the index-related context for each row to reflect any changes in the index of the rows,
* e.g. first/last/even/odd.
* @return {?}
*/
CdkTable.prototype._updateRowIndexContext = /**
* Updates the index-related context for each row to reflect any changes in the index of the rows,
* e.g. first/last/even/odd.
* @return {?}
*/
function () {
var /** @type {?} */ viewContainer = this._rowOutlet.viewContainer;
for (var /** @type {?} */ index = 0, /** @type {?} */ count = viewContainer.length; index < count; index++) {
var /** @type {?} */ viewRef = /** @type {?} */ (viewContainer.get(index));
viewRef.context.index = index;
viewRef.context.count = count;
viewRef.context.first = index === 0;
viewRef.context.last = index === count - 1;
viewRef.context.even = index % 2 === 0;
viewRef.context.odd = !viewRef.context.even;
}
};
/**
* Gets the column definitions for the provided row def.
* @param {?} rowDef
* @return {?}
*/
CdkTable.prototype._getCellTemplates = /**
* Gets the column definitions for the provided row def.
* @param {?} rowDef
* @return {?}
*/
function (rowDef) {
var _this = this;
if (!rowDef || !rowDef.columns) {
return [];
}
return Array.from(rowDef.columns, function (columnId) {
var /** @type {?} */ column = _this._columnDefsByName.get(columnId);
if (!column) {
throw getTableUnknownColumnError(columnId);
}
return rowDef.extractCellTemplate(column);
});
};
/**
* Adds native table sections (e.g. tbody) and moves the row outlets into them.
* @return {?}
*/
CdkTable.prototype._applyNativeTableSections = /**
* Adds native table sections (e.g. tbody) and moves the row outlets into them.
* @return {?}
*/
function () {
var /** @type {?} */ sections = [
{ tag: 'thead', outlet: this._headerRowOutlet },
{ tag: 'tbody', outlet: this._rowOutlet },
{ tag: 'tfoot', outlet: this._footerRowOutlet },
];
for (var _i = 0, sections_1 = sections; _i < sections_1.length; _i++) {
var section = sections_1[_i];
var /** @type {?} */ element = document.createElement(section.tag);
element.appendChild(section.outlet.elementRef.nativeElement);
this._elementRef.nativeElement.appendChild(element);
}
};
CdkTable.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'cdk-table, table[cdk-table]',
exportAs: 'cdkTable',
template: CDK_TABLE_TEMPLATE,
host: {
'class': 'cdk-table',
},
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
CdkTable.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Attribute"], args: ['role',] },] },
]; };
CdkTable.propDecorators = {
"trackBy": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"dataSource": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"_rowOutlet": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: [DataRowOutlet,] },],
"_headerRowOutlet": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: [HeaderRowOutlet,] },],
"_footerRowOutlet": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: [FooterRowOutlet,] },],
"_contentColumnDefs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [CdkColumnDef,] },],
"_contentRowDefs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [CdkRowDef,] },],
"_headerRowDef": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChild"], args: [CdkHeaderRowDef,] },],
"_footerRowDef": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChild"], args: [CdkFooterRowDef,] },],
};
return CdkTable;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ EXPORTED_DECLARATIONS = [
CdkTable,
CdkRowDef,
CdkCellDef,
CdkCellOutlet,
CdkHeaderCellDef,
CdkFooterCellDef,
CdkColumnDef,
CdkCell,
CdkRow,
CdkHeaderCell,
CdkFooterCell,
CdkHeaderRow,
CdkHeaderRowDef,
CdkFooterRow,
CdkFooterRowDef,
DataRowOutlet,
HeaderRowOutlet,
FooterRowOutlet,
];
var CdkTableModule = /** @class */ (function () {
function CdkTableModule() {
}
CdkTableModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__["CommonModule"]],
exports: EXPORTED_DECLARATIONS,
declarations: EXPORTED_DECLARATIONS
},] },
];
return CdkTableModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=table.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/text-field.es5.js":
/*!**********************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/text-field.es5.js ***!
\**********************************************************/
/*! exports provided: AutofillMonitor, CdkAutofill, CdkTextareaAutosize, TextFieldModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutofillMonitor", function() { return AutofillMonitor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkAutofill", function() { return CdkAutofill; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTextareaAutosize", function() { return CdkTextareaAutosize; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextFieldModule", function() { return TextFieldModule; });
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Options to pass to the animationstart listener.
*/
var /** @type {?} */ listenerOptions = Object(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__["supportsPassiveEventListeners"])() ? { passive: true } : false;
/**
* An injectable service that can be used to monitor the autofill state of an input.
* Based on the following blog post:
* https://medium.com/\@brunn/detecting-autofilled-fields-in-javascript-aed598d25da7
*/
var AutofillMonitor = /** @class */ (function () {
function AutofillMonitor(_platform, _ngZone) {
this._platform = _platform;
this._ngZone = _ngZone;
this._monitoredElements = new Map();
}
/**
* Monitor for changes in the autofill state of the given input element.
* @param element The element to monitor.
* @return A stream of autofill state changes.
*/
/**
* Monitor for changes in the autofill state of the given input element.
* @param {?} element The element to monitor.
* @return {?} A stream of autofill state changes.
*/
AutofillMonitor.prototype.monitor = /**
* Monitor for changes in the autofill state of the given input element.
* @param {?} element The element to monitor.
* @return {?} A stream of autofill state changes.
*/
function (element) {
if (!this._platform.isBrowser) {
return rxjs__WEBPACK_IMPORTED_MODULE_2__["EMPTY"];
}
var /** @type {?} */ info = this._monitoredElements.get(element);
if (info) {
return info.subject.asObservable();
}
var /** @type {?} */ result = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
var /** @type {?} */ listener = function (event) {
if (event.animationName === 'cdk-text-field-autofill-start') {
element.classList.add('cdk-text-field-autofilled');
result.next({ target: /** @type {?} */ (event.target), isAutofilled: true });
}
else if (event.animationName === 'cdk-text-field-autofill-end') {
element.classList.remove('cdk-text-field-autofilled');
result.next({ target: /** @type {?} */ (event.target), isAutofilled: false });
}
};
this._ngZone.runOutsideAngular(function () {
element.addEventListener('animationstart', listener, listenerOptions);
element.classList.add('cdk-text-field-autofill-monitored');
});
this._monitoredElements.set(element, {
subject: result,
unlisten: function () {
element.removeEventListener('animationstart', listener, listenerOptions);
}
});
return result.asObservable();
};
/**
* Stop monitoring the autofill state of the given input element.
* @param element The element to stop monitoring.
*/
/**
* Stop monitoring the autofill state of the given input element.
* @param {?} element The element to stop monitoring.
* @return {?}
*/
AutofillMonitor.prototype.stopMonitoring = /**
* Stop monitoring the autofill state of the given input element.
* @param {?} element The element to stop monitoring.
* @return {?}
*/
function (element) {
var /** @type {?} */ info = this._monitoredElements.get(element);
if (info) {
info.unlisten();
info.subject.complete();
element.classList.remove('cdk-text-field-autofill-monitored');
element.classList.remove('cdk-text-field-autofilled');
this._monitoredElements.delete(element);
}
};
/**
* @return {?}
*/
AutofillMonitor.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
var _this = this;
this._monitoredElements.forEach(function (_info, element) { return _this.stopMonitoring(element); });
};
AutofillMonitor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
AutofillMonitor.ctorParameters = function () { return [
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__["Platform"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], },
]; };
/** @nocollapse */ AutofillMonitor.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function AutofillMonitor_Factory() { return new AutofillMonitor(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__["Platform"]), Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"])); }, token: AutofillMonitor, providedIn: "root" });
return AutofillMonitor;
}());
/**
* A directive that can be used to monitor the autofill state of an input.
*/
var CdkAutofill = /** @class */ (function () {
function CdkAutofill(_elementRef, _autofillMonitor) {
this._elementRef = _elementRef;
this._autofillMonitor = _autofillMonitor;
/**
* Emits when the autofill state of the element changes.
*/
this.cdkAutofill = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
}
/**
* @return {?}
*/
CdkAutofill.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
this._autofillMonitor
.monitor(this._elementRef.nativeElement)
.subscribe(function (event) { return _this.cdkAutofill.emit(event); });
};
/**
* @return {?}
*/
CdkAutofill.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement);
};
CdkAutofill.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[cdkAutofill]',
},] },
];
/** @nocollapse */
CdkAutofill.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: AutofillMonitor, },
]; };
CdkAutofill.propDecorators = {
"cdkAutofill": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] },],
};
return CdkAutofill;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Directive to automatically resize a textarea to fit its content.
*/
var CdkTextareaAutosize = /** @class */ (function () {
function CdkTextareaAutosize(_elementRef, _platform, _ngZone) {
this._elementRef = _elementRef;
this._platform = _platform;
this._ngZone = _ngZone;
this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
}
Object.defineProperty(CdkTextareaAutosize.prototype, "minRows", {
get: /**
* @return {?}
*/
function () { return this._minRows; },
set: /**
* Minimum amount of rows in the textarea.
* @param {?} value
* @return {?}
*/
function (value) {
this._minRows = value;
this._setMinHeight();
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkTextareaAutosize.prototype, "maxRows", {
get: /**
* Maximum amount of rows in the textarea.
* @return {?}
*/
function () { return this._maxRows; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._maxRows = value;
this._setMaxHeight();
},
enumerable: true,
configurable: true
});
/** Sets the minimum height of the textarea as determined by minRows. */
/**
* Sets the minimum height of the textarea as determined by minRows.
* @return {?}
*/
CdkTextareaAutosize.prototype._setMinHeight = /**
* Sets the minimum height of the textarea as determined by minRows.
* @return {?}
*/
function () {
var /** @type {?} */ minHeight = this.minRows && this._cachedLineHeight ?
this.minRows * this._cachedLineHeight + "px" : null;
if (minHeight) {
this._setTextareaStyle('minHeight', minHeight);
}
};
/** Sets the maximum height of the textarea as determined by maxRows. */
/**
* Sets the maximum height of the textarea as determined by maxRows.
* @return {?}
*/
CdkTextareaAutosize.prototype._setMaxHeight = /**
* Sets the maximum height of the textarea as determined by maxRows.
* @return {?}
*/
function () {
var /** @type {?} */ maxHeight = this.maxRows && this._cachedLineHeight ?
this.maxRows * this._cachedLineHeight + "px" : null;
if (maxHeight) {
this._setTextareaStyle('maxHeight', maxHeight);
}
};
/**
* @return {?}
*/
CdkTextareaAutosize.prototype.ngAfterViewInit = /**
* @return {?}
*/
function () {
var _this = this;
if (this._platform.isBrowser) {
this.resizeToFitContent();
this._ngZone.runOutsideAngular(function () {
Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["fromEvent"])(window, 'resize')
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["auditTime"])(16), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(_this._destroyed))
.subscribe(function () { return _this.resizeToFitContent(true); });
});
}
};
/**
* @return {?}
*/
CdkTextareaAutosize.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._destroyed.next();
this._destroyed.complete();
};
/**
* Sets a style property on the textarea element.
* @param {?} property
* @param {?} value
* @return {?}
*/
CdkTextareaAutosize.prototype._setTextareaStyle = /**
* Sets a style property on the textarea element.
* @param {?} property
* @param {?} value
* @return {?}
*/
function (property, value) {
var /** @type {?} */ textarea = /** @type {?} */ (this._elementRef.nativeElement);
textarea.style[property] = value;
};
/**
* Cache the height of a single-row textarea if it has not already been cached.
*
* We need to know how large a single "row" of a textarea is in order to apply minRows and
* maxRows. For the initial version, we will assume that the height of a single line in the
* textarea does not ever change.
* @return {?}
*/
CdkTextareaAutosize.prototype._cacheTextareaLineHeight = /**
* Cache the height of a single-row textarea if it has not already been cached.
*
* We need to know how large a single "row" of a textarea is in order to apply minRows and
* maxRows. For the initial version, we will assume that the height of a single line in the
* textarea does not ever change.
* @return {?}
*/
function () {
if (this._cachedLineHeight) {
return;
}
var /** @type {?} */ textarea = /** @type {?} */ (this._elementRef.nativeElement);
// Use a clone element because we have to override some styles.
var /** @type {?} */ textareaClone = /** @type {?} */ (textarea.cloneNode(false));
textareaClone.rows = 1;
// Use `position: absolute` so that this doesn't cause a browser layout and use
// `visibility: hidden` so that nothing is rendered. Clear any other styles that
// would affect the height.
textareaClone.style.position = 'absolute';
textareaClone.style.visibility = 'hidden';
textareaClone.style.border = 'none';
textareaClone.style.padding = '0';
textareaClone.style.height = '';
textareaClone.style.minHeight = '';
textareaClone.style.maxHeight = '';
// In Firefox it happens that textarea elements are always bigger than the specified amount
// of rows. This is because Firefox tries to add extra space for the horizontal scrollbar.
// As a workaround that removes the extra space for the scrollbar, we can just set overflow
// to hidden. This ensures that there is no invalid calculation of the line height.
// See Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=33654
textareaClone.style.overflow = 'hidden'; /** @type {?} */
((textarea.parentNode)).appendChild(textareaClone);
this._cachedLineHeight = textareaClone.clientHeight; /** @type {?} */
((textarea.parentNode)).removeChild(textareaClone);
// Min and max heights have to be re-calculated if the cached line height changes
this._setMinHeight();
this._setMaxHeight();
};
/**
* @return {?}
*/
CdkTextareaAutosize.prototype.ngDoCheck = /**
* @return {?}
*/
function () {
if (this._platform.isBrowser) {
this.resizeToFitContent();
}
};
/**
* Resize the textarea to fit its content.
* @param force Whether to force a height recalculation. By default the height will be
* recalculated only if the value changed since the last call.
*/
/**
* Resize the textarea to fit its content.
* @param {?=} force Whether to force a height recalculation. By default the height will be
* recalculated only if the value changed since the last call.
* @return {?}
*/
CdkTextareaAutosize.prototype.resizeToFitContent = /**
* Resize the textarea to fit its content.
* @param {?=} force Whether to force a height recalculation. By default the height will be
* recalculated only if the value changed since the last call.
* @return {?}
*/
function (force) {
var _this = this;
if (force === void 0) { force = false; }
this._cacheTextareaLineHeight();
// If we haven't determined the line-height yet, we know we're still hidden and there's no point
// in checking the height of the textarea.
if (!this._cachedLineHeight) {
return;
}
var /** @type {?} */ textarea = /** @type {?} */ (this._elementRef.nativeElement);
var /** @type {?} */ value = textarea.value;
// Only resize of the value changed since these calculations can be expensive.
if (value === this._previousValue && !force) {
return;
}
var /** @type {?} */ placeholderText = textarea.placeholder;
// Reset the textarea height to auto in order to shrink back to its default size.
// Also temporarily force overflow:hidden, so scroll bars do not interfere with calculations.
// Long placeholders that are wider than the textarea width may lead to a bigger scrollHeight
// value. To ensure that the scrollHeight is not bigger than the content, the placeholders
// need to be removed temporarily.
textarea.classList.add('cdk-textarea-autosize-measuring');
textarea.placeholder = '';
// The cdk-textarea-autosize-measuring class includes a 2px padding to workaround an issue with
// Chrome, so we account for that extra space here by subtracting 4 (2px top + 2px bottom).
var /** @type {?} */ height = textarea.scrollHeight - 4;
// Use the scrollHeight to know how large the textarea *would* be if fit its entire value.
textarea.style.height = height + "px";
textarea.classList.remove('cdk-textarea-autosize-measuring');
textarea.placeholder = placeholderText;
// On Firefox resizing the textarea will prevent it from scrolling to the caret position.
// We need to re-set the selection in order for it to scroll to the proper position.
if (typeof requestAnimationFrame !== 'undefined') {
this._ngZone.runOutsideAngular(function () {
return requestAnimationFrame(function () {
var selectionStart = textarea.selectionStart, selectionEnd = textarea.selectionEnd;
// IE will throw an "Unspecified error" if we try to set the selection range after the
// element has been removed from the DOM. Assert that the directive hasn't been destroyed
// between the time we requested the animation frame and when it was executed.
if (!_this._destroyed.isStopped) {
textarea.setSelectionRange(selectionStart, selectionEnd);
}
});
});
}
this._previousValue = value;
};
/**
* @return {?}
*/
CdkTextareaAutosize.prototype._noopInputHandler = /**
* @return {?}
*/
function () {
// no-op handler that ensures we're running change detection on input events.
};
CdkTextareaAutosize.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'textarea[cdkTextareaAutosize]',
exportAs: 'cdkTextareaAutosize',
host: {
'class': 'cdk-textarea-autosize',
// Textarea elements that have the directive applied should have a single row by default.
// Browsers normally show two rows by default and therefore this limits the minRows binding.
'rows': '1',
'(input)': '_noopInputHandler()',
},
},] },
];
/** @nocollapse */
CdkTextareaAutosize.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__["Platform"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], },
]; };
CdkTextareaAutosize.propDecorators = {
"minRows": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['cdkAutosizeMinRows',] },],
"maxRows": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['cdkAutosizeMaxRows',] },],
};
return CdkTextareaAutosize;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var TextFieldModule = /** @class */ (function () {
function TextFieldModule() {
}
TextFieldModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
declarations: [CdkAutofill, CdkTextareaAutosize],
imports: [_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__["PlatformModule"]],
exports: [CdkAutofill, CdkTextareaAutosize],
},] },
];
return TextFieldModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=text-field.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/cdk/esm5/tree.es5.js":
/*!****************************************************!*\
!*** ./node_modules/@angular/cdk/esm5/tree.es5.js ***!
\****************************************************/
/*! exports provided: BaseTreeControl, FlatTreeControl, NestedTreeControl, CdkNestedTreeNode, CdkTreeNodeOutletContext, CdkTreeNodeDef, CdkTreeNodePadding, CdkTreeNodeOutlet, CdkTreeNode, CdkTree, getTreeNoValidDataSourceError, getTreeMultipleDefaultNodeDefsError, getTreeMissingMatchingNodeDefError, getTreeControlMissingError, getTreeControlFunctionsMissingError, CdkTreeModule, CdkTreeNodeToggle */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseTreeControl", function() { return BaseTreeControl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FlatTreeControl", function() { return FlatTreeControl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NestedTreeControl", function() { return NestedTreeControl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkNestedTreeNode", function() { return CdkNestedTreeNode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeNodeOutletContext", function() { return CdkTreeNodeOutletContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeNodeDef", function() { return CdkTreeNodeDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeNodePadding", function() { return CdkTreeNodePadding; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeNodeOutlet", function() { return CdkTreeNodeOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeNode", function() { return CdkTreeNode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTree", function() { return CdkTree; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTreeNoValidDataSourceError", function() { return getTreeNoValidDataSourceError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTreeMultipleDefaultNodeDefsError", function() { return getTreeMultipleDefaultNodeDefsError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTreeMissingMatchingNodeDefError", function() { return getTreeMissingMatchingNodeDefError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTreeControlMissingError", function() { return getTreeControlMissingError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTreeControlFunctionsMissingError", function() { return getTreeControlFunctionsMissingError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeModule", function() { return CdkTreeModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeNodeToggle", function() { return CdkTreeNodeToggle; });
/* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm5/collections.es5.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Base tree control. It has basic toggle/expand/collapse operations on a single data node.
* @abstract
* @template T
*/
var /**
* Base tree control. It has basic toggle/expand/collapse operations on a single data node.
* @abstract
* @template T
*/
BaseTreeControl = /** @class */ (function () {
function BaseTreeControl() {
/**
* A selection model with multi-selection to track expansion status.
*/
this.expansionModel = new _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_0__["SelectionModel"](true);
}
/** Toggles one single data node's expanded/collapsed state. */
/**
* Toggles one single data node's expanded/collapsed state.
* @param {?} dataNode
* @return {?}
*/
BaseTreeControl.prototype.toggle = /**
* Toggles one single data node's expanded/collapsed state.
* @param {?} dataNode
* @return {?}
*/
function (dataNode) {
this.expansionModel.toggle(dataNode);
};
/** Expands one single data node. */
/**
* Expands one single data node.
* @param {?} dataNode
* @return {?}
*/
BaseTreeControl.prototype.expand = /**
* Expands one single data node.
* @param {?} dataNode
* @return {?}
*/
function (dataNode) {
this.expansionModel.select(dataNode);
};
/** Collapses one single data node. */
/**
* Collapses one single data node.
* @param {?} dataNode
* @return {?}
*/
BaseTreeControl.prototype.collapse = /**
* Collapses one single data node.
* @param {?} dataNode
* @return {?}
*/
function (dataNode) {
this.expansionModel.deselect(dataNode);
};
/** Whether a given data node is expanded or not. Returns true if the data node is expanded. */
/**
* Whether a given data node is expanded or not. Returns true if the data node is expanded.
* @param {?} dataNode
* @return {?}
*/
BaseTreeControl.prototype.isExpanded = /**
* Whether a given data node is expanded or not. Returns true if the data node is expanded.
* @param {?} dataNode
* @return {?}
*/
function (dataNode) {
return this.expansionModel.isSelected(dataNode);
};
/** Toggles a subtree rooted at `node` recursively. */
/**
* Toggles a subtree rooted at `node` recursively.
* @param {?} dataNode
* @return {?}
*/
BaseTreeControl.prototype.toggleDescendants = /**
* Toggles a subtree rooted at `node` recursively.
* @param {?} dataNode
* @return {?}
*/
function (dataNode) {
this.expansionModel.isSelected(dataNode)
? this.collapseDescendants(dataNode)
: this.expandDescendants(dataNode);
};
/** Collapse all dataNodes in the tree. */
/**
* Collapse all dataNodes in the tree.
* @return {?}
*/
BaseTreeControl.prototype.collapseAll = /**
* Collapse all dataNodes in the tree.
* @return {?}
*/
function () {
this.expansionModel.clear();
};
/** Expands a subtree rooted at given data node recursively. */
/**
* Expands a subtree rooted at given data node recursively.
* @param {?} dataNode
* @return {?}
*/
BaseTreeControl.prototype.expandDescendants = /**
* Expands a subtree rooted at given data node recursively.
* @param {?} dataNode
* @return {?}
*/
function (dataNode) {
var /** @type {?} */ toBeProcessed = [dataNode];
toBeProcessed.push.apply(toBeProcessed, this.getDescendants(dataNode));
(_a = this.expansionModel).select.apply(_a, toBeProcessed);
var _a;
};
/** Collapses a subtree rooted at given data node recursively. */
/**
* Collapses a subtree rooted at given data node recursively.
* @param {?} dataNode
* @return {?}
*/
BaseTreeControl.prototype.collapseDescendants = /**
* Collapses a subtree rooted at given data node recursively.
* @param {?} dataNode
* @return {?}
*/
function (dataNode) {
var /** @type {?} */ toBeProcessed = [dataNode];
toBeProcessed.push.apply(toBeProcessed, this.getDescendants(dataNode));
(_a = this.expansionModel).deselect.apply(_a, toBeProcessed);
var _a;
};
return BaseTreeControl;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Flat tree control. Able to expand/collapse a subtree recursively for flattened tree.
* @template T
*/
var /**
* Flat tree control. Able to expand/collapse a subtree recursively for flattened tree.
* @template T
*/
FlatTreeControl = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(FlatTreeControl, _super);
/** Construct with flat tree data node functions getLevel and isExpandable. */
function FlatTreeControl(getLevel, isExpandable) {
var _this = _super.call(this) || this;
_this.getLevel = getLevel;
_this.isExpandable = isExpandable;
return _this;
}
/**
* Gets a list of the data node's subtree of descendent data nodes.
*
* To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes
* with correct levels.
*/
/**
* Gets a list of the data node's subtree of descendent data nodes.
*
* To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes
* with correct levels.
* @param {?} dataNode
* @return {?}
*/
FlatTreeControl.prototype.getDescendants = /**
* Gets a list of the data node's subtree of descendent data nodes.
*
* To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes
* with correct levels.
* @param {?} dataNode
* @return {?}
*/
function (dataNode) {
var /** @type {?} */ startIndex = this.dataNodes.indexOf(dataNode);
var /** @type {?} */ results = [];
// Goes through flattened tree nodes in the `dataNodes` array, and get all descendants.
// The level of descendants of a tree node must be greater than the level of the given
// tree node.
// If we reach a node whose level is equal to the level of the tree node, we hit a sibling.
// If we reach a node whose level is greater than the level of the tree node, we hit a
// sibling of an ancestor.
for (var /** @type {?} */ i = startIndex + 1; i < this.dataNodes.length && this.getLevel(dataNode) < this.getLevel(this.dataNodes[i]); i++) {
results.push(this.dataNodes[i]);
}
return results;
};
/**
* Expands all data nodes in the tree.
*
* To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened
* data nodes of the tree.
*/
/**
* Expands all data nodes in the tree.
*
* To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened
* data nodes of the tree.
* @return {?}
*/
FlatTreeControl.prototype.expandAll = /**
* Expands all data nodes in the tree.
*
* To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened
* data nodes of the tree.
* @return {?}
*/
function () {
(_a = this.expansionModel).select.apply(_a, this.dataNodes);
var _a;
};
return FlatTreeControl;
}(BaseTreeControl));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type.
* @template T
*/
var /**
* Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type.
* @template T
*/
NestedTreeControl = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(NestedTreeControl, _super);
/** Construct with nested tree function getChildren. */
function NestedTreeControl(getChildren) {
var _this = _super.call(this) || this;
_this.getChildren = getChildren;
return _this;
}
/**
* Expands all dataNodes in the tree.
*
* To make this working, the `dataNodes` variable of the TreeControl must be set to all root level
* data nodes of the tree.
*/
/**
* Expands all dataNodes in the tree.
*
* To make this working, the `dataNodes` variable of the TreeControl must be set to all root level
* data nodes of the tree.
* @return {?}
*/
NestedTreeControl.prototype.expandAll = /**
* Expands all dataNodes in the tree.
*
* To make this working, the `dataNodes` variable of the TreeControl must be set to all root level
* data nodes of the tree.
* @return {?}
*/
function () {
var _this = this;
this.expansionModel.clear();
var /** @type {?} */ allNodes = this.dataNodes.reduce(function (accumulator, dataNode) {
return accumulator.concat(_this.getDescendants(dataNode), [dataNode]);
}, []);
(_a = this.expansionModel).select.apply(_a, allNodes);
var _a;
};
/** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */
/**
* Gets a list of descendant dataNodes of a subtree rooted at given data node recursively.
* @param {?} dataNode
* @return {?}
*/
NestedTreeControl.prototype.getDescendants = /**
* Gets a list of descendant dataNodes of a subtree rooted at given data node recursively.
* @param {?} dataNode
* @return {?}
*/
function (dataNode) {
var /** @type {?} */ descendants = [];
this._getDescendants(descendants, dataNode);
// Remove the node itself
return descendants.splice(1);
};
/** A helper function to get descendants recursively. */
/**
* A helper function to get descendants recursively.
* @param {?} descendants
* @param {?} dataNode
* @return {?}
*/
NestedTreeControl.prototype._getDescendants = /**
* A helper function to get descendants recursively.
* @param {?} descendants
* @param {?} dataNode
* @return {?}
*/
function (descendants, dataNode) {
var _this = this;
descendants.push(dataNode);
this.getChildren(dataNode).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["take"])(1)).subscribe(function (children) {
if (children && children.length > 0) {
children.forEach(function (child) { return _this._getDescendants(descendants, child); });
}
});
};
return NestedTreeControl;
}(BaseTreeControl));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Context provided to the tree node component.
* @template T
*/
var /**
* Context provided to the tree node component.
* @template T
*/
CdkTreeNodeOutletContext = /** @class */ (function () {
function CdkTreeNodeOutletContext(data) {
this.$implicit = data;
}
return CdkTreeNodeOutletContext;
}());
/**
* Data node definition for the CdkTree.
* Captures the node's template and a when predicate that describes when this node should be used.
* @template T
*/
var CdkTreeNodeDef = /** @class */ (function () {
/** @docs-private */
function CdkTreeNodeDef(template) {
this.template = template;
}
CdkTreeNodeDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Directive"], args: [{
selector: '[cdkTreeNodeDef]',
inputs: [
'when: cdkTreeNodeDefWhen'
],
},] },
];
/** @nocollapse */
CdkTreeNodeDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["TemplateRef"], },
]; };
return CdkTreeNodeDef;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Outlet for nested CdkNode. Put `[cdkTreeNodeOutlet]` on a tag to place children dataNodes
* inside the outlet.
*/
var CdkTreeNodeOutlet = /** @class */ (function () {
function CdkTreeNodeOutlet(viewContainer) {
this.viewContainer = viewContainer;
}
CdkTreeNodeOutlet.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Directive"], args: [{
selector: '[cdkTreeNodeOutlet]'
},] },
];
/** @nocollapse */
CdkTreeNodeOutlet.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ViewContainerRef"], },
]; };
return CdkTreeNodeOutlet;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Returns an error to be thrown when there is no usable data.
* \@docs-private
* @return {?}
*/
function getTreeNoValidDataSourceError() {
return Error("A valid data source must be provided.");
}
/**
* Returns an error to be thrown when there are multiple nodes that are missing a when function.
* \@docs-private
* @return {?}
*/
function getTreeMultipleDefaultNodeDefsError() {
return Error("There can only be one default row without a when predicate function.");
}
/**
* Returns an error to be thrown when there are no matching node defs for a particular set of data.
* \@docs-private
* @return {?}
*/
function getTreeMissingMatchingNodeDefError() {
return Error("Could not find a matching node definition for the provided node data.");
}
/**
* Returns an error to be thrown when there are tree control.
* \@docs-private
* @return {?}
*/
function getTreeControlMissingError() {
return Error("Could not find a tree control for the tree.");
}
/**
* Returns an error to be thrown when tree control did not implement functions for flat/nested node.
* \@docs-private
* @return {?}
*/
function getTreeControlFunctionsMissingError() {
return Error("Could not find functions for nested/flat tree in tree control.");
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Tree node for CdkTree. It contains the data in the tree node.
* @template T
*/
var CdkTreeNode = /** @class */ (function () {
function CdkTreeNode(_elementRef, _tree) {
this._elementRef = _elementRef;
this._tree = _tree;
/**
* Subject that emits when the component has been destroyed.
*/
this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
/**
* The role of the node should be 'group' if it's an internal node,
* and 'treeitem' if it's a leaf node.
*/
this.role = 'treeitem';
CdkTreeNode.mostRecentTreeNode = /** @type {?} */ (this);
}
Object.defineProperty(CdkTreeNode.prototype, "data", {
/** The tree node's data. */
get: /**
* The tree node's data.
* @return {?}
*/
function () { return this._data; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._data = value;
this._setRoleFromData();
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkTreeNode.prototype, "isExpanded", {
get: /**
* @return {?}
*/
function () {
return this._tree.treeControl.isExpanded(this._data);
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkTreeNode.prototype, "level", {
get: /**
* @return {?}
*/
function () {
return this._tree.treeControl.getLevel ? this._tree.treeControl.getLevel(this._data) : 0;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
CdkTreeNode.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._destroyed.next();
this._destroyed.complete();
};
/** Focuses the menu item. Implements for FocusableOption. */
/**
* Focuses the menu item. Implements for FocusableOption.
* @return {?}
*/
CdkTreeNode.prototype.focus = /**
* Focuses the menu item. Implements for FocusableOption.
* @return {?}
*/
function () {
this._elementRef.nativeElement.focus();
};
/**
* @return {?}
*/
CdkTreeNode.prototype._setRoleFromData = /**
* @return {?}
*/
function () {
var _this = this;
if (this._tree.treeControl.isExpandable) {
this.role = this._tree.treeControl.isExpandable(this._data) ? 'group' : 'treeitem';
}
else {
if (!this._tree.treeControl.getChildren) {
throw getTreeControlFunctionsMissingError();
}
this._tree.treeControl.getChildren(this._data).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["takeUntil"])(this._destroyed))
.subscribe(function (children) {
_this.role = children && children.length ? 'group' : 'treeitem';
});
}
};
/**
* The most recently created `CdkTreeNode`. We save it in static variable so we can retrieve it
* in `CdkTree` and set the data to it.
*/
CdkTreeNode.mostRecentTreeNode = null;
CdkTreeNode.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Directive"], args: [{
selector: 'cdk-tree-node',
exportAs: 'cdkTreeNode',
host: {
'[attr.aria-expanded]': 'isExpanded',
'[attr.aria-level]': 'role === "treeitem" ? level : null',
'[attr.role]': 'role',
'class': 'cdk-tree-node',
},
},] },
];
/** @nocollapse */
CdkTreeNode.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ElementRef"], },
{ type: CdkTree, },
]; };
CdkTreeNode.propDecorators = {
"role": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"] },],
};
return CdkTreeNode;
}());
/**
* CDK tree component that connects with a data source to retrieve data of type `T` and renders
* dataNodes with hierarchy. Updates the dataNodes when new data is provided by the data source.
* @template T
*/
var CdkTree = /** @class */ (function () {
function CdkTree(_differs, _changeDetectorRef) {
this._differs = _differs;
this._changeDetectorRef = _changeDetectorRef;
/**
* Subject that emits when the component has been destroyed.
*/
this._onDestroy = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
/**
* Level of nodes
*/
this._levels = new Map();
/**
* Stream containing the latest information on what rows are being displayed on screen.
* Can be used by the data source to as a heuristic of what data should be provided.
*/
this.viewChange = new rxjs__WEBPACK_IMPORTED_MODULE_4__["BehaviorSubject"]({ start: 0, end: Number.MAX_VALUE });
}
Object.defineProperty(CdkTree.prototype, "dataSource", {
get: /**
* Provides a stream containing the latest data array to render. Influenced by the tree's
* stream of view window (what dataNodes are currently on screen).
* Data source can be an observable of data array, or a dara array to render.
* @return {?}
*/
function () { return this._dataSource; },
set: /**
* @param {?} dataSource
* @return {?}
*/
function (dataSource) {
if (this._dataSource !== dataSource) {
this._switchDataSource(dataSource);
}
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
CdkTree.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._dataDiffer = this._differs.find([]).create();
if (!this.treeControl) {
throw getTreeControlMissingError();
}
};
/**
* @return {?}
*/
CdkTree.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._nodeOutlet.viewContainer.clear();
this._onDestroy.next();
this._onDestroy.complete();
if (this._dataSource && typeof (/** @type {?} */ (this._dataSource)).disconnect === 'function') {
(/** @type {?} */ (this.dataSource)).disconnect(this);
}
if (this._dataSubscription) {
this._dataSubscription.unsubscribe();
this._dataSubscription = null;
}
};
/**
* @return {?}
*/
CdkTree.prototype.ngAfterContentChecked = /**
* @return {?}
*/
function () {
var /** @type {?} */ defaultNodeDefs = this._nodeDefs.filter(function (def) { return !def.when; });
if (defaultNodeDefs.length > 1) {
throw getTreeMultipleDefaultNodeDefsError();
}
this._defaultNodeDef = defaultNodeDefs[0];
if (this.dataSource && this._nodeDefs && !this._dataSubscription) {
this._observeRenderChanges();
}
};
/**
* Switch to the provided data source by resetting the data and unsubscribing from the current
* render change subscription if one exists. If the data source is null, interpret this by
* clearing the node outlet. Otherwise start listening for new data.
* @param {?} dataSource
* @return {?}
*/
CdkTree.prototype._switchDataSource = /**
* Switch to the provided data source by resetting the data and unsubscribing from the current
* render change subscription if one exists. If the data source is null, interpret this by
* clearing the node outlet. Otherwise start listening for new data.
* @param {?} dataSource
* @return {?}
*/
function (dataSource) {
if (this._dataSource && typeof (/** @type {?} */ (this._dataSource)).disconnect === 'function') {
(/** @type {?} */ (this.dataSource)).disconnect(this);
}
if (this._dataSubscription) {
this._dataSubscription.unsubscribe();
this._dataSubscription = null;
}
// Remove the all dataNodes if there is now no data source
if (!dataSource) {
this._nodeOutlet.viewContainer.clear();
}
this._dataSource = dataSource;
if (this._nodeDefs) {
this._observeRenderChanges();
}
};
/**
* Set up a subscription for the data provided by the data source.
* @return {?}
*/
CdkTree.prototype._observeRenderChanges = /**
* Set up a subscription for the data provided by the data source.
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ dataStream;
// Cannot use `instanceof DataSource` since the data source could be a literal with
// `connect` function and may not extends DataSource.
if (typeof (/** @type {?} */ (this._dataSource)).connect === 'function') {
dataStream = (/** @type {?} */ (this._dataSource)).connect(this);
}
else if (this._dataSource instanceof rxjs__WEBPACK_IMPORTED_MODULE_4__["Observable"]) {
dataStream = this._dataSource;
}
else if (Array.isArray(this._dataSource)) {
dataStream = Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["of"])(this._dataSource);
}
if (dataStream) {
this._dataSubscription = dataStream.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["takeUntil"])(this._onDestroy))
.subscribe(function (data) { return _this.renderNodeChanges(data); });
}
else {
throw getTreeNoValidDataSourceError();
}
};
/** Check for changes made in the data and render each change (node added/removed/moved). */
/**
* Check for changes made in the data and render each change (node added/removed/moved).
* @param {?} data
* @param {?=} dataDiffer
* @param {?=} viewContainer
* @param {?=} parentData
* @return {?}
*/
CdkTree.prototype.renderNodeChanges = /**
* Check for changes made in the data and render each change (node added/removed/moved).
* @param {?} data
* @param {?=} dataDiffer
* @param {?=} viewContainer
* @param {?=} parentData
* @return {?}
*/
function (data, dataDiffer, viewContainer, parentData) {
var _this = this;
if (dataDiffer === void 0) { dataDiffer = this._dataDiffer; }
if (viewContainer === void 0) { viewContainer = this._nodeOutlet.viewContainer; }
var /** @type {?} */ changes = dataDiffer.diff(data);
if (!changes) {
return;
}
changes.forEachOperation(function (item, adjustedPreviousIndex, currentIndex) {
if (item.previousIndex == null) {
_this.insertNode(data[currentIndex], currentIndex, viewContainer, parentData);
}
else if (currentIndex == null) {
viewContainer.remove(adjustedPreviousIndex);
_this._levels.delete(item.item);
}
else {
var /** @type {?} */ view = viewContainer.get(adjustedPreviousIndex);
viewContainer.move(/** @type {?} */ ((view)), currentIndex);
}
});
this._changeDetectorRef.detectChanges();
};
/**
* Finds the matching node definition that should be used for this node data. If there is only
* one node definition, it is returned. Otherwise, find the node definition that has a when
* predicate that returns true with the data. If none return true, return the default node
* definition.
*/
/**
* Finds the matching node definition that should be used for this node data. If there is only
* one node definition, it is returned. Otherwise, find the node definition that has a when
* predicate that returns true with the data. If none return true, return the default node
* definition.
* @param {?} data
* @param {?} i
* @return {?}
*/
CdkTree.prototype._getNodeDef = /**
* Finds the matching node definition that should be used for this node data. If there is only
* one node definition, it is returned. Otherwise, find the node definition that has a when
* predicate that returns true with the data. If none return true, return the default node
* definition.
* @param {?} data
* @param {?} i
* @return {?}
*/
function (data, i) {
if (this._nodeDefs.length === 1) {
return this._nodeDefs.first;
}
var /** @type {?} */ nodeDef = this._nodeDefs.find(function (def) { return def.when && def.when(i, data); }) || this._defaultNodeDef;
if (!nodeDef) {
throw getTreeMissingMatchingNodeDefError();
}
return nodeDef;
};
/**
* Create the embedded view for the data node template and place it in the correct index location
* within the data node view container.
*/
/**
* Create the embedded view for the data node template and place it in the correct index location
* within the data node view container.
* @param {?} nodeData
* @param {?} index
* @param {?=} viewContainer
* @param {?=} parentData
* @return {?}
*/
CdkTree.prototype.insertNode = /**
* Create the embedded view for the data node template and place it in the correct index location
* within the data node view container.
* @param {?} nodeData
* @param {?} index
* @param {?=} viewContainer
* @param {?=} parentData
* @return {?}
*/
function (nodeData, index, viewContainer, parentData) {
var /** @type {?} */ node = this._getNodeDef(nodeData, index);
// Node context that will be provided to created embedded view
var /** @type {?} */ context = new CdkTreeNodeOutletContext(nodeData);
// If the tree is flat tree, then use the `getLevel` function in flat tree control
// Otherwise, use the level of parent node.
if (this.treeControl.getLevel) {
context.level = this.treeControl.getLevel(nodeData);
}
else if (typeof parentData !== 'undefined' && this._levels.has(parentData)) {
context.level = /** @type {?} */ ((this._levels.get(parentData))) + 1;
}
else {
context.level = 0;
}
this._levels.set(nodeData, context.level);
// Use default tree nodeOutlet, or nested node's nodeOutlet
var /** @type {?} */ container = viewContainer ? viewContainer : this._nodeOutlet.viewContainer;
container.createEmbeddedView(node.template, context, index);
// Set the data to just created `CdkTreeNode`.
// The `CdkTreeNode` created from `createEmbeddedView` will be saved in static variable
// `mostRecentTreeNode`. We get it from static variable and pass the node data to it.
if (CdkTreeNode.mostRecentTreeNode) {
CdkTreeNode.mostRecentTreeNode.data = nodeData;
}
};
CdkTree.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Component"], args: [{selector: 'cdk-tree',
exportAs: 'cdkTree',
template: "<ng-container cdkTreeNodeOutlet></ng-container>",
host: {
'class': 'cdk-tree',
'role': 'tree',
},
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ChangeDetectionStrategy"].OnPush
},] },
];
/** @nocollapse */
CdkTree.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["IterableDiffers"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ChangeDetectorRef"], },
]; };
CdkTree.propDecorators = {
"dataSource": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"] },],
"treeControl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"] },],
"_nodeOutlet": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ViewChild"], args: [CdkTreeNodeOutlet,] },],
"_nodeDefs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ContentChildren"], args: [CdkTreeNodeDef,] },],
};
return CdkTree;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Nested node is a child of `<cdk-tree>`. It works with nested tree.
* By using `cdk-nested-tree-node` component in tree node template, children of the parent node will
* be added in the `cdkTreeNodeOutlet` in tree node template.
* For example:
* ```html
* <cdk-mested-tree-node>
* {{node.name}}
* <ng-template cdkTreeNodeOutlet></ng-template>
* </cdk-tree-node>
* ```
* The children of node will be automatically added to `cdkTreeNodeOutlet`, the result dom will be
* like this:
* ```html
* <cdk-nested-tree-node>
* {{node.name}}
* <cdk-nested-tree-node>{{child1.name}}</cdk-tree-node>
* <cdk-nested-tree-node>{{child2.name}}</cdk-tree-node>
* </cdk-tree-node>
* ```
* @template T
*/
var CdkNestedTreeNode = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(CdkNestedTreeNode, _super);
function CdkNestedTreeNode(_elementRef, _tree, _differs) {
var _this = _super.call(this, _elementRef, _tree) || this;
_this._elementRef = _elementRef;
_this._tree = _tree;
_this._differs = _differs;
return _this;
}
/**
* @return {?}
*/
CdkNestedTreeNode.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
this._dataDiffer = this._differs.find([]).create();
if (!this._tree.treeControl.getChildren) {
throw getTreeControlFunctionsMissingError();
}
this._tree.treeControl.getChildren(this.data).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["takeUntil"])(this._destroyed))
.subscribe(function (result) {
_this._children = result;
_this.updateChildrenNodes();
});
this.nodeOutlet.changes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["takeUntil"])(this._destroyed))
.subscribe(function () { return _this.updateChildrenNodes(); });
};
/**
* @return {?}
*/
CdkNestedTreeNode.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._clear();
_super.prototype.ngOnDestroy.call(this);
};
/** Add children dataNodes to the NodeOutlet */
/**
* Add children dataNodes to the NodeOutlet
* @return {?}
*/
CdkNestedTreeNode.prototype.updateChildrenNodes = /**
* Add children dataNodes to the NodeOutlet
* @return {?}
*/
function () {
if (this.nodeOutlet.length && this._children) {
var /** @type {?} */ viewContainer = this.nodeOutlet.first.viewContainer;
this._tree.renderNodeChanges(this._children, this._dataDiffer, viewContainer, this._data);
}
else {
// Reset the data differ if there's no children nodes displayed
this._dataDiffer.diff([]);
}
};
/** Clear the children dataNodes. */
/**
* Clear the children dataNodes.
* @return {?}
*/
CdkNestedTreeNode.prototype._clear = /**
* Clear the children dataNodes.
* @return {?}
*/
function () {
if (this.nodeOutlet && this.nodeOutlet.first) {
this.nodeOutlet.first.viewContainer.clear();
this._dataDiffer.diff([]);
}
};
CdkNestedTreeNode.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Directive"], args: [{
selector: 'cdk-nested-tree-node',
exportAs: 'cdkNestedTreeNode',
host: {
'[attr.aria-expanded]': 'isExpanded',
'[attr.role]': 'role',
'class': 'cdk-tree-node cdk-nested-tree-node',
},
providers: [{ provide: CdkTreeNode, useExisting: CdkNestedTreeNode }]
},] },
];
/** @nocollapse */
CdkNestedTreeNode.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ElementRef"], },
{ type: CdkTree, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["IterableDiffers"], },
]; };
CdkNestedTreeNode.propDecorators = {
"nodeOutlet": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ContentChildren"], args: [CdkTreeNodeOutlet,] },],
};
return CdkNestedTreeNode;
}(CdkTreeNode));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Indent for the children tree dataNodes.
* This directive will add left-padding to the node to show hierarchy.
* @template T
*/
var CdkTreeNodePadding = /** @class */ (function () {
function CdkTreeNodePadding(_treeNode, _tree, _renderer, _element, _dir) {
var _this = this;
this._treeNode = _treeNode;
this._tree = _tree;
this._renderer = _renderer;
this._element = _element;
this._dir = _dir;
/**
* Subject that emits when the component has been destroyed.
*/
this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
this._indent = 40;
this._setPadding();
if (this._dir) {
this._dir.change.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["takeUntil"])(this._destroyed)).subscribe(function () { return _this._setPadding(); });
}
}
Object.defineProperty(CdkTreeNodePadding.prototype, "level", {
get: /**
* The level of depth of the tree node. The padding will be `level * indent` pixels.
* @return {?}
*/
function () { return this._level; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._level = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_6__["coerceNumberProperty"])(value);
this._setPadding();
},
enumerable: true,
configurable: true
});
Object.defineProperty(CdkTreeNodePadding.prototype, "indent", {
get: /**
* The indent for each level. Default number 40px from material design menu sub-menu spec.
* @return {?}
*/
function () { return this._indent; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._indent = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_6__["coerceNumberProperty"])(value);
this._setPadding();
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
CdkTreeNodePadding.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._destroyed.next();
this._destroyed.complete();
};
/** The padding indent value for the tree node. Returns a string with px numbers if not null. */
/**
* The padding indent value for the tree node. Returns a string with px numbers if not null.
* @return {?}
*/
CdkTreeNodePadding.prototype._paddingIndent = /**
* The padding indent value for the tree node. Returns a string with px numbers if not null.
* @return {?}
*/
function () {
var /** @type {?} */ nodeLevel = (this._treeNode.data && this._tree.treeControl.getLevel)
? this._tree.treeControl.getLevel(this._treeNode.data)
: null;
var /** @type {?} */ level = this._level || nodeLevel;
return level ? level * this._indent + "px" : null;
};
/**
* @return {?}
*/
CdkTreeNodePadding.prototype._setPadding = /**
* @return {?}
*/
function () {
var /** @type {?} */ padding = this._paddingIndent();
var /** @type {?} */ paddingProp = this._dir && this._dir.value === 'rtl' ? 'paddingRight' : 'paddingLeft';
this._renderer.setStyle(this._element.nativeElement, paddingProp, padding);
};
CdkTreeNodePadding.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Directive"], args: [{
selector: '[cdkTreeNodePadding]',
},] },
];
/** @nocollapse */
CdkTreeNodePadding.ctorParameters = function () { return [
{ type: CdkTreeNode, },
{ type: CdkTree, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Renderer2"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ElementRef"], },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_5__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Optional"] },] },
]; };
CdkTreeNodePadding.propDecorators = {
"level": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"], args: ['cdkTreeNodePadding',] },],
"indent": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"], args: ['cdkTreeNodePaddingIndent',] },],
};
return CdkTreeNodePadding;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Node toggle to expand/collapse the node.
* @template T
*/
var CdkTreeNodeToggle = /** @class */ (function () {
function CdkTreeNodeToggle(_tree, _treeNode) {
this._tree = _tree;
this._treeNode = _treeNode;
this._recursive = false;
}
Object.defineProperty(CdkTreeNodeToggle.prototype, "recursive", {
get: /**
* Whether expand/collapse the node recursively.
* @return {?}
*/
function () { return this._recursive; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._recursive = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_6__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
/**
* @param {?} event
* @return {?}
*/
CdkTreeNodeToggle.prototype._toggle = /**
* @param {?} event
* @return {?}
*/
function (event) {
this.recursive
? this._tree.treeControl.toggleDescendants(this._treeNode.data)
: this._tree.treeControl.toggle(this._treeNode.data);
event.stopPropagation();
};
CdkTreeNodeToggle.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Directive"], args: [{
selector: '[cdkTreeNodeToggle]',
host: {
'(click)': '_toggle($event)',
}
},] },
];
/** @nocollapse */
CdkTreeNodeToggle.ctorParameters = function () { return [
{ type: CdkTree, },
{ type: CdkTreeNode, },
]; };
CdkTreeNodeToggle.propDecorators = {
"recursive": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"], args: ['cdkTreeNodeToggleRecursive',] },],
};
return CdkTreeNodeToggle;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ EXPORTED_DECLARATIONS = [
CdkNestedTreeNode,
CdkTreeNodeDef,
CdkTreeNodePadding,
CdkTreeNodeToggle,
CdkTree,
CdkTreeNode,
CdkTreeNodeOutlet,
];
var CdkTreeModule = /** @class */ (function () {
function CdkTreeModule() {
}
CdkTreeModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["NgModule"], args: [{
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_8__["CommonModule"]],
exports: EXPORTED_DECLARATIONS,
declarations: EXPORTED_DECLARATIONS,
providers: [_angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_7__["FocusMonitor"], CdkTreeNodeDef]
},] },
];
return CdkTreeModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=tree.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/common/fesm5/common.js":
/*!******************************************************!*\
!*** ./node_modules/@angular/common/fesm5/common.js ***!
\******************************************************/
/*! exports provided: ɵangular_packages_common_common_e, ɵangular_packages_common_common_d, ɵangular_packages_common_common_a, ɵangular_packages_common_common_b, ɵangular_packages_common_common_g, ɵangular_packages_common_common_f, ɵregisterLocaleData, formatDate, formatCurrency, formatNumber, formatPercent, NgLocaleLocalization, NgLocalization, registerLocaleData, Plural, NumberFormatStyle, FormStyle, TranslationWidth, FormatWidth, NumberSymbol, WeekDay, getNumberOfCurrencyDigits, getCurrencySymbol, getLocaleDayPeriods, getLocaleDayNames, getLocaleMonthNames, getLocaleId, getLocaleEraNames, getLocaleWeekEndRange, getLocaleFirstDayOfWeek, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocalePluralCase, getLocaleTimeFormat, getLocaleNumberSymbol, getLocaleNumberFormat, getLocaleCurrencyName, getLocaleCurrencySymbol, ɵparseCookieValue, CommonModule, DeprecatedI18NPipesModule, NgClass, NgForOf, NgForOfContext, NgIf, NgIfContext, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NgComponentOutlet, DOCUMENT, AsyncPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, JsonPipe, LowerCasePipe, CurrencyPipe, DecimalPipe, PercentPipe, SlicePipe, UpperCasePipe, TitleCasePipe, DeprecatedDatePipe, DeprecatedCurrencyPipe, DeprecatedDecimalPipe, DeprecatedPercentPipe, ɵPLATFORM_BROWSER_ID, ɵPLATFORM_SERVER_ID, ɵPLATFORM_WORKER_APP_ID, ɵPLATFORM_WORKER_UI_ID, isPlatformBrowser, isPlatformServer, isPlatformWorkerApp, isPlatformWorkerUi, VERSION, PlatformLocation, LOCATION_INITIALIZED, LocationStrategy, APP_BASE_HREF, HashLocationStrategy, PathLocationStrategy, Location */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_e", function() { return COMMON_DIRECTIVES; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_d", function() { return findLocaleData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_a", function() { return DEPRECATED_PLURAL_FN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_b", function() { return getPluralCase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_g", function() { return COMMON_DEPRECATED_I18N_PIPES; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_f", function() { return COMMON_PIPES; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵregisterLocaleData", function() { return registerLocaleData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatDate", function() { return formatDate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatCurrency", function() { return formatCurrency; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatNumber", function() { return formatNumber; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatPercent", function() { return formatPercent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgLocaleLocalization", function() { return NgLocaleLocalization; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgLocalization", function() { return NgLocalization; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerLocaleData", function() { return registerLocaleData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Plural", function() { return Plural; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberFormatStyle", function() { return NumberFormatStyle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormStyle", function() { return FormStyle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TranslationWidth", function() { return TranslationWidth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormatWidth", function() { return FormatWidth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberSymbol", function() { return NumberSymbol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WeekDay", function() { return WeekDay; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNumberOfCurrencyDigits", function() { return getNumberOfCurrencyDigits; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrencySymbol", function() { return getCurrencySymbol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDayPeriods", function() { return getLocaleDayPeriods; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDayNames", function() { return getLocaleDayNames; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleMonthNames", function() { return getLocaleMonthNames; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleId", function() { return getLocaleId; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleEraNames", function() { return getLocaleEraNames; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleWeekEndRange", function() { return getLocaleWeekEndRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleFirstDayOfWeek", function() { return getLocaleFirstDayOfWeek; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDateFormat", function() { return getLocaleDateFormat; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDateTimeFormat", function() { return getLocaleDateTimeFormat; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleExtraDayPeriodRules", function() { return getLocaleExtraDayPeriodRules; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleExtraDayPeriods", function() { return getLocaleExtraDayPeriods; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalePluralCase", function() { return getLocalePluralCase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleTimeFormat", function() { return getLocaleTimeFormat; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleNumberSymbol", function() { return getLocaleNumberSymbol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleNumberFormat", function() { return getLocaleNumberFormat; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleCurrencyName", function() { return getLocaleCurrencyName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleCurrencySymbol", function() { return getLocaleCurrencySymbol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵparseCookieValue", function() { return parseCookieValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommonModule", function() { return CommonModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeprecatedI18NPipesModule", function() { return DeprecatedI18NPipesModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgClass", function() { return NgClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgForOf", function() { return NgForOf; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgForOfContext", function() { return NgForOfContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgIf", function() { return NgIf; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgIfContext", function() { return NgIfContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgPlural", function() { return NgPlural; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgPluralCase", function() { return NgPluralCase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgStyle", function() { return NgStyle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgSwitch", function() { return NgSwitch; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgSwitchCase", function() { return NgSwitchCase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgSwitchDefault", function() { return NgSwitchDefault; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgTemplateOutlet", function() { return NgTemplateOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgComponentOutlet", function() { return NgComponentOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOCUMENT", function() { return DOCUMENT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncPipe", function() { return AsyncPipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DatePipe", function() { return DatePipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I18nPluralPipe", function() { return I18nPluralPipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I18nSelectPipe", function() { return I18nSelectPipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonPipe", function() { return JsonPipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LowerCasePipe", function() { return LowerCasePipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CurrencyPipe", function() { return CurrencyPipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DecimalPipe", function() { return DecimalPipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PercentPipe", function() { return PercentPipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SlicePipe", function() { return SlicePipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UpperCasePipe", function() { return UpperCasePipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TitleCasePipe", function() { return TitleCasePipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeprecatedDatePipe", function() { return DeprecatedDatePipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeprecatedCurrencyPipe", function() { return DeprecatedCurrencyPipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeprecatedDecimalPipe", function() { return DeprecatedDecimalPipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeprecatedPercentPipe", function() { return DeprecatedPercentPipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPLATFORM_BROWSER_ID", function() { return PLATFORM_BROWSER_ID; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPLATFORM_SERVER_ID", function() { return PLATFORM_SERVER_ID; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPLATFORM_WORKER_APP_ID", function() { return PLATFORM_WORKER_APP_ID; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPLATFORM_WORKER_UI_ID", function() { return PLATFORM_WORKER_UI_ID; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlatformBrowser", function() { return isPlatformBrowser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlatformServer", function() { return isPlatformServer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlatformWorkerApp", function() { return isPlatformWorkerApp; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlatformWorkerUi", function() { return isPlatformWorkerUi; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlatformLocation", function() { return PlatformLocation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOCATION_INITIALIZED", function() { return LOCATION_INITIALIZED; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocationStrategy", function() { return LocationStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APP_BASE_HREF", function() { return APP_BASE_HREF; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HashLocationStrategy", function() { return HashLocationStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PathLocationStrategy", function() { return PathLocationStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/**
* @license Angular v6.0.9
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* This class should not be used directly by an application developer. Instead, use
* {@link Location}.
*
* `PlatformLocation` encapsulates all calls to DOM apis, which allows the Router to be platform
* agnostic.
* This means that we can have different implementation of `PlatformLocation` for the different
* platforms that angular supports. For example, `@angular/platform-browser` provides an
* implementation specific to the browser environment, while `@angular/platform-webworker` provides
* one suitable for use with web workers.
*
* The `PlatformLocation` class is used directly by all implementations of {@link LocationStrategy}
* when they need to interact with the DOM apis like pushState, popState, etc...
*
* {@link LocationStrategy} in turn is used by the {@link Location} service which is used directly
* by the {@link Router} in order to navigate between routes. Since all interactions between {@link
* Router} /
* {@link Location} / {@link LocationStrategy} and DOM apis flow through the `PlatformLocation`
* class they are all platform independent.
*
*
*/
var PlatformLocation = /** @class */ (function () {
function PlatformLocation() {
}
return PlatformLocation;
}());
/**
* @description Indicates when a location is initialized.
* @experimental
*/
var LOCATION_INITIALIZED = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('Location Initialized');
/**
* @license
* Copyright Google Inc. 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
*/
/**
* `LocationStrategy` is responsible for representing and reading route state
* from the browser's URL. Angular provides two strategies:
* {@link HashLocationStrategy} and {@link PathLocationStrategy}.
*
* This is used under the hood of the {@link Location} service.
*
* Applications should use the {@link Router} or {@link Location} services to
* interact with application route state.
*
* For instance, {@link HashLocationStrategy} produces URLs like
* `http://example.com#/foo`, and {@link PathLocationStrategy} produces
* `http://example.com/foo` as an equivalent URL.
*
* See these two classes for more.
*
*
*/
var LocationStrategy = /** @class */ (function () {
function LocationStrategy() {
}
return LocationStrategy;
}());
/**
* The `APP_BASE_HREF` token represents the base href to be used with the
* {@link PathLocationStrategy}.
*
* If you're using {@link PathLocationStrategy}, you must provide a provider to a string
* representing the URL prefix that should be preserved when generating and recognizing
* URLs.
*
* ### Example
*
* ```typescript
* import {Component, NgModule} from '@angular/core';
* import {APP_BASE_HREF} from '@angular/common';
*
* @NgModule({
* providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]
* })
* class AppModule {}
* ```
*
*
*/
var APP_BASE_HREF = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('appBaseHref');
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
*
* A service that applications can use to interact with a browser's URL.
*
* Depending on which {@link LocationStrategy} is used, `Location` will either persist
* to the URL's path or the URL's hash segment.
*
* Note: it's better to use {@link Router#navigate} service to trigger route changes. Use
* `Location` only if you need to interact with or create normalized URLs outside of
* routing.
*
* `Location` is responsible for normalizing the URL against the application's base href.
* A normalized URL is absolute from the URL host, includes the application's base href, and has no
* trailing slash:
* - `/my/app/user/123` is normalized
* - `my/app/user/123` **is not** normalized
* - `/my/app/user/123/` **is not** normalized
*
* ### Example
* {@example common/location/ts/path_location_component.ts region='LocationComponent'}
*
*/
var Location = /** @class */ (function () {
function Location(platformStrategy) {
var _this = this;
/** @internal */
this._subject = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this._platformStrategy = platformStrategy;
var browserBaseHref = this._platformStrategy.getBaseHref();
this._baseHref = Location.stripTrailingSlash(_stripIndexHtml(browserBaseHref));
this._platformStrategy.onPopState(function (ev) {
_this._subject.emit({
'url': _this.path(true),
'pop': true,
'state': ev.state,
'type': ev.type,
});
});
}
/**
* Returns the normalized URL path.
*/
// TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is
// removed.
Location.prototype.path = function (includeHash) {
if (includeHash === void 0) { includeHash = false; }
return this.normalize(this._platformStrategy.path(includeHash));
};
/**
* Normalizes the given path and compares to the current normalized path.
*/
Location.prototype.isCurrentPathEqualTo = function (path, query) {
if (query === void 0) { query = ''; }
return this.path() == this.normalize(path + Location.normalizeQueryParams(query));
};
/**
* Given a string representing a URL, returns the normalized URL path without leading or
* trailing slashes.
*/
Location.prototype.normalize = function (url) {
return Location.stripTrailingSlash(_stripBaseHref(this._baseHref, _stripIndexHtml(url)));
};
/**
* Given a string representing a URL, returns the platform-specific external URL path.
* If the given URL doesn't begin with a leading slash (`'/'`), this method adds one
* before normalizing. This method will also add a hash if `HashLocationStrategy` is
* used, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
*/
Location.prototype.prepareExternalUrl = function (url) {
if (url && url[0] !== '/') {
url = '/' + url;
}
return this._platformStrategy.prepareExternalUrl(url);
};
// TODO: rename this method to pushState
/**
* Changes the browsers URL to the normalized version of the given URL, and pushes a
* new item onto the platform's history.
*/
Location.prototype.go = function (path, query, state) {
if (query === void 0) { query = ''; }
if (state === void 0) { state = null; }
this._platformStrategy.pushState(state, '', path, query);
};
/**
* Changes the browsers URL to the normalized version of the given URL, and replaces
* the top item on the platform's history stack.
*/
Location.prototype.replaceState = function (path, query, state) {
if (query === void 0) { query = ''; }
if (state === void 0) { state = null; }
this._platformStrategy.replaceState(state, '', path, query);
};
/**
* Navigates forward in the platform's history.
*/
Location.prototype.forward = function () { this._platformStrategy.forward(); };
/**
* Navigates back in the platform's history.
*/
Location.prototype.back = function () { this._platformStrategy.back(); };
/**
* Subscribe to the platform's `popState` events.
*/
Location.prototype.subscribe = function (onNext, onThrow, onReturn) {
return this._subject.subscribe({ next: onNext, error: onThrow, complete: onReturn });
};
/**
* Given a string of url parameters, prepend with '?' if needed, otherwise return parameters as
* is.
*/
Location.normalizeQueryParams = function (params) {
return params && params[0] !== '?' ? '?' + params : params;
};
/**
* Given 2 parts of a url, join them with a slash if needed.
*/
Location.joinWithSlash = function (start, end) {
if (start.length == 0) {
return end;
}
if (end.length == 0) {
return start;
}
var slashes = 0;
if (start.endsWith('/')) {
slashes++;
}
if (end.startsWith('/')) {
slashes++;
}
if (slashes == 2) {
return start + end.substring(1);
}
if (slashes == 1) {
return start + end;
}
return start + '/' + end;
};
/**
* If url has a trailing slash, remove it, otherwise return url as is. This
* method looks for the first occurrence of either #, ?, or the end of the
* line as `/` characters after any of these should not be replaced.
*/
Location.stripTrailingSlash = function (url) {
var match = url.match(/#|\?|$/);
var pathEndIdx = match && match.index || url.length;
var droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0);
return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx);
};
Location.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] }
];
/** @nocollapse */
Location.ctorParameters = function () { return [
{ type: LocationStrategy }
]; };
return Location;
}());
function _stripBaseHref(baseHref, url) {
return baseHref && url.startsWith(baseHref) ? url.substring(baseHref.length) : url;
}
function _stripIndexHtml(url) {
return url.replace(/\/index.html$/, '');
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
* A {@link LocationStrategy} used to configure the {@link Location} service to
* represent its state in the
* [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)
* of the browser's URL.
*
* For instance, if you call `location.go('/foo')`, the browser's URL will become
* `example.com#/foo`.
*
* ### Example
*
* {@example common/location/ts/hash_location_component.ts region='LocationComponent'}
*
*
*/
var HashLocationStrategy = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(HashLocationStrategy, _super);
function HashLocationStrategy(_platformLocation, _baseHref) {
var _this = _super.call(this) || this;
_this._platformLocation = _platformLocation;
_this._baseHref = '';
if (_baseHref != null) {
_this._baseHref = _baseHref;
}
return _this;
}
HashLocationStrategy.prototype.onPopState = function (fn) {
this._platformLocation.onPopState(fn);
this._platformLocation.onHashChange(fn);
};
HashLocationStrategy.prototype.getBaseHref = function () { return this._baseHref; };
HashLocationStrategy.prototype.path = function (includeHash) {
if (includeHash === void 0) { includeHash = false; }
// the hash value is always prefixed with a `#`
// and if it is empty then it will stay empty
var path = this._platformLocation.hash;
if (path == null)
path = '#';
return path.length > 0 ? path.substring(1) : path;
};
HashLocationStrategy.prototype.prepareExternalUrl = function (internal) {
var url = Location.joinWithSlash(this._baseHref, internal);
return url.length > 0 ? ('#' + url) : url;
};
HashLocationStrategy.prototype.pushState = function (state, title, path, queryParams) {
var url = this.prepareExternalUrl(path + Location.normalizeQueryParams(queryParams));
if (url.length == 0) {
url = this._platformLocation.pathname;
}
this._platformLocation.pushState(state, title, url);
};
HashLocationStrategy.prototype.replaceState = function (state, title, path, queryParams) {
var url = this.prepareExternalUrl(path + Location.normalizeQueryParams(queryParams));
if (url.length == 0) {
url = this._platformLocation.pathname;
}
this._platformLocation.replaceState(state, title, url);
};
HashLocationStrategy.prototype.forward = function () { this._platformLocation.forward(); };
HashLocationStrategy.prototype.back = function () { this._platformLocation.back(); };
HashLocationStrategy.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] }
];
/** @nocollapse */
HashLocationStrategy.ctorParameters = function () { return [
{ type: PlatformLocation },
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [APP_BASE_HREF,] }] }
]; };
return HashLocationStrategy;
}(LocationStrategy));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
* A {@link LocationStrategy} used to configure the {@link Location} service to
* represent its state in the
* [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the
* browser's URL.
*
* If you're using `PathLocationStrategy`, you must provide a {@link APP_BASE_HREF}
* or add a base element to the document. This URL prefix that will be preserved
* when generating and recognizing URLs.
*
* For instance, if you provide an `APP_BASE_HREF` of `'/my/app'` and call
* `location.go('/foo')`, the browser's URL will become
* `example.com/my/app/foo`.
*
* Similarly, if you add `<base href='/my/app'/>` to the document and call
* `location.go('/foo')`, the browser's URL will become
* `example.com/my/app/foo`.
*
* ### Example
*
* {@example common/location/ts/path_location_component.ts region='LocationComponent'}
*
*
*/
var PathLocationStrategy = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(PathLocationStrategy, _super);
function PathLocationStrategy(_platformLocation, href) {
var _this = _super.call(this) || this;
_this._platformLocation = _platformLocation;
if (href == null) {
href = _this._platformLocation.getBaseHrefFromDOM();
}
if (href == null) {
throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");
}
_this._baseHref = href;
return _this;
}
PathLocationStrategy.prototype.onPopState = function (fn) {
this._platformLocation.onPopState(fn);
this._platformLocation.onHashChange(fn);
};
PathLocationStrategy.prototype.getBaseHref = function () { return this._baseHref; };
PathLocationStrategy.prototype.prepareExternalUrl = function (internal) {
return Location.joinWithSlash(this._baseHref, internal);
};
PathLocationStrategy.prototype.path = function (includeHash) {
if (includeHash === void 0) { includeHash = false; }
var pathname = this._platformLocation.pathname +
Location.normalizeQueryParams(this._platformLocation.search);
var hash = this._platformLocation.hash;
return hash && includeHash ? "" + pathname + hash : pathname;
};
PathLocationStrategy.prototype.pushState = function (state, title, url, queryParams) {
var externalUrl = this.prepareExternalUrl(url + Location.normalizeQueryParams(queryParams));
this._platformLocation.pushState(state, title, externalUrl);
};
PathLocationStrategy.prototype.replaceState = function (state, title, url, queryParams) {
var externalUrl = this.prepareExternalUrl(url + Location.normalizeQueryParams(queryParams));
this._platformLocation.replaceState(state, title, externalUrl);
};
PathLocationStrategy.prototype.forward = function () { this._platformLocation.forward(); };
PathLocationStrategy.prototype.back = function () { this._platformLocation.back(); };
PathLocationStrategy.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] }
];
/** @nocollapse */
PathLocationStrategy.ctorParameters = function () { return [
{ type: PlatformLocation },
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [APP_BASE_HREF,] }] }
]; };
return PathLocationStrategy;
}(LocationStrategy));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-tasks/cldr/extract.js
var u = undefined;
function plural(n) {
var i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length;
if (i === 1 && v === 0)
return 1;
return 5;
}
var localeEn = [
'en', [['a', 'p'], ['AM', 'PM'], u], [['AM', 'PM'], u, u],
[
['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
],
u,
[
['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
[
'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',
'October', 'November', 'December'
]
],
u, [['B', 'A'], ['BC', 'AD'], ['Before Christ', 'Anno Domini']], 0, [6, 0],
['M/d/yy', 'MMM d, y', 'MMMM d, y', 'EEEE, MMMM d, y'],
['h:mm a', 'h:mm:ss a', 'h:mm:ss a z', 'h:mm:ss a zzzz'], ['{1}, {0}', u, '{1} \'at\' {0}', u],
['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],
['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'], '$', 'US Dollar', {}, plural
];
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @experimental i18n support is experimental.
*/
var LOCALE_DATA = {};
/**
* Register global data to be used internally by Angular. See the
* ["I18n guide"](guide/i18n#i18n-pipes) to know how to import additional locale data.
*
* @experimental i18n support is experimental.
*/
// The signature registerLocaleData(data: any, extraData?: any) is deprecated since v5.1
function registerLocaleData(data, localeId, extraData) {
if (typeof localeId !== 'string') {
extraData = localeId;
localeId = data[0 /* LocaleId */];
}
localeId = localeId.toLowerCase().replace(/_/g, '-');
LOCALE_DATA[localeId] = data;
if (extraData) {
LOCALE_DATA[localeId][19 /* ExtraData */] = extraData;
}
}
/**
* @license
* Copyright Google Inc. 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
*/
/** @internal */
var CURRENCIES_EN = {
'ADP': [undefined, undefined, 0],
'AFN': [undefined, undefined, 0],
'ALL': [undefined, undefined, 0],
'AMD': [undefined, undefined, 0],
'AOA': [undefined, 'Kz'],
'ARS': [undefined, '$'],
'AUD': ['A$', '$'],
'BAM': [undefined, 'KM'],
'BBD': [undefined, '$'],
'BDT': [undefined, '৳'],
'BHD': [undefined, undefined, 3],
'BIF': [undefined, undefined, 0],
'BMD': [undefined, '$'],
'BND': [undefined, '$'],
'BOB': [undefined, 'Bs'],
'BRL': ['R$'],
'BSD': [undefined, '$'],
'BWP': [undefined, 'P'],
'BYN': [undefined, 'р.', 2],
'BYR': [undefined, undefined, 0],
'BZD': [undefined, '$'],
'CAD': ['CA$', '$', 2],
'CHF': [undefined, undefined, 2],
'CLF': [undefined, undefined, 4],
'CLP': [undefined, '$', 0],
'CNY': ['CN¥', '¥'],
'COP': [undefined, '$', 0],
'CRC': [undefined, '₡', 2],
'CUC': [undefined, '$'],
'CUP': [undefined, '$'],
'CZK': [undefined, 'Kč', 2],
'DJF': [undefined, undefined, 0],
'DKK': [undefined, 'kr', 2],
'DOP': [undefined, '$'],
'EGP': [undefined, 'E£'],
'ESP': [undefined, '₧', 0],
'EUR': ['€'],
'FJD': [undefined, '$'],
'FKP': [undefined, '£'],
'GBP': ['£'],
'GEL': [undefined, '₾'],
'GIP': [undefined, '£'],
'GNF': [undefined, 'FG', 0],
'GTQ': [undefined, 'Q'],
'GYD': [undefined, '$', 0],
'HKD': ['HK$', '$'],
'HNL': [undefined, 'L'],
'HRK': [undefined, 'kn'],
'HUF': [undefined, 'Ft', 2],
'IDR': [undefined, 'Rp', 0],
'ILS': ['₪'],
'INR': ['₹'],
'IQD': [undefined, undefined, 0],
'IRR': [undefined, undefined, 0],
'ISK': [undefined, 'kr', 0],
'ITL': [undefined, undefined, 0],
'JMD': [undefined, '$'],
'JOD': [undefined, undefined, 3],
'JPY': ['¥', undefined, 0],
'KHR': [undefined, '៛'],
'KMF': [undefined, 'CF', 0],
'KPW': [undefined, '₩', 0],
'KRW': ['₩', undefined, 0],
'KWD': [undefined, undefined, 3],
'KYD': [undefined, '$'],
'KZT': [undefined, '₸'],
'LAK': [undefined, '₭', 0],
'LBP': [undefined, 'L£', 0],
'LKR': [undefined, 'Rs'],
'LRD': [undefined, '$'],
'LTL': [undefined, 'Lt'],
'LUF': [undefined, undefined, 0],
'LVL': [undefined, 'Ls'],
'LYD': [undefined, undefined, 3],
'MGA': [undefined, 'Ar', 0],
'MGF': [undefined, undefined, 0],
'MMK': [undefined, 'K', 0],
'MNT': [undefined, '₮', 0],
'MRO': [undefined, undefined, 0],
'MUR': [undefined, 'Rs', 0],
'MXN': ['MX$', '$'],
'MYR': [undefined, 'RM'],
'NAD': [undefined, '$'],
'NGN': [undefined, '₦'],
'NIO': [undefined, 'C$'],
'NOK': [undefined, 'kr', 2],
'NPR': [undefined, 'Rs'],
'NZD': ['NZ$', '$'],
'OMR': [undefined, undefined, 3],
'PHP': [undefined, '₱'],
'PKR': [undefined, 'Rs', 0],
'PLN': [undefined, 'zł'],
'PYG': [undefined, '₲', 0],
'RON': [undefined, 'lei'],
'RSD': [undefined, undefined, 0],
'RUB': [undefined, '₽'],
'RUR': [undefined, 'р.'],
'RWF': [undefined, 'RF', 0],
'SBD': [undefined, '$'],
'SEK': [undefined, 'kr', 2],
'SGD': [undefined, '$'],
'SHP': [undefined, '£'],
'SLL': [undefined, undefined, 0],
'SOS': [undefined, undefined, 0],
'SRD': [undefined, '$'],
'SSP': [undefined, '£'],
'STD': [undefined, undefined, 0],
'STN': [undefined, 'Db'],
'SYP': [undefined, '£', 0],
'THB': [undefined, '฿'],
'TMM': [undefined, undefined, 0],
'TND': [undefined, undefined, 3],
'TOP': [undefined, 'T$'],
'TRL': [undefined, undefined, 0],
'TRY': [undefined, '₺'],
'TTD': [undefined, '$'],
'TWD': ['NT$', '$', 2],
'TZS': [undefined, undefined, 0],
'UAH': [undefined, '₴'],
'UGX': [undefined, undefined, 0],
'USD': ['$'],
'UYI': [undefined, undefined, 0],
'UYU': [undefined, '$'],
'UZS': [undefined, undefined, 0],
'VEF': [undefined, 'Bs'],
'VND': ['₫', undefined, 0],
'VUV': [undefined, undefined, 0],
'XAF': ['FCFA', undefined, 0],
'XCD': ['EC$', '$'],
'XOF': ['CFA', undefined, 0],
'XPF': ['CFPF', undefined, 0],
'YER': [undefined, undefined, 0],
'ZAR': [undefined, 'R'],
'ZMK': [undefined, undefined, 0],
'ZMW': [undefined, 'ZK'],
'ZWD': [undefined, undefined, 0]
};
/**
* @license
* Copyright Google Inc. 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
*/
/**
* The different format styles that can be used to represent numbers.
* Used by the function {@link getLocaleNumberFormat}.
*
* @experimental i18n support is experimental.
*/
var NumberFormatStyle;
(function (NumberFormatStyle) {
NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal";
NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent";
NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency";
NumberFormatStyle[NumberFormatStyle["Scientific"] = 3] = "Scientific";
})(NumberFormatStyle || (NumberFormatStyle = {}));
/** @experimental */
var Plural;
(function (Plural) {
Plural[Plural["Zero"] = 0] = "Zero";
Plural[Plural["One"] = 1] = "One";
Plural[Plural["Two"] = 2] = "Two";
Plural[Plural["Few"] = 3] = "Few";
Plural[Plural["Many"] = 4] = "Many";
Plural[Plural["Other"] = 5] = "Other";
})(Plural || (Plural = {}));
/**
* Some languages use two different forms of strings (standalone and format) depending on the
* context.
* Typically the standalone version is the nominative form of the word, and the format version is in
* the genitive.
* See [the CLDR website](http://cldr.unicode.org/translation/date-time) for more information.
*
* @experimental i18n support is experimental.
*/
var FormStyle;
(function (FormStyle) {
FormStyle[FormStyle["Format"] = 0] = "Format";
FormStyle[FormStyle["Standalone"] = 1] = "Standalone";
})(FormStyle || (FormStyle = {}));
/**
* Multiple widths are available for translations: narrow (1 character), abbreviated (3 characters),
* wide (full length), and short (2 characters, only for days).
*
* For example the day `Sunday` will be:
* - Narrow: `S`
* - Short: `Su`
* - Abbreviated: `Sun`
* - Wide: `Sunday`
*
* @experimental i18n support is experimental.
*/
var TranslationWidth;
(function (TranslationWidth) {
TranslationWidth[TranslationWidth["Narrow"] = 0] = "Narrow";
TranslationWidth[TranslationWidth["Abbreviated"] = 1] = "Abbreviated";
TranslationWidth[TranslationWidth["Wide"] = 2] = "Wide";
TranslationWidth[TranslationWidth["Short"] = 3] = "Short";
})(TranslationWidth || (TranslationWidth = {}));
/**
* Multiple widths are available for formats: short (minimal amount of data), medium (small amount
* of data), long (complete amount of data), full (complete amount of data and extra information).
*
* For example the date-time formats for the english locale will be:
* - `'short'`: `'M/d/yy, h:mm a'` (e.g. `6/15/15, 9:03 AM`)
* - `'medium'`: `'MMM d, y, h:mm:ss a'` (e.g. `Jun 15, 2015, 9:03:01 AM`)
* - `'long'`: `'MMMM d, y, h:mm:ss a z'` (e.g. `June 15, 2015 at 9:03:01 AM GMT+1`)
* - `'full'`: `'EEEE, MMMM d, y, h:mm:ss a zzzz'` (e.g. `Monday, June 15, 2015 at
* 9:03:01 AM GMT+01:00`)
*
* @experimental i18n support is experimental.
*/
var FormatWidth;
(function (FormatWidth) {
FormatWidth[FormatWidth["Short"] = 0] = "Short";
FormatWidth[FormatWidth["Medium"] = 1] = "Medium";
FormatWidth[FormatWidth["Long"] = 2] = "Long";
FormatWidth[FormatWidth["Full"] = 3] = "Full";
})(FormatWidth || (FormatWidth = {}));
/**
* Number symbol that can be used to replace placeholders in number patterns.
* The placeholders are based on english values:
*
* | Name | Example for en-US | Meaning |
* |------------------------|-------------------|---------------------------------------------|
* | decimal | 2,345`.`67 | decimal separator |
* | group | 2`,`345.67 | grouping separator, typically for thousands |
* | plusSign | `+`23 | the plus sign used with numbers |
* | minusSign | `-`23 | the minus sign used with numbers |
* | percentSign | 23.4`%` | the percent sign (out of 100) |
* | perMille | 234`‰` | the permille sign (out of 1000) |
* | exponential | 1.2`E`3 | used in computers for 1.2×10³. |
* | superscriptingExponent | 1.2`×`103 | human-readable format of exponential |
* | infinity | `∞` | used in +∞ and -∞. |
* | nan | `NaN` | "not a number". |
* | timeSeparator | 10`:`52 | symbol used between time units |
* | currencyDecimal | $2,345`.`67 | decimal separator, fallback to "decimal" |
* | currencyGroup | $2`,`345.67 | grouping separator, fallback to "group" |
*
* @experimental i18n support is experimental.
*/
var NumberSymbol;
(function (NumberSymbol) {
NumberSymbol[NumberSymbol["Decimal"] = 0] = "Decimal";
NumberSymbol[NumberSymbol["Group"] = 1] = "Group";
NumberSymbol[NumberSymbol["List"] = 2] = "List";
NumberSymbol[NumberSymbol["PercentSign"] = 3] = "PercentSign";
NumberSymbol[NumberSymbol["PlusSign"] = 4] = "PlusSign";
NumberSymbol[NumberSymbol["MinusSign"] = 5] = "MinusSign";
NumberSymbol[NumberSymbol["Exponential"] = 6] = "Exponential";
NumberSymbol[NumberSymbol["SuperscriptingExponent"] = 7] = "SuperscriptingExponent";
NumberSymbol[NumberSymbol["PerMille"] = 8] = "PerMille";
NumberSymbol[NumberSymbol["Infinity"] = 9] = "Infinity";
NumberSymbol[NumberSymbol["NaN"] = 10] = "NaN";
NumberSymbol[NumberSymbol["TimeSeparator"] = 11] = "TimeSeparator";
NumberSymbol[NumberSymbol["CurrencyDecimal"] = 12] = "CurrencyDecimal";
NumberSymbol[NumberSymbol["CurrencyGroup"] = 13] = "CurrencyGroup";
})(NumberSymbol || (NumberSymbol = {}));
/**
* The value for each day of the week, based on the en-US locale
*
* @experimental
*/
var WeekDay;
(function (WeekDay) {
WeekDay[WeekDay["Sunday"] = 0] = "Sunday";
WeekDay[WeekDay["Monday"] = 1] = "Monday";
WeekDay[WeekDay["Tuesday"] = 2] = "Tuesday";
WeekDay[WeekDay["Wednesday"] = 3] = "Wednesday";
WeekDay[WeekDay["Thursday"] = 4] = "Thursday";
WeekDay[WeekDay["Friday"] = 5] = "Friday";
WeekDay[WeekDay["Saturday"] = 6] = "Saturday";
})(WeekDay || (WeekDay = {}));
/**
* The locale id for the chosen locale (e.g `en-GB`).
*
* @experimental i18n support is experimental.
*/
function getLocaleId(locale) {
return findLocaleData(locale)[0 /* LocaleId */];
}
/**
* Periods of the day (e.g. `[AM, PM]` for en-US).
*
* @experimental i18n support is experimental.
*/
function getLocaleDayPeriods(locale, formStyle, width) {
var data = findLocaleData(locale);
var amPmData = [data[1 /* DayPeriodsFormat */], data[2 /* DayPeriodsStandalone */]];
var amPm = getLastDefinedValue(amPmData, formStyle);
return getLastDefinedValue(amPm, width);
}
/**
* Days of the week for the Gregorian calendar (e.g. `[Sunday, Monday, ... Saturday]` for en-US).
*
* @experimental i18n support is experimental.
*/
function getLocaleDayNames(locale, formStyle, width) {
var data = findLocaleData(locale);
var daysData = [data[3 /* DaysFormat */], data[4 /* DaysStandalone */]];
var days = getLastDefinedValue(daysData, formStyle);
return getLastDefinedValue(days, width);
}
/**
* Months of the year for the Gregorian calendar (e.g. `[January, February, ...]` for en-US).
*
* @experimental i18n support is experimental.
*/
function getLocaleMonthNames(locale, formStyle, width) {
var data = findLocaleData(locale);
var monthsData = [data[5 /* MonthsFormat */], data[6 /* MonthsStandalone */]];
var months = getLastDefinedValue(monthsData, formStyle);
return getLastDefinedValue(months, width);
}
/**
* Eras for the Gregorian calendar (e.g. AD/BC).
*
* @experimental i18n support is experimental.
*/
function getLocaleEraNames(locale, width) {
var data = findLocaleData(locale);
var erasData = data[7 /* Eras */];
return getLastDefinedValue(erasData, width);
}
/**
* First day of the week for this locale, based on english days (Sunday = 0, Monday = 1, ...).
* For example in french the value would be 1 because the first day of the week is Monday.
*
* @experimental i18n support is experimental.
*/
function getLocaleFirstDayOfWeek(locale) {
var data = findLocaleData(locale);
return data[8 /* FirstDayOfWeek */];
}
/**
* Range of days in the week that represent the week-end for this locale, based on english days
* (Sunday = 0, Monday = 1, ...).
* For example in english the value would be [6,0] for Saturday to Sunday.
*
* @experimental i18n support is experimental.
*/
function getLocaleWeekEndRange(locale) {
var data = findLocaleData(locale);
return data[9 /* WeekendRange */];
}
/**
* Date format that depends on the locale.
*
* There are four basic date formats:
* - `full` should contain long-weekday (EEEE), year (y), long-month (MMMM), day (d).
*
* For example, English uses `EEEE, MMMM d, y`, corresponding to a date like
* "Tuesday, September 14, 1999".
*
* - `long` should contain year, long-month, day.
*
* For example, `MMMM d, y`, corresponding to a date like "September 14, 1999".
*
* - `medium` should contain year, abbreviated-month (MMM), day.
*
* For example, `MMM d, y`, corresponding to a date like "Sep 14, 1999".
* For languages that do not use abbreviated months, use the numeric month (MM/M). For example,
* `y/MM/dd`, corresponding to a date like "1999/09/14".
*
* - `short` should contain year, numeric-month (MM/M), and day.
*
* For example, `M/d/yy`, corresponding to a date like "9/14/99".
*
* @experimental i18n support is experimental.
*/
function getLocaleDateFormat(locale, width) {
var data = findLocaleData(locale);
return getLastDefinedValue(data[10 /* DateFormat */], width);
}
/**
* Time format that depends on the locale.
*
* The standard formats include four basic time formats:
* - `full` should contain hour (h/H), minute (mm), second (ss), and zone (zzzz).
* - `long` should contain hour, minute, second, and zone (z)
* - `medium` should contain hour, minute, second.
* - `short` should contain hour, minute.
*
* Note: The patterns depend on whether the main country using your language uses 12-hour time or
* not:
* - For 12-hour time, use a pattern like `hh:mm a` using h to mean a 12-hour clock cycle running
* 1 through 12 (midnight plus 1 minute is 12:01), or using K to mean a 12-hour clock cycle
* running 0 through 11 (midnight plus 1 minute is 0:01).
* - For 24-hour time, use a pattern like `HH:mm` using H to mean a 24-hour clock cycle running 0
* through 23 (midnight plus 1 minute is 0:01), or using k to mean a 24-hour clock cycle running
* 1 through 24 (midnight plus 1 minute is 24:01).
*
* @experimental i18n support is experimental.
*/
function getLocaleTimeFormat(locale, width) {
var data = findLocaleData(locale);
return getLastDefinedValue(data[11 /* TimeFormat */], width);
}
/**
* Date-time format that depends on the locale.
*
* The date-time pattern shows how to combine separate patterns for date (represented by {1})
* and time (represented by {0}) into a single pattern. It usually doesn't need to be changed.
* What you want to pay attention to are:
* - possibly removing a space for languages that don't use it, such as many East Asian languages
* - possibly adding a comma, other punctuation, or a combining word
*
* For example:
* - English uses `{1} 'at' {0}` or `{1}, {0}` (depending on date style), while Japanese uses
* `{1}{0}`.
* - An English formatted date-time using the combining pattern `{1}, {0}` could be
* `Dec 10, 2010, 3:59:49 PM`. Notice the comma and space between the date portion and the time
* portion.
*
* There are four formats (`full`, `long`, `medium`, `short`); the determination of which to use
* is normally based on the date style. For example, if the date has a full month and weekday
* name, the full combining pattern will be used to combine that with a time. If the date has
* numeric month, the short version of the combining pattern will be used to combine that with a
* time. English uses `{1} 'at' {0}` for full and long styles, and `{1}, {0}` for medium and short
* styles.
*
* @experimental i18n support is experimental.
*/
function getLocaleDateTimeFormat(locale, width) {
var data = findLocaleData(locale);
var dateTimeFormatData = data[12 /* DateTimeFormat */];
return getLastDefinedValue(dateTimeFormatData, width);
}
/**
* Number symbol that can be used to replace placeholders in number formats.
* See {@link NumberSymbol} for more information.
*
* @experimental i18n support is experimental.
*/
function getLocaleNumberSymbol(locale, symbol) {
var data = findLocaleData(locale);
var res = data[13 /* NumberSymbols */][symbol];
if (typeof res === 'undefined') {
if (symbol === NumberSymbol.CurrencyDecimal) {
return data[13 /* NumberSymbols */][NumberSymbol.Decimal];
}
else if (symbol === NumberSymbol.CurrencyGroup) {
return data[13 /* NumberSymbols */][NumberSymbol.Group];
}
}
return res;
}
/**
* Number format that depends on the locale.
*
* Numbers are formatted using patterns, like `#,###.00`. For example, the pattern `#,###.00`
* when used to format the number 12345.678 could result in "12'345,67". That would happen if the
* grouping separator for your language is an apostrophe, and the decimal separator is a comma.
*
* <b>Important:</b> The characters `.` `,` `0` `#` (and others below) are special placeholders;
* they stand for the decimal separator, and so on, and are NOT real characters.
* You must NOT "translate" the placeholders; for example, don't change `.` to `,` even though in
* your language the decimal point is written with a comma. The symbols should be replaced by the
* local equivalents, using the Number Symbols for your language.
*
* Here are the special characters used in number patterns:
*
* | Symbol | Meaning |
* |--------|---------|
* | . | Replaced automatically by the character used for the decimal point. |
* | , | Replaced by the "grouping" (thousands) separator. |
* | 0 | Replaced by a digit (or zero if there aren't enough digits). |
* | # | Replaced by a digit (or nothing if there aren't enough). |
* | ¤ | This will be replaced by a currency symbol, such as $ or USD. |
* | % | This marks a percent format. The % symbol may change position, but must be retained. |
* | E | This marks a scientific format. The E symbol may change position, but must be retained. |
* | ' | Special characters used as literal characters are quoted with ASCII single quotes. |
*
* You can find more information
* [on the CLDR website](http://cldr.unicode.org/translation/number-patterns)
*
* @experimental i18n support is experimental.
*/
function getLocaleNumberFormat(locale, type) {
var data = findLocaleData(locale);
return data[14 /* NumberFormats */][type];
}
/**
* The symbol used to represent the currency for the main country using this locale (e.g. $ for
* the locale en-US).
* The symbol will be `null` if the main country cannot be determined.
*
* @experimental i18n support is experimental.
*/
function getLocaleCurrencySymbol(locale) {
var data = findLocaleData(locale);
return data[15 /* CurrencySymbol */] || null;
}
/**
* The name of the currency for the main country using this locale (e.g. USD for the locale
* en-US).
* The name will be `null` if the main country cannot be determined.
*
* @experimental i18n support is experimental.
*/
function getLocaleCurrencyName(locale) {
var data = findLocaleData(locale);
return data[16 /* CurrencyName */] || null;
}
/**
* Returns the currency values for the locale
*/
function getLocaleCurrencies(locale) {
var data = findLocaleData(locale);
return data[17 /* Currencies */];
}
/**
* The locale plural function used by ICU expressions to determine the plural case to use.
* See {@link NgPlural} for more information.
*
* @experimental i18n support is experimental.
*/
function getLocalePluralCase(locale) {
var data = findLocaleData(locale);
return data[18 /* PluralCase */];
}
function checkFullData(data) {
if (!data[19 /* ExtraData */]) {
throw new Error("Missing extra locale data for the locale \"" + data[0 /* LocaleId */] + "\". Use \"registerLocaleData\" to load new data. See the \"I18n guide\" on angular.io to know more.");
}
}
/**
* Rules used to determine which day period to use (See `dayPeriods` below).
* The rules can either be an array or a single value. If it's an array, consider it as "from"
* and "to". If it's a single value then it means that the period is only valid at this exact
* value.
* There is always the same number of rules as the number of day periods, which means that the
* first rule is applied to the first day period and so on.
* You should fallback to AM/PM when there are no rules available.
*
* Note: this is only available if you load the full locale data.
* See the ["I18n guide"](guide/i18n#i18n-pipes) to know how to import additional locale
* data.
*
* @experimental i18n support is experimental.
*/
function getLocaleExtraDayPeriodRules(locale) {
var data = findLocaleData(locale);
checkFullData(data);
var rules = data[19 /* ExtraData */][2 /* ExtraDayPeriodsRules */] || [];
return rules.map(function (rule) {
if (typeof rule === 'string') {
return extractTime(rule);
}
return [extractTime(rule[0]), extractTime(rule[1])];
});
}
/**
* Day Periods indicate roughly how the day is broken up in different languages (e.g. morning,
* noon, afternoon, midnight, ...).
* You should use the function {@link getLocaleExtraDayPeriodRules} to determine which period to
* use.
* You should fallback to AM/PM when there are no day periods available.
*
* Note: this is only available if you load the full locale data.
* See the ["I18n guide"](guide/i18n#i18n-pipes) to know how to import additional locale
* data.
*
* @experimental i18n support is experimental.
*/
function getLocaleExtraDayPeriods(locale, formStyle, width) {
var data = findLocaleData(locale);
checkFullData(data);
var dayPeriodsData = [
data[19 /* ExtraData */][0 /* ExtraDayPeriodFormats */],
data[19 /* ExtraData */][1 /* ExtraDayPeriodStandalone */]
];
var dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];
return getLastDefinedValue(dayPeriods, width) || [];
}
/**
* Returns the first value that is defined in an array, going backwards.
*
* To avoid repeating the same data (e.g. when "format" and "standalone" are the same) we only
* add the first one to the locale data arrays, the other ones are only defined when different.
* We use this function to retrieve the first defined value.
*
* @experimental i18n support is experimental.
*/
function getLastDefinedValue(data, index) {
for (var i = index; i > -1; i--) {
if (typeof data[i] !== 'undefined') {
return data[i];
}
}
throw new Error('Locale data API: locale data undefined');
}
/**
* Extract the hours and minutes from a string like "15:45"
*/
function extractTime(time) {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__read"])(time.split(':'), 2), h = _a[0], m = _a[1];
return { hours: +h, minutes: +m };
}
/**
* Finds the locale data for a locale id
*
* @experimental i18n support is experimental.
*/
function findLocaleData(locale) {
var normalizedLocale = locale.toLowerCase().replace(/_/g, '-');
var match = LOCALE_DATA[normalizedLocale];
if (match) {
return match;
}
// let's try to find a parent locale
var parentLocale = normalizedLocale.split('-')[0];
match = LOCALE_DATA[parentLocale];
if (match) {
return match;
}
if (parentLocale === 'en') {
return localeEn;
}
throw new Error("Missing locale data for the locale \"" + locale + "\".");
}
/**
* Returns the currency symbol for a given currency code, or the code if no symbol available
* (e.g.: format narrow = $, format wide = US$, code = USD)
* If no locale is provided, it uses the locale "en" by default
*
* @experimental i18n support is experimental.
*/
function getCurrencySymbol(code, format, locale) {
if (locale === void 0) { locale = 'en'; }
var currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
var symbolNarrow = currency[1 /* SymbolNarrow */];
if (format === 'narrow' && typeof symbolNarrow === 'string') {
return symbolNarrow;
}
return currency[0 /* Symbol */] || code;
}
// Most currencies have cents, that's why the default is 2
var DEFAULT_NB_OF_CURRENCY_DIGITS = 2;
/**
* Returns the number of decimal digits for the given currency.
* Its value depends upon the presence of cents in that particular currency.
*
* @experimental i18n support is experimental.
*/
function getNumberOfCurrencyDigits(code) {
var digits;
var currency = CURRENCIES_EN[code];
if (currency) {
digits = currency[2 /* NbOfDigits */];
}
return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;
}
/**
* @license
* Copyright Google Inc. 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 ISO8601_DATE_REGEX = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
// 1 2 3 4 5 6 7 8 9 10 11
var NAMED_FORMATS = {};
var DATE_FORMATS_SPLIT = /((?:[^GyMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;
var ZoneWidth;
(function (ZoneWidth) {
ZoneWidth[ZoneWidth["Short"] = 0] = "Short";
ZoneWidth[ZoneWidth["ShortGMT"] = 1] = "ShortGMT";
ZoneWidth[ZoneWidth["Long"] = 2] = "Long";
ZoneWidth[ZoneWidth["Extended"] = 3] = "Extended";
})(ZoneWidth || (ZoneWidth = {}));
var DateType;
(function (DateType) {
DateType[DateType["FullYear"] = 0] = "FullYear";
DateType[DateType["Month"] = 1] = "Month";
DateType[DateType["Date"] = 2] = "Date";
DateType[DateType["Hours"] = 3] = "Hours";
DateType[DateType["Minutes"] = 4] = "Minutes";
DateType[DateType["Seconds"] = 5] = "Seconds";
DateType[DateType["FractionalSeconds"] = 6] = "FractionalSeconds";
DateType[DateType["Day"] = 7] = "Day";
})(DateType || (DateType = {}));
var TranslationType;
(function (TranslationType) {
TranslationType[TranslationType["DayPeriods"] = 0] = "DayPeriods";
TranslationType[TranslationType["Days"] = 1] = "Days";
TranslationType[TranslationType["Months"] = 2] = "Months";
TranslationType[TranslationType["Eras"] = 3] = "Eras";
})(TranslationType || (TranslationType = {}));
/**
* @ngModule CommonModule
* @description
*
* Formats a date according to locale rules.
*
* Where:
* - `value` is a Date, a number (milliseconds since UTC epoch) or an ISO string
* (https://www.w3.org/TR/NOTE-datetime).
* - `format` indicates which date/time components to include. See {@link DatePipe} for more
* details.
* - `locale` is a `string` defining the locale to use.
* - `timezone` to be used for formatting. It understands UTC/GMT and the continental US time zone
* abbreviations, but for general use, use a time zone offset (e.g. `'+0430'`).
* If not specified, host system settings are used.
*
* See {@link DatePipe} for more details.
*/
function formatDate(value, format, locale, timezone) {
var date = toDate(value);
var namedFormat = getNamedFormat(locale, format);
format = namedFormat || format;
var parts = [];
var match;
while (format) {
match = DATE_FORMATS_SPLIT.exec(format);
if (match) {
parts = parts.concat(match.slice(1));
var part = parts.pop();
if (!part) {
break;
}
format = part;
}
else {
parts.push(format);
break;
}
}
var dateTimezoneOffset = date.getTimezoneOffset();
if (timezone) {
dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
date = convertTimezoneToLocal(date, timezone, true);
}
var text = '';
parts.forEach(function (value) {
var dateFormatter = getDateFormatter(value);
text += dateFormatter ?
dateFormatter(date, locale, dateTimezoneOffset) :
value === '\'\'' ? '\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\'');
});
return text;
}
function getNamedFormat(locale, format) {
var localeId = getLocaleId(locale);
NAMED_FORMATS[localeId] = NAMED_FORMATS[localeId] || {};
if (NAMED_FORMATS[localeId][format]) {
return NAMED_FORMATS[localeId][format];
}
var formatValue = '';
switch (format) {
case 'shortDate':
formatValue = getLocaleDateFormat(locale, FormatWidth.Short);
break;
case 'mediumDate':
formatValue = getLocaleDateFormat(locale, FormatWidth.Medium);
break;
case 'longDate':
formatValue = getLocaleDateFormat(locale, FormatWidth.Long);
break;
case 'fullDate':
formatValue = getLocaleDateFormat(locale, FormatWidth.Full);
break;
case 'shortTime':
formatValue = getLocaleTimeFormat(locale, FormatWidth.Short);
break;
case 'mediumTime':
formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium);
break;
case 'longTime':
formatValue = getLocaleTimeFormat(locale, FormatWidth.Long);
break;
case 'fullTime':
formatValue = getLocaleTimeFormat(locale, FormatWidth.Full);
break;
case 'short':
var shortTime = getNamedFormat(locale, 'shortTime');
var shortDate = getNamedFormat(locale, 'shortDate');
formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);
break;
case 'medium':
var mediumTime = getNamedFormat(locale, 'mediumTime');
var mediumDate = getNamedFormat(locale, 'mediumDate');
formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);
break;
case 'long':
var longTime = getNamedFormat(locale, 'longTime');
var longDate = getNamedFormat(locale, 'longDate');
formatValue =
formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);
break;
case 'full':
var fullTime = getNamedFormat(locale, 'fullTime');
var fullDate = getNamedFormat(locale, 'fullDate');
formatValue =
formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);
break;
}
if (formatValue) {
NAMED_FORMATS[localeId][format] = formatValue;
}
return formatValue;
}
function formatDateTime(str, opt_values) {
if (opt_values) {
str = str.replace(/\{([^}]+)}/g, function (match, key) {
return (opt_values != null && key in opt_values) ? opt_values[key] : match;
});
}
return str;
}
function padNumber(num, digits, minusSign, trim, negWrap) {
if (minusSign === void 0) { minusSign = '-'; }
var neg = '';
if (num < 0 || (negWrap && num <= 0)) {
if (negWrap) {
num = -num + 1;
}
else {
num = -num;
neg = minusSign;
}
}
var strNum = String(num);
while (strNum.length < digits) {
strNum = '0' + strNum;
}
if (trim) {
strNum = strNum.substr(strNum.length - digits);
}
return neg + strNum;
}
function formatFractionalSeconds(milliseconds, digits) {
var strMs = padNumber(milliseconds, 3);
return strMs.substr(0, digits);
}
/**
* Returns a date formatter that transforms a date into its locale digit representation
*/
function dateGetter(name, size, offset, trim, negWrap) {
if (offset === void 0) { offset = 0; }
if (trim === void 0) { trim = false; }
if (negWrap === void 0) { negWrap = false; }
return function (date, locale) {
var part = getDatePart(name, date);
if (offset > 0 || part > -offset) {
part += offset;
}
if (name === DateType.Hours) {
if (part === 0 && offset === -12) {
part = 12;
}
}
else if (name === DateType.FractionalSeconds) {
return formatFractionalSeconds(part, size);
}
var localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
return padNumber(part, size, localeMinus, trim, negWrap);
};
}
function getDatePart(part, date) {
switch (part) {
case DateType.FullYear:
return date.getFullYear();
case DateType.Month:
return date.getMonth();
case DateType.Date:
return date.getDate();
case DateType.Hours:
return date.getHours();
case DateType.Minutes:
return date.getMinutes();
case DateType.Seconds:
return date.getSeconds();
case DateType.FractionalSeconds:
return date.getMilliseconds();
case DateType.Day:
return date.getDay();
default:
throw new Error("Unknown DateType value \"" + part + "\".");
}
}
/**
* Returns a date formatter that transforms a date into its locale string representation
*/
function dateStrGetter(name, width, form, extended) {
if (form === void 0) { form = FormStyle.Format; }
if (extended === void 0) { extended = false; }
return function (date, locale) {
return getDateTranslation(date, locale, name, width, form, extended);
};
}
/**
* Returns the locale translation of a date for a given form, type and width
*/
function getDateTranslation(date, locale, name, width, form, extended) {
switch (name) {
case TranslationType.Months:
return getLocaleMonthNames(locale, form, width)[date.getMonth()];
case TranslationType.Days:
return getLocaleDayNames(locale, form, width)[date.getDay()];
case TranslationType.DayPeriods:
var currentHours_1 = date.getHours();
var currentMinutes_1 = date.getMinutes();
if (extended) {
var rules = getLocaleExtraDayPeriodRules(locale);
var dayPeriods_1 = getLocaleExtraDayPeriods(locale, form, width);
var result_1;
rules.forEach(function (rule, index) {
if (Array.isArray(rule)) {
// morning, afternoon, evening, night
var _a = rule[0], hoursFrom = _a.hours, minutesFrom = _a.minutes;
var _b = rule[1], hoursTo = _b.hours, minutesTo = _b.minutes;
if (currentHours_1 >= hoursFrom && currentMinutes_1 >= minutesFrom &&
(currentHours_1 < hoursTo ||
(currentHours_1 === hoursTo && currentMinutes_1 < minutesTo))) {
result_1 = dayPeriods_1[index];
}
}
else {
var hours = rule.hours, minutes = rule.minutes;
if (hours === currentHours_1 && minutes === currentMinutes_1) {
result_1 = dayPeriods_1[index];
}
}
});
if (result_1) {
return result_1;
}
}
// if no rules for the day periods, we use am/pm by default
return getLocaleDayPeriods(locale, form, width)[currentHours_1 < 12 ? 0 : 1];
case TranslationType.Eras:
return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1];
default:
// This default case is not needed by TypeScript compiler, as the switch is exhaustive.
// However Closure Compiler does not understand that and reports an error in typed mode.
// The `throw new Error` below works around the problem, and the unexpected: never variable
// makes sure tsc still checks this code is unreachable.
var unexpected = name;
throw new Error("unexpected translation type " + unexpected);
}
}
/**
* Returns a date formatter that transforms a date and an offset into a timezone with ISO8601 or
* GMT format depending on the width (eg: short = +0430, short:GMT = GMT+4, long = GMT+04:30,
* extended = +04:30)
*/
function timeZoneGetter(width) {
return function (date, locale, offset) {
var zone = -1 * offset;
var minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
var hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);
switch (width) {
case ZoneWidth.Short:
return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +
padNumber(Math.abs(zone % 60), 2, minusSign);
case ZoneWidth.ShortGMT:
return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);
case ZoneWidth.Long:
return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +
padNumber(Math.abs(zone % 60), 2, minusSign);
case ZoneWidth.Extended:
if (offset === 0) {
return 'Z';
}
else {
return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +
padNumber(Math.abs(zone % 60), 2, minusSign);
}
default:
throw new Error("Unknown zone width \"" + width + "\"");
}
};
}
var JANUARY = 0;
var THURSDAY = 4;
function getFirstThursdayOfYear(year) {
var firstDayOfYear = (new Date(year, JANUARY, 1)).getDay();
return new Date(year, 0, 1 + ((firstDayOfYear <= THURSDAY) ? THURSDAY : THURSDAY + 7) - firstDayOfYear);
}
function getThursdayThisWeek(datetime) {
return new Date(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + (THURSDAY - datetime.getDay()));
}
function weekGetter(size, monthBased) {
if (monthBased === void 0) { monthBased = false; }
return function (date, locale) {
var result;
if (monthBased) {
var nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;
var today = date.getDate();
result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);
}
else {
var firstThurs = getFirstThursdayOfYear(date.getFullYear());
var thisThurs = getThursdayThisWeek(date);
var diff = thisThurs.getTime() - firstThurs.getTime();
result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week
}
return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
};
}
var DATE_FORMATS = {};
// Based on CLDR formats:
// See complete list: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
// See also explanations: http://cldr.unicode.org/translation/date-time
// TODO(ocombe): support all missing cldr formats: Y, U, Q, D, F, e, c, j, J, C, A, v, V, X, x
function getDateFormatter(format) {
if (DATE_FORMATS[format]) {
return DATE_FORMATS[format];
}
var formatter;
switch (format) {
// Era name (AD/BC)
case 'G':
case 'GG':
case 'GGG':
formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Abbreviated);
break;
case 'GGGG':
formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Wide);
break;
case 'GGGGG':
formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Narrow);
break;
// 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199)
case 'y':
formatter = dateGetter(DateType.FullYear, 1, 0, false, true);
break;
// 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
case 'yy':
formatter = dateGetter(DateType.FullYear, 2, 0, true, true);
break;
// 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10)
case 'yyy':
formatter = dateGetter(DateType.FullYear, 3, 0, false, true);
break;
// 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010)
case 'yyyy':
formatter = dateGetter(DateType.FullYear, 4, 0, false, true);
break;
// Month of the year (1-12), numeric
case 'M':
case 'L':
formatter = dateGetter(DateType.Month, 1, 1);
break;
case 'MM':
case 'LL':
formatter = dateGetter(DateType.Month, 2, 1);
break;
// Month of the year (January, ...), string, format
case 'MMM':
formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated);
break;
case 'MMMM':
formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide);
break;
case 'MMMMM':
formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow);
break;
// Month of the year (January, ...), string, standalone
case 'LLL':
formatter =
dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated, FormStyle.Standalone);
break;
case 'LLLL':
formatter =
dateStrGetter(TranslationType.Months, TranslationWidth.Wide, FormStyle.Standalone);
break;
case 'LLLLL':
formatter =
dateStrGetter(TranslationType.Months, TranslationWidth.Narrow, FormStyle.Standalone);
break;
// Week of the year (1, ... 52)
case 'w':
formatter = weekGetter(1);
break;
case 'ww':
formatter = weekGetter(2);
break;
// Week of the month (1, ...)
case 'W':
formatter = weekGetter(1, true);
break;
// Day of the month (1-31)
case 'd':
formatter = dateGetter(DateType.Date, 1);
break;
case 'dd':
formatter = dateGetter(DateType.Date, 2);
break;
// Day of the Week
case 'E':
case 'EE':
case 'EEE':
formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated);
break;
case 'EEEE':
formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide);
break;
case 'EEEEE':
formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow);
break;
case 'EEEEEE':
formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short);
break;
// Generic period of the day (am-pm)
case 'a':
case 'aa':
case 'aaa':
formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated);
break;
case 'aaaa':
formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide);
break;
case 'aaaaa':
formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow);
break;
// Extended period of the day (midnight, at night, ...), standalone
case 'b':
case 'bb':
case 'bbb':
formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Standalone, true);
break;
case 'bbbb':
formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Standalone, true);
break;
case 'bbbbb':
formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Standalone, true);
break;
// Extended period of the day (midnight, night, ...), standalone
case 'B':
case 'BB':
case 'BBB':
formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Format, true);
break;
case 'BBBB':
formatter =
dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Format, true);
break;
case 'BBBBB':
formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Format, true);
break;
// Hour in AM/PM, (1-12)
case 'h':
formatter = dateGetter(DateType.Hours, 1, -12);
break;
case 'hh':
formatter = dateGetter(DateType.Hours, 2, -12);
break;
// Hour of the day (0-23)
case 'H':
formatter = dateGetter(DateType.Hours, 1);
break;
// Hour in day, padded (00-23)
case 'HH':
formatter = dateGetter(DateType.Hours, 2);
break;
// Minute of the hour (0-59)
case 'm':
formatter = dateGetter(DateType.Minutes, 1);
break;
case 'mm':
formatter = dateGetter(DateType.Minutes, 2);
break;
// Second of the minute (0-59)
case 's':
formatter = dateGetter(DateType.Seconds, 1);
break;
case 'ss':
formatter = dateGetter(DateType.Seconds, 2);
break;
// Fractional second
case 'S':
formatter = dateGetter(DateType.FractionalSeconds, 1);
break;
case 'SS':
formatter = dateGetter(DateType.FractionalSeconds, 2);
break;
case 'SSS':
formatter = dateGetter(DateType.FractionalSeconds, 3);
break;
// Timezone ISO8601 short format (-0430)
case 'Z':
case 'ZZ':
case 'ZZZ':
formatter = timeZoneGetter(ZoneWidth.Short);
break;
// Timezone ISO8601 extended format (-04:30)
case 'ZZZZZ':
formatter = timeZoneGetter(ZoneWidth.Extended);
break;
// Timezone GMT short format (GMT+4)
case 'O':
case 'OO':
case 'OOO':
// Should be location, but fallback to format O instead because we don't have the data yet
case 'z':
case 'zz':
case 'zzz':
formatter = timeZoneGetter(ZoneWidth.ShortGMT);
break;
// Timezone GMT long format (GMT+0430)
case 'OOOO':
case 'ZZZZ':
// Should be location, but fallback to format O instead because we don't have the data yet
case 'zzzz':
formatter = timeZoneGetter(ZoneWidth.Long);
break;
default:
return null;
}
DATE_FORMATS[format] = formatter;
return formatter;
}
function timezoneToOffset(timezone, fallback) {
// Support: IE 9-11 only, Edge 13-15+
// IE/Edge do not "understand" colon (`:`) in timezone
timezone = timezone.replace(/:/g, '');
var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
}
function addDateMinutes(date, minutes) {
date = new Date(date.getTime());
date.setMinutes(date.getMinutes() + minutes);
return date;
}
function convertTimezoneToLocal(date, timezone, reverse) {
var reverseValue = reverse ? -1 : 1;
var dateTimezoneOffset = date.getTimezoneOffset();
var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));
}
/**
* Converts a value to date.
*
* Supported input formats:
* - `Date`
* - number: timestamp
* - string: numeric (e.g. "1234"), ISO and date strings in a format supported by
* [Date.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).
* Note: ISO strings without time return a date without timeoffset.
*
* Throws if unable to convert to a date.
*/
function toDate(value) {
if (isDate(value)) {
return value;
}
if (typeof value === 'number' && !isNaN(value)) {
return new Date(value);
}
if (typeof value === 'string') {
value = value.trim();
var parsedNb = parseFloat(value);
// any string that only contains numbers, like "1234" but not like "1234hello"
if (!isNaN(value - parsedNb)) {
return new Date(parsedNb);
}
if (/^(\d{4}-\d{1,2}-\d{1,2})$/.test(value)) {
/* For ISO Strings without time the day, month and year must be extracted from the ISO String
before Date creation to avoid time offset and errors in the new Date.
If we only replace '-' with ',' in the ISO String ("2015,01,01"), and try to create a new
date, some browsers (e.g. IE 9) will throw an invalid Date error.
If we leave the '-' ("2015-01-01") and try to create a new Date("2015-01-01") the timeoffset
is applied.
Note: ISO months are 0 for January, 1 for February, ... */
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__read"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];
return new Date(y, m - 1, d);
}
var match = void 0;
if (match = value.match(ISO8601_DATE_REGEX)) {
return isoStringToDate(match);
}
}
var date = new Date(value);
if (!isDate(date)) {
throw new Error("Unable to convert \"" + value + "\" into a date");
}
return date;
}
/**
* Converts a date in ISO8601 to a Date.
* Used instead of `Date.parse` because of browser discrepancies.
*/
function isoStringToDate(match) {
var date = new Date(0);
var tzHour = 0;
var tzMin = 0;
// match[8] means that the string contains "Z" (UTC) or a timezone like "+01:00" or "+0100"
var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;
var timeSetter = match[8] ? date.setUTCHours : date.setHours;
// if there is a timezone defined like "+01:00" or "+0100"
if (match[9]) {
tzHour = Number(match[9] + match[10]);
tzMin = Number(match[9] + match[11]);
}
dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));
var h = Number(match[4] || 0) - tzHour;
var m = Number(match[5] || 0) - tzMin;
var s = Number(match[6] || 0);
var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);
timeSetter.call(date, h, m, s, ms);
return date;
}
function isDate(value) {
return value instanceof Date && !isNaN(value.valueOf());
}
/**
* @license
* Copyright Google Inc. 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 NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
var MAX_DIGITS = 22;
var DECIMAL_SEP = '.';
var ZERO_CHAR = '0';
var PATTERN_SEP = ';';
var GROUP_SEP = ',';
var DIGIT_CHAR = '#';
var CURRENCY_CHAR = '¤';
var PERCENT_CHAR = '%';
/**
* Transforms a number to a locale string based on a style and a format
*/
function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent) {
if (isPercent === void 0) { isPercent = false; }
var formattedText = '';
var isZero = false;
if (!isFinite(value)) {
formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);
}
else {
var parsedNumber = parseNumber(value);
if (isPercent) {
parsedNumber = toPercent(parsedNumber);
}
var minInt = pattern.minInt;
var minFraction = pattern.minFrac;
var maxFraction = pattern.maxFrac;
if (digitsInfo) {
var parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);
if (parts === null) {
throw new Error(digitsInfo + " is not a valid digit info");
}
var minIntPart = parts[1];
var minFractionPart = parts[3];
var maxFractionPart = parts[5];
if (minIntPart != null) {
minInt = parseIntAutoRadix(minIntPart);
}
if (minFractionPart != null) {
minFraction = parseIntAutoRadix(minFractionPart);
}
if (maxFractionPart != null) {
maxFraction = parseIntAutoRadix(maxFractionPart);
}
else if (minFractionPart != null && minFraction > maxFraction) {
maxFraction = minFraction;
}
}
roundNumber(parsedNumber, minFraction, maxFraction);
var digits = parsedNumber.digits;
var integerLen = parsedNumber.integerLen;
var exponent = parsedNumber.exponent;
var decimals = [];
isZero = digits.every(function (d) { return !d; });
// pad zeros for small numbers
for (; integerLen < minInt; integerLen++) {
digits.unshift(0);
}
// pad zeros for small numbers
for (; integerLen < 0; integerLen++) {
digits.unshift(0);
}
// extract decimals digits
if (integerLen > 0) {
decimals = digits.splice(integerLen, digits.length);
}
else {
decimals = digits;
digits = [0];
}
// format the integer digits with grouping separators
var groups = [];
if (digits.length >= pattern.lgSize) {
groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));
}
while (digits.length > pattern.gSize) {
groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));
}
if (digits.length) {
groups.unshift(digits.join(''));
}
formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));
// append the decimal digits
if (decimals.length) {
formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join('');
}
if (exponent) {
formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + '+' + exponent;
}
}
if (value < 0 && !isZero) {
formattedText = pattern.negPre + formattedText + pattern.negSuf;
}
else {
formattedText = pattern.posPre + formattedText + pattern.posSuf;
}
return formattedText;
}
/**
* @ngModule CommonModule
* @description
*
* Formats a number as currency using locale rules.
*
* Use `currency` to format a number as currency.
*
* Where:
* - `value` is a number.
* - `locale` is a `string` defining the locale to use.
* - `currency` is the string that represents the currency, it can be its symbol or its name.
* - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such
* as `USD` for the US dollar and `EUR` for the euro.
* - `digitInfo` See {@link DecimalPipe} for more details.
*
*
*/
function formatCurrency(value, locale, currency, currencyCode, digitsInfo) {
var format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency);
var pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);
pattern.maxFrac = pattern.minFrac;
var res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo);
return res
.replace(CURRENCY_CHAR, currency)
.replace(CURRENCY_CHAR, '');
}
/**
* @ngModule CommonModule
* @description
*
* Formats a number as a percentage according to locale rules.
*
* Where:
* - `value` is a number.
* - `locale` is a `string` defining the locale to use.
* - `digitInfo` See {@link DecimalPipe} for more details.
*
*
*/
function formatPercent(value, locale, digitsInfo) {
var format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent);
var pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
var res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo, true);
return res.replace(new RegExp(PERCENT_CHAR, 'g'), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));
}
/**
* @ngModule CommonModule
* @description
*
* Formats a number as text. Group sizing and separator and other locale-specific
* configurations are based on the locale.
*
* Where:
* - `value` is a number.
* - `locale` is a `string` defining the locale to use.
* - `digitInfo` See {@link DecimalPipe} for more details.
*
*
*/
function formatNumber(value, locale, digitsInfo) {
var format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal);
var pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo);
}
function parseNumberFormat(format, minusSign) {
if (minusSign === void 0) { minusSign = '-'; }
var p = {
minInt: 1,
minFrac: 0,
maxFrac: 0,
posPre: '',
posSuf: '',
negPre: '',
negSuf: '',
gSize: 0,
lgSize: 0
};
var patternParts = format.split(PATTERN_SEP);
var positive = patternParts[0];
var negative = patternParts[1];
var positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ?
positive.split(DECIMAL_SEP) :
[
positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1),
positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)
], integer = positiveParts[0], fraction = positiveParts[1] || '';
p.posPre = integer.substr(0, integer.indexOf(DIGIT_CHAR));
for (var i = 0; i < fraction.length; i++) {
var ch = fraction.charAt(i);
if (ch === ZERO_CHAR) {
p.minFrac = p.maxFrac = i + 1;
}
else if (ch === DIGIT_CHAR) {
p.maxFrac = i + 1;
}
else {
p.posSuf += ch;
}
}
var groups = integer.split(GROUP_SEP);
p.gSize = groups[1] ? groups[1].length : 0;
p.lgSize = (groups[2] || groups[1]) ? (groups[2] || groups[1]).length : 0;
if (negative) {
var trunkLen = positive.length - p.posPre.length - p.posSuf.length, pos = negative.indexOf(DIGIT_CHAR);
p.negPre = negative.substr(0, pos).replace(/'/g, '');
p.negSuf = negative.substr(pos + trunkLen).replace(/'/g, '');
}
else {
p.negPre = minusSign + p.posPre;
p.negSuf = p.posSuf;
}
return p;
}
// Transforms a parsed number into a percentage by multiplying it by 100
function toPercent(parsedNumber) {
// if the number is 0, don't do anything
if (parsedNumber.digits[0] === 0) {
return parsedNumber;
}
// Getting the current number of decimals
var fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
if (parsedNumber.exponent) {
parsedNumber.exponent += 2;
}
else {
if (fractionLen === 0) {
parsedNumber.digits.push(0, 0);
}
else if (fractionLen === 1) {
parsedNumber.digits.push(0);
}
parsedNumber.integerLen += 2;
}
return parsedNumber;
}
/**
* Parses a number.
* Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/
*/
function parseNumber(num) {
var numStr = Math.abs(num) + '';
var exponent = 0, digits, integerLen;
var i, j, zeros;
// Decimal point?
if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {
numStr = numStr.replace(DECIMAL_SEP, '');
}
// Exponential form?
if ((i = numStr.search(/e/i)) > 0) {
// Work out the exponent.
if (integerLen < 0)
integerLen = i;
integerLen += +numStr.slice(i + 1);
numStr = numStr.substring(0, i);
}
else if (integerLen < 0) {
// There was no decimal point or exponent so it is an integer.
integerLen = numStr.length;
}
// Count the number of leading zeros.
for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {
}
if (i === (zeros = numStr.length)) {
// The digits are all zero.
digits = [0];
integerLen = 1;
}
else {
// Count the number of trailing zeros
zeros--;
while (numStr.charAt(zeros) === ZERO_CHAR)
zeros--;
// Trailing zeros are insignificant so ignore them
integerLen -= i;
digits = [];
// Convert string to array of digits without leading/trailing zeros.
for (j = 0; i <= zeros; i++, j++) {
digits[j] = Number(numStr.charAt(i));
}
}
// If the number overflows the maximum allowed digits then use an exponent.
if (integerLen > MAX_DIGITS) {
digits = digits.splice(0, MAX_DIGITS - 1);
exponent = integerLen - 1;
integerLen = 1;
}
return { digits: digits, exponent: exponent, integerLen: integerLen };
}
/**
* Round the parsed number to the specified number of decimal places
* This function changes the parsedNumber in-place
*/
function roundNumber(parsedNumber, minFrac, maxFrac) {
if (minFrac > maxFrac) {
throw new Error("The minimum number of digits after fraction (" + minFrac + ") is higher than the maximum (" + maxFrac + ").");
}
var digits = parsedNumber.digits;
var fractionLen = digits.length - parsedNumber.integerLen;
var fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);
// The index of the digit to where rounding is to occur
var roundAt = fractionSize + parsedNumber.integerLen;
var digit = digits[roundAt];
if (roundAt > 0) {
// Drop fractional digits beyond `roundAt`
digits.splice(Math.max(parsedNumber.integerLen, roundAt));
// Set non-fractional digits beyond `roundAt` to 0
for (var j = roundAt; j < digits.length; j++) {
digits[j] = 0;
}
}
else {
// We rounded to zero so reset the parsedNumber
fractionLen = Math.max(0, fractionLen);
parsedNumber.integerLen = 1;
digits.length = Math.max(1, roundAt = fractionSize + 1);
digits[0] = 0;
for (var i = 1; i < roundAt; i++)
digits[i] = 0;
}
if (digit >= 5) {
if (roundAt - 1 < 0) {
for (var k = 0; k > roundAt; k--) {
digits.unshift(0);
parsedNumber.integerLen++;
}
digits.unshift(1);
parsedNumber.integerLen++;
}
else {
digits[roundAt - 1]++;
}
}
// Pad out with zeros to get the required fraction length
for (; fractionLen < Math.max(0, fractionSize); fractionLen++)
digits.push(0);
var dropTrailingZeros = fractionSize !== 0;
// Minimal length = nb of decimals required + current nb of integers
// Any number besides that is optional and can be removed if it's a trailing 0
var minLen = minFrac + parsedNumber.integerLen;
// Do any carrying, e.g. a digit was rounded up to 10
var carry = digits.reduceRight(function (carry, d, i, digits) {
d = d + carry;
digits[i] = d < 10 ? d : d - 10; // d % 10
if (dropTrailingZeros) {
// Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52)
if (digits[i] === 0 && i >= minLen) {
digits.pop();
}
else {
dropTrailingZeros = false;
}
}
return d >= 10 ? 1 : 0; // Math.floor(d / 10);
}, 0);
if (carry) {
digits.unshift(carry);
parsedNumber.integerLen++;
}
}
function parseIntAutoRadix(text) {
var result = parseInt(text);
if (isNaN(result)) {
throw new Error('Invalid integer literal when parsing ' + text);
}
return result;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @deprecated from v5
*/
var DEPRECATED_PLURAL_FN = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('UseV4Plurals');
/**
* @experimental
*/
var NgLocalization = /** @class */ (function () {
function NgLocalization() {
}
return NgLocalization;
}());
/**
* Returns the plural category for a given value.
* - "=value" when the case exists,
* - the plural category otherwise
*/
function getPluralCategory(value, cases, ngLocalization, locale) {
var key = "=" + value;
if (cases.indexOf(key) > -1) {
return key;
}
key = ngLocalization.getPluralCategory(value, locale);
if (cases.indexOf(key) > -1) {
return key;
}
if (cases.indexOf('other') > -1) {
return 'other';
}
throw new Error("No plural message found for value \"" + value + "\"");
}
/**
* Returns the plural case based on the locale
*
* @experimental
*/
var NgLocaleLocalization = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(NgLocaleLocalization, _super);
function NgLocaleLocalization(locale,
/** @deprecated from v5 */
deprecatedPluralFn) {
var _this = _super.call(this) || this;
_this.locale = locale;
_this.deprecatedPluralFn = deprecatedPluralFn;
return _this;
}
NgLocaleLocalization.prototype.getPluralCategory = function (value, locale) {
var plural = this.deprecatedPluralFn ? this.deprecatedPluralFn(locale || this.locale, value) :
getLocalePluralCase(locale || this.locale)(value);
switch (plural) {
case Plural.Zero:
return 'zero';
case Plural.One:
return 'one';
case Plural.Two:
return 'two';
case Plural.Few:
return 'few';
case Plural.Many:
return 'many';
default:
return 'other';
}
};
NgLocaleLocalization.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] }
];
/** @nocollapse */
NgLocaleLocalization.ctorParameters = function () { return [
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [DEPRECATED_PLURAL_FN,] }] }
]; };
return NgLocaleLocalization;
}(NgLocalization));
/**
* Returns the plural case based on the locale
*
* @deprecated from v5 the plural case function is in locale data files common/locales/*.ts
* @experimental
*/
function getPluralCase(locale, nLike) {
// TODO(vicb): lazy compute
if (typeof nLike === 'string') {
nLike = parseInt(nLike, 10);
}
var n = nLike;
var nDecimal = n.toString().replace(/^[^.]*\.?/, '');
var i = Math.floor(Math.abs(n));
var v = nDecimal.length;
var f = parseInt(nDecimal, 10);
var t = parseInt(n.toString().replace(/^[^.]*\.?|0+$/g, ''), 10) || 0;
var lang = locale.split('-')[0].toLowerCase();
switch (lang) {
case 'af':
case 'asa':
case 'az':
case 'bem':
case 'bez':
case 'bg':
case 'brx':
case 'ce':
case 'cgg':
case 'chr':
case 'ckb':
case 'ee':
case 'el':
case 'eo':
case 'es':
case 'eu':
case 'fo':
case 'fur':
case 'gsw':
case 'ha':
case 'haw':
case 'hu':
case 'jgo':
case 'jmc':
case 'ka':
case 'kk':
case 'kkj':
case 'kl':
case 'ks':
case 'ksb':
case 'ky':
case 'lb':
case 'lg':
case 'mas':
case 'mgo':
case 'ml':
case 'mn':
case 'nb':
case 'nd':
case 'ne':
case 'nn':
case 'nnh':
case 'nyn':
case 'om':
case 'or':
case 'os':
case 'ps':
case 'rm':
case 'rof':
case 'rwk':
case 'saq':
case 'seh':
case 'sn':
case 'so':
case 'sq':
case 'ta':
case 'te':
case 'teo':
case 'tk':
case 'tr':
case 'ug':
case 'uz':
case 'vo':
case 'vun':
case 'wae':
case 'xog':
if (n === 1)
return Plural.One;
return Plural.Other;
case 'ak':
case 'ln':
case 'mg':
case 'pa':
case 'ti':
if (n === Math.floor(n) && n >= 0 && n <= 1)
return Plural.One;
return Plural.Other;
case 'am':
case 'as':
case 'bn':
case 'fa':
case 'gu':
case 'hi':
case 'kn':
case 'mr':
case 'zu':
if (i === 0 || n === 1)
return Plural.One;
return Plural.Other;
case 'ar':
if (n === 0)
return Plural.Zero;
if (n === 1)
return Plural.One;
if (n === 2)
return Plural.Two;
if (n % 100 === Math.floor(n % 100) && n % 100 >= 3 && n % 100 <= 10)
return Plural.Few;
if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 99)
return Plural.Many;
return Plural.Other;
case 'ast':
case 'ca':
case 'de':
case 'en':
case 'et':
case 'fi':
case 'fy':
case 'gl':
case 'it':
case 'nl':
case 'sv':
case 'sw':
case 'ur':
case 'yi':
if (i === 1 && v === 0)
return Plural.One;
return Plural.Other;
case 'be':
if (n % 10 === 1 && !(n % 100 === 11))
return Plural.One;
if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 4 &&
!(n % 100 >= 12 && n % 100 <= 14))
return Plural.Few;
if (n % 10 === 0 || n % 10 === Math.floor(n % 10) && n % 10 >= 5 && n % 10 <= 9 ||
n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 14)
return Plural.Many;
return Plural.Other;
case 'br':
if (n % 10 === 1 && !(n % 100 === 11 || n % 100 === 71 || n % 100 === 91))
return Plural.One;
if (n % 10 === 2 && !(n % 100 === 12 || n % 100 === 72 || n % 100 === 92))
return Plural.Two;
if (n % 10 === Math.floor(n % 10) && (n % 10 >= 3 && n % 10 <= 4 || n % 10 === 9) &&
!(n % 100 >= 10 && n % 100 <= 19 || n % 100 >= 70 && n % 100 <= 79 ||
n % 100 >= 90 && n % 100 <= 99))
return Plural.Few;
if (!(n === 0) && n % 1e6 === 0)
return Plural.Many;
return Plural.Other;
case 'bs':
case 'hr':
case 'sr':
if (v === 0 && i % 10 === 1 && !(i % 100 === 11) || f % 10 === 1 && !(f % 100 === 11))
return Plural.One;
if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&
!(i % 100 >= 12 && i % 100 <= 14) ||
f % 10 === Math.floor(f % 10) && f % 10 >= 2 && f % 10 <= 4 &&
!(f % 100 >= 12 && f % 100 <= 14))
return Plural.Few;
return Plural.Other;
case 'cs':
case 'sk':
if (i === 1 && v === 0)
return Plural.One;
if (i === Math.floor(i) && i >= 2 && i <= 4 && v === 0)
return Plural.Few;
if (!(v === 0))
return Plural.Many;
return Plural.Other;
case 'cy':
if (n === 0)
return Plural.Zero;
if (n === 1)
return Plural.One;
if (n === 2)
return Plural.Two;
if (n === 3)
return Plural.Few;
if (n === 6)
return Plural.Many;
return Plural.Other;
case 'da':
if (n === 1 || !(t === 0) && (i === 0 || i === 1))
return Plural.One;
return Plural.Other;
case 'dsb':
case 'hsb':
if (v === 0 && i % 100 === 1 || f % 100 === 1)
return Plural.One;
if (v === 0 && i % 100 === 2 || f % 100 === 2)
return Plural.Two;
if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 ||
f % 100 === Math.floor(f % 100) && f % 100 >= 3 && f % 100 <= 4)
return Plural.Few;
return Plural.Other;
case 'ff':
case 'fr':
case 'hy':
case 'kab':
if (i === 0 || i === 1)
return Plural.One;
return Plural.Other;
case 'fil':
if (v === 0 && (i === 1 || i === 2 || i === 3) ||
v === 0 && !(i % 10 === 4 || i % 10 === 6 || i % 10 === 9) ||
!(v === 0) && !(f % 10 === 4 || f % 10 === 6 || f % 10 === 9))
return Plural.One;
return Plural.Other;
case 'ga':
if (n === 1)
return Plural.One;
if (n === 2)
return Plural.Two;
if (n === Math.floor(n) && n >= 3 && n <= 6)
return Plural.Few;
if (n === Math.floor(n) && n >= 7 && n <= 10)
return Plural.Many;
return Plural.Other;
case 'gd':
if (n === 1 || n === 11)
return Plural.One;
if (n === 2 || n === 12)
return Plural.Two;
if (n === Math.floor(n) && (n >= 3 && n <= 10 || n >= 13 && n <= 19))
return Plural.Few;
return Plural.Other;
case 'gv':
if (v === 0 && i % 10 === 1)
return Plural.One;
if (v === 0 && i % 10 === 2)
return Plural.Two;
if (v === 0 &&
(i % 100 === 0 || i % 100 === 20 || i % 100 === 40 || i % 100 === 60 || i % 100 === 80))
return Plural.Few;
if (!(v === 0))
return Plural.Many;
return Plural.Other;
case 'he':
if (i === 1 && v === 0)
return Plural.One;
if (i === 2 && v === 0)
return Plural.Two;
if (v === 0 && !(n >= 0 && n <= 10) && n % 10 === 0)
return Plural.Many;
return Plural.Other;
case 'is':
if (t === 0 && i % 10 === 1 && !(i % 100 === 11) || !(t === 0))
return Plural.One;
return Plural.Other;
case 'ksh':
if (n === 0)
return Plural.Zero;
if (n === 1)
return Plural.One;
return Plural.Other;
case 'kw':
case 'naq':
case 'se':
case 'smn':
if (n === 1)
return Plural.One;
if (n === 2)
return Plural.Two;
return Plural.Other;
case 'lag':
if (n === 0)
return Plural.Zero;
if ((i === 0 || i === 1) && !(n === 0))
return Plural.One;
return Plural.Other;
case 'lt':
if (n % 10 === 1 && !(n % 100 >= 11 && n % 100 <= 19))
return Plural.One;
if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 9 &&
!(n % 100 >= 11 && n % 100 <= 19))
return Plural.Few;
if (!(f === 0))
return Plural.Many;
return Plural.Other;
case 'lv':
case 'prg':
if (n % 10 === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19 ||
v === 2 && f % 100 === Math.floor(f % 100) && f % 100 >= 11 && f % 100 <= 19)
return Plural.Zero;
if (n % 10 === 1 && !(n % 100 === 11) || v === 2 && f % 10 === 1 && !(f % 100 === 11) ||
!(v === 2) && f % 10 === 1)
return Plural.One;
return Plural.Other;
case 'mk':
if (v === 0 && i % 10 === 1 || f % 10 === 1)
return Plural.One;
return Plural.Other;
case 'mt':
if (n === 1)
return Plural.One;
if (n === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 2 && n % 100 <= 10)
return Plural.Few;
if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19)
return Plural.Many;
return Plural.Other;
case 'pl':
if (i === 1 && v === 0)
return Plural.One;
if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&
!(i % 100 >= 12 && i % 100 <= 14))
return Plural.Few;
if (v === 0 && !(i === 1) && i % 10 === Math.floor(i % 10) && i % 10 >= 0 && i % 10 <= 1 ||
v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||
v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 12 && i % 100 <= 14)
return Plural.Many;
return Plural.Other;
case 'pt':
if (n === Math.floor(n) && n >= 0 && n <= 2 && !(n === 2))
return Plural.One;
return Plural.Other;
case 'ro':
if (i === 1 && v === 0)
return Plural.One;
if (!(v === 0) || n === 0 ||
!(n === 1) && n % 100 === Math.floor(n % 100) && n % 100 >= 1 && n % 100 <= 19)
return Plural.Few;
return Plural.Other;
case 'ru':
case 'uk':
if (v === 0 && i % 10 === 1 && !(i % 100 === 11))
return Plural.One;
if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&
!(i % 100 >= 12 && i % 100 <= 14))
return Plural.Few;
if (v === 0 && i % 10 === 0 ||
v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||
v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 11 && i % 100 <= 14)
return Plural.Many;
return Plural.Other;
case 'shi':
if (i === 0 || n === 1)
return Plural.One;
if (n === Math.floor(n) && n >= 2 && n <= 10)
return Plural.Few;
return Plural.Other;
case 'si':
if (n === 0 || n === 1 || i === 0 && f === 1)
return Plural.One;
return Plural.Other;
case 'sl':
if (v === 0 && i % 100 === 1)
return Plural.One;
if (v === 0 && i % 100 === 2)
return Plural.Two;
if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 || !(v === 0))
return Plural.Few;
return Plural.Other;
case 'tzm':
if (n === Math.floor(n) && n >= 0 && n <= 1 || n === Math.floor(n) && n >= 11 && n <= 99)
return Plural.One;
return Plural.Other;
// When there is no specification, the default is always "other"
// Spec: http://cldr.unicode.org/index/cldr-spec/plural-rules
// > other (required—general plural form — also used if the language only has a single form)
default:
return Plural.Other;
}
}
/**
* @license
* Copyright Google Inc. 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
*/
function parseCookieValue(cookieStr, name) {
name = encodeURIComponent(name);
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__values"])(cookieStr.split(';')), _b = _a.next(); !_b.done; _b = _a.next()) {
var cookie = _b.value;
var eqIndex = cookie.indexOf('=');
var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__read"])(eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)], 2), cookieName = _c[0], cookieValue = _c[1];
if (cookieName.trim() === name) {
return decodeURIComponent(cookieValue);
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_b && !_b.done && (_d = _a.return)) _d.call(_a);
}
finally { if (e_1) throw e_1.error; }
}
return null;
var e_1, _d;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @ngModule CommonModule
*
* @usageNotes
* ```
* <some-element [ngClass]="'first second'">...</some-element>
*
* <some-element [ngClass]="['first', 'second']">...</some-element>
*
* <some-element [ngClass]="{'first': true, 'second': true, 'third': false}">...</some-element>
*
* <some-element [ngClass]="stringExp|arrayExp|objExp">...</some-element>
*
* <some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element>
* ```
*
* @description
*
* Adds and removes CSS classes on an HTML element.
*
* The CSS classes are updated as follows, depending on the type of the expression evaluation:
* - `string` - the CSS classes listed in the string (space delimited) are added,
* - `Array` - the CSS classes declared as Array elements are added,
* - `Object` - keys are CSS classes that get added when the expression given in the value
* evaluates to a truthy value, otherwise they are removed.
*
*
*/
var NgClass = /** @class */ (function () {
function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) {
this._iterableDiffers = _iterableDiffers;
this._keyValueDiffers = _keyValueDiffers;
this._ngEl = _ngEl;
this._renderer = _renderer;
this._initialClasses = [];
}
Object.defineProperty(NgClass.prototype, "klass", {
set: function (v) {
this._removeClasses(this._initialClasses);
this._initialClasses = typeof v === 'string' ? v.split(/\s+/) : [];
this._applyClasses(this._initialClasses);
this._applyClasses(this._rawClass);
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgClass.prototype, "ngClass", {
set: function (v) {
this._removeClasses(this._rawClass);
this._applyClasses(this._initialClasses);
this._iterableDiffer = null;
this._keyValueDiffer = null;
this._rawClass = typeof v === 'string' ? v.split(/\s+/) : v;
if (this._rawClass) {
if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisListLikeIterable"])(this._rawClass)) {
this._iterableDiffer = this._iterableDiffers.find(this._rawClass).create();
}
else {
this._keyValueDiffer = this._keyValueDiffers.find(this._rawClass).create();
}
}
},
enumerable: true,
configurable: true
});
NgClass.prototype.ngDoCheck = function () {
if (this._iterableDiffer) {
var iterableChanges = this._iterableDiffer.diff(this._rawClass);
if (iterableChanges) {
this._applyIterableChanges(iterableChanges);
}
}
else if (this._keyValueDiffer) {
var keyValueChanges = this._keyValueDiffer.diff(this._rawClass);
if (keyValueChanges) {
this._applyKeyValueChanges(keyValueChanges);
}
}
};
NgClass.prototype._applyKeyValueChanges = function (changes) {
var _this = this;
changes.forEachAddedItem(function (record) { return _this._toggleClass(record.key, record.currentValue); });
changes.forEachChangedItem(function (record) { return _this._toggleClass(record.key, record.currentValue); });
changes.forEachRemovedItem(function (record) {
if (record.previousValue) {
_this._toggleClass(record.key, false);
}
});
};
NgClass.prototype._applyIterableChanges = function (changes) {
var _this = this;
changes.forEachAddedItem(function (record) {
if (typeof record.item === 'string') {
_this._toggleClass(record.item, true);
}
else {
throw new Error("NgClass can only toggle CSS classes expressed as strings, got " + Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(record.item));
}
});
changes.forEachRemovedItem(function (record) { return _this._toggleClass(record.item, false); });
};
/**
* Applies a collection of CSS classes to the DOM element.
*
* For argument of type Set and Array CSS class names contained in those collections are always
* added.
* For argument of type Map CSS class name in the map's key is toggled based on the value (added
* for truthy and removed for falsy).
*/
NgClass.prototype._applyClasses = function (rawClassVal) {
var _this = this;
if (rawClassVal) {
if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {
rawClassVal.forEach(function (klass) { return _this._toggleClass(klass, true); });
}
else {
Object.keys(rawClassVal).forEach(function (klass) { return _this._toggleClass(klass, !!rawClassVal[klass]); });
}
}
};
/**
* Removes a collection of CSS classes from the DOM element. This is mostly useful for cleanup
* purposes.
*/
NgClass.prototype._removeClasses = function (rawClassVal) {
var _this = this;
if (rawClassVal) {
if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {
rawClassVal.forEach(function (klass) { return _this._toggleClass(klass, false); });
}
else {
Object.keys(rawClassVal).forEach(function (klass) { return _this._toggleClass(klass, false); });
}
}
};
NgClass.prototype._toggleClass = function (klass, enabled) {
var _this = this;
klass = klass.trim();
if (klass) {
klass.split(/\s+/g).forEach(function (klass) {
if (enabled) {
_this._renderer.addClass(_this._ngEl.nativeElement, klass);
}
else {
_this._renderer.removeClass(_this._ngEl.nativeElement, klass);
}
});
}
};
NgClass.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[ngClass]' },] }
];
/** @nocollapse */
NgClass.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }
]; };
NgClass.propDecorators = {
klass: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['class',] }],
ngClass: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
};
return NgClass;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Instantiates a single {@link Component} type and inserts its Host View into current View.
* `NgComponentOutlet` provides a declarative approach for dynamic component creation.
*
* `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and
* any existing component will get destroyed.
*
* ### Fine tune control
*
* You can control the component creation process by using the following optional attributes:
*
* * `ngComponentOutletInjector`: Optional custom {@link Injector} that will be used as parent for
* the Component. Defaults to the injector of the current view container.
*
* * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content
* section of the component, if exists.
*
* * `ngComponentOutletNgModuleFactory`: Optional module factory to allow dynamically loading other
* module, then load a component from that module.
*
* ### Syntax
*
* Simple
* ```
* <ng-container *ngComponentOutlet="componentTypeExpression"></ng-container>
* ```
*
* Customized injector/content
* ```
* <ng-container *ngComponentOutlet="componentTypeExpression;
* injector: injectorExpression;
* content: contentNodesExpression;">
* </ng-container>
* ```
*
* Customized ngModuleFactory
* ```
* <ng-container *ngComponentOutlet="componentTypeExpression;
* ngModuleFactory: moduleFactory;">
* </ng-container>
* ```
* ## Example
*
* {@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'}
*
* A more complete example with additional options:
*
* {@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'}
* A more complete example with ngModuleFactory:
*
* {@example common/ngComponentOutlet/ts/module.ts region='NgModuleFactoryExample'}
*
* @experimental
*/
var NgComponentOutlet = /** @class */ (function () {
function NgComponentOutlet(_viewContainerRef) {
this._viewContainerRef = _viewContainerRef;
this._componentRef = null;
this._moduleRef = null;
}
NgComponentOutlet.prototype.ngOnChanges = function (changes) {
this._viewContainerRef.clear();
this._componentRef = null;
if (this.ngComponentOutlet) {
var elInjector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;
if (changes['ngComponentOutletNgModuleFactory']) {
if (this._moduleRef)
this._moduleRef.destroy();
if (this.ngComponentOutletNgModuleFactory) {
var parentModule = elInjector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModuleRef"]);
this._moduleRef = this.ngComponentOutletNgModuleFactory.create(parentModule.injector);
}
else {
this._moduleRef = null;
}
}
var componentFactoryResolver = this._moduleRef ? this._moduleRef.componentFactoryResolver :
elInjector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ComponentFactoryResolver"]);
var componentFactory = componentFactoryResolver.resolveComponentFactory(this.ngComponentOutlet);
this._componentRef = this._viewContainerRef.createComponent(componentFactory, this._viewContainerRef.length, elInjector, this.ngComponentOutletContent);
}
};
NgComponentOutlet.prototype.ngOnDestroy = function () {
if (this._moduleRef)
this._moduleRef.destroy();
};
NgComponentOutlet.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[ngComponentOutlet]' },] }
];
/** @nocollapse */
NgComponentOutlet.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }
]; };
NgComponentOutlet.propDecorators = {
ngComponentOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
ngComponentOutletInjector: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
ngComponentOutletContent: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
ngComponentOutletNgModuleFactory: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
};
return NgComponentOutlet;
}());
/**
* @license
* Copyright Google Inc. 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 NgForOfContext = /** @class */ (function () {
function NgForOfContext($implicit, ngForOf, index, count) {
this.$implicit = $implicit;
this.ngForOf = ngForOf;
this.index = index;
this.count = count;
}
Object.defineProperty(NgForOfContext.prototype, "first", {
get: function () { return this.index === 0; },
enumerable: true,
configurable: true
});
Object.defineProperty(NgForOfContext.prototype, "last", {
get: function () { return this.index === this.count - 1; },
enumerable: true,
configurable: true
});
Object.defineProperty(NgForOfContext.prototype, "even", {
get: function () { return this.index % 2 === 0; },
enumerable: true,
configurable: true
});
Object.defineProperty(NgForOfContext.prototype, "odd", {
get: function () { return !this.even; },
enumerable: true,
configurable: true
});
return NgForOfContext;
}());
/**
* The `NgForOf` directive instantiates a template once per item from an iterable. The context
* for each instantiated template inherits from the outer context with the given loop variable
* set to the current item from the iterable.
*
* ### Local Variables
*
* `NgForOf` provides several exported values that can be aliased to local variables:
*
* - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).
* - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is
* more complex then a property access, for example when using the async pipe (`userStreams |
* async`).
* - `index: number`: The index of the current item in the iterable.
* - `first: boolean`: True when the item is the first item in the iterable.
* - `last: boolean`: True when the item is the last item in the iterable.
* - `even: boolean`: True when the item has an even index in the iterable.
* - `odd: boolean`: True when the item has an odd index in the iterable.
*
* ```
* <li *ngFor="let user of userObservable | async as users; index as i; first as isFirst">
* {{i}}/{{users.length}}. {{user}} <span *ngIf="isFirst">default</span>
* </li>
* ```
*
* ### Change Propagation
*
* When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:
*
* * When an item is added, a new instance of the template is added to the DOM.
* * When an item is removed, its template instance is removed from the DOM.
* * When items are reordered, their respective templates are reordered in the DOM.
* * Otherwise, the DOM element for that item will remain the same.
*
* Angular uses object identity to track insertions and deletions within the iterator and reproduce
* those changes in the DOM. This has important implications for animations and any stateful
* controls (such as `<input>` elements which accept user input) that are present. Inserted rows can
* be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state
* such as user input.
*
* It is possible for the identities of elements in the iterator to change while the data does not.
* This can happen, for example, if the iterator produced from an RPC to the server, and that
* RPC is re-run. Even if the data hasn't changed, the second response will produce objects with
* different identities, and Angular will tear down the entire DOM and rebuild it (as if all old
* elements were deleted and all new elements inserted). This is an expensive operation and should
* be avoided if possible.
*
* To customize the default tracking algorithm, `NgForOf` supports `trackBy` option.
* `trackBy` takes a function which has two arguments: `index` and `item`.
* If `trackBy` is given, Angular tracks changes by the return value of the function.
*
* ### Syntax
*
* - `<li *ngFor="let item of items; index as i; trackBy: trackByFn">...</li>`
*
* With `<ng-template>` element:
*
* ```
* <ng-template ngFor let-item [ngForOf]="items" let-i="index" [ngForTrackBy]="trackByFn">
* <li>...</li>
* </ng-template>
* ```
*
* ### Example
*
* See a [live demo](http://plnkr.co/edit/KVuXxDp0qinGDyo307QW?p=preview) for a more detailed
* example.
*
*
*/
var NgForOf = /** @class */ (function () {
function NgForOf(_viewContainer, _template, _differs) {
this._viewContainer = _viewContainer;
this._template = _template;
this._differs = _differs;
this._differ = null;
}
Object.defineProperty(NgForOf.prototype, "ngForTrackBy", {
get: function () { return this._trackByFn; },
set: function (fn) {
if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["isDevMode"])() && fn != null && typeof fn !== 'function') {
// TODO(vicb): use a log service once there is a public one available
if (console && console.warn) {
console.warn("trackBy must be a function, but received " + JSON.stringify(fn) + ". " +
"See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information.");
}
}
this._trackByFn = fn;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgForOf.prototype, "ngForTemplate", {
set: function (value) {
// TODO(TS2.1): make TemplateRef<Partial<NgForRowOf<T>>> once we move to TS v2.1
// The current type is too restrictive; a template that just uses index, for example,
// should be acceptable.
if (value) {
this._template = value;
}
},
enumerable: true,
configurable: true
});
NgForOf.prototype.ngOnChanges = function (changes) {
if ('ngForOf' in changes) {
// React on ngForOf changes only once all inputs have been initialized
var value = changes['ngForOf'].currentValue;
if (!this._differ && value) {
try {
this._differ = this._differs.find(value).create(this.ngForTrackBy);
}
catch (e) {
throw new Error("Cannot find a differ supporting object '" + value + "' of type '" + getTypeNameForDebugging(value) + "'. NgFor only supports binding to Iterables such as Arrays.");
}
}
}
};
NgForOf.prototype.ngDoCheck = function () {
if (this._differ) {
var changes = this._differ.diff(this.ngForOf);
if (changes)
this._applyChanges(changes);
}
};
NgForOf.prototype._applyChanges = function (changes) {
var _this = this;
var insertTuples = [];
changes.forEachOperation(function (item, adjustedPreviousIndex, currentIndex) {
if (item.previousIndex == null) {
var view = _this._viewContainer.createEmbeddedView(_this._template, new NgForOfContext(null, _this.ngForOf, -1, -1), currentIndex);
var tuple = new RecordViewTuple(item, view);
insertTuples.push(tuple);
}
else if (currentIndex == null) {
_this._viewContainer.remove(adjustedPreviousIndex);
}
else {
var view = _this._viewContainer.get(adjustedPreviousIndex);
_this._viewContainer.move(view, currentIndex);
var tuple = new RecordViewTuple(item, view);
insertTuples.push(tuple);
}
});
for (var i = 0; i < insertTuples.length; i++) {
this._perViewChange(insertTuples[i].view, insertTuples[i].record);
}
for (var i = 0, ilen = this._viewContainer.length; i < ilen; i++) {
var viewRef = this._viewContainer.get(i);
viewRef.context.index = i;
viewRef.context.count = ilen;
viewRef.context.ngForOf = this.ngForOf;
}
changes.forEachIdentityChange(function (record) {
var viewRef = _this._viewContainer.get(record.currentIndex);
viewRef.context.$implicit = record.item;
});
};
NgForOf.prototype._perViewChange = function (view, record) {
view.context.$implicit = record.item;
};
NgForOf.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[ngFor][ngForOf]' },] }
];
/** @nocollapse */
NgForOf.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"] }
]; };
NgForOf.propDecorators = {
ngForOf: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
ngForTrackBy: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
ngForTemplate: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
};
return NgForOf;
}());
var RecordViewTuple = /** @class */ (function () {
function RecordViewTuple(record, view) {
this.record = record;
this.view = view;
}
return RecordViewTuple;
}());
function getTypeNameForDebugging(type) {
return type['name'] || typeof type;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Conditionally includes a template based on the value of an `expression`.
*
* `ngIf` evaluates the `expression` and then renders the `then` or `else` template in its place
* when expression is truthy or falsy respectively. Typically the:
* - `then` template is the inline template of `ngIf` unless bound to a different value.
* - `else` template is blank unless it is bound.
*
* ## Most common usage
*
* The most common usage of the `ngIf` directive is to conditionally show the inline template as
* seen in this example:
* {@example common/ngIf/ts/module.ts region='NgIfSimple'}
*
* ## Showing an alternative template using `else`
*
* If it is necessary to display a template when the `expression` is falsy use the `else` template
* binding as shown. Note that the `else` binding points to a `<ng-template>` labeled `#elseBlock`.
* The template can be defined anywhere in the component view but is typically placed right after
* `ngIf` for readability.
*
* {@example common/ngIf/ts/module.ts region='NgIfElse'}
*
* ## Using non-inlined `then` template
*
* Usually the `then` template is the inlined template of the `ngIf`, but it can be changed using
* a binding (just like `else`). Because `then` and `else` are bindings, the template references can
* change at runtime as shown in this example.
*
* {@example common/ngIf/ts/module.ts region='NgIfThenElse'}
*
* ## Storing conditional result in a variable
*
* A common pattern is that we need to show a set of properties from the same object. If the
* object is undefined, then we have to use the safe-traversal-operator `?.` to guard against
* dereferencing a `null` value. This is especially the case when waiting on async data such as
* when using the `async` pipe as shown in following example:
*
* ```
* Hello {{ (userStream|async)?.last }}, {{ (userStream|async)?.first }}!
* ```
*
* There are several inefficiencies in the above example:
* - We create multiple subscriptions on `userStream`. One for each `async` pipe, or two in the
* example above.
* - We cannot display an alternative screen while waiting for the data to arrive asynchronously.
* - We have to use the safe-traversal-operator `?.` to access properties, which is cumbersome.
* - We have to place the `async` pipe in parenthesis.
*
* A better way to do this is to use `ngIf` and store the result of the condition in a local
* variable as shown in the the example below:
*
* {@example common/ngIf/ts/module.ts region='NgIfAs'}
*
* Notice that:
* - We use only one `async` pipe and hence only one subscription gets created.
* - `ngIf` stores the result of the `userStream|async` in the local variable `user`.
* - The local `user` can then be bound repeatedly in a more efficient way.
* - No need to use the safe-traversal-operator `?.` to access properties as `ngIf` will only
* display the data if `userStream` returns a value.
* - We can display an alternative template while waiting for the data.
*
* ### Syntax
*
* Simple form:
* - `<div *ngIf="condition">...</div>`
* - `<ng-template [ngIf]="condition"><div>...</div></ng-template>`
*
* Form with an else block:
* ```
* <div *ngIf="condition; else elseBlock">...</div>
* <ng-template #elseBlock>...</ng-template>
* ```
*
* Form with a `then` and `else` block:
* ```
* <div *ngIf="condition; then thenBlock else elseBlock"></div>
* <ng-template #thenBlock>...</ng-template>
* <ng-template #elseBlock>...</ng-template>
* ```
*
* Form with storing the value locally:
* ```
* <div *ngIf="condition as value; else elseBlock">{{value}}</div>
* <ng-template #elseBlock>...</ng-template>
* ```
*
*
*/
var NgIf = /** @class */ (function () {
function NgIf(_viewContainer, templateRef) {
this._viewContainer = _viewContainer;
this._context = new NgIfContext();
this._thenTemplateRef = null;
this._elseTemplateRef = null;
this._thenViewRef = null;
this._elseViewRef = null;
this._thenTemplateRef = templateRef;
}
Object.defineProperty(NgIf.prototype, "ngIf", {
set: function (condition) {
this._context.$implicit = this._context.ngIf = condition;
this._updateView();
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgIf.prototype, "ngIfThen", {
set: function (templateRef) {
assertTemplate('ngIfThen', templateRef);
this._thenTemplateRef = templateRef;
this._thenViewRef = null; // clear previous view if any.
this._updateView();
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgIf.prototype, "ngIfElse", {
set: function (templateRef) {
assertTemplate('ngIfElse', templateRef);
this._elseTemplateRef = templateRef;
this._elseViewRef = null; // clear previous view if any.
this._updateView();
},
enumerable: true,
configurable: true
});
NgIf.prototype._updateView = function () {
if (this._context.$implicit) {
if (!this._thenViewRef) {
this._viewContainer.clear();
this._elseViewRef = null;
if (this._thenTemplateRef) {
this._thenViewRef =
this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);
}
}
}
else {
if (!this._elseViewRef) {
this._viewContainer.clear();
this._thenViewRef = null;
if (this._elseTemplateRef) {
this._elseViewRef =
this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);
}
}
}
};
NgIf.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[ngIf]' },] }
];
/** @nocollapse */
NgIf.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }
]; };
NgIf.propDecorators = {
ngIf: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
ngIfThen: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
ngIfElse: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
};
return NgIf;
}());
var NgIfContext = /** @class */ (function () {
function NgIfContext() {
this.$implicit = null;
this.ngIf = null;
}
return NgIfContext;
}());
function assertTemplate(property, templateRef) {
var isTemplateRefOrNull = !!(!templateRef || templateRef.createEmbeddedView);
if (!isTemplateRefOrNull) {
throw new Error(property + " must be a TemplateRef, but received '" + Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(templateRef) + "'.");
}
}
/**
* @license
* Copyright Google Inc. 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 SwitchView = /** @class */ (function () {
function SwitchView(_viewContainerRef, _templateRef) {
this._viewContainerRef = _viewContainerRef;
this._templateRef = _templateRef;
this._created = false;
}
SwitchView.prototype.create = function () {
this._created = true;
this._viewContainerRef.createEmbeddedView(this._templateRef);
};
SwitchView.prototype.destroy = function () {
this._created = false;
this._viewContainerRef.clear();
};
SwitchView.prototype.enforceState = function (created) {
if (created && !this._created) {
this.create();
}
else if (!created && this._created) {
this.destroy();
}
};
return SwitchView;
}());
/**
* @ngModule CommonModule
*
* @usageNotes
* ```
* <container-element [ngSwitch]="switch_expression">
* <some-element *ngSwitchCase="match_expression_1">...</some-element>
* <some-element *ngSwitchCase="match_expression_2">...</some-element>
* <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element>
* <ng-container *ngSwitchCase="match_expression_3">
* <!-- use a ng-container to group multiple root nodes -->
* <inner-element></inner-element>
* <inner-other-element></inner-other-element>
* </ng-container>
* <some-element *ngSwitchDefault>...</some-element>
* </container-element>
* ```
* @description
*
* Adds / removes DOM sub-trees when the nest match expressions matches the switch expression.
*
* `NgSwitch` stamps out nested views when their match expression value matches the value of the
* switch expression.
*
* In other words:
* - you define a container element (where you place the directive with a switch expression on the
* `[ngSwitch]="..."` attribute)
* - you define inner views inside the `NgSwitch` and place a `*ngSwitchCase` attribute on the view
* root elements.
*
* Elements within `NgSwitch` but outside of a `NgSwitchCase` or `NgSwitchDefault` directives will
* be preserved at the location.
*
* The `ngSwitchCase` directive informs the parent `NgSwitch` of which view to display when the
* expression is evaluated.
* When no matching expression is found on a `ngSwitchCase` view, the `ngSwitchDefault` view is
* stamped out.
*
*
*/
var NgSwitch = /** @class */ (function () {
function NgSwitch() {
this._defaultUsed = false;
this._caseCount = 0;
this._lastCaseCheckIndex = 0;
this._lastCasesMatched = false;
}
Object.defineProperty(NgSwitch.prototype, "ngSwitch", {
set: function (newValue) {
this._ngSwitch = newValue;
if (this._caseCount === 0) {
this._updateDefaultCases(true);
}
},
enumerable: true,
configurable: true
});
/** @internal */
NgSwitch.prototype._addCase = function () { return this._caseCount++; };
/** @internal */
NgSwitch.prototype._addDefault = function (view) {
if (!this._defaultViews) {
this._defaultViews = [];
}
this._defaultViews.push(view);
};
/** @internal */
NgSwitch.prototype._matchCase = function (value) {
var matched = value == this._ngSwitch;
this._lastCasesMatched = this._lastCasesMatched || matched;
this._lastCaseCheckIndex++;
if (this._lastCaseCheckIndex === this._caseCount) {
this._updateDefaultCases(!this._lastCasesMatched);
this._lastCaseCheckIndex = 0;
this._lastCasesMatched = false;
}
return matched;
};
NgSwitch.prototype._updateDefaultCases = function (useDefault) {
if (this._defaultViews && useDefault !== this._defaultUsed) {
this._defaultUsed = useDefault;
for (var i = 0; i < this._defaultViews.length; i++) {
var defaultView = this._defaultViews[i];
defaultView.enforceState(useDefault);
}
}
};
NgSwitch.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[ngSwitch]' },] }
];
NgSwitch.propDecorators = {
ngSwitch: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
};
return NgSwitch;
}());
/**
* @ngModule CommonModule
*
* @usageNotes
* ```
* <container-element [ngSwitch]="switch_expression">
* <some-element *ngSwitchCase="match_expression_1">...</some-element>
* </container-element>
*```
* @description
*
* Creates a view that will be added/removed from the parent {@link NgSwitch} when the
* given expression evaluate to respectively the same/different value as the switch
* expression.
*
* Insert the sub-tree when the expression evaluates to the same value as the enclosing switch
* expression.
*
* If multiple match expressions match the switch expression value, all of them are displayed.
*
* See {@link NgSwitch} for more details and example.
*
*
*/
var NgSwitchCase = /** @class */ (function () {
function NgSwitchCase(viewContainer, templateRef, ngSwitch) {
this.ngSwitch = ngSwitch;
ngSwitch._addCase();
this._view = new SwitchView(viewContainer, templateRef);
}
NgSwitchCase.prototype.ngDoCheck = function () { this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase)); };
NgSwitchCase.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[ngSwitchCase]' },] }
];
/** @nocollapse */
NgSwitchCase.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] },
{ type: NgSwitch, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }] }
]; };
NgSwitchCase.propDecorators = {
ngSwitchCase: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
};
return NgSwitchCase;
}());
/**
* @ngModule CommonModule
* @usageNotes
* ```
* <container-element [ngSwitch]="switch_expression">
* <some-element *ngSwitchCase="match_expression_1">...</some-element>
* <some-other-element *ngSwitchDefault>...</some-other-element>
* </container-element>
* ```
*
* @description
*
* Creates a view that is added to the parent {@link NgSwitch} when no case expressions
* match the switch expression.
*
* Insert the sub-tree when no case expressions evaluate to the same value as the enclosing switch
* expression.
*
* See {@link NgSwitch} for more details and example.
*
*
*/
var NgSwitchDefault = /** @class */ (function () {
function NgSwitchDefault(viewContainer, templateRef, ngSwitch) {
ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
}
NgSwitchDefault.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[ngSwitchDefault]' },] }
];
/** @nocollapse */
NgSwitchDefault.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] },
{ type: NgSwitch, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }] }
]; };
return NgSwitchDefault;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @ngModule CommonModule
*
* @usageNotes
* ```
* <some-element [ngPlural]="value">
* <ng-template ngPluralCase="=0">there is nothing</ng-template>
* <ng-template ngPluralCase="=1">there is one</ng-template>
* <ng-template ngPluralCase="few">there are a few</ng-template>
* </some-element>
* ```
*
* @description
*
* Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.
*
* Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees
* that match the switch expression's pluralization category.
*
* To use this directive you must provide a container element that sets the `[ngPlural]` attribute
* to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their
* expression:
* - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value
* matches the switch expression exactly,
* - otherwise, the view will be treated as a "category match", and will only display if exact
* value matches aren't found and the value maps to its category for the defined locale.
*
* See http://cldr.unicode.org/index/cldr-spec/plural-rules
*
* @experimental
*/
var NgPlural = /** @class */ (function () {
function NgPlural(_localization) {
this._localization = _localization;
this._caseViews = {};
}
Object.defineProperty(NgPlural.prototype, "ngPlural", {
set: function (value) {
this._switchValue = value;
this._updateView();
},
enumerable: true,
configurable: true
});
NgPlural.prototype.addCase = function (value, switchView) { this._caseViews[value] = switchView; };
NgPlural.prototype._updateView = function () {
this._clearViews();
var cases = Object.keys(this._caseViews);
var key = getPluralCategory(this._switchValue, cases, this._localization);
this._activateView(this._caseViews[key]);
};
NgPlural.prototype._clearViews = function () {
if (this._activeView)
this._activeView.destroy();
};
NgPlural.prototype._activateView = function (view) {
if (view) {
this._activeView = view;
this._activeView.create();
}
};
NgPlural.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[ngPlural]' },] }
];
/** @nocollapse */
NgPlural.ctorParameters = function () { return [
{ type: NgLocalization }
]; };
NgPlural.propDecorators = {
ngPlural: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
};
return NgPlural;
}());
/**
* @ngModule CommonModule
*
* @description
*
* Creates a view that will be added/removed from the parent {@link NgPlural} when the
* given expression matches the plural expression according to CLDR rules.
*
* @usageNotes
* ```
* <some-element [ngPlural]="value">
* <ng-template ngPluralCase="=0">...</ng-template>
* <ng-template ngPluralCase="other">...</ng-template>
* </some-element>
*```
*
* See {@link NgPlural} for more details and example.
*
* @experimental
*/
var NgPluralCase = /** @class */ (function () {
function NgPluralCase(value, template, viewContainer, ngPlural) {
this.value = value;
var isANumber = !isNaN(Number(value));
ngPlural.addCase(isANumber ? "=" + value : value, new SwitchView(viewContainer, template));
}
NgPluralCase.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[ngPluralCase]' },] }
];
/** @nocollapse */
NgPluralCase.ctorParameters = function () { return [
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Attribute"], args: ['ngPluralCase',] }] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] },
{ type: NgPlural, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }] }
]; };
return NgPluralCase;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @ngModule CommonModule
*
* @usageNotes
* ```
* <some-element [ngStyle]="{'font-style': styleExp}">...</some-element>
*
* <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element>
*
* <some-element [ngStyle]="objExp">...</some-element>
* ```
*
* @description
*
* Update an HTML element styles.
*
* The styles are updated according to the value of the expression evaluation:
* - keys are style names with an optional `.<unit>` suffix (ie 'top.px', 'font-style.em'),
* - values are the values assigned to those properties (expressed in the given unit).
*
*
*/
var NgStyle = /** @class */ (function () {
function NgStyle(_differs, _ngEl, _renderer) {
this._differs = _differs;
this._ngEl = _ngEl;
this._renderer = _renderer;
}
Object.defineProperty(NgStyle.prototype, "ngStyle", {
set: function (v) {
this._ngStyle = v;
if (!this._differ && v) {
this._differ = this._differs.find(v).create();
}
},
enumerable: true,
configurable: true
});
NgStyle.prototype.ngDoCheck = function () {
if (this._differ) {
var changes = this._differ.diff(this._ngStyle);
if (changes) {
this._applyChanges(changes);
}
}
};
NgStyle.prototype._applyChanges = function (changes) {
var _this = this;
changes.forEachRemovedItem(function (record) { return _this._setStyle(record.key, null); });
changes.forEachAddedItem(function (record) { return _this._setStyle(record.key, record.currentValue); });
changes.forEachChangedItem(function (record) { return _this._setStyle(record.key, record.currentValue); });
};
NgStyle.prototype._setStyle = function (nameAndUnit, value) {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__read"])(nameAndUnit.split('.'), 2), name = _a[0], unit = _a[1];
value = value != null && unit ? "" + value + unit : value;
if (value != null) {
this._renderer.setStyle(this._ngEl.nativeElement, name, value);
}
else {
this._renderer.removeStyle(this._ngEl.nativeElement, name);
}
};
NgStyle.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[ngStyle]' },] }
];
/** @nocollapse */
NgStyle.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }
]; };
NgStyle.propDecorators = {
ngStyle: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
};
return NgStyle;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @ngModule CommonModule
*
* @usageNotes
* ```
* <ng-container *ngTemplateOutlet="templateRefExp; context: contextExp"></ng-container>
* ```
*
* @description
*
* Inserts an embedded view from a prepared `TemplateRef`.
*
* You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.
* `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding
* by the local template `let` declarations.
*
* Note: using the key `$implicit` in the context object will set its value as default.
*
* ## Example
*
* {@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}
*
*
*/
var NgTemplateOutlet = /** @class */ (function () {
function NgTemplateOutlet(_viewContainerRef) {
this._viewContainerRef = _viewContainerRef;
}
NgTemplateOutlet.prototype.ngOnChanges = function (changes) {
var recreateView = this._shouldRecreateView(changes);
if (recreateView) {
if (this._viewRef) {
this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._viewRef));
}
if (this.ngTemplateOutlet) {
this._viewRef = this._viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, this.ngTemplateOutletContext);
}
}
else {
if (this._viewRef && this.ngTemplateOutletContext) {
this._updateExistingContext(this.ngTemplateOutletContext);
}
}
};
/**
* We need to re-create existing embedded view if:
* - templateRef has changed
* - context has changes
*
* We mark context object as changed when the corresponding object
* shape changes (new properties are added or existing properties are removed).
* In other words we consider context with the same properties as "the same" even
* if object reference changes (see https://github.com/angular/angular/issues/13407).
*/
NgTemplateOutlet.prototype._shouldRecreateView = function (changes) {
var ctxChange = changes['ngTemplateOutletContext'];
return !!changes['ngTemplateOutlet'] || (ctxChange && this._hasContextShapeChanged(ctxChange));
};
NgTemplateOutlet.prototype._hasContextShapeChanged = function (ctxChange) {
var prevCtxKeys = Object.keys(ctxChange.previousValue || {});
var currCtxKeys = Object.keys(ctxChange.currentValue || {});
if (prevCtxKeys.length === currCtxKeys.length) {
try {
for (var currCtxKeys_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__values"])(currCtxKeys), currCtxKeys_1_1 = currCtxKeys_1.next(); !currCtxKeys_1_1.done; currCtxKeys_1_1 = currCtxKeys_1.next()) {
var propName = currCtxKeys_1_1.value;
if (prevCtxKeys.indexOf(propName) === -1) {
return true;
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (currCtxKeys_1_1 && !currCtxKeys_1_1.done && (_a = currCtxKeys_1.return)) _a.call(currCtxKeys_1);
}
finally { if (e_1) throw e_1.error; }
}
return false;
}
else {
return true;
}
var e_1, _a;
};
NgTemplateOutlet.prototype._updateExistingContext = function (ctx) {
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__values"])(Object.keys(ctx)), _b = _a.next(); !_b.done; _b = _a.next()) {
var propName = _b.value;
this._viewRef.context[propName] = this.ngTemplateOutletContext[propName];
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_2) throw e_2.error; }
}
var e_2, _c;
};
NgTemplateOutlet.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[ngTemplateOutlet]' },] }
];
/** @nocollapse */
NgTemplateOutlet.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }
]; };
NgTemplateOutlet.propDecorators = {
ngTemplateOutletContext: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
ngTemplateOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
};
return NgTemplateOutlet;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A collection of Angular directives that are likely to be used in each and every Angular
* application.
*/
var COMMON_DIRECTIVES = [
NgClass,
NgComponentOutlet,
NgForOf,
NgIf,
NgTemplateOutlet,
NgStyle,
NgSwitch,
NgSwitchCase,
NgSwitchDefault,
NgPlural,
NgPluralCase,
];
/**
* @license
* Copyright Google Inc. 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
*/
function invalidPipeArgumentError(type, value) {
return Error("InvalidPipeArgument: '" + value + "' for pipe '" + Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(type) + "'");
}
var NumberFormatter = /** @class */ (function () {
function NumberFormatter() {
}
NumberFormatter.format = function (num, locale, style, opts) {
if (opts === void 0) { opts = {}; }
var minimumIntegerDigits = opts.minimumIntegerDigits, minimumFractionDigits = opts.minimumFractionDigits, maximumFractionDigits = opts.maximumFractionDigits, currency = opts.currency, _a = opts.currencyAsSymbol, currencyAsSymbol = _a === void 0 ? false : _a;
var options = {
minimumIntegerDigits: minimumIntegerDigits,
minimumFractionDigits: minimumFractionDigits,
maximumFractionDigits: maximumFractionDigits,
style: NumberFormatStyle[style].toLowerCase()
};
if (style == NumberFormatStyle.Currency) {
options.currency = typeof currency == 'string' ? currency : undefined;
options.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code';
}
return new Intl.NumberFormat(locale, options).format(num);
};
return NumberFormatter;
}());
var DATE_FORMATS_SPLIT$1 = /((?:[^yMLdHhmsazZEwGjJ']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|J+|j+|m+|s+|a|z|Z|G+|w+))(.*)/;
var PATTERN_ALIASES = {
// Keys are quoted so they do not get renamed during closure compilation.
'yMMMdjms': datePartGetterFactory(combine([
digitCondition('year', 1),
nameCondition('month', 3),
digitCondition('day', 1),
digitCondition('hour', 1),
digitCondition('minute', 1),
digitCondition('second', 1),
])),
'yMdjm': datePartGetterFactory(combine([
digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1),
digitCondition('hour', 1), digitCondition('minute', 1)
])),
'yMMMMEEEEd': datePartGetterFactory(combine([
digitCondition('year', 1), nameCondition('month', 4), nameCondition('weekday', 4),
digitCondition('day', 1)
])),
'yMMMMd': datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 4), digitCondition('day', 1)])),
'yMMMd': datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 3), digitCondition('day', 1)])),
'yMd': datePartGetterFactory(combine([digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1)])),
'jms': datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('second', 1), digitCondition('minute', 1)])),
'jm': datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('minute', 1)]))
};
var DATE_FORMATS$1 = {
// Keys are quoted so they do not get renamed.
'yyyy': datePartGetterFactory(digitCondition('year', 4)),
'yy': datePartGetterFactory(digitCondition('year', 2)),
'y': datePartGetterFactory(digitCondition('year', 1)),
'MMMM': datePartGetterFactory(nameCondition('month', 4)),
'MMM': datePartGetterFactory(nameCondition('month', 3)),
'MM': datePartGetterFactory(digitCondition('month', 2)),
'M': datePartGetterFactory(digitCondition('month', 1)),
'LLLL': datePartGetterFactory(nameCondition('month', 4)),
'L': datePartGetterFactory(nameCondition('month', 1)),
'dd': datePartGetterFactory(digitCondition('day', 2)),
'd': datePartGetterFactory(digitCondition('day', 1)),
'HH': digitModifier(hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), false)))),
'H': hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), false))),
'hh': digitModifier(hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), true)))),
'h': hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),
'jj': datePartGetterFactory(digitCondition('hour', 2)),
'j': datePartGetterFactory(digitCondition('hour', 1)),
'mm': digitModifier(datePartGetterFactory(digitCondition('minute', 2))),
'm': datePartGetterFactory(digitCondition('minute', 1)),
'ss': digitModifier(datePartGetterFactory(digitCondition('second', 2))),
's': datePartGetterFactory(digitCondition('second', 1)),
// while ISO 8601 requires fractions to be prefixed with `.` or `,`
// we can be just safely rely on using `sss` since we currently don't support single or two digit
// fractions
'sss': datePartGetterFactory(digitCondition('second', 3)),
'EEEE': datePartGetterFactory(nameCondition('weekday', 4)),
'EEE': datePartGetterFactory(nameCondition('weekday', 3)),
'EE': datePartGetterFactory(nameCondition('weekday', 2)),
'E': datePartGetterFactory(nameCondition('weekday', 1)),
'a': hourClockExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),
'Z': timeZoneGetter$1('short'),
'z': timeZoneGetter$1('long'),
'ww': datePartGetterFactory({}),
// first Thursday of the year. not support ?
'w': datePartGetterFactory({}),
// of the year not support ?
'G': datePartGetterFactory(nameCondition('era', 1)),
'GG': datePartGetterFactory(nameCondition('era', 2)),
'GGG': datePartGetterFactory(nameCondition('era', 3)),
'GGGG': datePartGetterFactory(nameCondition('era', 4))
};
function digitModifier(inner) {
return function (date, locale) {
var result = inner(date, locale);
return result.length == 1 ? '0' + result : result;
};
}
function hourClockExtractor(inner) {
return function (date, locale) { return inner(date, locale).split(' ')[1]; };
}
function hourExtractor(inner) {
return function (date, locale) { return inner(date, locale).split(' ')[0]; };
}
function intlDateFormat(date, locale, options) {
return new Intl.DateTimeFormat(locale, options).format(date).replace(/[\u200e\u200f]/g, '');
}
function timeZoneGetter$1(timezone) {
// To workaround `Intl` API restriction for single timezone let format with 24 hours
var options = { hour: '2-digit', hour12: false, timeZoneName: timezone };
return function (date, locale) {
var result = intlDateFormat(date, locale, options);
// Then extract first 3 letters that related to hours
return result ? result.substring(3) : '';
};
}
function hour12Modify(options, value) {
options.hour12 = value;
return options;
}
function digitCondition(prop, len) {
var result = {};
result[prop] = len === 2 ? '2-digit' : 'numeric';
return result;
}
function nameCondition(prop, len) {
var result = {};
if (len < 4) {
result[prop] = len > 1 ? 'short' : 'narrow';
}
else {
result[prop] = 'long';
}
return result;
}
function combine(options) {
return options.reduce(function (merged, opt) { return (Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__assign"])({}, merged, opt)); }, {});
}
function datePartGetterFactory(ret) {
return function (date, locale) { return intlDateFormat(date, locale, ret); };
}
var DATE_FORMATTER_CACHE = new Map();
function dateFormatter(format, date, locale) {
var fn = PATTERN_ALIASES[format];
if (fn)
return fn(date, locale);
var cacheKey = format;
var parts = DATE_FORMATTER_CACHE.get(cacheKey);
if (!parts) {
parts = [];
var match = void 0;
DATE_FORMATS_SPLIT$1.exec(format);
var _format = format;
while (_format) {
match = DATE_FORMATS_SPLIT$1.exec(_format);
if (match) {
parts = parts.concat(match.slice(1));
_format = parts.pop();
}
else {
parts.push(_format);
_format = null;
}
}
DATE_FORMATTER_CACHE.set(cacheKey, parts);
}
return parts.reduce(function (text, part) {
var fn = DATE_FORMATS$1[part];
return text + (fn ? fn(date, locale) : partToTime(part));
}, '');
}
function partToTime(part) {
return part === '\'\'' ? '\'' : part.replace(/(^'|'$)/g, '').replace(/''/g, '\'');
}
var DateFormatter = /** @class */ (function () {
function DateFormatter() {
}
DateFormatter.format = function (date, locale, pattern) {
return dateFormatter(pattern, date, locale);
};
return DateFormatter;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @ngModule CommonModule
* @description
*
* Formats a date according to locale rules.
*
* Where:
* - `expression` is a date object or a number (milliseconds since UTC epoch) or an ISO string
* (https://www.w3.org/TR/NOTE-datetime).
* - `format` indicates which date/time components to include. The format can be predefined as
* shown below or custom as shown in the table.
* - `'medium'`: equivalent to `'yMMMdjms'` (e.g. `Sep 3, 2010, 12:05:08 PM` for `en-US`)
* - `'short'`: equivalent to `'yMdjm'` (e.g. `9/3/2010, 12:05 PM` for `en-US`)
* - `'fullDate'`: equivalent to `'yMMMMEEEEd'` (e.g. `Friday, September 3, 2010` for `en-US`)
* - `'longDate'`: equivalent to `'yMMMMd'` (e.g. `September 3, 2010` for `en-US`)
* - `'mediumDate'`: equivalent to `'yMMMd'` (e.g. `Sep 3, 2010` for `en-US`)
* - `'shortDate'`: equivalent to `'yMd'` (e.g. `9/3/2010` for `en-US`)
* - `'mediumTime'`: equivalent to `'jms'` (e.g. `12:05:08 PM` for `en-US`)
* - `'shortTime'`: equivalent to `'jm'` (e.g. `12:05 PM` for `en-US`)
*
*
* | Component | Symbol | Narrow | Short Form | Long Form | Numeric | 2-digit |
* |-----------|:------:|--------|--------------|-------------------|-----------|-----------|
* | era | G | G (A) | GGG (AD) | GGGG (Anno Domini)| - | - |
* | year | y | - | - | - | y (2015) | yy (15) |
* | month | M | L (S) | MMM (Sep) | MMMM (September) | M (9) | MM (09) |
* | day | d | - | - | - | d (3) | dd (03) |
* | weekday | E | E (S) | EEE (Sun) | EEEE (Sunday) | - | - |
* | hour | j | - | - | - | j (13) | jj (13) |
* | hour12 | h | - | - | - | h (1 PM) | hh (01 PM)|
* | hour24 | H | - | - | - | H (13) | HH (13) |
* | minute | m | - | - | - | m (5) | mm (05) |
* | second | s | - | - | - | s (9) | ss (09) |
* | timezone | z | - | - | z (Pacific Standard Time)| - | - |
* | timezone | Z | - | Z (GMT-8:00) | - | - | - |
* | timezone | a | - | a (PM) | - | - | - |
*
* In javascript, only the components specified will be respected (not the ordering,
* punctuations, ...) and details of the formatting will be dependent on the locale.
*
* Timezone of the formatted text will be the local system timezone of the end-user's machine.
*
* When the expression is a ISO string without time (e.g. 2016-09-19) the time zone offset is not
* applied and the formatted text will have the same day, month and year of the expression.
*
* WARNINGS:
* - this pipe is marked as pure hence it will not be re-evaluated when the input is mutated.
* Instead users should treat the date as an immutable object and change the reference when the
* pipe needs to re-run (this is to avoid reformatting the date on every change detection run
* which would be an expensive operation).
* - this pipe uses the Internationalization API. Therefore it is only reliable in Chrome and Opera
* browsers.
*
* ### Examples
*
* Assuming `dateObj` is (year: 2010, month: 9, day: 3, hour: 12 PM, minute: 05, second: 08)
* in the _local_ time and locale is 'en-US':
*
* {@example common/pipes/ts/date_pipe.ts region='DeprecatedDatePipe'}
*
*
*/
var DeprecatedDatePipe = /** @class */ (function () {
function DeprecatedDatePipe(_locale) {
this._locale = _locale;
}
DeprecatedDatePipe.prototype.transform = function (value, pattern) {
if (pattern === void 0) { pattern = 'mediumDate'; }
if (value == null || value === '' || value !== value)
return null;
var date;
if (typeof value === 'string') {
value = value.trim();
}
if (isDate$1(value)) {
date = value;
}
else if (!isNaN(value - parseFloat(value))) {
date = new Date(parseFloat(value));
}
else if (typeof value === 'string' && /^(\d{4}-\d{1,2}-\d{1,2})$/.test(value)) {
/**
* For ISO Strings without time the day, month and year must be extracted from the ISO String
* before Date creation to avoid time offset and errors in the new Date.
* If we only replace '-' with ',' in the ISO String ("2015,01,01"), and try to create a new
* date, some browsers (e.g. IE 9) will throw an invalid Date error
* If we leave the '-' ("2015-01-01") and try to create a new Date("2015-01-01") the
* timeoffset
* is applied
* Note: ISO months are 0 for January, 1 for February, ...
*/
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__read"])(value.split('-').map(function (val) { return parseInt(val, 10); }), 3), y = _a[0], m = _a[1], d = _a[2];
date = new Date(y, m - 1, d);
}
else {
date = new Date(value);
}
if (!isDate$1(date)) {
var match = void 0;
if ((typeof value === 'string') && (match = value.match(ISO8601_DATE_REGEX))) {
date = isoStringToDate(match);
}
else {
throw invalidPipeArgumentError(DeprecatedDatePipe, value);
}
}
return DateFormatter.format(date, this._locale, DeprecatedDatePipe._ALIASES[pattern] || pattern);
};
/** @internal */
DeprecatedDatePipe._ALIASES = {
'medium': 'yMMMdjms',
'short': 'yMdjm',
'fullDate': 'yMMMMEEEEd',
'longDate': 'yMMMMd',
'mediumDate': 'yMMMd',
'shortDate': 'yMd',
'mediumTime': 'jms',
'shortTime': 'jm'
};
DeprecatedDatePipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'date', pure: true },] }
];
/** @nocollapse */
DeprecatedDatePipe.ctorParameters = function () { return [
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }
]; };
return DeprecatedDatePipe;
}());
function isDate$1(value) {
return value instanceof Date && !isNaN(value.valueOf());
}
/**
* @license
* Copyright Google Inc. 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
*/
function formatNumber$1(pipe, locale, value, style, digits, currency, currencyAsSymbol) {
if (currency === void 0) { currency = null; }
if (currencyAsSymbol === void 0) { currencyAsSymbol = false; }
if (value == null)
return null;
// Convert strings to numbers
value = typeof value === 'string' && !isNaN(+value - parseFloat(value)) ? +value : value;
if (typeof value !== 'number') {
throw invalidPipeArgumentError(pipe, value);
}
var minInt;
var minFraction;
var maxFraction;
if (style !== NumberFormatStyle.Currency) {
// rely on Intl default for currency
minInt = 1;
minFraction = 0;
maxFraction = 3;
}
if (digits) {
var parts = digits.match(NUMBER_FORMAT_REGEXP);
if (parts === null) {
throw new Error(digits + " is not a valid digit info for number pipes");
}
if (parts[1] != null) {
minInt = parseIntAutoRadix(parts[1]);
}
if (parts[3] != null) {
minFraction = parseIntAutoRadix(parts[3]);
}
if (parts[5] != null) {
maxFraction = parseIntAutoRadix(parts[5]);
}
}
return NumberFormatter.format(value, locale, style, {
minimumIntegerDigits: minInt,
minimumFractionDigits: minFraction,
maximumFractionDigits: maxFraction,
currency: currency,
currencyAsSymbol: currencyAsSymbol,
});
}
/**
* @ngModule CommonModule
*
* Formats a number as text. Group sizing and separator and other locale-specific
* configurations are based on the active locale.
*
* where `expression` is a number:
* - `digitInfo` is a `string` which has a following format: <br>
* <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>
* - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`.
* - `minFractionDigits` is the minimum number of digits after fraction. Defaults to `0`.
* - `maxFractionDigits` is the maximum number of digits after fraction. Defaults to `3`.
*
* For more information on the acceptable range for each of these numbers and other
* details see your native internationalization library.
*
* WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
* and may require a polyfill. See [Browser Support](guide/browser-support) for details.
*
* ### Example
*
* {@example common/pipes/ts/number_pipe.ts region='DeprecatedNumberPipe'}
*
*
*/
var DeprecatedDecimalPipe = /** @class */ (function () {
function DeprecatedDecimalPipe(_locale) {
this._locale = _locale;
}
DeprecatedDecimalPipe.prototype.transform = function (value, digits) {
return formatNumber$1(DeprecatedDecimalPipe, this._locale, value, NumberFormatStyle.Decimal, digits);
};
DeprecatedDecimalPipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'number' },] }
];
/** @nocollapse */
DeprecatedDecimalPipe.ctorParameters = function () { return [
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }
]; };
return DeprecatedDecimalPipe;
}());
/**
* @ngModule CommonModule
*
* @description
*
* Formats a number as percentage according to locale rules.
*
* - `digitInfo` See {@link DecimalPipe} for detailed description.
*
* WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
* and may require a polyfill. See [Browser Support](guide/browser-support) for details.
*
* ### Example
*
* {@example common/pipes/ts/percent_pipe.ts region='DeprecatedPercentPipe'}
*
*
*/
var DeprecatedPercentPipe = /** @class */ (function () {
function DeprecatedPercentPipe(_locale) {
this._locale = _locale;
}
DeprecatedPercentPipe.prototype.transform = function (value, digits) {
return formatNumber$1(DeprecatedPercentPipe, this._locale, value, NumberFormatStyle.Percent, digits);
};
DeprecatedPercentPipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'percent' },] }
];
/** @nocollapse */
DeprecatedPercentPipe.ctorParameters = function () { return [
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }
]; };
return DeprecatedPercentPipe;
}());
/**
* @ngModule CommonModule
* @description
*
* Formats a number as currency using locale rules.
*
* Use `currency` to format a number as currency.
*
* - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such
* as `USD` for the US dollar and `EUR` for the euro.
* - `symbolDisplay` is a boolean indicating whether to use the currency symbol or code.
* - `true`: use symbol (e.g. `$`).
* - `false`(default): use code (e.g. `USD`).
* - `digitInfo` See {@link DecimalPipe} for detailed description.
*
* WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
* and may require a polyfill. See [Browser Support](guide/browser-support) for details.
*
* ### Example
*
* {@example common/pipes/ts/currency_pipe.ts region='DeprecatedCurrencyPipe'}
*
*
*/
var DeprecatedCurrencyPipe = /** @class */ (function () {
function DeprecatedCurrencyPipe(_locale) {
this._locale = _locale;
}
DeprecatedCurrencyPipe.prototype.transform = function (value, currencyCode, symbolDisplay, digits) {
if (currencyCode === void 0) { currencyCode = 'USD'; }
if (symbolDisplay === void 0) { symbolDisplay = false; }
return formatNumber$1(DeprecatedCurrencyPipe, this._locale, value, NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay);
};
DeprecatedCurrencyPipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'currency' },] }
];
/** @nocollapse */
DeprecatedCurrencyPipe.ctorParameters = function () { return [
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }
]; };
return DeprecatedCurrencyPipe;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A collection of deprecated i18n pipes that require intl api
*
* @deprecated from v5
*/
var COMMON_DEPRECATED_I18N_PIPES = [DeprecatedDecimalPipe, DeprecatedPercentPipe, DeprecatedCurrencyPipe, DeprecatedDatePipe];
/**
* @license
* Copyright Google Inc. 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 ObservableStrategy = /** @class */ (function () {
function ObservableStrategy() {
}
ObservableStrategy.prototype.createSubscription = function (async, updateLatestValue) {
return async.subscribe({ next: updateLatestValue, error: function (e) { throw e; } });
};
ObservableStrategy.prototype.dispose = function (subscription) { subscription.unsubscribe(); };
ObservableStrategy.prototype.onDestroy = function (subscription) { subscription.unsubscribe(); };
return ObservableStrategy;
}());
var PromiseStrategy = /** @class */ (function () {
function PromiseStrategy() {
}
PromiseStrategy.prototype.createSubscription = function (async, updateLatestValue) {
return async.then(updateLatestValue, function (e) { throw e; });
};
PromiseStrategy.prototype.dispose = function (subscription) { };
PromiseStrategy.prototype.onDestroy = function (subscription) { };
return PromiseStrategy;
}());
var _promiseStrategy = new PromiseStrategy();
var _observableStrategy = new ObservableStrategy();
/**
* @ngModule CommonModule
* @description
*
* Unwraps a value from an asynchronous primitive.
*
* The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has
* emitted. When a new value is emitted, the `async` pipe marks the component to be checked for
* changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid
* potential memory leaks.
*
*
* ## Examples
*
* This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the
* promise.
*
* {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}
*
* It's also possible to use `async` with Observables. The example below binds the `time` Observable
* to the view. The Observable continuously updates the view with the current time.
*
* {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
*
*
*/
var AsyncPipe = /** @class */ (function () {
function AsyncPipe(_ref) {
this._ref = _ref;
this._latestValue = null;
this._latestReturnedValue = null;
this._subscription = null;
this._obj = null;
this._strategy = null;
}
AsyncPipe.prototype.ngOnDestroy = function () {
if (this._subscription) {
this._dispose();
}
};
AsyncPipe.prototype.transform = function (obj) {
if (!this._obj) {
if (obj) {
this._subscribe(obj);
}
this._latestReturnedValue = this._latestValue;
return this._latestValue;
}
if (obj !== this._obj) {
this._dispose();
return this.transform(obj);
}
if (this._latestValue === this._latestReturnedValue) {
return this._latestReturnedValue;
}
this._latestReturnedValue = this._latestValue;
return _angular_core__WEBPACK_IMPORTED_MODULE_0__["WrappedValue"].wrap(this._latestValue);
};
AsyncPipe.prototype._subscribe = function (obj) {
var _this = this;
this._obj = obj;
this._strategy = this._selectStrategy(obj);
this._subscription = this._strategy.createSubscription(obj, function (value) { return _this._updateLatestValue(obj, value); });
};
AsyncPipe.prototype._selectStrategy = function (obj) {
if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisPromise"])(obj)) {
return _promiseStrategy;
}
if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisObservable"])(obj)) {
return _observableStrategy;
}
throw invalidPipeArgumentError(AsyncPipe, obj);
};
AsyncPipe.prototype._dispose = function () {
this._strategy.dispose(this._subscription);
this._latestValue = null;
this._latestReturnedValue = null;
this._subscription = null;
this._obj = null;
};
AsyncPipe.prototype._updateLatestValue = function (async, value) {
if (async === this._obj) {
this._latestValue = value;
this._ref.markForCheck();
}
};
AsyncPipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'async', pure: false },] }
];
/** @nocollapse */
AsyncPipe.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"] }
]; };
return AsyncPipe;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Transforms text to all lower case.
*
* @see `UpperCasePipe`
* @see `TitleCasePipe`
* @usageNotes
*
* The following example defines a view that allows the user to enter
* text, and then uses the pipe to convert the input text to all lower case.
*
* <code-example path="common/pipes/ts/lowerupper_pipe.ts" region='LowerUpperPipe'></code-example>
*
*
*/
var LowerCasePipe = /** @class */ (function () {
function LowerCasePipe() {
}
/**
* @param value The string to transform to lower case.
*/
LowerCasePipe.prototype.transform = function (value) {
if (!value)
return value;
if (typeof value !== 'string') {
throw invalidPipeArgumentError(LowerCasePipe, value);
}
return value.toLowerCase();
};
LowerCasePipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'lowercase' },] }
];
return LowerCasePipe;
}());
//
// Regex below matches any Unicode word and compatible with ES5. In ES2018 the same result
// can be achieved by using /\p{L}\S*/gu and also known as Unicode Property Escapes
// (http://2ality.com/2017/07/regexp-unicode-property-escapes.html). Since there is no
// transpilation of this functionality down to ES5 without external tool, the only solution is
// to use already transpiled form. Example can be found here -
// https://mothereff.in/regexpu#input=var+regex+%3D+/%5Cp%7BL%7D/u%3B&unicodePropertyEscape=1
//
var unicodeWordMatch = /(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])\S*/g;
/**
* Transforms text to title case.
* Capitalizes the first letter of each word, and transforms the
* rest of the word to lower case.
* Words are delimited by any whitespace character, such as a space, tab, or line-feed character.
*
* @see `LowerCasePipe`
* @see `UpperCasePipe`
*
* @usageNotes
* The following example shows the result of transforming various strings into title case.
*
* <code-example path="common/pipes/ts/titlecase_pipe.ts" region='TitleCasePipe'></code-example>
*
*
*/
var TitleCasePipe = /** @class */ (function () {
function TitleCasePipe() {
}
/**
* @param value The string to transform to title case.
*/
TitleCasePipe.prototype.transform = function (value) {
if (!value)
return value;
if (typeof value !== 'string') {
throw invalidPipeArgumentError(TitleCasePipe, value);
}
return value.replace(unicodeWordMatch, (function (txt) { return txt[0].toUpperCase() + txt.substr(1).toLowerCase(); }));
};
TitleCasePipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'titlecase' },] }
];
return TitleCasePipe;
}());
/**
* Transforms text to all upper case.
* @see `LowerCasePipe`
* @see `TitleCasePipe`
*/
var UpperCasePipe = /** @class */ (function () {
function UpperCasePipe() {
}
/**
* @param value The string to transform to upper case.
*/
UpperCasePipe.prototype.transform = function (value) {
if (!value)
return value;
if (typeof value !== 'string') {
throw invalidPipeArgumentError(UpperCasePipe, value);
}
return value.toUpperCase();
};
UpperCasePipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'uppercase' },] }
];
return UpperCasePipe;
}());
/**
* @license
* Copyright Google Inc. 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
*/
// clang-format off
/**
* @ngModule CommonModule
* @description
*
* Formats a date value according to locale rules.
*
* Only the `en-US` locale data comes with Angular. To localize dates
* in another language, you must import the corresponding locale data.
* See the [I18n guide](guide/i18n#i18n-pipes) for more information.
*
* @see `formatDate()`
*
*
* @usageNotes
*
* The result of this pipe is not reevaluated when the input is mutated. To avoid the need to
* reformat the date on every change-detection cycle, treat the date as an immutable object
* and change the reference when the pipe needs to run again.
*
* ### Pre-defined format options
*
* Examples are given in `en-US` locale.
*
* - `'short'`: equivalent to `'M/d/yy, h:mm a'` (`6/15/15, 9:03 AM`).
* - `'medium'`: equivalent to `'MMM d, y, h:mm:ss a'` (`Jun 15, 2015, 9:03:01 AM`).
* - `'long'`: equivalent to `'MMMM d, y, h:mm:ss a z'` (`June 15, 2015 at 9:03:01 AM
* GMT+1`).
* - `'full'`: equivalent to `'EEEE, MMMM d, y, h:mm:ss a zzzz'` (`Monday, June 15, 2015 at
* 9:03:01 AM GMT+01:00`).
* - `'shortDate'`: equivalent to `'M/d/yy'` (`6/15/15`).
* - `'mediumDate'`: equivalent to `'MMM d, y'` (`Jun 15, 2015`).
* - `'longDate'`: equivalent to `'MMMM d, y'` (`June 15, 2015`).
* - `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` (`Monday, June 15, 2015`).
* - `'shortTime'`: equivalent to `'h:mm a'` (`9:03 AM`).
* - `'mediumTime'`: equivalent to `'h:mm:ss a'` (`9:03:01 AM`).
* - `'longTime'`: equivalent to `'h:mm:ss a z'` (`9:03:01 AM GMT+1`).
* - `'fullTime'`: equivalent to `'h:mm:ss a zzzz'` (`9:03:01 AM GMT+01:00`).
*
* ### Custom format options
*
* You can construct a format string using symbols to specify the components
* of a date-time value, as described in the following table.
* Format details depend on the locale.
* Fields marked with (*) are only available in the extra data set for the given locale.
*
* | Field type | Format | Description | Example Value |
* |--------------------|-------------|---------------------------------------------------------------|------------------------------------------------------------|
* | Era | G, GG & GGG | Abbreviated | AD |
* | | GGGG | Wide | Anno Domini |
* | | GGGGG | Narrow | A |
* | Year | y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |
* | | yy | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |
* | | yyy | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |
* | | yyyy | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |
* | Month | M | Numeric: 1 digit | 9, 12 |
* | | MM | Numeric: 2 digits + zero padded | 09, 12 |
* | | MMM | Abbreviated | Sep |
* | | MMMM | Wide | September |
* | | MMMMM | Narrow | S |
* | Month standalone | L | Numeric: 1 digit | 9, 12 |
* | | LL | Numeric: 2 digits + zero padded | 09, 12 |
* | | LLL | Abbreviated | Sep |
* | | LLLL | Wide | September |
* | | LLLLL | Narrow | S |
* | Week of year | w | Numeric: minimum digits | 1... 53 |
* | | ww | Numeric: 2 digits + zero padded | 01... 53 |
* | Week of month | W | Numeric: 1 digit | 1... 5 |
* | Day of month | d | Numeric: minimum digits | 1 |
* | | dd | Numeric: 2 digits + zero padded | 01 |
* | Week day | E, EE & EEE | Abbreviated | Tue |
* | | EEEE | Wide | Tuesday |
* | | EEEEE | Narrow | T |
* | | EEEEEE | Short | Tu |
* | Period | a, aa & aaa | Abbreviated | am/pm or AM/PM |
* | | aaaa | Wide (fallback to `a` when missing) | ante meridiem/post meridiem |
* | | aaaaa | Narrow | a/p |
* | Period* | B, BB & BBB | Abbreviated | mid. |
* | | BBBB | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |
* | | BBBBB | Narrow | md |
* | Period standalone* | b, bb & bbb | Abbreviated | mid. |
* | | bbbb | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |
* | | bbbbb | Narrow | md |
* | Hour 1-12 | h | Numeric: minimum digits | 1, 12 |
* | | hh | Numeric: 2 digits + zero padded | 01, 12 |
* | Hour 0-23 | H | Numeric: minimum digits | 0, 23 |
* | | HH | Numeric: 2 digits + zero padded | 00, 23 |
* | Minute | m | Numeric: minimum digits | 8, 59 |
* | | mm | Numeric: 2 digits + zero padded | 08, 59 |
* | Second | s | Numeric: minimum digits | 0... 59 |
* | | ss | Numeric: 2 digits + zero padded | 00... 59 |
* | Fractional seconds | S | Numeric: 1 digit | 0... 9 |
* | | SS | Numeric: 2 digits + zero padded | 00... 99 |
* | | SSS | Numeric: 3 digits + zero padded (= milliseconds) | 000... 999 |
* | Zone | z, zz & zzz | Short specific non location format (fallback to O) | GMT-8 |
* | | zzzz | Long specific non location format (fallback to OOOO) | GMT-08:00 |
* | | Z, ZZ & ZZZ | ISO8601 basic format | -0800 |
* | | ZZZZ | Long localized GMT format | GMT-8:00 |
* | | ZZZZZ | ISO8601 extended format + Z indicator for offset 0 (= XXXXX) | -08:00 |
* | | O, OO & OOO | Short localized GMT format | GMT-8 |
* | | OOOO | Long localized GMT format | GMT-08:00 |
*
* Note that timezone correction is not applied to an ISO string that has no time component, such as "2016-09-19"
*
* ### Format examples
*
* These examples transform a date into various formats,
* assuming that `dateObj` is a JavaScript `Date` object for
* year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11,
* given in the local time for the `en-US` locale.
*
* ```
* {{ dateObj | date }} // output is 'Jun 15, 2015'
* {{ dateObj | date:'medium' }} // output is 'Jun 15, 2015, 9:43:11 PM'
* {{ dateObj | date:'shortTime' }} // output is '9:43 PM'
* {{ dateObj | date:'mmss' }} // output is '43:11'
* ```
*
* ### Usage example
*
* The following component uses a date pipe to display the current date in different formats.
*
* ```
* @Component({
* selector: 'date-pipe',
* template: `<div>
* <p>Today is {{today | date}}</p>
* <p>Or if you prefer, {{today | date:'fullDate'}}</p>
* <p>The time is {{today | date:'h:mm a z'}}</p>
* </div>`
* })
* // Get the current date and time as a date-time value.
* export class DatePipeComponent {
* today: number = Date.now();
* }
* ```
*
*/
// clang-format on
var DatePipe = /** @class */ (function () {
function DatePipe(locale) {
this.locale = locale;
}
/**
* @param value The date expression: a `Date` object, a number
* (milliseconds since UTC epoch), or an ISO string (https://www.w3.org/TR/NOTE-datetime).
* @param format The date/time components to include, using predefined options or a
* custom format string.
* @param timezone A timezone offset (such as `'+0430'`), or a standard
* UTC/GMT or continental US timezone abbreviation. Default is
* the local system timezone of the end-user's machine.
* @param locale A locale code for the locale format rules to use.
* When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
* See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app).
* @returns A date string in the desired format.
*/
DatePipe.prototype.transform = function (value, format, timezone, locale) {
if (format === void 0) { format = 'mediumDate'; }
if (value == null || value === '' || value !== value)
return null;
try {
return formatDate(value, format, locale || this.locale, timezone);
}
catch (error) {
throw invalidPipeArgumentError(DatePipe, error.message);
}
};
DatePipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'date', pure: true },] }
];
/** @nocollapse */
DatePipe.ctorParameters = function () { return [
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }
]; };
return DatePipe;
}());
/**
* @license
* Copyright Google Inc. 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 _INTERPOLATION_REGEXP = /#/g;
/**
* @ngModule CommonModule
* @description
*
* Maps a value to a string that pluralizes the value according to locale rules.
*
* ## Example
*
* {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}
*
* @experimental
*/
var I18nPluralPipe = /** @class */ (function () {
function I18nPluralPipe(_localization) {
this._localization = _localization;
}
/**
* @param value the number to be formatted
* @param pluralMap an object that mimics the ICU format, see
* http://userguide.icu-project.org/formatparse/messages.
* @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
* default).
*/
I18nPluralPipe.prototype.transform = function (value, pluralMap, locale) {
if (value == null)
return '';
if (typeof pluralMap !== 'object' || pluralMap === null) {
throw invalidPipeArgumentError(I18nPluralPipe, pluralMap);
}
var key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);
return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
};
I18nPluralPipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'i18nPlural', pure: true },] }
];
/** @nocollapse */
I18nPluralPipe.ctorParameters = function () { return [
{ type: NgLocalization }
]; };
return I18nPluralPipe;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @ngModule CommonModule
* @description
*
* Generic selector that displays the string that matches the current value.
*
* If none of the keys of the `mapping` match the `value`, then the content
* of the `other` key is returned when present, otherwise an empty string is returned.
*
* ## Example
*
* {@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}
*
* @experimental
*/
var I18nSelectPipe = /** @class */ (function () {
function I18nSelectPipe() {
}
/**
* @param value a string to be internationalized.
* @param mapping an object that indicates the text that should be displayed
* for different values of the provided `value`.
*/
I18nSelectPipe.prototype.transform = function (value, mapping) {
if (value == null)
return '';
if (typeof mapping !== 'object' || typeof value !== 'string') {
throw invalidPipeArgumentError(I18nSelectPipe, mapping);
}
if (mapping.hasOwnProperty(value)) {
return mapping[value];
}
if (mapping.hasOwnProperty('other')) {
return mapping['other'];
}
return '';
};
I18nSelectPipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'i18nSelect', pure: true },] }
];
return I18nSelectPipe;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @ngModule CommonModule
* @description
*
* Converts a value into its JSON-format representation. Useful for debugging.
*
* @usageNotes
*
* The following component uses a JSON pipe to convert an object
* to JSON format, and displays the string in both formats for comparison.
* {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}
*
*
*/
var JsonPipe = /** @class */ (function () {
function JsonPipe() {
}
/**
* @param value A value of any type to convert into a JSON-format string.
*/
JsonPipe.prototype.transform = function (value) { return JSON.stringify(value, null, 2); };
JsonPipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'json', pure: false },] }
];
return JsonPipe;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @ngModule CommonModule
* @description
*
* Transforms a number into a string,
* formatted according to locale rules that determine group sizing and
* separator, decimal-point character, and other locale-specific
* configurations.
*
* If no parameters are specified, the function rounds off to the nearest value using this
* [rounding method](https://en.wikibooks.org/wiki/Arithmetic/Rounding).
* The behavior differs from that of the JavaScript ```Math.round()``` function.
* In the following case for example, the pipe rounds down where
* ```Math.round()``` rounds up:
*
* ```html
* -2.5 | number:'1.0-0'
* > -3
* Math.round(-2.5)
* > -2
* ```
*
* @see `formatNumber()`
*
* @usageNotes
* The following code shows how the pipe transforms numbers
* into text strings, according to various format specifications,
* where the caller's default locale is `en-US`.
*
* ### Example
*
* <code-example path="common/pipes/ts/number_pipe.ts" region='NumberPipe'></code-example>
*
*
*/
var DecimalPipe = /** @class */ (function () {
function DecimalPipe(_locale) {
this._locale = _locale;
}
/**
* @param value The number to be formatted.
* @param digitsInfo Decimal representation options, specified by a string
* in the following format:<br>
* <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.
* - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
* Default is `1`.
* - `minFractionDigits`: The minimum number of digits after the decimal point.
* Default is `0`.
* - `maxFractionDigits`: The maximum number of digits after the decimal point.
* Default is `3`.
* @param locale A locale code for the locale format rules to use.
* When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
* See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app).
*/
DecimalPipe.prototype.transform = function (value, digitsInfo, locale) {
if (isEmpty(value))
return null;
locale = locale || this._locale;
try {
var num = strToNumber(value);
return formatNumber(num, locale, digitsInfo);
}
catch (error) {
throw invalidPipeArgumentError(DecimalPipe, error.message);
}
};
DecimalPipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'number' },] }
];
/** @nocollapse */
DecimalPipe.ctorParameters = function () { return [
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }
]; };
return DecimalPipe;
}());
/**
* @ngModule CommonModule
* @description
*
* Transforms a number to a percentage
* string, formatted according to locale rules that determine group sizing and
* separator, decimal-point character, and other locale-specific
* configurations.
*
* @see `formatPercent()`
*
* @usageNotes
* The following code shows how the pipe transforms numbers
* into text strings, according to various format specifications,
* where the caller's default locale is `en-US`.
*
* <code-example path="common/pipes/ts/percent_pipe.ts" region='PercentPipe'></code-example>
*
*
*/
var PercentPipe = /** @class */ (function () {
function PercentPipe(_locale) {
this._locale = _locale;
}
/**
*
* @param value The number to be formatted as a percentage.
* @param digitsInfo Decimal representation options, specified by a string
* in the following format:<br>
* <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.
* - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
* Default is `1`.
* - `minFractionDigits`: The minimum number of digits after the decimal point.
* Default is `0`.
* - `maxFractionDigits`: The maximum number of digits after the decimal point.
* Default is `3`.
* @param locale A locale code for the locale format rules to use.
* When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
* See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app).
*/
PercentPipe.prototype.transform = function (value, digitsInfo, locale) {
if (isEmpty(value))
return null;
locale = locale || this._locale;
try {
var num = strToNumber(value);
return formatPercent(num, locale, digitsInfo);
}
catch (error) {
throw invalidPipeArgumentError(PercentPipe, error.message);
}
};
PercentPipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'percent' },] }
];
/** @nocollapse */
PercentPipe.ctorParameters = function () { return [
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }
]; };
return PercentPipe;
}());
/**
* @ngModule CommonModule
* @description
*
* Transforms a number to a currency string, formatted according to locale rules
* that determine group sizing and separator, decimal-point character,
* and other locale-specific configurations.
*
* @see `getCurrencySymbol()`
* @see `formatCurrency()`
*
* @usageNotes
* The following code shows how the pipe transforms numbers
* into text strings, according to various format specifications,
* where the caller's default locale is `en-US`.
*
* <code-example path="common/pipes/ts/currency_pipe.ts" region='CurrencyPipe'></code-example>
*
*
*/
var CurrencyPipe = /** @class */ (function () {
function CurrencyPipe(_locale) {
this._locale = _locale;
}
/**
*
* @param value The number to be formatted as currency.
* @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code,
* such as `USD` for the US dollar and `EUR` for the euro.
* @param display The format for the currency indicator. One of the following:
* - `code`: Show the code (such as `USD`).
* - `symbol`(default): Show the symbol (such as `$`).
* - `symbol-narrow`: Use the narrow symbol for locales that have two symbols for their
* currency.
* For example, the Canadian dollar CAD has the symbol `CA$` and the symbol-narrow `$`. If the
* locale has no narrow symbol, uses the standard symbol for the locale.
* - String: Use the given string value instead of a code or a symbol.
* - Boolean (marked deprecated in v5): `true` for symbol and false for `code`.
*
* @param digitsInfo Decimal representation options, specified by a string
* in the following format:<br>
* <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.
* - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
* Default is `1`.
* - `minFractionDigits`: The minimum number of digits after the decimal point.
* Default is `0`.
* - `maxFractionDigits`: The maximum number of digits after the decimal point.
* Default is `3`.
* @param locale A locale code for the locale format rules to use.
* When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
* See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app).
*/
CurrencyPipe.prototype.transform = function (value, currencyCode, display, digitsInfo, locale) {
if (display === void 0) { display = 'symbol'; }
if (isEmpty(value))
return null;
locale = locale || this._locale;
if (typeof display === 'boolean') {
if (console && console.warn) {
console.warn("Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are \"code\", \"symbol\" or \"symbol-narrow\".");
}
display = display ? 'symbol' : 'code';
}
var currency = currencyCode || 'USD';
if (display !== 'code') {
if (display === 'symbol' || display === 'symbol-narrow') {
currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow', locale);
}
else {
currency = display;
}
}
try {
var num = strToNumber(value);
return formatCurrency(num, locale, currency, currencyCode, digitsInfo);
}
catch (error) {
throw invalidPipeArgumentError(CurrencyPipe, error.message);
}
};
CurrencyPipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'currency' },] }
];
/** @nocollapse */
CurrencyPipe.ctorParameters = function () { return [
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }
]; };
return CurrencyPipe;
}());
function isEmpty(value) {
return value == null || value === '' || value !== value;
}
/**
* Transforms a string into a number (if needed).
*/
function strToNumber(value) {
// Convert strings to numbers
if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) {
return Number(value);
}
if (typeof value !== 'number') {
throw new Error(value + " is not a number");
}
return value;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @ngModule CommonModule
* @description
*
* Creates a new `Array` or `String` containing a subset (slice) of the elements.
*
* All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`
* and `String.prototype.slice()`.
*
* When operating on an `Array`, the returned `Array` is always a copy even when all
* the elements are being returned.
*
* When operating on a blank value, the pipe returns the blank value.
*
* ### List Example
*
* This `ngFor` example:
*
* {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}
*
* produces the following:
*
* <li>b</li>
* <li>c</li>
*
* ## String Examples
*
* {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}
*
*
*/
var SlicePipe = /** @class */ (function () {
function SlicePipe() {
}
/**
* @param value a list or a string to be sliced.
* @param start the starting index of the subset to return:
* - **a positive integer**: return the item at `start` index and all items after
* in the list or string expression.
* - **a negative integer**: return the item at `start` index from the end and all items after
* in the list or string expression.
* - **if positive and greater than the size of the expression**: return an empty list or
* string.
* - **if negative and greater than the size of the expression**: return entire list or string.
* @param end the ending index of the subset to return:
* - **omitted**: return all items until the end.
* - **if positive**: return all items before `end` index of the list or string.
* - **if negative**: return all items before `end` index from the end of the list or string.
*/
SlicePipe.prototype.transform = function (value, start, end) {
if (value == null)
return value;
if (!this.supports(value)) {
throw invalidPipeArgumentError(SlicePipe, value);
}
return value.slice(start, end);
};
SlicePipe.prototype.supports = function (obj) { return typeof obj === 'string' || Array.isArray(obj); };
SlicePipe.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], args: [{ name: 'slice', pure: false },] }
];
return SlicePipe;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A collection of Angular pipes that are likely to be used in each and every application.
*/
var COMMON_PIPES = [
AsyncPipe,
UpperCasePipe,
LowerCasePipe,
JsonPipe,
SlicePipe,
DecimalPipe,
PercentPipe,
TitleCasePipe,
CurrencyPipe,
DatePipe,
I18nPluralPipe,
I18nSelectPipe,
];
/**
* @license
* Copyright Google Inc. 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
*/
// Note: This does not contain the location providers,
// as they need some platform specific implementations to work.
/**
* The module that includes all the basic Angular directives like {@link NgIf}, {@link NgForOf}, ...
*
*
*/
var CommonModule = /** @class */ (function () {
function CommonModule() {
}
CommonModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
declarations: [COMMON_DIRECTIVES, COMMON_PIPES],
exports: [COMMON_DIRECTIVES, COMMON_PIPES],
providers: [
{ provide: NgLocalization, useClass: NgLocaleLocalization },
],
},] }
];
return CommonModule;
}());
var ɵ0 = getPluralCase;
/**
* A module that contains the deprecated i18n pipes.
*
* @deprecated from v5
*/
var DeprecatedI18NPipesModule = /** @class */ (function () {
function DeprecatedI18NPipesModule() {
}
DeprecatedI18NPipesModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
declarations: [COMMON_DEPRECATED_I18N_PIPES],
exports: [COMMON_DEPRECATED_I18N_PIPES],
providers: [{ provide: DEPRECATED_PLURAL_FN, useValue: ɵ0 }],
},] }
];
return DeprecatedI18NPipesModule;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A DI Token representing the main rendering context. In a browser this is the DOM Document.
*
* Note: Document might not be available in the Application Context when Application and Rendering
* Contexts are not the same (e.g. when running the application into a Web Worker).
*
*
*/
var DOCUMENT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('DocumentToken');
/**
* @license
* Copyright Google Inc. 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 PLATFORM_BROWSER_ID = 'browser';
var PLATFORM_SERVER_ID = 'server';
var PLATFORM_WORKER_APP_ID = 'browserWorkerApp';
var PLATFORM_WORKER_UI_ID = 'browserWorkerUi';
/**
* Returns whether a platform id represents a browser platform.
* @experimental
*/
function isPlatformBrowser(platformId) {
return platformId === PLATFORM_BROWSER_ID;
}
/**
* Returns whether a platform id represents a server platform.
* @experimental
*/
function isPlatformServer(platformId) {
return platformId === PLATFORM_SERVER_ID;
}
/**
* Returns whether a platform id represents a web worker app platform.
* @experimental
*/
function isPlatformWorkerApp(platformId) {
return platformId === PLATFORM_WORKER_APP_ID;
}
/**
* Returns whether a platform id represents a web worker UI platform.
* @experimental
*/
function isPlatformWorkerUi(platformId) {
return platformId === PLATFORM_WORKER_UI_ID;
}
/**
* @license
* Copyright Google Inc. 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 VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Version"]('6.0.9');
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
// This file only reexports content of the `src` folder. Keep it that way.
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Generated bundle index. Do not edit.
*/
//# sourceMappingURL=common.js.map
/***/ }),
/***/ "./node_modules/@angular/common/fesm5/http.js":
/*!****************************************************!*\
!*** ./node_modules/@angular/common/fesm5/http.js ***!
\****************************************************/
/*! exports provided: ɵangular_packages_common_http_http_a, ɵangular_packages_common_http_http_b, ɵangular_packages_common_http_http_c, ɵangular_packages_common_http_http_d, ɵangular_packages_common_http_http_g, ɵangular_packages_common_http_http_h, ɵangular_packages_common_http_http_e, ɵangular_packages_common_http_http_f, HttpBackend, HttpHandler, HttpClient, HttpHeaders, HTTP_INTERCEPTORS, JsonpClientBackend, JsonpInterceptor, HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, ɵHttpInterceptingHandler, HttpParams, HttpUrlEncodingCodec, HttpRequest, HttpErrorResponse, HttpEventType, HttpHeaderResponse, HttpResponse, HttpResponseBase, HttpXhrBackend, XhrFactory, HttpXsrfTokenExtractor */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_a", function() { return NoopInterceptor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_b", function() { return JsonpCallbackContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_c", function() { return jsonpCallbackContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_d", function() { return BrowserXhr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_g", function() { return HttpXsrfCookieExtractor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_h", function() { return HttpXsrfInterceptor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_e", function() { return XSRF_COOKIE_NAME; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_f", function() { return XSRF_HEADER_NAME; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpBackend", function() { return HttpBackend; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpHandler", function() { return HttpHandler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpClient", function() { return HttpClient; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpHeaders", function() { return HttpHeaders; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HTTP_INTERCEPTORS", function() { return HTTP_INTERCEPTORS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonpClientBackend", function() { return JsonpClientBackend; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonpInterceptor", function() { return JsonpInterceptor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpClientJsonpModule", function() { return HttpClientJsonpModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpClientModule", function() { return HttpClientModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpClientXsrfModule", function() { return HttpClientXsrfModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵHttpInterceptingHandler", function() { return HttpInterceptingHandler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpParams", function() { return HttpParams; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpUrlEncodingCodec", function() { return HttpUrlEncodingCodec; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpRequest", function() { return HttpRequest; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpErrorResponse", function() { return HttpErrorResponse; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpEventType", function() { return HttpEventType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpHeaderResponse", function() { return HttpHeaderResponse; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpResponse", function() { return HttpResponse; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpResponseBase", function() { return HttpResponseBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpXhrBackend", function() { return HttpXhrBackend; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XhrFactory", function() { return XhrFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpXsrfTokenExtractor", function() { return HttpXsrfTokenExtractor; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @license Angular v6.0.9
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a
* `HttpResponse`.
*
* `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the
* first interceptor in the chain, which dispatches to the second, etc, eventually reaching the
* `HttpBackend`.
*
* In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.
*
*
*/
var HttpHandler = /** @class */ (function () {
function HttpHandler() {
}
return HttpHandler;
}());
/**
* A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.
*
* Interceptors sit between the `HttpClient` interface and the `HttpBackend`.
*
* When injected, `HttpBackend` dispatches requests directly to the backend, without going
* through the interceptor chain.
*
*
*/
var HttpBackend = /** @class */ (function () {
function HttpBackend() {
}
return HttpBackend;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Immutable set of Http headers, with lazy parsing.
*
*/
var HttpHeaders = /** @class */ (function () {
function HttpHeaders(headers) {
var _this = this;
/**
* Internal map of lowercased header names to the normalized
* form of the name (the form seen first).
*/
this.normalizedNames = new Map();
/**
* Queued updates to be materialized the next initialization.
*/
this.lazyUpdate = null;
if (!headers) {
this.headers = new Map();
}
else if (typeof headers === 'string') {
this.lazyInit = function () {
_this.headers = new Map();
headers.split('\n').forEach(function (line) {
var index = line.indexOf(':');
if (index > 0) {
var name_1 = line.slice(0, index);
var key = name_1.toLowerCase();
var value = line.slice(index + 1).trim();
_this.maybeSetNormalizedName(name_1, key);
if (_this.headers.has(key)) {
_this.headers.get(key).push(value);
}
else {
_this.headers.set(key, [value]);
}
}
});
};
}
else {
this.lazyInit = function () {
_this.headers = new Map();
Object.keys(headers).forEach(function (name) {
var values = headers[name];
var key = name.toLowerCase();
if (typeof values === 'string') {
values = [values];
}
if (values.length > 0) {
_this.headers.set(key, values);
_this.maybeSetNormalizedName(name, key);
}
});
};
}
}
/**
* Checks for existence of header by given name.
*/
HttpHeaders.prototype.has = function (name) {
this.init();
return this.headers.has(name.toLowerCase());
};
/**
* Returns first header that matches given name.
*/
HttpHeaders.prototype.get = function (name) {
this.init();
var values = this.headers.get(name.toLowerCase());
return values && values.length > 0 ? values[0] : null;
};
/**
* Returns the names of the headers
*/
HttpHeaders.prototype.keys = function () {
this.init();
return Array.from(this.normalizedNames.values());
};
/**
* Returns list of header values for a given name.
*/
HttpHeaders.prototype.getAll = function (name) {
this.init();
return this.headers.get(name.toLowerCase()) || null;
};
HttpHeaders.prototype.append = function (name, value) {
return this.clone({ name: name, value: value, op: 'a' });
};
HttpHeaders.prototype.set = function (name, value) {
return this.clone({ name: name, value: value, op: 's' });
};
HttpHeaders.prototype.delete = function (name, value) {
return this.clone({ name: name, value: value, op: 'd' });
};
HttpHeaders.prototype.maybeSetNormalizedName = function (name, lcName) {
if (!this.normalizedNames.has(lcName)) {
this.normalizedNames.set(lcName, name);
}
};
HttpHeaders.prototype.init = function () {
var _this = this;
if (!!this.lazyInit) {
if (this.lazyInit instanceof HttpHeaders) {
this.copyFrom(this.lazyInit);
}
else {
this.lazyInit();
}
this.lazyInit = null;
if (!!this.lazyUpdate) {
this.lazyUpdate.forEach(function (update) { return _this.applyUpdate(update); });
this.lazyUpdate = null;
}
}
};
HttpHeaders.prototype.copyFrom = function (other) {
var _this = this;
other.init();
Array.from(other.headers.keys()).forEach(function (key) {
_this.headers.set(key, other.headers.get(key));
_this.normalizedNames.set(key, other.normalizedNames.get(key));
});
};
HttpHeaders.prototype.clone = function (update) {
var clone = new HttpHeaders();
clone.lazyInit =
(!!this.lazyInit && this.lazyInit instanceof HttpHeaders) ? this.lazyInit : this;
clone.lazyUpdate = (this.lazyUpdate || []).concat([update]);
return clone;
};
HttpHeaders.prototype.applyUpdate = function (update) {
var key = update.name.toLowerCase();
switch (update.op) {
case 'a':
case 's':
var value = update.value;
if (typeof value === 'string') {
value = [value];
}
if (value.length === 0) {
return;
}
this.maybeSetNormalizedName(update.name, key);
var base = (update.op === 'a' ? this.headers.get(key) : undefined) || [];
base.push.apply(base, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(value));
this.headers.set(key, base);
break;
case 'd':
var toDelete_1 = update.value;
if (!toDelete_1) {
this.headers.delete(key);
this.normalizedNames.delete(key);
}
else {
var existing = this.headers.get(key);
if (!existing) {
return;
}
existing = existing.filter(function (value) { return toDelete_1.indexOf(value) === -1; });
if (existing.length === 0) {
this.headers.delete(key);
this.normalizedNames.delete(key);
}
else {
this.headers.set(key, existing);
}
}
break;
}
};
/**
* @internal
*/
HttpHeaders.prototype.forEach = function (fn) {
var _this = this;
this.init();
Array.from(this.normalizedNames.keys())
.forEach(function (key) { return fn(_this.normalizedNames.get(key), _this.headers.get(key)); });
};
return HttpHeaders;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to
* serialize and parse URL parameter keys and values.
*
*
*/
var HttpUrlEncodingCodec = /** @class */ (function () {
function HttpUrlEncodingCodec() {
}
HttpUrlEncodingCodec.prototype.encodeKey = function (k) { return standardEncoding(k); };
HttpUrlEncodingCodec.prototype.encodeValue = function (v) { return standardEncoding(v); };
HttpUrlEncodingCodec.prototype.decodeKey = function (k) { return decodeURIComponent(k); };
HttpUrlEncodingCodec.prototype.decodeValue = function (v) { return decodeURIComponent(v); };
return HttpUrlEncodingCodec;
}());
function paramParser(rawParams, codec) {
var map$$1 = new Map();
if (rawParams.length > 0) {
var params = rawParams.split('&');
params.forEach(function (param) {
var eqIdx = param.indexOf('=');
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(eqIdx == -1 ?
[codec.decodeKey(param), ''] :
[codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))], 2), key = _a[0], val = _a[1];
var list = map$$1.get(key) || [];
list.push(val);
map$$1.set(key, list);
});
}
return map$$1;
}
function standardEncoding(v) {
return encodeURIComponent(v)
.replace(/%40/gi, '@')
.replace(/%3A/gi, ':')
.replace(/%24/gi, '$')
.replace(/%2C/gi, ',')
.replace(/%3B/gi, ';')
.replace(/%2B/gi, '+')
.replace(/%3D/gi, '=')
.replace(/%3F/gi, '?')
.replace(/%2F/gi, '/');
}
/**
* An HTTP request/response body that represents serialized parameters,
* per the MIME type `application/x-www-form-urlencoded`.
*
* This class is immutable - all mutation operations return a new instance.
*
*
*/
var HttpParams = /** @class */ (function () {
function HttpParams(options) {
if (options === void 0) { options = {}; }
var _this = this;
this.updates = null;
this.cloneFrom = null;
this.encoder = options.encoder || new HttpUrlEncodingCodec();
if (!!options.fromString) {
if (!!options.fromObject) {
throw new Error("Cannot specify both fromString and fromObject.");
}
this.map = paramParser(options.fromString, this.encoder);
}
else if (!!options.fromObject) {
this.map = new Map();
Object.keys(options.fromObject).forEach(function (key) {
var value = options.fromObject[key];
_this.map.set(key, Array.isArray(value) ? value : [value]);
});
}
else {
this.map = null;
}
}
/**
* Check whether the body has one or more values for the given parameter name.
*/
HttpParams.prototype.has = function (param) {
this.init();
return this.map.has(param);
};
/**
* Get the first value for the given parameter name, or `null` if it's not present.
*/
HttpParams.prototype.get = function (param) {
this.init();
var res = this.map.get(param);
return !!res ? res[0] : null;
};
/**
* Get all values for the given parameter name, or `null` if it's not present.
*/
HttpParams.prototype.getAll = function (param) {
this.init();
return this.map.get(param) || null;
};
/**
* Get all the parameter names for this body.
*/
HttpParams.prototype.keys = function () {
this.init();
return Array.from(this.map.keys());
};
/**
* Construct a new body with an appended value for the given parameter name.
*/
HttpParams.prototype.append = function (param, value) { return this.clone({ param: param, value: value, op: 'a' }); };
/**
* Construct a new body with a new value for the given parameter name.
*/
HttpParams.prototype.set = function (param, value) { return this.clone({ param: param, value: value, op: 's' }); };
/**
* Construct a new body with either the given value for the given parameter
* removed, if a value is given, or all values for the given parameter removed
* if not.
*/
HttpParams.prototype.delete = function (param, value) { return this.clone({ param: param, value: value, op: 'd' }); };
/**
* Serialize the body to an encoded string, where key-value pairs (separated by `=`) are
* separated by `&`s.
*/
HttpParams.prototype.toString = function () {
var _this = this;
this.init();
return this.keys()
.map(function (key) {
var eKey = _this.encoder.encodeKey(key);
return _this.map.get(key).map(function (value) { return eKey + '=' + _this.encoder.encodeValue(value); })
.join('&');
})
.join('&');
};
HttpParams.prototype.clone = function (update) {
var clone = new HttpParams({ encoder: this.encoder });
clone.cloneFrom = this.cloneFrom || this;
clone.updates = (this.updates || []).concat([update]);
return clone;
};
HttpParams.prototype.init = function () {
var _this = this;
if (this.map === null) {
this.map = new Map();
}
if (this.cloneFrom !== null) {
this.cloneFrom.init();
this.cloneFrom.keys().forEach(function (key) { return _this.map.set(key, _this.cloneFrom.map.get(key)); });
this.updates.forEach(function (update) {
switch (update.op) {
case 'a':
case 's':
var base = (update.op === 'a' ? _this.map.get(update.param) : undefined) || [];
base.push(update.value);
_this.map.set(update.param, base);
break;
case 'd':
if (update.value !== undefined) {
var base_1 = _this.map.get(update.param) || [];
var idx = base_1.indexOf(update.value);
if (idx !== -1) {
base_1.splice(idx, 1);
}
if (base_1.length > 0) {
_this.map.set(update.param, base_1);
}
else {
_this.map.delete(update.param);
}
}
else {
_this.map.delete(update.param);
break;
}
}
});
this.cloneFrom = null;
}
};
return HttpParams;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Determine whether the given HTTP method may include a body.
*/
function mightHaveBody(method) {
switch (method) {
case 'DELETE':
case 'GET':
case 'HEAD':
case 'OPTIONS':
case 'JSONP':
return false;
default:
return true;
}
}
/**
* Safely assert whether the given value is an ArrayBuffer.
*
* In some execution environments ArrayBuffer is not defined.
*/
function isArrayBuffer(value) {
return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;
}
/**
* Safely assert whether the given value is a Blob.
*
* In some execution environments Blob is not defined.
*/
function isBlob(value) {
return typeof Blob !== 'undefined' && value instanceof Blob;
}
/**
* Safely assert whether the given value is a FormData instance.
*
* In some execution environments FormData is not defined.
*/
function isFormData(value) {
return typeof FormData !== 'undefined' && value instanceof FormData;
}
/**
* An outgoing HTTP request with an optional typed body.
*
* `HttpRequest` represents an outgoing request, including URL, method,
* headers, body, and other request configuration options. Instances should be
* assumed to be immutable. To modify a `HttpRequest`, the `clone`
* method should be used.
*
*
*/
var HttpRequest = /** @class */ (function () {
function HttpRequest(method, url, third, fourth) {
this.url = url;
/**
* The request body, or `null` if one isn't set.
*
* Bodies are not enforced to be immutable, as they can include a reference to any
* user-defined data type. However, interceptors should take care to preserve
* idempotence by treating them as such.
*/
this.body = null;
/**
* Whether this request should be made in a way that exposes progress events.
*
* Progress events are expensive (change detection runs on each event) and so
* they should only be requested if the consumer intends to monitor them.
*/
this.reportProgress = false;
/**
* Whether this request should be sent with outgoing credentials (cookies).
*/
this.withCredentials = false;
/**
* The expected response type of the server.
*
* This is used to parse the response appropriately before returning it to
* the requestee.
*/
this.responseType = 'json';
this.method = method.toUpperCase();
// Next, need to figure out which argument holds the HttpRequestInit
// options, if any.
var options;
// Check whether a body argument is expected. The only valid way to omit
// the body argument is to use a known no-body method like GET.
if (mightHaveBody(this.method) || !!fourth) {
// Body is the third argument, options are the fourth.
this.body = (third !== undefined) ? third : null;
options = fourth;
}
else {
// No body required, options are the third argument. The body stays null.
options = third;
}
// If options have been passed, interpret them.
if (options) {
// Normalize reportProgress and withCredentials.
this.reportProgress = !!options.reportProgress;
this.withCredentials = !!options.withCredentials;
// Override default response type of 'json' if one is provided.
if (!!options.responseType) {
this.responseType = options.responseType;
}
// Override headers if they're provided.
if (!!options.headers) {
this.headers = options.headers;
}
if (!!options.params) {
this.params = options.params;
}
}
// If no headers have been passed in, construct a new HttpHeaders instance.
if (!this.headers) {
this.headers = new HttpHeaders();
}
// If no parameters have been passed in, construct a new HttpUrlEncodedParams instance.
if (!this.params) {
this.params = new HttpParams();
this.urlWithParams = url;
}
else {
// Encode the parameters to a string in preparation for inclusion in the URL.
var params = this.params.toString();
if (params.length === 0) {
// No parameters, the visible URL is just the URL given at creation time.
this.urlWithParams = url;
}
else {
// Does the URL already have query parameters? Look for '?'.
var qIdx = url.indexOf('?');
// There are 3 cases to handle:
// 1) No existing parameters -> append '?' followed by params.
// 2) '?' exists and is followed by existing query string ->
// append '&' followed by params.
// 3) '?' exists at the end of the url -> append params directly.
// This basically amounts to determining the character, if any, with
// which to join the URL and parameters.
var sep = qIdx === -1 ? '?' : (qIdx < url.length - 1 ? '&' : '');
this.urlWithParams = url + sep + params;
}
}
}
/**
* Transform the free-form body into a serialized format suitable for
* transmission to the server.
*/
HttpRequest.prototype.serializeBody = function () {
// If no body is present, no need to serialize it.
if (this.body === null) {
return null;
}
// Check whether the body is already in a serialized form. If so,
// it can just be returned directly.
if (isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) ||
typeof this.body === 'string') {
return this.body;
}
// Check whether the body is an instance of HttpUrlEncodedParams.
if (this.body instanceof HttpParams) {
return this.body.toString();
}
// Check whether the body is an object or array, and serialize with JSON if so.
if (typeof this.body === 'object' || typeof this.body === 'boolean' ||
Array.isArray(this.body)) {
return JSON.stringify(this.body);
}
// Fall back on toString() for everything else.
return this.body.toString();
};
/**
* Examine the body and attempt to infer an appropriate MIME type
* for it.
*
* If no such type can be inferred, this method will return `null`.
*/
HttpRequest.prototype.detectContentTypeHeader = function () {
// An empty body has no content type.
if (this.body === null) {
return null;
}
// FormData bodies rely on the browser's content type assignment.
if (isFormData(this.body)) {
return null;
}
// Blobs usually have their own content type. If it doesn't, then
// no type can be inferred.
if (isBlob(this.body)) {
return this.body.type || null;
}
// Array buffers have unknown contents and thus no type can be inferred.
if (isArrayBuffer(this.body)) {
return null;
}
// Technically, strings could be a form of JSON data, but it's safe enough
// to assume they're plain strings.
if (typeof this.body === 'string') {
return 'text/plain';
}
// `HttpUrlEncodedParams` has its own content-type.
if (this.body instanceof HttpParams) {
return 'application/x-www-form-urlencoded;charset=UTF-8';
}
// Arrays, objects, and numbers will be encoded as JSON.
if (typeof this.body === 'object' || typeof this.body === 'number' ||
Array.isArray(this.body)) {
return 'application/json';
}
// No type could be inferred.
return null;
};
HttpRequest.prototype.clone = function (update) {
if (update === void 0) { update = {}; }
// For method, url, and responseType, take the current value unless
// it is overridden in the update hash.
var method = update.method || this.method;
var url = update.url || this.url;
var responseType = update.responseType || this.responseType;
// The body is somewhat special - a `null` value in update.body means
// whatever current body is present is being overridden with an empty
// body, whereas an `undefined` value in update.body implies no
// override.
var body = (update.body !== undefined) ? update.body : this.body;
// Carefully handle the boolean options to differentiate between
// `false` and `undefined` in the update args.
var withCredentials = (update.withCredentials !== undefined) ? update.withCredentials : this.withCredentials;
var reportProgress = (update.reportProgress !== undefined) ? update.reportProgress : this.reportProgress;
// Headers and params may be appended to if `setHeaders` or
// `setParams` are used.
var headers = update.headers || this.headers;
var params = update.params || this.params;
// Check whether the caller has asked to add headers.
if (update.setHeaders !== undefined) {
// Set every requested header.
headers =
Object.keys(update.setHeaders)
.reduce(function (headers, name) { return headers.set(name, update.setHeaders[name]); }, headers);
}
// Check whether the caller has asked to set params.
if (update.setParams) {
// Set every requested param.
params = Object.keys(update.setParams)
.reduce(function (params, param) { return params.set(param, update.setParams[param]); }, params);
}
// Finally, construct the new HttpRequest using the pieces from above.
return new HttpRequest(method, url, body, {
params: params, headers: headers, reportProgress: reportProgress, responseType: responseType, withCredentials: withCredentials,
});
};
return HttpRequest;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Type enumeration for the different kinds of `HttpEvent`.
*
*
*/
var HttpEventType;
(function (HttpEventType) {
/**
* The request was sent out over the wire.
*/
HttpEventType[HttpEventType["Sent"] = 0] = "Sent";
/**
* An upload progress event was received.
*/
HttpEventType[HttpEventType["UploadProgress"] = 1] = "UploadProgress";
/**
* The response status code and headers were received.
*/
HttpEventType[HttpEventType["ResponseHeader"] = 2] = "ResponseHeader";
/**
* A download progress event was received.
*/
HttpEventType[HttpEventType["DownloadProgress"] = 3] = "DownloadProgress";
/**
* The full response including the body was received.
*/
HttpEventType[HttpEventType["Response"] = 4] = "Response";
/**
* A custom event from an interceptor or a backend.
*/
HttpEventType[HttpEventType["User"] = 5] = "User";
})(HttpEventType || (HttpEventType = {}));
/**
* Base class for both `HttpResponse` and `HttpHeaderResponse`.
*
*
*/
var HttpResponseBase = /** @class */ (function () {
/**
* Super-constructor for all responses.
*
* The single parameter accepted is an initialization hash. Any properties
* of the response passed there will override the default values.
*/
function HttpResponseBase(init, defaultStatus, defaultStatusText) {
if (defaultStatus === void 0) { defaultStatus = 200; }
if (defaultStatusText === void 0) { defaultStatusText = 'OK'; }
// If the hash has values passed, use them to initialize the response.
// Otherwise use the default values.
this.headers = init.headers || new HttpHeaders();
this.status = init.status !== undefined ? init.status : defaultStatus;
this.statusText = init.statusText || defaultStatusText;
this.url = init.url || null;
// Cache the ok value to avoid defining a getter.
this.ok = this.status >= 200 && this.status < 300;
}
return HttpResponseBase;
}());
/**
* A partial HTTP response which only includes the status and header data,
* but no response body.
*
* `HttpHeaderResponse` is a `HttpEvent` available on the response
* event stream, only when progress events are requested.
*
*
*/
var HttpHeaderResponse = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(HttpHeaderResponse, _super);
/**
* Create a new `HttpHeaderResponse` with the given parameters.
*/
function HttpHeaderResponse(init) {
if (init === void 0) { init = {}; }
var _this = _super.call(this, init) || this;
_this.type = HttpEventType.ResponseHeader;
return _this;
}
/**
* Copy this `HttpHeaderResponse`, overriding its contents with the
* given parameter hash.
*/
HttpHeaderResponse.prototype.clone = function (update) {
if (update === void 0) { update = {}; }
// Perform a straightforward initialization of the new HttpHeaderResponse,
// overriding the current parameters with new ones if given.
return new HttpHeaderResponse({
headers: update.headers || this.headers,
status: update.status !== undefined ? update.status : this.status,
statusText: update.statusText || this.statusText,
url: update.url || this.url || undefined,
});
};
return HttpHeaderResponse;
}(HttpResponseBase));
/**
* A full HTTP response, including a typed response body (which may be `null`
* if one was not returned).
*
* `HttpResponse` is a `HttpEvent` available on the response event
* stream.
*
*
*/
var HttpResponse = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(HttpResponse, _super);
/**
* Construct a new `HttpResponse`.
*/
function HttpResponse(init) {
if (init === void 0) { init = {}; }
var _this = _super.call(this, init) || this;
_this.type = HttpEventType.Response;
_this.body = init.body !== undefined ? init.body : null;
return _this;
}
HttpResponse.prototype.clone = function (update) {
if (update === void 0) { update = {}; }
return new HttpResponse({
body: (update.body !== undefined) ? update.body : this.body,
headers: update.headers || this.headers,
status: (update.status !== undefined) ? update.status : this.status,
statusText: update.statusText || this.statusText,
url: update.url || this.url || undefined,
});
};
return HttpResponse;
}(HttpResponseBase));
/**
* A response that represents an error or failure, either from a
* non-successful HTTP status, an error while executing the request,
* or some other failure which occurred during the parsing of the response.
*
* Any error returned on the `Observable` response stream will be
* wrapped in an `HttpErrorResponse` to provide additional context about
* the state of the HTTP layer when the error occurred. The error property
* will contain either a wrapped Error object or the error response returned
* from the server.
*
*
*/
var HttpErrorResponse = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(HttpErrorResponse, _super);
function HttpErrorResponse(init) {
var _this =
// Initialize with a default status of 0 / Unknown Error.
_super.call(this, init, 0, 'Unknown Error') || this;
_this.name = 'HttpErrorResponse';
/**
* Errors are never okay, even when the status code is in the 2xx success range.
*/
_this.ok = false;
// If the response was successful, then this was a parse error. Otherwise, it was
// a protocol-level failure of some sort. Either the request failed in transit
// or the server returned an unsuccessful status code.
if (_this.status >= 200 && _this.status < 300) {
_this.message = "Http failure during parsing for " + (init.url || '(unknown url)');
}
else {
_this.message =
"Http failure response for " + (init.url || '(unknown url)') + ": " + init.status + " " + init.statusText;
}
_this.error = init.error || null;
return _this;
}
return HttpErrorResponse;
}(HttpResponseBase));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Construct an instance of `HttpRequestOptions<T>` from a source `HttpMethodOptions` and
* the given `body`. Basically, this clones the object and adds the body.
*/
function addBody(options, body) {
return {
body: body,
headers: options.headers,
observe: options.observe,
params: options.params,
reportProgress: options.reportProgress,
responseType: options.responseType,
withCredentials: options.withCredentials,
};
}
/**
* Perform HTTP requests.
*
* `HttpClient` is available as an injectable class, with methods to perform HTTP requests.
* Each request method has multiple signatures, and the return type varies according to which
* signature is called (mainly the values of `observe` and `responseType`).
*
*
*/
var HttpClient = /** @class */ (function () {
function HttpClient(handler) {
this.handler = handler;
}
/**
* Constructs an `Observable` for a particular HTTP request that, when subscribed,
* fires the request through the chain of registered interceptors and on to the
* server.
*
* This method can be called in one of two ways. Either an `HttpRequest`
* instance can be passed directly as the only parameter, or a method can be
* passed as the first parameter, a string URL as the second, and an
* options hash as the third.
*
* If a `HttpRequest` object is passed directly, an `Observable` of the
* raw `HttpEvent` stream will be returned.
*
* If a request is instead built by providing a URL, the options object
* determines the return type of `request()`. In addition to configuring
* request parameters such as the outgoing headers and/or the body, the options
* hash specifies two key pieces of information about the request: the
* `responseType` and what to `observe`.
*
* The `responseType` value determines how a successful response body will be
* parsed. If `responseType` is the default `json`, a type interface for the
* resulting object may be passed as a type parameter to `request()`.
*
* The `observe` value determines the return type of `request()`, based on what
* the consumer is interested in observing. A value of `events` will return an
* `Observable<HttpEvent>` representing the raw `HttpEvent` stream,
* including progress events by default. A value of `response` will return an
* `Observable<HttpResponse<T>>` where the `T` parameter of `HttpResponse`
* depends on the `responseType` and any optionally provided type parameter.
* A value of `body` will return an `Observable<T>` with the same `T` body type.
*/
HttpClient.prototype.request = function (first, url, options) {
var _this = this;
if (options === void 0) { options = {}; }
var req;
// Firstly, check whether the primary argument is an instance of `HttpRequest`.
if (first instanceof HttpRequest) {
// It is. The other arguments must be undefined (per the signatures) and can be
// ignored.
req = first;
}
else {
// It's a string, so it represents a URL. Construct a request based on it,
// and incorporate the remaining arguments (assuming GET unless a method is
// provided.
// Figure out the headers.
var headers = undefined;
if (options.headers instanceof HttpHeaders) {
headers = options.headers;
}
else {
headers = new HttpHeaders(options.headers);
}
// Sort out parameters.
var params = undefined;
if (!!options.params) {
if (options.params instanceof HttpParams) {
params = options.params;
}
else {
params = new HttpParams({ fromObject: options.params });
}
}
// Construct the request.
req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), {
headers: headers,
params: params,
reportProgress: options.reportProgress,
// By default, JSON is assumed to be returned for all calls.
responseType: options.responseType || 'json',
withCredentials: options.withCredentials,
});
}
// Start with an Observable.of() the initial request, and run the handler (which
// includes all interceptors) inside a concatMap(). This way, the handler runs
// inside an Observable chain, which causes interceptors to be re-run on every
// subscription (this also makes retries re-run the handler, including interceptors).
var events$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(req).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["concatMap"])(function (req) { return _this.handler.handle(req); }));
// If coming via the API signature which accepts a previously constructed HttpRequest,
// the only option is to get the event stream. Otherwise, return the event stream if
// that is what was requested.
if (first instanceof HttpRequest || options.observe === 'events') {
return events$;
}
// The requested stream contains either the full response or the body. In either
// case, the first step is to filter the event stream to extract a stream of
// responses(s).
var res$ = events$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])(function (event) { return event instanceof HttpResponse; }));
// Decide which stream to return.
switch (options.observe || 'body') {
case 'body':
// The requested stream is the body. Map the response stream to the response
// body. This could be done more simply, but a misbehaving interceptor might
// transform the response body into a different format and ignore the requested
// responseType. Guard against this by validating that the response is of the
// requested type.
switch (req.responseType) {
case 'arraybuffer':
return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (res) {
// Validate that the body is an ArrayBuffer.
if (res.body !== null && !(res.body instanceof ArrayBuffer)) {
throw new Error('Response is not an ArrayBuffer.');
}
return res.body;
}));
case 'blob':
return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (res) {
// Validate that the body is a Blob.
if (res.body !== null && !(res.body instanceof Blob)) {
throw new Error('Response is not a Blob.');
}
return res.body;
}));
case 'text':
return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (res) {
// Validate that the body is a string.
if (res.body !== null && typeof res.body !== 'string') {
throw new Error('Response is not a string.');
}
return res.body;
}));
case 'json':
default:
// No validation needed for JSON responses, as they can be of any type.
return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (res) { return res.body; }));
}
case 'response':
// The response stream was requested directly, so return it.
return res$;
default:
// Guard against new future observe types being added.
throw new Error("Unreachable: unhandled observe type " + options.observe + "}");
}
};
/**
* Constructs an `Observable` which, when subscribed, will cause the configured
* DELETE request to be executed on the server. See the individual overloads for
* details of `delete()`'s return type based on the provided options.
*/
HttpClient.prototype.delete = function (url, options) {
if (options === void 0) { options = {}; }
return this.request('DELETE', url, options);
};
/**
* Constructs an `Observable` which, when subscribed, will cause the configured
* GET request to be executed on the server. See the individual overloads for
* details of `get()`'s return type based on the provided options.
*/
HttpClient.prototype.get = function (url, options) {
if (options === void 0) { options = {}; }
return this.request('GET', url, options);
};
/**
* Constructs an `Observable` which, when subscribed, will cause the configured
* HEAD request to be executed on the server. See the individual overloads for
* details of `head()`'s return type based on the provided options.
*/
HttpClient.prototype.head = function (url, options) {
if (options === void 0) { options = {}; }
return this.request('HEAD', url, options);
};
/**
* Constructs an `Observable` which, when subscribed, will cause a request
* with the special method `JSONP` to be dispatched via the interceptor pipeline.
*
* A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).
* If no such interceptor is reached, then the `JSONP` request will likely be
* rejected by the configured backend.
*/
HttpClient.prototype.jsonp = function (url, callbackParam) {
return this.request('JSONP', url, {
params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),
observe: 'body',
responseType: 'json',
});
};
/**
* Constructs an `Observable` which, when subscribed, will cause the configured
* OPTIONS request to be executed on the server. See the individual overloads for
* details of `options()`'s return type based on the provided options.
*/
HttpClient.prototype.options = function (url, options) {
if (options === void 0) { options = {}; }
return this.request('OPTIONS', url, options);
};
/**
* Constructs an `Observable` which, when subscribed, will cause the configured
* PATCH request to be executed on the server. See the individual overloads for
* details of `patch()`'s return type based on the provided options.
*/
HttpClient.prototype.patch = function (url, body, options) {
if (options === void 0) { options = {}; }
return this.request('PATCH', url, addBody(options, body));
};
/**
* Constructs an `Observable` which, when subscribed, will cause the configured
* POST request to be executed on the server. See the individual overloads for
* details of `post()`'s return type based on the provided options.
*/
HttpClient.prototype.post = function (url, body, options) {
if (options === void 0) { options = {}; }
return this.request('POST', url, addBody(options, body));
};
/**
* Constructs an `Observable` which, when subscribed, will cause the configured
* PUT request to be executed on the server. See the individual overloads for
* details of `put()`'s return type based on the provided options.
*/
HttpClient.prototype.put = function (url, body, options) {
if (options === void 0) { options = {}; }
return this.request('PUT', url, addBody(options, body));
};
HttpClient.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
/** @nocollapse */
HttpClient.ctorParameters = function () { return [
{ type: HttpHandler }
]; };
return HttpClient;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.
*
*
*/
var HttpInterceptorHandler = /** @class */ (function () {
function HttpInterceptorHandler(next, interceptor) {
this.next = next;
this.interceptor = interceptor;
}
HttpInterceptorHandler.prototype.handle = function (req) {
return this.interceptor.intercept(req, this.next);
};
return HttpInterceptorHandler;
}());
/**
* A multi-provider token which represents the array of `HttpInterceptor`s that
* are registered.
*
*
*/
var HTTP_INTERCEPTORS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('HTTP_INTERCEPTORS');
var NoopInterceptor = /** @class */ (function () {
function NoopInterceptor() {
}
NoopInterceptor.prototype.intercept = function (req, next) {
return next.handle(req);
};
NoopInterceptor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
return NoopInterceptor;
}());
/**
* @license
* Copyright Google Inc. 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
*/
// Every request made through JSONP needs a callback name that's unique across the
// whole page. Each request is assigned an id and the callback name is constructed
// from that. The next id to be assigned is tracked in a global variable here that
// is shared among all applications on the page.
var nextRequestId = 0;
// Error text given when a JSONP script is injected, but doesn't invoke the callback
// passed in its URL.
var JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.';
// Error text given when a request is passed to the JsonpClientBackend that doesn't
// have a request method JSONP.
var JSONP_ERR_WRONG_METHOD = 'JSONP requests must use JSONP request method.';
var JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json response type.';
/**
* DI token/abstract type representing a map of JSONP callbacks.
*
* In the browser, this should always be the `window` object.
*
*
*/
var JsonpCallbackContext = /** @class */ (function () {
function JsonpCallbackContext() {
}
return JsonpCallbackContext;
}());
/**
* `HttpBackend` that only processes `HttpRequest` with the JSONP method,
* by performing JSONP style requests.
*
*
*/
var JsonpClientBackend = /** @class */ (function () {
function JsonpClientBackend(callbackMap, document) {
this.callbackMap = callbackMap;
this.document = document;
}
/**
* Get the name of the next callback method, by incrementing the global `nextRequestId`.
*/
JsonpClientBackend.prototype.nextCallback = function () { return "ng_jsonp_callback_" + nextRequestId++; };
/**
* Process a JSONP request and return an event stream of the results.
*/
JsonpClientBackend.prototype.handle = function (req) {
var _this = this;
// Firstly, check both the method and response type. If either doesn't match
// then the request was improperly routed here and cannot be handled.
if (req.method !== 'JSONP') {
throw new Error(JSONP_ERR_WRONG_METHOD);
}
else if (req.responseType !== 'json') {
throw new Error(JSONP_ERR_WRONG_RESPONSE_TYPE);
}
// Everything else happens inside the Observable boundary.
return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](function (observer) {
// The first step to make a request is to generate the callback name, and replace the
// callback placeholder in the URL with the name. Care has to be taken here to ensure
// a trailing &, if matched, gets inserted back into the URL in the correct place.
var callback = _this.nextCallback();
var url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, "=" + callback + "$1");
// Construct the <script> tag and point it at the URL.
var node = _this.document.createElement('script');
node.src = url;
// A JSONP request requires waiting for multiple callbacks. These variables
// are closed over and track state across those callbacks.
// The response object, if one has been received, or null otherwise.
var body = null;
// Whether the response callback has been called.
var finished = false;
// Whether the request has been cancelled (and thus any other callbacks)
// should be ignored.
var cancelled = false;
// Set the response callback in this.callbackMap (which will be the window
// object in the browser. The script being loaded via the <script> tag will
// eventually call this callback.
_this.callbackMap[callback] = function (data) {
// Data has been received from the JSONP script. Firstly, delete this callback.
delete _this.callbackMap[callback];
// Next, make sure the request wasn't cancelled in the meantime.
if (cancelled) {
return;
}
// Set state to indicate data was received.
body = data;
finished = true;
};
// cleanup() is a utility closure that removes the <script> from the page and
// the response callback from the window. This logic is used in both the
// success, error, and cancellation paths, so it's extracted out for convenience.
var cleanup = function () {
// Remove the <script> tag if it's still on the page.
if (node.parentNode) {
node.parentNode.removeChild(node);
}
// Remove the response callback from the callbackMap (window object in the
// browser).
delete _this.callbackMap[callback];
};
// onLoad() is the success callback which runs after the response callback
// if the JSONP script loads successfully. The event itself is unimportant.
// If something went wrong, onLoad() may run without the response callback
// having been invoked.
var onLoad = function (event) {
// Do nothing if the request has been cancelled.
if (cancelled) {
return;
}
// Cleanup the page.
cleanup();
// Check whether the response callback has run.
if (!finished) {
// It hasn't, something went wrong with the request. Return an error via
// the Observable error path. All JSONP errors have status 0.
observer.error(new HttpErrorResponse({
url: url,
status: 0,
statusText: 'JSONP Error',
error: new Error(JSONP_ERR_NO_CALLBACK),
}));
return;
}
// Success. body either contains the response body or null if none was
// returned.
observer.next(new HttpResponse({
body: body,
status: 200,
statusText: 'OK', url: url,
}));
// Complete the stream, the response is over.
observer.complete();
};
// onError() is the error callback, which runs if the script returned generates
// a Javascript error. It emits the error via the Observable error channel as
// a HttpErrorResponse.
var onError = function (error) {
// If the request was already cancelled, no need to emit anything.
if (cancelled) {
return;
}
cleanup();
// Wrap the error in a HttpErrorResponse.
observer.error(new HttpErrorResponse({
error: error,
status: 0,
statusText: 'JSONP Error', url: url,
}));
};
// Subscribe to both the success (load) and error events on the <script> tag,
// and add it to the page.
node.addEventListener('load', onLoad);
node.addEventListener('error', onError);
_this.document.body.appendChild(node);
// The request has now been successfully sent.
observer.next({ type: HttpEventType.Sent });
// Cancellation handler.
return function () {
// Track the cancellation so event listeners won't do anything even if already scheduled.
cancelled = true;
// Remove the event listeners so they won't run if the events later fire.
node.removeEventListener('load', onLoad);
node.removeEventListener('error', onError);
// And finally, clean up the page.
cleanup();
};
});
};
JsonpClientBackend.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
/** @nocollapse */
JsonpClientBackend.ctorParameters = function () { return [
{ type: JsonpCallbackContext },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_4__["DOCUMENT"],] }] }
]; };
return JsonpClientBackend;
}());
/**
* An `HttpInterceptor` which identifies requests with the method JSONP and
* shifts them to the `JsonpClientBackend`.
*
*
*/
var JsonpInterceptor = /** @class */ (function () {
function JsonpInterceptor(jsonp) {
this.jsonp = jsonp;
}
JsonpInterceptor.prototype.intercept = function (req, next) {
if (req.method === 'JSONP') {
return this.jsonp.handle(req);
}
// Fall through for normal HTTP requests.
return next.handle(req);
};
JsonpInterceptor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
/** @nocollapse */
JsonpInterceptor.ctorParameters = function () { return [
{ type: JsonpClientBackend }
]; };
return JsonpInterceptor;
}());
/**
* @license
* Copyright Google Inc. 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 XSSI_PREFIX = /^\)\]\}',?\n/;
/**
* Determine an appropriate URL for the response, by checking either
* XMLHttpRequest.responseURL or the X-Request-URL header.
*/
function getResponseUrl(xhr) {
if ('responseURL' in xhr && xhr.responseURL) {
return xhr.responseURL;
}
if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
return xhr.getResponseHeader('X-Request-URL');
}
return null;
}
/**
* A wrapper around the `XMLHttpRequest` constructor.
*
*
*/
var XhrFactory = /** @class */ (function () {
function XhrFactory() {
}
return XhrFactory;
}());
/**
* A factory for @{link HttpXhrBackend} that uses the `XMLHttpRequest` browser API.
*
*
*/
var BrowserXhr = /** @class */ (function () {
function BrowserXhr() {
}
BrowserXhr.prototype.build = function () { return (new XMLHttpRequest()); };
BrowserXhr.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
/** @nocollapse */
BrowserXhr.ctorParameters = function () { return []; };
return BrowserXhr;
}());
/**
* An `HttpBackend` which uses the XMLHttpRequest API to send
* requests to a backend server.
*
*
*/
var HttpXhrBackend = /** @class */ (function () {
function HttpXhrBackend(xhrFactory) {
this.xhrFactory = xhrFactory;
}
/**
* Process a request and return a stream of response events.
*/
HttpXhrBackend.prototype.handle = function (req) {
var _this = this;
// Quick check to give a better error message when a user attempts to use
// HttpClient.jsonp() without installing the JsonpClientModule
if (req.method === 'JSONP') {
throw new Error("Attempted to construct Jsonp request without JsonpClientModule installed.");
}
// Everything happens on Observable subscription.
return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](function (observer) {
// Start by setting up the XHR object with request method, URL, and withCredentials flag.
var xhr = _this.xhrFactory.build();
xhr.open(req.method, req.urlWithParams);
if (!!req.withCredentials) {
xhr.withCredentials = true;
}
// Add all the requested headers.
req.headers.forEach(function (name, values) { return xhr.setRequestHeader(name, values.join(',')); });
// Add an Accept header if one isn't present already.
if (!req.headers.has('Accept')) {
xhr.setRequestHeader('Accept', 'application/json, text/plain, */*');
}
// Auto-detect the Content-Type header if one isn't present already.
if (!req.headers.has('Content-Type')) {
var detectedType = req.detectContentTypeHeader();
// Sometimes Content-Type detection fails.
if (detectedType !== null) {
xhr.setRequestHeader('Content-Type', detectedType);
}
}
// Set the responseType if one was requested.
if (req.responseType) {
var responseType = req.responseType.toLowerCase();
// JSON responses need to be processed as text. This is because if the server
// returns an XSSI-prefixed JSON response, the browser will fail to parse it,
// xhr.response will be null, and xhr.responseText cannot be accessed to
// retrieve the prefixed JSON data in order to strip the prefix. Thus, all JSON
// is parsed by first requesting text and then applying JSON.parse.
xhr.responseType = ((responseType !== 'json') ? responseType : 'text');
}
// Serialize the request body if one is present. If not, this will be set to null.
var reqBody = req.serializeBody();
// If progress events are enabled, response headers will be delivered
// in two events - the HttpHeaderResponse event and the full HttpResponse
// event. However, since response headers don't change in between these
// two events, it doesn't make sense to parse them twice. So headerResponse
// caches the data extracted from the response whenever it's first parsed,
// to ensure parsing isn't duplicated.
var headerResponse = null;
// partialFromXhr extracts the HttpHeaderResponse from the current XMLHttpRequest
// state, and memoizes it into headerResponse.
var partialFromXhr = function () {
if (headerResponse !== null) {
return headerResponse;
}
// Read status and normalize an IE9 bug (http://bugs.jquery.com/ticket/1450).
var status = xhr.status === 1223 ? 204 : xhr.status;
var statusText = xhr.statusText || 'OK';
// Parse headers from XMLHttpRequest - this step is lazy.
var headers = new HttpHeaders(xhr.getAllResponseHeaders());
// Read the response URL from the XMLHttpResponse instance and fall back on the
// request URL.
var url = getResponseUrl(xhr) || req.url;
// Construct the HttpHeaderResponse and memoize it.
headerResponse = new HttpHeaderResponse({ headers: headers, status: status, statusText: statusText, url: url });
return headerResponse;
};
// Next, a few closures are defined for the various events which XMLHttpRequest can
// emit. This allows them to be unregistered as event listeners later.
// First up is the load event, which represents a response being fully available.
var onLoad = function () {
// Read response state from the memoized partial data.
var _a = partialFromXhr(), headers = _a.headers, status = _a.status, statusText = _a.statusText, url = _a.url;
// The body will be read out if present.
var body = null;
if (status !== 204) {
// Use XMLHttpRequest.response if set, responseText otherwise.
body = (typeof xhr.response === 'undefined') ? xhr.responseText : xhr.response;
}
// Normalize another potential bug (this one comes from CORS).
if (status === 0) {
status = !!body ? 200 : 0;
}
// ok determines whether the response will be transmitted on the event or
// error channel. Unsuccessful status codes (not 2xx) will always be errors,
// but a successful status code can still result in an error if the user
// asked for JSON data and the body cannot be parsed as such.
var ok = status >= 200 && status < 300;
// Check whether the body needs to be parsed as JSON (in many cases the browser
// will have done that already).
if (req.responseType === 'json' && typeof body === 'string') {
// Save the original body, before attempting XSSI prefix stripping.
var originalBody = body;
body = body.replace(XSSI_PREFIX, '');
try {
// Attempt the parse. If it fails, a parse error should be delivered to the user.
body = body !== '' ? JSON.parse(body) : null;
}
catch (error) {
// Since the JSON.parse failed, it's reasonable to assume this might not have been a
// JSON response. Restore the original body (including any XSSI prefix) to deliver
// a better error response.
body = originalBody;
// If this was an error request to begin with, leave it as a string, it probably
// just isn't JSON. Otherwise, deliver the parsing error to the user.
if (ok) {
// Even though the response status was 2xx, this is still an error.
ok = false;
// The parse error contains the text of the body that failed to parse.
body = { error: error, text: body };
}
}
}
if (ok) {
// A successful response is delivered on the event stream.
observer.next(new HttpResponse({
body: body,
headers: headers,
status: status,
statusText: statusText,
url: url || undefined,
}));
// The full body has been received and delivered, no further events
// are possible. This request is complete.
observer.complete();
}
else {
// An unsuccessful request is delivered on the error channel.
observer.error(new HttpErrorResponse({
// The error in this case is the response body (error from the server).
error: body,
headers: headers,
status: status,
statusText: statusText,
url: url || undefined,
}));
}
};
// The onError callback is called when something goes wrong at the network level.
// Connection timeout, DNS error, offline, etc. These are actual errors, and are
// transmitted on the error channel.
var onError = function (error) {
var res = new HttpErrorResponse({
error: error,
status: xhr.status || 0,
statusText: xhr.statusText || 'Unknown Error',
});
observer.error(res);
};
// The sentHeaders flag tracks whether the HttpResponseHeaders event
// has been sent on the stream. This is necessary to track if progress
// is enabled since the event will be sent on only the first download
// progerss event.
var sentHeaders = false;
// The download progress event handler, which is only registered if
// progress events are enabled.
var onDownProgress = function (event) {
// Send the HttpResponseHeaders event if it hasn't been sent already.
if (!sentHeaders) {
observer.next(partialFromXhr());
sentHeaders = true;
}
// Start building the download progress event to deliver on the response
// event stream.
var progressEvent = {
type: HttpEventType.DownloadProgress,
loaded: event.loaded,
};
// Set the total number of bytes in the event if it's available.
if (event.lengthComputable) {
progressEvent.total = event.total;
}
// If the request was for text content and a partial response is
// available on XMLHttpRequest, include it in the progress event
// to allow for streaming reads.
if (req.responseType === 'text' && !!xhr.responseText) {
progressEvent.partialText = xhr.responseText;
}
// Finally, fire the event.
observer.next(progressEvent);
};
// The upload progress event handler, which is only registered if
// progress events are enabled.
var onUpProgress = function (event) {
// Upload progress events are simpler. Begin building the progress
// event.
var progress = {
type: HttpEventType.UploadProgress,
loaded: event.loaded,
};
// If the total number of bytes being uploaded is available, include
// it.
if (event.lengthComputable) {
progress.total = event.total;
}
// Send the event.
observer.next(progress);
};
// By default, register for load and error events.
xhr.addEventListener('load', onLoad);
xhr.addEventListener('error', onError);
// Progress events are only enabled if requested.
if (req.reportProgress) {
// Download progress is always enabled if requested.
xhr.addEventListener('progress', onDownProgress);
// Upload progress depends on whether there is a body to upload.
if (reqBody !== null && xhr.upload) {
xhr.upload.addEventListener('progress', onUpProgress);
}
}
// Fire the request, and notify the event stream that it was fired.
xhr.send(reqBody);
observer.next({ type: HttpEventType.Sent });
// This is the return from the Observable function, which is the
// request cancellation handler.
return function () {
// On a cancellation, remove all registered event listeners.
xhr.removeEventListener('error', onError);
xhr.removeEventListener('load', onLoad);
if (req.reportProgress) {
xhr.removeEventListener('progress', onDownProgress);
if (reqBody !== null && xhr.upload) {
xhr.upload.removeEventListener('progress', onUpProgress);
}
}
// Finally, abort the in-flight request.
xhr.abort();
};
});
};
HttpXhrBackend.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
/** @nocollapse */
HttpXhrBackend.ctorParameters = function () { return [
{ type: XhrFactory }
]; };
return HttpXhrBackend;
}());
/**
* @license
* Copyright Google Inc. 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 XSRF_COOKIE_NAME = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('XSRF_COOKIE_NAME');
var XSRF_HEADER_NAME = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('XSRF_HEADER_NAME');
/**
* Retrieves the current XSRF token to use with the next outgoing request.
*
*
*/
var HttpXsrfTokenExtractor = /** @class */ (function () {
function HttpXsrfTokenExtractor() {
}
return HttpXsrfTokenExtractor;
}());
/**
* `HttpXsrfTokenExtractor` which retrieves the token from a cookie.
*/
var HttpXsrfCookieExtractor = /** @class */ (function () {
function HttpXsrfCookieExtractor(doc, platform, cookieName) {
this.doc = doc;
this.platform = platform;
this.cookieName = cookieName;
this.lastCookieString = '';
this.lastToken = null;
/**
* @internal for testing
*/
this.parseCount = 0;
}
HttpXsrfCookieExtractor.prototype.getToken = function () {
if (this.platform === 'server') {
return null;
}
var cookieString = this.doc.cookie || '';
if (cookieString !== this.lastCookieString) {
this.parseCount++;
this.lastToken = Object(_angular_common__WEBPACK_IMPORTED_MODULE_4__["ɵparseCookieValue"])(cookieString, this.cookieName);
this.lastCookieString = cookieString;
}
return this.lastToken;
};
HttpXsrfCookieExtractor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
/** @nocollapse */
HttpXsrfCookieExtractor.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_4__["DOCUMENT"],] }] },
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"],] }] },
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [XSRF_COOKIE_NAME,] }] }
]; };
return HttpXsrfCookieExtractor;
}());
/**
* `HttpInterceptor` which adds an XSRF token to eligible outgoing requests.
*/
var HttpXsrfInterceptor = /** @class */ (function () {
function HttpXsrfInterceptor(tokenService, headerName) {
this.tokenService = tokenService;
this.headerName = headerName;
}
HttpXsrfInterceptor.prototype.intercept = function (req, next) {
var lcUrl = req.url.toLowerCase();
// Skip both non-mutating requests and absolute URLs.
// Non-mutating requests don't require a token, and absolute URLs require special handling
// anyway as the cookie set
// on our origin is not the same as the token expected by another origin.
if (req.method === 'GET' || req.method === 'HEAD' || lcUrl.startsWith('http://') ||
lcUrl.startsWith('https://')) {
return next.handle(req);
}
var token = this.tokenService.getToken();
// Be careful not to overwrite an existing header of the same name.
if (token !== null && !req.headers.has(this.headerName)) {
req = req.clone({ headers: req.headers.set(this.headerName, token) });
}
return next.handle(req);
};
HttpXsrfInterceptor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
/** @nocollapse */
HttpXsrfInterceptor.ctorParameters = function () { return [
{ type: HttpXsrfTokenExtractor },
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [XSRF_HEADER_NAME,] }] }
]; };
return HttpXsrfInterceptor;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* An injectable `HttpHandler` that applies multiple interceptors
* to a request before passing it to the given `HttpBackend`.
*
* The interceptors are loaded lazily from the injector, to allow
* interceptors to themselves inject classes depending indirectly
* on `HttpInterceptingHandler` itself.
* @see `HttpInterceptor`
*/
var HttpInterceptingHandler = /** @class */ (function () {
function HttpInterceptingHandler(backend, injector) {
this.backend = backend;
this.injector = injector;
this.chain = null;
}
HttpInterceptingHandler.prototype.handle = function (req) {
if (this.chain === null) {
var interceptors = this.injector.get(HTTP_INTERCEPTORS, []);
this.chain = interceptors.reduceRight(function (next, interceptor) { return new HttpInterceptorHandler(next, interceptor); }, this.backend);
}
return this.chain.handle(req);
};
HttpInterceptingHandler.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
/** @nocollapse */
HttpInterceptingHandler.ctorParameters = function () { return [
{ type: HttpBackend },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"] }
]; };
return HttpInterceptingHandler;
}());
/**
* Factory function that determines where to store JSONP callbacks.
*
* Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist
* in test environments. In that case, callbacks are stored on an anonymous object instead.
*
*
*/
function jsonpCallbackContext() {
if (typeof window === 'object') {
return window;
}
return {};
}
/**
* An NgModule that adds XSRF protection support to outgoing requests.
*
* For a server that supports a cookie-based XSRF protection system,
* use directly to configure XSRF protection with the correct
* cookie and header names.
*
* If no names are supplied, the default cookie name is `XSRF-TOKEN`
* and the default header name is `X-XSRF-TOKEN`.
*
*
*/
var HttpClientXsrfModule = /** @class */ (function () {
function HttpClientXsrfModule() {
}
/**
* Disable the default XSRF protection.
*/
HttpClientXsrfModule.disable = function () {
return {
ngModule: HttpClientXsrfModule,
providers: [
{ provide: HttpXsrfInterceptor, useClass: NoopInterceptor },
],
};
};
/**
* Configure XSRF protection.
* @param options An object that can specify either or both
* cookie name or header name.
* - Cookie name default is `XSRF-TOKEN`.
* - Header name default is `X-XSRF-TOKEN`.
*
*/
HttpClientXsrfModule.withOptions = function (options) {
if (options === void 0) { options = {}; }
return {
ngModule: HttpClientXsrfModule,
providers: [
options.cookieName ? { provide: XSRF_COOKIE_NAME, useValue: options.cookieName } : [],
options.headerName ? { provide: XSRF_HEADER_NAME, useValue: options.headerName } : [],
],
};
};
HttpClientXsrfModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
providers: [
HttpXsrfInterceptor,
{ provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
{ provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
{ provide: XSRF_COOKIE_NAME, useValue: 'XSRF-TOKEN' },
{ provide: XSRF_HEADER_NAME, useValue: 'X-XSRF-TOKEN' },
],
},] }
];
return HttpClientXsrfModule;
}());
/**
* An NgModule that provides the `HttpClient` and associated services.
*
* Interceptors can be added to the chain behind `HttpClient` by binding them
* to the multiprovider for `HTTP_INTERCEPTORS`.
*
*
*/
var HttpClientModule = /** @class */ (function () {
function HttpClientModule() {
}
HttpClientModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
/**
* Optional configuration for XSRF protection.
*/
imports: [
HttpClientXsrfModule.withOptions({
cookieName: 'XSRF-TOKEN',
headerName: 'X-XSRF-TOKEN',
}),
],
/**
* The module provides `HttpClient` itself, and supporting services.
*/
providers: [
HttpClient,
{ provide: HttpHandler, useClass: HttpInterceptingHandler },
HttpXhrBackend,
{ provide: HttpBackend, useExisting: HttpXhrBackend },
BrowserXhr,
{ provide: XhrFactory, useExisting: BrowserXhr },
],
},] }
];
return HttpClientModule;
}());
/**
* An NgModule that enables JSONP support in `HttpClient`.
*
* Without this module, Jsonp requests will reach the backend
* with method JSONP, where they'll be rejected.
*
*
*/
var HttpClientJsonpModule = /** @class */ (function () {
function HttpClientJsonpModule() {
}
HttpClientJsonpModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
providers: [
JsonpClientBackend,
{ provide: JsonpCallbackContext, useFactory: jsonpCallbackContext },
{ provide: HTTP_INTERCEPTORS, useClass: JsonpInterceptor, multi: true },
],
},] }
];
return HttpClientJsonpModule;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Generated bundle index. Do not edit.
*/
//# sourceMappingURL=http.js.map
/***/ }),
/***/ "./node_modules/@angular/compiler/fesm5/compiler.js":
/*!**********************************************************!*\
!*** ./node_modules/@angular/compiler/fesm5/compiler.js ***!
\**********************************************************/
/*! exports provided: core, CompilerConfig, preserveWhitespacesDefault, isLoweredSymbol, createLoweredSymbol, Identifiers, JitCompiler, DirectiveResolver, PipeResolver, NgModuleResolver, DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, NgModuleCompiler, AssertNotNull, BinaryOperator, BinaryOperatorExpr, BuiltinMethod, BuiltinVar, CastExpr, ClassField, ClassMethod, ClassStmt, CommaExpr, CommentStmt, ConditionalExpr, DeclareFunctionStmt, DeclareVarStmt, ExpressionStatement, ExternalExpr, ExternalReference, FunctionExpr, IfStmt, InstantiateExpr, InvokeFunctionExpr, InvokeMethodExpr, JSDocCommentStmt, LiteralArrayExpr, LiteralExpr, LiteralMapExpr, NotExpr, ReadKeyExpr, ReadPropExpr, ReadVarExpr, ReturnStatement, ThrowStmt, TryCatchStmt, WriteKeyExpr, WritePropExpr, WriteVarExpr, StmtModifier, Statement, collectExternalReferences, EmitterVisitorContext, ViewCompiler, getParseErrors, isSyntaxError, syntaxError, Version, VERSION, TextAst, BoundTextAst, AttrAst, BoundElementPropertyAst, BoundEventAst, ReferenceAst, VariableAst, ElementAst, EmbeddedTemplateAst, BoundDirectivePropertyAst, DirectiveAst, ProviderAst, ProviderAstType, NgContentAst, PropertyBindingType, NullTemplateVisitor, RecursiveTemplateAstVisitor, templateVisitAll, sanitizeIdentifier, identifierName, identifierModuleUrl, viewClassName, rendererTypeName, hostViewClassName, componentFactoryName, CompileSummaryKind, tokenName, tokenReference, CompileStylesheetMetadata, CompileTemplateMetadata, CompileDirectiveMetadata, CompilePipeMetadata, CompileShallowModuleMetadata, CompileNgModuleMetadata, TransitiveCompileNgModuleMetadata, ProviderMeta, flatten, templateSourceUrl, sharedStylesheetJitUrl, ngModuleJitUrl, templateJitUrl, createAotUrlResolver, createAotCompiler, AotCompiler, analyzeNgModules, analyzeAndValidateNgModules, analyzeFile, analyzeFileForInjectables, mergeAnalyzedFiles, GeneratedFile, toTypeScript, formattedError, isFormattedError, StaticReflector, StaticSymbol, StaticSymbolCache, ResolvedStaticSymbol, StaticSymbolResolver, unescapeIdentifier, unwrapResolvedMetadata, AotSummaryResolver, AstPath, SummaryResolver, JitSummaryResolver, CompileReflector, createUrlResolverWithoutPackagePrefix, createOfflineCompileUrlResolver, UrlResolver, getUrlScheme, ResourceLoader, ElementSchemaRegistry, Extractor, I18NHtmlParser, MessageBundle, Serializer, Xliff, Xliff2, Xmb, Xtb, DirectiveNormalizer, ParserError, ParseSpan, AST, Quote, EmptyExpr, ImplicitReceiver, Chain, Conditional, PropertyRead, PropertyWrite, SafePropertyRead, KeyedRead, KeyedWrite, BindingPipe, LiteralPrimitive, LiteralArray, LiteralMap, Interpolation, Binary, PrefixNot, NonNullAssert, MethodCall, SafeMethodCall, FunctionCall, ASTWithSource, TemplateBinding, NullAstVisitor, RecursiveAstVisitor, AstTransformer, AstMemoryEfficientTransformer, visitAstChildren, TokenType, Lexer, Token, EOF, isIdentifier, isQuote, SplitInterpolation, TemplateBindingParseResult, Parser, _ParseAST, ERROR_COMPONENT_TYPE, CompileMetadataResolver, Text, Expansion, ExpansionCase, Attribute, Element, Comment, visitAll, RecursiveVisitor, findNode, HtmlParser, ParseTreeResult, TreeError, HtmlTagDefinition, getHtmlTagDefinition, TagContentType, splitNsName, isNgContainer, isNgContent, isNgTemplate, getNsPrefix, mergeNsAndName, NAMED_ENTITIES, NGSP_UNICODE, debugOutputAstAsTypeScript, TypeScriptEmitter, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseErrorLevel, ParseError, typeSourceSpan, DomElementSchemaRegistry, CssSelector, SelectorMatcher, SelectorListContext, SelectorContext, StylesCompileDependency, CompiledStylesheet, StyleCompiler, TemplateParseError, TemplateParseResult, TemplateParser, splitClasses, createElementCssSelector, removeSummaryDuplicates */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "core", function() { return core; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompilerConfig", function() { return CompilerConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "preserveWhitespacesDefault", function() { return preserveWhitespacesDefault; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLoweredSymbol", function() { return isLoweredSymbol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLoweredSymbol", function() { return createLoweredSymbol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Identifiers", function() { return Identifiers; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JitCompiler", function() { return JitCompiler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DirectiveResolver", function() { return DirectiveResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PipeResolver", function() { return PipeResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModuleResolver", function() { return NgModuleResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_INTERPOLATION_CONFIG", function() { return DEFAULT_INTERPOLATION_CONFIG; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InterpolationConfig", function() { return InterpolationConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModuleCompiler", function() { return NgModuleCompiler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AssertNotNull", function() { return AssertNotNull; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BinaryOperator", function() { return BinaryOperator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BinaryOperatorExpr", function() { return BinaryOperatorExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BuiltinMethod", function() { return BuiltinMethod; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BuiltinVar", function() { return BuiltinVar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CastExpr", function() { return CastExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClassField", function() { return ClassField; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClassMethod", function() { return ClassMethod; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClassStmt", function() { return ClassStmt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommaExpr", function() { return CommaExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommentStmt", function() { return CommentStmt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConditionalExpr", function() { return ConditionalExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeclareFunctionStmt", function() { return DeclareFunctionStmt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeclareVarStmt", function() { return DeclareVarStmt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionStatement", function() { return ExpressionStatement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExternalExpr", function() { return ExternalExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExternalReference", function() { return ExternalReference; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionExpr", function() { return FunctionExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfStmt", function() { return IfStmt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InstantiateExpr", function() { return InstantiateExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InvokeFunctionExpr", function() { return InvokeFunctionExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InvokeMethodExpr", function() { return InvokeMethodExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSDocCommentStmt", function() { return JSDocCommentStmt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LiteralArrayExpr", function() { return LiteralArrayExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LiteralExpr", function() { return LiteralExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LiteralMapExpr", function() { return LiteralMapExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotExpr", function() { return NotExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReadKeyExpr", function() { return ReadKeyExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReadPropExpr", function() { return ReadPropExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReadVarExpr", function() { return ReadVarExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReturnStatement", function() { return ReturnStatement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThrowStmt", function() { return ThrowStmt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TryCatchStmt", function() { return TryCatchStmt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WriteKeyExpr", function() { return WriteKeyExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WritePropExpr", function() { return WritePropExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WriteVarExpr", function() { return WriteVarExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StmtModifier", function() { return StmtModifier; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Statement", function() { return Statement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "collectExternalReferences", function() { return collectExternalReferences; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmitterVisitorContext", function() { return EmitterVisitorContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewCompiler", function() { return ViewCompiler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getParseErrors", function() { return getParseErrors; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSyntaxError", function() { return isSyntaxError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "syntaxError", function() { return syntaxError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Version", function() { return Version; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextAst", function() { return TextAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoundTextAst", function() { return BoundTextAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AttrAst", function() { return AttrAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoundElementPropertyAst", function() { return BoundElementPropertyAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoundEventAst", function() { return BoundEventAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReferenceAst", function() { return ReferenceAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableAst", function() { return VariableAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ElementAst", function() { return ElementAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmbeddedTemplateAst", function() { return EmbeddedTemplateAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoundDirectivePropertyAst", function() { return BoundDirectivePropertyAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DirectiveAst", function() { return DirectiveAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProviderAst", function() { return ProviderAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProviderAstType", function() { return ProviderAstType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgContentAst", function() { return NgContentAst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyBindingType", function() { return PropertyBindingType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NullTemplateVisitor", function() { return NullTemplateVisitor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecursiveTemplateAstVisitor", function() { return RecursiveTemplateAstVisitor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "templateVisitAll", function() { return templateVisitAll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sanitizeIdentifier", function() { return sanitizeIdentifier; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identifierName", function() { return identifierName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identifierModuleUrl", function() { return identifierModuleUrl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewClassName", function() { return viewClassName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rendererTypeName", function() { return rendererTypeName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hostViewClassName", function() { return hostViewClassName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "componentFactoryName", function() { return componentFactoryName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompileSummaryKind", function() { return CompileSummaryKind; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tokenName", function() { return tokenName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tokenReference", function() { return tokenReference; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompileStylesheetMetadata", function() { return CompileStylesheetMetadata; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompileTemplateMetadata", function() { return CompileTemplateMetadata; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompileDirectiveMetadata", function() { return CompileDirectiveMetadata; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompilePipeMetadata", function() { return CompilePipeMetadata; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompileShallowModuleMetadata", function() { return CompileShallowModuleMetadata; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompileNgModuleMetadata", function() { return CompileNgModuleMetadata; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TransitiveCompileNgModuleMetadata", function() { return TransitiveCompileNgModuleMetadata; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProviderMeta", function() { return ProviderMeta; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return flatten; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "templateSourceUrl", function() { return templateSourceUrl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sharedStylesheetJitUrl", function() { return sharedStylesheetJitUrl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ngModuleJitUrl", function() { return ngModuleJitUrl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "templateJitUrl", function() { return templateJitUrl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAotUrlResolver", function() { return createAotUrlResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAotCompiler", function() { return createAotCompiler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AotCompiler", function() { return AotCompiler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "analyzeNgModules", function() { return analyzeNgModules; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "analyzeAndValidateNgModules", function() { return analyzeAndValidateNgModules; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "analyzeFile", function() { return analyzeFile; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "analyzeFileForInjectables", function() { return analyzeFileForInjectables; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeAnalyzedFiles", function() { return mergeAnalyzedFiles; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeneratedFile", function() { return GeneratedFile; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toTypeScript", function() { return toTypeScript; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formattedError", function() { return formattedError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFormattedError", function() { return isFormattedError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticReflector", function() { return StaticReflector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticSymbol", function() { return StaticSymbol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticSymbolCache", function() { return StaticSymbolCache; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedStaticSymbol", function() { return ResolvedStaticSymbol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticSymbolResolver", function() { return StaticSymbolResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unescapeIdentifier", function() { return unescapeIdentifier; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrapResolvedMetadata", function() { return unwrapResolvedMetadata; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AotSummaryResolver", function() { return AotSummaryResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AstPath", function() { return AstPath; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SummaryResolver", function() { return SummaryResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JitSummaryResolver", function() { return JitSummaryResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompileReflector", function() { return CompileReflector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUrlResolverWithoutPackagePrefix", function() { return createUrlResolverWithoutPackagePrefix; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createOfflineCompileUrlResolver", function() { return createOfflineCompileUrlResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlResolver", function() { return UrlResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getUrlScheme", function() { return getUrlScheme; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResourceLoader", function() { return ResourceLoader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ElementSchemaRegistry", function() { return ElementSchemaRegistry; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Extractor", function() { return Extractor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I18NHtmlParser", function() { return I18NHtmlParser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MessageBundle", function() { return MessageBundle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Serializer", function() { return Serializer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Xliff", function() { return Xliff; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Xliff2", function() { return Xliff2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Xmb", function() { return Xmb; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Xtb", function() { return Xtb; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DirectiveNormalizer", function() { return DirectiveNormalizer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParserError", function() { return ParserError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParseSpan", function() { return ParseSpan; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AST", function() { return AST; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Quote", function() { return Quote; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmptyExpr", function() { return EmptyExpr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImplicitReceiver", function() { return ImplicitReceiver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Chain", function() { return Chain; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Conditional", function() { return Conditional; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyRead", function() { return PropertyRead; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyWrite", function() { return PropertyWrite; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SafePropertyRead", function() { return SafePropertyRead; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyedRead", function() { return KeyedRead; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyedWrite", function() { return KeyedWrite; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BindingPipe", function() { return BindingPipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LiteralPrimitive", function() { return LiteralPrimitive; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LiteralArray", function() { return LiteralArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LiteralMap", function() { return LiteralMap; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Interpolation", function() { return Interpolation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Binary", function() { return Binary; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixNot", function() { return PrefixNot; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NonNullAssert", function() { return NonNullAssert; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MethodCall", function() { return MethodCall; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SafeMethodCall", function() { return SafeMethodCall; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ASTWithSource", function() { return ASTWithSource; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateBinding", function() { return TemplateBinding; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NullAstVisitor", function() { return NullAstVisitor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecursiveAstVisitor", function() { return RecursiveAstVisitor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AstTransformer", function() { return AstTransformer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AstMemoryEfficientTransformer", function() { return AstMemoryEfficientTransformer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "visitAstChildren", function() { return visitAstChildren; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenType", function() { return TokenType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Lexer", function() { return Lexer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EOF", function() { return EOF; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIdentifier", function() { return isIdentifier; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isQuote", function() { return isQuote; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SplitInterpolation", function() { return SplitInterpolation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateBindingParseResult", function() { return TemplateBindingParseResult; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Parser", function() { return Parser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_ParseAST", function() { return _ParseAST; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ERROR_COMPONENT_TYPE", function() { return ERROR_COMPONENT_TYPE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompileMetadataResolver", function() { return CompileMetadataResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Text", function() { return Text; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Expansion", function() { return Expansion; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpansionCase", function() { return ExpansionCase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribute", function() { return Attribute; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return Element; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Comment", function() { return Comment; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "visitAll", function() { return visitAll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecursiveVisitor", function() { return RecursiveVisitor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNode", function() { return findNode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HtmlParser", function() { return HtmlParser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParseTreeResult", function() { return ParseTreeResult; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TreeError", function() { return TreeError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HtmlTagDefinition", function() { return HtmlTagDefinition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHtmlTagDefinition", function() { return getHtmlTagDefinition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TagContentType", function() { return TagContentType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitNsName", function() { return splitNsName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNgContainer", function() { return isNgContainer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNgContent", function() { return isNgContent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNgTemplate", function() { return isNgTemplate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNsPrefix", function() { return getNsPrefix; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeNsAndName", function() { return mergeNsAndName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NAMED_ENTITIES", function() { return NAMED_ENTITIES; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NGSP_UNICODE", function() { return NGSP_UNICODE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debugOutputAstAsTypeScript", function() { return debugOutputAstAsTypeScript; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TypeScriptEmitter", function() { return TypeScriptEmitter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParseLocation", function() { return ParseLocation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParseSourceFile", function() { return ParseSourceFile; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParseSourceSpan", function() { return ParseSourceSpan; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParseErrorLevel", function() { return ParseErrorLevel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParseError", function() { return ParseError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "typeSourceSpan", function() { return typeSourceSpan; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DomElementSchemaRegistry", function() { return DomElementSchemaRegistry; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CssSelector", function() { return CssSelector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectorMatcher", function() { return SelectorMatcher; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectorListContext", function() { return SelectorListContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectorContext", function() { return SelectorContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StylesCompileDependency", function() { return StylesCompileDependency; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompiledStylesheet", function() { return CompiledStylesheet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StyleCompiler", function() { return StyleCompiler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateParseError", function() { return TemplateParseError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateParseResult", function() { return TemplateParseResult; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateParser", function() { return TemplateParser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitClasses", function() { return splitClasses; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createElementCssSelector", function() { return createElementCssSelector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeSummaryDuplicates", function() { return removeSummaryDuplicates; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/**
* @license Angular v6.0.9
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
/**
* @license
* Copyright Google Inc. 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 createInject = makeMetadataFactory('Inject', function (token) { return ({ token: token }); });
var createInjectionToken = makeMetadataFactory('InjectionToken', function (desc) { return ({ _desc: desc, ngInjectableDef: undefined }); });
var createAttribute = makeMetadataFactory('Attribute', function (attributeName) { return ({ attributeName: attributeName }); });
var createContentChildren = makeMetadataFactory('ContentChildren', function (selector, data) {
if (data === void 0) { data = {}; }
return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ selector: selector, first: false, isViewQuery: false, descendants: false }, data));
});
var createContentChild = makeMetadataFactory('ContentChild', function (selector, data) {
if (data === void 0) { data = {}; }
return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ selector: selector, first: true, isViewQuery: false, descendants: true }, data));
});
var createViewChildren = makeMetadataFactory('ViewChildren', function (selector, data) {
if (data === void 0) { data = {}; }
return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ selector: selector, first: false, isViewQuery: true, descendants: true }, data));
});
var createViewChild = makeMetadataFactory('ViewChild', function (selector, data) {
return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ selector: selector, first: true, isViewQuery: true, descendants: true }, data));
});
var createDirective = makeMetadataFactory('Directive', function (dir) {
if (dir === void 0) { dir = {}; }
return dir;
});
var ViewEncapsulation;
(function (ViewEncapsulation) {
ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
ViewEncapsulation[ViewEncapsulation["Native"] = 1] = "Native";
ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
})(ViewEncapsulation || (ViewEncapsulation = {}));
var ChangeDetectionStrategy;
(function (ChangeDetectionStrategy) {
ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
var createComponent = makeMetadataFactory('Component', function (c) {
if (c === void 0) { c = {}; }
return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ changeDetection: ChangeDetectionStrategy.Default }, c));
});
var createPipe = makeMetadataFactory('Pipe', function (p) { return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ pure: true }, p)); });
var createInput = makeMetadataFactory('Input', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });
var createOutput = makeMetadataFactory('Output', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });
var createHostBinding = makeMetadataFactory('HostBinding', function (hostPropertyName) { return ({ hostPropertyName: hostPropertyName }); });
var createHostListener = makeMetadataFactory('HostListener', function (eventName, args) { return ({ eventName: eventName, args: args }); });
var createNgModule = makeMetadataFactory('NgModule', function (ngModule) { return ngModule; });
var createInjectable = makeMetadataFactory('Injectable', function (injectable) {
if (injectable === void 0) { injectable = {}; }
return injectable;
});
var CUSTOM_ELEMENTS_SCHEMA = {
name: 'custom-elements'
};
var NO_ERRORS_SCHEMA = {
name: 'no-errors-schema'
};
var createOptional = makeMetadataFactory('Optional');
var createSelf = makeMetadataFactory('Self');
var createSkipSelf = makeMetadataFactory('SkipSelf');
var createHost = makeMetadataFactory('Host');
var Type = Function;
var SecurityContext;
(function (SecurityContext) {
SecurityContext[SecurityContext["NONE"] = 0] = "NONE";
SecurityContext[SecurityContext["HTML"] = 1] = "HTML";
SecurityContext[SecurityContext["STYLE"] = 2] = "STYLE";
SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT";
SecurityContext[SecurityContext["URL"] = 4] = "URL";
SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL";
})(SecurityContext || (SecurityContext = {}));
var MissingTranslationStrategy;
(function (MissingTranslationStrategy) {
MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error";
MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning";
MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore";
})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
function makeMetadataFactory(name, props) {
var factory = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var values = props ? props.apply(void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(args)) : {};
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ ngMetadataName: name }, values);
};
factory.isTypeOf = function (obj) { return obj && obj.ngMetadataName === name; };
factory.ngMetadataName = name;
return factory;
}
var core = /*#__PURE__*/Object.freeze({
createInject: createInject,
createInjectionToken: createInjectionToken,
createAttribute: createAttribute,
createContentChildren: createContentChildren,
createContentChild: createContentChild,
createViewChildren: createViewChildren,
createViewChild: createViewChild,
createDirective: createDirective,
get ViewEncapsulation () { return ViewEncapsulation; },
get ChangeDetectionStrategy () { return ChangeDetectionStrategy; },
createComponent: createComponent,
createPipe: createPipe,
createInput: createInput,
createOutput: createOutput,
createHostBinding: createHostBinding,
createHostListener: createHostListener,
createNgModule: createNgModule,
createInjectable: createInjectable,
CUSTOM_ELEMENTS_SCHEMA: CUSTOM_ELEMENTS_SCHEMA,
NO_ERRORS_SCHEMA: NO_ERRORS_SCHEMA,
createOptional: createOptional,
createSelf: createSelf,
createSkipSelf: createSkipSelf,
createHost: createHost,
Type: Type,
get SecurityContext () { return SecurityContext; },
get MissingTranslationStrategy () { return MissingTranslationStrategy; }
});
/**
* @license
* Copyright Google Inc. 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 DASH_CASE_REGEXP = /-+([a-z0-9])/g;
function dashCaseToCamelCase(input) {
return input.replace(DASH_CASE_REGEXP, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i] = arguments[_i];
}
return m[1].toUpperCase();
});
}
function splitAtColon(input, defaultValues) {
return _splitAt(input, ':', defaultValues);
}
function splitAtPeriod(input, defaultValues) {
return _splitAt(input, '.', defaultValues);
}
function _splitAt(input, character, defaultValues) {
var characterIndex = input.indexOf(character);
if (characterIndex == -1)
return defaultValues;
return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];
}
function visitValue(value, visitor, context) {
if (Array.isArray(value)) {
return visitor.visitArray(value, context);
}
if (isStrictStringMap(value)) {
return visitor.visitStringMap(value, context);
}
if (value == null || typeof value == 'string' || typeof value == 'number' ||
typeof value == 'boolean') {
return visitor.visitPrimitive(value, context);
}
return visitor.visitOther(value, context);
}
function isDefined(val) {
return val !== null && val !== undefined;
}
function noUndefined(val) {
return val === undefined ? null : val;
}
var ValueTransformer = /** @class */ (function () {
function ValueTransformer() {
}
ValueTransformer.prototype.visitArray = function (arr, context) {
var _this = this;
return arr.map(function (value) { return visitValue(value, _this, context); });
};
ValueTransformer.prototype.visitStringMap = function (map, context) {
var _this = this;
var result = {};
Object.keys(map).forEach(function (key) { result[key] = visitValue(map[key], _this, context); });
return result;
};
ValueTransformer.prototype.visitPrimitive = function (value, context) { return value; };
ValueTransformer.prototype.visitOther = function (value, context) { return value; };
return ValueTransformer;
}());
var SyncAsync = {
assertSync: function (value) {
if (isPromise(value)) {
throw new Error("Illegal state: value cannot be a promise");
}
return value;
},
then: function (value, cb) { return isPromise(value) ? value.then(cb) : cb(value); },
all: function (syncAsyncValues) {
return syncAsyncValues.some(isPromise) ? Promise.all(syncAsyncValues) : syncAsyncValues;
}
};
function error(msg) {
throw new Error("Internal Error: " + msg);
}
function syntaxError(msg, parseErrors) {
var error = Error(msg);
error[ERROR_SYNTAX_ERROR] = true;
if (parseErrors)
error[ERROR_PARSE_ERRORS] = parseErrors;
return error;
}
var ERROR_SYNTAX_ERROR = 'ngSyntaxError';
var ERROR_PARSE_ERRORS = 'ngParseErrors';
function isSyntaxError(error) {
return error[ERROR_SYNTAX_ERROR];
}
function getParseErrors(error) {
return error[ERROR_PARSE_ERRORS] || [];
}
// Escape characters that have a special meaning in Regular Expressions
function escapeRegExp(s) {
return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
}
var STRING_MAP_PROTO = Object.getPrototypeOf({});
function isStrictStringMap(obj) {
return typeof obj === 'object' && obj !== null && Object.getPrototypeOf(obj) === STRING_MAP_PROTO;
}
function utf8Encode(str) {
var encoded = '';
for (var index = 0; index < str.length; index++) {
var codePoint = str.charCodeAt(index);
// decode surrogate
// see https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
if (codePoint >= 0xd800 && codePoint <= 0xdbff && str.length > (index + 1)) {
var low = str.charCodeAt(index + 1);
if (low >= 0xdc00 && low <= 0xdfff) {
index++;
codePoint = ((codePoint - 0xd800) << 10) + low - 0xdc00 + 0x10000;
}
}
if (codePoint <= 0x7f) {
encoded += String.fromCharCode(codePoint);
}
else if (codePoint <= 0x7ff) {
encoded += String.fromCharCode(((codePoint >> 6) & 0x1F) | 0xc0, (codePoint & 0x3f) | 0x80);
}
else if (codePoint <= 0xffff) {
encoded += String.fromCharCode((codePoint >> 12) | 0xe0, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);
}
else if (codePoint <= 0x1fffff) {
encoded += String.fromCharCode(((codePoint >> 18) & 0x07) | 0xf0, ((codePoint >> 12) & 0x3f) | 0x80, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);
}
}
return encoded;
}
function stringify(token) {
if (typeof token === 'string') {
return token;
}
if (token instanceof Array) {
return '[' + token.map(stringify).join(', ') + ']';
}
if (token == null) {
return '' + token;
}
if (token.overriddenName) {
return "" + token.overriddenName;
}
if (token.name) {
return "" + token.name;
}
// WARNING: do not try to `JSON.stringify(token)` here
// see https://github.com/angular/angular/issues/23440
var res = token.toString();
if (res == null) {
return '' + res;
}
var newLineIndex = res.indexOf('\n');
return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
}
/**
* Lazily retrieves the reference value from a forwardRef.
*/
function resolveForwardRef(type) {
if (typeof type === 'function' && type.hasOwnProperty('__forward_ref__')) {
return type();
}
else {
return type;
}
}
/**
* Determine if the argument is shaped like a Promise
*/
function isPromise(obj) {
// allow any Promise/A+ compliant thenable.
// It's up to the caller to ensure that obj.then conforms to the spec
return !!obj && typeof obj.then === 'function';
}
var Version = /** @class */ (function () {
function Version(full) {
this.full = full;
var splits = full.split('.');
this.major = splits[0];
this.minor = splits[1];
this.patch = splits.slice(2).join('.');
}
return Version;
}());
/**
* @license
* Copyright Google Inc. 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 VERSION = new Version('6.0.9');
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A segment of text within the template.
*/
var TextAst = /** @class */ (function () {
function TextAst(value, ngContentIndex, sourceSpan) {
this.value = value;
this.ngContentIndex = ngContentIndex;
this.sourceSpan = sourceSpan;
}
TextAst.prototype.visit = function (visitor, context) { return visitor.visitText(this, context); };
return TextAst;
}());
/**
* A bound expression within the text of a template.
*/
var BoundTextAst = /** @class */ (function () {
function BoundTextAst(value, ngContentIndex, sourceSpan) {
this.value = value;
this.ngContentIndex = ngContentIndex;
this.sourceSpan = sourceSpan;
}
BoundTextAst.prototype.visit = function (visitor, context) {
return visitor.visitBoundText(this, context);
};
return BoundTextAst;
}());
/**
* A plain attribute on an element.
*/
var AttrAst = /** @class */ (function () {
function AttrAst(name, value, sourceSpan) {
this.name = name;
this.value = value;
this.sourceSpan = sourceSpan;
}
AttrAst.prototype.visit = function (visitor, context) { return visitor.visitAttr(this, context); };
return AttrAst;
}());
/**
* A binding for an element property (e.g. `[property]="expression"`) or an animation trigger (e.g.
* `[@trigger]="stateExp"`)
*/
var BoundElementPropertyAst = /** @class */ (function () {
function BoundElementPropertyAst(name, type, securityContext, value, unit, sourceSpan) {
this.name = name;
this.type = type;
this.securityContext = securityContext;
this.value = value;
this.unit = unit;
this.sourceSpan = sourceSpan;
this.isAnimation = this.type === PropertyBindingType.Animation;
}
BoundElementPropertyAst.prototype.visit = function (visitor, context) {
return visitor.visitElementProperty(this, context);
};
return BoundElementPropertyAst;
}());
/**
* A binding for an element event (e.g. `(event)="handler()"`) or an animation trigger event (e.g.
* `(@trigger.phase)="callback($event)"`).
*/
var BoundEventAst = /** @class */ (function () {
function BoundEventAst(name, target, phase, handler, sourceSpan) {
this.name = name;
this.target = target;
this.phase = phase;
this.handler = handler;
this.sourceSpan = sourceSpan;
this.fullName = BoundEventAst.calcFullName(this.name, this.target, this.phase);
this.isAnimation = !!this.phase;
}
BoundEventAst.calcFullName = function (name, target, phase) {
if (target) {
return target + ":" + name;
}
else if (phase) {
return "@" + name + "." + phase;
}
else {
return name;
}
};
BoundEventAst.prototype.visit = function (visitor, context) {
return visitor.visitEvent(this, context);
};
return BoundEventAst;
}());
/**
* A reference declaration on an element (e.g. `let someName="expression"`).
*/
var ReferenceAst = /** @class */ (function () {
function ReferenceAst(name, value, originalValue, sourceSpan) {
this.name = name;
this.value = value;
this.originalValue = originalValue;
this.sourceSpan = sourceSpan;
}
ReferenceAst.prototype.visit = function (visitor, context) {
return visitor.visitReference(this, context);
};
return ReferenceAst;
}());
/**
* A variable declaration on a <ng-template> (e.g. `var-someName="someLocalName"`).
*/
var VariableAst = /** @class */ (function () {
function VariableAst(name, value, sourceSpan) {
this.name = name;
this.value = value;
this.sourceSpan = sourceSpan;
}
VariableAst.prototype.visit = function (visitor, context) {
return visitor.visitVariable(this, context);
};
return VariableAst;
}());
/**
* An element declaration in a template.
*/
var ElementAst = /** @class */ (function () {
function ElementAst(name, attrs, inputs, outputs, references, directives, providers, hasViewContainer, queryMatches, children, ngContentIndex, sourceSpan, endSourceSpan) {
this.name = name;
this.attrs = attrs;
this.inputs = inputs;
this.outputs = outputs;
this.references = references;
this.directives = directives;
this.providers = providers;
this.hasViewContainer = hasViewContainer;
this.queryMatches = queryMatches;
this.children = children;
this.ngContentIndex = ngContentIndex;
this.sourceSpan = sourceSpan;
this.endSourceSpan = endSourceSpan;
}
ElementAst.prototype.visit = function (visitor, context) {
return visitor.visitElement(this, context);
};
return ElementAst;
}());
/**
* A `<ng-template>` element included in an Angular template.
*/
var EmbeddedTemplateAst = /** @class */ (function () {
function EmbeddedTemplateAst(attrs, outputs, references, variables, directives, providers, hasViewContainer, queryMatches, children, ngContentIndex, sourceSpan) {
this.attrs = attrs;
this.outputs = outputs;
this.references = references;
this.variables = variables;
this.directives = directives;
this.providers = providers;
this.hasViewContainer = hasViewContainer;
this.queryMatches = queryMatches;
this.children = children;
this.ngContentIndex = ngContentIndex;
this.sourceSpan = sourceSpan;
}
EmbeddedTemplateAst.prototype.visit = function (visitor, context) {
return visitor.visitEmbeddedTemplate(this, context);
};
return EmbeddedTemplateAst;
}());
/**
* A directive property with a bound value (e.g. `*ngIf="condition").
*/
var BoundDirectivePropertyAst = /** @class */ (function () {
function BoundDirectivePropertyAst(directiveName, templateName, value, sourceSpan) {
this.directiveName = directiveName;
this.templateName = templateName;
this.value = value;
this.sourceSpan = sourceSpan;
}
BoundDirectivePropertyAst.prototype.visit = function (visitor, context) {
return visitor.visitDirectiveProperty(this, context);
};
return BoundDirectivePropertyAst;
}());
/**
* A directive declared on an element.
*/
var DirectiveAst = /** @class */ (function () {
function DirectiveAst(directive, inputs, hostProperties, hostEvents, contentQueryStartId, sourceSpan) {
this.directive = directive;
this.inputs = inputs;
this.hostProperties = hostProperties;
this.hostEvents = hostEvents;
this.contentQueryStartId = contentQueryStartId;
this.sourceSpan = sourceSpan;
}
DirectiveAst.prototype.visit = function (visitor, context) {
return visitor.visitDirective(this, context);
};
return DirectiveAst;
}());
/**
* A provider declared on an element
*/
var ProviderAst = /** @class */ (function () {
function ProviderAst(token, multiProvider, eager, providers, providerType, lifecycleHooks, sourceSpan, isModule) {
this.token = token;
this.multiProvider = multiProvider;
this.eager = eager;
this.providers = providers;
this.providerType = providerType;
this.lifecycleHooks = lifecycleHooks;
this.sourceSpan = sourceSpan;
this.isModule = isModule;
}
ProviderAst.prototype.visit = function (visitor, context) {
// No visit method in the visitor for now...
return null;
};
return ProviderAst;
}());
var ProviderAstType;
(function (ProviderAstType) {
ProviderAstType[ProviderAstType["PublicService"] = 0] = "PublicService";
ProviderAstType[ProviderAstType["PrivateService"] = 1] = "PrivateService";
ProviderAstType[ProviderAstType["Component"] = 2] = "Component";
ProviderAstType[ProviderAstType["Directive"] = 3] = "Directive";
ProviderAstType[ProviderAstType["Builtin"] = 4] = "Builtin";
})(ProviderAstType || (ProviderAstType = {}));
/**
* Position where content is to be projected (instance of `<ng-content>` in a template).
*/
var NgContentAst = /** @class */ (function () {
function NgContentAst(index, ngContentIndex, sourceSpan) {
this.index = index;
this.ngContentIndex = ngContentIndex;
this.sourceSpan = sourceSpan;
}
NgContentAst.prototype.visit = function (visitor, context) {
return visitor.visitNgContent(this, context);
};
return NgContentAst;
}());
/**
* Enumeration of types of property bindings.
*/
var PropertyBindingType;
(function (PropertyBindingType) {
/**
* A normal binding to a property (e.g. `[property]="expression"`).
*/
PropertyBindingType[PropertyBindingType["Property"] = 0] = "Property";
/**
* A binding to an element attribute (e.g. `[attr.name]="expression"`).
*/
PropertyBindingType[PropertyBindingType["Attribute"] = 1] = "Attribute";
/**
* A binding to a CSS class (e.g. `[class.name]="condition"`).
*/
PropertyBindingType[PropertyBindingType["Class"] = 2] = "Class";
/**
* A binding to a style rule (e.g. `[style.rule]="expression"`).
*/
PropertyBindingType[PropertyBindingType["Style"] = 3] = "Style";
/**
* A binding to an animation reference (e.g. `[animate.key]="expression"`).
*/
PropertyBindingType[PropertyBindingType["Animation"] = 4] = "Animation";
})(PropertyBindingType || (PropertyBindingType = {}));
/**
* A visitor that accepts each node but doesn't do anything. It is intended to be used
* as the base class for a visitor that is only interested in a subset of the node types.
*/
var NullTemplateVisitor = /** @class */ (function () {
function NullTemplateVisitor() {
}
NullTemplateVisitor.prototype.visitNgContent = function (ast, context) { };
NullTemplateVisitor.prototype.visitEmbeddedTemplate = function (ast, context) { };
NullTemplateVisitor.prototype.visitElement = function (ast, context) { };
NullTemplateVisitor.prototype.visitReference = function (ast, context) { };
NullTemplateVisitor.prototype.visitVariable = function (ast, context) { };
NullTemplateVisitor.prototype.visitEvent = function (ast, context) { };
NullTemplateVisitor.prototype.visitElementProperty = function (ast, context) { };
NullTemplateVisitor.prototype.visitAttr = function (ast, context) { };
NullTemplateVisitor.prototype.visitBoundText = function (ast, context) { };
NullTemplateVisitor.prototype.visitText = function (ast, context) { };
NullTemplateVisitor.prototype.visitDirective = function (ast, context) { };
NullTemplateVisitor.prototype.visitDirectiveProperty = function (ast, context) { };
return NullTemplateVisitor;
}());
/**
* Base class that can be used to build a visitor that visits each node
* in an template ast recursively.
*/
var RecursiveTemplateAstVisitor = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(RecursiveTemplateAstVisitor, _super);
function RecursiveTemplateAstVisitor() {
return _super.call(this) || this;
}
// Nodes with children
RecursiveTemplateAstVisitor.prototype.visitEmbeddedTemplate = function (ast, context) {
return this.visitChildren(context, function (visit) {
visit(ast.attrs);
visit(ast.references);
visit(ast.variables);
visit(ast.directives);
visit(ast.providers);
visit(ast.children);
});
};
RecursiveTemplateAstVisitor.prototype.visitElement = function (ast, context) {
return this.visitChildren(context, function (visit) {
visit(ast.attrs);
visit(ast.inputs);
visit(ast.outputs);
visit(ast.references);
visit(ast.directives);
visit(ast.providers);
visit(ast.children);
});
};
RecursiveTemplateAstVisitor.prototype.visitDirective = function (ast, context) {
return this.visitChildren(context, function (visit) {
visit(ast.inputs);
visit(ast.hostProperties);
visit(ast.hostEvents);
});
};
RecursiveTemplateAstVisitor.prototype.visitChildren = function (context, cb) {
var results = [];
var t = this;
function visit(children) {
if (children && children.length)
results.push(templateVisitAll(t, children, context));
}
cb(visit);
return [].concat.apply([], results);
};
return RecursiveTemplateAstVisitor;
}(NullTemplateVisitor));
/**
* Visit every node in a list of {@link TemplateAst}s with the given {@link TemplateAstVisitor}.
*/
function templateVisitAll(visitor, asts, context) {
if (context === void 0) { context = null; }
var result = [];
var visit = visitor.visit ?
function (ast) { return visitor.visit(ast, context) || ast.visit(visitor, context); } :
function (ast) { return ast.visit(visitor, context); };
asts.forEach(function (ast) {
var astResult = visit(ast);
if (astResult) {
result.push(astResult);
}
});
return result;
}
/**
* @license
* Copyright Google Inc. 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 CompilerConfig = /** @class */ (function () {
function CompilerConfig(_a) {
var _b = _a === void 0 ? {} : _a, _c = _b.defaultEncapsulation, defaultEncapsulation = _c === void 0 ? ViewEncapsulation.Emulated : _c, _d = _b.useJit, useJit = _d === void 0 ? true : _d, _e = _b.jitDevMode, jitDevMode = _e === void 0 ? false : _e, _f = _b.missingTranslation, missingTranslation = _f === void 0 ? null : _f, preserveWhitespaces = _b.preserveWhitespaces, strictInjectionParameters = _b.strictInjectionParameters;
this.defaultEncapsulation = defaultEncapsulation;
this.useJit = !!useJit;
this.jitDevMode = !!jitDevMode;
this.missingTranslation = missingTranslation;
this.preserveWhitespaces = preserveWhitespacesDefault(noUndefined(preserveWhitespaces));
this.strictInjectionParameters = strictInjectionParameters === true;
}
return CompilerConfig;
}());
function preserveWhitespacesDefault(preserveWhitespacesOption, defaultSetting) {
if (defaultSetting === void 0) { defaultSetting = false; }
return preserveWhitespacesOption === null ? defaultSetting : preserveWhitespacesOption;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A token representing the a reference to a static type.
*
* This token is unique for a filePath and name and can be used as a hash table key.
*/
var StaticSymbol = /** @class */ (function () {
function StaticSymbol(filePath, name, members) {
this.filePath = filePath;
this.name = name;
this.members = members;
}
StaticSymbol.prototype.assertNoMembers = function () {
if (this.members.length) {
throw new Error("Illegal state: symbol without members expected, but got " + JSON.stringify(this) + ".");
}
};
return StaticSymbol;
}());
/**
* A cache of static symbol used by the StaticReflector to return the same symbol for the
* same symbol values.
*/
var StaticSymbolCache = /** @class */ (function () {
function StaticSymbolCache() {
this.cache = new Map();
}
StaticSymbolCache.prototype.get = function (declarationFile, name, members) {
members = members || [];
var memberSuffix = members.length ? "." + members.join('.') : '';
var key = "\"" + declarationFile + "\"." + name + memberSuffix;
var result = this.cache.get(key);
if (!result) {
result = new StaticSymbol(declarationFile, name, members);
this.cache.set(key, result);
}
return result;
};
return StaticSymbolCache;
}());
/**
* @license
* Copyright Google Inc. 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
*/
// group 0: "[prop] or (event) or @trigger"
// group 1: "prop" from "[prop]"
// group 2: "event" from "(event)"
// group 3: "@trigger" from "@trigger"
var HOST_REG_EXP = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))|(\@[-\w]+)$/;
function sanitizeIdentifier(name) {
return name.replace(/\W/g, '_');
}
var _anonymousTypeIndex = 0;
function identifierName(compileIdentifier) {
if (!compileIdentifier || !compileIdentifier.reference) {
return null;
}
var ref = compileIdentifier.reference;
if (ref instanceof StaticSymbol) {
return ref.name;
}
if (ref['__anonymousType']) {
return ref['__anonymousType'];
}
var identifier = stringify(ref);
if (identifier.indexOf('(') >= 0) {
// case: anonymous functions!
identifier = "anonymous_" + _anonymousTypeIndex++;
ref['__anonymousType'] = identifier;
}
else {
identifier = sanitizeIdentifier(identifier);
}
return identifier;
}
function identifierModuleUrl(compileIdentifier) {
var ref = compileIdentifier.reference;
if (ref instanceof StaticSymbol) {
return ref.filePath;
}
// Runtime type
return "./" + stringify(ref);
}
function viewClassName(compType, embeddedTemplateIndex) {
return "View_" + identifierName({ reference: compType }) + "_" + embeddedTemplateIndex;
}
function rendererTypeName(compType) {
return "RenderType_" + identifierName({ reference: compType });
}
function hostViewClassName(compType) {
return "HostView_" + identifierName({ reference: compType });
}
function componentFactoryName(compType) {
return identifierName({ reference: compType }) + "NgFactory";
}
var CompileSummaryKind;
(function (CompileSummaryKind) {
CompileSummaryKind[CompileSummaryKind["Pipe"] = 0] = "Pipe";
CompileSummaryKind[CompileSummaryKind["Directive"] = 1] = "Directive";
CompileSummaryKind[CompileSummaryKind["NgModule"] = 2] = "NgModule";
CompileSummaryKind[CompileSummaryKind["Injectable"] = 3] = "Injectable";
})(CompileSummaryKind || (CompileSummaryKind = {}));
function tokenName(token) {
return token.value != null ? sanitizeIdentifier(token.value) : identifierName(token.identifier);
}
function tokenReference(token) {
if (token.identifier != null) {
return token.identifier.reference;
}
else {
return token.value;
}
}
/**
* Metadata about a stylesheet
*/
var CompileStylesheetMetadata = /** @class */ (function () {
function CompileStylesheetMetadata(_a) {
var _b = _a === void 0 ? {} : _a, moduleUrl = _b.moduleUrl, styles = _b.styles, styleUrls = _b.styleUrls;
this.moduleUrl = moduleUrl || null;
this.styles = _normalizeArray(styles);
this.styleUrls = _normalizeArray(styleUrls);
}
return CompileStylesheetMetadata;
}());
/**
* Metadata regarding compilation of a template.
*/
var CompileTemplateMetadata = /** @class */ (function () {
function CompileTemplateMetadata(_a) {
var encapsulation = _a.encapsulation, template = _a.template, templateUrl = _a.templateUrl, htmlAst = _a.htmlAst, styles = _a.styles, styleUrls = _a.styleUrls, externalStylesheets = _a.externalStylesheets, animations = _a.animations, ngContentSelectors = _a.ngContentSelectors, interpolation = _a.interpolation, isInline = _a.isInline, preserveWhitespaces = _a.preserveWhitespaces;
this.encapsulation = encapsulation;
this.template = template;
this.templateUrl = templateUrl;
this.htmlAst = htmlAst;
this.styles = _normalizeArray(styles);
this.styleUrls = _normalizeArray(styleUrls);
this.externalStylesheets = _normalizeArray(externalStylesheets);
this.animations = animations ? flatten(animations) : [];
this.ngContentSelectors = ngContentSelectors || [];
if (interpolation && interpolation.length != 2) {
throw new Error("'interpolation' should have a start and an end symbol.");
}
this.interpolation = interpolation;
this.isInline = isInline;
this.preserveWhitespaces = preserveWhitespaces;
}
CompileTemplateMetadata.prototype.toSummary = function () {
return {
ngContentSelectors: this.ngContentSelectors,
encapsulation: this.encapsulation,
};
};
return CompileTemplateMetadata;
}());
/**
* Metadata regarding compilation of a directive.
*/
var CompileDirectiveMetadata = /** @class */ (function () {
function CompileDirectiveMetadata(_a) {
var isHost = _a.isHost, type = _a.type, isComponent = _a.isComponent, selector = _a.selector, exportAs = _a.exportAs, changeDetection = _a.changeDetection, inputs = _a.inputs, outputs = _a.outputs, hostListeners = _a.hostListeners, hostProperties = _a.hostProperties, hostAttributes = _a.hostAttributes, providers = _a.providers, viewProviders = _a.viewProviders, queries = _a.queries, guards = _a.guards, viewQueries = _a.viewQueries, entryComponents = _a.entryComponents, template = _a.template, componentViewType = _a.componentViewType, rendererType = _a.rendererType, componentFactory = _a.componentFactory;
this.isHost = !!isHost;
this.type = type;
this.isComponent = isComponent;
this.selector = selector;
this.exportAs = exportAs;
this.changeDetection = changeDetection;
this.inputs = inputs;
this.outputs = outputs;
this.hostListeners = hostListeners;
this.hostProperties = hostProperties;
this.hostAttributes = hostAttributes;
this.providers = _normalizeArray(providers);
this.viewProviders = _normalizeArray(viewProviders);
this.queries = _normalizeArray(queries);
this.guards = guards;
this.viewQueries = _normalizeArray(viewQueries);
this.entryComponents = _normalizeArray(entryComponents);
this.template = template;
this.componentViewType = componentViewType;
this.rendererType = rendererType;
this.componentFactory = componentFactory;
}
CompileDirectiveMetadata.create = function (_a) {
var isHost = _a.isHost, type = _a.type, isComponent = _a.isComponent, selector = _a.selector, exportAs = _a.exportAs, changeDetection = _a.changeDetection, inputs = _a.inputs, outputs = _a.outputs, host = _a.host, providers = _a.providers, viewProviders = _a.viewProviders, queries = _a.queries, guards = _a.guards, viewQueries = _a.viewQueries, entryComponents = _a.entryComponents, template = _a.template, componentViewType = _a.componentViewType, rendererType = _a.rendererType, componentFactory = _a.componentFactory;
var hostListeners = {};
var hostProperties = {};
var hostAttributes = {};
if (host != null) {
Object.keys(host).forEach(function (key) {
var value = host[key];
var matches = key.match(HOST_REG_EXP);
if (matches === null) {
hostAttributes[key] = value;
}
else if (matches[1] != null) {
hostProperties[matches[1]] = value;
}
else if (matches[2] != null) {
hostListeners[matches[2]] = value;
}
});
}
var inputsMap = {};
if (inputs != null) {
inputs.forEach(function (bindConfig) {
// canonical syntax: `dirProp: elProp`
// if there is no `:`, use dirProp = elProp
var parts = splitAtColon(bindConfig, [bindConfig, bindConfig]);
inputsMap[parts[0]] = parts[1];
});
}
var outputsMap = {};
if (outputs != null) {
outputs.forEach(function (bindConfig) {
// canonical syntax: `dirProp: elProp`
// if there is no `:`, use dirProp = elProp
var parts = splitAtColon(bindConfig, [bindConfig, bindConfig]);
outputsMap[parts[0]] = parts[1];
});
}
return new CompileDirectiveMetadata({
isHost: isHost,
type: type,
isComponent: !!isComponent, selector: selector, exportAs: exportAs, changeDetection: changeDetection,
inputs: inputsMap,
outputs: outputsMap,
hostListeners: hostListeners,
hostProperties: hostProperties,
hostAttributes: hostAttributes,
providers: providers,
viewProviders: viewProviders,
queries: queries,
guards: guards,
viewQueries: viewQueries,
entryComponents: entryComponents,
template: template,
componentViewType: componentViewType,
rendererType: rendererType,
componentFactory: componentFactory,
});
};
CompileDirectiveMetadata.prototype.toSummary = function () {
return {
summaryKind: CompileSummaryKind.Directive,
type: this.type,
isComponent: this.isComponent,
selector: this.selector,
exportAs: this.exportAs,
inputs: this.inputs,
outputs: this.outputs,
hostListeners: this.hostListeners,
hostProperties: this.hostProperties,
hostAttributes: this.hostAttributes,
providers: this.providers,
viewProviders: this.viewProviders,
queries: this.queries,
guards: this.guards,
viewQueries: this.viewQueries,
entryComponents: this.entryComponents,
changeDetection: this.changeDetection,
template: this.template && this.template.toSummary(),
componentViewType: this.componentViewType,
rendererType: this.rendererType,
componentFactory: this.componentFactory
};
};
return CompileDirectiveMetadata;
}());
var CompilePipeMetadata = /** @class */ (function () {
function CompilePipeMetadata(_a) {
var type = _a.type, name = _a.name, pure = _a.pure;
this.type = type;
this.name = name;
this.pure = !!pure;
}
CompilePipeMetadata.prototype.toSummary = function () {
return {
summaryKind: CompileSummaryKind.Pipe,
type: this.type,
name: this.name,
pure: this.pure
};
};
return CompilePipeMetadata;
}());
var CompileShallowModuleMetadata = /** @class */ (function () {
function CompileShallowModuleMetadata() {
}
return CompileShallowModuleMetadata;
}());
/**
* Metadata regarding compilation of a module.
*/
var CompileNgModuleMetadata = /** @class */ (function () {
function CompileNgModuleMetadata(_a) {
var type = _a.type, providers = _a.providers, declaredDirectives = _a.declaredDirectives, exportedDirectives = _a.exportedDirectives, declaredPipes = _a.declaredPipes, exportedPipes = _a.exportedPipes, entryComponents = _a.entryComponents, bootstrapComponents = _a.bootstrapComponents, importedModules = _a.importedModules, exportedModules = _a.exportedModules, schemas = _a.schemas, transitiveModule = _a.transitiveModule, id = _a.id;
this.type = type || null;
this.declaredDirectives = _normalizeArray(declaredDirectives);
this.exportedDirectives = _normalizeArray(exportedDirectives);
this.declaredPipes = _normalizeArray(declaredPipes);
this.exportedPipes = _normalizeArray(exportedPipes);
this.providers = _normalizeArray(providers);
this.entryComponents = _normalizeArray(entryComponents);
this.bootstrapComponents = _normalizeArray(bootstrapComponents);
this.importedModules = _normalizeArray(importedModules);
this.exportedModules = _normalizeArray(exportedModules);
this.schemas = _normalizeArray(schemas);
this.id = id || null;
this.transitiveModule = transitiveModule || null;
}
CompileNgModuleMetadata.prototype.toSummary = function () {
var module = this.transitiveModule;
return {
summaryKind: CompileSummaryKind.NgModule,
type: this.type,
entryComponents: module.entryComponents,
providers: module.providers,
modules: module.modules,
exportedDirectives: module.exportedDirectives,
exportedPipes: module.exportedPipes
};
};
return CompileNgModuleMetadata;
}());
var TransitiveCompileNgModuleMetadata = /** @class */ (function () {
function TransitiveCompileNgModuleMetadata() {
this.directivesSet = new Set();
this.directives = [];
this.exportedDirectivesSet = new Set();
this.exportedDirectives = [];
this.pipesSet = new Set();
this.pipes = [];
this.exportedPipesSet = new Set();
this.exportedPipes = [];
this.modulesSet = new Set();
this.modules = [];
this.entryComponentsSet = new Set();
this.entryComponents = [];
this.providers = [];
}
TransitiveCompileNgModuleMetadata.prototype.addProvider = function (provider, module) {
this.providers.push({ provider: provider, module: module });
};
TransitiveCompileNgModuleMetadata.prototype.addDirective = function (id) {
if (!this.directivesSet.has(id.reference)) {
this.directivesSet.add(id.reference);
this.directives.push(id);
}
};
TransitiveCompileNgModuleMetadata.prototype.addExportedDirective = function (id) {
if (!this.exportedDirectivesSet.has(id.reference)) {
this.exportedDirectivesSet.add(id.reference);
this.exportedDirectives.push(id);
}
};
TransitiveCompileNgModuleMetadata.prototype.addPipe = function (id) {
if (!this.pipesSet.has(id.reference)) {
this.pipesSet.add(id.reference);
this.pipes.push(id);
}
};
TransitiveCompileNgModuleMetadata.prototype.addExportedPipe = function (id) {
if (!this.exportedPipesSet.has(id.reference)) {
this.exportedPipesSet.add(id.reference);
this.exportedPipes.push(id);
}
};
TransitiveCompileNgModuleMetadata.prototype.addModule = function (id) {
if (!this.modulesSet.has(id.reference)) {
this.modulesSet.add(id.reference);
this.modules.push(id);
}
};
TransitiveCompileNgModuleMetadata.prototype.addEntryComponent = function (ec) {
if (!this.entryComponentsSet.has(ec.componentType)) {
this.entryComponentsSet.add(ec.componentType);
this.entryComponents.push(ec);
}
};
return TransitiveCompileNgModuleMetadata;
}());
function _normalizeArray(obj) {
return obj || [];
}
var ProviderMeta = /** @class */ (function () {
function ProviderMeta(token, _a) {
var useClass = _a.useClass, useValue = _a.useValue, useExisting = _a.useExisting, useFactory = _a.useFactory, deps = _a.deps, multi = _a.multi;
this.token = token;
this.useClass = useClass || null;
this.useValue = useValue;
this.useExisting = useExisting;
this.useFactory = useFactory || null;
this.dependencies = deps || null;
this.multi = !!multi;
}
return ProviderMeta;
}());
function flatten(list) {
return list.reduce(function (flat, item) {
var flatItem = Array.isArray(item) ? flatten(item) : item;
return flat.concat(flatItem);
}, []);
}
function jitSourceUrl(url) {
// Note: We need 3 "/" so that ng shows up as a separate domain
// in the chrome dev tools.
return url.replace(/(\w+:\/\/[\w:-]+)?(\/+)?/, 'ng:///');
}
function templateSourceUrl(ngModuleType, compMeta, templateMeta) {
var url;
if (templateMeta.isInline) {
if (compMeta.type.reference instanceof StaticSymbol) {
// Note: a .ts file might contain multiple components with inline templates,
// so we need to give them unique urls, as these will be used for sourcemaps.
url = compMeta.type.reference.filePath + "." + compMeta.type.reference.name + ".html";
}
else {
url = identifierName(ngModuleType) + "/" + identifierName(compMeta.type) + ".html";
}
}
else {
url = templateMeta.templateUrl;
}
return compMeta.type.reference instanceof StaticSymbol ? url : jitSourceUrl(url);
}
function sharedStylesheetJitUrl(meta, id) {
var pathParts = meta.moduleUrl.split(/\/\\/g);
var baseName = pathParts[pathParts.length - 1];
return jitSourceUrl("css/" + id + baseName + ".ngstyle.js");
}
function ngModuleJitUrl(moduleMeta) {
return jitSourceUrl(identifierName(moduleMeta.type) + "/module.ngfactory.js");
}
function templateJitUrl(ngModuleType, compMeta) {
return jitSourceUrl(identifierName(ngModuleType) + "/" + identifierName(compMeta.type) + ".ngfactory.js");
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A path is an ordered set of elements. Typically a path is to a
* particular offset in a source file. The head of the list is the top
* most node. The tail is the node that contains the offset directly.
*
* For example, the expression `a + b + c` might have an ast that looks
* like:
* +
* / \
* a +
* / \
* b c
*
* The path to the node at offset 9 would be `['+' at 1-10, '+' at 7-10,
* 'c' at 9-10]` and the path the node at offset 1 would be
* `['+' at 1-10, 'a' at 1-2]`.
*/
var AstPath = /** @class */ (function () {
function AstPath(path, position) {
if (position === void 0) { position = -1; }
this.path = path;
this.position = position;
}
Object.defineProperty(AstPath.prototype, "empty", {
get: function () { return !this.path || !this.path.length; },
enumerable: true,
configurable: true
});
Object.defineProperty(AstPath.prototype, "head", {
get: function () { return this.path[0]; },
enumerable: true,
configurable: true
});
Object.defineProperty(AstPath.prototype, "tail", {
get: function () { return this.path[this.path.length - 1]; },
enumerable: true,
configurable: true
});
AstPath.prototype.parentOf = function (node) {
return node && this.path[this.path.indexOf(node) - 1];
};
AstPath.prototype.childOf = function (node) { return this.path[this.path.indexOf(node) + 1]; };
AstPath.prototype.first = function (ctor) {
for (var i = this.path.length - 1; i >= 0; i--) {
var item = this.path[i];
if (item instanceof ctor)
return item;
}
};
AstPath.prototype.push = function (node) { this.path.push(node); };
AstPath.prototype.pop = function () { return this.path.pop(); };
return AstPath;
}());
/**
* @license
* Copyright Google Inc. 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 Text = /** @class */ (function () {
function Text(value, sourceSpan) {
this.value = value;
this.sourceSpan = sourceSpan;
}
Text.prototype.visit = function (visitor, context) { return visitor.visitText(this, context); };
return Text;
}());
var Expansion = /** @class */ (function () {
function Expansion(switchValue, type, cases, sourceSpan, switchValueSourceSpan) {
this.switchValue = switchValue;
this.type = type;
this.cases = cases;
this.sourceSpan = sourceSpan;
this.switchValueSourceSpan = switchValueSourceSpan;
}
Expansion.prototype.visit = function (visitor, context) { return visitor.visitExpansion(this, context); };
return Expansion;
}());
var ExpansionCase = /** @class */ (function () {
function ExpansionCase(value, expression, sourceSpan, valueSourceSpan, expSourceSpan) {
this.value = value;
this.expression = expression;
this.sourceSpan = sourceSpan;
this.valueSourceSpan = valueSourceSpan;
this.expSourceSpan = expSourceSpan;
}
ExpansionCase.prototype.visit = function (visitor, context) { return visitor.visitExpansionCase(this, context); };
return ExpansionCase;
}());
var Attribute = /** @class */ (function () {
function Attribute(name, value, sourceSpan, valueSpan) {
this.name = name;
this.value = value;
this.sourceSpan = sourceSpan;
this.valueSpan = valueSpan;
}
Attribute.prototype.visit = function (visitor, context) { return visitor.visitAttribute(this, context); };
return Attribute;
}());
var Element = /** @class */ (function () {
function Element(name, attrs, children, sourceSpan, startSourceSpan, endSourceSpan) {
if (startSourceSpan === void 0) { startSourceSpan = null; }
if (endSourceSpan === void 0) { endSourceSpan = null; }
this.name = name;
this.attrs = attrs;
this.children = children;
this.sourceSpan = sourceSpan;
this.startSourceSpan = startSourceSpan;
this.endSourceSpan = endSourceSpan;
}
Element.prototype.visit = function (visitor, context) { return visitor.visitElement(this, context); };
return Element;
}());
var Comment = /** @class */ (function () {
function Comment(value, sourceSpan) {
this.value = value;
this.sourceSpan = sourceSpan;
}
Comment.prototype.visit = function (visitor, context) { return visitor.visitComment(this, context); };
return Comment;
}());
function visitAll(visitor, nodes, context) {
if (context === void 0) { context = null; }
var result = [];
var visit = visitor.visit ?
function (ast) { return visitor.visit(ast, context) || ast.visit(visitor, context); } :
function (ast) { return ast.visit(visitor, context); };
nodes.forEach(function (ast) {
var astResult = visit(ast);
if (astResult) {
result.push(astResult);
}
});
return result;
}
var RecursiveVisitor = /** @class */ (function () {
function RecursiveVisitor() {
}
RecursiveVisitor.prototype.visitElement = function (ast, context) {
this.visitChildren(context, function (visit) {
visit(ast.attrs);
visit(ast.children);
});
};
RecursiveVisitor.prototype.visitAttribute = function (ast, context) { };
RecursiveVisitor.prototype.visitText = function (ast, context) { };
RecursiveVisitor.prototype.visitComment = function (ast, context) { };
RecursiveVisitor.prototype.visitExpansion = function (ast, context) {
return this.visitChildren(context, function (visit) { visit(ast.cases); });
};
RecursiveVisitor.prototype.visitExpansionCase = function (ast, context) { };
RecursiveVisitor.prototype.visitChildren = function (context, cb) {
var results = [];
var t = this;
function visit(children) {
if (children)
results.push(visitAll(t, children, context));
}
cb(visit);
return [].concat.apply([], results);
};
return RecursiveVisitor;
}());
function spanOf(ast) {
var start = ast.sourceSpan.start.offset;
var end = ast.sourceSpan.end.offset;
if (ast instanceof Element) {
if (ast.endSourceSpan) {
end = ast.endSourceSpan.end.offset;
}
else if (ast.children && ast.children.length) {
end = spanOf(ast.children[ast.children.length - 1]).end;
}
}
return { start: start, end: end };
}
function findNode(nodes, position) {
var path = [];
var visitor = new /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(class_1, _super);
function class_1() {
return _super !== null && _super.apply(this, arguments) || this;
}
class_1.prototype.visit = function (ast, context) {
var span = spanOf(ast);
if (span.start <= position && position < span.end) {
path.push(ast);
}
else {
// Returning a value here will result in the children being skipped.
return true;
}
};
return class_1;
}(RecursiveVisitor));
visitAll(visitor, nodes);
return new AstPath(path, position);
}
/**
* @license
* Copyright Google Inc. 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
*/
function assertArrayOfStrings(identifier, value) {
if (value == null) {
return;
}
if (!Array.isArray(value)) {
throw new Error("Expected '" + identifier + "' to be an array of strings.");
}
for (var i = 0; i < value.length; i += 1) {
if (typeof value[i] !== 'string') {
throw new Error("Expected '" + identifier + "' to be an array of strings.");
}
}
}
var INTERPOLATION_BLACKLIST_REGEXPS = [
/^\s*$/,
/[<>]/,
/^[{}]$/,
/&(#|[a-z])/i,
/^\/\//,
];
function assertInterpolationSymbols(identifier, value) {
if (value != null && !(Array.isArray(value) && value.length == 2)) {
throw new Error("Expected '" + identifier + "' to be an array, [start, end].");
}
else if (value != null) {
var start_1 = value[0];
var end_1 = value[1];
// black list checking
INTERPOLATION_BLACKLIST_REGEXPS.forEach(function (regexp) {
if (regexp.test(start_1) || regexp.test(end_1)) {
throw new Error("['" + start_1 + "', '" + end_1 + "'] contains unusable interpolation symbol.");
}
});
}
}
/**
* @license
* Copyright Google Inc. 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 InterpolationConfig = /** @class */ (function () {
function InterpolationConfig(start, end) {
this.start = start;
this.end = end;
}
InterpolationConfig.fromArray = function (markers) {
if (!markers) {
return DEFAULT_INTERPOLATION_CONFIG;
}
assertInterpolationSymbols('interpolation', markers);
return new InterpolationConfig(markers[0], markers[1]);
};
return InterpolationConfig;
}());
var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig('{{', '}}');
/**
* @license
* Copyright Google Inc. 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 StyleWithImports = /** @class */ (function () {
function StyleWithImports(style, styleUrls) {
this.style = style;
this.styleUrls = styleUrls;
}
return StyleWithImports;
}());
function isStyleUrlResolvable(url) {
if (url == null || url.length === 0 || url[0] == '/')
return false;
var schemeMatch = url.match(URL_WITH_SCHEMA_REGEXP);
return schemeMatch === null || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset';
}
/**
* Rewrites stylesheets by resolving and removing the @import urls that
* are either relative or don't have a `package:` scheme
*/
function extractStyleUrls(resolver, baseUrl, cssText) {
var foundUrls = [];
var modifiedCssText = cssText.replace(CSS_STRIPPABLE_COMMENT_REGEXP, '')
.replace(CSS_IMPORT_REGEXP, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i] = arguments[_i];
}
var url = m[1] || m[2];
if (!isStyleUrlResolvable(url)) {
// Do not attempt to resolve non-package absolute URLs with URI
// scheme
return m[0];
}
foundUrls.push(resolver.resolve(baseUrl, url));
return '';
});
return new StyleWithImports(modifiedCssText, foundUrls);
}
var CSS_IMPORT_REGEXP = /@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g;
var CSS_STRIPPABLE_COMMENT_REGEXP = /\/\*(?!#\s*(?:sourceURL|sourceMappingURL)=)[\s\S]+?\*\//g;
var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
/**
* @license
* Copyright Google Inc. 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 TagContentType;
(function (TagContentType) {
TagContentType[TagContentType["RAW_TEXT"] = 0] = "RAW_TEXT";
TagContentType[TagContentType["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
TagContentType[TagContentType["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
})(TagContentType || (TagContentType = {}));
function splitNsName(elementName) {
if (elementName[0] != ':') {
return [null, elementName];
}
var colonIndex = elementName.indexOf(':', 1);
if (colonIndex == -1) {
throw new Error("Unsupported format \"" + elementName + "\" expecting \":namespace:name\"");
}
return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
}
// `<ng-container>` tags work the same regardless the namespace
function isNgContainer(tagName) {
return splitNsName(tagName)[1] === 'ng-container';
}
// `<ng-content>` tags work the same regardless the namespace
function isNgContent(tagName) {
return splitNsName(tagName)[1] === 'ng-content';
}
// `<ng-template>` tags work the same regardless the namespace
function isNgTemplate(tagName) {
return splitNsName(tagName)[1] === 'ng-template';
}
function getNsPrefix(fullName) {
return fullName === null ? null : splitNsName(fullName)[0];
}
function mergeNsAndName(prefix, localName) {
return prefix ? ":" + prefix + ":" + localName : localName;
}
// see http://www.w3.org/TR/html51/syntax.html#named-character-references
// see https://html.spec.whatwg.org/multipage/entities.json
// This list is not exhaustive to keep the compiler footprint low.
// The `&#123;` / `&#x1ab;` syntax should be used when the named character reference does not
// exist.
var NAMED_ENTITIES = {
'Aacute': '\u00C1',
'aacute': '\u00E1',
'Acirc': '\u00C2',
'acirc': '\u00E2',
'acute': '\u00B4',
'AElig': '\u00C6',
'aelig': '\u00E6',
'Agrave': '\u00C0',
'agrave': '\u00E0',
'alefsym': '\u2135',
'Alpha': '\u0391',
'alpha': '\u03B1',
'amp': '&',
'and': '\u2227',
'ang': '\u2220',
'apos': '\u0027',
'Aring': '\u00C5',
'aring': '\u00E5',
'asymp': '\u2248',
'Atilde': '\u00C3',
'atilde': '\u00E3',
'Auml': '\u00C4',
'auml': '\u00E4',
'bdquo': '\u201E',
'Beta': '\u0392',
'beta': '\u03B2',
'brvbar': '\u00A6',
'bull': '\u2022',
'cap': '\u2229',
'Ccedil': '\u00C7',
'ccedil': '\u00E7',
'cedil': '\u00B8',
'cent': '\u00A2',
'Chi': '\u03A7',
'chi': '\u03C7',
'circ': '\u02C6',
'clubs': '\u2663',
'cong': '\u2245',
'copy': '\u00A9',
'crarr': '\u21B5',
'cup': '\u222A',
'curren': '\u00A4',
'dagger': '\u2020',
'Dagger': '\u2021',
'darr': '\u2193',
'dArr': '\u21D3',
'deg': '\u00B0',
'Delta': '\u0394',
'delta': '\u03B4',
'diams': '\u2666',
'divide': '\u00F7',
'Eacute': '\u00C9',
'eacute': '\u00E9',
'Ecirc': '\u00CA',
'ecirc': '\u00EA',
'Egrave': '\u00C8',
'egrave': '\u00E8',
'empty': '\u2205',
'emsp': '\u2003',
'ensp': '\u2002',
'Epsilon': '\u0395',
'epsilon': '\u03B5',
'equiv': '\u2261',
'Eta': '\u0397',
'eta': '\u03B7',
'ETH': '\u00D0',
'eth': '\u00F0',
'Euml': '\u00CB',
'euml': '\u00EB',
'euro': '\u20AC',
'exist': '\u2203',
'fnof': '\u0192',
'forall': '\u2200',
'frac12': '\u00BD',
'frac14': '\u00BC',
'frac34': '\u00BE',
'frasl': '\u2044',
'Gamma': '\u0393',
'gamma': '\u03B3',
'ge': '\u2265',
'gt': '>',
'harr': '\u2194',
'hArr': '\u21D4',
'hearts': '\u2665',
'hellip': '\u2026',
'Iacute': '\u00CD',
'iacute': '\u00ED',
'Icirc': '\u00CE',
'icirc': '\u00EE',
'iexcl': '\u00A1',
'Igrave': '\u00CC',
'igrave': '\u00EC',
'image': '\u2111',
'infin': '\u221E',
'int': '\u222B',
'Iota': '\u0399',
'iota': '\u03B9',
'iquest': '\u00BF',
'isin': '\u2208',
'Iuml': '\u00CF',
'iuml': '\u00EF',
'Kappa': '\u039A',
'kappa': '\u03BA',
'Lambda': '\u039B',
'lambda': '\u03BB',
'lang': '\u27E8',
'laquo': '\u00AB',
'larr': '\u2190',
'lArr': '\u21D0',
'lceil': '\u2308',
'ldquo': '\u201C',
'le': '\u2264',
'lfloor': '\u230A',
'lowast': '\u2217',
'loz': '\u25CA',
'lrm': '\u200E',
'lsaquo': '\u2039',
'lsquo': '\u2018',
'lt': '<',
'macr': '\u00AF',
'mdash': '\u2014',
'micro': '\u00B5',
'middot': '\u00B7',
'minus': '\u2212',
'Mu': '\u039C',
'mu': '\u03BC',
'nabla': '\u2207',
'nbsp': '\u00A0',
'ndash': '\u2013',
'ne': '\u2260',
'ni': '\u220B',
'not': '\u00AC',
'notin': '\u2209',
'nsub': '\u2284',
'Ntilde': '\u00D1',
'ntilde': '\u00F1',
'Nu': '\u039D',
'nu': '\u03BD',
'Oacute': '\u00D3',
'oacute': '\u00F3',
'Ocirc': '\u00D4',
'ocirc': '\u00F4',
'OElig': '\u0152',
'oelig': '\u0153',
'Ograve': '\u00D2',
'ograve': '\u00F2',
'oline': '\u203E',
'Omega': '\u03A9',
'omega': '\u03C9',
'Omicron': '\u039F',
'omicron': '\u03BF',
'oplus': '\u2295',
'or': '\u2228',
'ordf': '\u00AA',
'ordm': '\u00BA',
'Oslash': '\u00D8',
'oslash': '\u00F8',
'Otilde': '\u00D5',
'otilde': '\u00F5',
'otimes': '\u2297',
'Ouml': '\u00D6',
'ouml': '\u00F6',
'para': '\u00B6',
'permil': '\u2030',
'perp': '\u22A5',
'Phi': '\u03A6',
'phi': '\u03C6',
'Pi': '\u03A0',
'pi': '\u03C0',
'piv': '\u03D6',
'plusmn': '\u00B1',
'pound': '\u00A3',
'prime': '\u2032',
'Prime': '\u2033',
'prod': '\u220F',
'prop': '\u221D',
'Psi': '\u03A8',
'psi': '\u03C8',
'quot': '\u0022',
'radic': '\u221A',
'rang': '\u27E9',
'raquo': '\u00BB',
'rarr': '\u2192',
'rArr': '\u21D2',
'rceil': '\u2309',
'rdquo': '\u201D',
'real': '\u211C',
'reg': '\u00AE',
'rfloor': '\u230B',
'Rho': '\u03A1',
'rho': '\u03C1',
'rlm': '\u200F',
'rsaquo': '\u203A',
'rsquo': '\u2019',
'sbquo': '\u201A',
'Scaron': '\u0160',
'scaron': '\u0161',
'sdot': '\u22C5',
'sect': '\u00A7',
'shy': '\u00AD',
'Sigma': '\u03A3',
'sigma': '\u03C3',
'sigmaf': '\u03C2',
'sim': '\u223C',
'spades': '\u2660',
'sub': '\u2282',
'sube': '\u2286',
'sum': '\u2211',
'sup': '\u2283',
'sup1': '\u00B9',
'sup2': '\u00B2',
'sup3': '\u00B3',
'supe': '\u2287',
'szlig': '\u00DF',
'Tau': '\u03A4',
'tau': '\u03C4',
'there4': '\u2234',
'Theta': '\u0398',
'theta': '\u03B8',
'thetasym': '\u03D1',
'thinsp': '\u2009',
'THORN': '\u00DE',
'thorn': '\u00FE',
'tilde': '\u02DC',
'times': '\u00D7',
'trade': '\u2122',
'Uacute': '\u00DA',
'uacute': '\u00FA',
'uarr': '\u2191',
'uArr': '\u21D1',
'Ucirc': '\u00DB',
'ucirc': '\u00FB',
'Ugrave': '\u00D9',
'ugrave': '\u00F9',
'uml': '\u00A8',
'upsih': '\u03D2',
'Upsilon': '\u03A5',
'upsilon': '\u03C5',
'Uuml': '\u00DC',
'uuml': '\u00FC',
'weierp': '\u2118',
'Xi': '\u039E',
'xi': '\u03BE',
'Yacute': '\u00DD',
'yacute': '\u00FD',
'yen': '\u00A5',
'yuml': '\u00FF',
'Yuml': '\u0178',
'Zeta': '\u0396',
'zeta': '\u03B6',
'zwj': '\u200D',
'zwnj': '\u200C',
};
// The &ngsp; pseudo-entity is denoting a space. see:
// https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart
var NGSP_UNICODE = '\uE500';
NAMED_ENTITIES['ngsp'] = NGSP_UNICODE;
/**
* @license
* Copyright Google Inc. 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 NG_CONTENT_SELECT_ATTR = 'select';
var LINK_ELEMENT = 'link';
var LINK_STYLE_REL_ATTR = 'rel';
var LINK_STYLE_HREF_ATTR = 'href';
var LINK_STYLE_REL_VALUE = 'stylesheet';
var STYLE_ELEMENT = 'style';
var SCRIPT_ELEMENT = 'script';
var NG_NON_BINDABLE_ATTR = 'ngNonBindable';
var NG_PROJECT_AS = 'ngProjectAs';
function preparseElement(ast) {
var selectAttr = null;
var hrefAttr = null;
var relAttr = null;
var nonBindable = false;
var projectAs = null;
ast.attrs.forEach(function (attr) {
var lcAttrName = attr.name.toLowerCase();
if (lcAttrName == NG_CONTENT_SELECT_ATTR) {
selectAttr = attr.value;
}
else if (lcAttrName == LINK_STYLE_HREF_ATTR) {
hrefAttr = attr.value;
}
else if (lcAttrName == LINK_STYLE_REL_ATTR) {
relAttr = attr.value;
}
else if (attr.name == NG_NON_BINDABLE_ATTR) {
nonBindable = true;
}
else if (attr.name == NG_PROJECT_AS) {
if (attr.value.length > 0) {
projectAs = attr.value;
}
}
});
selectAttr = normalizeNgContentSelect(selectAttr);
var nodeName = ast.name.toLowerCase();
var type = PreparsedElementType.OTHER;
if (isNgContent(nodeName)) {
type = PreparsedElementType.NG_CONTENT;
}
else if (nodeName == STYLE_ELEMENT) {
type = PreparsedElementType.STYLE;
}
else if (nodeName == SCRIPT_ELEMENT) {
type = PreparsedElementType.SCRIPT;
}
else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) {
type = PreparsedElementType.STYLESHEET;
}
return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs);
}
var PreparsedElementType;
(function (PreparsedElementType) {
PreparsedElementType[PreparsedElementType["NG_CONTENT"] = 0] = "NG_CONTENT";
PreparsedElementType[PreparsedElementType["STYLE"] = 1] = "STYLE";
PreparsedElementType[PreparsedElementType["STYLESHEET"] = 2] = "STYLESHEET";
PreparsedElementType[PreparsedElementType["SCRIPT"] = 3] = "SCRIPT";
PreparsedElementType[PreparsedElementType["OTHER"] = 4] = "OTHER";
})(PreparsedElementType || (PreparsedElementType = {}));
var PreparsedElement = /** @class */ (function () {
function PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs) {
this.type = type;
this.selectAttr = selectAttr;
this.hrefAttr = hrefAttr;
this.nonBindable = nonBindable;
this.projectAs = projectAs;
}
return PreparsedElement;
}());
function normalizeNgContentSelect(selectAttr) {
if (selectAttr === null || selectAttr.length === 0) {
return '*';
}
return selectAttr;
}
/**
* @license
* Copyright Google Inc. 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 DirectiveNormalizer = /** @class */ (function () {
function DirectiveNormalizer(_resourceLoader, _urlResolver, _htmlParser, _config) {
this._resourceLoader = _resourceLoader;
this._urlResolver = _urlResolver;
this._htmlParser = _htmlParser;
this._config = _config;
this._resourceLoaderCache = new Map();
}
DirectiveNormalizer.prototype.clearCache = function () { this._resourceLoaderCache.clear(); };
DirectiveNormalizer.prototype.clearCacheFor = function (normalizedDirective) {
var _this = this;
if (!normalizedDirective.isComponent) {
return;
}
var template = normalizedDirective.template;
this._resourceLoaderCache.delete(template.templateUrl);
template.externalStylesheets.forEach(function (stylesheet) { _this._resourceLoaderCache.delete(stylesheet.moduleUrl); });
};
DirectiveNormalizer.prototype._fetch = function (url) {
var result = this._resourceLoaderCache.get(url);
if (!result) {
result = this._resourceLoader.get(url);
this._resourceLoaderCache.set(url, result);
}
return result;
};
DirectiveNormalizer.prototype.normalizeTemplate = function (prenormData) {
var _this = this;
if (isDefined(prenormData.template)) {
if (isDefined(prenormData.templateUrl)) {
throw syntaxError("'" + stringify(prenormData.componentType) + "' component cannot define both template and templateUrl");
}
if (typeof prenormData.template !== 'string') {
throw syntaxError("The template specified for component " + stringify(prenormData.componentType) + " is not a string");
}
}
else if (isDefined(prenormData.templateUrl)) {
if (typeof prenormData.templateUrl !== 'string') {
throw syntaxError("The templateUrl specified for component " + stringify(prenormData.componentType) + " is not a string");
}
}
else {
throw syntaxError("No template specified for component " + stringify(prenormData.componentType));
}
if (isDefined(prenormData.preserveWhitespaces) &&
typeof prenormData.preserveWhitespaces !== 'boolean') {
throw syntaxError("The preserveWhitespaces option for component " + stringify(prenormData.componentType) + " must be a boolean");
}
return SyncAsync.then(this._preParseTemplate(prenormData), function (preparsedTemplate) { return _this._normalizeTemplateMetadata(prenormData, preparsedTemplate); });
};
DirectiveNormalizer.prototype._preParseTemplate = function (prenomData) {
var _this = this;
var template;
var templateUrl;
if (prenomData.template != null) {
template = prenomData.template;
templateUrl = prenomData.moduleUrl;
}
else {
templateUrl = this._urlResolver.resolve(prenomData.moduleUrl, prenomData.templateUrl);
template = this._fetch(templateUrl);
}
return SyncAsync.then(template, function (template) { return _this._preparseLoadedTemplate(prenomData, template, templateUrl); });
};
DirectiveNormalizer.prototype._preparseLoadedTemplate = function (prenormData, template, templateAbsUrl) {
var isInline = !!prenormData.template;
var interpolationConfig = InterpolationConfig.fromArray(prenormData.interpolation);
var rootNodesAndErrors = this._htmlParser.parse(template, templateSourceUrl({ reference: prenormData.ngModuleType }, { type: { reference: prenormData.componentType } }, { isInline: isInline, templateUrl: templateAbsUrl }), true, interpolationConfig);
if (rootNodesAndErrors.errors.length > 0) {
var errorString = rootNodesAndErrors.errors.join('\n');
throw syntaxError("Template parse errors:\n" + errorString);
}
var templateMetadataStyles = this._normalizeStylesheet(new CompileStylesheetMetadata({ styles: prenormData.styles, moduleUrl: prenormData.moduleUrl }));
var visitor = new TemplatePreparseVisitor();
visitAll(visitor, rootNodesAndErrors.rootNodes);
var templateStyles = this._normalizeStylesheet(new CompileStylesheetMetadata({ styles: visitor.styles, styleUrls: visitor.styleUrls, moduleUrl: templateAbsUrl }));
var styles = templateMetadataStyles.styles.concat(templateStyles.styles);
var inlineStyleUrls = templateMetadataStyles.styleUrls.concat(templateStyles.styleUrls);
var styleUrls = this
._normalizeStylesheet(new CompileStylesheetMetadata({ styleUrls: prenormData.styleUrls, moduleUrl: prenormData.moduleUrl }))
.styleUrls;
return {
template: template,
templateUrl: templateAbsUrl, isInline: isInline,
htmlAst: rootNodesAndErrors, styles: styles, inlineStyleUrls: inlineStyleUrls, styleUrls: styleUrls,
ngContentSelectors: visitor.ngContentSelectors,
};
};
DirectiveNormalizer.prototype._normalizeTemplateMetadata = function (prenormData, preparsedTemplate) {
var _this = this;
return SyncAsync.then(this._loadMissingExternalStylesheets(preparsedTemplate.styleUrls.concat(preparsedTemplate.inlineStyleUrls)), function (externalStylesheets) { return _this._normalizeLoadedTemplateMetadata(prenormData, preparsedTemplate, externalStylesheets); });
};
DirectiveNormalizer.prototype._normalizeLoadedTemplateMetadata = function (prenormData, preparsedTemplate, stylesheets) {
// Algorithm:
// - produce exactly 1 entry per original styleUrl in
// CompileTemplateMetadata.externalStylesheets with all styles inlined
// - inline all styles that are referenced by the template into CompileTemplateMetadata.styles.
// Reason: be able to determine how many stylesheets there are even without loading
// the template nor the stylesheets, so we can create a stub for TypeScript always synchronously
// (as resource loading may be async)
var _this = this;
var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(preparsedTemplate.styles);
this._inlineStyles(preparsedTemplate.inlineStyleUrls, stylesheets, styles);
var styleUrls = preparsedTemplate.styleUrls;
var externalStylesheets = styleUrls.map(function (styleUrl) {
var stylesheet = stylesheets.get(styleUrl);
var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(stylesheet.styles);
_this._inlineStyles(stylesheet.styleUrls, stylesheets, styles);
return new CompileStylesheetMetadata({ moduleUrl: styleUrl, styles: styles });
});
var encapsulation = prenormData.encapsulation;
if (encapsulation == null) {
encapsulation = this._config.defaultEncapsulation;
}
if (encapsulation === ViewEncapsulation.Emulated && styles.length === 0 &&
styleUrls.length === 0) {
encapsulation = ViewEncapsulation.None;
}
return new CompileTemplateMetadata({
encapsulation: encapsulation,
template: preparsedTemplate.template,
templateUrl: preparsedTemplate.templateUrl,
htmlAst: preparsedTemplate.htmlAst, styles: styles, styleUrls: styleUrls,
ngContentSelectors: preparsedTemplate.ngContentSelectors,
animations: prenormData.animations,
interpolation: prenormData.interpolation,
isInline: preparsedTemplate.isInline, externalStylesheets: externalStylesheets,
preserveWhitespaces: preserveWhitespacesDefault(prenormData.preserveWhitespaces, this._config.preserveWhitespaces),
});
};
DirectiveNormalizer.prototype._inlineStyles = function (styleUrls, stylesheets, targetStyles) {
var _this = this;
styleUrls.forEach(function (styleUrl) {
var stylesheet = stylesheets.get(styleUrl);
stylesheet.styles.forEach(function (style) { return targetStyles.push(style); });
_this._inlineStyles(stylesheet.styleUrls, stylesheets, targetStyles);
});
};
DirectiveNormalizer.prototype._loadMissingExternalStylesheets = function (styleUrls, loadedStylesheets) {
var _this = this;
if (loadedStylesheets === void 0) { loadedStylesheets = new Map(); }
return SyncAsync.then(SyncAsync.all(styleUrls.filter(function (styleUrl) { return !loadedStylesheets.has(styleUrl); })
.map(function (styleUrl) { return SyncAsync.then(_this._fetch(styleUrl), function (loadedStyle) {
var stylesheet = _this._normalizeStylesheet(new CompileStylesheetMetadata({ styles: [loadedStyle], moduleUrl: styleUrl }));
loadedStylesheets.set(styleUrl, stylesheet);
return _this._loadMissingExternalStylesheets(stylesheet.styleUrls, loadedStylesheets);
}); })), function (_) { return loadedStylesheets; });
};
DirectiveNormalizer.prototype._normalizeStylesheet = function (stylesheet) {
var _this = this;
var moduleUrl = stylesheet.moduleUrl;
var allStyleUrls = stylesheet.styleUrls.filter(isStyleUrlResolvable)
.map(function (url) { return _this._urlResolver.resolve(moduleUrl, url); });
var allStyles = stylesheet.styles.map(function (style) {
var styleWithImports = extractStyleUrls(_this._urlResolver, moduleUrl, style);
allStyleUrls.push.apply(allStyleUrls, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(styleWithImports.styleUrls));
return styleWithImports.style;
});
return new CompileStylesheetMetadata({ styles: allStyles, styleUrls: allStyleUrls, moduleUrl: moduleUrl });
};
return DirectiveNormalizer;
}());
var TemplatePreparseVisitor = /** @class */ (function () {
function TemplatePreparseVisitor() {
this.ngContentSelectors = [];
this.styles = [];
this.styleUrls = [];
this.ngNonBindableStackCount = 0;
}
TemplatePreparseVisitor.prototype.visitElement = function (ast, context) {
var preparsedElement = preparseElement(ast);
switch (preparsedElement.type) {
case PreparsedElementType.NG_CONTENT:
if (this.ngNonBindableStackCount === 0) {
this.ngContentSelectors.push(preparsedElement.selectAttr);
}
break;
case PreparsedElementType.STYLE:
var textContent_1 = '';
ast.children.forEach(function (child) {
if (child instanceof Text) {
textContent_1 += child.value;
}
});
this.styles.push(textContent_1);
break;
case PreparsedElementType.STYLESHEET:
this.styleUrls.push(preparsedElement.hrefAttr);
break;
default:
break;
}
if (preparsedElement.nonBindable) {
this.ngNonBindableStackCount++;
}
visitAll(this, ast.children);
if (preparsedElement.nonBindable) {
this.ngNonBindableStackCount--;
}
return null;
};
TemplatePreparseVisitor.prototype.visitExpansion = function (ast, context) { visitAll(this, ast.cases); };
TemplatePreparseVisitor.prototype.visitExpansionCase = function (ast, context) {
visitAll(this, ast.expression);
};
TemplatePreparseVisitor.prototype.visitComment = function (ast, context) { return null; };
TemplatePreparseVisitor.prototype.visitAttribute = function (ast, context) { return null; };
TemplatePreparseVisitor.prototype.visitText = function (ast, context) { return null; };
return TemplatePreparseVisitor;
}());
/**
* @license
* Copyright Google Inc. 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 QUERY_METADATA_IDENTIFIERS = [
createViewChild,
createViewChildren,
createContentChild,
createContentChildren,
];
/*
* Resolve a `Type` for {@link Directive}.
*
* This interface can be overridden by the application developer to create custom behavior.
*
* See {@link Compiler}
*/
var DirectiveResolver = /** @class */ (function () {
function DirectiveResolver(_reflector) {
this._reflector = _reflector;
}
DirectiveResolver.prototype.isDirective = function (type) {
var typeMetadata = this._reflector.annotations(resolveForwardRef(type));
return typeMetadata && typeMetadata.some(isDirectiveMetadata);
};
DirectiveResolver.prototype.resolve = function (type, throwIfNotFound) {
if (throwIfNotFound === void 0) { throwIfNotFound = true; }
var typeMetadata = this._reflector.annotations(resolveForwardRef(type));
if (typeMetadata) {
var metadata = findLast(typeMetadata, isDirectiveMetadata);
if (metadata) {
var propertyMetadata = this._reflector.propMetadata(type);
var guards = this._reflector.guards(type);
return this._mergeWithPropertyMetadata(metadata, propertyMetadata, guards, type);
}
}
if (throwIfNotFound) {
throw new Error("No Directive annotation found on " + stringify(type));
}
return null;
};
DirectiveResolver.prototype._mergeWithPropertyMetadata = function (dm, propertyMetadata, guards, directiveType) {
var inputs = [];
var outputs = [];
var host = {};
var queries = {};
Object.keys(propertyMetadata).forEach(function (propName) {
var input = findLast(propertyMetadata[propName], function (a) { return createInput.isTypeOf(a); });
if (input) {
if (input.bindingPropertyName) {
inputs.push(propName + ": " + input.bindingPropertyName);
}
else {
inputs.push(propName);
}
}
var output = findLast(propertyMetadata[propName], function (a) { return createOutput.isTypeOf(a); });
if (output) {
if (output.bindingPropertyName) {
outputs.push(propName + ": " + output.bindingPropertyName);
}
else {
outputs.push(propName);
}
}
var hostBindings = propertyMetadata[propName].filter(function (a) { return createHostBinding.isTypeOf(a); });
hostBindings.forEach(function (hostBinding) {
if (hostBinding.hostPropertyName) {
var startWith = hostBinding.hostPropertyName[0];
if (startWith === '(') {
throw new Error("@HostBinding can not bind to events. Use @HostListener instead.");
}
else if (startWith === '[') {
throw new Error("@HostBinding parameter should be a property name, 'class.<name>', or 'attr.<name>'.");
}
host["[" + hostBinding.hostPropertyName + "]"] = propName;
}
else {
host["[" + propName + "]"] = propName;
}
});
var hostListeners = propertyMetadata[propName].filter(function (a) { return createHostListener.isTypeOf(a); });
hostListeners.forEach(function (hostListener) {
var args = hostListener.args || [];
host["(" + hostListener.eventName + ")"] = propName + "(" + args.join(',') + ")";
});
var query = findLast(propertyMetadata[propName], function (a) { return QUERY_METADATA_IDENTIFIERS.some(function (i) { return i.isTypeOf(a); }); });
if (query) {
queries[propName] = query;
}
});
return this._merge(dm, inputs, outputs, host, queries, guards, directiveType);
};
DirectiveResolver.prototype._extractPublicName = function (def) { return splitAtColon(def, [null, def])[1].trim(); };
DirectiveResolver.prototype._dedupeBindings = function (bindings) {
var names = new Set();
var publicNames = new Set();
var reversedResult = [];
// go last to first to allow later entries to overwrite previous entries
for (var i = bindings.length - 1; i >= 0; i--) {
var binding = bindings[i];
var name_1 = this._extractPublicName(binding);
publicNames.add(name_1);
if (!names.has(name_1)) {
names.add(name_1);
reversedResult.push(binding);
}
}
return reversedResult.reverse();
};
DirectiveResolver.prototype._merge = function (directive, inputs, outputs, host, queries, guards, directiveType) {
var mergedInputs = this._dedupeBindings(directive.inputs ? directive.inputs.concat(inputs) : inputs);
var mergedOutputs = this._dedupeBindings(directive.outputs ? directive.outputs.concat(outputs) : outputs);
var mergedHost = directive.host ? Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, directive.host, host) : host;
var mergedQueries = directive.queries ? Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, directive.queries, queries) : queries;
if (createComponent.isTypeOf(directive)) {
var comp = directive;
return createComponent({
selector: comp.selector,
inputs: mergedInputs,
outputs: mergedOutputs,
host: mergedHost,
exportAs: comp.exportAs,
moduleId: comp.moduleId,
queries: mergedQueries,
changeDetection: comp.changeDetection,
providers: comp.providers,
viewProviders: comp.viewProviders,
entryComponents: comp.entryComponents,
template: comp.template,
templateUrl: comp.templateUrl,
styles: comp.styles,
styleUrls: comp.styleUrls,
encapsulation: comp.encapsulation,
animations: comp.animations,
interpolation: comp.interpolation,
preserveWhitespaces: directive.preserveWhitespaces,
});
}
else {
return createDirective({
selector: directive.selector,
inputs: mergedInputs,
outputs: mergedOutputs,
host: mergedHost,
exportAs: directive.exportAs,
queries: mergedQueries,
providers: directive.providers, guards: guards
});
}
};
return DirectiveResolver;
}());
function isDirectiveMetadata(type) {
return createDirective.isTypeOf(type) || createComponent.isTypeOf(type);
}
function findLast(arr, condition) {
for (var i = arr.length - 1; i >= 0; i--) {
if (condition(arr[i])) {
return arr[i];
}
}
return null;
}
/**
* @license
* Copyright Google Inc. 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 $EOF = 0;
var $TAB = 9;
var $LF = 10;
var $VTAB = 11;
var $FF = 12;
var $CR = 13;
var $SPACE = 32;
var $BANG = 33;
var $DQ = 34;
var $HASH = 35;
var $$ = 36;
var $PERCENT = 37;
var $AMPERSAND = 38;
var $SQ = 39;
var $LPAREN = 40;
var $RPAREN = 41;
var $STAR = 42;
var $PLUS = 43;
var $COMMA = 44;
var $MINUS = 45;
var $PERIOD = 46;
var $SLASH = 47;
var $COLON = 58;
var $SEMICOLON = 59;
var $LT = 60;
var $EQ = 61;
var $GT = 62;
var $QUESTION = 63;
var $0 = 48;
var $9 = 57;
var $A = 65;
var $E = 69;
var $F = 70;
var $X = 88;
var $Z = 90;
var $LBRACKET = 91;
var $BACKSLASH = 92;
var $RBRACKET = 93;
var $CARET = 94;
var $_ = 95;
var $a = 97;
var $e = 101;
var $f = 102;
var $n = 110;
var $r = 114;
var $t = 116;
var $u = 117;
var $v = 118;
var $x = 120;
var $z = 122;
var $LBRACE = 123;
var $BAR = 124;
var $RBRACE = 125;
var $NBSP = 160;
var $BT = 96;
function isWhitespace(code) {
return (code >= $TAB && code <= $SPACE) || (code == $NBSP);
}
function isDigit(code) {
return $0 <= code && code <= $9;
}
function isAsciiLetter(code) {
return code >= $a && code <= $z || code >= $A && code <= $Z;
}
function isAsciiHexDigit(code) {
return code >= $a && code <= $f || code >= $A && code <= $F || isDigit(code);
}
/**
* @license
* Copyright Google Inc. 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 TokenType;
(function (TokenType) {
TokenType[TokenType["Character"] = 0] = "Character";
TokenType[TokenType["Identifier"] = 1] = "Identifier";
TokenType[TokenType["Keyword"] = 2] = "Keyword";
TokenType[TokenType["String"] = 3] = "String";
TokenType[TokenType["Operator"] = 4] = "Operator";
TokenType[TokenType["Number"] = 5] = "Number";
TokenType[TokenType["Error"] = 6] = "Error";
})(TokenType || (TokenType = {}));
var KEYWORDS = ['var', 'let', 'as', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this'];
var Lexer = /** @class */ (function () {
function Lexer() {
}
Lexer.prototype.tokenize = function (text) {
var scanner = new _Scanner(text);
var tokens = [];
var token = scanner.scanToken();
while (token != null) {
tokens.push(token);
token = scanner.scanToken();
}
return tokens;
};
return Lexer;
}());
var Token = /** @class */ (function () {
function Token(index, type, numValue, strValue) {
this.index = index;
this.type = type;
this.numValue = numValue;
this.strValue = strValue;
}
Token.prototype.isCharacter = function (code) {
return this.type == TokenType.Character && this.numValue == code;
};
Token.prototype.isNumber = function () { return this.type == TokenType.Number; };
Token.prototype.isString = function () { return this.type == TokenType.String; };
Token.prototype.isOperator = function (operater) {
return this.type == TokenType.Operator && this.strValue == operater;
};
Token.prototype.isIdentifier = function () { return this.type == TokenType.Identifier; };
Token.prototype.isKeyword = function () { return this.type == TokenType.Keyword; };
Token.prototype.isKeywordLet = function () { return this.type == TokenType.Keyword && this.strValue == 'let'; };
Token.prototype.isKeywordAs = function () { return this.type == TokenType.Keyword && this.strValue == 'as'; };
Token.prototype.isKeywordNull = function () { return this.type == TokenType.Keyword && this.strValue == 'null'; };
Token.prototype.isKeywordUndefined = function () {
return this.type == TokenType.Keyword && this.strValue == 'undefined';
};
Token.prototype.isKeywordTrue = function () { return this.type == TokenType.Keyword && this.strValue == 'true'; };
Token.prototype.isKeywordFalse = function () { return this.type == TokenType.Keyword && this.strValue == 'false'; };
Token.prototype.isKeywordThis = function () { return this.type == TokenType.Keyword && this.strValue == 'this'; };
Token.prototype.isError = function () { return this.type == TokenType.Error; };
Token.prototype.toNumber = function () { return this.type == TokenType.Number ? this.numValue : -1; };
Token.prototype.toString = function () {
switch (this.type) {
case TokenType.Character:
case TokenType.Identifier:
case TokenType.Keyword:
case TokenType.Operator:
case TokenType.String:
case TokenType.Error:
return this.strValue;
case TokenType.Number:
return this.numValue.toString();
default:
return null;
}
};
return Token;
}());
function newCharacterToken(index, code) {
return new Token(index, TokenType.Character, code, String.fromCharCode(code));
}
function newIdentifierToken(index, text) {
return new Token(index, TokenType.Identifier, 0, text);
}
function newKeywordToken(index, text) {
return new Token(index, TokenType.Keyword, 0, text);
}
function newOperatorToken(index, text) {
return new Token(index, TokenType.Operator, 0, text);
}
function newStringToken(index, text) {
return new Token(index, TokenType.String, 0, text);
}
function newNumberToken(index, n) {
return new Token(index, TokenType.Number, n, '');
}
function newErrorToken(index, message) {
return new Token(index, TokenType.Error, 0, message);
}
var EOF = new Token(-1, TokenType.Character, 0, '');
var _Scanner = /** @class */ (function () {
function _Scanner(input) {
this.input = input;
this.peek = 0;
this.index = -1;
this.length = input.length;
this.advance();
}
_Scanner.prototype.advance = function () {
this.peek = ++this.index >= this.length ? $EOF : this.input.charCodeAt(this.index);
};
_Scanner.prototype.scanToken = function () {
var input = this.input, length = this.length;
var peek = this.peek, index = this.index;
// Skip whitespace.
while (peek <= $SPACE) {
if (++index >= length) {
peek = $EOF;
break;
}
else {
peek = input.charCodeAt(index);
}
}
this.peek = peek;
this.index = index;
if (index >= length) {
return null;
}
// Handle identifiers and numbers.
if (isIdentifierStart(peek))
return this.scanIdentifier();
if (isDigit(peek))
return this.scanNumber(index);
var start = index;
switch (peek) {
case $PERIOD:
this.advance();
return isDigit(this.peek) ? this.scanNumber(start) :
newCharacterToken(start, $PERIOD);
case $LPAREN:
case $RPAREN:
case $LBRACE:
case $RBRACE:
case $LBRACKET:
case $RBRACKET:
case $COMMA:
case $COLON:
case $SEMICOLON:
return this.scanCharacter(start, peek);
case $SQ:
case $DQ:
return this.scanString();
case $HASH:
case $PLUS:
case $MINUS:
case $STAR:
case $SLASH:
case $PERCENT:
case $CARET:
return this.scanOperator(start, String.fromCharCode(peek));
case $QUESTION:
return this.scanComplexOperator(start, '?', $PERIOD, '.');
case $LT:
case $GT:
return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=');
case $BANG:
case $EQ:
return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=', $EQ, '=');
case $AMPERSAND:
return this.scanComplexOperator(start, '&', $AMPERSAND, '&');
case $BAR:
return this.scanComplexOperator(start, '|', $BAR, '|');
case $NBSP:
while (isWhitespace(this.peek))
this.advance();
return this.scanToken();
}
this.advance();
return this.error("Unexpected character [" + String.fromCharCode(peek) + "]", 0);
};
_Scanner.prototype.scanCharacter = function (start, code) {
this.advance();
return newCharacterToken(start, code);
};
_Scanner.prototype.scanOperator = function (start, str) {
this.advance();
return newOperatorToken(start, str);
};
/**
* Tokenize a 2/3 char long operator
*
* @param start start index in the expression
* @param one first symbol (always part of the operator)
* @param twoCode code point for the second symbol
* @param two second symbol (part of the operator when the second code point matches)
* @param threeCode code point for the third symbol
* @param three third symbol (part of the operator when provided and matches source expression)
*/
_Scanner.prototype.scanComplexOperator = function (start, one, twoCode, two, threeCode, three) {
this.advance();
var str = one;
if (this.peek == twoCode) {
this.advance();
str += two;
}
if (threeCode != null && this.peek == threeCode) {
this.advance();
str += three;
}
return newOperatorToken(start, str);
};
_Scanner.prototype.scanIdentifier = function () {
var start = this.index;
this.advance();
while (isIdentifierPart(this.peek))
this.advance();
var str = this.input.substring(start, this.index);
return KEYWORDS.indexOf(str) > -1 ? newKeywordToken(start, str) :
newIdentifierToken(start, str);
};
_Scanner.prototype.scanNumber = function (start) {
var simple = (this.index === start);
this.advance(); // Skip initial digit.
while (true) {
if (isDigit(this.peek)) ;
else if (this.peek == $PERIOD) {
simple = false;
}
else if (isExponentStart(this.peek)) {
this.advance();
if (isExponentSign(this.peek))
this.advance();
if (!isDigit(this.peek))
return this.error('Invalid exponent', -1);
simple = false;
}
else {
break;
}
this.advance();
}
var str = this.input.substring(start, this.index);
var value = simple ? parseIntAutoRadix(str) : parseFloat(str);
return newNumberToken(start, value);
};
_Scanner.prototype.scanString = function () {
var start = this.index;
var quote = this.peek;
this.advance(); // Skip initial quote.
var buffer = '';
var marker = this.index;
var input = this.input;
while (this.peek != quote) {
if (this.peek == $BACKSLASH) {
buffer += input.substring(marker, this.index);
this.advance();
var unescapedCode = void 0;
// Workaround for TS2.1-introduced type strictness
this.peek = this.peek;
if (this.peek == $u) {
// 4 character hex code for unicode character.
var hex = input.substring(this.index + 1, this.index + 5);
if (/^[0-9a-f]+$/i.test(hex)) {
unescapedCode = parseInt(hex, 16);
}
else {
return this.error("Invalid unicode escape [\\u" + hex + "]", 0);
}
for (var i = 0; i < 5; i++) {
this.advance();
}
}
else {
unescapedCode = unescape(this.peek);
this.advance();
}
buffer += String.fromCharCode(unescapedCode);
marker = this.index;
}
else if (this.peek == $EOF) {
return this.error('Unterminated quote', 0);
}
else {
this.advance();
}
}
var last = input.substring(marker, this.index);
this.advance(); // Skip terminating quote.
return newStringToken(start, buffer + last);
};
_Scanner.prototype.error = function (message, offset) {
var position = this.index + offset;
return newErrorToken(position, "Lexer Error: " + message + " at column " + position + " in expression [" + this.input + "]");
};
return _Scanner;
}());
function isIdentifierStart(code) {
return ($a <= code && code <= $z) || ($A <= code && code <= $Z) ||
(code == $_) || (code == $$);
}
function isIdentifier(input) {
if (input.length == 0)
return false;
var scanner = new _Scanner(input);
if (!isIdentifierStart(scanner.peek))
return false;
scanner.advance();
while (scanner.peek !== $EOF) {
if (!isIdentifierPart(scanner.peek))
return false;
scanner.advance();
}
return true;
}
function isIdentifierPart(code) {
return isAsciiLetter(code) || isDigit(code) || (code == $_) ||
(code == $$);
}
function isExponentStart(code) {
return code == $e || code == $E;
}
function isExponentSign(code) {
return code == $MINUS || code == $PLUS;
}
function isQuote(code) {
return code === $SQ || code === $DQ || code === $BT;
}
function unescape(code) {
switch (code) {
case $n:
return $LF;
case $f:
return $FF;
case $r:
return $CR;
case $t:
return $TAB;
case $v:
return $VTAB;
default:
return code;
}
}
function parseIntAutoRadix(text) {
var result = parseInt(text);
if (isNaN(result)) {
throw new Error('Invalid integer literal when parsing ' + text);
}
return result;
}
/**
* @license
* Copyright Google Inc. 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 ParserError = /** @class */ (function () {
function ParserError(message, input, errLocation, ctxLocation) {
this.input = input;
this.errLocation = errLocation;
this.ctxLocation = ctxLocation;
this.message = "Parser Error: " + message + " " + errLocation + " [" + input + "] in " + ctxLocation;
}
return ParserError;
}());
var ParseSpan = /** @class */ (function () {
function ParseSpan(start, end) {
this.start = start;
this.end = end;
}
return ParseSpan;
}());
var AST = /** @class */ (function () {
function AST(span) {
this.span = span;
}
AST.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return null;
};
AST.prototype.toString = function () { return 'AST'; };
return AST;
}());
/**
* Represents a quoted expression of the form:
*
* quote = prefix `:` uninterpretedExpression
* prefix = identifier
* uninterpretedExpression = arbitrary string
*
* A quoted expression is meant to be pre-processed by an AST transformer that
* converts it into another AST that no longer contains quoted expressions.
* It is meant to allow third-party developers to extend Angular template
* expression language. The `uninterpretedExpression` part of the quote is
* therefore not interpreted by the Angular's own expression parser.
*/
var Quote = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Quote, _super);
function Quote(span, prefix, uninterpretedExpression, location) {
var _this = _super.call(this, span) || this;
_this.prefix = prefix;
_this.uninterpretedExpression = uninterpretedExpression;
_this.location = location;
return _this;
}
Quote.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitQuote(this, context);
};
Quote.prototype.toString = function () { return 'Quote'; };
return Quote;
}(AST));
var EmptyExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(EmptyExpr, _super);
function EmptyExpr() {
return _super !== null && _super.apply(this, arguments) || this;
}
EmptyExpr.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
// do nothing
};
return EmptyExpr;
}(AST));
var ImplicitReceiver = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ImplicitReceiver, _super);
function ImplicitReceiver() {
return _super !== null && _super.apply(this, arguments) || this;
}
ImplicitReceiver.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitImplicitReceiver(this, context);
};
return ImplicitReceiver;
}(AST));
/**
* Multiple expressions separated by a semicolon.
*/
var Chain = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Chain, _super);
function Chain(span, expressions) {
var _this = _super.call(this, span) || this;
_this.expressions = expressions;
return _this;
}
Chain.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitChain(this, context);
};
return Chain;
}(AST));
var Conditional = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Conditional, _super);
function Conditional(span, condition, trueExp, falseExp) {
var _this = _super.call(this, span) || this;
_this.condition = condition;
_this.trueExp = trueExp;
_this.falseExp = falseExp;
return _this;
}
Conditional.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitConditional(this, context);
};
return Conditional;
}(AST));
var PropertyRead = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PropertyRead, _super);
function PropertyRead(span, receiver, name) {
var _this = _super.call(this, span) || this;
_this.receiver = receiver;
_this.name = name;
return _this;
}
PropertyRead.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitPropertyRead(this, context);
};
return PropertyRead;
}(AST));
var PropertyWrite = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PropertyWrite, _super);
function PropertyWrite(span, receiver, name, value) {
var _this = _super.call(this, span) || this;
_this.receiver = receiver;
_this.name = name;
_this.value = value;
return _this;
}
PropertyWrite.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitPropertyWrite(this, context);
};
return PropertyWrite;
}(AST));
var SafePropertyRead = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SafePropertyRead, _super);
function SafePropertyRead(span, receiver, name) {
var _this = _super.call(this, span) || this;
_this.receiver = receiver;
_this.name = name;
return _this;
}
SafePropertyRead.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitSafePropertyRead(this, context);
};
return SafePropertyRead;
}(AST));
var KeyedRead = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(KeyedRead, _super);
function KeyedRead(span, obj, key) {
var _this = _super.call(this, span) || this;
_this.obj = obj;
_this.key = key;
return _this;
}
KeyedRead.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitKeyedRead(this, context);
};
return KeyedRead;
}(AST));
var KeyedWrite = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(KeyedWrite, _super);
function KeyedWrite(span, obj, key, value) {
var _this = _super.call(this, span) || this;
_this.obj = obj;
_this.key = key;
_this.value = value;
return _this;
}
KeyedWrite.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitKeyedWrite(this, context);
};
return KeyedWrite;
}(AST));
var BindingPipe = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BindingPipe, _super);
function BindingPipe(span, exp, name, args) {
var _this = _super.call(this, span) || this;
_this.exp = exp;
_this.name = name;
_this.args = args;
return _this;
}
BindingPipe.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitPipe(this, context);
};
return BindingPipe;
}(AST));
var LiteralPrimitive = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LiteralPrimitive, _super);
function LiteralPrimitive(span, value) {
var _this = _super.call(this, span) || this;
_this.value = value;
return _this;
}
LiteralPrimitive.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitLiteralPrimitive(this, context);
};
return LiteralPrimitive;
}(AST));
var LiteralArray = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LiteralArray, _super);
function LiteralArray(span, expressions) {
var _this = _super.call(this, span) || this;
_this.expressions = expressions;
return _this;
}
LiteralArray.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitLiteralArray(this, context);
};
return LiteralArray;
}(AST));
var LiteralMap = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LiteralMap, _super);
function LiteralMap(span, keys, values) {
var _this = _super.call(this, span) || this;
_this.keys = keys;
_this.values = values;
return _this;
}
LiteralMap.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitLiteralMap(this, context);
};
return LiteralMap;
}(AST));
var Interpolation = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Interpolation, _super);
function Interpolation(span, strings, expressions) {
var _this = _super.call(this, span) || this;
_this.strings = strings;
_this.expressions = expressions;
return _this;
}
Interpolation.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitInterpolation(this, context);
};
return Interpolation;
}(AST));
var Binary = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Binary, _super);
function Binary(span, operation, left, right) {
var _this = _super.call(this, span) || this;
_this.operation = operation;
_this.left = left;
_this.right = right;
return _this;
}
Binary.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitBinary(this, context);
};
return Binary;
}(AST));
var PrefixNot = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PrefixNot, _super);
function PrefixNot(span, expression) {
var _this = _super.call(this, span) || this;
_this.expression = expression;
return _this;
}
PrefixNot.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitPrefixNot(this, context);
};
return PrefixNot;
}(AST));
var NonNullAssert = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NonNullAssert, _super);
function NonNullAssert(span, expression) {
var _this = _super.call(this, span) || this;
_this.expression = expression;
return _this;
}
NonNullAssert.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitNonNullAssert(this, context);
};
return NonNullAssert;
}(AST));
var MethodCall = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MethodCall, _super);
function MethodCall(span, receiver, name, args) {
var _this = _super.call(this, span) || this;
_this.receiver = receiver;
_this.name = name;
_this.args = args;
return _this;
}
MethodCall.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitMethodCall(this, context);
};
return MethodCall;
}(AST));
var SafeMethodCall = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SafeMethodCall, _super);
function SafeMethodCall(span, receiver, name, args) {
var _this = _super.call(this, span) || this;
_this.receiver = receiver;
_this.name = name;
_this.args = args;
return _this;
}
SafeMethodCall.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitSafeMethodCall(this, context);
};
return SafeMethodCall;
}(AST));
var FunctionCall = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FunctionCall, _super);
function FunctionCall(span, target, args) {
var _this = _super.call(this, span) || this;
_this.target = target;
_this.args = args;
return _this;
}
FunctionCall.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return visitor.visitFunctionCall(this, context);
};
return FunctionCall;
}(AST));
var ASTWithSource = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ASTWithSource, _super);
function ASTWithSource(ast, source, location, errors) {
var _this = _super.call(this, new ParseSpan(0, source == null ? 0 : source.length)) || this;
_this.ast = ast;
_this.source = source;
_this.location = location;
_this.errors = errors;
return _this;
}
ASTWithSource.prototype.visit = function (visitor, context) {
if (context === void 0) { context = null; }
return this.ast.visit(visitor, context);
};
ASTWithSource.prototype.toString = function () { return this.source + " in " + this.location; };
return ASTWithSource;
}(AST));
var TemplateBinding = /** @class */ (function () {
function TemplateBinding(span, key, keyIsVar, name, expression) {
this.span = span;
this.key = key;
this.keyIsVar = keyIsVar;
this.name = name;
this.expression = expression;
}
return TemplateBinding;
}());
var NullAstVisitor = /** @class */ (function () {
function NullAstVisitor() {
}
NullAstVisitor.prototype.visitBinary = function (ast, context) { };
NullAstVisitor.prototype.visitChain = function (ast, context) { };
NullAstVisitor.prototype.visitConditional = function (ast, context) { };
NullAstVisitor.prototype.visitFunctionCall = function (ast, context) { };
NullAstVisitor.prototype.visitImplicitReceiver = function (ast, context) { };
NullAstVisitor.prototype.visitInterpolation = function (ast, context) { };
NullAstVisitor.prototype.visitKeyedRead = function (ast, context) { };
NullAstVisitor.prototype.visitKeyedWrite = function (ast, context) { };
NullAstVisitor.prototype.visitLiteralArray = function (ast, context) { };
NullAstVisitor.prototype.visitLiteralMap = function (ast, context) { };
NullAstVisitor.prototype.visitLiteralPrimitive = function (ast, context) { };
NullAstVisitor.prototype.visitMethodCall = function (ast, context) { };
NullAstVisitor.prototype.visitPipe = function (ast, context) { };
NullAstVisitor.prototype.visitPrefixNot = function (ast, context) { };
NullAstVisitor.prototype.visitNonNullAssert = function (ast, context) { };
NullAstVisitor.prototype.visitPropertyRead = function (ast, context) { };
NullAstVisitor.prototype.visitPropertyWrite = function (ast, context) { };
NullAstVisitor.prototype.visitQuote = function (ast, context) { };
NullAstVisitor.prototype.visitSafeMethodCall = function (ast, context) { };
NullAstVisitor.prototype.visitSafePropertyRead = function (ast, context) { };
return NullAstVisitor;
}());
var RecursiveAstVisitor = /** @class */ (function () {
function RecursiveAstVisitor() {
}
RecursiveAstVisitor.prototype.visitBinary = function (ast, context) {
ast.left.visit(this);
ast.right.visit(this);
return null;
};
RecursiveAstVisitor.prototype.visitChain = function (ast, context) { return this.visitAll(ast.expressions, context); };
RecursiveAstVisitor.prototype.visitConditional = function (ast, context) {
ast.condition.visit(this);
ast.trueExp.visit(this);
ast.falseExp.visit(this);
return null;
};
RecursiveAstVisitor.prototype.visitPipe = function (ast, context) {
ast.exp.visit(this);
this.visitAll(ast.args, context);
return null;
};
RecursiveAstVisitor.prototype.visitFunctionCall = function (ast, context) {
ast.target.visit(this);
this.visitAll(ast.args, context);
return null;
};
RecursiveAstVisitor.prototype.visitImplicitReceiver = function (ast, context) { return null; };
RecursiveAstVisitor.prototype.visitInterpolation = function (ast, context) {
return this.visitAll(ast.expressions, context);
};
RecursiveAstVisitor.prototype.visitKeyedRead = function (ast, context) {
ast.obj.visit(this);
ast.key.visit(this);
return null;
};
RecursiveAstVisitor.prototype.visitKeyedWrite = function (ast, context) {
ast.obj.visit(this);
ast.key.visit(this);
ast.value.visit(this);
return null;
};
RecursiveAstVisitor.prototype.visitLiteralArray = function (ast, context) {
return this.visitAll(ast.expressions, context);
};
RecursiveAstVisitor.prototype.visitLiteralMap = function (ast, context) { return this.visitAll(ast.values, context); };
RecursiveAstVisitor.prototype.visitLiteralPrimitive = function (ast, context) { return null; };
RecursiveAstVisitor.prototype.visitMethodCall = function (ast, context) {
ast.receiver.visit(this);
return this.visitAll(ast.args, context);
};
RecursiveAstVisitor.prototype.visitPrefixNot = function (ast, context) {
ast.expression.visit(this);
return null;
};
RecursiveAstVisitor.prototype.visitNonNullAssert = function (ast, context) {
ast.expression.visit(this);
return null;
};
RecursiveAstVisitor.prototype.visitPropertyRead = function (ast, context) {
ast.receiver.visit(this);
return null;
};
RecursiveAstVisitor.prototype.visitPropertyWrite = function (ast, context) {
ast.receiver.visit(this);
ast.value.visit(this);
return null;
};
RecursiveAstVisitor.prototype.visitSafePropertyRead = function (ast, context) {
ast.receiver.visit(this);
return null;
};
RecursiveAstVisitor.prototype.visitSafeMethodCall = function (ast, context) {
ast.receiver.visit(this);
return this.visitAll(ast.args, context);
};
RecursiveAstVisitor.prototype.visitAll = function (asts, context) {
var _this = this;
asts.forEach(function (ast) { return ast.visit(_this, context); });
return null;
};
RecursiveAstVisitor.prototype.visitQuote = function (ast, context) { return null; };
return RecursiveAstVisitor;
}());
var AstTransformer = /** @class */ (function () {
function AstTransformer() {
}
AstTransformer.prototype.visitImplicitReceiver = function (ast, context) { return ast; };
AstTransformer.prototype.visitInterpolation = function (ast, context) {
return new Interpolation(ast.span, ast.strings, this.visitAll(ast.expressions));
};
AstTransformer.prototype.visitLiteralPrimitive = function (ast, context) {
return new LiteralPrimitive(ast.span, ast.value);
};
AstTransformer.prototype.visitPropertyRead = function (ast, context) {
return new PropertyRead(ast.span, ast.receiver.visit(this), ast.name);
};
AstTransformer.prototype.visitPropertyWrite = function (ast, context) {
return new PropertyWrite(ast.span, ast.receiver.visit(this), ast.name, ast.value.visit(this));
};
AstTransformer.prototype.visitSafePropertyRead = function (ast, context) {
return new SafePropertyRead(ast.span, ast.receiver.visit(this), ast.name);
};
AstTransformer.prototype.visitMethodCall = function (ast, context) {
return new MethodCall(ast.span, ast.receiver.visit(this), ast.name, this.visitAll(ast.args));
};
AstTransformer.prototype.visitSafeMethodCall = function (ast, context) {
return new SafeMethodCall(ast.span, ast.receiver.visit(this), ast.name, this.visitAll(ast.args));
};
AstTransformer.prototype.visitFunctionCall = function (ast, context) {
return new FunctionCall(ast.span, ast.target.visit(this), this.visitAll(ast.args));
};
AstTransformer.prototype.visitLiteralArray = function (ast, context) {
return new LiteralArray(ast.span, this.visitAll(ast.expressions));
};
AstTransformer.prototype.visitLiteralMap = function (ast, context) {
return new LiteralMap(ast.span, ast.keys, this.visitAll(ast.values));
};
AstTransformer.prototype.visitBinary = function (ast, context) {
return new Binary(ast.span, ast.operation, ast.left.visit(this), ast.right.visit(this));
};
AstTransformer.prototype.visitPrefixNot = function (ast, context) {
return new PrefixNot(ast.span, ast.expression.visit(this));
};
AstTransformer.prototype.visitNonNullAssert = function (ast, context) {
return new NonNullAssert(ast.span, ast.expression.visit(this));
};
AstTransformer.prototype.visitConditional = function (ast, context) {
return new Conditional(ast.span, ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this));
};
AstTransformer.prototype.visitPipe = function (ast, context) {
return new BindingPipe(ast.span, ast.exp.visit(this), ast.name, this.visitAll(ast.args));
};
AstTransformer.prototype.visitKeyedRead = function (ast, context) {
return new KeyedRead(ast.span, ast.obj.visit(this), ast.key.visit(this));
};
AstTransformer.prototype.visitKeyedWrite = function (ast, context) {
return new KeyedWrite(ast.span, ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this));
};
AstTransformer.prototype.visitAll = function (asts) {
var res = new Array(asts.length);
for (var i = 0; i < asts.length; ++i) {
res[i] = asts[i].visit(this);
}
return res;
};
AstTransformer.prototype.visitChain = function (ast, context) {
return new Chain(ast.span, this.visitAll(ast.expressions));
};
AstTransformer.prototype.visitQuote = function (ast, context) {
return new Quote(ast.span, ast.prefix, ast.uninterpretedExpression, ast.location);
};
return AstTransformer;
}());
// A transformer that only creates new nodes if the transformer makes a change or
// a change is made a child node.
var AstMemoryEfficientTransformer = /** @class */ (function () {
function AstMemoryEfficientTransformer() {
}
AstMemoryEfficientTransformer.prototype.visitImplicitReceiver = function (ast, context) { return ast; };
AstMemoryEfficientTransformer.prototype.visitInterpolation = function (ast, context) {
var expressions = this.visitAll(ast.expressions);
if (expressions !== ast.expressions)
return new Interpolation(ast.span, ast.strings, expressions);
return ast;
};
AstMemoryEfficientTransformer.prototype.visitLiteralPrimitive = function (ast, context) { return ast; };
AstMemoryEfficientTransformer.prototype.visitPropertyRead = function (ast, context) {
var receiver = ast.receiver.visit(this);
if (receiver !== ast.receiver) {
return new PropertyRead(ast.span, receiver, ast.name);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitPropertyWrite = function (ast, context) {
var receiver = ast.receiver.visit(this);
var value = ast.value.visit(this);
if (receiver !== ast.receiver || value !== ast.value) {
return new PropertyWrite(ast.span, receiver, ast.name, value);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitSafePropertyRead = function (ast, context) {
var receiver = ast.receiver.visit(this);
if (receiver !== ast.receiver) {
return new SafePropertyRead(ast.span, receiver, ast.name);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitMethodCall = function (ast, context) {
var receiver = ast.receiver.visit(this);
if (receiver !== ast.receiver) {
return new MethodCall(ast.span, receiver, ast.name, this.visitAll(ast.args));
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitSafeMethodCall = function (ast, context) {
var receiver = ast.receiver.visit(this);
var args = this.visitAll(ast.args);
if (receiver !== ast.receiver || args !== ast.args) {
return new SafeMethodCall(ast.span, receiver, ast.name, args);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitFunctionCall = function (ast, context) {
var target = ast.target && ast.target.visit(this);
var args = this.visitAll(ast.args);
if (target !== ast.target || args !== ast.args) {
return new FunctionCall(ast.span, target, args);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitLiteralArray = function (ast, context) {
var expressions = this.visitAll(ast.expressions);
if (expressions !== ast.expressions) {
return new LiteralArray(ast.span, expressions);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitLiteralMap = function (ast, context) {
var values = this.visitAll(ast.values);
if (values !== ast.values) {
return new LiteralMap(ast.span, ast.keys, values);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitBinary = function (ast, context) {
var left = ast.left.visit(this);
var right = ast.right.visit(this);
if (left !== ast.left || right !== ast.right) {
return new Binary(ast.span, ast.operation, left, right);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitPrefixNot = function (ast, context) {
var expression = ast.expression.visit(this);
if (expression !== ast.expression) {
return new PrefixNot(ast.span, expression);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitNonNullAssert = function (ast, context) {
var expression = ast.expression.visit(this);
if (expression !== ast.expression) {
return new NonNullAssert(ast.span, expression);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitConditional = function (ast, context) {
var condition = ast.condition.visit(this);
var trueExp = ast.trueExp.visit(this);
var falseExp = ast.falseExp.visit(this);
if (condition !== ast.condition || trueExp !== ast.trueExp || falseExp !== falseExp) {
return new Conditional(ast.span, condition, trueExp, falseExp);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitPipe = function (ast, context) {
var exp = ast.exp.visit(this);
var args = this.visitAll(ast.args);
if (exp !== ast.exp || args !== ast.args) {
return new BindingPipe(ast.span, exp, ast.name, args);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitKeyedRead = function (ast, context) {
var obj = ast.obj.visit(this);
var key = ast.key.visit(this);
if (obj !== ast.obj || key !== ast.key) {
return new KeyedRead(ast.span, obj, key);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitKeyedWrite = function (ast, context) {
var obj = ast.obj.visit(this);
var key = ast.key.visit(this);
var value = ast.value.visit(this);
if (obj !== ast.obj || key !== ast.key || value !== ast.value) {
return new KeyedWrite(ast.span, obj, key, value);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitAll = function (asts) {
var res = new Array(asts.length);
var modified = false;
for (var i = 0; i < asts.length; ++i) {
var original = asts[i];
var value = original.visit(this);
res[i] = value;
modified = modified || value !== original;
}
return modified ? res : asts;
};
AstMemoryEfficientTransformer.prototype.visitChain = function (ast, context) {
var expressions = this.visitAll(ast.expressions);
if (expressions !== ast.expressions) {
return new Chain(ast.span, expressions);
}
return ast;
};
AstMemoryEfficientTransformer.prototype.visitQuote = function (ast, context) { return ast; };
return AstMemoryEfficientTransformer;
}());
function visitAstChildren(ast, visitor, context) {
function visit(ast) {
visitor.visit && visitor.visit(ast, context) || ast.visit(visitor, context);
}
function visitAll(asts) { asts.forEach(visit); }
ast.visit({
visitBinary: function (ast) {
visit(ast.left);
visit(ast.right);
},
visitChain: function (ast) { visitAll(ast.expressions); },
visitConditional: function (ast) {
visit(ast.condition);
visit(ast.trueExp);
visit(ast.falseExp);
},
visitFunctionCall: function (ast) {
if (ast.target) {
visit(ast.target);
}
visitAll(ast.args);
},
visitImplicitReceiver: function (ast) { },
visitInterpolation: function (ast) { visitAll(ast.expressions); },
visitKeyedRead: function (ast) {
visit(ast.obj);
visit(ast.key);
},
visitKeyedWrite: function (ast) {
visit(ast.obj);
visit(ast.key);
visit(ast.obj);
},
visitLiteralArray: function (ast) { visitAll(ast.expressions); },
visitLiteralMap: function (ast) { },
visitLiteralPrimitive: function (ast) { },
visitMethodCall: function (ast) {
visit(ast.receiver);
visitAll(ast.args);
},
visitPipe: function (ast) {
visit(ast.exp);
visitAll(ast.args);
},
visitPrefixNot: function (ast) { visit(ast.expression); },
visitNonNullAssert: function (ast) { visit(ast.expression); },
visitPropertyRead: function (ast) { visit(ast.receiver); },
visitPropertyWrite: function (ast) {
visit(ast.receiver);
visit(ast.value);
},
visitQuote: function (ast) { },
visitSafeMethodCall: function (ast) {
visit(ast.receiver);
visitAll(ast.args);
},
visitSafePropertyRead: function (ast) { visit(ast.receiver); },
});
}
/**
* @license
* Copyright Google Inc. 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 SplitInterpolation = /** @class */ (function () {
function SplitInterpolation(strings, expressions, offsets) {
this.strings = strings;
this.expressions = expressions;
this.offsets = offsets;
}
return SplitInterpolation;
}());
var TemplateBindingParseResult = /** @class */ (function () {
function TemplateBindingParseResult(templateBindings, warnings, errors) {
this.templateBindings = templateBindings;
this.warnings = warnings;
this.errors = errors;
}
return TemplateBindingParseResult;
}());
function _createInterpolateRegExp(config) {
var pattern = escapeRegExp(config.start) + '([\\s\\S]*?)' + escapeRegExp(config.end);
return new RegExp(pattern, 'g');
}
var Parser = /** @class */ (function () {
function Parser(_lexer) {
this._lexer = _lexer;
this.errors = [];
}
Parser.prototype.parseAction = function (input, location, interpolationConfig) {
if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
this._checkNoInterpolation(input, location, interpolationConfig);
var sourceToLex = this._stripComments(input);
var tokens = this._lexer.tokenize(this._stripComments(input));
var ast = new _ParseAST(input, location, tokens, sourceToLex.length, true, this.errors, input.length - sourceToLex.length)
.parseChain();
return new ASTWithSource(ast, input, location, this.errors);
};
Parser.prototype.parseBinding = function (input, location, interpolationConfig) {
if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
var ast = this._parseBindingAst(input, location, interpolationConfig);
return new ASTWithSource(ast, input, location, this.errors);
};
Parser.prototype.parseSimpleBinding = function (input, location, interpolationConfig) {
if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
var ast = this._parseBindingAst(input, location, interpolationConfig);
var errors = SimpleExpressionChecker.check(ast);
if (errors.length > 0) {
this._reportError("Host binding expression cannot contain " + errors.join(' '), input, location);
}
return new ASTWithSource(ast, input, location, this.errors);
};
Parser.prototype._reportError = function (message, input, errLocation, ctxLocation) {
this.errors.push(new ParserError(message, input, errLocation, ctxLocation));
};
Parser.prototype._parseBindingAst = function (input, location, interpolationConfig) {
// Quotes expressions use 3rd-party expression language. We don't want to use
// our lexer or parser for that, so we check for that ahead of time.
var quote = this._parseQuote(input, location);
if (quote != null) {
return quote;
}
this._checkNoInterpolation(input, location, interpolationConfig);
var sourceToLex = this._stripComments(input);
var tokens = this._lexer.tokenize(sourceToLex);
return new _ParseAST(input, location, tokens, sourceToLex.length, false, this.errors, input.length - sourceToLex.length)
.parseChain();
};
Parser.prototype._parseQuote = function (input, location) {
if (input == null)
return null;
var prefixSeparatorIndex = input.indexOf(':');
if (prefixSeparatorIndex == -1)
return null;
var prefix = input.substring(0, prefixSeparatorIndex).trim();
if (!isIdentifier(prefix))
return null;
var uninterpretedExpression = input.substring(prefixSeparatorIndex + 1);
return new Quote(new ParseSpan(0, input.length), prefix, uninterpretedExpression, location);
};
Parser.prototype.parseTemplateBindings = function (prefixToken, input, location) {
var tokens = this._lexer.tokenize(input);
if (prefixToken) {
// Prefix the tokens with the tokens from prefixToken but have them take no space (0 index).
var prefixTokens = this._lexer.tokenize(prefixToken).map(function (t) {
t.index = 0;
return t;
});
tokens.unshift.apply(tokens, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(prefixTokens));
}
return new _ParseAST(input, location, tokens, input.length, false, this.errors, 0)
.parseTemplateBindings();
};
Parser.prototype.parseInterpolation = function (input, location, interpolationConfig) {
if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
var split = this.splitInterpolation(input, location, interpolationConfig);
if (split == null)
return null;
var expressions = [];
for (var i = 0; i < split.expressions.length; ++i) {
var expressionText = split.expressions[i];
var sourceToLex = this._stripComments(expressionText);
var tokens = this._lexer.tokenize(sourceToLex);
var ast = new _ParseAST(input, location, tokens, sourceToLex.length, false, this.errors, split.offsets[i] + (expressionText.length - sourceToLex.length))
.parseChain();
expressions.push(ast);
}
return new ASTWithSource(new Interpolation(new ParseSpan(0, input == null ? 0 : input.length), split.strings, expressions), input, location, this.errors);
};
Parser.prototype.splitInterpolation = function (input, location, interpolationConfig) {
if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
var regexp = _createInterpolateRegExp(interpolationConfig);
var parts = input.split(regexp);
if (parts.length <= 1) {
return null;
}
var strings = [];
var expressions = [];
var offsets = [];
var offset = 0;
for (var i = 0; i < parts.length; i++) {
var part = parts[i];
if (i % 2 === 0) {
// fixed string
strings.push(part);
offset += part.length;
}
else if (part.trim().length > 0) {
offset += interpolationConfig.start.length;
expressions.push(part);
offsets.push(offset);
offset += part.length + interpolationConfig.end.length;
}
else {
this._reportError('Blank expressions are not allowed in interpolated strings', input, "at column " + this._findInterpolationErrorColumn(parts, i, interpolationConfig) + " in", location);
expressions.push('$implict');
offsets.push(offset);
}
}
return new SplitInterpolation(strings, expressions, offsets);
};
Parser.prototype.wrapLiteralPrimitive = function (input, location) {
return new ASTWithSource(new LiteralPrimitive(new ParseSpan(0, input == null ? 0 : input.length), input), input, location, this.errors);
};
Parser.prototype._stripComments = function (input) {
var i = this._commentStart(input);
return i != null ? input.substring(0, i).trim() : input;
};
Parser.prototype._commentStart = function (input) {
var outerQuote = null;
for (var i = 0; i < input.length - 1; i++) {
var char = input.charCodeAt(i);
var nextChar = input.charCodeAt(i + 1);
if (char === $SLASH && nextChar == $SLASH && outerQuote == null)
return i;
if (outerQuote === char) {
outerQuote = null;
}
else if (outerQuote == null && isQuote(char)) {
outerQuote = char;
}
}
return null;
};
Parser.prototype._checkNoInterpolation = function (input, location, interpolationConfig) {
var regexp = _createInterpolateRegExp(interpolationConfig);
var parts = input.split(regexp);
if (parts.length > 1) {
this._reportError("Got interpolation (" + interpolationConfig.start + interpolationConfig.end + ") where expression was expected", input, "at column " + this._findInterpolationErrorColumn(parts, 1, interpolationConfig) + " in", location);
}
};
Parser.prototype._findInterpolationErrorColumn = function (parts, partInErrIdx, interpolationConfig) {
var errLocation = '';
for (var j = 0; j < partInErrIdx; j++) {
errLocation += j % 2 === 0 ?
parts[j] :
"" + interpolationConfig.start + parts[j] + interpolationConfig.end;
}
return errLocation.length;
};
return Parser;
}());
var _ParseAST = /** @class */ (function () {
function _ParseAST(input, location, tokens, inputLength, parseAction, errors, offset) {
this.input = input;
this.location = location;
this.tokens = tokens;
this.inputLength = inputLength;
this.parseAction = parseAction;
this.errors = errors;
this.offset = offset;
this.rparensExpected = 0;
this.rbracketsExpected = 0;
this.rbracesExpected = 0;
this.index = 0;
}
_ParseAST.prototype.peek = function (offset) {
var i = this.index + offset;
return i < this.tokens.length ? this.tokens[i] : EOF;
};
Object.defineProperty(_ParseAST.prototype, "next", {
get: function () { return this.peek(0); },
enumerable: true,
configurable: true
});
Object.defineProperty(_ParseAST.prototype, "inputIndex", {
get: function () {
return (this.index < this.tokens.length) ? this.next.index + this.offset :
this.inputLength + this.offset;
},
enumerable: true,
configurable: true
});
_ParseAST.prototype.span = function (start) { return new ParseSpan(start, this.inputIndex); };
_ParseAST.prototype.advance = function () { this.index++; };
_ParseAST.prototype.optionalCharacter = function (code) {
if (this.next.isCharacter(code)) {
this.advance();
return true;
}
else {
return false;
}
};
_ParseAST.prototype.peekKeywordLet = function () { return this.next.isKeywordLet(); };
_ParseAST.prototype.peekKeywordAs = function () { return this.next.isKeywordAs(); };
_ParseAST.prototype.expectCharacter = function (code) {
if (this.optionalCharacter(code))
return;
this.error("Missing expected " + String.fromCharCode(code));
};
_ParseAST.prototype.optionalOperator = function (op) {
if (this.next.isOperator(op)) {
this.advance();
return true;
}
else {
return false;
}
};
_ParseAST.prototype.expectOperator = function (operator) {
if (this.optionalOperator(operator))
return;
this.error("Missing expected operator " + operator);
};
_ParseAST.prototype.expectIdentifierOrKeyword = function () {
var n = this.next;
if (!n.isIdentifier() && !n.isKeyword()) {
this.error("Unexpected token " + n + ", expected identifier or keyword");
return '';
}
this.advance();
return n.toString();
};
_ParseAST.prototype.expectIdentifierOrKeywordOrString = function () {
var n = this.next;
if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {
this.error("Unexpected token " + n + ", expected identifier, keyword, or string");
return '';
}
this.advance();
return n.toString();
};
_ParseAST.prototype.parseChain = function () {
var exprs = [];
var start = this.inputIndex;
while (this.index < this.tokens.length) {
var expr = this.parsePipe();
exprs.push(expr);
if (this.optionalCharacter($SEMICOLON)) {
if (!this.parseAction) {
this.error('Binding expression cannot contain chained expression');
}
while (this.optionalCharacter($SEMICOLON)) {
} // read all semicolons
}
else if (this.index < this.tokens.length) {
this.error("Unexpected token '" + this.next + "'");
}
}
if (exprs.length == 0)
return new EmptyExpr(this.span(start));
if (exprs.length == 1)
return exprs[0];
return new Chain(this.span(start), exprs);
};
_ParseAST.prototype.parsePipe = function () {
var result = this.parseExpression();
if (this.optionalOperator('|')) {
if (this.parseAction) {
this.error('Cannot have a pipe in an action expression');
}
do {
var name_1 = this.expectIdentifierOrKeyword();
var args = [];
while (this.optionalCharacter($COLON)) {
args.push(this.parseExpression());
}
result = new BindingPipe(this.span(result.span.start), result, name_1, args);
} while (this.optionalOperator('|'));
}
return result;
};
_ParseAST.prototype.parseExpression = function () { return this.parseConditional(); };
_ParseAST.prototype.parseConditional = function () {
var start = this.inputIndex;
var result = this.parseLogicalOr();
if (this.optionalOperator('?')) {
var yes = this.parsePipe();
var no = void 0;
if (!this.optionalCharacter($COLON)) {
var end = this.inputIndex;
var expression = this.input.substring(start, end);
this.error("Conditional expression " + expression + " requires all 3 expressions");
no = new EmptyExpr(this.span(start));
}
else {
no = this.parsePipe();
}
return new Conditional(this.span(start), result, yes, no);
}
else {
return result;
}
};
_ParseAST.prototype.parseLogicalOr = function () {
// '||'
var result = this.parseLogicalAnd();
while (this.optionalOperator('||')) {
var right = this.parseLogicalAnd();
result = new Binary(this.span(result.span.start), '||', result, right);
}
return result;
};
_ParseAST.prototype.parseLogicalAnd = function () {
// '&&'
var result = this.parseEquality();
while (this.optionalOperator('&&')) {
var right = this.parseEquality();
result = new Binary(this.span(result.span.start), '&&', result, right);
}
return result;
};
_ParseAST.prototype.parseEquality = function () {
// '==','!=','===','!=='
var result = this.parseRelational();
while (this.next.type == TokenType.Operator) {
var operator = this.next.strValue;
switch (operator) {
case '==':
case '===':
case '!=':
case '!==':
this.advance();
var right = this.parseRelational();
result = new Binary(this.span(result.span.start), operator, result, right);
continue;
}
break;
}
return result;
};
_ParseAST.prototype.parseRelational = function () {
// '<', '>', '<=', '>='
var result = this.parseAdditive();
while (this.next.type == TokenType.Operator) {
var operator = this.next.strValue;
switch (operator) {
case '<':
case '>':
case '<=':
case '>=':
this.advance();
var right = this.parseAdditive();
result = new Binary(this.span(result.span.start), operator, result, right);
continue;
}
break;
}
return result;
};
_ParseAST.prototype.parseAdditive = function () {
// '+', '-'
var result = this.parseMultiplicative();
while (this.next.type == TokenType.Operator) {
var operator = this.next.strValue;
switch (operator) {
case '+':
case '-':
this.advance();
var right = this.parseMultiplicative();
result = new Binary(this.span(result.span.start), operator, result, right);
continue;
}
break;
}
return result;
};
_ParseAST.prototype.parseMultiplicative = function () {
// '*', '%', '/'
var result = this.parsePrefix();
while (this.next.type == TokenType.Operator) {
var operator = this.next.strValue;
switch (operator) {
case '*':
case '%':
case '/':
this.advance();
var right = this.parsePrefix();
result = new Binary(this.span(result.span.start), operator, result, right);
continue;
}
break;
}
return result;
};
_ParseAST.prototype.parsePrefix = function () {
if (this.next.type == TokenType.Operator) {
var start = this.inputIndex;
var operator = this.next.strValue;
var result = void 0;
switch (operator) {
case '+':
this.advance();
result = this.parsePrefix();
return new Binary(this.span(start), '-', result, new LiteralPrimitive(new ParseSpan(start, start), 0));
case '-':
this.advance();
result = this.parsePrefix();
return new Binary(this.span(start), operator, new LiteralPrimitive(new ParseSpan(start, start), 0), result);
case '!':
this.advance();
result = this.parsePrefix();
return new PrefixNot(this.span(start), result);
}
}
return this.parseCallChain();
};
_ParseAST.prototype.parseCallChain = function () {
var result = this.parsePrimary();
while (true) {
if (this.optionalCharacter($PERIOD)) {
result = this.parseAccessMemberOrMethodCall(result, false);
}
else if (this.optionalOperator('?.')) {
result = this.parseAccessMemberOrMethodCall(result, true);
}
else if (this.optionalCharacter($LBRACKET)) {
this.rbracketsExpected++;
var key = this.parsePipe();
this.rbracketsExpected--;
this.expectCharacter($RBRACKET);
if (this.optionalOperator('=')) {
var value = this.parseConditional();
result = new KeyedWrite(this.span(result.span.start), result, key, value);
}
else {
result = new KeyedRead(this.span(result.span.start), result, key);
}
}
else if (this.optionalCharacter($LPAREN)) {
this.rparensExpected++;
var args = this.parseCallArguments();
this.rparensExpected--;
this.expectCharacter($RPAREN);
result = new FunctionCall(this.span(result.span.start), result, args);
}
else if (this.optionalOperator('!')) {
result = new NonNullAssert(this.span(result.span.start), result);
}
else {
return result;
}
}
};
_ParseAST.prototype.parsePrimary = function () {
var start = this.inputIndex;
if (this.optionalCharacter($LPAREN)) {
this.rparensExpected++;
var result = this.parsePipe();
this.rparensExpected--;
this.expectCharacter($RPAREN);
return result;
}
else if (this.next.isKeywordNull()) {
this.advance();
return new LiteralPrimitive(this.span(start), null);
}
else if (this.next.isKeywordUndefined()) {
this.advance();
return new LiteralPrimitive(this.span(start), void 0);
}
else if (this.next.isKeywordTrue()) {
this.advance();
return new LiteralPrimitive(this.span(start), true);
}
else if (this.next.isKeywordFalse()) {
this.advance();
return new LiteralPrimitive(this.span(start), false);
}
else if (this.next.isKeywordThis()) {
this.advance();
return new ImplicitReceiver(this.span(start));
}
else if (this.optionalCharacter($LBRACKET)) {
this.rbracketsExpected++;
var elements = this.parseExpressionList($RBRACKET);
this.rbracketsExpected--;
this.expectCharacter($RBRACKET);
return new LiteralArray(this.span(start), elements);
}
else if (this.next.isCharacter($LBRACE)) {
return this.parseLiteralMap();
}
else if (this.next.isIdentifier()) {
return this.parseAccessMemberOrMethodCall(new ImplicitReceiver(this.span(start)), false);
}
else if (this.next.isNumber()) {
var value = this.next.toNumber();
this.advance();
return new LiteralPrimitive(this.span(start), value);
}
else if (this.next.isString()) {
var literalValue = this.next.toString();
this.advance();
return new LiteralPrimitive(this.span(start), literalValue);
}
else if (this.index >= this.tokens.length) {
this.error("Unexpected end of expression: " + this.input);
return new EmptyExpr(this.span(start));
}
else {
this.error("Unexpected token " + this.next);
return new EmptyExpr(this.span(start));
}
};
_ParseAST.prototype.parseExpressionList = function (terminator) {
var result = [];
if (!this.next.isCharacter(terminator)) {
do {
result.push(this.parsePipe());
} while (this.optionalCharacter($COMMA));
}
return result;
};
_ParseAST.prototype.parseLiteralMap = function () {
var keys = [];
var values = [];
var start = this.inputIndex;
this.expectCharacter($LBRACE);
if (!this.optionalCharacter($RBRACE)) {
this.rbracesExpected++;
do {
var quoted = this.next.isString();
var key = this.expectIdentifierOrKeywordOrString();
keys.push({ key: key, quoted: quoted });
this.expectCharacter($COLON);
values.push(this.parsePipe());
} while (this.optionalCharacter($COMMA));
this.rbracesExpected--;
this.expectCharacter($RBRACE);
}
return new LiteralMap(this.span(start), keys, values);
};
_ParseAST.prototype.parseAccessMemberOrMethodCall = function (receiver, isSafe) {
if (isSafe === void 0) { isSafe = false; }
var start = receiver.span.start;
var id = this.expectIdentifierOrKeyword();
if (this.optionalCharacter($LPAREN)) {
this.rparensExpected++;
var args = this.parseCallArguments();
this.expectCharacter($RPAREN);
this.rparensExpected--;
var span = this.span(start);
return isSafe ? new SafeMethodCall(span, receiver, id, args) :
new MethodCall(span, receiver, id, args);
}
else {
if (isSafe) {
if (this.optionalOperator('=')) {
this.error('The \'?.\' operator cannot be used in the assignment');
return new EmptyExpr(this.span(start));
}
else {
return new SafePropertyRead(this.span(start), receiver, id);
}
}
else {
if (this.optionalOperator('=')) {
if (!this.parseAction) {
this.error('Bindings cannot contain assignments');
return new EmptyExpr(this.span(start));
}
var value = this.parseConditional();
return new PropertyWrite(this.span(start), receiver, id, value);
}
else {
return new PropertyRead(this.span(start), receiver, id);
}
}
}
};
_ParseAST.prototype.parseCallArguments = function () {
if (this.next.isCharacter($RPAREN))
return [];
var positionals = [];
do {
positionals.push(this.parsePipe());
} while (this.optionalCharacter($COMMA));
return positionals;
};
/**
* An identifier, a keyword, a string with an optional `-` in between.
*/
_ParseAST.prototype.expectTemplateBindingKey = function () {
var result = '';
var operatorFound = false;
do {
result += this.expectIdentifierOrKeywordOrString();
operatorFound = this.optionalOperator('-');
if (operatorFound) {
result += '-';
}
} while (operatorFound);
return result.toString();
};
_ParseAST.prototype.parseTemplateBindings = function () {
var bindings = [];
var prefix = null;
var warnings = [];
while (this.index < this.tokens.length) {
var start = this.inputIndex;
var keyIsVar = this.peekKeywordLet();
if (keyIsVar) {
this.advance();
}
var rawKey = this.expectTemplateBindingKey();
var key = rawKey;
if (!keyIsVar) {
if (prefix == null) {
prefix = key;
}
else {
key = prefix + key[0].toUpperCase() + key.substring(1);
}
}
this.optionalCharacter($COLON);
var name_2 = null;
var expression = null;
if (keyIsVar) {
if (this.optionalOperator('=')) {
name_2 = this.expectTemplateBindingKey();
}
else {
name_2 = '\$implicit';
}
}
else if (this.peekKeywordAs()) {
var letStart = this.inputIndex;
this.advance(); // consume `as`
name_2 = rawKey;
key = this.expectTemplateBindingKey(); // read local var name
keyIsVar = true;
}
else if (this.next !== EOF && !this.peekKeywordLet()) {
var start_1 = this.inputIndex;
var ast = this.parsePipe();
var source = this.input.substring(start_1 - this.offset, this.inputIndex - this.offset);
expression = new ASTWithSource(ast, source, this.location, this.errors);
}
bindings.push(new TemplateBinding(this.span(start), key, keyIsVar, name_2, expression));
if (this.peekKeywordAs() && !keyIsVar) {
var letStart = this.inputIndex;
this.advance(); // consume `as`
var letName = this.expectTemplateBindingKey(); // read local var name
bindings.push(new TemplateBinding(this.span(letStart), letName, true, key, null));
}
if (!this.optionalCharacter($SEMICOLON)) {
this.optionalCharacter($COMMA);
}
}
return new TemplateBindingParseResult(bindings, warnings, this.errors);
};
_ParseAST.prototype.error = function (message, index) {
if (index === void 0) { index = null; }
this.errors.push(new ParserError(message, this.input, this.locationText(index), this.location));
this.skip();
};
_ParseAST.prototype.locationText = function (index) {
if (index === void 0) { index = null; }
if (index == null)
index = this.index;
return (index < this.tokens.length) ? "at column " + (this.tokens[index].index + 1) + " in" :
"at the end of the expression";
};
// Error recovery should skip tokens until it encounters a recovery point. skip() treats
// the end of input and a ';' as unconditionally a recovery point. It also treats ')',
// '}' and ']' as conditional recovery points if one of calling productions is expecting
// one of these symbols. This allows skip() to recover from errors such as '(a.) + 1' allowing
// more of the AST to be retained (it doesn't skip any tokens as the ')' is retained because
// of the '(' begins an '(' <expr> ')' production). The recovery points of grouping symbols
// must be conditional as they must be skipped if none of the calling productions are not
// expecting the closing token else we will never make progress in the case of an
// extraneous group closing symbol (such as a stray ')'). This is not the case for ';' because
// parseChain() is always the root production and it expects a ';'.
// If a production expects one of these token it increments the corresponding nesting count,
// and then decrements it just prior to checking if the token is in the input.
_ParseAST.prototype.skip = function () {
var n = this.next;
while (this.index < this.tokens.length && !n.isCharacter($SEMICOLON) &&
(this.rparensExpected <= 0 || !n.isCharacter($RPAREN)) &&
(this.rbracesExpected <= 0 || !n.isCharacter($RBRACE)) &&
(this.rbracketsExpected <= 0 || !n.isCharacter($RBRACKET))) {
if (this.next.isError()) {
this.errors.push(new ParserError(this.next.toString(), this.input, this.locationText(), this.location));
}
this.advance();
n = this.next;
}
};
return _ParseAST;
}());
var SimpleExpressionChecker = /** @class */ (function () {
function SimpleExpressionChecker() {
this.errors = [];
}
SimpleExpressionChecker.check = function (ast) {
var s = new SimpleExpressionChecker();
ast.visit(s);
return s.errors;
};
SimpleExpressionChecker.prototype.visitImplicitReceiver = function (ast, context) { };
SimpleExpressionChecker.prototype.visitInterpolation = function (ast, context) { };
SimpleExpressionChecker.prototype.visitLiteralPrimitive = function (ast, context) { };
SimpleExpressionChecker.prototype.visitPropertyRead = function (ast, context) { };
SimpleExpressionChecker.prototype.visitPropertyWrite = function (ast, context) { };
SimpleExpressionChecker.prototype.visitSafePropertyRead = function (ast, context) { };
SimpleExpressionChecker.prototype.visitMethodCall = function (ast, context) { };
SimpleExpressionChecker.prototype.visitSafeMethodCall = function (ast, context) { };
SimpleExpressionChecker.prototype.visitFunctionCall = function (ast, context) { };
SimpleExpressionChecker.prototype.visitLiteralArray = function (ast, context) { this.visitAll(ast.expressions); };
SimpleExpressionChecker.prototype.visitLiteralMap = function (ast, context) { this.visitAll(ast.values); };
SimpleExpressionChecker.prototype.visitBinary = function (ast, context) { };
SimpleExpressionChecker.prototype.visitPrefixNot = function (ast, context) { };
SimpleExpressionChecker.prototype.visitNonNullAssert = function (ast, context) { };
SimpleExpressionChecker.prototype.visitConditional = function (ast, context) { };
SimpleExpressionChecker.prototype.visitPipe = function (ast, context) { this.errors.push('pipes'); };
SimpleExpressionChecker.prototype.visitKeyedRead = function (ast, context) { };
SimpleExpressionChecker.prototype.visitKeyedWrite = function (ast, context) { };
SimpleExpressionChecker.prototype.visitAll = function (asts) {
var _this = this;
return asts.map(function (node) { return node.visit(_this); });
};
SimpleExpressionChecker.prototype.visitChain = function (ast, context) { };
SimpleExpressionChecker.prototype.visitQuote = function (ast, context) { };
return SimpleExpressionChecker;
}());
/**
* @license
* Copyright Google Inc. 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 ParseLocation = /** @class */ (function () {
function ParseLocation(file, offset, line, col) {
this.file = file;
this.offset = offset;
this.line = line;
this.col = col;
}
ParseLocation.prototype.toString = function () {
return this.offset != null ? this.file.url + "@" + this.line + ":" + this.col : this.file.url;
};
ParseLocation.prototype.moveBy = function (delta) {
var source = this.file.content;
var len = source.length;
var offset = this.offset;
var line = this.line;
var col = this.col;
while (offset > 0 && delta < 0) {
offset--;
delta++;
var ch = source.charCodeAt(offset);
if (ch == $LF) {
line--;
var priorLine = source.substr(0, offset - 1).lastIndexOf(String.fromCharCode($LF));
col = priorLine > 0 ? offset - priorLine : offset;
}
else {
col--;
}
}
while (offset < len && delta > 0) {
var ch = source.charCodeAt(offset);
offset++;
delta--;
if (ch == $LF) {
line++;
col = 0;
}
else {
col++;
}
}
return new ParseLocation(this.file, offset, line, col);
};
// Return the source around the location
// Up to `maxChars` or `maxLines` on each side of the location
ParseLocation.prototype.getContext = function (maxChars, maxLines) {
var content = this.file.content;
var startOffset = this.offset;
if (startOffset != null) {
if (startOffset > content.length - 1) {
startOffset = content.length - 1;
}
var endOffset = startOffset;
var ctxChars = 0;
var ctxLines = 0;
while (ctxChars < maxChars && startOffset > 0) {
startOffset--;
ctxChars++;
if (content[startOffset] == '\n') {
if (++ctxLines == maxLines) {
break;
}
}
}
ctxChars = 0;
ctxLines = 0;
while (ctxChars < maxChars && endOffset < content.length - 1) {
endOffset++;
ctxChars++;
if (content[endOffset] == '\n') {
if (++ctxLines == maxLines) {
break;
}
}
}
return {
before: content.substring(startOffset, this.offset),
after: content.substring(this.offset, endOffset + 1),
};
}
return null;
};
return ParseLocation;
}());
var ParseSourceFile = /** @class */ (function () {
function ParseSourceFile(content, url) {
this.content = content;
this.url = url;
}
return ParseSourceFile;
}());
var ParseSourceSpan = /** @class */ (function () {
function ParseSourceSpan(start, end, details) {
if (details === void 0) { details = null; }
this.start = start;
this.end = end;
this.details = details;
}
ParseSourceSpan.prototype.toString = function () {
return this.start.file.content.substring(this.start.offset, this.end.offset);
};
return ParseSourceSpan;
}());
var ParseErrorLevel;
(function (ParseErrorLevel) {
ParseErrorLevel[ParseErrorLevel["WARNING"] = 0] = "WARNING";
ParseErrorLevel[ParseErrorLevel["ERROR"] = 1] = "ERROR";
})(ParseErrorLevel || (ParseErrorLevel = {}));
var ParseError = /** @class */ (function () {
function ParseError(span, msg, level) {
if (level === void 0) { level = ParseErrorLevel.ERROR; }
this.span = span;
this.msg = msg;
this.level = level;
}
ParseError.prototype.contextualMessage = function () {
var ctx = this.span.start.getContext(100, 3);
return ctx ? this.msg + " (\"" + ctx.before + "[" + ParseErrorLevel[this.level] + " ->]" + ctx.after + "\")" :
this.msg;
};
ParseError.prototype.toString = function () {
var details = this.span.details ? ", " + this.span.details : '';
return this.contextualMessage() + ": " + this.span.start + details;
};
return ParseError;
}());
function typeSourceSpan(kind, type) {
var moduleUrl = identifierModuleUrl(type);
var sourceFileName = moduleUrl != null ? "in " + kind + " " + identifierName(type) + " in " + moduleUrl :
"in " + kind + " " + identifierName(type);
var sourceFile = new ParseSourceFile('', sourceFileName);
return new ParseSourceSpan(new ParseLocation(sourceFile, -1, -1, -1), new ParseLocation(sourceFile, -1, -1, -1));
}
/**
* @license
* Copyright Google Inc. 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 TokenType$1;
(function (TokenType) {
TokenType[TokenType["TAG_OPEN_START"] = 0] = "TAG_OPEN_START";
TokenType[TokenType["TAG_OPEN_END"] = 1] = "TAG_OPEN_END";
TokenType[TokenType["TAG_OPEN_END_VOID"] = 2] = "TAG_OPEN_END_VOID";
TokenType[TokenType["TAG_CLOSE"] = 3] = "TAG_CLOSE";
TokenType[TokenType["TEXT"] = 4] = "TEXT";
TokenType[TokenType["ESCAPABLE_RAW_TEXT"] = 5] = "ESCAPABLE_RAW_TEXT";
TokenType[TokenType["RAW_TEXT"] = 6] = "RAW_TEXT";
TokenType[TokenType["COMMENT_START"] = 7] = "COMMENT_START";
TokenType[TokenType["COMMENT_END"] = 8] = "COMMENT_END";
TokenType[TokenType["CDATA_START"] = 9] = "CDATA_START";
TokenType[TokenType["CDATA_END"] = 10] = "CDATA_END";
TokenType[TokenType["ATTR_NAME"] = 11] = "ATTR_NAME";
TokenType[TokenType["ATTR_VALUE"] = 12] = "ATTR_VALUE";
TokenType[TokenType["DOC_TYPE"] = 13] = "DOC_TYPE";
TokenType[TokenType["EXPANSION_FORM_START"] = 14] = "EXPANSION_FORM_START";
TokenType[TokenType["EXPANSION_CASE_VALUE"] = 15] = "EXPANSION_CASE_VALUE";
TokenType[TokenType["EXPANSION_CASE_EXP_START"] = 16] = "EXPANSION_CASE_EXP_START";
TokenType[TokenType["EXPANSION_CASE_EXP_END"] = 17] = "EXPANSION_CASE_EXP_END";
TokenType[TokenType["EXPANSION_FORM_END"] = 18] = "EXPANSION_FORM_END";
TokenType[TokenType["EOF"] = 19] = "EOF";
})(TokenType$1 || (TokenType$1 = {}));
var Token$1 = /** @class */ (function () {
function Token(type, parts, sourceSpan) {
this.type = type;
this.parts = parts;
this.sourceSpan = sourceSpan;
}
return Token;
}());
var TokenError = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TokenError, _super);
function TokenError(errorMsg, tokenType, span) {
var _this = _super.call(this, span, errorMsg) || this;
_this.tokenType = tokenType;
return _this;
}
return TokenError;
}(ParseError));
var TokenizeResult = /** @class */ (function () {
function TokenizeResult(tokens, errors) {
this.tokens = tokens;
this.errors = errors;
}
return TokenizeResult;
}());
function tokenize(source, url, getTagDefinition, tokenizeExpansionForms, interpolationConfig) {
if (tokenizeExpansionForms === void 0) { tokenizeExpansionForms = false; }
if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
return new _Tokenizer(new ParseSourceFile(source, url), getTagDefinition, tokenizeExpansionForms, interpolationConfig)
.tokenize();
}
var _CR_OR_CRLF_REGEXP = /\r\n?/g;
function _unexpectedCharacterErrorMsg(charCode) {
var char = charCode === $EOF ? 'EOF' : String.fromCharCode(charCode);
return "Unexpected character \"" + char + "\"";
}
function _unknownEntityErrorMsg(entitySrc) {
return "Unknown entity \"" + entitySrc + "\" - use the \"&#<decimal>;\" or \"&#x<hex>;\" syntax";
}
var _ControlFlowError = /** @class */ (function () {
function _ControlFlowError(error) {
this.error = error;
}
return _ControlFlowError;
}());
// See http://www.w3.org/TR/html51/syntax.html#writing
var _Tokenizer = /** @class */ (function () {
/**
* @param _file The html source
* @param _getTagDefinition
* @param _tokenizeIcu Whether to tokenize ICU messages (considered as text nodes when false)
* @param _interpolationConfig
*/
function _Tokenizer(_file, _getTagDefinition, _tokenizeIcu, _interpolationConfig) {
if (_interpolationConfig === void 0) { _interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
this._file = _file;
this._getTagDefinition = _getTagDefinition;
this._tokenizeIcu = _tokenizeIcu;
this._interpolationConfig = _interpolationConfig;
// Note: this is always lowercase!
this._peek = -1;
this._nextPeek = -1;
this._index = -1;
this._line = 0;
this._column = -1;
this._expansionCaseStack = [];
this._inInterpolation = false;
this.tokens = [];
this.errors = [];
this._input = _file.content;
this._length = _file.content.length;
this._advance();
}
_Tokenizer.prototype._processCarriageReturns = function (content) {
// http://www.w3.org/TR/html5/syntax.html#preprocessing-the-input-stream
// In order to keep the original position in the source, we can not
// pre-process it.
// Instead CRs are processed right before instantiating the tokens.
return content.replace(_CR_OR_CRLF_REGEXP, '\n');
};
_Tokenizer.prototype.tokenize = function () {
while (this._peek !== $EOF) {
var start = this._getLocation();
try {
if (this._attemptCharCode($LT)) {
if (this._attemptCharCode($BANG)) {
if (this._attemptCharCode($LBRACKET)) {
this._consumeCdata(start);
}
else if (this._attemptCharCode($MINUS)) {
this._consumeComment(start);
}
else {
this._consumeDocType(start);
}
}
else if (this._attemptCharCode($SLASH)) {
this._consumeTagClose(start);
}
else {
this._consumeTagOpen(start);
}
}
else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) {
this._consumeText();
}
}
catch (e) {
if (e instanceof _ControlFlowError) {
this.errors.push(e.error);
}
else {
throw e;
}
}
}
this._beginToken(TokenType$1.EOF);
this._endToken([]);
return new TokenizeResult(mergeTextTokens(this.tokens), this.errors);
};
/**
* @returns whether an ICU token has been created
* @internal
*/
_Tokenizer.prototype._tokenizeExpansionForm = function () {
if (isExpansionFormStart(this._input, this._index, this._interpolationConfig)) {
this._consumeExpansionFormStart();
return true;
}
if (isExpansionCaseStart(this._peek) && this._isInExpansionForm()) {
this._consumeExpansionCaseStart();
return true;
}
if (this._peek === $RBRACE) {
if (this._isInExpansionCase()) {
this._consumeExpansionCaseEnd();
return true;
}
if (this._isInExpansionForm()) {
this._consumeExpansionFormEnd();
return true;
}
}
return false;
};
_Tokenizer.prototype._getLocation = function () {
return new ParseLocation(this._file, this._index, this._line, this._column);
};
_Tokenizer.prototype._getSpan = function (start, end) {
if (start === void 0) { start = this._getLocation(); }
if (end === void 0) { end = this._getLocation(); }
return new ParseSourceSpan(start, end);
};
_Tokenizer.prototype._beginToken = function (type, start) {
if (start === void 0) { start = this._getLocation(); }
this._currentTokenStart = start;
this._currentTokenType = type;
};
_Tokenizer.prototype._endToken = function (parts, end) {
if (end === void 0) { end = this._getLocation(); }
var token = new Token$1(this._currentTokenType, parts, new ParseSourceSpan(this._currentTokenStart, end));
this.tokens.push(token);
this._currentTokenStart = null;
this._currentTokenType = null;
return token;
};
_Tokenizer.prototype._createError = function (msg, span) {
if (this._isInExpansionForm()) {
msg += " (Do you have an unescaped \"{\" in your template? Use \"{{ '{' }}\") to escape it.)";
}
var error = new TokenError(msg, this._currentTokenType, span);
this._currentTokenStart = null;
this._currentTokenType = null;
return new _ControlFlowError(error);
};
_Tokenizer.prototype._advance = function () {
if (this._index >= this._length) {
throw this._createError(_unexpectedCharacterErrorMsg($EOF), this._getSpan());
}
if (this._peek === $LF) {
this._line++;
this._column = 0;
}
else if (this._peek !== $LF && this._peek !== $CR) {
this._column++;
}
this._index++;
this._peek = this._index >= this._length ? $EOF : this._input.charCodeAt(this._index);
this._nextPeek =
this._index + 1 >= this._length ? $EOF : this._input.charCodeAt(this._index + 1);
};
_Tokenizer.prototype._attemptCharCode = function (charCode) {
if (this._peek === charCode) {
this._advance();
return true;
}
return false;
};
_Tokenizer.prototype._attemptCharCodeCaseInsensitive = function (charCode) {
if (compareCharCodeCaseInsensitive(this._peek, charCode)) {
this._advance();
return true;
}
return false;
};
_Tokenizer.prototype._requireCharCode = function (charCode) {
var location = this._getLocation();
if (!this._attemptCharCode(charCode)) {
throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan(location, location));
}
};
_Tokenizer.prototype._attemptStr = function (chars) {
var len = chars.length;
if (this._index + len > this._length) {
return false;
}
var initialPosition = this._savePosition();
for (var i = 0; i < len; i++) {
if (!this._attemptCharCode(chars.charCodeAt(i))) {
// If attempting to parse the string fails, we want to reset the parser
// to where it was before the attempt
this._restorePosition(initialPosition);
return false;
}
}
return true;
};
_Tokenizer.prototype._attemptStrCaseInsensitive = function (chars) {
for (var i = 0; i < chars.length; i++) {
if (!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i))) {
return false;
}
}
return true;
};
_Tokenizer.prototype._requireStr = function (chars) {
var location = this._getLocation();
if (!this._attemptStr(chars)) {
throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan(location));
}
};
_Tokenizer.prototype._attemptCharCodeUntilFn = function (predicate) {
while (!predicate(this._peek)) {
this._advance();
}
};
_Tokenizer.prototype._requireCharCodeUntilFn = function (predicate, len) {
var start = this._getLocation();
this._attemptCharCodeUntilFn(predicate);
if (this._index - start.offset < len) {
throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan(start, start));
}
};
_Tokenizer.prototype._attemptUntilChar = function (char) {
while (this._peek !== char) {
this._advance();
}
};
_Tokenizer.prototype._readChar = function (decodeEntities) {
if (decodeEntities && this._peek === $AMPERSAND) {
return this._decodeEntity();
}
else {
var index = this._index;
this._advance();
return this._input[index];
}
};
_Tokenizer.prototype._decodeEntity = function () {
var start = this._getLocation();
this._advance();
if (this._attemptCharCode($HASH)) {
var isHex = this._attemptCharCode($x) || this._attemptCharCode($X);
var numberStart = this._getLocation().offset;
this._attemptCharCodeUntilFn(isDigitEntityEnd);
if (this._peek != $SEMICOLON) {
throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan());
}
this._advance();
var strNum = this._input.substring(numberStart, this._index - 1);
try {
var charCode = parseInt(strNum, isHex ? 16 : 10);
return String.fromCharCode(charCode);
}
catch (e) {
var entity = this._input.substring(start.offset + 1, this._index - 1);
throw this._createError(_unknownEntityErrorMsg(entity), this._getSpan(start));
}
}
else {
var startPosition = this._savePosition();
this._attemptCharCodeUntilFn(isNamedEntityEnd);
if (this._peek != $SEMICOLON) {
this._restorePosition(startPosition);
return '&';
}
this._advance();
var name_1 = this._input.substring(start.offset + 1, this._index - 1);
var char = NAMED_ENTITIES[name_1];
if (!char) {
throw this._createError(_unknownEntityErrorMsg(name_1), this._getSpan(start));
}
return char;
}
};
_Tokenizer.prototype._consumeRawText = function (decodeEntities, firstCharOfEnd, attemptEndRest) {
var tagCloseStart;
var textStart = this._getLocation();
this._beginToken(decodeEntities ? TokenType$1.ESCAPABLE_RAW_TEXT : TokenType$1.RAW_TEXT, textStart);
var parts = [];
while (true) {
tagCloseStart = this._getLocation();
if (this._attemptCharCode(firstCharOfEnd) && attemptEndRest()) {
break;
}
if (this._index > tagCloseStart.offset) {
// add the characters consumed by the previous if statement to the output
parts.push(this._input.substring(tagCloseStart.offset, this._index));
}
while (this._peek !== firstCharOfEnd) {
parts.push(this._readChar(decodeEntities));
}
}
return this._endToken([this._processCarriageReturns(parts.join(''))], tagCloseStart);
};
_Tokenizer.prototype._consumeComment = function (start) {
var _this = this;
this._beginToken(TokenType$1.COMMENT_START, start);
this._requireCharCode($MINUS);
this._endToken([]);
var textToken = this._consumeRawText(false, $MINUS, function () { return _this._attemptStr('->'); });
this._beginToken(TokenType$1.COMMENT_END, textToken.sourceSpan.end);
this._endToken([]);
};
_Tokenizer.prototype._consumeCdata = function (start) {
var _this = this;
this._beginToken(TokenType$1.CDATA_START, start);
this._requireStr('CDATA[');
this._endToken([]);
var textToken = this._consumeRawText(false, $RBRACKET, function () { return _this._attemptStr(']>'); });
this._beginToken(TokenType$1.CDATA_END, textToken.sourceSpan.end);
this._endToken([]);
};
_Tokenizer.prototype._consumeDocType = function (start) {
this._beginToken(TokenType$1.DOC_TYPE, start);
this._attemptUntilChar($GT);
this._advance();
this._endToken([this._input.substring(start.offset + 2, this._index - 1)]);
};
_Tokenizer.prototype._consumePrefixAndName = function () {
var nameOrPrefixStart = this._index;
var prefix = null;
while (this._peek !== $COLON && !isPrefixEnd(this._peek)) {
this._advance();
}
var nameStart;
if (this._peek === $COLON) {
this._advance();
prefix = this._input.substring(nameOrPrefixStart, this._index - 1);
nameStart = this._index;
}
else {
nameStart = nameOrPrefixStart;
}
this._requireCharCodeUntilFn(isNameEnd, this._index === nameStart ? 1 : 0);
var name = this._input.substring(nameStart, this._index);
return [prefix, name];
};
_Tokenizer.prototype._consumeTagOpen = function (start) {
var savedPos = this._savePosition();
var tagName;
var lowercaseTagName;
try {
if (!isAsciiLetter(this._peek)) {
throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan());
}
var nameStart = this._index;
this._consumeTagOpenStart(start);
tagName = this._input.substring(nameStart, this._index);
lowercaseTagName = tagName.toLowerCase();
this._attemptCharCodeUntilFn(isNotWhitespace);
while (this._peek !== $SLASH && this._peek !== $GT) {
this._consumeAttributeName();
this._attemptCharCodeUntilFn(isNotWhitespace);
if (this._attemptCharCode($EQ)) {
this._attemptCharCodeUntilFn(isNotWhitespace);
this._consumeAttributeValue();
}
this._attemptCharCodeUntilFn(isNotWhitespace);
}
this._consumeTagOpenEnd();
}
catch (e) {
if (e instanceof _ControlFlowError) {
// When the start tag is invalid, assume we want a "<"
this._restorePosition(savedPos);
// Back to back text tokens are merged at the end
this._beginToken(TokenType$1.TEXT, start);
this._endToken(['<']);
return;
}
throw e;
}
var contentTokenType = this._getTagDefinition(tagName).contentType;
if (contentTokenType === TagContentType.RAW_TEXT) {
this._consumeRawTextWithTagClose(lowercaseTagName, false);
}
else if (contentTokenType === TagContentType.ESCAPABLE_RAW_TEXT) {
this._consumeRawTextWithTagClose(lowercaseTagName, true);
}
};
_Tokenizer.prototype._consumeRawTextWithTagClose = function (lowercaseTagName, decodeEntities) {
var _this = this;
var textToken = this._consumeRawText(decodeEntities, $LT, function () {
if (!_this._attemptCharCode($SLASH))
return false;
_this._attemptCharCodeUntilFn(isNotWhitespace);
if (!_this._attemptStrCaseInsensitive(lowercaseTagName))
return false;
_this._attemptCharCodeUntilFn(isNotWhitespace);
return _this._attemptCharCode($GT);
});
this._beginToken(TokenType$1.TAG_CLOSE, textToken.sourceSpan.end);
this._endToken([null, lowercaseTagName]);
};
_Tokenizer.prototype._consumeTagOpenStart = function (start) {
this._beginToken(TokenType$1.TAG_OPEN_START, start);
var parts = this._consumePrefixAndName();
this._endToken(parts);
};
_Tokenizer.prototype._consumeAttributeName = function () {
this._beginToken(TokenType$1.ATTR_NAME);
var prefixAndName = this._consumePrefixAndName();
this._endToken(prefixAndName);
};
_Tokenizer.prototype._consumeAttributeValue = function () {
this._beginToken(TokenType$1.ATTR_VALUE);
var value;
if (this._peek === $SQ || this._peek === $DQ) {
var quoteChar = this._peek;
this._advance();
var parts = [];
while (this._peek !== quoteChar) {
parts.push(this._readChar(true));
}
value = parts.join('');
this._advance();
}
else {
var valueStart = this._index;
this._requireCharCodeUntilFn(isNameEnd, 1);
value = this._input.substring(valueStart, this._index);
}
this._endToken([this._processCarriageReturns(value)]);
};
_Tokenizer.prototype._consumeTagOpenEnd = function () {
var tokenType = this._attemptCharCode($SLASH) ? TokenType$1.TAG_OPEN_END_VOID : TokenType$1.TAG_OPEN_END;
this._beginToken(tokenType);
this._requireCharCode($GT);
this._endToken([]);
};
_Tokenizer.prototype._consumeTagClose = function (start) {
this._beginToken(TokenType$1.TAG_CLOSE, start);
this._attemptCharCodeUntilFn(isNotWhitespace);
var prefixAndName = this._consumePrefixAndName();
this._attemptCharCodeUntilFn(isNotWhitespace);
this._requireCharCode($GT);
this._endToken(prefixAndName);
};
_Tokenizer.prototype._consumeExpansionFormStart = function () {
this._beginToken(TokenType$1.EXPANSION_FORM_START, this._getLocation());
this._requireCharCode($LBRACE);
this._endToken([]);
this._expansionCaseStack.push(TokenType$1.EXPANSION_FORM_START);
this._beginToken(TokenType$1.RAW_TEXT, this._getLocation());
var condition = this._readUntil($COMMA);
this._endToken([condition], this._getLocation());
this._requireCharCode($COMMA);
this._attemptCharCodeUntilFn(isNotWhitespace);
this._beginToken(TokenType$1.RAW_TEXT, this._getLocation());
var type = this._readUntil($COMMA);
this._endToken([type], this._getLocation());
this._requireCharCode($COMMA);
this._attemptCharCodeUntilFn(isNotWhitespace);
};
_Tokenizer.prototype._consumeExpansionCaseStart = function () {
this._beginToken(TokenType$1.EXPANSION_CASE_VALUE, this._getLocation());
var value = this._readUntil($LBRACE).trim();
this._endToken([value], this._getLocation());
this._attemptCharCodeUntilFn(isNotWhitespace);
this._beginToken(TokenType$1.EXPANSION_CASE_EXP_START, this._getLocation());
this._requireCharCode($LBRACE);
this._endToken([], this._getLocation());
this._attemptCharCodeUntilFn(isNotWhitespace);
this._expansionCaseStack.push(TokenType$1.EXPANSION_CASE_EXP_START);
};
_Tokenizer.prototype._consumeExpansionCaseEnd = function () {
this._beginToken(TokenType$1.EXPANSION_CASE_EXP_END, this._getLocation());
this._requireCharCode($RBRACE);
this._endToken([], this._getLocation());
this._attemptCharCodeUntilFn(isNotWhitespace);
this._expansionCaseStack.pop();
};
_Tokenizer.prototype._consumeExpansionFormEnd = function () {
this._beginToken(TokenType$1.EXPANSION_FORM_END, this._getLocation());
this._requireCharCode($RBRACE);
this._endToken([]);
this._expansionCaseStack.pop();
};
_Tokenizer.prototype._consumeText = function () {
var start = this._getLocation();
this._beginToken(TokenType$1.TEXT, start);
var parts = [];
do {
if (this._interpolationConfig && this._attemptStr(this._interpolationConfig.start)) {
parts.push(this._interpolationConfig.start);
this._inInterpolation = true;
}
else if (this._interpolationConfig && this._inInterpolation &&
this._attemptStr(this._interpolationConfig.end)) {
parts.push(this._interpolationConfig.end);
this._inInterpolation = false;
}
else {
parts.push(this._readChar(true));
}
} while (!this._isTextEnd());
this._endToken([this._processCarriageReturns(parts.join(''))]);
};
_Tokenizer.prototype._isTextEnd = function () {
if (this._peek === $LT || this._peek === $EOF) {
return true;
}
if (this._tokenizeIcu && !this._inInterpolation) {
if (isExpansionFormStart(this._input, this._index, this._interpolationConfig)) {
// start of an expansion form
return true;
}
if (this._peek === $RBRACE && this._isInExpansionCase()) {
// end of and expansion case
return true;
}
}
return false;
};
_Tokenizer.prototype._savePosition = function () {
return [this._peek, this._index, this._column, this._line, this.tokens.length];
};
_Tokenizer.prototype._readUntil = function (char) {
var start = this._index;
this._attemptUntilChar(char);
return this._input.substring(start, this._index);
};
_Tokenizer.prototype._restorePosition = function (position) {
this._peek = position[0];
this._index = position[1];
this._column = position[2];
this._line = position[3];
var nbTokens = position[4];
if (nbTokens < this.tokens.length) {
// remove any extra tokens
this.tokens = this.tokens.slice(0, nbTokens);
}
};
_Tokenizer.prototype._isInExpansionCase = function () {
return this._expansionCaseStack.length > 0 &&
this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
TokenType$1.EXPANSION_CASE_EXP_START;
};
_Tokenizer.prototype._isInExpansionForm = function () {
return this._expansionCaseStack.length > 0 &&
this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
TokenType$1.EXPANSION_FORM_START;
};
return _Tokenizer;
}());
function isNotWhitespace(code) {
return !isWhitespace(code) || code === $EOF;
}
function isNameEnd(code) {
return isWhitespace(code) || code === $GT || code === $SLASH ||
code === $SQ || code === $DQ || code === $EQ;
}
function isPrefixEnd(code) {
return (code < $a || $z < code) && (code < $A || $Z < code) &&
(code < $0 || code > $9);
}
function isDigitEntityEnd(code) {
return code == $SEMICOLON || code == $EOF || !isAsciiHexDigit(code);
}
function isNamedEntityEnd(code) {
return code == $SEMICOLON || code == $EOF || !isAsciiLetter(code);
}
function isExpansionFormStart(input, offset, interpolationConfig) {
var isInterpolationStart = interpolationConfig ? input.indexOf(interpolationConfig.start, offset) == offset : false;
return input.charCodeAt(offset) == $LBRACE && !isInterpolationStart;
}
function isExpansionCaseStart(peek) {
return peek === $EQ || isAsciiLetter(peek) || isDigit(peek);
}
function compareCharCodeCaseInsensitive(code1, code2) {
return toUpperCaseCharCode(code1) == toUpperCaseCharCode(code2);
}
function toUpperCaseCharCode(code) {
return code >= $a && code <= $z ? code - $a + $A : code;
}
function mergeTextTokens(srcTokens) {
var dstTokens = [];
var lastDstToken = undefined;
for (var i = 0; i < srcTokens.length; i++) {
var token = srcTokens[i];
if (lastDstToken && lastDstToken.type == TokenType$1.TEXT && token.type == TokenType$1.TEXT) {
lastDstToken.parts[0] += token.parts[0];
lastDstToken.sourceSpan.end = token.sourceSpan.end;
}
else {
lastDstToken = token;
dstTokens.push(lastDstToken);
}
}
return dstTokens;
}
/**
* @license
* Copyright Google Inc. 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 TreeError = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TreeError, _super);
function TreeError(elementName, span, msg) {
var _this = _super.call(this, span, msg) || this;
_this.elementName = elementName;
return _this;
}
TreeError.create = function (elementName, span, msg) {
return new TreeError(elementName, span, msg);
};
return TreeError;
}(ParseError));
var ParseTreeResult = /** @class */ (function () {
function ParseTreeResult(rootNodes, errors) {
this.rootNodes = rootNodes;
this.errors = errors;
}
return ParseTreeResult;
}());
var Parser$1 = /** @class */ (function () {
function Parser(getTagDefinition) {
this.getTagDefinition = getTagDefinition;
}
Parser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {
if (parseExpansionForms === void 0) { parseExpansionForms = false; }
if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
var tokensAndErrors = tokenize(source, url, this.getTagDefinition, parseExpansionForms, interpolationConfig);
var treeAndErrors = new _TreeBuilder(tokensAndErrors.tokens, this.getTagDefinition).build();
return new ParseTreeResult(treeAndErrors.rootNodes, tokensAndErrors.errors.concat(treeAndErrors.errors));
};
return Parser;
}());
var _TreeBuilder = /** @class */ (function () {
function _TreeBuilder(tokens, getTagDefinition) {
this.tokens = tokens;
this.getTagDefinition = getTagDefinition;
this._index = -1;
this._rootNodes = [];
this._errors = [];
this._elementStack = [];
this._advance();
}
_TreeBuilder.prototype.build = function () {
while (this._peek.type !== TokenType$1.EOF) {
if (this._peek.type === TokenType$1.TAG_OPEN_START) {
this._consumeStartTag(this._advance());
}
else if (this._peek.type === TokenType$1.TAG_CLOSE) {
this._consumeEndTag(this._advance());
}
else if (this._peek.type === TokenType$1.CDATA_START) {
this._closeVoidElement();
this._consumeCdata(this._advance());
}
else if (this._peek.type === TokenType$1.COMMENT_START) {
this._closeVoidElement();
this._consumeComment(this._advance());
}
else if (this._peek.type === TokenType$1.TEXT || this._peek.type === TokenType$1.RAW_TEXT ||
this._peek.type === TokenType$1.ESCAPABLE_RAW_TEXT) {
this._closeVoidElement();
this._consumeText(this._advance());
}
else if (this._peek.type === TokenType$1.EXPANSION_FORM_START) {
this._consumeExpansion(this._advance());
}
else {
// Skip all other tokens...
this._advance();
}
}
return new ParseTreeResult(this._rootNodes, this._errors);
};
_TreeBuilder.prototype._advance = function () {
var prev = this._peek;
if (this._index < this.tokens.length - 1) {
// Note: there is always an EOF token at the end
this._index++;
}
this._peek = this.tokens[this._index];
return prev;
};
_TreeBuilder.prototype._advanceIf = function (type) {
if (this._peek.type === type) {
return this._advance();
}
return null;
};
_TreeBuilder.prototype._consumeCdata = function (startToken) {
this._consumeText(this._advance());
this._advanceIf(TokenType$1.CDATA_END);
};
_TreeBuilder.prototype._consumeComment = function (token) {
var text = this._advanceIf(TokenType$1.RAW_TEXT);
this._advanceIf(TokenType$1.COMMENT_END);
var value = text != null ? text.parts[0].trim() : null;
this._addToParent(new Comment(value, token.sourceSpan));
};
_TreeBuilder.prototype._consumeExpansion = function (token) {
var switchValue = this._advance();
var type = this._advance();
var cases = [];
// read =
while (this._peek.type === TokenType$1.EXPANSION_CASE_VALUE) {
var expCase = this._parseExpansionCase();
if (!expCase)
return; // error
cases.push(expCase);
}
// read the final }
if (this._peek.type !== TokenType$1.EXPANSION_FORM_END) {
this._errors.push(TreeError.create(null, this._peek.sourceSpan, "Invalid ICU message. Missing '}'."));
return;
}
var sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end);
this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));
this._advance();
};
_TreeBuilder.prototype._parseExpansionCase = function () {
var value = this._advance();
// read {
if (this._peek.type !== TokenType$1.EXPANSION_CASE_EXP_START) {
this._errors.push(TreeError.create(null, this._peek.sourceSpan, "Invalid ICU message. Missing '{'."));
return null;
}
// read until }
var start = this._advance();
var exp = this._collectExpansionExpTokens(start);
if (!exp)
return null;
var end = this._advance();
exp.push(new Token$1(TokenType$1.EOF, [], end.sourceSpan));
// parse everything in between { and }
var parsedExp = new _TreeBuilder(exp, this.getTagDefinition).build();
if (parsedExp.errors.length > 0) {
this._errors = this._errors.concat(parsedExp.errors);
return null;
}
var sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end);
var expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end);
return new ExpansionCase(value.parts[0], parsedExp.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);
};
_TreeBuilder.prototype._collectExpansionExpTokens = function (start) {
var exp = [];
var expansionFormStack = [TokenType$1.EXPANSION_CASE_EXP_START];
while (true) {
if (this._peek.type === TokenType$1.EXPANSION_FORM_START ||
this._peek.type === TokenType$1.EXPANSION_CASE_EXP_START) {
expansionFormStack.push(this._peek.type);
}
if (this._peek.type === TokenType$1.EXPANSION_CASE_EXP_END) {
if (lastOnStack(expansionFormStack, TokenType$1.EXPANSION_CASE_EXP_START)) {
expansionFormStack.pop();
if (expansionFormStack.length == 0)
return exp;
}
else {
this._errors.push(TreeError.create(null, start.sourceSpan, "Invalid ICU message. Missing '}'."));
return null;
}
}
if (this._peek.type === TokenType$1.EXPANSION_FORM_END) {
if (lastOnStack(expansionFormStack, TokenType$1.EXPANSION_FORM_START)) {
expansionFormStack.pop();
}
else {
this._errors.push(TreeError.create(null, start.sourceSpan, "Invalid ICU message. Missing '}'."));
return null;
}
}
if (this._peek.type === TokenType$1.EOF) {
this._errors.push(TreeError.create(null, start.sourceSpan, "Invalid ICU message. Missing '}'."));
return null;
}
exp.push(this._advance());
}
};
_TreeBuilder.prototype._consumeText = function (token) {
var text = token.parts[0];
if (text.length > 0 && text[0] == '\n') {
var parent_1 = this._getParentElement();
if (parent_1 != null && parent_1.children.length == 0 &&
this.getTagDefinition(parent_1.name).ignoreFirstLf) {
text = text.substring(1);
}
}
if (text.length > 0) {
this._addToParent(new Text(text, token.sourceSpan));
}
};
_TreeBuilder.prototype._closeVoidElement = function () {
var el = this._getParentElement();
if (el && this.getTagDefinition(el.name).isVoid) {
this._elementStack.pop();
}
};
_TreeBuilder.prototype._consumeStartTag = function (startTagToken) {
var prefix = startTagToken.parts[0];
var name = startTagToken.parts[1];
var attrs = [];
while (this._peek.type === TokenType$1.ATTR_NAME) {
attrs.push(this._consumeAttr(this._advance()));
}
var fullName = this._getElementFullName(prefix, name, this._getParentElement());
var selfClosing = false;
// Note: There could have been a tokenizer error
// so that we don't get a token for the end tag...
if (this._peek.type === TokenType$1.TAG_OPEN_END_VOID) {
this._advance();
selfClosing = true;
var tagDef = this.getTagDefinition(fullName);
if (!(tagDef.canSelfClose || getNsPrefix(fullName) !== null || tagDef.isVoid)) {
this._errors.push(TreeError.create(fullName, startTagToken.sourceSpan, "Only void and foreign elements can be self closed \"" + startTagToken.parts[1] + "\""));
}
}
else if (this._peek.type === TokenType$1.TAG_OPEN_END) {
this._advance();
selfClosing = false;
}
var end = this._peek.sourceSpan.start;
var span = new ParseSourceSpan(startTagToken.sourceSpan.start, end);
var el = new Element(fullName, attrs, [], span, span, undefined);
this._pushElement(el);
if (selfClosing) {
this._popElement(fullName);
el.endSourceSpan = span;
}
};
_TreeBuilder.prototype._pushElement = function (el) {
var parentEl = this._getParentElement();
if (parentEl && this.getTagDefinition(parentEl.name).isClosedByChild(el.name)) {
this._elementStack.pop();
}
var tagDef = this.getTagDefinition(el.name);
var _a = this._getParentElementSkippingContainers(), parent = _a.parent, container = _a.container;
if (parent && tagDef.requireExtraParent(parent.name)) {
var newParent = new Element(tagDef.parentToAdd, [], [], el.sourceSpan, el.startSourceSpan, el.endSourceSpan);
this._insertBeforeContainer(parent, container, newParent);
}
this._addToParent(el);
this._elementStack.push(el);
};
_TreeBuilder.prototype._consumeEndTag = function (endTagToken) {
var fullName = this._getElementFullName(endTagToken.parts[0], endTagToken.parts[1], this._getParentElement());
if (this._getParentElement()) {
this._getParentElement().endSourceSpan = endTagToken.sourceSpan;
}
if (this.getTagDefinition(fullName).isVoid) {
this._errors.push(TreeError.create(fullName, endTagToken.sourceSpan, "Void elements do not have end tags \"" + endTagToken.parts[1] + "\""));
}
else if (!this._popElement(fullName)) {
var errMsg = "Unexpected closing tag \"" + fullName + "\". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags";
this._errors.push(TreeError.create(fullName, endTagToken.sourceSpan, errMsg));
}
};
_TreeBuilder.prototype._popElement = function (fullName) {
for (var stackIndex = this._elementStack.length - 1; stackIndex >= 0; stackIndex--) {
var el = this._elementStack[stackIndex];
if (el.name == fullName) {
this._elementStack.splice(stackIndex, this._elementStack.length - stackIndex);
return true;
}
if (!this.getTagDefinition(el.name).closedByParent) {
return false;
}
}
return false;
};
_TreeBuilder.prototype._consumeAttr = function (attrName) {
var fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);
var end = attrName.sourceSpan.end;
var value = '';
var valueSpan = undefined;
if (this._peek.type === TokenType$1.ATTR_VALUE) {
var valueToken = this._advance();
value = valueToken.parts[0];
end = valueToken.sourceSpan.end;
valueSpan = valueToken.sourceSpan;
}
return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end), valueSpan);
};
_TreeBuilder.prototype._getParentElement = function () {
return this._elementStack.length > 0 ? this._elementStack[this._elementStack.length - 1] : null;
};
/**
* Returns the parent in the DOM and the container.
*
* `<ng-container>` elements are skipped as they are not rendered as DOM element.
*/
_TreeBuilder.prototype._getParentElementSkippingContainers = function () {
var container = null;
for (var i = this._elementStack.length - 1; i >= 0; i--) {
if (!isNgContainer(this._elementStack[i].name)) {
return { parent: this._elementStack[i], container: container };
}
container = this._elementStack[i];
}
return { parent: null, container: container };
};
_TreeBuilder.prototype._addToParent = function (node) {
var parent = this._getParentElement();
if (parent != null) {
parent.children.push(node);
}
else {
this._rootNodes.push(node);
}
};
/**
* Insert a node between the parent and the container.
* When no container is given, the node is appended as a child of the parent.
* Also updates the element stack accordingly.
*
* @internal
*/
_TreeBuilder.prototype._insertBeforeContainer = function (parent, container, node) {
if (!container) {
this._addToParent(node);
this._elementStack.push(node);
}
else {
if (parent) {
// replace the container with the new node in the children
var index = parent.children.indexOf(container);
parent.children[index] = node;
}
else {
this._rootNodes.push(node);
}
node.children.push(container);
this._elementStack.splice(this._elementStack.indexOf(container), 0, node);
}
};
_TreeBuilder.prototype._getElementFullName = function (prefix, localName, parentElement) {
if (prefix == null) {
prefix = this.getTagDefinition(localName).implicitNamespacePrefix;
if (prefix == null && parentElement != null) {
prefix = getNsPrefix(parentElement.name);
}
}
return mergeNsAndName(prefix, localName);
};
return _TreeBuilder;
}());
function lastOnStack(stack, element) {
return stack.length > 0 && stack[stack.length - 1] === element;
}
/**
* @license
* Copyright Google Inc. 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
*/
function digest(message) {
return message.id || sha1(serializeNodes(message.nodes).join('') + ("[" + message.meaning + "]"));
}
function decimalDigest(message) {
if (message.id) {
return message.id;
}
var visitor = new _SerializerIgnoreIcuExpVisitor();
var parts = message.nodes.map(function (a) { return a.visit(visitor, null); });
return computeMsgId(parts.join(''), message.meaning);
}
/**
* Serialize the i18n ast to something xml-like in order to generate an UID.
*
* The visitor is also used in the i18n parser tests
*
* @internal
*/
var _SerializerVisitor = /** @class */ (function () {
function _SerializerVisitor() {
}
_SerializerVisitor.prototype.visitText = function (text, context) { return text.value; };
_SerializerVisitor.prototype.visitContainer = function (container, context) {
var _this = this;
return "[" + container.children.map(function (child) { return child.visit(_this); }).join(', ') + "]";
};
_SerializerVisitor.prototype.visitIcu = function (icu, context) {
var _this = this;
var strCases = Object.keys(icu.cases).map(function (k) { return k + " {" + icu.cases[k].visit(_this) + "}"; });
return "{" + icu.expression + ", " + icu.type + ", " + strCases.join(', ') + "}";
};
_SerializerVisitor.prototype.visitTagPlaceholder = function (ph, context) {
var _this = this;
return ph.isVoid ?
"<ph tag name=\"" + ph.startName + "\"/>" :
"<ph tag name=\"" + ph.startName + "\">" + ph.children.map(function (child) { return child.visit(_this); }).join(', ') + "</ph name=\"" + ph.closeName + "\">";
};
_SerializerVisitor.prototype.visitPlaceholder = function (ph, context) {
return ph.value ? "<ph name=\"" + ph.name + "\">" + ph.value + "</ph>" : "<ph name=\"" + ph.name + "\"/>";
};
_SerializerVisitor.prototype.visitIcuPlaceholder = function (ph, context) {
return "<ph icu name=\"" + ph.name + "\">" + ph.value.visit(this) + "</ph>";
};
return _SerializerVisitor;
}());
var serializerVisitor = new _SerializerVisitor();
function serializeNodes(nodes) {
return nodes.map(function (a) { return a.visit(serializerVisitor, null); });
}
/**
* Serialize the i18n ast to something xml-like in order to generate an UID.
*
* Ignore the ICU expressions so that message IDs stays identical if only the expression changes.
*
* @internal
*/
var _SerializerIgnoreIcuExpVisitor = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(_SerializerIgnoreIcuExpVisitor, _super);
function _SerializerIgnoreIcuExpVisitor() {
return _super !== null && _super.apply(this, arguments) || this;
}
_SerializerIgnoreIcuExpVisitor.prototype.visitIcu = function (icu, context) {
var _this = this;
var strCases = Object.keys(icu.cases).map(function (k) { return k + " {" + icu.cases[k].visit(_this) + "}"; });
// Do not take the expression into account
return "{" + icu.type + ", " + strCases.join(', ') + "}";
};
return _SerializerIgnoreIcuExpVisitor;
}(_SerializerVisitor));
/**
* Compute the SHA1 of the given string
*
* see http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf
*
* WARNING: this function has not been designed not tested with security in mind.
* DO NOT USE IT IN A SECURITY SENSITIVE CONTEXT.
*/
function sha1(str) {
var utf8 = utf8Encode(str);
var words32 = stringToWords32(utf8, Endian.Big);
var len = utf8.length * 8;
var w = new Array(80);
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0], 5), a = _a[0], b = _a[1], c = _a[2], d = _a[3], e = _a[4];
words32[len >> 5] |= 0x80 << (24 - len % 32);
words32[((len + 64 >> 9) << 4) + 15] = len;
for (var i = 0; i < words32.length; i += 16) {
var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])([a, b, c, d, e], 5), h0 = _b[0], h1 = _b[1], h2 = _b[2], h3 = _b[3], h4 = _b[4];
for (var j = 0; j < 80; j++) {
if (j < 16) {
w[j] = words32[i + j];
}
else {
w[j] = rol32(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
}
var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(fk(j, b, c, d), 2), f = _c[0], k = _c[1];
var temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32);
_d = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])([d, c, rol32(b, 30), a, temp], 5), e = _d[0], d = _d[1], c = _d[2], b = _d[3], a = _d[4];
}
_e = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])([add32(a, h0), add32(b, h1), add32(c, h2), add32(d, h3), add32(e, h4)], 5), a = _e[0], b = _e[1], c = _e[2], d = _e[3], e = _e[4];
}
return byteStringToHexString(words32ToByteString([a, b, c, d, e]));
var _d, _e;
}
function fk(index, b, c, d) {
if (index < 20) {
return [(b & c) | (~b & d), 0x5a827999];
}
if (index < 40) {
return [b ^ c ^ d, 0x6ed9eba1];
}
if (index < 60) {
return [(b & c) | (b & d) | (c & d), 0x8f1bbcdc];
}
return [b ^ c ^ d, 0xca62c1d6];
}
/**
* Compute the fingerprint of the given string
*
* The output is 64 bit number encoded as a decimal string
*
* based on:
* https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java
*/
function fingerprint(str) {
var utf8 = utf8Encode(str);
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])([hash32(utf8, 0), hash32(utf8, 102072)], 2), hi = _a[0], lo = _a[1];
if (hi == 0 && (lo == 0 || lo == 1)) {
hi = hi ^ 0x130f9bef;
lo = lo ^ -0x6b5f56d8;
}
return [hi, lo];
}
function computeMsgId(msg, meaning) {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(fingerprint(msg), 2), hi = _a[0], lo = _a[1];
if (meaning) {
var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(fingerprint(meaning), 2), him = _b[0], lom = _b[1];
_c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(add64(rol64([hi, lo], 1), [him, lom]), 2), hi = _c[0], lo = _c[1];
}
return byteStringToDecString(words32ToByteString([hi & 0x7fffffff, lo]));
var _c;
}
function hash32(str, c) {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])([0x9e3779b9, 0x9e3779b9], 2), a = _a[0], b = _a[1];
var i;
var len = str.length;
for (i = 0; i + 12 <= len; i += 12) {
a = add32(a, wordAt(str, i, Endian.Little));
b = add32(b, wordAt(str, i + 4, Endian.Little));
c = add32(c, wordAt(str, i + 8, Endian.Little));
_b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(mix([a, b, c]), 3), a = _b[0], b = _b[1], c = _b[2];
}
a = add32(a, wordAt(str, i, Endian.Little));
b = add32(b, wordAt(str, i + 4, Endian.Little));
// the first byte of c is reserved for the length
c = add32(c, len);
c = add32(c, wordAt(str, i + 8, Endian.Little) << 8);
return mix([a, b, c])[2];
var _b;
}
// clang-format off
function mix(_a) {
var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_a, 3), a = _b[0], b = _b[1], c = _b[2];
a = sub32(a, b);
a = sub32(a, c);
a ^= c >>> 13;
b = sub32(b, c);
b = sub32(b, a);
b ^= a << 8;
c = sub32(c, a);
c = sub32(c, b);
c ^= b >>> 13;
a = sub32(a, b);
a = sub32(a, c);
a ^= c >>> 12;
b = sub32(b, c);
b = sub32(b, a);
b ^= a << 16;
c = sub32(c, a);
c = sub32(c, b);
c ^= b >>> 5;
a = sub32(a, b);
a = sub32(a, c);
a ^= c >>> 3;
b = sub32(b, c);
b = sub32(b, a);
b ^= a << 10;
c = sub32(c, a);
c = sub32(c, b);
c ^= b >>> 15;
return [a, b, c];
}
// clang-format on
// Utils
var Endian;
(function (Endian) {
Endian[Endian["Little"] = 0] = "Little";
Endian[Endian["Big"] = 1] = "Big";
})(Endian || (Endian = {}));
function add32(a, b) {
return add32to64(a, b)[1];
}
function add32to64(a, b) {
var low = (a & 0xffff) + (b & 0xffff);
var high = (a >>> 16) + (b >>> 16) + (low >>> 16);
return [high >>> 16, (high << 16) | (low & 0xffff)];
}
function add64(_a, _b) {
var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_a, 2), ah = _c[0], al = _c[1];
var _d = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_b, 2), bh = _d[0], bl = _d[1];
var _e = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(add32to64(al, bl), 2), carry = _e[0], l = _e[1];
var h = add32(add32(ah, bh), carry);
return [h, l];
}
function sub32(a, b) {
var low = (a & 0xffff) - (b & 0xffff);
var high = (a >> 16) - (b >> 16) + (low >> 16);
return (high << 16) | (low & 0xffff);
}
// Rotate a 32b number left `count` position
function rol32(a, count) {
return (a << count) | (a >>> (32 - count));
}
// Rotate a 64b number left `count` position
function rol64(_a, count) {
var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_a, 2), hi = _b[0], lo = _b[1];
var h = (hi << count) | (lo >>> (32 - count));
var l = (lo << count) | (hi >>> (32 - count));
return [h, l];
}
function stringToWords32(str, endian) {
var words32 = Array((str.length + 3) >>> 2);
for (var i = 0; i < words32.length; i++) {
words32[i] = wordAt(str, i * 4, endian);
}
return words32;
}
function byteAt(str, index) {
return index >= str.length ? 0 : str.charCodeAt(index) & 0xff;
}
function wordAt(str, index, endian) {
var word = 0;
if (endian === Endian.Big) {
for (var i = 0; i < 4; i++) {
word += byteAt(str, index + i) << (24 - 8 * i);
}
}
else {
for (var i = 0; i < 4; i++) {
word += byteAt(str, index + i) << 8 * i;
}
}
return word;
}
function words32ToByteString(words32) {
return words32.reduce(function (str, word) { return str + word32ToByteString(word); }, '');
}
function word32ToByteString(word) {
var str = '';
for (var i = 0; i < 4; i++) {
str += String.fromCharCode((word >>> 8 * (3 - i)) & 0xff);
}
return str;
}
function byteStringToHexString(str) {
var hex = '';
for (var i = 0; i < str.length; i++) {
var b = byteAt(str, i);
hex += (b >>> 4).toString(16) + (b & 0x0f).toString(16);
}
return hex.toLowerCase();
}
// based on http://www.danvk.org/hex2dec.html (JS can not handle more than 56b)
function byteStringToDecString(str) {
var decimal = '';
var toThePower = '1';
for (var i = str.length - 1; i >= 0; i--) {
decimal = addBigInt(decimal, numberTimesBigInt(byteAt(str, i), toThePower));
toThePower = numberTimesBigInt(256, toThePower);
}
return decimal.split('').reverse().join('');
}
// x and y decimal, lowest significant digit first
function addBigInt(x, y) {
var sum = '';
var len = Math.max(x.length, y.length);
for (var i = 0, carry = 0; i < len || carry; i++) {
var tmpSum = carry + +(x[i] || 0) + +(y[i] || 0);
if (tmpSum >= 10) {
carry = 1;
sum += tmpSum - 10;
}
else {
carry = 0;
sum += tmpSum;
}
}
return sum;
}
function numberTimesBigInt(num, b) {
var product = '';
var bToThePower = b;
for (; num !== 0; num = num >>> 1) {
if (num & 1)
product = addBigInt(product, bToThePower);
bToThePower = addBigInt(bToThePower, bToThePower);
}
return product;
}
/**
* @license
* Copyright Google Inc. 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 Message = /** @class */ (function () {
/**
* @param nodes message AST
* @param placeholders maps placeholder names to static content
* @param placeholderToMessage maps placeholder names to messages (used for nested ICU messages)
* @param meaning
* @param description
* @param id
*/
function Message(nodes, placeholders, placeholderToMessage, meaning, description, id) {
this.nodes = nodes;
this.placeholders = placeholders;
this.placeholderToMessage = placeholderToMessage;
this.meaning = meaning;
this.description = description;
this.id = id;
if (nodes.length) {
this.sources = [{
filePath: nodes[0].sourceSpan.start.file.url,
startLine: nodes[0].sourceSpan.start.line + 1,
startCol: nodes[0].sourceSpan.start.col + 1,
endLine: nodes[nodes.length - 1].sourceSpan.end.line + 1,
endCol: nodes[0].sourceSpan.start.col + 1
}];
}
else {
this.sources = [];
}
}
return Message;
}());
var Text$1 = /** @class */ (function () {
function Text(value, sourceSpan) {
this.value = value;
this.sourceSpan = sourceSpan;
}
Text.prototype.visit = function (visitor, context) { return visitor.visitText(this, context); };
return Text;
}());
// TODO(vicb): do we really need this node (vs an array) ?
var Container = /** @class */ (function () {
function Container(children, sourceSpan) {
this.children = children;
this.sourceSpan = sourceSpan;
}
Container.prototype.visit = function (visitor, context) { return visitor.visitContainer(this, context); };
return Container;
}());
var Icu = /** @class */ (function () {
function Icu(expression, type, cases, sourceSpan) {
this.expression = expression;
this.type = type;
this.cases = cases;
this.sourceSpan = sourceSpan;
}
Icu.prototype.visit = function (visitor, context) { return visitor.visitIcu(this, context); };
return Icu;
}());
var TagPlaceholder = /** @class */ (function () {
function TagPlaceholder(tag, attrs, startName, closeName, children, isVoid, sourceSpan) {
this.tag = tag;
this.attrs = attrs;
this.startName = startName;
this.closeName = closeName;
this.children = children;
this.isVoid = isVoid;
this.sourceSpan = sourceSpan;
}
TagPlaceholder.prototype.visit = function (visitor, context) { return visitor.visitTagPlaceholder(this, context); };
return TagPlaceholder;
}());
var Placeholder = /** @class */ (function () {
function Placeholder(value, name, sourceSpan) {
this.value = value;
this.name = name;
this.sourceSpan = sourceSpan;
}
Placeholder.prototype.visit = function (visitor, context) { return visitor.visitPlaceholder(this, context); };
return Placeholder;
}());
var IcuPlaceholder = /** @class */ (function () {
function IcuPlaceholder(value, name, sourceSpan) {
this.value = value;
this.name = name;
this.sourceSpan = sourceSpan;
}
IcuPlaceholder.prototype.visit = function (visitor, context) { return visitor.visitIcuPlaceholder(this, context); };
return IcuPlaceholder;
}());
// Clone the AST
var CloneVisitor = /** @class */ (function () {
function CloneVisitor() {
}
CloneVisitor.prototype.visitText = function (text, context) { return new Text$1(text.value, text.sourceSpan); };
CloneVisitor.prototype.visitContainer = function (container, context) {
var _this = this;
var children = container.children.map(function (n) { return n.visit(_this, context); });
return new Container(children, container.sourceSpan);
};
CloneVisitor.prototype.visitIcu = function (icu, context) {
var _this = this;
var cases = {};
Object.keys(icu.cases).forEach(function (key) { return cases[key] = icu.cases[key].visit(_this, context); });
var msg = new Icu(icu.expression, icu.type, cases, icu.sourceSpan);
msg.expressionPlaceholder = icu.expressionPlaceholder;
return msg;
};
CloneVisitor.prototype.visitTagPlaceholder = function (ph, context) {
var _this = this;
var children = ph.children.map(function (n) { return n.visit(_this, context); });
return new TagPlaceholder(ph.tag, ph.attrs, ph.startName, ph.closeName, children, ph.isVoid, ph.sourceSpan);
};
CloneVisitor.prototype.visitPlaceholder = function (ph, context) {
return new Placeholder(ph.value, ph.name, ph.sourceSpan);
};
CloneVisitor.prototype.visitIcuPlaceholder = function (ph, context) {
return new IcuPlaceholder(ph.value, ph.name, ph.sourceSpan);
};
return CloneVisitor;
}());
// Visit all the nodes recursively
var RecurseVisitor = /** @class */ (function () {
function RecurseVisitor() {
}
RecurseVisitor.prototype.visitText = function (text, context) { };
RecurseVisitor.prototype.visitContainer = function (container, context) {
var _this = this;
container.children.forEach(function (child) { return child.visit(_this); });
};
RecurseVisitor.prototype.visitIcu = function (icu, context) {
var _this = this;
Object.keys(icu.cases).forEach(function (k) { icu.cases[k].visit(_this); });
};
RecurseVisitor.prototype.visitTagPlaceholder = function (ph, context) {
var _this = this;
ph.children.forEach(function (child) { return child.visit(_this); });
};
RecurseVisitor.prototype.visitPlaceholder = function (ph, context) { };
RecurseVisitor.prototype.visitIcuPlaceholder = function (ph, context) { };
return RecurseVisitor;
}());
/**
* @license
* Copyright Google Inc. 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 HtmlTagDefinition = /** @class */ (function () {
function HtmlTagDefinition(_a) {
var _b = _a === void 0 ? {} : _a, closedByChildren = _b.closedByChildren, requiredParents = _b.requiredParents, implicitNamespacePrefix = _b.implicitNamespacePrefix, _c = _b.contentType, contentType = _c === void 0 ? TagContentType.PARSABLE_DATA : _c, _d = _b.closedByParent, closedByParent = _d === void 0 ? false : _d, _e = _b.isVoid, isVoid = _e === void 0 ? false : _e, _f = _b.ignoreFirstLf, ignoreFirstLf = _f === void 0 ? false : _f;
var _this = this;
this.closedByChildren = {};
this.closedByParent = false;
this.canSelfClose = false;
if (closedByChildren && closedByChildren.length > 0) {
closedByChildren.forEach(function (tagName) { return _this.closedByChildren[tagName] = true; });
}
this.isVoid = isVoid;
this.closedByParent = closedByParent || isVoid;
if (requiredParents && requiredParents.length > 0) {
this.requiredParents = {};
// The first parent is the list is automatically when none of the listed parents are present
this.parentToAdd = requiredParents[0];
requiredParents.forEach(function (tagName) { return _this.requiredParents[tagName] = true; });
}
this.implicitNamespacePrefix = implicitNamespacePrefix || null;
this.contentType = contentType;
this.ignoreFirstLf = ignoreFirstLf;
}
HtmlTagDefinition.prototype.requireExtraParent = function (currentParent) {
if (!this.requiredParents) {
return false;
}
if (!currentParent) {
return true;
}
var lcParent = currentParent.toLowerCase();
var isParentTemplate = lcParent === 'template' || currentParent === 'ng-template';
return !isParentTemplate && this.requiredParents[lcParent] != true;
};
HtmlTagDefinition.prototype.isClosedByChild = function (name) {
return this.isVoid || name.toLowerCase() in this.closedByChildren;
};
return HtmlTagDefinition;
}());
// see http://www.w3.org/TR/html51/syntax.html#optional-tags
// This implementation does not fully conform to the HTML5 spec.
var TAG_DEFINITIONS = {
'base': new HtmlTagDefinition({ isVoid: true }),
'meta': new HtmlTagDefinition({ isVoid: true }),
'area': new HtmlTagDefinition({ isVoid: true }),
'embed': new HtmlTagDefinition({ isVoid: true }),
'link': new HtmlTagDefinition({ isVoid: true }),
'img': new HtmlTagDefinition({ isVoid: true }),
'input': new HtmlTagDefinition({ isVoid: true }),
'param': new HtmlTagDefinition({ isVoid: true }),
'hr': new HtmlTagDefinition({ isVoid: true }),
'br': new HtmlTagDefinition({ isVoid: true }),
'source': new HtmlTagDefinition({ isVoid: true }),
'track': new HtmlTagDefinition({ isVoid: true }),
'wbr': new HtmlTagDefinition({ isVoid: true }),
'p': new HtmlTagDefinition({
closedByChildren: [
'address', 'article', 'aside', 'blockquote', 'div', 'dl', 'fieldset', 'footer', 'form',
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr',
'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'
],
closedByParent: true
}),
'thead': new HtmlTagDefinition({ closedByChildren: ['tbody', 'tfoot'] }),
'tbody': new HtmlTagDefinition({ closedByChildren: ['tbody', 'tfoot'], closedByParent: true }),
'tfoot': new HtmlTagDefinition({ closedByChildren: ['tbody'], closedByParent: true }),
'tr': new HtmlTagDefinition({
closedByChildren: ['tr'],
requiredParents: ['tbody', 'tfoot', 'thead'],
closedByParent: true
}),
'td': new HtmlTagDefinition({ closedByChildren: ['td', 'th'], closedByParent: true }),
'th': new HtmlTagDefinition({ closedByChildren: ['td', 'th'], closedByParent: true }),
'col': new HtmlTagDefinition({ requiredParents: ['colgroup'], isVoid: true }),
'svg': new HtmlTagDefinition({ implicitNamespacePrefix: 'svg' }),
'math': new HtmlTagDefinition({ implicitNamespacePrefix: 'math' }),
'li': new HtmlTagDefinition({ closedByChildren: ['li'], closedByParent: true }),
'dt': new HtmlTagDefinition({ closedByChildren: ['dt', 'dd'] }),
'dd': new HtmlTagDefinition({ closedByChildren: ['dt', 'dd'], closedByParent: true }),
'rb': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),
'rt': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),
'rtc': new HtmlTagDefinition({ closedByChildren: ['rb', 'rtc', 'rp'], closedByParent: true }),
'rp': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),
'optgroup': new HtmlTagDefinition({ closedByChildren: ['optgroup'], closedByParent: true }),
'option': new HtmlTagDefinition({ closedByChildren: ['option', 'optgroup'], closedByParent: true }),
'pre': new HtmlTagDefinition({ ignoreFirstLf: true }),
'listing': new HtmlTagDefinition({ ignoreFirstLf: true }),
'style': new HtmlTagDefinition({ contentType: TagContentType.RAW_TEXT }),
'script': new HtmlTagDefinition({ contentType: TagContentType.RAW_TEXT }),
'title': new HtmlTagDefinition({ contentType: TagContentType.ESCAPABLE_RAW_TEXT }),
'textarea': new HtmlTagDefinition({ contentType: TagContentType.ESCAPABLE_RAW_TEXT, ignoreFirstLf: true }),
};
var _DEFAULT_TAG_DEFINITION = new HtmlTagDefinition();
function getHtmlTagDefinition(tagName) {
return TAG_DEFINITIONS[tagName.toLowerCase()] || _DEFAULT_TAG_DEFINITION;
}
/**
* @license
* Copyright Google Inc. 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 TAG_TO_PLACEHOLDER_NAMES = {
'A': 'LINK',
'B': 'BOLD_TEXT',
'BR': 'LINE_BREAK',
'EM': 'EMPHASISED_TEXT',
'H1': 'HEADING_LEVEL1',
'H2': 'HEADING_LEVEL2',
'H3': 'HEADING_LEVEL3',
'H4': 'HEADING_LEVEL4',
'H5': 'HEADING_LEVEL5',
'H6': 'HEADING_LEVEL6',
'HR': 'HORIZONTAL_RULE',
'I': 'ITALIC_TEXT',
'LI': 'LIST_ITEM',
'LINK': 'MEDIA_LINK',
'OL': 'ORDERED_LIST',
'P': 'PARAGRAPH',
'Q': 'QUOTATION',
'S': 'STRIKETHROUGH_TEXT',
'SMALL': 'SMALL_TEXT',
'SUB': 'SUBSTRIPT',
'SUP': 'SUPERSCRIPT',
'TBODY': 'TABLE_BODY',
'TD': 'TABLE_CELL',
'TFOOT': 'TABLE_FOOTER',
'TH': 'TABLE_HEADER_CELL',
'THEAD': 'TABLE_HEADER',
'TR': 'TABLE_ROW',
'TT': 'MONOSPACED_TEXT',
'U': 'UNDERLINED_TEXT',
'UL': 'UNORDERED_LIST',
};
/**
* Creates unique names for placeholder with different content.
*
* Returns the same placeholder name when the content is identical.
*/
var PlaceholderRegistry = /** @class */ (function () {
function PlaceholderRegistry() {
// Count the occurrence of the base name top generate a unique name
this._placeHolderNameCounts = {};
// Maps signature to placeholder names
this._signatureToName = {};
}
PlaceholderRegistry.prototype.getStartTagPlaceholderName = function (tag, attrs, isVoid) {
var signature = this._hashTag(tag, attrs, isVoid);
if (this._signatureToName[signature]) {
return this._signatureToName[signature];
}
var upperTag = tag.toUpperCase();
var baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || "TAG_" + upperTag;
var name = this._generateUniqueName(isVoid ? baseName : "START_" + baseName);
this._signatureToName[signature] = name;
return name;
};
PlaceholderRegistry.prototype.getCloseTagPlaceholderName = function (tag) {
var signature = this._hashClosingTag(tag);
if (this._signatureToName[signature]) {
return this._signatureToName[signature];
}
var upperTag = tag.toUpperCase();
var baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || "TAG_" + upperTag;
var name = this._generateUniqueName("CLOSE_" + baseName);
this._signatureToName[signature] = name;
return name;
};
PlaceholderRegistry.prototype.getPlaceholderName = function (name, content) {
var upperName = name.toUpperCase();
var signature = "PH: " + upperName + "=" + content;
if (this._signatureToName[signature]) {
return this._signatureToName[signature];
}
var uniqueName = this._generateUniqueName(upperName);
this._signatureToName[signature] = uniqueName;
return uniqueName;
};
PlaceholderRegistry.prototype.getUniquePlaceholder = function (name) {
return this._generateUniqueName(name.toUpperCase());
};
// Generate a hash for a tag - does not take attribute order into account
PlaceholderRegistry.prototype._hashTag = function (tag, attrs, isVoid) {
var start = "<" + tag;
var strAttrs = Object.keys(attrs).sort().map(function (name) { return " " + name + "=" + attrs[name]; }).join('');
var end = isVoid ? '/>' : "></" + tag + ">";
return start + strAttrs + end;
};
PlaceholderRegistry.prototype._hashClosingTag = function (tag) { return this._hashTag("/" + tag, {}, false); };
PlaceholderRegistry.prototype._generateUniqueName = function (base) {
var seen = this._placeHolderNameCounts.hasOwnProperty(base);
if (!seen) {
this._placeHolderNameCounts[base] = 1;
return base;
}
var id = this._placeHolderNameCounts[base];
this._placeHolderNameCounts[base] = id + 1;
return base + "_" + id;
};
return PlaceholderRegistry;
}());
/**
* @license
* Copyright Google Inc. 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 _expParser = new Parser(new Lexer());
/**
* Returns a function converting html nodes to an i18n Message given an interpolationConfig
*/
function createI18nMessageFactory(interpolationConfig) {
var visitor = new _I18nVisitor(_expParser, interpolationConfig);
return function (nodes, meaning, description, id) {
return visitor.toI18nMessage(nodes, meaning, description, id);
};
}
var _I18nVisitor = /** @class */ (function () {
function _I18nVisitor(_expressionParser, _interpolationConfig) {
this._expressionParser = _expressionParser;
this._interpolationConfig = _interpolationConfig;
}
_I18nVisitor.prototype.toI18nMessage = function (nodes, meaning, description, id) {
this._isIcu = nodes.length == 1 && nodes[0] instanceof Expansion;
this._icuDepth = 0;
this._placeholderRegistry = new PlaceholderRegistry();
this._placeholderToContent = {};
this._placeholderToMessage = {};
var i18nodes = visitAll(this, nodes, {});
return new Message(i18nodes, this._placeholderToContent, this._placeholderToMessage, meaning, description, id);
};
_I18nVisitor.prototype.visitElement = function (el, context) {
var children = visitAll(this, el.children);
var attrs = {};
el.attrs.forEach(function (attr) {
// Do not visit the attributes, translatable ones are top-level ASTs
attrs[attr.name] = attr.value;
});
var isVoid = getHtmlTagDefinition(el.name).isVoid;
var startPhName = this._placeholderRegistry.getStartTagPlaceholderName(el.name, attrs, isVoid);
this._placeholderToContent[startPhName] = el.sourceSpan.toString();
var closePhName = '';
if (!isVoid) {
closePhName = this._placeholderRegistry.getCloseTagPlaceholderName(el.name);
this._placeholderToContent[closePhName] = "</" + el.name + ">";
}
return new TagPlaceholder(el.name, attrs, startPhName, closePhName, children, isVoid, el.sourceSpan);
};
_I18nVisitor.prototype.visitAttribute = function (attribute, context) {
return this._visitTextWithInterpolation(attribute.value, attribute.sourceSpan);
};
_I18nVisitor.prototype.visitText = function (text, context) {
return this._visitTextWithInterpolation(text.value, text.sourceSpan);
};
_I18nVisitor.prototype.visitComment = function (comment, context) { return null; };
_I18nVisitor.prototype.visitExpansion = function (icu, context) {
var _this = this;
this._icuDepth++;
var i18nIcuCases = {};
var i18nIcu = new Icu(icu.switchValue, icu.type, i18nIcuCases, icu.sourceSpan);
icu.cases.forEach(function (caze) {
i18nIcuCases[caze.value] = new Container(caze.expression.map(function (node) { return node.visit(_this, {}); }), caze.expSourceSpan);
});
this._icuDepth--;
if (this._isIcu || this._icuDepth > 0) {
// Returns an ICU node when:
// - the message (vs a part of the message) is an ICU message, or
// - the ICU message is nested.
var expPh = this._placeholderRegistry.getUniquePlaceholder("VAR_" + icu.type);
i18nIcu.expressionPlaceholder = expPh;
this._placeholderToContent[expPh] = icu.switchValue;
return i18nIcu;
}
// Else returns a placeholder
// ICU placeholders should not be replaced with their original content but with the their
// translations. We need to create a new visitor (they are not re-entrant) to compute the
// message id.
// TODO(vicb): add a html.Node -> i18n.Message cache to avoid having to re-create the msg
var phName = this._placeholderRegistry.getPlaceholderName('ICU', icu.sourceSpan.toString());
var visitor = new _I18nVisitor(this._expressionParser, this._interpolationConfig);
this._placeholderToMessage[phName] = visitor.toI18nMessage([icu], '', '', '');
return new IcuPlaceholder(i18nIcu, phName, icu.sourceSpan);
};
_I18nVisitor.prototype.visitExpansionCase = function (icuCase, context) {
throw new Error('Unreachable code');
};
_I18nVisitor.prototype._visitTextWithInterpolation = function (text, sourceSpan) {
var splitInterpolation = this._expressionParser.splitInterpolation(text, sourceSpan.start.toString(), this._interpolationConfig);
if (!splitInterpolation) {
// No expression, return a single text
return new Text$1(text, sourceSpan);
}
// Return a group of text + expressions
var nodes = [];
var container = new Container(nodes, sourceSpan);
var _a = this._interpolationConfig, sDelimiter = _a.start, eDelimiter = _a.end;
for (var i = 0; i < splitInterpolation.strings.length - 1; i++) {
var expression = splitInterpolation.expressions[i];
var baseName = _extractPlaceholderName(expression) || 'INTERPOLATION';
var phName = this._placeholderRegistry.getPlaceholderName(baseName, expression);
if (splitInterpolation.strings[i].length) {
// No need to add empty strings
nodes.push(new Text$1(splitInterpolation.strings[i], sourceSpan));
}
nodes.push(new Placeholder(expression, phName, sourceSpan));
this._placeholderToContent[phName] = sDelimiter + expression + eDelimiter;
}
// The last index contains no expression
var lastStringIdx = splitInterpolation.strings.length - 1;
if (splitInterpolation.strings[lastStringIdx].length) {
nodes.push(new Text$1(splitInterpolation.strings[lastStringIdx], sourceSpan));
}
return container;
};
return _I18nVisitor;
}());
var _CUSTOM_PH_EXP = /\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g;
function _extractPlaceholderName(input) {
return input.split(_CUSTOM_PH_EXP)[2];
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* An i18n error.
*/
var I18nError = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(I18nError, _super);
function I18nError(span, msg) {
return _super.call(this, span, msg) || this;
}
return I18nError;
}(ParseError));
/**
* @license
* Copyright Google Inc. 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 _I18N_ATTR = 'i18n';
var _I18N_ATTR_PREFIX = 'i18n-';
var _I18N_COMMENT_PREFIX_REGEXP = /^i18n:?/;
var MEANING_SEPARATOR = '|';
var ID_SEPARATOR = '@@';
var i18nCommentsWarned = false;
/**
* Extract translatable messages from an html AST
*/
function extractMessages(nodes, interpolationConfig, implicitTags, implicitAttrs) {
var visitor = new _Visitor(implicitTags, implicitAttrs);
return visitor.extract(nodes, interpolationConfig);
}
function mergeTranslations(nodes, translations, interpolationConfig, implicitTags, implicitAttrs) {
var visitor = new _Visitor(implicitTags, implicitAttrs);
return visitor.merge(nodes, translations, interpolationConfig);
}
var ExtractionResult = /** @class */ (function () {
function ExtractionResult(messages, errors) {
this.messages = messages;
this.errors = errors;
}
return ExtractionResult;
}());
var _VisitorMode;
(function (_VisitorMode) {
_VisitorMode[_VisitorMode["Extract"] = 0] = "Extract";
_VisitorMode[_VisitorMode["Merge"] = 1] = "Merge";
})(_VisitorMode || (_VisitorMode = {}));
/**
* This Visitor is used:
* 1. to extract all the translatable strings from an html AST (see `extract()`),
* 2. to replace the translatable strings with the actual translations (see `merge()`)
*
* @internal
*/
var _Visitor = /** @class */ (function () {
function _Visitor(_implicitTags, _implicitAttrs) {
this._implicitTags = _implicitTags;
this._implicitAttrs = _implicitAttrs;
}
/**
* Extracts the messages from the tree
*/
_Visitor.prototype.extract = function (nodes, interpolationConfig) {
var _this = this;
this._init(_VisitorMode.Extract, interpolationConfig);
nodes.forEach(function (node) { return node.visit(_this, null); });
if (this._inI18nBlock) {
this._reportError(nodes[nodes.length - 1], 'Unclosed block');
}
return new ExtractionResult(this._messages, this._errors);
};
/**
* Returns a tree where all translatable nodes are translated
*/
_Visitor.prototype.merge = function (nodes, translations, interpolationConfig) {
this._init(_VisitorMode.Merge, interpolationConfig);
this._translations = translations;
// Construct a single fake root element
var wrapper = new Element('wrapper', [], nodes, undefined, undefined, undefined);
var translatedNode = wrapper.visit(this, null);
if (this._inI18nBlock) {
this._reportError(nodes[nodes.length - 1], 'Unclosed block');
}
return new ParseTreeResult(translatedNode.children, this._errors);
};
_Visitor.prototype.visitExpansionCase = function (icuCase, context) {
// Parse cases for translatable html attributes
var expression = visitAll(this, icuCase.expression, context);
if (this._mode === _VisitorMode.Merge) {
return new ExpansionCase(icuCase.value, expression, icuCase.sourceSpan, icuCase.valueSourceSpan, icuCase.expSourceSpan);
}
};
_Visitor.prototype.visitExpansion = function (icu, context) {
this._mayBeAddBlockChildren(icu);
var wasInIcu = this._inIcu;
if (!this._inIcu) {
// nested ICU messages should not be extracted but top-level translated as a whole
if (this._isInTranslatableSection) {
this._addMessage([icu]);
}
this._inIcu = true;
}
var cases = visitAll(this, icu.cases, context);
if (this._mode === _VisitorMode.Merge) {
icu = new Expansion(icu.switchValue, icu.type, cases, icu.sourceSpan, icu.switchValueSourceSpan);
}
this._inIcu = wasInIcu;
return icu;
};
_Visitor.prototype.visitComment = function (comment, context) {
var isOpening = _isOpeningComment(comment);
if (isOpening && this._isInTranslatableSection) {
this._reportError(comment, 'Could not start a block inside a translatable section');
return;
}
var isClosing = _isClosingComment(comment);
if (isClosing && !this._inI18nBlock) {
this._reportError(comment, 'Trying to close an unopened block');
return;
}
if (!this._inI18nNode && !this._inIcu) {
if (!this._inI18nBlock) {
if (isOpening) {
// deprecated from v5 you should use <ng-container i18n> instead of i18n comments
if (!i18nCommentsWarned && console && console.warn) {
i18nCommentsWarned = true;
var details = comment.sourceSpan.details ? ", " + comment.sourceSpan.details : '';
// TODO(ocombe): use a log service once there is a public one available
console.warn("I18n comments are deprecated, use an <ng-container> element instead (" + comment.sourceSpan.start + details + ")");
}
this._inI18nBlock = true;
this._blockStartDepth = this._depth;
this._blockChildren = [];
this._blockMeaningAndDesc =
comment.value.replace(_I18N_COMMENT_PREFIX_REGEXP, '').trim();
this._openTranslatableSection(comment);
}
}
else {
if (isClosing) {
if (this._depth == this._blockStartDepth) {
this._closeTranslatableSection(comment, this._blockChildren);
this._inI18nBlock = false;
var message = this._addMessage(this._blockChildren, this._blockMeaningAndDesc);
// merge attributes in sections
var nodes = this._translateMessage(comment, message);
return visitAll(this, nodes);
}
else {
this._reportError(comment, 'I18N blocks should not cross element boundaries');
return;
}
}
}
}
};
_Visitor.prototype.visitText = function (text, context) {
if (this._isInTranslatableSection) {
this._mayBeAddBlockChildren(text);
}
return text;
};
_Visitor.prototype.visitElement = function (el, context) {
var _this = this;
this._mayBeAddBlockChildren(el);
this._depth++;
var wasInI18nNode = this._inI18nNode;
var wasInImplicitNode = this._inImplicitNode;
var childNodes = [];
var translatedChildNodes = undefined;
// Extract:
// - top level nodes with the (implicit) "i18n" attribute if not already in a section
// - ICU messages
var i18nAttr = _getI18nAttr(el);
var i18nMeta = i18nAttr ? i18nAttr.value : '';
var isImplicit = this._implicitTags.some(function (tag) { return el.name === tag; }) && !this._inIcu &&
!this._isInTranslatableSection;
var isTopLevelImplicit = !wasInImplicitNode && isImplicit;
this._inImplicitNode = wasInImplicitNode || isImplicit;
if (!this._isInTranslatableSection && !this._inIcu) {
if (i18nAttr || isTopLevelImplicit) {
this._inI18nNode = true;
var message = this._addMessage(el.children, i18nMeta);
translatedChildNodes = this._translateMessage(el, message);
}
if (this._mode == _VisitorMode.Extract) {
var isTranslatable = i18nAttr || isTopLevelImplicit;
if (isTranslatable)
this._openTranslatableSection(el);
visitAll(this, el.children);
if (isTranslatable)
this._closeTranslatableSection(el, el.children);
}
}
else {
if (i18nAttr || isTopLevelImplicit) {
this._reportError(el, 'Could not mark an element as translatable inside a translatable section');
}
if (this._mode == _VisitorMode.Extract) {
// Descend into child nodes for extraction
visitAll(this, el.children);
}
}
if (this._mode === _VisitorMode.Merge) {
var visitNodes = translatedChildNodes || el.children;
visitNodes.forEach(function (child) {
var visited = child.visit(_this, context);
if (visited && !_this._isInTranslatableSection) {
// Do not add the children from translatable sections (= i18n blocks here)
// They will be added later in this loop when the block closes (i.e. on `<!-- /i18n -->`)
childNodes = childNodes.concat(visited);
}
});
}
this._visitAttributesOf(el);
this._depth--;
this._inI18nNode = wasInI18nNode;
this._inImplicitNode = wasInImplicitNode;
if (this._mode === _VisitorMode.Merge) {
var translatedAttrs = this._translateAttributes(el);
return new Element(el.name, translatedAttrs, childNodes, el.sourceSpan, el.startSourceSpan, el.endSourceSpan);
}
return null;
};
_Visitor.prototype.visitAttribute = function (attribute, context) {
throw new Error('unreachable code');
};
_Visitor.prototype._init = function (mode, interpolationConfig) {
this._mode = mode;
this._inI18nBlock = false;
this._inI18nNode = false;
this._depth = 0;
this._inIcu = false;
this._msgCountAtSectionStart = undefined;
this._errors = [];
this._messages = [];
this._inImplicitNode = false;
this._createI18nMessage = createI18nMessageFactory(interpolationConfig);
};
// looks for translatable attributes
_Visitor.prototype._visitAttributesOf = function (el) {
var _this = this;
var explicitAttrNameToValue = {};
var implicitAttrNames = this._implicitAttrs[el.name] || [];
el.attrs.filter(function (attr) { return attr.name.startsWith(_I18N_ATTR_PREFIX); })
.forEach(function (attr) { return explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =
attr.value; });
el.attrs.forEach(function (attr) {
if (attr.name in explicitAttrNameToValue) {
_this._addMessage([attr], explicitAttrNameToValue[attr.name]);
}
else if (implicitAttrNames.some(function (name) { return attr.name === name; })) {
_this._addMessage([attr]);
}
});
};
// add a translatable message
_Visitor.prototype._addMessage = function (ast, msgMeta) {
if (ast.length == 0 ||
ast.length == 1 && ast[0] instanceof Attribute && !ast[0].value) {
// Do not create empty messages
return null;
}
var _a = _parseMessageMeta(msgMeta), meaning = _a.meaning, description = _a.description, id = _a.id;
var message = this._createI18nMessage(ast, meaning, description, id);
this._messages.push(message);
return message;
};
// Translates the given message given the `TranslationBundle`
// This is used for translating elements / blocks - see `_translateAttributes` for attributes
// no-op when called in extraction mode (returns [])
_Visitor.prototype._translateMessage = function (el, message) {
if (message && this._mode === _VisitorMode.Merge) {
var nodes = this._translations.get(message);
if (nodes) {
return nodes;
}
this._reportError(el, "Translation unavailable for message id=\"" + this._translations.digest(message) + "\"");
}
return [];
};
// translate the attributes of an element and remove i18n specific attributes
_Visitor.prototype._translateAttributes = function (el) {
var _this = this;
var attributes = el.attrs;
var i18nParsedMessageMeta = {};
attributes.forEach(function (attr) {
if (attr.name.startsWith(_I18N_ATTR_PREFIX)) {
i18nParsedMessageMeta[attr.name.slice(_I18N_ATTR_PREFIX.length)] =
_parseMessageMeta(attr.value);
}
});
var translatedAttributes = [];
attributes.forEach(function (attr) {
if (attr.name === _I18N_ATTR || attr.name.startsWith(_I18N_ATTR_PREFIX)) {
// strip i18n specific attributes
return;
}
if (attr.value && attr.value != '' && i18nParsedMessageMeta.hasOwnProperty(attr.name)) {
var _a = i18nParsedMessageMeta[attr.name], meaning = _a.meaning, description = _a.description, id = _a.id;
var message = _this._createI18nMessage([attr], meaning, description, id);
var nodes = _this._translations.get(message);
if (nodes) {
if (nodes.length == 0) {
translatedAttributes.push(new Attribute(attr.name, '', attr.sourceSpan));
}
else if (nodes[0] instanceof Text) {
var value = nodes[0].value;
translatedAttributes.push(new Attribute(attr.name, value, attr.sourceSpan));
}
else {
_this._reportError(el, "Unexpected translation for attribute \"" + attr.name + "\" (id=\"" + (id || _this._translations.digest(message)) + "\")");
}
}
else {
_this._reportError(el, "Translation unavailable for attribute \"" + attr.name + "\" (id=\"" + (id || _this._translations.digest(message)) + "\")");
}
}
else {
translatedAttributes.push(attr);
}
});
return translatedAttributes;
};
/**
* Add the node as a child of the block when:
* - we are in a block,
* - we are not inside a ICU message (those are handled separately),
* - the node is a "direct child" of the block
*/
_Visitor.prototype._mayBeAddBlockChildren = function (node) {
if (this._inI18nBlock && !this._inIcu && this._depth == this._blockStartDepth) {
this._blockChildren.push(node);
}
};
/**
* Marks the start of a section, see `_closeTranslatableSection`
*/
_Visitor.prototype._openTranslatableSection = function (node) {
if (this._isInTranslatableSection) {
this._reportError(node, 'Unexpected section start');
}
else {
this._msgCountAtSectionStart = this._messages.length;
}
};
Object.defineProperty(_Visitor.prototype, "_isInTranslatableSection", {
/**
* A translatable section could be:
* - the content of translatable element,
* - nodes between `<!-- i18n -->` and `<!-- /i18n -->` comments
*/
get: function () {
return this._msgCountAtSectionStart !== void 0;
},
enumerable: true,
configurable: true
});
/**
* Terminates a section.
*
* If a section has only one significant children (comments not significant) then we should not
* keep the message from this children:
*
* `<p i18n="meaning|description">{ICU message}</p>` would produce two messages:
* - one for the <p> content with meaning and description,
* - another one for the ICU message.
*
* In this case the last message is discarded as it contains less information (the AST is
* otherwise identical).
*
* Note that we should still keep messages extracted from attributes inside the section (ie in the
* ICU message here)
*/
_Visitor.prototype._closeTranslatableSection = function (node, directChildren) {
if (!this._isInTranslatableSection) {
this._reportError(node, 'Unexpected section end');
return;
}
var startIndex = this._msgCountAtSectionStart;
var significantChildren = directChildren.reduce(function (count, node) { return count + (node instanceof Comment ? 0 : 1); }, 0);
if (significantChildren == 1) {
for (var i = this._messages.length - 1; i >= startIndex; i--) {
var ast = this._messages[i].nodes;
if (!(ast.length == 1 && ast[0] instanceof Text$1)) {
this._messages.splice(i, 1);
break;
}
}
}
this._msgCountAtSectionStart = undefined;
};
_Visitor.prototype._reportError = function (node, msg) {
this._errors.push(new I18nError(node.sourceSpan, msg));
};
return _Visitor;
}());
function _isOpeningComment(n) {
return !!(n instanceof Comment && n.value && n.value.startsWith('i18n'));
}
function _isClosingComment(n) {
return !!(n instanceof Comment && n.value && n.value === '/i18n');
}
function _getI18nAttr(p) {
return p.attrs.find(function (attr) { return attr.name === _I18N_ATTR; }) || null;
}
function _parseMessageMeta(i18n) {
if (!i18n)
return { meaning: '', description: '', id: '' };
var idIndex = i18n.indexOf(ID_SEPARATOR);
var descIndex = i18n.indexOf(MEANING_SEPARATOR);
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])((idIndex > -1) ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, ''], 2), meaningAndDesc = _a[0], id = _a[1];
var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])((descIndex > -1) ?
[meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] :
['', meaningAndDesc], 2), meaning = _b[0], description = _b[1];
return { meaning: meaning, description: description, id: id };
}
/**
* @license
* Copyright Google Inc. 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 XmlTagDefinition = /** @class */ (function () {
function XmlTagDefinition() {
this.closedByParent = false;
this.contentType = TagContentType.PARSABLE_DATA;
this.isVoid = false;
this.ignoreFirstLf = false;
this.canSelfClose = true;
}
XmlTagDefinition.prototype.requireExtraParent = function (currentParent) { return false; };
XmlTagDefinition.prototype.isClosedByChild = function (name) { return false; };
return XmlTagDefinition;
}());
var _TAG_DEFINITION = new XmlTagDefinition();
function getXmlTagDefinition(tagName) {
return _TAG_DEFINITION;
}
/**
* @license
* Copyright Google Inc. 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 XmlParser = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(XmlParser, _super);
function XmlParser() {
return _super.call(this, getXmlTagDefinition) || this;
}
XmlParser.prototype.parse = function (source, url, parseExpansionForms) {
if (parseExpansionForms === void 0) { parseExpansionForms = false; }
return _super.prototype.parse.call(this, source, url, parseExpansionForms);
};
return XmlParser;
}(Parser$1));
/**
* @license
* Copyright Google Inc. 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 Serializer = /** @class */ (function () {
function Serializer() {
}
// Creates a name mapper, see `PlaceholderMapper`
// Returning `null` means that no name mapping is used.
Serializer.prototype.createNameMapper = function (message) { return null; };
return Serializer;
}());
/**
* A simple mapper that take a function to transform an internal name to a public name
*/
var SimplePlaceholderMapper = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SimplePlaceholderMapper, _super);
// create a mapping from the message
function SimplePlaceholderMapper(message, mapName) {
var _this = _super.call(this) || this;
_this.mapName = mapName;
_this.internalToPublic = {};
_this.publicToNextId = {};
_this.publicToInternal = {};
message.nodes.forEach(function (node) { return node.visit(_this); });
return _this;
}
SimplePlaceholderMapper.prototype.toPublicName = function (internalName) {
return this.internalToPublic.hasOwnProperty(internalName) ?
this.internalToPublic[internalName] :
null;
};
SimplePlaceholderMapper.prototype.toInternalName = function (publicName) {
return this.publicToInternal.hasOwnProperty(publicName) ? this.publicToInternal[publicName] :
null;
};
SimplePlaceholderMapper.prototype.visitText = function (text, context) { return null; };
SimplePlaceholderMapper.prototype.visitTagPlaceholder = function (ph, context) {
this.visitPlaceholderName(ph.startName);
_super.prototype.visitTagPlaceholder.call(this, ph, context);
this.visitPlaceholderName(ph.closeName);
};
SimplePlaceholderMapper.prototype.visitPlaceholder = function (ph, context) { this.visitPlaceholderName(ph.name); };
SimplePlaceholderMapper.prototype.visitIcuPlaceholder = function (ph, context) {
this.visitPlaceholderName(ph.name);
};
// XMB placeholders could only contains A-Z, 0-9 and _
SimplePlaceholderMapper.prototype.visitPlaceholderName = function (internalName) {
if (!internalName || this.internalToPublic.hasOwnProperty(internalName)) {
return;
}
var publicName = this.mapName(internalName);
if (this.publicToInternal.hasOwnProperty(publicName)) {
// Create a new XMB when it has already been used
var nextId = this.publicToNextId[publicName];
this.publicToNextId[publicName] = nextId + 1;
publicName = publicName + "_" + nextId;
}
else {
this.publicToNextId[publicName] = 1;
}
this.internalToPublic[internalName] = publicName;
this.publicToInternal[publicName] = internalName;
};
return SimplePlaceholderMapper;
}(RecurseVisitor));
/**
* @license
* Copyright Google Inc. 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 _Visitor$1 = /** @class */ (function () {
function _Visitor() {
}
_Visitor.prototype.visitTag = function (tag) {
var _this = this;
var strAttrs = this._serializeAttributes(tag.attrs);
if (tag.children.length == 0) {
return "<" + tag.name + strAttrs + "/>";
}
var strChildren = tag.children.map(function (node) { return node.visit(_this); });
return "<" + tag.name + strAttrs + ">" + strChildren.join('') + "</" + tag.name + ">";
};
_Visitor.prototype.visitText = function (text) { return text.value; };
_Visitor.prototype.visitDeclaration = function (decl) {
return "<?xml" + this._serializeAttributes(decl.attrs) + " ?>";
};
_Visitor.prototype._serializeAttributes = function (attrs) {
var strAttrs = Object.keys(attrs).map(function (name) { return name + "=\"" + attrs[name] + "\""; }).join(' ');
return strAttrs.length > 0 ? ' ' + strAttrs : '';
};
_Visitor.prototype.visitDoctype = function (doctype) {
return "<!DOCTYPE " + doctype.rootTag + " [\n" + doctype.dtd + "\n]>";
};
return _Visitor;
}());
var _visitor = new _Visitor$1();
function serialize(nodes) {
return nodes.map(function (node) { return node.visit(_visitor); }).join('');
}
var Declaration = /** @class */ (function () {
function Declaration(unescapedAttrs) {
var _this = this;
this.attrs = {};
Object.keys(unescapedAttrs).forEach(function (k) {
_this.attrs[k] = escapeXml(unescapedAttrs[k]);
});
}
Declaration.prototype.visit = function (visitor) { return visitor.visitDeclaration(this); };
return Declaration;
}());
var Doctype = /** @class */ (function () {
function Doctype(rootTag, dtd) {
this.rootTag = rootTag;
this.dtd = dtd;
}
Doctype.prototype.visit = function (visitor) { return visitor.visitDoctype(this); };
return Doctype;
}());
var Tag = /** @class */ (function () {
function Tag(name, unescapedAttrs, children) {
if (unescapedAttrs === void 0) { unescapedAttrs = {}; }
if (children === void 0) { children = []; }
var _this = this;
this.name = name;
this.children = children;
this.attrs = {};
Object.keys(unescapedAttrs).forEach(function (k) {
_this.attrs[k] = escapeXml(unescapedAttrs[k]);
});
}
Tag.prototype.visit = function (visitor) { return visitor.visitTag(this); };
return Tag;
}());
var Text$2 = /** @class */ (function () {
function Text(unescapedValue) {
this.value = escapeXml(unescapedValue);
}
Text.prototype.visit = function (visitor) { return visitor.visitText(this); };
return Text;
}());
var CR = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CR, _super);
function CR(ws) {
if (ws === void 0) { ws = 0; }
return _super.call(this, "\n" + new Array(ws + 1).join(' ')) || this;
}
return CR;
}(Text$2));
var _ESCAPED_CHARS = [
[/&/g, '&amp;'],
[/"/g, '&quot;'],
[/'/g, '&apos;'],
[/</g, '&lt;'],
[/>/g, '&gt;'],
];
// Escape `_ESCAPED_CHARS` characters in the given text with encoded entities
function escapeXml(text) {
return _ESCAPED_CHARS.reduce(function (text, entry) { return text.replace(entry[0], entry[1]); }, text);
}
/**
* @license
* Copyright Google Inc. 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 _VERSION = '1.2';
var _XMLNS = 'urn:oasis:names:tc:xliff:document:1.2';
// TODO(vicb): make this a param (s/_/-/)
var _DEFAULT_SOURCE_LANG = 'en';
var _PLACEHOLDER_TAG = 'x';
var _MARKER_TAG = 'mrk';
var _FILE_TAG = 'file';
var _SOURCE_TAG = 'source';
var _SEGMENT_SOURCE_TAG = 'seg-source';
var _TARGET_TAG = 'target';
var _UNIT_TAG = 'trans-unit';
var _CONTEXT_GROUP_TAG = 'context-group';
var _CONTEXT_TAG = 'context';
// http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html
// http://docs.oasis-open.org/xliff/v1.2/xliff-profile-html/xliff-profile-html-1.2.html
var Xliff = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Xliff, _super);
function Xliff() {
return _super !== null && _super.apply(this, arguments) || this;
}
Xliff.prototype.write = function (messages, locale) {
var visitor = new _WriteVisitor();
var transUnits = [];
messages.forEach(function (message) {
var contextTags = [];
message.sources.forEach(function (source) {
var contextGroupTag = new Tag(_CONTEXT_GROUP_TAG, { purpose: 'location' });
contextGroupTag.children.push(new CR(10), new Tag(_CONTEXT_TAG, { 'context-type': 'sourcefile' }, [new Text$2(source.filePath)]), new CR(10), new Tag(_CONTEXT_TAG, { 'context-type': 'linenumber' }, [new Text$2("" + source.startLine)]), new CR(8));
contextTags.push(new CR(8), contextGroupTag);
});
var transUnit = new Tag(_UNIT_TAG, { id: message.id, datatype: 'html' });
(_a = transUnit.children).push.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([new CR(8), new Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes))], contextTags));
if (message.description) {
transUnit.children.push(new CR(8), new Tag('note', { priority: '1', from: 'description' }, [new Text$2(message.description)]));
}
if (message.meaning) {
transUnit.children.push(new CR(8), new Tag('note', { priority: '1', from: 'meaning' }, [new Text$2(message.meaning)]));
}
transUnit.children.push(new CR(6));
transUnits.push(new CR(6), transUnit);
var _a;
});
var body = new Tag('body', {}, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(transUnits, [new CR(4)]));
var file = new Tag('file', {
'source-language': locale || _DEFAULT_SOURCE_LANG,
datatype: 'plaintext',
original: 'ng2.template',
}, [new CR(4), body, new CR(2)]);
var xliff = new Tag('xliff', { version: _VERSION, xmlns: _XMLNS }, [new CR(2), file, new CR()]);
return serialize([
new Declaration({ version: '1.0', encoding: 'UTF-8' }), new CR(), xliff, new CR()
]);
};
Xliff.prototype.load = function (content, url) {
// xliff to xml nodes
var xliffParser = new XliffParser();
var _a = xliffParser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;
// xml nodes to i18n nodes
var i18nNodesByMsgId = {};
var converter = new XmlToI18n();
Object.keys(msgIdToHtml).forEach(function (msgId) {
var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;
errors.push.apply(errors, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(e));
i18nNodesByMsgId[msgId] = i18nNodes;
});
if (errors.length) {
throw new Error("xliff parse errors:\n" + errors.join('\n'));
}
return { locale: locale, i18nNodesByMsgId: i18nNodesByMsgId };
};
Xliff.prototype.digest = function (message) { return digest(message); };
return Xliff;
}(Serializer));
var _WriteVisitor = /** @class */ (function () {
function _WriteVisitor() {
}
_WriteVisitor.prototype.visitText = function (text, context) { return [new Text$2(text.value)]; };
_WriteVisitor.prototype.visitContainer = function (container, context) {
var _this = this;
var nodes = [];
container.children.forEach(function (node) { return nodes.push.apply(nodes, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(node.visit(_this))); });
return nodes;
};
_WriteVisitor.prototype.visitIcu = function (icu, context) {
var _this = this;
var nodes = [new Text$2("{" + icu.expressionPlaceholder + ", " + icu.type + ", ")];
Object.keys(icu.cases).forEach(function (c) {
nodes.push.apply(nodes, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([new Text$2(c + " {")], icu.cases[c].visit(_this), [new Text$2("} ")]));
});
nodes.push(new Text$2("}"));
return nodes;
};
_WriteVisitor.prototype.visitTagPlaceholder = function (ph, context) {
var ctype = getCtypeForTag(ph.tag);
if (ph.isVoid) {
// void tags have no children nor closing tags
return [new Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype: ctype, 'equiv-text': "<" + ph.tag + "/>" })];
}
var startTagPh = new Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype: ctype, 'equiv-text': "<" + ph.tag + ">" });
var closeTagPh = new Tag(_PLACEHOLDER_TAG, { id: ph.closeName, ctype: ctype, 'equiv-text': "</" + ph.tag + ">" });
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([startTagPh], this.serialize(ph.children), [closeTagPh]);
};
_WriteVisitor.prototype.visitPlaceholder = function (ph, context) {
return [new Tag(_PLACEHOLDER_TAG, { id: ph.name, 'equiv-text': "{{" + ph.value + "}}" })];
};
_WriteVisitor.prototype.visitIcuPlaceholder = function (ph, context) {
var equivText = "{" + ph.value.expression + ", " + ph.value.type + ", " + Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ') + "}";
return [new Tag(_PLACEHOLDER_TAG, { id: ph.name, 'equiv-text': equivText })];
};
_WriteVisitor.prototype.serialize = function (nodes) {
var _this = this;
return [].concat.apply([], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(nodes.map(function (node) { return node.visit(_this); })));
};
return _WriteVisitor;
}());
// TODO(vicb): add error management (structure)
// Extract messages as xml nodes from the xliff file
var XliffParser = /** @class */ (function () {
function XliffParser() {
this._locale = null;
}
XliffParser.prototype.parse = function (xliff, url) {
this._unitMlString = null;
this._msgIdToHtml = {};
var xml = new XmlParser().parse(xliff, url, false);
this._errors = xml.errors;
visitAll(this, xml.rootNodes, null);
return {
msgIdToHtml: this._msgIdToHtml,
errors: this._errors,
locale: this._locale,
};
};
XliffParser.prototype.visitElement = function (element, context) {
switch (element.name) {
case _UNIT_TAG:
this._unitMlString = null;
var idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });
if (!idAttr) {
this._addError(element, "<" + _UNIT_TAG + "> misses the \"id\" attribute");
}
else {
var id = idAttr.value;
if (this._msgIdToHtml.hasOwnProperty(id)) {
this._addError(element, "Duplicated translations for msg " + id);
}
else {
visitAll(this, element.children, null);
if (typeof this._unitMlString === 'string') {
this._msgIdToHtml[id] = this._unitMlString;
}
else {
this._addError(element, "Message " + id + " misses a translation");
}
}
}
break;
// ignore those tags
case _SOURCE_TAG:
case _SEGMENT_SOURCE_TAG:
break;
case _TARGET_TAG:
var innerTextStart = element.startSourceSpan.end.offset;
var innerTextEnd = element.endSourceSpan.start.offset;
var content = element.startSourceSpan.start.file.content;
var innerText = content.slice(innerTextStart, innerTextEnd);
this._unitMlString = innerText;
break;
case _FILE_TAG:
var localeAttr = element.attrs.find(function (attr) { return attr.name === 'target-language'; });
if (localeAttr) {
this._locale = localeAttr.value;
}
visitAll(this, element.children, null);
break;
default:
// TODO(vicb): assert file structure, xliff version
// For now only recurse on unhandled nodes
visitAll(this, element.children, null);
}
};
XliffParser.prototype.visitAttribute = function (attribute, context) { };
XliffParser.prototype.visitText = function (text, context) { };
XliffParser.prototype.visitComment = function (comment, context) { };
XliffParser.prototype.visitExpansion = function (expansion, context) { };
XliffParser.prototype.visitExpansionCase = function (expansionCase, context) { };
XliffParser.prototype._addError = function (node, message) {
this._errors.push(new I18nError(node.sourceSpan, message));
};
return XliffParser;
}());
// Convert ml nodes (xliff syntax) to i18n nodes
var XmlToI18n = /** @class */ (function () {
function XmlToI18n() {
}
XmlToI18n.prototype.convert = function (message, url) {
var xmlIcu = new XmlParser().parse(message, url, true);
this._errors = xmlIcu.errors;
var i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?
[] : [].concat.apply([], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(visitAll(this, xmlIcu.rootNodes)));
return {
i18nNodes: i18nNodes,
errors: this._errors,
};
};
XmlToI18n.prototype.visitText = function (text, context) { return new Text$1(text.value, text.sourceSpan); };
XmlToI18n.prototype.visitElement = function (el, context) {
if (el.name === _PLACEHOLDER_TAG) {
var nameAttr = el.attrs.find(function (attr) { return attr.name === 'id'; });
if (nameAttr) {
return new Placeholder('', nameAttr.value, el.sourceSpan);
}
this._addError(el, "<" + _PLACEHOLDER_TAG + "> misses the \"id\" attribute");
return null;
}
if (el.name === _MARKER_TAG) {
return [].concat.apply([], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(visitAll(this, el.children)));
}
this._addError(el, "Unexpected tag");
return null;
};
XmlToI18n.prototype.visitExpansion = function (icu, context) {
var caseMap = {};
visitAll(this, icu.cases).forEach(function (c) {
caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);
});
return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);
};
XmlToI18n.prototype.visitExpansionCase = function (icuCase, context) {
return {
value: icuCase.value,
nodes: visitAll(this, icuCase.expression),
};
};
XmlToI18n.prototype.visitComment = function (comment, context) { };
XmlToI18n.prototype.visitAttribute = function (attribute, context) { };
XmlToI18n.prototype._addError = function (node, message) {
this._errors.push(new I18nError(node.sourceSpan, message));
};
return XmlToI18n;
}());
function getCtypeForTag(tag) {
switch (tag.toLowerCase()) {
case 'br':
return 'lb';
case 'img':
return 'image';
default:
return "x-" + tag;
}
}
/**
* @license
* Copyright Google Inc. 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 _VERSION$1 = '2.0';
var _XMLNS$1 = 'urn:oasis:names:tc:xliff:document:2.0';
// TODO(vicb): make this a param (s/_/-/)
var _DEFAULT_SOURCE_LANG$1 = 'en';
var _PLACEHOLDER_TAG$1 = 'ph';
var _PLACEHOLDER_SPANNING_TAG = 'pc';
var _MARKER_TAG$1 = 'mrk';
var _XLIFF_TAG = 'xliff';
var _SOURCE_TAG$1 = 'source';
var _TARGET_TAG$1 = 'target';
var _UNIT_TAG$1 = 'unit';
// http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html
var Xliff2 = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Xliff2, _super);
function Xliff2() {
return _super !== null && _super.apply(this, arguments) || this;
}
Xliff2.prototype.write = function (messages, locale) {
var visitor = new _WriteVisitor$1();
var units = [];
messages.forEach(function (message) {
var unit = new Tag(_UNIT_TAG$1, { id: message.id });
var notes = new Tag('notes');
if (message.description || message.meaning) {
if (message.description) {
notes.children.push(new CR(8), new Tag('note', { category: 'description' }, [new Text$2(message.description)]));
}
if (message.meaning) {
notes.children.push(new CR(8), new Tag('note', { category: 'meaning' }, [new Text$2(message.meaning)]));
}
}
message.sources.forEach(function (source) {
notes.children.push(new CR(8), new Tag('note', { category: 'location' }, [
new Text$2(source.filePath + ":" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))
]));
});
notes.children.push(new CR(6));
unit.children.push(new CR(6), notes);
var segment = new Tag('segment');
segment.children.push(new CR(8), new Tag(_SOURCE_TAG$1, {}, visitor.serialize(message.nodes)), new CR(6));
unit.children.push(new CR(6), segment, new CR(4));
units.push(new CR(4), unit);
});
var file = new Tag('file', { 'original': 'ng.template', id: 'ngi18n' }, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(units, [new CR(2)]));
var xliff = new Tag(_XLIFF_TAG, { version: _VERSION$1, xmlns: _XMLNS$1, srcLang: locale || _DEFAULT_SOURCE_LANG$1 }, [new CR(2), file, new CR()]);
return serialize([
new Declaration({ version: '1.0', encoding: 'UTF-8' }), new CR(), xliff, new CR()
]);
};
Xliff2.prototype.load = function (content, url) {
// xliff to xml nodes
var xliff2Parser = new Xliff2Parser();
var _a = xliff2Parser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;
// xml nodes to i18n nodes
var i18nNodesByMsgId = {};
var converter = new XmlToI18n$1();
Object.keys(msgIdToHtml).forEach(function (msgId) {
var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;
errors.push.apply(errors, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(e));
i18nNodesByMsgId[msgId] = i18nNodes;
});
if (errors.length) {
throw new Error("xliff2 parse errors:\n" + errors.join('\n'));
}
return { locale: locale, i18nNodesByMsgId: i18nNodesByMsgId };
};
Xliff2.prototype.digest = function (message) { return decimalDigest(message); };
return Xliff2;
}(Serializer));
var _WriteVisitor$1 = /** @class */ (function () {
function _WriteVisitor() {
}
_WriteVisitor.prototype.visitText = function (text, context) { return [new Text$2(text.value)]; };
_WriteVisitor.prototype.visitContainer = function (container, context) {
var _this = this;
var nodes = [];
container.children.forEach(function (node) { return nodes.push.apply(nodes, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(node.visit(_this))); });
return nodes;
};
_WriteVisitor.prototype.visitIcu = function (icu, context) {
var _this = this;
var nodes = [new Text$2("{" + icu.expressionPlaceholder + ", " + icu.type + ", ")];
Object.keys(icu.cases).forEach(function (c) {
nodes.push.apply(nodes, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([new Text$2(c + " {")], icu.cases[c].visit(_this), [new Text$2("} ")]));
});
nodes.push(new Text$2("}"));
return nodes;
};
_WriteVisitor.prototype.visitTagPlaceholder = function (ph, context) {
var _this = this;
var type = getTypeForTag(ph.tag);
if (ph.isVoid) {
var tagPh = new Tag(_PLACEHOLDER_TAG$1, {
id: (this._nextPlaceholderId++).toString(),
equiv: ph.startName,
type: type,
disp: "<" + ph.tag + "/>",
});
return [tagPh];
}
var tagPc = new Tag(_PLACEHOLDER_SPANNING_TAG, {
id: (this._nextPlaceholderId++).toString(),
equivStart: ph.startName,
equivEnd: ph.closeName,
type: type,
dispStart: "<" + ph.tag + ">",
dispEnd: "</" + ph.tag + ">",
});
var nodes = [].concat.apply([], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(ph.children.map(function (node) { return node.visit(_this); })));
if (nodes.length) {
nodes.forEach(function (node) { return tagPc.children.push(node); });
}
else {
tagPc.children.push(new Text$2(''));
}
return [tagPc];
};
_WriteVisitor.prototype.visitPlaceholder = function (ph, context) {
var idStr = (this._nextPlaceholderId++).toString();
return [new Tag(_PLACEHOLDER_TAG$1, {
id: idStr,
equiv: ph.name,
disp: "{{" + ph.value + "}}",
})];
};
_WriteVisitor.prototype.visitIcuPlaceholder = function (ph, context) {
var cases = Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ');
var idStr = (this._nextPlaceholderId++).toString();
return [new Tag(_PLACEHOLDER_TAG$1, { id: idStr, equiv: ph.name, disp: "{" + ph.value.expression + ", " + ph.value.type + ", " + cases + "}" })];
};
_WriteVisitor.prototype.serialize = function (nodes) {
var _this = this;
this._nextPlaceholderId = 0;
return [].concat.apply([], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(nodes.map(function (node) { return node.visit(_this); })));
};
return _WriteVisitor;
}());
// Extract messages as xml nodes from the xliff file
var Xliff2Parser = /** @class */ (function () {
function Xliff2Parser() {
this._locale = null;
}
Xliff2Parser.prototype.parse = function (xliff, url) {
this._unitMlString = null;
this._msgIdToHtml = {};
var xml = new XmlParser().parse(xliff, url, false);
this._errors = xml.errors;
visitAll(this, xml.rootNodes, null);
return {
msgIdToHtml: this._msgIdToHtml,
errors: this._errors,
locale: this._locale,
};
};
Xliff2Parser.prototype.visitElement = function (element, context) {
switch (element.name) {
case _UNIT_TAG$1:
this._unitMlString = null;
var idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });
if (!idAttr) {
this._addError(element, "<" + _UNIT_TAG$1 + "> misses the \"id\" attribute");
}
else {
var id = idAttr.value;
if (this._msgIdToHtml.hasOwnProperty(id)) {
this._addError(element, "Duplicated translations for msg " + id);
}
else {
visitAll(this, element.children, null);
if (typeof this._unitMlString === 'string') {
this._msgIdToHtml[id] = this._unitMlString;
}
else {
this._addError(element, "Message " + id + " misses a translation");
}
}
}
break;
case _SOURCE_TAG$1:
// ignore source message
break;
case _TARGET_TAG$1:
var innerTextStart = element.startSourceSpan.end.offset;
var innerTextEnd = element.endSourceSpan.start.offset;
var content = element.startSourceSpan.start.file.content;
var innerText = content.slice(innerTextStart, innerTextEnd);
this._unitMlString = innerText;
break;
case _XLIFF_TAG:
var localeAttr = element.attrs.find(function (attr) { return attr.name === 'trgLang'; });
if (localeAttr) {
this._locale = localeAttr.value;
}
var versionAttr = element.attrs.find(function (attr) { return attr.name === 'version'; });
if (versionAttr) {
var version = versionAttr.value;
if (version !== '2.0') {
this._addError(element, "The XLIFF file version " + version + " is not compatible with XLIFF 2.0 serializer");
}
else {
visitAll(this, element.children, null);
}
}
break;
default:
visitAll(this, element.children, null);
}
};
Xliff2Parser.prototype.visitAttribute = function (attribute, context) { };
Xliff2Parser.prototype.visitText = function (text, context) { };
Xliff2Parser.prototype.visitComment = function (comment, context) { };
Xliff2Parser.prototype.visitExpansion = function (expansion, context) { };
Xliff2Parser.prototype.visitExpansionCase = function (expansionCase, context) { };
Xliff2Parser.prototype._addError = function (node, message) {
this._errors.push(new I18nError(node.sourceSpan, message));
};
return Xliff2Parser;
}());
// Convert ml nodes (xliff syntax) to i18n nodes
var XmlToI18n$1 = /** @class */ (function () {
function XmlToI18n() {
}
XmlToI18n.prototype.convert = function (message, url) {
var xmlIcu = new XmlParser().parse(message, url, true);
this._errors = xmlIcu.errors;
var i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?
[] : [].concat.apply([], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(visitAll(this, xmlIcu.rootNodes)));
return {
i18nNodes: i18nNodes,
errors: this._errors,
};
};
XmlToI18n.prototype.visitText = function (text, context) { return new Text$1(text.value, text.sourceSpan); };
XmlToI18n.prototype.visitElement = function (el, context) {
var _this = this;
switch (el.name) {
case _PLACEHOLDER_TAG$1:
var nameAttr = el.attrs.find(function (attr) { return attr.name === 'equiv'; });
if (nameAttr) {
return [new Placeholder('', nameAttr.value, el.sourceSpan)];
}
this._addError(el, "<" + _PLACEHOLDER_TAG$1 + "> misses the \"equiv\" attribute");
break;
case _PLACEHOLDER_SPANNING_TAG:
var startAttr = el.attrs.find(function (attr) { return attr.name === 'equivStart'; });
var endAttr = el.attrs.find(function (attr) { return attr.name === 'equivEnd'; });
if (!startAttr) {
this._addError(el, "<" + _PLACEHOLDER_TAG$1 + "> misses the \"equivStart\" attribute");
}
else if (!endAttr) {
this._addError(el, "<" + _PLACEHOLDER_TAG$1 + "> misses the \"equivEnd\" attribute");
}
else {
var startId = startAttr.value;
var endId = endAttr.value;
var nodes = [];
return nodes.concat.apply(nodes, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([new Placeholder('', startId, el.sourceSpan)], el.children.map(function (node) { return node.visit(_this, null); }), [new Placeholder('', endId, el.sourceSpan)]));
}
break;
case _MARKER_TAG$1:
return [].concat.apply([], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(visitAll(this, el.children)));
default:
this._addError(el, "Unexpected tag");
}
return null;
};
XmlToI18n.prototype.visitExpansion = function (icu, context) {
var caseMap = {};
visitAll(this, icu.cases).forEach(function (c) {
caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);
});
return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);
};
XmlToI18n.prototype.visitExpansionCase = function (icuCase, context) {
return {
value: icuCase.value,
nodes: [].concat.apply([], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(visitAll(this, icuCase.expression))),
};
};
XmlToI18n.prototype.visitComment = function (comment, context) { };
XmlToI18n.prototype.visitAttribute = function (attribute, context) { };
XmlToI18n.prototype._addError = function (node, message) {
this._errors.push(new I18nError(node.sourceSpan, message));
};
return XmlToI18n;
}());
function getTypeForTag(tag) {
switch (tag.toLowerCase()) {
case 'br':
case 'b':
case 'i':
case 'u':
return 'fmt';
case 'img':
return 'image';
case 'a':
return 'link';
default:
return 'other';
}
}
/**
* @license
* Copyright Google Inc. 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 _MESSAGES_TAG = 'messagebundle';
var _MESSAGE_TAG = 'msg';
var _PLACEHOLDER_TAG$2 = 'ph';
var _EXEMPLE_TAG = 'ex';
var _SOURCE_TAG$2 = 'source';
var _DOCTYPE = "<!ELEMENT messagebundle (msg)*>\n<!ATTLIST messagebundle class CDATA #IMPLIED>\n\n<!ELEMENT msg (#PCDATA|ph|source)*>\n<!ATTLIST msg id CDATA #IMPLIED>\n<!ATTLIST msg seq CDATA #IMPLIED>\n<!ATTLIST msg name CDATA #IMPLIED>\n<!ATTLIST msg desc CDATA #IMPLIED>\n<!ATTLIST msg meaning CDATA #IMPLIED>\n<!ATTLIST msg obsolete (obsolete) #IMPLIED>\n<!ATTLIST msg xml:space (default|preserve) \"default\">\n<!ATTLIST msg is_hidden CDATA #IMPLIED>\n\n<!ELEMENT source (#PCDATA)>\n\n<!ELEMENT ph (#PCDATA|ex)*>\n<!ATTLIST ph name CDATA #REQUIRED>\n\n<!ELEMENT ex (#PCDATA)>";
var Xmb = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Xmb, _super);
function Xmb() {
return _super !== null && _super.apply(this, arguments) || this;
}
Xmb.prototype.write = function (messages, locale) {
var exampleVisitor = new ExampleVisitor();
var visitor = new _Visitor$2();
var rootNode = new Tag(_MESSAGES_TAG);
messages.forEach(function (message) {
var attrs = { id: message.id };
if (message.description) {
attrs['desc'] = message.description;
}
if (message.meaning) {
attrs['meaning'] = message.meaning;
}
var sourceTags = [];
message.sources.forEach(function (source) {
sourceTags.push(new Tag(_SOURCE_TAG$2, {}, [
new Text$2(source.filePath + ":" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))
]));
});
rootNode.children.push(new CR(2), new Tag(_MESSAGE_TAG, attrs, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(sourceTags, visitor.serialize(message.nodes))));
});
rootNode.children.push(new CR());
return serialize([
new Declaration({ version: '1.0', encoding: 'UTF-8' }),
new CR(),
new Doctype(_MESSAGES_TAG, _DOCTYPE),
new CR(),
exampleVisitor.addDefaultExamples(rootNode),
new CR(),
]);
};
Xmb.prototype.load = function (content, url) {
throw new Error('Unsupported');
};
Xmb.prototype.digest = function (message) { return digest$1(message); };
Xmb.prototype.createNameMapper = function (message) {
return new SimplePlaceholderMapper(message, toPublicName);
};
return Xmb;
}(Serializer));
var _Visitor$2 = /** @class */ (function () {
function _Visitor() {
}
_Visitor.prototype.visitText = function (text, context) { return [new Text$2(text.value)]; };
_Visitor.prototype.visitContainer = function (container, context) {
var _this = this;
var nodes = [];
container.children.forEach(function (node) { return nodes.push.apply(nodes, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(node.visit(_this))); });
return nodes;
};
_Visitor.prototype.visitIcu = function (icu, context) {
var _this = this;
var nodes = [new Text$2("{" + icu.expressionPlaceholder + ", " + icu.type + ", ")];
Object.keys(icu.cases).forEach(function (c) {
nodes.push.apply(nodes, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([new Text$2(c + " {")], icu.cases[c].visit(_this), [new Text$2("} ")]));
});
nodes.push(new Text$2("}"));
return nodes;
};
_Visitor.prototype.visitTagPlaceholder = function (ph, context) {
var startEx = new Tag(_EXEMPLE_TAG, {}, [new Text$2("<" + ph.tag + ">")]);
var startTagPh = new Tag(_PLACEHOLDER_TAG$2, { name: ph.startName }, [startEx]);
if (ph.isVoid) {
// void tags have no children nor closing tags
return [startTagPh];
}
var closeEx = new Tag(_EXEMPLE_TAG, {}, [new Text$2("</" + ph.tag + ">")]);
var closeTagPh = new Tag(_PLACEHOLDER_TAG$2, { name: ph.closeName }, [closeEx]);
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([startTagPh], this.serialize(ph.children), [closeTagPh]);
};
_Visitor.prototype.visitPlaceholder = function (ph, context) {
var exTag = new Tag(_EXEMPLE_TAG, {}, [new Text$2("{{" + ph.value + "}}")]);
return [new Tag(_PLACEHOLDER_TAG$2, { name: ph.name }, [exTag])];
};
_Visitor.prototype.visitIcuPlaceholder = function (ph, context) {
var exTag = new Tag(_EXEMPLE_TAG, {}, [
new Text$2("{" + ph.value.expression + ", " + ph.value.type + ", " + Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ') + "}")
]);
return [new Tag(_PLACEHOLDER_TAG$2, { name: ph.name }, [exTag])];
};
_Visitor.prototype.serialize = function (nodes) {
var _this = this;
return [].concat.apply([], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(nodes.map(function (node) { return node.visit(_this); })));
};
return _Visitor;
}());
function digest$1(message) {
return decimalDigest(message);
}
// TC requires at least one non-empty example on placeholders
var ExampleVisitor = /** @class */ (function () {
function ExampleVisitor() {
}
ExampleVisitor.prototype.addDefaultExamples = function (node) {
node.visit(this);
return node;
};
ExampleVisitor.prototype.visitTag = function (tag) {
var _this = this;
if (tag.name === _PLACEHOLDER_TAG$2) {
if (!tag.children || tag.children.length == 0) {
var exText = new Text$2(tag.attrs['name'] || '...');
tag.children = [new Tag(_EXEMPLE_TAG, {}, [exText])];
}
}
else if (tag.children) {
tag.children.forEach(function (node) { return node.visit(_this); });
}
};
ExampleVisitor.prototype.visitText = function (text) { };
ExampleVisitor.prototype.visitDeclaration = function (decl) { };
ExampleVisitor.prototype.visitDoctype = function (doctype) { };
return ExampleVisitor;
}());
// XMB/XTB placeholders can only contain A-Z, 0-9 and _
function toPublicName(internalName) {
return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, '_');
}
/**
* @license
* Copyright Google Inc. 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 _TRANSLATIONS_TAG = 'translationbundle';
var _TRANSLATION_TAG = 'translation';
var _PLACEHOLDER_TAG$3 = 'ph';
var Xtb = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Xtb, _super);
function Xtb() {
return _super !== null && _super.apply(this, arguments) || this;
}
Xtb.prototype.write = function (messages, locale) { throw new Error('Unsupported'); };
Xtb.prototype.load = function (content, url) {
// xtb to xml nodes
var xtbParser = new XtbParser();
var _a = xtbParser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;
// xml nodes to i18n nodes
var i18nNodesByMsgId = {};
var converter = new XmlToI18n$2();
// Because we should be able to load xtb files that rely on features not supported by angular,
// we need to delay the conversion of html to i18n nodes so that non angular messages are not
// converted
Object.keys(msgIdToHtml).forEach(function (msgId) {
var valueFn = function () {
var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, errors = _a.errors;
if (errors.length) {
throw new Error("xtb parse errors:\n" + errors.join('\n'));
}
return i18nNodes;
};
createLazyProperty(i18nNodesByMsgId, msgId, valueFn);
});
if (errors.length) {
throw new Error("xtb parse errors:\n" + errors.join('\n'));
}
return { locale: locale, i18nNodesByMsgId: i18nNodesByMsgId };
};
Xtb.prototype.digest = function (message) { return digest$1(message); };
Xtb.prototype.createNameMapper = function (message) {
return new SimplePlaceholderMapper(message, toPublicName);
};
return Xtb;
}(Serializer));
function createLazyProperty(messages, id, valueFn) {
Object.defineProperty(messages, id, {
configurable: true,
enumerable: true,
get: function () {
var value = valueFn();
Object.defineProperty(messages, id, { enumerable: true, value: value });
return value;
},
set: function (_) { throw new Error('Could not overwrite an XTB translation'); },
});
}
// Extract messages as xml nodes from the xtb file
var XtbParser = /** @class */ (function () {
function XtbParser() {
this._locale = null;
}
XtbParser.prototype.parse = function (xtb, url) {
this._bundleDepth = 0;
this._msgIdToHtml = {};
// We can not parse the ICU messages at this point as some messages might not originate
// from Angular that could not be lex'd.
var xml = new XmlParser().parse(xtb, url, false);
this._errors = xml.errors;
visitAll(this, xml.rootNodes);
return {
msgIdToHtml: this._msgIdToHtml,
errors: this._errors,
locale: this._locale,
};
};
XtbParser.prototype.visitElement = function (element, context) {
switch (element.name) {
case _TRANSLATIONS_TAG:
this._bundleDepth++;
if (this._bundleDepth > 1) {
this._addError(element, "<" + _TRANSLATIONS_TAG + "> elements can not be nested");
}
var langAttr = element.attrs.find(function (attr) { return attr.name === 'lang'; });
if (langAttr) {
this._locale = langAttr.value;
}
visitAll(this, element.children, null);
this._bundleDepth--;
break;
case _TRANSLATION_TAG:
var idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });
if (!idAttr) {
this._addError(element, "<" + _TRANSLATION_TAG + "> misses the \"id\" attribute");
}
else {
var id = idAttr.value;
if (this._msgIdToHtml.hasOwnProperty(id)) {
this._addError(element, "Duplicated translations for msg " + id);
}
else {
var innerTextStart = element.startSourceSpan.end.offset;
var innerTextEnd = element.endSourceSpan.start.offset;
var content = element.startSourceSpan.start.file.content;
var innerText = content.slice(innerTextStart, innerTextEnd);
this._msgIdToHtml[id] = innerText;
}
}
break;
default:
this._addError(element, 'Unexpected tag');
}
};
XtbParser.prototype.visitAttribute = function (attribute, context) { };
XtbParser.prototype.visitText = function (text, context) { };
XtbParser.prototype.visitComment = function (comment, context) { };
XtbParser.prototype.visitExpansion = function (expansion, context) { };
XtbParser.prototype.visitExpansionCase = function (expansionCase, context) { };
XtbParser.prototype._addError = function (node, message) {
this._errors.push(new I18nError(node.sourceSpan, message));
};
return XtbParser;
}());
// Convert ml nodes (xtb syntax) to i18n nodes
var XmlToI18n$2 = /** @class */ (function () {
function XmlToI18n() {
}
XmlToI18n.prototype.convert = function (message, url) {
var xmlIcu = new XmlParser().parse(message, url, true);
this._errors = xmlIcu.errors;
var i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?
[] :
visitAll(this, xmlIcu.rootNodes);
return {
i18nNodes: i18nNodes,
errors: this._errors,
};
};
XmlToI18n.prototype.visitText = function (text, context) { return new Text$1(text.value, text.sourceSpan); };
XmlToI18n.prototype.visitExpansion = function (icu, context) {
var caseMap = {};
visitAll(this, icu.cases).forEach(function (c) {
caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);
});
return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);
};
XmlToI18n.prototype.visitExpansionCase = function (icuCase, context) {
return {
value: icuCase.value,
nodes: visitAll(this, icuCase.expression),
};
};
XmlToI18n.prototype.visitElement = function (el, context) {
if (el.name === _PLACEHOLDER_TAG$3) {
var nameAttr = el.attrs.find(function (attr) { return attr.name === 'name'; });
if (nameAttr) {
return new Placeholder('', nameAttr.value, el.sourceSpan);
}
this._addError(el, "<" + _PLACEHOLDER_TAG$3 + "> misses the \"name\" attribute");
}
else {
this._addError(el, "Unexpected tag");
}
return null;
};
XmlToI18n.prototype.visitComment = function (comment, context) { };
XmlToI18n.prototype.visitAttribute = function (attribute, context) { };
XmlToI18n.prototype._addError = function (node, message) {
this._errors.push(new I18nError(node.sourceSpan, message));
};
return XmlToI18n;
}());
/**
* @license
* Copyright Google Inc. 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 HtmlParser = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(HtmlParser, _super);
function HtmlParser() {
return _super.call(this, getHtmlTagDefinition) || this;
}
HtmlParser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {
if (parseExpansionForms === void 0) { parseExpansionForms = false; }
if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
return _super.prototype.parse.call(this, source, url, parseExpansionForms, interpolationConfig);
};
return HtmlParser;
}(Parser$1));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A container for translated messages
*/
var TranslationBundle = /** @class */ (function () {
function TranslationBundle(_i18nNodesByMsgId, locale, digest, mapperFactory, missingTranslationStrategy, console) {
if (_i18nNodesByMsgId === void 0) { _i18nNodesByMsgId = {}; }
if (missingTranslationStrategy === void 0) { missingTranslationStrategy = MissingTranslationStrategy.Warning; }
this._i18nNodesByMsgId = _i18nNodesByMsgId;
this.digest = digest;
this.mapperFactory = mapperFactory;
this._i18nToHtml = new I18nToHtmlVisitor(_i18nNodesByMsgId, locale, digest, mapperFactory, missingTranslationStrategy, console);
}
// Creates a `TranslationBundle` by parsing the given `content` with the `serializer`.
TranslationBundle.load = function (content, url, serializer, missingTranslationStrategy, console) {
var _a = serializer.load(content, url), locale = _a.locale, i18nNodesByMsgId = _a.i18nNodesByMsgId;
var digestFn = function (m) { return serializer.digest(m); };
var mapperFactory = function (m) { return serializer.createNameMapper(m); };
return new TranslationBundle(i18nNodesByMsgId, locale, digestFn, mapperFactory, missingTranslationStrategy, console);
};
// Returns the translation as HTML nodes from the given source message.
TranslationBundle.prototype.get = function (srcMsg) {
var html = this._i18nToHtml.convert(srcMsg);
if (html.errors.length) {
throw new Error(html.errors.join('\n'));
}
return html.nodes;
};
TranslationBundle.prototype.has = function (srcMsg) { return this.digest(srcMsg) in this._i18nNodesByMsgId; };
return TranslationBundle;
}());
var I18nToHtmlVisitor = /** @class */ (function () {
function I18nToHtmlVisitor(_i18nNodesByMsgId, _locale, _digest, _mapperFactory, _missingTranslationStrategy, _console) {
if (_i18nNodesByMsgId === void 0) { _i18nNodesByMsgId = {}; }
this._i18nNodesByMsgId = _i18nNodesByMsgId;
this._locale = _locale;
this._digest = _digest;
this._mapperFactory = _mapperFactory;
this._missingTranslationStrategy = _missingTranslationStrategy;
this._console = _console;
this._contextStack = [];
this._errors = [];
}
I18nToHtmlVisitor.prototype.convert = function (srcMsg) {
this._contextStack.length = 0;
this._errors.length = 0;
// i18n to text
var text = this._convertToText(srcMsg);
// text to html
var url = srcMsg.nodes[0].sourceSpan.start.file.url;
var html = new HtmlParser().parse(text, url, true);
return {
nodes: html.rootNodes,
errors: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(this._errors, html.errors),
};
};
I18nToHtmlVisitor.prototype.visitText = function (text, context) {
// `convert()` uses an `HtmlParser` to return `html.Node`s
// we should then make sure that any special characters are escaped
return escapeXml(text.value);
};
I18nToHtmlVisitor.prototype.visitContainer = function (container, context) {
var _this = this;
return container.children.map(function (n) { return n.visit(_this); }).join('');
};
I18nToHtmlVisitor.prototype.visitIcu = function (icu, context) {
var _this = this;
var cases = Object.keys(icu.cases).map(function (k) { return k + " {" + icu.cases[k].visit(_this) + "}"; });
// TODO(vicb): Once all format switch to using expression placeholders
// we should throw when the placeholder is not in the source message
var exp = this._srcMsg.placeholders.hasOwnProperty(icu.expression) ?
this._srcMsg.placeholders[icu.expression] :
icu.expression;
return "{" + exp + ", " + icu.type + ", " + cases.join(' ') + "}";
};
I18nToHtmlVisitor.prototype.visitPlaceholder = function (ph, context) {
var phName = this._mapper(ph.name);
if (this._srcMsg.placeholders.hasOwnProperty(phName)) {
return this._srcMsg.placeholders[phName];
}
if (this._srcMsg.placeholderToMessage.hasOwnProperty(phName)) {
return this._convertToText(this._srcMsg.placeholderToMessage[phName]);
}
this._addError(ph, "Unknown placeholder \"" + ph.name + "\"");
return '';
};
// Loaded message contains only placeholders (vs tag and icu placeholders).
// However when a translation can not be found, we need to serialize the source message
// which can contain tag placeholders
I18nToHtmlVisitor.prototype.visitTagPlaceholder = function (ph, context) {
var _this = this;
var tag = "" + ph.tag;
var attrs = Object.keys(ph.attrs).map(function (name) { return name + "=\"" + ph.attrs[name] + "\""; }).join(' ');
if (ph.isVoid) {
return "<" + tag + " " + attrs + "/>";
}
var children = ph.children.map(function (c) { return c.visit(_this); }).join('');
return "<" + tag + " " + attrs + ">" + children + "</" + tag + ">";
};
// Loaded message contains only placeholders (vs tag and icu placeholders).
// However when a translation can not be found, we need to serialize the source message
// which can contain tag placeholders
I18nToHtmlVisitor.prototype.visitIcuPlaceholder = function (ph, context) {
// An ICU placeholder references the source message to be serialized
return this._convertToText(this._srcMsg.placeholderToMessage[ph.name]);
};
/**
* Convert a source message to a translated text string:
* - text nodes are replaced with their translation,
* - placeholders are replaced with their content,
* - ICU nodes are converted to ICU expressions.
*/
I18nToHtmlVisitor.prototype._convertToText = function (srcMsg) {
var _this = this;
var id = this._digest(srcMsg);
var mapper = this._mapperFactory ? this._mapperFactory(srcMsg) : null;
var nodes;
this._contextStack.push({ msg: this._srcMsg, mapper: this._mapper });
this._srcMsg = srcMsg;
if (this._i18nNodesByMsgId.hasOwnProperty(id)) {
// When there is a translation use its nodes as the source
// And create a mapper to convert serialized placeholder names to internal names
nodes = this._i18nNodesByMsgId[id];
this._mapper = function (name) { return mapper ? mapper.toInternalName(name) : name; };
}
else {
// When no translation has been found
// - report an error / a warning / nothing,
// - use the nodes from the original message
// - placeholders are already internal and need no mapper
if (this._missingTranslationStrategy === MissingTranslationStrategy.Error) {
var ctx = this._locale ? " for locale \"" + this._locale + "\"" : '';
this._addError(srcMsg.nodes[0], "Missing translation for message \"" + id + "\"" + ctx);
}
else if (this._console &&
this._missingTranslationStrategy === MissingTranslationStrategy.Warning) {
var ctx = this._locale ? " for locale \"" + this._locale + "\"" : '';
this._console.warn("Missing translation for message \"" + id + "\"" + ctx);
}
nodes = srcMsg.nodes;
this._mapper = function (name) { return name; };
}
var text = nodes.map(function (node) { return node.visit(_this); }).join('');
var context = this._contextStack.pop();
this._srcMsg = context.msg;
this._mapper = context.mapper;
return text;
};
I18nToHtmlVisitor.prototype._addError = function (el, msg) {
this._errors.push(new I18nError(el.sourceSpan, msg));
};
return I18nToHtmlVisitor;
}());
/**
* @license
* Copyright Google Inc. 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 I18NHtmlParser = /** @class */ (function () {
function I18NHtmlParser(_htmlParser, translations, translationsFormat, missingTranslation, console) {
if (missingTranslation === void 0) { missingTranslation = MissingTranslationStrategy.Warning; }
this._htmlParser = _htmlParser;
if (translations) {
var serializer = createSerializer(translationsFormat);
this._translationBundle =
TranslationBundle.load(translations, 'i18n', serializer, missingTranslation, console);
}
else {
this._translationBundle =
new TranslationBundle({}, null, digest, undefined, missingTranslation, console);
}
}
I18NHtmlParser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {
if (parseExpansionForms === void 0) { parseExpansionForms = false; }
if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
var parseResult = this._htmlParser.parse(source, url, parseExpansionForms, interpolationConfig);
if (parseResult.errors.length) {
return new ParseTreeResult(parseResult.rootNodes, parseResult.errors);
}
return mergeTranslations(parseResult.rootNodes, this._translationBundle, interpolationConfig, [], {});
};
return I18NHtmlParser;
}());
function createSerializer(format) {
format = (format || 'xlf').toLowerCase();
switch (format) {
case 'xmb':
return new Xmb();
case 'xtb':
return new Xtb();
case 'xliff2':
case 'xlf2':
return new Xliff2();
case 'xliff':
case 'xlf':
default:
return new Xliff();
}
}
/**
* @license
* Copyright Google Inc. 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 CORE = '@angular/core';
var Identifiers = /** @class */ (function () {
function Identifiers() {
}
Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS = {
name: 'ANALYZE_FOR_ENTRY_COMPONENTS',
moduleName: CORE,
};
Identifiers.ElementRef = { name: 'ElementRef', moduleName: CORE };
Identifiers.NgModuleRef = { name: 'NgModuleRef', moduleName: CORE };
Identifiers.ViewContainerRef = { name: 'ViewContainerRef', moduleName: CORE };
Identifiers.ChangeDetectorRef = {
name: 'ChangeDetectorRef',
moduleName: CORE,
};
Identifiers.QueryList = { name: 'QueryList', moduleName: CORE };
Identifiers.TemplateRef = { name: 'TemplateRef', moduleName: CORE };
Identifiers.CodegenComponentFactoryResolver = {
name: 'ɵCodegenComponentFactoryResolver',
moduleName: CORE,
};
Identifiers.ComponentFactoryResolver = {
name: 'ComponentFactoryResolver',
moduleName: CORE,
};
Identifiers.ComponentFactory = { name: 'ComponentFactory', moduleName: CORE };
Identifiers.ComponentRef = { name: 'ComponentRef', moduleName: CORE };
Identifiers.NgModuleFactory = { name: 'NgModuleFactory', moduleName: CORE };
Identifiers.createModuleFactory = {
name: 'ɵcmf',
moduleName: CORE,
};
Identifiers.moduleDef = {
name: 'ɵmod',
moduleName: CORE,
};
Identifiers.moduleProviderDef = {
name: 'ɵmpd',
moduleName: CORE,
};
Identifiers.RegisterModuleFactoryFn = {
name: 'ɵregisterModuleFactory',
moduleName: CORE,
};
Identifiers.inject = { name: 'inject', moduleName: CORE };
Identifiers.INJECTOR = { name: 'INJECTOR', moduleName: CORE };
Identifiers.Injector = { name: 'Injector', moduleName: CORE };
Identifiers.defineInjectable = { name: 'defineInjectable', moduleName: CORE };
Identifiers.ViewEncapsulation = {
name: 'ViewEncapsulation',
moduleName: CORE,
};
Identifiers.ChangeDetectionStrategy = {
name: 'ChangeDetectionStrategy',
moduleName: CORE,
};
Identifiers.SecurityContext = {
name: 'SecurityContext',
moduleName: CORE,
};
Identifiers.LOCALE_ID = { name: 'LOCALE_ID', moduleName: CORE };
Identifiers.TRANSLATIONS_FORMAT = {
name: 'TRANSLATIONS_FORMAT',
moduleName: CORE,
};
Identifiers.inlineInterpolate = {
name: 'ɵinlineInterpolate',
moduleName: CORE,
};
Identifiers.interpolate = { name: 'ɵinterpolate', moduleName: CORE };
Identifiers.EMPTY_ARRAY = { name: 'ɵEMPTY_ARRAY', moduleName: CORE };
Identifiers.EMPTY_MAP = { name: 'ɵEMPTY_MAP', moduleName: CORE };
Identifiers.Renderer = { name: 'Renderer', moduleName: CORE };
Identifiers.viewDef = { name: 'ɵvid', moduleName: CORE };
Identifiers.elementDef = { name: 'ɵeld', moduleName: CORE };
Identifiers.anchorDef = { name: 'ɵand', moduleName: CORE };
Identifiers.textDef = { name: 'ɵted', moduleName: CORE };
Identifiers.directiveDef = { name: 'ɵdid', moduleName: CORE };
Identifiers.providerDef = { name: 'ɵprd', moduleName: CORE };
Identifiers.queryDef = { name: 'ɵqud', moduleName: CORE };
Identifiers.pureArrayDef = { name: 'ɵpad', moduleName: CORE };
Identifiers.pureObjectDef = { name: 'ɵpod', moduleName: CORE };
Identifiers.purePipeDef = { name: 'ɵppd', moduleName: CORE };
Identifiers.pipeDef = { name: 'ɵpid', moduleName: CORE };
Identifiers.nodeValue = { name: 'ɵnov', moduleName: CORE };
Identifiers.ngContentDef = { name: 'ɵncd', moduleName: CORE };
Identifiers.unwrapValue = { name: 'ɵunv', moduleName: CORE };
Identifiers.createRendererType2 = { name: 'ɵcrt', moduleName: CORE };
// type only
Identifiers.RendererType2 = {
name: 'RendererType2',
moduleName: CORE,
};
// type only
Identifiers.ViewDefinition = {
name: 'ɵViewDefinition',
moduleName: CORE,
};
Identifiers.createComponentFactory = { name: 'ɵccf', moduleName: CORE };
return Identifiers;
}());
function createTokenForReference(reference) {
return { identifier: { reference: reference } };
}
function createTokenForExternalReference(reflector, reference) {
return createTokenForReference(reflector.resolveExternalReference(reference));
}
/**
* @license
* Copyright Google Inc. 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
*/
//// Types
var TypeModifier;
(function (TypeModifier) {
TypeModifier[TypeModifier["Const"] = 0] = "Const";
})(TypeModifier || (TypeModifier = {}));
var Type$1 = /** @class */ (function () {
function Type(modifiers) {
if (modifiers === void 0) { modifiers = null; }
this.modifiers = modifiers;
if (!modifiers) {
this.modifiers = [];
}
}
Type.prototype.hasModifier = function (modifier) { return this.modifiers.indexOf(modifier) !== -1; };
return Type;
}());
var BuiltinTypeName;
(function (BuiltinTypeName) {
BuiltinTypeName[BuiltinTypeName["Dynamic"] = 0] = "Dynamic";
BuiltinTypeName[BuiltinTypeName["Bool"] = 1] = "Bool";
BuiltinTypeName[BuiltinTypeName["String"] = 2] = "String";
BuiltinTypeName[BuiltinTypeName["Int"] = 3] = "Int";
BuiltinTypeName[BuiltinTypeName["Number"] = 4] = "Number";
BuiltinTypeName[BuiltinTypeName["Function"] = 5] = "Function";
BuiltinTypeName[BuiltinTypeName["Inferred"] = 6] = "Inferred";
})(BuiltinTypeName || (BuiltinTypeName = {}));
var BuiltinType = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BuiltinType, _super);
function BuiltinType(name, modifiers) {
if (modifiers === void 0) { modifiers = null; }
var _this = _super.call(this, modifiers) || this;
_this.name = name;
return _this;
}
BuiltinType.prototype.visitType = function (visitor, context) {
return visitor.visitBuiltinType(this, context);
};
return BuiltinType;
}(Type$1));
var ExpressionType = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ExpressionType, _super);
function ExpressionType(value, modifiers) {
if (modifiers === void 0) { modifiers = null; }
var _this = _super.call(this, modifiers) || this;
_this.value = value;
return _this;
}
ExpressionType.prototype.visitType = function (visitor, context) {
return visitor.visitExpressionType(this, context);
};
return ExpressionType;
}(Type$1));
var ArrayType = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ArrayType, _super);
function ArrayType(of, modifiers) {
if (modifiers === void 0) { modifiers = null; }
var _this = _super.call(this, modifiers) || this;
_this.of = of;
return _this;
}
ArrayType.prototype.visitType = function (visitor, context) {
return visitor.visitArrayType(this, context);
};
return ArrayType;
}(Type$1));
var MapType = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MapType, _super);
function MapType(valueType, modifiers) {
if (modifiers === void 0) { modifiers = null; }
var _this = _super.call(this, modifiers) || this;
_this.valueType = valueType || null;
return _this;
}
MapType.prototype.visitType = function (visitor, context) { return visitor.visitMapType(this, context); };
return MapType;
}(Type$1));
var DYNAMIC_TYPE = new BuiltinType(BuiltinTypeName.Dynamic);
var INFERRED_TYPE = new BuiltinType(BuiltinTypeName.Inferred);
var BOOL_TYPE = new BuiltinType(BuiltinTypeName.Bool);
var INT_TYPE = new BuiltinType(BuiltinTypeName.Int);
var NUMBER_TYPE = new BuiltinType(BuiltinTypeName.Number);
var STRING_TYPE = new BuiltinType(BuiltinTypeName.String);
var FUNCTION_TYPE = new BuiltinType(BuiltinTypeName.Function);
///// Expressions
var BinaryOperator;
(function (BinaryOperator) {
BinaryOperator[BinaryOperator["Equals"] = 0] = "Equals";
BinaryOperator[BinaryOperator["NotEquals"] = 1] = "NotEquals";
BinaryOperator[BinaryOperator["Identical"] = 2] = "Identical";
BinaryOperator[BinaryOperator["NotIdentical"] = 3] = "NotIdentical";
BinaryOperator[BinaryOperator["Minus"] = 4] = "Minus";
BinaryOperator[BinaryOperator["Plus"] = 5] = "Plus";
BinaryOperator[BinaryOperator["Divide"] = 6] = "Divide";
BinaryOperator[BinaryOperator["Multiply"] = 7] = "Multiply";
BinaryOperator[BinaryOperator["Modulo"] = 8] = "Modulo";
BinaryOperator[BinaryOperator["And"] = 9] = "And";
BinaryOperator[BinaryOperator["Or"] = 10] = "Or";
BinaryOperator[BinaryOperator["BitwiseAnd"] = 11] = "BitwiseAnd";
BinaryOperator[BinaryOperator["Lower"] = 12] = "Lower";
BinaryOperator[BinaryOperator["LowerEquals"] = 13] = "LowerEquals";
BinaryOperator[BinaryOperator["Bigger"] = 14] = "Bigger";
BinaryOperator[BinaryOperator["BiggerEquals"] = 15] = "BiggerEquals";
})(BinaryOperator || (BinaryOperator = {}));
function nullSafeIsEquivalent(base, other) {
if (base == null || other == null) {
return base == other;
}
return base.isEquivalent(other);
}
function areAllEquivalent(base, other) {
var len = base.length;
if (len !== other.length) {
return false;
}
for (var i = 0; i < len; i++) {
if (!base[i].isEquivalent(other[i])) {
return false;
}
}
return true;
}
var Expression = /** @class */ (function () {
function Expression(type, sourceSpan) {
this.type = type || null;
this.sourceSpan = sourceSpan || null;
}
Expression.prototype.prop = function (name, sourceSpan) {
return new ReadPropExpr(this, name, null, sourceSpan);
};
Expression.prototype.key = function (index, type, sourceSpan) {
return new ReadKeyExpr(this, index, type, sourceSpan);
};
Expression.prototype.callMethod = function (name, params, sourceSpan) {
return new InvokeMethodExpr(this, name, params, null, sourceSpan);
};
Expression.prototype.callFn = function (params, sourceSpan) {
return new InvokeFunctionExpr(this, params, null, sourceSpan);
};
Expression.prototype.instantiate = function (params, type, sourceSpan) {
return new InstantiateExpr(this, params, type, sourceSpan);
};
Expression.prototype.conditional = function (trueCase, falseCase, sourceSpan) {
if (falseCase === void 0) { falseCase = null; }
return new ConditionalExpr(this, trueCase, falseCase, null, sourceSpan);
};
Expression.prototype.equals = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Equals, this, rhs, null, sourceSpan);
};
Expression.prototype.notEquals = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.NotEquals, this, rhs, null, sourceSpan);
};
Expression.prototype.identical = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Identical, this, rhs, null, sourceSpan);
};
Expression.prototype.notIdentical = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.NotIdentical, this, rhs, null, sourceSpan);
};
Expression.prototype.minus = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Minus, this, rhs, null, sourceSpan);
};
Expression.prototype.plus = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Plus, this, rhs, null, sourceSpan);
};
Expression.prototype.divide = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Divide, this, rhs, null, sourceSpan);
};
Expression.prototype.multiply = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Multiply, this, rhs, null, sourceSpan);
};
Expression.prototype.modulo = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Modulo, this, rhs, null, sourceSpan);
};
Expression.prototype.and = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.And, this, rhs, null, sourceSpan);
};
Expression.prototype.bitwiseAnd = function (rhs, sourceSpan, parens) {
if (parens === void 0) { parens = true; }
return new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, this, rhs, null, sourceSpan, parens);
};
Expression.prototype.or = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Or, this, rhs, null, sourceSpan);
};
Expression.prototype.lower = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Lower, this, rhs, null, sourceSpan);
};
Expression.prototype.lowerEquals = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.LowerEquals, this, rhs, null, sourceSpan);
};
Expression.prototype.bigger = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Bigger, this, rhs, null, sourceSpan);
};
Expression.prototype.biggerEquals = function (rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.BiggerEquals, this, rhs, null, sourceSpan);
};
Expression.prototype.isBlank = function (sourceSpan) {
// Note: We use equals by purpose here to compare to null and undefined in JS.
// We use the typed null to allow strictNullChecks to narrow types.
return this.equals(TYPED_NULL_EXPR, sourceSpan);
};
Expression.prototype.cast = function (type, sourceSpan) {
return new CastExpr(this, type, sourceSpan);
};
Expression.prototype.toStmt = function () { return new ExpressionStatement(this, null); };
return Expression;
}());
var BuiltinVar;
(function (BuiltinVar) {
BuiltinVar[BuiltinVar["This"] = 0] = "This";
BuiltinVar[BuiltinVar["Super"] = 1] = "Super";
BuiltinVar[BuiltinVar["CatchError"] = 2] = "CatchError";
BuiltinVar[BuiltinVar["CatchStack"] = 3] = "CatchStack";
})(BuiltinVar || (BuiltinVar = {}));
var ReadVarExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ReadVarExpr, _super);
function ReadVarExpr(name, type, sourceSpan) {
var _this = _super.call(this, type, sourceSpan) || this;
if (typeof name === 'string') {
_this.name = name;
_this.builtin = null;
}
else {
_this.name = null;
_this.builtin = name;
}
return _this;
}
ReadVarExpr.prototype.isEquivalent = function (e) {
return e instanceof ReadVarExpr && this.name === e.name && this.builtin === e.builtin;
};
ReadVarExpr.prototype.isConstant = function () { return false; };
ReadVarExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitReadVarExpr(this, context);
};
ReadVarExpr.prototype.set = function (value) {
if (!this.name) {
throw new Error("Built in variable " + this.builtin + " can not be assigned to.");
}
return new WriteVarExpr(this.name, value, null, this.sourceSpan);
};
return ReadVarExpr;
}(Expression));
var WriteVarExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(WriteVarExpr, _super);
function WriteVarExpr(name, value, type, sourceSpan) {
var _this = _super.call(this, type || value.type, sourceSpan) || this;
_this.name = name;
_this.value = value;
return _this;
}
WriteVarExpr.prototype.isEquivalent = function (e) {
return e instanceof WriteVarExpr && this.name === e.name && this.value.isEquivalent(e.value);
};
WriteVarExpr.prototype.isConstant = function () { return false; };
WriteVarExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitWriteVarExpr(this, context);
};
WriteVarExpr.prototype.toDeclStmt = function (type, modifiers) {
return new DeclareVarStmt(this.name, this.value, type, modifiers, this.sourceSpan);
};
return WriteVarExpr;
}(Expression));
var WriteKeyExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(WriteKeyExpr, _super);
function WriteKeyExpr(receiver, index, value, type, sourceSpan) {
var _this = _super.call(this, type || value.type, sourceSpan) || this;
_this.receiver = receiver;
_this.index = index;
_this.value = value;
return _this;
}
WriteKeyExpr.prototype.isEquivalent = function (e) {
return e instanceof WriteKeyExpr && this.receiver.isEquivalent(e.receiver) &&
this.index.isEquivalent(e.index) && this.value.isEquivalent(e.value);
};
WriteKeyExpr.prototype.isConstant = function () { return false; };
WriteKeyExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitWriteKeyExpr(this, context);
};
return WriteKeyExpr;
}(Expression));
var WritePropExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(WritePropExpr, _super);
function WritePropExpr(receiver, name, value, type, sourceSpan) {
var _this = _super.call(this, type || value.type, sourceSpan) || this;
_this.receiver = receiver;
_this.name = name;
_this.value = value;
return _this;
}
WritePropExpr.prototype.isEquivalent = function (e) {
return e instanceof WritePropExpr && this.receiver.isEquivalent(e.receiver) &&
this.name === e.name && this.value.isEquivalent(e.value);
};
WritePropExpr.prototype.isConstant = function () { return false; };
WritePropExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitWritePropExpr(this, context);
};
return WritePropExpr;
}(Expression));
var BuiltinMethod;
(function (BuiltinMethod) {
BuiltinMethod[BuiltinMethod["ConcatArray"] = 0] = "ConcatArray";
BuiltinMethod[BuiltinMethod["SubscribeObservable"] = 1] = "SubscribeObservable";
BuiltinMethod[BuiltinMethod["Bind"] = 2] = "Bind";
})(BuiltinMethod || (BuiltinMethod = {}));
var InvokeMethodExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(InvokeMethodExpr, _super);
function InvokeMethodExpr(receiver, method, args, type, sourceSpan) {
var _this = _super.call(this, type, sourceSpan) || this;
_this.receiver = receiver;
_this.args = args;
if (typeof method === 'string') {
_this.name = method;
_this.builtin = null;
}
else {
_this.name = null;
_this.builtin = method;
}
return _this;
}
InvokeMethodExpr.prototype.isEquivalent = function (e) {
return e instanceof InvokeMethodExpr && this.receiver.isEquivalent(e.receiver) &&
this.name === e.name && this.builtin === e.builtin && areAllEquivalent(this.args, e.args);
};
InvokeMethodExpr.prototype.isConstant = function () { return false; };
InvokeMethodExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitInvokeMethodExpr(this, context);
};
return InvokeMethodExpr;
}(Expression));
var InvokeFunctionExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(InvokeFunctionExpr, _super);
function InvokeFunctionExpr(fn, args, type, sourceSpan) {
var _this = _super.call(this, type, sourceSpan) || this;
_this.fn = fn;
_this.args = args;
return _this;
}
InvokeFunctionExpr.prototype.isEquivalent = function (e) {
return e instanceof InvokeFunctionExpr && this.fn.isEquivalent(e.fn) &&
areAllEquivalent(this.args, e.args);
};
InvokeFunctionExpr.prototype.isConstant = function () { return false; };
InvokeFunctionExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitInvokeFunctionExpr(this, context);
};
return InvokeFunctionExpr;
}(Expression));
var InstantiateExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(InstantiateExpr, _super);
function InstantiateExpr(classExpr, args, type, sourceSpan) {
var _this = _super.call(this, type, sourceSpan) || this;
_this.classExpr = classExpr;
_this.args = args;
return _this;
}
InstantiateExpr.prototype.isEquivalent = function (e) {
return e instanceof InstantiateExpr && this.classExpr.isEquivalent(e.classExpr) &&
areAllEquivalent(this.args, e.args);
};
InstantiateExpr.prototype.isConstant = function () { return false; };
InstantiateExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitInstantiateExpr(this, context);
};
return InstantiateExpr;
}(Expression));
var LiteralExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LiteralExpr, _super);
function LiteralExpr(value, type, sourceSpan) {
var _this = _super.call(this, type, sourceSpan) || this;
_this.value = value;
return _this;
}
LiteralExpr.prototype.isEquivalent = function (e) {
return e instanceof LiteralExpr && this.value === e.value;
};
LiteralExpr.prototype.isConstant = function () { return true; };
LiteralExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitLiteralExpr(this, context);
};
return LiteralExpr;
}(Expression));
var ExternalExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ExternalExpr, _super);
function ExternalExpr(value, type, typeParams, sourceSpan) {
if (typeParams === void 0) { typeParams = null; }
var _this = _super.call(this, type, sourceSpan) || this;
_this.value = value;
_this.typeParams = typeParams;
return _this;
}
ExternalExpr.prototype.isEquivalent = function (e) {
return e instanceof ExternalExpr && this.value.name === e.value.name &&
this.value.moduleName === e.value.moduleName && this.value.runtime === e.value.runtime;
};
ExternalExpr.prototype.isConstant = function () { return false; };
ExternalExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitExternalExpr(this, context);
};
return ExternalExpr;
}(Expression));
var ExternalReference = /** @class */ (function () {
function ExternalReference(moduleName, name, runtime) {
this.moduleName = moduleName;
this.name = name;
this.runtime = runtime;
}
return ExternalReference;
}());
var ConditionalExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ConditionalExpr, _super);
function ConditionalExpr(condition, trueCase, falseCase, type, sourceSpan) {
if (falseCase === void 0) { falseCase = null; }
var _this = _super.call(this, type || trueCase.type, sourceSpan) || this;
_this.condition = condition;
_this.falseCase = falseCase;
_this.trueCase = trueCase;
return _this;
}
ConditionalExpr.prototype.isEquivalent = function (e) {
return e instanceof ConditionalExpr && this.condition.isEquivalent(e.condition) &&
this.trueCase.isEquivalent(e.trueCase) && nullSafeIsEquivalent(this.falseCase, e.falseCase);
};
ConditionalExpr.prototype.isConstant = function () { return false; };
ConditionalExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitConditionalExpr(this, context);
};
return ConditionalExpr;
}(Expression));
var NotExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NotExpr, _super);
function NotExpr(condition, sourceSpan) {
var _this = _super.call(this, BOOL_TYPE, sourceSpan) || this;
_this.condition = condition;
return _this;
}
NotExpr.prototype.isEquivalent = function (e) {
return e instanceof NotExpr && this.condition.isEquivalent(e.condition);
};
NotExpr.prototype.isConstant = function () { return false; };
NotExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitNotExpr(this, context);
};
return NotExpr;
}(Expression));
var AssertNotNull = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(AssertNotNull, _super);
function AssertNotNull(condition, sourceSpan) {
var _this = _super.call(this, condition.type, sourceSpan) || this;
_this.condition = condition;
return _this;
}
AssertNotNull.prototype.isEquivalent = function (e) {
return e instanceof AssertNotNull && this.condition.isEquivalent(e.condition);
};
AssertNotNull.prototype.isConstant = function () { return false; };
AssertNotNull.prototype.visitExpression = function (visitor, context) {
return visitor.visitAssertNotNullExpr(this, context);
};
return AssertNotNull;
}(Expression));
var CastExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CastExpr, _super);
function CastExpr(value, type, sourceSpan) {
var _this = _super.call(this, type, sourceSpan) || this;
_this.value = value;
return _this;
}
CastExpr.prototype.isEquivalent = function (e) {
return e instanceof CastExpr && this.value.isEquivalent(e.value);
};
CastExpr.prototype.isConstant = function () { return false; };
CastExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitCastExpr(this, context);
};
return CastExpr;
}(Expression));
var FnParam = /** @class */ (function () {
function FnParam(name, type) {
if (type === void 0) { type = null; }
this.name = name;
this.type = type;
}
FnParam.prototype.isEquivalent = function (param) { return this.name === param.name; };
return FnParam;
}());
var FunctionExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FunctionExpr, _super);
function FunctionExpr(params, statements, type, sourceSpan, name) {
var _this = _super.call(this, type, sourceSpan) || this;
_this.params = params;
_this.statements = statements;
_this.name = name;
return _this;
}
FunctionExpr.prototype.isEquivalent = function (e) {
return e instanceof FunctionExpr && areAllEquivalent(this.params, e.params) &&
areAllEquivalent(this.statements, e.statements);
};
FunctionExpr.prototype.isConstant = function () { return false; };
FunctionExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitFunctionExpr(this, context);
};
FunctionExpr.prototype.toDeclStmt = function (name, modifiers) {
if (modifiers === void 0) { modifiers = null; }
return new DeclareFunctionStmt(name, this.params, this.statements, this.type, modifiers, this.sourceSpan);
};
return FunctionExpr;
}(Expression));
var BinaryOperatorExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BinaryOperatorExpr, _super);
function BinaryOperatorExpr(operator, lhs, rhs, type, sourceSpan, parens) {
if (parens === void 0) { parens = true; }
var _this = _super.call(this, type || lhs.type, sourceSpan) || this;
_this.operator = operator;
_this.rhs = rhs;
_this.parens = parens;
_this.lhs = lhs;
return _this;
}
BinaryOperatorExpr.prototype.isEquivalent = function (e) {
return e instanceof BinaryOperatorExpr && this.operator === e.operator &&
this.lhs.isEquivalent(e.lhs) && this.rhs.isEquivalent(e.rhs);
};
BinaryOperatorExpr.prototype.isConstant = function () { return false; };
BinaryOperatorExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitBinaryOperatorExpr(this, context);
};
return BinaryOperatorExpr;
}(Expression));
var ReadPropExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ReadPropExpr, _super);
function ReadPropExpr(receiver, name, type, sourceSpan) {
var _this = _super.call(this, type, sourceSpan) || this;
_this.receiver = receiver;
_this.name = name;
return _this;
}
ReadPropExpr.prototype.isEquivalent = function (e) {
return e instanceof ReadPropExpr && this.receiver.isEquivalent(e.receiver) &&
this.name === e.name;
};
ReadPropExpr.prototype.isConstant = function () { return false; };
ReadPropExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitReadPropExpr(this, context);
};
ReadPropExpr.prototype.set = function (value) {
return new WritePropExpr(this.receiver, this.name, value, null, this.sourceSpan);
};
return ReadPropExpr;
}(Expression));
var ReadKeyExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ReadKeyExpr, _super);
function ReadKeyExpr(receiver, index, type, sourceSpan) {
var _this = _super.call(this, type, sourceSpan) || this;
_this.receiver = receiver;
_this.index = index;
return _this;
}
ReadKeyExpr.prototype.isEquivalent = function (e) {
return e instanceof ReadKeyExpr && this.receiver.isEquivalent(e.receiver) &&
this.index.isEquivalent(e.index);
};
ReadKeyExpr.prototype.isConstant = function () { return false; };
ReadKeyExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitReadKeyExpr(this, context);
};
ReadKeyExpr.prototype.set = function (value) {
return new WriteKeyExpr(this.receiver, this.index, value, null, this.sourceSpan);
};
return ReadKeyExpr;
}(Expression));
var LiteralArrayExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LiteralArrayExpr, _super);
function LiteralArrayExpr(entries, type, sourceSpan) {
var _this = _super.call(this, type, sourceSpan) || this;
_this.entries = entries;
return _this;
}
LiteralArrayExpr.prototype.isConstant = function () { return this.entries.every(function (e) { return e.isConstant(); }); };
LiteralArrayExpr.prototype.isEquivalent = function (e) {
return e instanceof LiteralArrayExpr && areAllEquivalent(this.entries, e.entries);
};
LiteralArrayExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitLiteralArrayExpr(this, context);
};
return LiteralArrayExpr;
}(Expression));
var LiteralMapEntry = /** @class */ (function () {
function LiteralMapEntry(key, value, quoted) {
this.key = key;
this.value = value;
this.quoted = quoted;
}
LiteralMapEntry.prototype.isEquivalent = function (e) {
return this.key === e.key && this.value.isEquivalent(e.value);
};
return LiteralMapEntry;
}());
var LiteralMapExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LiteralMapExpr, _super);
function LiteralMapExpr(entries, type, sourceSpan) {
var _this = _super.call(this, type, sourceSpan) || this;
_this.entries = entries;
_this.valueType = null;
if (type) {
_this.valueType = type.valueType;
}
return _this;
}
LiteralMapExpr.prototype.isEquivalent = function (e) {
return e instanceof LiteralMapExpr && areAllEquivalent(this.entries, e.entries);
};
LiteralMapExpr.prototype.isConstant = function () { return this.entries.every(function (e) { return e.value.isConstant(); }); };
LiteralMapExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitLiteralMapExpr(this, context);
};
return LiteralMapExpr;
}(Expression));
var CommaExpr = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CommaExpr, _super);
function CommaExpr(parts, sourceSpan) {
var _this = _super.call(this, parts[parts.length - 1].type, sourceSpan) || this;
_this.parts = parts;
return _this;
}
CommaExpr.prototype.isEquivalent = function (e) {
return e instanceof CommaExpr && areAllEquivalent(this.parts, e.parts);
};
CommaExpr.prototype.isConstant = function () { return false; };
CommaExpr.prototype.visitExpression = function (visitor, context) {
return visitor.visitCommaExpr(this, context);
};
return CommaExpr;
}(Expression));
var THIS_EXPR = new ReadVarExpr(BuiltinVar.This, null, null);
var SUPER_EXPR = new ReadVarExpr(BuiltinVar.Super, null, null);
var CATCH_ERROR_VAR = new ReadVarExpr(BuiltinVar.CatchError, null, null);
var CATCH_STACK_VAR = new ReadVarExpr(BuiltinVar.CatchStack, null, null);
var NULL_EXPR = new LiteralExpr(null, null, null);
var TYPED_NULL_EXPR = new LiteralExpr(null, INFERRED_TYPE, null);
//// Statements
var StmtModifier;
(function (StmtModifier) {
StmtModifier[StmtModifier["Final"] = 0] = "Final";
StmtModifier[StmtModifier["Private"] = 1] = "Private";
StmtModifier[StmtModifier["Exported"] = 2] = "Exported";
StmtModifier[StmtModifier["Static"] = 3] = "Static";
})(StmtModifier || (StmtModifier = {}));
var Statement = /** @class */ (function () {
function Statement(modifiers, sourceSpan) {
this.modifiers = modifiers || [];
this.sourceSpan = sourceSpan || null;
}
Statement.prototype.hasModifier = function (modifier) { return this.modifiers.indexOf(modifier) !== -1; };
return Statement;
}());
var DeclareVarStmt = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(DeclareVarStmt, _super);
function DeclareVarStmt(name, value, type, modifiers, sourceSpan) {
if (modifiers === void 0) { modifiers = null; }
var _this = _super.call(this, modifiers, sourceSpan) || this;
_this.name = name;
_this.value = value;
_this.type = type || (value && value.type) || null;
return _this;
}
DeclareVarStmt.prototype.isEquivalent = function (stmt) {
return stmt instanceof DeclareVarStmt && this.name === stmt.name &&
(this.value ? !!stmt.value && this.value.isEquivalent(stmt.value) : !stmt.value);
};
DeclareVarStmt.prototype.visitStatement = function (visitor, context) {
return visitor.visitDeclareVarStmt(this, context);
};
return DeclareVarStmt;
}(Statement));
var DeclareFunctionStmt = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(DeclareFunctionStmt, _super);
function DeclareFunctionStmt(name, params, statements, type, modifiers, sourceSpan) {
if (modifiers === void 0) { modifiers = null; }
var _this = _super.call(this, modifiers, sourceSpan) || this;
_this.name = name;
_this.params = params;
_this.statements = statements;
_this.type = type || null;
return _this;
}
DeclareFunctionStmt.prototype.isEquivalent = function (stmt) {
return stmt instanceof DeclareFunctionStmt && areAllEquivalent(this.params, stmt.params) &&
areAllEquivalent(this.statements, stmt.statements);
};
DeclareFunctionStmt.prototype.visitStatement = function (visitor, context) {
return visitor.visitDeclareFunctionStmt(this, context);
};
return DeclareFunctionStmt;
}(Statement));
var ExpressionStatement = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ExpressionStatement, _super);
function ExpressionStatement(expr, sourceSpan) {
var _this = _super.call(this, null, sourceSpan) || this;
_this.expr = expr;
return _this;
}
ExpressionStatement.prototype.isEquivalent = function (stmt) {
return stmt instanceof ExpressionStatement && this.expr.isEquivalent(stmt.expr);
};
ExpressionStatement.prototype.visitStatement = function (visitor, context) {
return visitor.visitExpressionStmt(this, context);
};
return ExpressionStatement;
}(Statement));
var ReturnStatement = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ReturnStatement, _super);
function ReturnStatement(value, sourceSpan) {
var _this = _super.call(this, null, sourceSpan) || this;
_this.value = value;
return _this;
}
ReturnStatement.prototype.isEquivalent = function (stmt) {
return stmt instanceof ReturnStatement && this.value.isEquivalent(stmt.value);
};
ReturnStatement.prototype.visitStatement = function (visitor, context) {
return visitor.visitReturnStmt(this, context);
};
return ReturnStatement;
}(Statement));
var AbstractClassPart = /** @class */ (function () {
function AbstractClassPart(type, modifiers) {
this.modifiers = modifiers;
if (!modifiers) {
this.modifiers = [];
}
this.type = type || null;
}
AbstractClassPart.prototype.hasModifier = function (modifier) { return this.modifiers.indexOf(modifier) !== -1; };
return AbstractClassPart;
}());
var ClassField = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ClassField, _super);
function ClassField(name, type, modifiers, initializer) {
if (modifiers === void 0) { modifiers = null; }
var _this = _super.call(this, type, modifiers) || this;
_this.name = name;
_this.initializer = initializer;
return _this;
}
ClassField.prototype.isEquivalent = function (f) { return this.name === f.name; };
return ClassField;
}(AbstractClassPart));
var ClassMethod = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ClassMethod, _super);
function ClassMethod(name, params, body, type, modifiers) {
if (modifiers === void 0) { modifiers = null; }
var _this = _super.call(this, type, modifiers) || this;
_this.name = name;
_this.params = params;
_this.body = body;
return _this;
}
ClassMethod.prototype.isEquivalent = function (m) {
return this.name === m.name && areAllEquivalent(this.body, m.body);
};
return ClassMethod;
}(AbstractClassPart));
var ClassGetter = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ClassGetter, _super);
function ClassGetter(name, body, type, modifiers) {
if (modifiers === void 0) { modifiers = null; }
var _this = _super.call(this, type, modifiers) || this;
_this.name = name;
_this.body = body;
return _this;
}
ClassGetter.prototype.isEquivalent = function (m) {
return this.name === m.name && areAllEquivalent(this.body, m.body);
};
return ClassGetter;
}(AbstractClassPart));
var ClassStmt = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ClassStmt, _super);
function ClassStmt(name, parent, fields, getters, constructorMethod, methods, modifiers, sourceSpan) {
if (modifiers === void 0) { modifiers = null; }
var _this = _super.call(this, modifiers, sourceSpan) || this;
_this.name = name;
_this.parent = parent;
_this.fields = fields;
_this.getters = getters;
_this.constructorMethod = constructorMethod;
_this.methods = methods;
return _this;
}
ClassStmt.prototype.isEquivalent = function (stmt) {
return stmt instanceof ClassStmt && this.name === stmt.name &&
nullSafeIsEquivalent(this.parent, stmt.parent) &&
areAllEquivalent(this.fields, stmt.fields) &&
areAllEquivalent(this.getters, stmt.getters) &&
this.constructorMethod.isEquivalent(stmt.constructorMethod) &&
areAllEquivalent(this.methods, stmt.methods);
};
ClassStmt.prototype.visitStatement = function (visitor, context) {
return visitor.visitDeclareClassStmt(this, context);
};
return ClassStmt;
}(Statement));
var IfStmt = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(IfStmt, _super);
function IfStmt(condition, trueCase, falseCase, sourceSpan) {
if (falseCase === void 0) { falseCase = []; }
var _this = _super.call(this, null, sourceSpan) || this;
_this.condition = condition;
_this.trueCase = trueCase;
_this.falseCase = falseCase;
return _this;
}
IfStmt.prototype.isEquivalent = function (stmt) {
return stmt instanceof IfStmt && this.condition.isEquivalent(stmt.condition) &&
areAllEquivalent(this.trueCase, stmt.trueCase) &&
areAllEquivalent(this.falseCase, stmt.falseCase);
};
IfStmt.prototype.visitStatement = function (visitor, context) {
return visitor.visitIfStmt(this, context);
};
return IfStmt;
}(Statement));
var CommentStmt = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CommentStmt, _super);
function CommentStmt(comment, multiline, sourceSpan) {
if (multiline === void 0) { multiline = false; }
var _this = _super.call(this, null, sourceSpan) || this;
_this.comment = comment;
_this.multiline = multiline;
return _this;
}
CommentStmt.prototype.isEquivalent = function (stmt) { return stmt instanceof CommentStmt; };
CommentStmt.prototype.visitStatement = function (visitor, context) {
return visitor.visitCommentStmt(this, context);
};
return CommentStmt;
}(Statement));
var JSDocCommentStmt = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(JSDocCommentStmt, _super);
function JSDocCommentStmt(tags, sourceSpan) {
if (tags === void 0) { tags = []; }
var _this = _super.call(this, null, sourceSpan) || this;
_this.tags = tags;
return _this;
}
JSDocCommentStmt.prototype.isEquivalent = function (stmt) {
return stmt instanceof JSDocCommentStmt && this.toString() === stmt.toString();
};
JSDocCommentStmt.prototype.visitStatement = function (visitor, context) {
return visitor.visitJSDocCommentStmt(this, context);
};
JSDocCommentStmt.prototype.toString = function () { return serializeTags(this.tags); };
return JSDocCommentStmt;
}(Statement));
var TryCatchStmt = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TryCatchStmt, _super);
function TryCatchStmt(bodyStmts, catchStmts, sourceSpan) {
var _this = _super.call(this, null, sourceSpan) || this;
_this.bodyStmts = bodyStmts;
_this.catchStmts = catchStmts;
return _this;
}
TryCatchStmt.prototype.isEquivalent = function (stmt) {
return stmt instanceof TryCatchStmt && areAllEquivalent(this.bodyStmts, stmt.bodyStmts) &&
areAllEquivalent(this.catchStmts, stmt.catchStmts);
};
TryCatchStmt.prototype.visitStatement = function (visitor, context) {
return visitor.visitTryCatchStmt(this, context);
};
return TryCatchStmt;
}(Statement));
var ThrowStmt = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ThrowStmt, _super);
function ThrowStmt(error, sourceSpan) {
var _this = _super.call(this, null, sourceSpan) || this;
_this.error = error;
return _this;
}
ThrowStmt.prototype.isEquivalent = function (stmt) {
return stmt instanceof TryCatchStmt && this.error.isEquivalent(stmt.error);
};
ThrowStmt.prototype.visitStatement = function (visitor, context) {
return visitor.visitThrowStmt(this, context);
};
return ThrowStmt;
}(Statement));
var AstTransformer$1 = /** @class */ (function () {
function AstTransformer() {
}
AstTransformer.prototype.transformExpr = function (expr, context) { return expr; };
AstTransformer.prototype.transformStmt = function (stmt, context) { return stmt; };
AstTransformer.prototype.visitReadVarExpr = function (ast, context) { return this.transformExpr(ast, context); };
AstTransformer.prototype.visitWriteVarExpr = function (expr, context) {
return this.transformExpr(new WriteVarExpr(expr.name, expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);
};
AstTransformer.prototype.visitWriteKeyExpr = function (expr, context) {
return this.transformExpr(new WriteKeyExpr(expr.receiver.visitExpression(this, context), expr.index.visitExpression(this, context), expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);
};
AstTransformer.prototype.visitWritePropExpr = function (expr, context) {
return this.transformExpr(new WritePropExpr(expr.receiver.visitExpression(this, context), expr.name, expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);
};
AstTransformer.prototype.visitInvokeMethodExpr = function (ast, context) {
var method = ast.builtin || ast.name;
return this.transformExpr(new InvokeMethodExpr(ast.receiver.visitExpression(this, context), method, this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);
};
AstTransformer.prototype.visitInvokeFunctionExpr = function (ast, context) {
return this.transformExpr(new InvokeFunctionExpr(ast.fn.visitExpression(this, context), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);
};
AstTransformer.prototype.visitInstantiateExpr = function (ast, context) {
return this.transformExpr(new InstantiateExpr(ast.classExpr.visitExpression(this, context), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);
};
AstTransformer.prototype.visitLiteralExpr = function (ast, context) { return this.transformExpr(ast, context); };
AstTransformer.prototype.visitExternalExpr = function (ast, context) {
return this.transformExpr(ast, context);
};
AstTransformer.prototype.visitConditionalExpr = function (ast, context) {
return this.transformExpr(new ConditionalExpr(ast.condition.visitExpression(this, context), ast.trueCase.visitExpression(this, context), ast.falseCase.visitExpression(this, context), ast.type, ast.sourceSpan), context);
};
AstTransformer.prototype.visitNotExpr = function (ast, context) {
return this.transformExpr(new NotExpr(ast.condition.visitExpression(this, context), ast.sourceSpan), context);
};
AstTransformer.prototype.visitAssertNotNullExpr = function (ast, context) {
return this.transformExpr(new AssertNotNull(ast.condition.visitExpression(this, context), ast.sourceSpan), context);
};
AstTransformer.prototype.visitCastExpr = function (ast, context) {
return this.transformExpr(new CastExpr(ast.value.visitExpression(this, context), ast.type, ast.sourceSpan), context);
};
AstTransformer.prototype.visitFunctionExpr = function (ast, context) {
return this.transformExpr(new FunctionExpr(ast.params, this.visitAllStatements(ast.statements, context), ast.type, ast.sourceSpan), context);
};
AstTransformer.prototype.visitBinaryOperatorExpr = function (ast, context) {
return this.transformExpr(new BinaryOperatorExpr(ast.operator, ast.lhs.visitExpression(this, context), ast.rhs.visitExpression(this, context), ast.type, ast.sourceSpan), context);
};
AstTransformer.prototype.visitReadPropExpr = function (ast, context) {
return this.transformExpr(new ReadPropExpr(ast.receiver.visitExpression(this, context), ast.name, ast.type, ast.sourceSpan), context);
};
AstTransformer.prototype.visitReadKeyExpr = function (ast, context) {
return this.transformExpr(new ReadKeyExpr(ast.receiver.visitExpression(this, context), ast.index.visitExpression(this, context), ast.type, ast.sourceSpan), context);
};
AstTransformer.prototype.visitLiteralArrayExpr = function (ast, context) {
return this.transformExpr(new LiteralArrayExpr(this.visitAllExpressions(ast.entries, context), ast.type, ast.sourceSpan), context);
};
AstTransformer.prototype.visitLiteralMapExpr = function (ast, context) {
var _this = this;
var entries = ast.entries.map(function (entry) { return new LiteralMapEntry(entry.key, entry.value.visitExpression(_this, context), entry.quoted); });
var mapType = new MapType(ast.valueType, null);
return this.transformExpr(new LiteralMapExpr(entries, mapType, ast.sourceSpan), context);
};
AstTransformer.prototype.visitCommaExpr = function (ast, context) {
return this.transformExpr(new CommaExpr(this.visitAllExpressions(ast.parts, context), ast.sourceSpan), context);
};
AstTransformer.prototype.visitAllExpressions = function (exprs, context) {
var _this = this;
return exprs.map(function (expr) { return expr.visitExpression(_this, context); });
};
AstTransformer.prototype.visitDeclareVarStmt = function (stmt, context) {
var value = stmt.value && stmt.value.visitExpression(this, context);
return this.transformStmt(new DeclareVarStmt(stmt.name, value, stmt.type, stmt.modifiers, stmt.sourceSpan), context);
};
AstTransformer.prototype.visitDeclareFunctionStmt = function (stmt, context) {
return this.transformStmt(new DeclareFunctionStmt(stmt.name, stmt.params, this.visitAllStatements(stmt.statements, context), stmt.type, stmt.modifiers, stmt.sourceSpan), context);
};
AstTransformer.prototype.visitExpressionStmt = function (stmt, context) {
return this.transformStmt(new ExpressionStatement(stmt.expr.visitExpression(this, context), stmt.sourceSpan), context);
};
AstTransformer.prototype.visitReturnStmt = function (stmt, context) {
return this.transformStmt(new ReturnStatement(stmt.value.visitExpression(this, context), stmt.sourceSpan), context);
};
AstTransformer.prototype.visitDeclareClassStmt = function (stmt, context) {
var _this = this;
var parent = stmt.parent.visitExpression(this, context);
var getters = stmt.getters.map(function (getter) { return new ClassGetter(getter.name, _this.visitAllStatements(getter.body, context), getter.type, getter.modifiers); });
var ctorMethod = stmt.constructorMethod &&
new ClassMethod(stmt.constructorMethod.name, stmt.constructorMethod.params, this.visitAllStatements(stmt.constructorMethod.body, context), stmt.constructorMethod.type, stmt.constructorMethod.modifiers);
var methods = stmt.methods.map(function (method) { return new ClassMethod(method.name, method.params, _this.visitAllStatements(method.body, context), method.type, method.modifiers); });
return this.transformStmt(new ClassStmt(stmt.name, parent, stmt.fields, getters, ctorMethod, methods, stmt.modifiers, stmt.sourceSpan), context);
};
AstTransformer.prototype.visitIfStmt = function (stmt, context) {
return this.transformStmt(new IfStmt(stmt.condition.visitExpression(this, context), this.visitAllStatements(stmt.trueCase, context), this.visitAllStatements(stmt.falseCase, context), stmt.sourceSpan), context);
};
AstTransformer.prototype.visitTryCatchStmt = function (stmt, context) {
return this.transformStmt(new TryCatchStmt(this.visitAllStatements(stmt.bodyStmts, context), this.visitAllStatements(stmt.catchStmts, context), stmt.sourceSpan), context);
};
AstTransformer.prototype.visitThrowStmt = function (stmt, context) {
return this.transformStmt(new ThrowStmt(stmt.error.visitExpression(this, context), stmt.sourceSpan), context);
};
AstTransformer.prototype.visitCommentStmt = function (stmt, context) {
return this.transformStmt(stmt, context);
};
AstTransformer.prototype.visitJSDocCommentStmt = function (stmt, context) {
return this.transformStmt(stmt, context);
};
AstTransformer.prototype.visitAllStatements = function (stmts, context) {
var _this = this;
return stmts.map(function (stmt) { return stmt.visitStatement(_this, context); });
};
return AstTransformer;
}());
var RecursiveAstVisitor$1 = /** @class */ (function () {
function RecursiveAstVisitor() {
}
RecursiveAstVisitor.prototype.visitType = function (ast, context) { return ast; };
RecursiveAstVisitor.prototype.visitExpression = function (ast, context) {
if (ast.type) {
ast.type.visitType(this, context);
}
return ast;
};
RecursiveAstVisitor.prototype.visitBuiltinType = function (type, context) { return this.visitType(type, context); };
RecursiveAstVisitor.prototype.visitExpressionType = function (type, context) {
type.value.visitExpression(this, context);
return this.visitType(type, context);
};
RecursiveAstVisitor.prototype.visitArrayType = function (type, context) { return this.visitType(type, context); };
RecursiveAstVisitor.prototype.visitMapType = function (type, context) { return this.visitType(type, context); };
RecursiveAstVisitor.prototype.visitReadVarExpr = function (ast, context) {
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitWriteVarExpr = function (ast, context) {
ast.value.visitExpression(this, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitWriteKeyExpr = function (ast, context) {
ast.receiver.visitExpression(this, context);
ast.index.visitExpression(this, context);
ast.value.visitExpression(this, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitWritePropExpr = function (ast, context) {
ast.receiver.visitExpression(this, context);
ast.value.visitExpression(this, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitInvokeMethodExpr = function (ast, context) {
ast.receiver.visitExpression(this, context);
this.visitAllExpressions(ast.args, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitInvokeFunctionExpr = function (ast, context) {
ast.fn.visitExpression(this, context);
this.visitAllExpressions(ast.args, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitInstantiateExpr = function (ast, context) {
ast.classExpr.visitExpression(this, context);
this.visitAllExpressions(ast.args, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitLiteralExpr = function (ast, context) {
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitExternalExpr = function (ast, context) {
var _this = this;
if (ast.typeParams) {
ast.typeParams.forEach(function (type) { return type.visitType(_this, context); });
}
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitConditionalExpr = function (ast, context) {
ast.condition.visitExpression(this, context);
ast.trueCase.visitExpression(this, context);
ast.falseCase.visitExpression(this, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitNotExpr = function (ast, context) {
ast.condition.visitExpression(this, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitAssertNotNullExpr = function (ast, context) {
ast.condition.visitExpression(this, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitCastExpr = function (ast, context) {
ast.value.visitExpression(this, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitFunctionExpr = function (ast, context) {
this.visitAllStatements(ast.statements, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitBinaryOperatorExpr = function (ast, context) {
ast.lhs.visitExpression(this, context);
ast.rhs.visitExpression(this, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitReadPropExpr = function (ast, context) {
ast.receiver.visitExpression(this, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitReadKeyExpr = function (ast, context) {
ast.receiver.visitExpression(this, context);
ast.index.visitExpression(this, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitLiteralArrayExpr = function (ast, context) {
this.visitAllExpressions(ast.entries, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitLiteralMapExpr = function (ast, context) {
var _this = this;
ast.entries.forEach(function (entry) { return entry.value.visitExpression(_this, context); });
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitCommaExpr = function (ast, context) {
this.visitAllExpressions(ast.parts, context);
return this.visitExpression(ast, context);
};
RecursiveAstVisitor.prototype.visitAllExpressions = function (exprs, context) {
var _this = this;
exprs.forEach(function (expr) { return expr.visitExpression(_this, context); });
};
RecursiveAstVisitor.prototype.visitDeclareVarStmt = function (stmt, context) {
if (stmt.value) {
stmt.value.visitExpression(this, context);
}
if (stmt.type) {
stmt.type.visitType(this, context);
}
return stmt;
};
RecursiveAstVisitor.prototype.visitDeclareFunctionStmt = function (stmt, context) {
this.visitAllStatements(stmt.statements, context);
if (stmt.type) {
stmt.type.visitType(this, context);
}
return stmt;
};
RecursiveAstVisitor.prototype.visitExpressionStmt = function (stmt, context) {
stmt.expr.visitExpression(this, context);
return stmt;
};
RecursiveAstVisitor.prototype.visitReturnStmt = function (stmt, context) {
stmt.value.visitExpression(this, context);
return stmt;
};
RecursiveAstVisitor.prototype.visitDeclareClassStmt = function (stmt, context) {
var _this = this;
stmt.parent.visitExpression(this, context);
stmt.getters.forEach(function (getter) { return _this.visitAllStatements(getter.body, context); });
if (stmt.constructorMethod) {
this.visitAllStatements(stmt.constructorMethod.body, context);
}
stmt.methods.forEach(function (method) { return _this.visitAllStatements(method.body, context); });
return stmt;
};
RecursiveAstVisitor.prototype.visitIfStmt = function (stmt, context) {
stmt.condition.visitExpression(this, context);
this.visitAllStatements(stmt.trueCase, context);
this.visitAllStatements(stmt.falseCase, context);
return stmt;
};
RecursiveAstVisitor.prototype.visitTryCatchStmt = function (stmt, context) {
this.visitAllStatements(stmt.bodyStmts, context);
this.visitAllStatements(stmt.catchStmts, context);
return stmt;
};
RecursiveAstVisitor.prototype.visitThrowStmt = function (stmt, context) {
stmt.error.visitExpression(this, context);
return stmt;
};
RecursiveAstVisitor.prototype.visitCommentStmt = function (stmt, context) { return stmt; };
RecursiveAstVisitor.prototype.visitJSDocCommentStmt = function (stmt, context) { return stmt; };
RecursiveAstVisitor.prototype.visitAllStatements = function (stmts, context) {
var _this = this;
stmts.forEach(function (stmt) { return stmt.visitStatement(_this, context); });
};
return RecursiveAstVisitor;
}());
function findReadVarNames(stmts) {
var visitor = new _ReadVarVisitor();
visitor.visitAllStatements(stmts, null);
return visitor.varNames;
}
var _ReadVarVisitor = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(_ReadVarVisitor, _super);
function _ReadVarVisitor() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.varNames = new Set();
return _this;
}
_ReadVarVisitor.prototype.visitDeclareFunctionStmt = function (stmt, context) {
// Don't descend into nested functions
return stmt;
};
_ReadVarVisitor.prototype.visitDeclareClassStmt = function (stmt, context) {
// Don't descend into nested classes
return stmt;
};
_ReadVarVisitor.prototype.visitReadVarExpr = function (ast, context) {
if (ast.name) {
this.varNames.add(ast.name);
}
return null;
};
return _ReadVarVisitor;
}(RecursiveAstVisitor$1));
function collectExternalReferences(stmts) {
var visitor = new _FindExternalReferencesVisitor();
visitor.visitAllStatements(stmts, null);
return visitor.externalReferences;
}
var _FindExternalReferencesVisitor = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(_FindExternalReferencesVisitor, _super);
function _FindExternalReferencesVisitor() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.externalReferences = [];
return _this;
}
_FindExternalReferencesVisitor.prototype.visitExternalExpr = function (e, context) {
this.externalReferences.push(e.value);
return _super.prototype.visitExternalExpr.call(this, e, context);
};
return _FindExternalReferencesVisitor;
}(RecursiveAstVisitor$1));
function applySourceSpanToStatementIfNeeded(stmt, sourceSpan) {
if (!sourceSpan) {
return stmt;
}
var transformer = new _ApplySourceSpanTransformer(sourceSpan);
return stmt.visitStatement(transformer, null);
}
function applySourceSpanToExpressionIfNeeded(expr, sourceSpan) {
if (!sourceSpan) {
return expr;
}
var transformer = new _ApplySourceSpanTransformer(sourceSpan);
return expr.visitExpression(transformer, null);
}
var _ApplySourceSpanTransformer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(_ApplySourceSpanTransformer, _super);
function _ApplySourceSpanTransformer(sourceSpan) {
var _this = _super.call(this) || this;
_this.sourceSpan = sourceSpan;
return _this;
}
_ApplySourceSpanTransformer.prototype._clone = function (obj) {
var clone = Object.create(obj.constructor.prototype);
for (var prop in obj) {
clone[prop] = obj[prop];
}
return clone;
};
_ApplySourceSpanTransformer.prototype.transformExpr = function (expr, context) {
if (!expr.sourceSpan) {
expr = this._clone(expr);
expr.sourceSpan = this.sourceSpan;
}
return expr;
};
_ApplySourceSpanTransformer.prototype.transformStmt = function (stmt, context) {
if (!stmt.sourceSpan) {
stmt = this._clone(stmt);
stmt.sourceSpan = this.sourceSpan;
}
return stmt;
};
return _ApplySourceSpanTransformer;
}(AstTransformer$1));
function variable(name, type, sourceSpan) {
return new ReadVarExpr(name, type, sourceSpan);
}
function importExpr(id, typeParams, sourceSpan) {
if (typeParams === void 0) { typeParams = null; }
return new ExternalExpr(id, null, typeParams, sourceSpan);
}
function importType(id, typeParams, typeModifiers) {
if (typeParams === void 0) { typeParams = null; }
if (typeModifiers === void 0) { typeModifiers = null; }
return id != null ? expressionType(importExpr(id, typeParams, null), typeModifiers) : null;
}
function expressionType(expr, typeModifiers) {
if (typeModifiers === void 0) { typeModifiers = null; }
return new ExpressionType(expr, typeModifiers);
}
function literalArr(values, type, sourceSpan) {
return new LiteralArrayExpr(values, type, sourceSpan);
}
function literalMap(values, type) {
if (type === void 0) { type = null; }
return new LiteralMapExpr(values.map(function (e) { return new LiteralMapEntry(e.key, e.value, e.quoted); }), type, null);
}
function not(expr, sourceSpan) {
return new NotExpr(expr, sourceSpan);
}
function assertNotNull(expr, sourceSpan) {
return new AssertNotNull(expr, sourceSpan);
}
function fn(params, body, type, sourceSpan, name) {
return new FunctionExpr(params, body, type, sourceSpan, name);
}
function ifStmt(condition, thenClause, elseClause) {
return new IfStmt(condition, thenClause, elseClause);
}
function literal(value, type, sourceSpan) {
return new LiteralExpr(value, type, sourceSpan);
}
function isNull(exp) {
return exp instanceof LiteralExpr && exp.value === null;
}
/*
* Serializes a `Tag` into a string.
* Returns a string like " @foo {bar} baz" (note the leading whitespace before `@foo`).
*/
function tagToString(tag) {
var out = '';
if (tag.tagName) {
out += " @" + tag.tagName;
}
if (tag.text) {
if (tag.text.match(/\/\*|\*\//)) {
throw new Error('JSDoc text cannot contain "/*" and "*/"');
}
out += ' ' + tag.text.replace(/@/g, '\\@');
}
return out;
}
function serializeTags(tags) {
if (tags.length === 0)
return '';
var out = '*\n';
try {
for (var tags_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(tags), tags_1_1 = tags_1.next(); !tags_1_1.done; tags_1_1 = tags_1.next()) {
var tag = tags_1_1.value;
out += ' *';
// If the tagToString is multi-line, insert " * " prefixes on subsequent lines.
out += tagToString(tag).replace(/\n/g, '\n * ');
out += '\n';
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (tags_1_1 && !tags_1_1.done && (_a = tags_1.return)) _a.call(tags_1);
}
finally { if (e_1) throw e_1.error; }
}
out += ' ';
return out;
var e_1, _a;
}
/**
* @license
* Copyright Google Inc. 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 QUOTED_KEYS = '$quoted$';
function convertValueToOutputAst(ctx, value, type) {
if (type === void 0) { type = null; }
return visitValue(value, new _ValueOutputAstTransformer(ctx), type);
}
var _ValueOutputAstTransformer = /** @class */ (function () {
function _ValueOutputAstTransformer(ctx) {
this.ctx = ctx;
}
_ValueOutputAstTransformer.prototype.visitArray = function (arr, type) {
var _this = this;
return literalArr(arr.map(function (value) { return visitValue(value, _this, null); }), type);
};
_ValueOutputAstTransformer.prototype.visitStringMap = function (map, type) {
var _this = this;
var entries = [];
var quotedSet = new Set(map && map[QUOTED_KEYS]);
Object.keys(map).forEach(function (key) {
entries.push(new LiteralMapEntry(key, visitValue(map[key], _this, null), quotedSet.has(key)));
});
return new LiteralMapExpr(entries, type);
};
_ValueOutputAstTransformer.prototype.visitPrimitive = function (value, type) { return literal(value, type); };
_ValueOutputAstTransformer.prototype.visitOther = function (value, type) {
if (value instanceof Expression) {
return value;
}
else {
return this.ctx.importExpr(value);
}
};
return _ValueOutputAstTransformer;
}());
/**
* @license
* Copyright Google Inc. 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
*/
function mapEntry(key, value) {
return { key: key, value: value, quoted: false };
}
var InjectableCompiler = /** @class */ (function () {
function InjectableCompiler(reflector, alwaysGenerateDef) {
this.reflector = reflector;
this.alwaysGenerateDef = alwaysGenerateDef;
this.tokenInjector = reflector.resolveExternalReference(Identifiers.Injector);
}
InjectableCompiler.prototype.depsArray = function (deps, ctx) {
var _this = this;
return deps.map(function (dep) {
var token = dep;
var args = [token];
var flags = 0 /* Default */;
if (Array.isArray(dep)) {
for (var i = 0; i < dep.length; i++) {
var v = dep[i];
if (v) {
if (v.ngMetadataName === 'Optional') {
flags |= 8 /* Optional */;
}
else if (v.ngMetadataName === 'SkipSelf') {
flags |= 4 /* SkipSelf */;
}
else if (v.ngMetadataName === 'Self') {
flags |= 2 /* Self */;
}
else if (v.ngMetadataName === 'Inject') {
token = v.token;
}
else {
token = v;
}
}
}
}
var tokenExpr;
if (typeof token === 'string') {
tokenExpr = literal(token);
}
else if (token === _this.tokenInjector) {
tokenExpr = importExpr(Identifiers.INJECTOR);
}
else {
tokenExpr = ctx.importExpr(token);
}
if (flags !== 0 /* Default */) {
args = [tokenExpr, literal(flags)];
}
else {
args = [tokenExpr];
}
return importExpr(Identifiers.inject).callFn(args);
});
};
InjectableCompiler.prototype.factoryFor = function (injectable, ctx) {
var retValue;
if (injectable.useExisting) {
retValue = importExpr(Identifiers.inject).callFn([ctx.importExpr(injectable.useExisting)]);
}
else if (injectable.useFactory) {
var deps = injectable.deps || [];
if (deps.length > 0) {
retValue = ctx.importExpr(injectable.useFactory).callFn(this.depsArray(deps, ctx));
}
else {
return ctx.importExpr(injectable.useFactory);
}
}
else if (injectable.useValue) {
retValue = convertValueToOutputAst(ctx, injectable.useValue);
}
else {
var clazz = injectable.useClass || injectable.symbol;
var depArgs = this.depsArray(this.reflector.parameters(clazz), ctx);
retValue = new InstantiateExpr(ctx.importExpr(clazz), depArgs);
}
return fn([], [new ReturnStatement(retValue)], undefined, undefined, injectable.symbol.name + '_Factory');
};
InjectableCompiler.prototype.injectableDef = function (injectable, ctx) {
var providedIn = NULL_EXPR;
if (injectable.providedIn !== undefined) {
if (injectable.providedIn === null) {
providedIn = NULL_EXPR;
}
else if (typeof injectable.providedIn === 'string') {
providedIn = literal(injectable.providedIn);
}
else {
providedIn = ctx.importExpr(injectable.providedIn);
}
}
var def = [
mapEntry('factory', this.factoryFor(injectable, ctx)),
mapEntry('token', ctx.importExpr(injectable.type.reference)),
mapEntry('providedIn', providedIn),
];
return importExpr(Identifiers.defineInjectable).callFn([literalMap(def)]);
};
InjectableCompiler.prototype.compile = function (injectable, ctx) {
if (this.alwaysGenerateDef || injectable.providedIn !== undefined) {
var className = identifierName(injectable.type);
var clazz = new ClassStmt(className, null, [
new ClassField('ngInjectableDef', INFERRED_TYPE, [StmtModifier.Static], this.injectableDef(injectable, ctx)),
], [], new ClassMethod(null, [], []), []);
ctx.statements.push(clazz);
}
};
return InjectableCompiler;
}());
/**
* @license
* Copyright Google Inc. 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 STRIP_SRC_FILE_SUFFIXES = /(\.ts|\.d\.ts|\.js|\.jsx|\.tsx)$/;
var GENERATED_FILE = /\.ngfactory\.|\.ngsummary\./;
var JIT_SUMMARY_FILE = /\.ngsummary\./;
var JIT_SUMMARY_NAME = /NgSummary$/;
function ngfactoryFilePath(filePath, forceSourceFile) {
if (forceSourceFile === void 0) { forceSourceFile = false; }
var urlWithSuffix = splitTypescriptSuffix(filePath, forceSourceFile);
return urlWithSuffix[0] + ".ngfactory" + normalizeGenFileSuffix(urlWithSuffix[1]);
}
function stripGeneratedFileSuffix(filePath) {
return filePath.replace(GENERATED_FILE, '.');
}
function isGeneratedFile(filePath) {
return GENERATED_FILE.test(filePath);
}
function splitTypescriptSuffix(path, forceSourceFile) {
if (forceSourceFile === void 0) { forceSourceFile = false; }
if (path.endsWith('.d.ts')) {
return [path.slice(0, -5), forceSourceFile ? '.ts' : '.d.ts'];
}
var lastDot = path.lastIndexOf('.');
if (lastDot !== -1) {
return [path.substring(0, lastDot), path.substring(lastDot)];
}
return [path, ''];
}
function normalizeGenFileSuffix(srcFileSuffix) {
return srcFileSuffix === '.tsx' ? '.ts' : srcFileSuffix;
}
function summaryFileName(fileName) {
var fileNameWithoutSuffix = fileName.replace(STRIP_SRC_FILE_SUFFIXES, '');
return fileNameWithoutSuffix + ".ngsummary.json";
}
function summaryForJitFileName(fileName, forceSourceFile) {
if (forceSourceFile === void 0) { forceSourceFile = false; }
var urlWithSuffix = splitTypescriptSuffix(stripGeneratedFileSuffix(fileName), forceSourceFile);
return urlWithSuffix[0] + ".ngsummary" + urlWithSuffix[1];
}
function stripSummaryForJitFileSuffix(filePath) {
return filePath.replace(JIT_SUMMARY_FILE, '.');
}
function summaryForJitName(symbolName) {
return symbolName + "NgSummary";
}
function stripSummaryForJitNameSuffix(symbolName) {
return symbolName.replace(JIT_SUMMARY_NAME, '');
}
var LOWERED_SYMBOL = /\u0275\d+/;
function isLoweredSymbol(name) {
return LOWERED_SYMBOL.test(name);
}
function createLoweredSymbol(id) {
return "\u0275" + id;
}
/**
* @license
* Copyright Google Inc. 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 LifecycleHooks;
(function (LifecycleHooks) {
LifecycleHooks[LifecycleHooks["OnInit"] = 0] = "OnInit";
LifecycleHooks[LifecycleHooks["OnDestroy"] = 1] = "OnDestroy";
LifecycleHooks[LifecycleHooks["DoCheck"] = 2] = "DoCheck";
LifecycleHooks[LifecycleHooks["OnChanges"] = 3] = "OnChanges";
LifecycleHooks[LifecycleHooks["AfterContentInit"] = 4] = "AfterContentInit";
LifecycleHooks[LifecycleHooks["AfterContentChecked"] = 5] = "AfterContentChecked";
LifecycleHooks[LifecycleHooks["AfterViewInit"] = 6] = "AfterViewInit";
LifecycleHooks[LifecycleHooks["AfterViewChecked"] = 7] = "AfterViewChecked";
})(LifecycleHooks || (LifecycleHooks = {}));
var LIFECYCLE_HOOKS_VALUES = [
LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges,
LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit,
LifecycleHooks.AfterViewChecked
];
function hasLifecycleHook(reflector, hook, token) {
return reflector.hasLifecycleHook(token, getHookName(hook));
}
function getAllLifecycleHooks(reflector, token) {
return LIFECYCLE_HOOKS_VALUES.filter(function (hook) { return hasLifecycleHook(reflector, hook, token); });
}
function getHookName(hook) {
switch (hook) {
case LifecycleHooks.OnInit:
return 'ngOnInit';
case LifecycleHooks.OnDestroy:
return 'ngOnDestroy';
case LifecycleHooks.DoCheck:
return 'ngDoCheck';
case LifecycleHooks.OnChanges:
return 'ngOnChanges';
case LifecycleHooks.AfterContentInit:
return 'ngAfterContentInit';
case LifecycleHooks.AfterContentChecked:
return 'ngAfterContentChecked';
case LifecycleHooks.AfterViewInit:
return 'ngAfterViewInit';
case LifecycleHooks.AfterViewChecked:
return 'ngAfterViewChecked';
}
}
/**
* @license
* Copyright Google Inc. 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 _SELECTOR_REGEXP = new RegExp('(\\:not\\()|' + //":not("
'([-\\w]+)|' + // "tag"
'(?:\\.([-\\w]+))|' + // ".class"
// "-" should appear first in the regexp below as FF31 parses "[.-\w]" as a range
'(?:\\[([-.\\w*]+)(?:=([\"\']?)([^\\]\"\']*)\\5)?\\])|' + // "[name]", "[name=value]",
// "[name="value"]",
// "[name='value']"
'(\\))|' + // ")"
'(\\s*,\\s*)', // ","
'g');
/**
* A css selector contains an element name,
* css classes and attribute/value pairs with the purpose
* of selecting subsets out of them.
*/
var CssSelector = /** @class */ (function () {
function CssSelector() {
this.element = null;
this.classNames = [];
/**
* The selectors are encoded in pairs where:
* - even locations are attribute names
* - odd locations are attribute values.
*
* Example:
* Selector: `[key1=value1][key2]` would parse to:
* ```
* ['key1', 'value1', 'key2', '']
* ```
*/
this.attrs = [];
this.notSelectors = [];
}
CssSelector.parse = function (selector) {
var results = [];
var _addResult = function (res, cssSel) {
if (cssSel.notSelectors.length > 0 && !cssSel.element && cssSel.classNames.length == 0 &&
cssSel.attrs.length == 0) {
cssSel.element = '*';
}
res.push(cssSel);
};
var cssSelector = new CssSelector();
var match;
var current = cssSelector;
var inNot = false;
_SELECTOR_REGEXP.lastIndex = 0;
while (match = _SELECTOR_REGEXP.exec(selector)) {
if (match[1]) {
if (inNot) {
throw new Error('Nesting :not is not allowed in a selector');
}
inNot = true;
current = new CssSelector();
cssSelector.notSelectors.push(current);
}
if (match[2]) {
current.setElement(match[2]);
}
if (match[3]) {
current.addClassName(match[3]);
}
if (match[4]) {
current.addAttribute(match[4], match[6]);
}
if (match[7]) {
inNot = false;
current = cssSelector;
}
if (match[8]) {
if (inNot) {
throw new Error('Multiple selectors in :not are not supported');
}
_addResult(results, cssSelector);
cssSelector = current = new CssSelector();
}
}
_addResult(results, cssSelector);
return results;
};
CssSelector.prototype.isElementSelector = function () {
return this.hasElementSelector() && this.classNames.length == 0 && this.attrs.length == 0 &&
this.notSelectors.length === 0;
};
CssSelector.prototype.hasElementSelector = function () { return !!this.element; };
CssSelector.prototype.setElement = function (element) {
if (element === void 0) { element = null; }
this.element = element;
};
/** Gets a template string for an element that matches the selector. */
CssSelector.prototype.getMatchingElementTemplate = function () {
var tagName = this.element || 'div';
var classAttr = this.classNames.length > 0 ? " class=\"" + this.classNames.join(' ') + "\"" : '';
var attrs = '';
for (var i = 0; i < this.attrs.length; i += 2) {
var attrName = this.attrs[i];
var attrValue = this.attrs[i + 1] !== '' ? "=\"" + this.attrs[i + 1] + "\"" : '';
attrs += " " + attrName + attrValue;
}
return getHtmlTagDefinition(tagName).isVoid ? "<" + tagName + classAttr + attrs + "/>" :
"<" + tagName + classAttr + attrs + "></" + tagName + ">";
};
CssSelector.prototype.getAttrs = function () {
var result = [];
if (this.classNames.length > 0) {
result.push('class', this.classNames.join(' '));
}
return result.concat(this.attrs);
};
CssSelector.prototype.addAttribute = function (name, value) {
if (value === void 0) { value = ''; }
this.attrs.push(name, value && value.toLowerCase() || '');
};
CssSelector.prototype.addClassName = function (name) { this.classNames.push(name.toLowerCase()); };
CssSelector.prototype.toString = function () {
var res = this.element || '';
if (this.classNames) {
this.classNames.forEach(function (klass) { return res += "." + klass; });
}
if (this.attrs) {
for (var i = 0; i < this.attrs.length; i += 2) {
var name_1 = this.attrs[i];
var value = this.attrs[i + 1];
res += "[" + name_1 + (value ? '=' + value : '') + "]";
}
}
this.notSelectors.forEach(function (notSelector) { return res += ":not(" + notSelector + ")"; });
return res;
};
return CssSelector;
}());
/**
* Reads a list of CssSelectors and allows to calculate which ones
* are contained in a given CssSelector.
*/
var SelectorMatcher = /** @class */ (function () {
function SelectorMatcher() {
this._elementMap = new Map();
this._elementPartialMap = new Map();
this._classMap = new Map();
this._classPartialMap = new Map();
this._attrValueMap = new Map();
this._attrValuePartialMap = new Map();
this._listContexts = [];
}
SelectorMatcher.createNotMatcher = function (notSelectors) {
var notMatcher = new SelectorMatcher();
notMatcher.addSelectables(notSelectors, null);
return notMatcher;
};
SelectorMatcher.prototype.addSelectables = function (cssSelectors, callbackCtxt) {
var listContext = null;
if (cssSelectors.length > 1) {
listContext = new SelectorListContext(cssSelectors);
this._listContexts.push(listContext);
}
for (var i = 0; i < cssSelectors.length; i++) {
this._addSelectable(cssSelectors[i], callbackCtxt, listContext);
}
};
/**
* Add an object that can be found later on by calling `match`.
* @param cssSelector A css selector
* @param callbackCtxt An opaque object that will be given to the callback of the `match` function
*/
SelectorMatcher.prototype._addSelectable = function (cssSelector, callbackCtxt, listContext) {
var matcher = this;
var element = cssSelector.element;
var classNames = cssSelector.classNames;
var attrs = cssSelector.attrs;
var selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);
if (element) {
var isTerminal = attrs.length === 0 && classNames.length === 0;
if (isTerminal) {
this._addTerminal(matcher._elementMap, element, selectable);
}
else {
matcher = this._addPartial(matcher._elementPartialMap, element);
}
}
if (classNames) {
for (var i = 0; i < classNames.length; i++) {
var isTerminal = attrs.length === 0 && i === classNames.length - 1;
var className = classNames[i];
if (isTerminal) {
this._addTerminal(matcher._classMap, className, selectable);
}
else {
matcher = this._addPartial(matcher._classPartialMap, className);
}
}
}
if (attrs) {
for (var i = 0; i < attrs.length; i += 2) {
var isTerminal = i === attrs.length - 2;
var name_2 = attrs[i];
var value = attrs[i + 1];
if (isTerminal) {
var terminalMap = matcher._attrValueMap;
var terminalValuesMap = terminalMap.get(name_2);
if (!terminalValuesMap) {
terminalValuesMap = new Map();
terminalMap.set(name_2, terminalValuesMap);
}
this._addTerminal(terminalValuesMap, value, selectable);
}
else {
var partialMap = matcher._attrValuePartialMap;
var partialValuesMap = partialMap.get(name_2);
if (!partialValuesMap) {
partialValuesMap = new Map();
partialMap.set(name_2, partialValuesMap);
}
matcher = this._addPartial(partialValuesMap, value);
}
}
}
};
SelectorMatcher.prototype._addTerminal = function (map, name, selectable) {
var terminalList = map.get(name);
if (!terminalList) {
terminalList = [];
map.set(name, terminalList);
}
terminalList.push(selectable);
};
SelectorMatcher.prototype._addPartial = function (map, name) {
var matcher = map.get(name);
if (!matcher) {
matcher = new SelectorMatcher();
map.set(name, matcher);
}
return matcher;
};
/**
* Find the objects that have been added via `addSelectable`
* whose css selector is contained in the given css selector.
* @param cssSelector A css selector
* @param matchedCallback This callback will be called with the object handed into `addSelectable`
* @return boolean true if a match was found
*/
SelectorMatcher.prototype.match = function (cssSelector, matchedCallback) {
var result = false;
var element = cssSelector.element;
var classNames = cssSelector.classNames;
var attrs = cssSelector.attrs;
for (var i = 0; i < this._listContexts.length; i++) {
this._listContexts[i].alreadyMatched = false;
}
result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result;
result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) ||
result;
if (classNames) {
for (var i = 0; i < classNames.length; i++) {
var className = classNames[i];
result =
this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result;
result =
this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) ||
result;
}
}
if (attrs) {
for (var i = 0; i < attrs.length; i += 2) {
var name_3 = attrs[i];
var value = attrs[i + 1];
var terminalValuesMap = this._attrValueMap.get(name_3);
if (value) {
result =
this._matchTerminal(terminalValuesMap, '', cssSelector, matchedCallback) || result;
}
result =
this._matchTerminal(terminalValuesMap, value, cssSelector, matchedCallback) || result;
var partialValuesMap = this._attrValuePartialMap.get(name_3);
if (value) {
result = this._matchPartial(partialValuesMap, '', cssSelector, matchedCallback) || result;
}
result =
this._matchPartial(partialValuesMap, value, cssSelector, matchedCallback) || result;
}
}
return result;
};
/** @internal */
SelectorMatcher.prototype._matchTerminal = function (map, name, cssSelector, matchedCallback) {
if (!map || typeof name !== 'string') {
return false;
}
var selectables = map.get(name) || [];
var starSelectables = map.get('*');
if (starSelectables) {
selectables = selectables.concat(starSelectables);
}
if (selectables.length === 0) {
return false;
}
var selectable;
var result = false;
for (var i = 0; i < selectables.length; i++) {
selectable = selectables[i];
result = selectable.finalize(cssSelector, matchedCallback) || result;
}
return result;
};
/** @internal */
SelectorMatcher.prototype._matchPartial = function (map, name, cssSelector, matchedCallback) {
if (!map || typeof name !== 'string') {
return false;
}
var nestedSelector = map.get(name);
if (!nestedSelector) {
return false;
}
// TODO(perf): get rid of recursion and measure again
// TODO(perf): don't pass the whole selector into the recursion,
// but only the not processed parts
return nestedSelector.match(cssSelector, matchedCallback);
};
return SelectorMatcher;
}());
var SelectorListContext = /** @class */ (function () {
function SelectorListContext(selectors) {
this.selectors = selectors;
this.alreadyMatched = false;
}
return SelectorListContext;
}());
// Store context to pass back selector and context when a selector is matched
var SelectorContext = /** @class */ (function () {
function SelectorContext(selector, cbContext, listContext) {
this.selector = selector;
this.cbContext = cbContext;
this.listContext = listContext;
this.notSelectors = selector.notSelectors;
}
SelectorContext.prototype.finalize = function (cssSelector, callback) {
var result = true;
if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) {
var notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors);
result = !notMatcher.match(cssSelector, null);
}
if (result && callback && (!this.listContext || !this.listContext.alreadyMatched)) {
if (this.listContext) {
this.listContext.alreadyMatched = true;
}
callback(this.selector, this.cbContext);
}
return result;
};
return SelectorContext;
}());
/**
* @license
* Copyright Google Inc. 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 ERROR_COMPONENT_TYPE = 'ngComponentType';
// Design notes:
// - don't lazily create metadata:
// For some metadata, we need to do async work sometimes,
// so the user has to kick off this loading.
// But we want to report errors even when the async work is
// not required to check that the user would have been able
// to wait correctly.
var CompileMetadataResolver = /** @class */ (function () {
function CompileMetadataResolver(_config, _htmlParser, _ngModuleResolver, _directiveResolver, _pipeResolver, _summaryResolver, _schemaRegistry, _directiveNormalizer, _console, _staticSymbolCache, _reflector, _errorCollector) {
this._config = _config;
this._htmlParser = _htmlParser;
this._ngModuleResolver = _ngModuleResolver;
this._directiveResolver = _directiveResolver;
this._pipeResolver = _pipeResolver;
this._summaryResolver = _summaryResolver;
this._schemaRegistry = _schemaRegistry;
this._directiveNormalizer = _directiveNormalizer;
this._console = _console;
this._staticSymbolCache = _staticSymbolCache;
this._reflector = _reflector;
this._errorCollector = _errorCollector;
this._nonNormalizedDirectiveCache = new Map();
this._directiveCache = new Map();
this._summaryCache = new Map();
this._pipeCache = new Map();
this._ngModuleCache = new Map();
this._ngModuleOfTypes = new Map();
this._shallowModuleCache = new Map();
}
CompileMetadataResolver.prototype.getReflector = function () { return this._reflector; };
CompileMetadataResolver.prototype.clearCacheFor = function (type) {
var dirMeta = this._directiveCache.get(type);
this._directiveCache.delete(type);
this._nonNormalizedDirectiveCache.delete(type);
this._summaryCache.delete(type);
this._pipeCache.delete(type);
this._ngModuleOfTypes.delete(type);
// Clear all of the NgModule as they contain transitive information!
this._ngModuleCache.clear();
if (dirMeta) {
this._directiveNormalizer.clearCacheFor(dirMeta);
}
};
CompileMetadataResolver.prototype.clearCache = function () {
this._directiveCache.clear();
this._nonNormalizedDirectiveCache.clear();
this._summaryCache.clear();
this._pipeCache.clear();
this._ngModuleCache.clear();
this._ngModuleOfTypes.clear();
this._directiveNormalizer.clearCache();
};
CompileMetadataResolver.prototype._createProxyClass = function (baseType, name) {
var delegate = null;
var proxyClass = function () {
if (!delegate) {
throw new Error("Illegal state: Class " + name + " for type " + stringify(baseType) + " is not compiled yet!");
}
return delegate.apply(this, arguments);
};
proxyClass.setDelegate = function (d) {
delegate = d;
proxyClass.prototype = d.prototype;
};
// Make stringify work correctly
proxyClass.overriddenName = name;
return proxyClass;
};
CompileMetadataResolver.prototype.getGeneratedClass = function (dirType, name) {
if (dirType instanceof StaticSymbol) {
return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), name);
}
else {
return this._createProxyClass(dirType, name);
}
};
CompileMetadataResolver.prototype.getComponentViewClass = function (dirType) {
return this.getGeneratedClass(dirType, viewClassName(dirType, 0));
};
CompileMetadataResolver.prototype.getHostComponentViewClass = function (dirType) {
return this.getGeneratedClass(dirType, hostViewClassName(dirType));
};
CompileMetadataResolver.prototype.getHostComponentType = function (dirType) {
var name = identifierName({ reference: dirType }) + "_Host";
if (dirType instanceof StaticSymbol) {
return this._staticSymbolCache.get(dirType.filePath, name);
}
else {
var HostClass = function HostClass() { };
HostClass.overriddenName = name;
return HostClass;
}
};
CompileMetadataResolver.prototype.getRendererType = function (dirType) {
if (dirType instanceof StaticSymbol) {
return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), rendererTypeName(dirType));
}
else {
// returning an object as proxy,
// that we fill later during runtime compilation.
return {};
}
};
CompileMetadataResolver.prototype.getComponentFactory = function (selector, dirType, inputs, outputs) {
if (dirType instanceof StaticSymbol) {
return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), componentFactoryName(dirType));
}
else {
var hostView = this.getHostComponentViewClass(dirType);
// Note: ngContentSelectors will be filled later once the template is
// loaded.
var createComponentFactory = this._reflector.resolveExternalReference(Identifiers.createComponentFactory);
return createComponentFactory(selector, dirType, hostView, inputs, outputs, []);
}
};
CompileMetadataResolver.prototype.initComponentFactory = function (factory, ngContentSelectors) {
if (!(factory instanceof StaticSymbol)) {
(_a = factory.ngContentSelectors).push.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(ngContentSelectors));
}
var _a;
};
CompileMetadataResolver.prototype._loadSummary = function (type, kind) {
var typeSummary = this._summaryCache.get(type);
if (!typeSummary) {
var summary = this._summaryResolver.resolveSummary(type);
typeSummary = summary ? summary.type : null;
this._summaryCache.set(type, typeSummary || null);
}
return typeSummary && typeSummary.summaryKind === kind ? typeSummary : null;
};
CompileMetadataResolver.prototype.getHostComponentMetadata = function (compMeta, hostViewType) {
var hostType = this.getHostComponentType(compMeta.type.reference);
if (!hostViewType) {
hostViewType = this.getHostComponentViewClass(hostType);
}
// Note: ! is ok here as this method should only be called with normalized directive
// metadata, which always fills in the selector.
var template = CssSelector.parse(compMeta.selector)[0].getMatchingElementTemplate();
var templateUrl = '';
var htmlAst = this._htmlParser.parse(template, templateUrl);
return CompileDirectiveMetadata.create({
isHost: true,
type: { reference: hostType, diDeps: [], lifecycleHooks: [] },
template: new CompileTemplateMetadata({
encapsulation: ViewEncapsulation.None,
template: template,
templateUrl: templateUrl,
htmlAst: htmlAst,
styles: [],
styleUrls: [],
ngContentSelectors: [],
animations: [],
isInline: true,
externalStylesheets: [],
interpolation: null,
preserveWhitespaces: false,
}),
exportAs: null,
changeDetection: ChangeDetectionStrategy.Default,
inputs: [],
outputs: [],
host: {},
isComponent: true,
selector: '*',
providers: [],
viewProviders: [],
queries: [],
guards: {},
viewQueries: [],
componentViewType: hostViewType,
rendererType: { id: '__Host__', encapsulation: ViewEncapsulation.None, styles: [], data: {} },
entryComponents: [],
componentFactory: null
});
};
CompileMetadataResolver.prototype.loadDirectiveMetadata = function (ngModuleType, directiveType, isSync) {
var _this = this;
if (this._directiveCache.has(directiveType)) {
return null;
}
directiveType = resolveForwardRef(directiveType);
var _a = this.getNonNormalizedDirectiveMetadata(directiveType), annotation = _a.annotation, metadata = _a.metadata;
var createDirectiveMetadata = function (templateMetadata) {
var normalizedDirMeta = new CompileDirectiveMetadata({
isHost: false,
type: metadata.type,
isComponent: metadata.isComponent,
selector: metadata.selector,
exportAs: metadata.exportAs,
changeDetection: metadata.changeDetection,
inputs: metadata.inputs,
outputs: metadata.outputs,
hostListeners: metadata.hostListeners,
hostProperties: metadata.hostProperties,
hostAttributes: metadata.hostAttributes,
providers: metadata.providers,
viewProviders: metadata.viewProviders,
queries: metadata.queries,
guards: metadata.guards,
viewQueries: metadata.viewQueries,
entryComponents: metadata.entryComponents,
componentViewType: metadata.componentViewType,
rendererType: metadata.rendererType,
componentFactory: metadata.componentFactory,
template: templateMetadata
});
if (templateMetadata) {
_this.initComponentFactory(metadata.componentFactory, templateMetadata.ngContentSelectors);
}
_this._directiveCache.set(directiveType, normalizedDirMeta);
_this._summaryCache.set(directiveType, normalizedDirMeta.toSummary());
return null;
};
if (metadata.isComponent) {
var template = metadata.template;
var templateMeta = this._directiveNormalizer.normalizeTemplate({
ngModuleType: ngModuleType,
componentType: directiveType,
moduleUrl: this._reflector.componentModuleUrl(directiveType, annotation),
encapsulation: template.encapsulation,
template: template.template,
templateUrl: template.templateUrl,
styles: template.styles,
styleUrls: template.styleUrls,
animations: template.animations,
interpolation: template.interpolation,
preserveWhitespaces: template.preserveWhitespaces
});
if (isPromise(templateMeta) && isSync) {
this._reportError(componentStillLoadingError(directiveType), directiveType);
return null;
}
return SyncAsync.then(templateMeta, createDirectiveMetadata);
}
else {
// directive
createDirectiveMetadata(null);
return null;
}
};
CompileMetadataResolver.prototype.getNonNormalizedDirectiveMetadata = function (directiveType) {
var _this = this;
directiveType = resolveForwardRef(directiveType);
if (!directiveType) {
return null;
}
var cacheEntry = this._nonNormalizedDirectiveCache.get(directiveType);
if (cacheEntry) {
return cacheEntry;
}
var dirMeta = this._directiveResolver.resolve(directiveType, false);
if (!dirMeta) {
return null;
}
var nonNormalizedTemplateMetadata = undefined;
if (createComponent.isTypeOf(dirMeta)) {
// component
var compMeta = dirMeta;
assertArrayOfStrings('styles', compMeta.styles);
assertArrayOfStrings('styleUrls', compMeta.styleUrls);
assertInterpolationSymbols('interpolation', compMeta.interpolation);
var animations = compMeta.animations;
nonNormalizedTemplateMetadata = new CompileTemplateMetadata({
encapsulation: noUndefined(compMeta.encapsulation),
template: noUndefined(compMeta.template),
templateUrl: noUndefined(compMeta.templateUrl),
htmlAst: null,
styles: compMeta.styles || [],
styleUrls: compMeta.styleUrls || [],
animations: animations || [],
interpolation: noUndefined(compMeta.interpolation),
isInline: !!compMeta.template,
externalStylesheets: [],
ngContentSelectors: [],
preserveWhitespaces: noUndefined(dirMeta.preserveWhitespaces),
});
}
var changeDetectionStrategy = null;
var viewProviders = [];
var entryComponentMetadata = [];
var selector = dirMeta.selector;
if (createComponent.isTypeOf(dirMeta)) {
// Component
var compMeta = dirMeta;
changeDetectionStrategy = compMeta.changeDetection;
if (compMeta.viewProviders) {
viewProviders = this._getProvidersMetadata(compMeta.viewProviders, entryComponentMetadata, "viewProviders for \"" + stringifyType(directiveType) + "\"", [], directiveType);
}
if (compMeta.entryComponents) {
entryComponentMetadata = flattenAndDedupeArray(compMeta.entryComponents)
.map(function (type) { return _this._getEntryComponentMetadata(type); })
.concat(entryComponentMetadata);
}
if (!selector) {
selector = this._schemaRegistry.getDefaultComponentElementName();
}
}
else {
// Directive
if (!selector) {
this._reportError(syntaxError("Directive " + stringifyType(directiveType) + " has no selector, please add it!"), directiveType);
selector = 'error';
}
}
var providers = [];
if (dirMeta.providers != null) {
providers = this._getProvidersMetadata(dirMeta.providers, entryComponentMetadata, "providers for \"" + stringifyType(directiveType) + "\"", [], directiveType);
}
var queries = [];
var viewQueries = [];
if (dirMeta.queries != null) {
queries = this._getQueriesMetadata(dirMeta.queries, false, directiveType);
viewQueries = this._getQueriesMetadata(dirMeta.queries, true, directiveType);
}
var metadata = CompileDirectiveMetadata.create({
isHost: false,
selector: selector,
exportAs: noUndefined(dirMeta.exportAs),
isComponent: !!nonNormalizedTemplateMetadata,
type: this._getTypeMetadata(directiveType),
template: nonNormalizedTemplateMetadata,
changeDetection: changeDetectionStrategy,
inputs: dirMeta.inputs || [],
outputs: dirMeta.outputs || [],
host: dirMeta.host || {},
providers: providers || [],
viewProviders: viewProviders || [],
queries: queries || [],
guards: dirMeta.guards || {},
viewQueries: viewQueries || [],
entryComponents: entryComponentMetadata,
componentViewType: nonNormalizedTemplateMetadata ? this.getComponentViewClass(directiveType) :
null,
rendererType: nonNormalizedTemplateMetadata ? this.getRendererType(directiveType) : null,
componentFactory: null
});
if (nonNormalizedTemplateMetadata) {
metadata.componentFactory =
this.getComponentFactory(selector, directiveType, metadata.inputs, metadata.outputs);
}
cacheEntry = { metadata: metadata, annotation: dirMeta };
this._nonNormalizedDirectiveCache.set(directiveType, cacheEntry);
return cacheEntry;
};
/**
* Gets the metadata for the given directive.
* This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
*/
CompileMetadataResolver.prototype.getDirectiveMetadata = function (directiveType) {
var dirMeta = this._directiveCache.get(directiveType);
if (!dirMeta) {
this._reportError(syntaxError("Illegal state: getDirectiveMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Directive " + stringifyType(directiveType) + "."), directiveType);
}
return dirMeta;
};
CompileMetadataResolver.prototype.getDirectiveSummary = function (dirType) {
var dirSummary = this._loadSummary(dirType, CompileSummaryKind.Directive);
if (!dirSummary) {
this._reportError(syntaxError("Illegal state: Could not load the summary for directive " + stringifyType(dirType) + "."), dirType);
}
return dirSummary;
};
CompileMetadataResolver.prototype.isDirective = function (type) {
return !!this._loadSummary(type, CompileSummaryKind.Directive) ||
this._directiveResolver.isDirective(type);
};
CompileMetadataResolver.prototype.isPipe = function (type) {
return !!this._loadSummary(type, CompileSummaryKind.Pipe) ||
this._pipeResolver.isPipe(type);
};
CompileMetadataResolver.prototype.isNgModule = function (type) {
return !!this._loadSummary(type, CompileSummaryKind.NgModule) ||
this._ngModuleResolver.isNgModule(type);
};
CompileMetadataResolver.prototype.getNgModuleSummary = function (moduleType, alreadyCollecting) {
if (alreadyCollecting === void 0) { alreadyCollecting = null; }
var moduleSummary = this._loadSummary(moduleType, CompileSummaryKind.NgModule);
if (!moduleSummary) {
var moduleMeta = this.getNgModuleMetadata(moduleType, false, alreadyCollecting);
moduleSummary = moduleMeta ? moduleMeta.toSummary() : null;
if (moduleSummary) {
this._summaryCache.set(moduleType, moduleSummary);
}
}
return moduleSummary;
};
/**
* Loads the declared directives and pipes of an NgModule.
*/
CompileMetadataResolver.prototype.loadNgModuleDirectiveAndPipeMetadata = function (moduleType, isSync, throwIfNotFound) {
var _this = this;
if (throwIfNotFound === void 0) { throwIfNotFound = true; }
var ngModule = this.getNgModuleMetadata(moduleType, throwIfNotFound);
var loading = [];
if (ngModule) {
ngModule.declaredDirectives.forEach(function (id) {
var promise = _this.loadDirectiveMetadata(moduleType, id.reference, isSync);
if (promise) {
loading.push(promise);
}
});
ngModule.declaredPipes.forEach(function (id) { return _this._loadPipeMetadata(id.reference); });
}
return Promise.all(loading);
};
CompileMetadataResolver.prototype.getShallowModuleMetadata = function (moduleType) {
var compileMeta = this._shallowModuleCache.get(moduleType);
if (compileMeta) {
return compileMeta;
}
var ngModuleMeta = findLast(this._reflector.shallowAnnotations(moduleType), createNgModule.isTypeOf);
compileMeta = {
type: this._getTypeMetadata(moduleType),
rawExports: ngModuleMeta.exports,
rawImports: ngModuleMeta.imports,
rawProviders: ngModuleMeta.providers,
};
this._shallowModuleCache.set(moduleType, compileMeta);
return compileMeta;
};
CompileMetadataResolver.prototype.getNgModuleMetadata = function (moduleType, throwIfNotFound, alreadyCollecting) {
var _this = this;
if (throwIfNotFound === void 0) { throwIfNotFound = true; }
if (alreadyCollecting === void 0) { alreadyCollecting = null; }
moduleType = resolveForwardRef(moduleType);
var compileMeta = this._ngModuleCache.get(moduleType);
if (compileMeta) {
return compileMeta;
}
var meta = this._ngModuleResolver.resolve(moduleType, throwIfNotFound);
if (!meta) {
return null;
}
var declaredDirectives = [];
var exportedNonModuleIdentifiers = [];
var declaredPipes = [];
var importedModules = [];
var exportedModules = [];
var providers = [];
var entryComponents = [];
var bootstrapComponents = [];
var schemas = [];
if (meta.imports) {
flattenAndDedupeArray(meta.imports).forEach(function (importedType) {
var importedModuleType = undefined;
if (isValidType(importedType)) {
importedModuleType = importedType;
}
else if (importedType && importedType.ngModule) {
var moduleWithProviders = importedType;
importedModuleType = moduleWithProviders.ngModule;
if (moduleWithProviders.providers) {
providers.push.apply(providers, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(_this._getProvidersMetadata(moduleWithProviders.providers, entryComponents, "provider for the NgModule '" + stringifyType(importedModuleType) + "'", [], importedType)));
}
}
if (importedModuleType) {
if (_this._checkSelfImport(moduleType, importedModuleType))
return;
if (!alreadyCollecting)
alreadyCollecting = new Set();
if (alreadyCollecting.has(importedModuleType)) {
_this._reportError(syntaxError(_this._getTypeDescriptor(importedModuleType) + " '" + stringifyType(importedType) + "' is imported recursively by the module '" + stringifyType(moduleType) + "'."), moduleType);
return;
}
alreadyCollecting.add(importedModuleType);
var importedModuleSummary = _this.getNgModuleSummary(importedModuleType, alreadyCollecting);
alreadyCollecting.delete(importedModuleType);
if (!importedModuleSummary) {
_this._reportError(syntaxError("Unexpected " + _this._getTypeDescriptor(importedType) + " '" + stringifyType(importedType) + "' imported by the module '" + stringifyType(moduleType) + "'. Please add a @NgModule annotation."), moduleType);
return;
}
importedModules.push(importedModuleSummary);
}
else {
_this._reportError(syntaxError("Unexpected value '" + stringifyType(importedType) + "' imported by the module '" + stringifyType(moduleType) + "'"), moduleType);
return;
}
});
}
if (meta.exports) {
flattenAndDedupeArray(meta.exports).forEach(function (exportedType) {
if (!isValidType(exportedType)) {
_this._reportError(syntaxError("Unexpected value '" + stringifyType(exportedType) + "' exported by the module '" + stringifyType(moduleType) + "'"), moduleType);
return;
}
if (!alreadyCollecting)
alreadyCollecting = new Set();
if (alreadyCollecting.has(exportedType)) {
_this._reportError(syntaxError(_this._getTypeDescriptor(exportedType) + " '" + stringify(exportedType) + "' is exported recursively by the module '" + stringifyType(moduleType) + "'"), moduleType);
return;
}
alreadyCollecting.add(exportedType);
var exportedModuleSummary = _this.getNgModuleSummary(exportedType, alreadyCollecting);
alreadyCollecting.delete(exportedType);
if (exportedModuleSummary) {
exportedModules.push(exportedModuleSummary);
}
else {
exportedNonModuleIdentifiers.push(_this._getIdentifierMetadata(exportedType));
}
});
}
// Note: This will be modified later, so we rely on
// getting a new instance every time!
var transitiveModule = this._getTransitiveNgModuleMetadata(importedModules, exportedModules);
if (meta.declarations) {
flattenAndDedupeArray(meta.declarations).forEach(function (declaredType) {
if (!isValidType(declaredType)) {
_this._reportError(syntaxError("Unexpected value '" + stringifyType(declaredType) + "' declared by the module '" + stringifyType(moduleType) + "'"), moduleType);
return;
}
var declaredIdentifier = _this._getIdentifierMetadata(declaredType);
if (_this.isDirective(declaredType)) {
transitiveModule.addDirective(declaredIdentifier);
declaredDirectives.push(declaredIdentifier);
_this._addTypeToModule(declaredType, moduleType);
}
else if (_this.isPipe(declaredType)) {
transitiveModule.addPipe(declaredIdentifier);
transitiveModule.pipes.push(declaredIdentifier);
declaredPipes.push(declaredIdentifier);
_this._addTypeToModule(declaredType, moduleType);
}
else {
_this._reportError(syntaxError("Unexpected " + _this._getTypeDescriptor(declaredType) + " '" + stringifyType(declaredType) + "' declared by the module '" + stringifyType(moduleType) + "'. Please add a @Pipe/@Directive/@Component annotation."), moduleType);
return;
}
});
}
var exportedDirectives = [];
var exportedPipes = [];
exportedNonModuleIdentifiers.forEach(function (exportedId) {
if (transitiveModule.directivesSet.has(exportedId.reference)) {
exportedDirectives.push(exportedId);
transitiveModule.addExportedDirective(exportedId);
}
else if (transitiveModule.pipesSet.has(exportedId.reference)) {
exportedPipes.push(exportedId);
transitiveModule.addExportedPipe(exportedId);
}
else {
_this._reportError(syntaxError("Can't export " + _this._getTypeDescriptor(exportedId.reference) + " " + stringifyType(exportedId.reference) + " from " + stringifyType(moduleType) + " as it was neither declared nor imported!"), moduleType);
return;
}
});
// The providers of the module have to go last
// so that they overwrite any other provider we already added.
if (meta.providers) {
providers.push.apply(providers, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(this._getProvidersMetadata(meta.providers, entryComponents, "provider for the NgModule '" + stringifyType(moduleType) + "'", [], moduleType)));
}
if (meta.entryComponents) {
entryComponents.push.apply(entryComponents, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(flattenAndDedupeArray(meta.entryComponents)
.map(function (type) { return _this._getEntryComponentMetadata(type); })));
}
if (meta.bootstrap) {
flattenAndDedupeArray(meta.bootstrap).forEach(function (type) {
if (!isValidType(type)) {
_this._reportError(syntaxError("Unexpected value '" + stringifyType(type) + "' used in the bootstrap property of module '" + stringifyType(moduleType) + "'"), moduleType);
return;
}
bootstrapComponents.push(_this._getIdentifierMetadata(type));
});
}
entryComponents.push.apply(entryComponents, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(bootstrapComponents.map(function (type) { return _this._getEntryComponentMetadata(type.reference); })));
if (meta.schemas) {
schemas.push.apply(schemas, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(flattenAndDedupeArray(meta.schemas)));
}
compileMeta = new CompileNgModuleMetadata({
type: this._getTypeMetadata(moduleType),
providers: providers,
entryComponents: entryComponents,
bootstrapComponents: bootstrapComponents,
schemas: schemas,
declaredDirectives: declaredDirectives,
exportedDirectives: exportedDirectives,
declaredPipes: declaredPipes,
exportedPipes: exportedPipes,
importedModules: importedModules,
exportedModules: exportedModules,
transitiveModule: transitiveModule,
id: meta.id || null,
});
entryComponents.forEach(function (id) { return transitiveModule.addEntryComponent(id); });
providers.forEach(function (provider) { return transitiveModule.addProvider(provider, compileMeta.type); });
transitiveModule.addModule(compileMeta.type);
this._ngModuleCache.set(moduleType, compileMeta);
return compileMeta;
};
CompileMetadataResolver.prototype._checkSelfImport = function (moduleType, importedModuleType) {
if (moduleType === importedModuleType) {
this._reportError(syntaxError("'" + stringifyType(moduleType) + "' module can't import itself"), moduleType);
return true;
}
return false;
};
CompileMetadataResolver.prototype._getTypeDescriptor = function (type) {
if (isValidType(type)) {
if (this.isDirective(type)) {
return 'directive';
}
if (this.isPipe(type)) {
return 'pipe';
}
if (this.isNgModule(type)) {
return 'module';
}
}
if (type.provide) {
return 'provider';
}
return 'value';
};
CompileMetadataResolver.prototype._addTypeToModule = function (type, moduleType) {
var oldModule = this._ngModuleOfTypes.get(type);
if (oldModule && oldModule !== moduleType) {
this._reportError(syntaxError("Type " + stringifyType(type) + " is part of the declarations of 2 modules: " + stringifyType(oldModule) + " and " + stringifyType(moduleType) + "! " +
("Please consider moving " + stringifyType(type) + " to a higher module that imports " + stringifyType(oldModule) + " and " + stringifyType(moduleType) + ". ") +
("You can also create a new NgModule that exports and includes " + stringifyType(type) + " then import that NgModule in " + stringifyType(oldModule) + " and " + stringifyType(moduleType) + ".")), moduleType);
return;
}
this._ngModuleOfTypes.set(type, moduleType);
};
CompileMetadataResolver.prototype._getTransitiveNgModuleMetadata = function (importedModules, exportedModules) {
// collect `providers` / `entryComponents` from all imported and all exported modules
var result = new TransitiveCompileNgModuleMetadata();
var modulesByToken = new Map();
importedModules.concat(exportedModules).forEach(function (modSummary) {
modSummary.modules.forEach(function (mod) { return result.addModule(mod); });
modSummary.entryComponents.forEach(function (comp) { return result.addEntryComponent(comp); });
var addedTokens = new Set();
modSummary.providers.forEach(function (entry) {
var tokenRef = tokenReference(entry.provider.token);
var prevModules = modulesByToken.get(tokenRef);
if (!prevModules) {
prevModules = new Set();
modulesByToken.set(tokenRef, prevModules);
}
var moduleRef = entry.module.reference;
// Note: the providers of one module may still contain multiple providers
// per token (e.g. for multi providers), and we need to preserve these.
if (addedTokens.has(tokenRef) || !prevModules.has(moduleRef)) {
prevModules.add(moduleRef);
addedTokens.add(tokenRef);
result.addProvider(entry.provider, entry.module);
}
});
});
exportedModules.forEach(function (modSummary) {
modSummary.exportedDirectives.forEach(function (id) { return result.addExportedDirective(id); });
modSummary.exportedPipes.forEach(function (id) { return result.addExportedPipe(id); });
});
importedModules.forEach(function (modSummary) {
modSummary.exportedDirectives.forEach(function (id) { return result.addDirective(id); });
modSummary.exportedPipes.forEach(function (id) { return result.addPipe(id); });
});
return result;
};
CompileMetadataResolver.prototype._getIdentifierMetadata = function (type) {
type = resolveForwardRef(type);
return { reference: type };
};
CompileMetadataResolver.prototype.isInjectable = function (type) {
var annotations = this._reflector.tryAnnotations(type);
return annotations.some(function (ann) { return createInjectable.isTypeOf(ann); });
};
CompileMetadataResolver.prototype.getInjectableSummary = function (type) {
return {
summaryKind: CompileSummaryKind.Injectable,
type: this._getTypeMetadata(type, null, false)
};
};
CompileMetadataResolver.prototype.getInjectableMetadata = function (type, dependencies, throwOnUnknownDeps) {
if (dependencies === void 0) { dependencies = null; }
if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }
var typeSummary = this._loadSummary(type, CompileSummaryKind.Injectable);
var typeMetadata = typeSummary ?
typeSummary.type :
this._getTypeMetadata(type, dependencies, throwOnUnknownDeps);
var annotations = this._reflector.annotations(type).filter(function (ann) { return createInjectable.isTypeOf(ann); });
if (annotations.length === 0) {
return null;
}
var meta = annotations[annotations.length - 1];
return {
symbol: type,
type: typeMetadata,
providedIn: meta.providedIn,
useValue: meta.useValue,
useClass: meta.useClass,
useExisting: meta.useExisting,
useFactory: meta.useFactory,
deps: meta.deps,
};
};
CompileMetadataResolver.prototype._getTypeMetadata = function (type, dependencies, throwOnUnknownDeps) {
if (dependencies === void 0) { dependencies = null; }
if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }
var identifier = this._getIdentifierMetadata(type);
return {
reference: identifier.reference,
diDeps: this._getDependenciesMetadata(identifier.reference, dependencies, throwOnUnknownDeps),
lifecycleHooks: getAllLifecycleHooks(this._reflector, identifier.reference),
};
};
CompileMetadataResolver.prototype._getFactoryMetadata = function (factory, dependencies) {
if (dependencies === void 0) { dependencies = null; }
factory = resolveForwardRef(factory);
return { reference: factory, diDeps: this._getDependenciesMetadata(factory, dependencies) };
};
/**
* Gets the metadata for the given pipe.
* This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
*/
CompileMetadataResolver.prototype.getPipeMetadata = function (pipeType) {
var pipeMeta = this._pipeCache.get(pipeType);
if (!pipeMeta) {
this._reportError(syntaxError("Illegal state: getPipeMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Pipe " + stringifyType(pipeType) + "."), pipeType);
}
return pipeMeta || null;
};
CompileMetadataResolver.prototype.getPipeSummary = function (pipeType) {
var pipeSummary = this._loadSummary(pipeType, CompileSummaryKind.Pipe);
if (!pipeSummary) {
this._reportError(syntaxError("Illegal state: Could not load the summary for pipe " + stringifyType(pipeType) + "."), pipeType);
}
return pipeSummary;
};
CompileMetadataResolver.prototype.getOrLoadPipeMetadata = function (pipeType) {
var pipeMeta = this._pipeCache.get(pipeType);
if (!pipeMeta) {
pipeMeta = this._loadPipeMetadata(pipeType);
}
return pipeMeta;
};
CompileMetadataResolver.prototype._loadPipeMetadata = function (pipeType) {
pipeType = resolveForwardRef(pipeType);
var pipeAnnotation = this._pipeResolver.resolve(pipeType);
var pipeMeta = new CompilePipeMetadata({
type: this._getTypeMetadata(pipeType),
name: pipeAnnotation.name,
pure: !!pipeAnnotation.pure
});
this._pipeCache.set(pipeType, pipeMeta);
this._summaryCache.set(pipeType, pipeMeta.toSummary());
return pipeMeta;
};
CompileMetadataResolver.prototype._getDependenciesMetadata = function (typeOrFunc, dependencies, throwOnUnknownDeps) {
var _this = this;
if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }
var hasUnknownDeps = false;
var params = dependencies || this._reflector.parameters(typeOrFunc) || [];
var dependenciesMetadata = params.map(function (param) {
var isAttribute = false;
var isHost = false;
var isSelf = false;
var isSkipSelf = false;
var isOptional = false;
var token = null;
if (Array.isArray(param)) {
param.forEach(function (paramEntry) {
if (createHost.isTypeOf(paramEntry)) {
isHost = true;
}
else if (createSelf.isTypeOf(paramEntry)) {
isSelf = true;
}
else if (createSkipSelf.isTypeOf(paramEntry)) {
isSkipSelf = true;
}
else if (createOptional.isTypeOf(paramEntry)) {
isOptional = true;
}
else if (createAttribute.isTypeOf(paramEntry)) {
isAttribute = true;
token = paramEntry.attributeName;
}
else if (createInject.isTypeOf(paramEntry)) {
token = paramEntry.token;
}
else if (createInjectionToken.isTypeOf(paramEntry) || paramEntry instanceof StaticSymbol) {
token = paramEntry;
}
else if (isValidType(paramEntry) && token == null) {
token = paramEntry;
}
});
}
else {
token = param;
}
if (token == null) {
hasUnknownDeps = true;
return null;
}
return {
isAttribute: isAttribute,
isHost: isHost,
isSelf: isSelf,
isSkipSelf: isSkipSelf,
isOptional: isOptional,
token: _this._getTokenMetadata(token)
};
});
if (hasUnknownDeps) {
var depsTokens = dependenciesMetadata.map(function (dep) { return dep ? stringifyType(dep.token) : '?'; }).join(', ');
var message = "Can't resolve all parameters for " + stringifyType(typeOrFunc) + ": (" + depsTokens + ").";
if (throwOnUnknownDeps || this._config.strictInjectionParameters) {
this._reportError(syntaxError(message), typeOrFunc);
}
else {
this._console.warn("Warning: " + message + " This will become an error in Angular v6.x");
}
}
return dependenciesMetadata;
};
CompileMetadataResolver.prototype._getTokenMetadata = function (token) {
token = resolveForwardRef(token);
var compileToken;
if (typeof token === 'string') {
compileToken = { value: token };
}
else {
compileToken = { identifier: { reference: token } };
}
return compileToken;
};
CompileMetadataResolver.prototype._getProvidersMetadata = function (providers, targetEntryComponents, debugInfo, compileProviders, type) {
var _this = this;
if (compileProviders === void 0) { compileProviders = []; }
providers.forEach(function (provider, providerIdx) {
if (Array.isArray(provider)) {
_this._getProvidersMetadata(provider, targetEntryComponents, debugInfo, compileProviders);
}
else {
provider = resolveForwardRef(provider);
var providerMeta = undefined;
if (provider && typeof provider === 'object' && provider.hasOwnProperty('provide')) {
_this._validateProvider(provider);
providerMeta = new ProviderMeta(provider.provide, provider);
}
else if (isValidType(provider)) {
providerMeta = new ProviderMeta(provider, { useClass: provider });
}
else if (provider === void 0) {
_this._reportError(syntaxError("Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files."));
return;
}
else {
var providersInfo = providers.reduce(function (soFar, seenProvider, seenProviderIdx) {
if (seenProviderIdx < providerIdx) {
soFar.push("" + stringifyType(seenProvider));
}
else if (seenProviderIdx == providerIdx) {
soFar.push("?" + stringifyType(seenProvider) + "?");
}
else if (seenProviderIdx == providerIdx + 1) {
soFar.push('...');
}
return soFar;
}, [])
.join(', ');
_this._reportError(syntaxError("Invalid " + (debugInfo ? debugInfo : 'provider') + " - only instances of Provider and Type are allowed, got: [" + providersInfo + "]"), type);
return;
}
if (providerMeta.token ===
_this._reflector.resolveExternalReference(Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS)) {
targetEntryComponents.push.apply(targetEntryComponents, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(_this._getEntryComponentsFromProvider(providerMeta, type)));
}
else {
compileProviders.push(_this.getProviderMetadata(providerMeta));
}
}
});
return compileProviders;
};
CompileMetadataResolver.prototype._validateProvider = function (provider) {
if (provider.hasOwnProperty('useClass') && provider.useClass == null) {
this._reportError(syntaxError("Invalid provider for " + stringifyType(provider.provide) + ". useClass cannot be " + provider.useClass + ".\n Usually it happens when:\n 1. There's a circular dependency (might be caused by using index.ts (barrel) files).\n 2. Class was used before it was declared. Use forwardRef in this case."));
}
};
CompileMetadataResolver.prototype._getEntryComponentsFromProvider = function (provider, type) {
var _this = this;
var components = [];
var collectedIdentifiers = [];
if (provider.useFactory || provider.useExisting || provider.useClass) {
this._reportError(syntaxError("The ANALYZE_FOR_ENTRY_COMPONENTS token only supports useValue!"), type);
return [];
}
if (!provider.multi) {
this._reportError(syntaxError("The ANALYZE_FOR_ENTRY_COMPONENTS token only supports 'multi = true'!"), type);
return [];
}
extractIdentifiers(provider.useValue, collectedIdentifiers);
collectedIdentifiers.forEach(function (identifier) {
var entry = _this._getEntryComponentMetadata(identifier.reference, false);
if (entry) {
components.push(entry);
}
});
return components;
};
CompileMetadataResolver.prototype._getEntryComponentMetadata = function (dirType, throwIfNotFound) {
if (throwIfNotFound === void 0) { throwIfNotFound = true; }
var dirMeta = this.getNonNormalizedDirectiveMetadata(dirType);
if (dirMeta && dirMeta.metadata.isComponent) {
return { componentType: dirType, componentFactory: dirMeta.metadata.componentFactory };
}
var dirSummary = this._loadSummary(dirType, CompileSummaryKind.Directive);
if (dirSummary && dirSummary.isComponent) {
return { componentType: dirType, componentFactory: dirSummary.componentFactory };
}
if (throwIfNotFound) {
throw syntaxError(dirType.name + " cannot be used as an entry component.");
}
return null;
};
CompileMetadataResolver.prototype._getInjectableTypeMetadata = function (type, dependencies) {
if (dependencies === void 0) { dependencies = null; }
var typeSummary = this._loadSummary(type, CompileSummaryKind.Injectable);
if (typeSummary) {
return typeSummary.type;
}
return this._getTypeMetadata(type, dependencies);
};
CompileMetadataResolver.prototype.getProviderMetadata = function (provider) {
var compileDeps = undefined;
var compileTypeMetadata = null;
var compileFactoryMetadata = null;
var token = this._getTokenMetadata(provider.token);
if (provider.useClass) {
compileTypeMetadata =
this._getInjectableTypeMetadata(provider.useClass, provider.dependencies);
compileDeps = compileTypeMetadata.diDeps;
if (provider.token === provider.useClass) {
// use the compileTypeMetadata as it contains information about lifecycleHooks...
token = { identifier: compileTypeMetadata };
}
}
else if (provider.useFactory) {
compileFactoryMetadata = this._getFactoryMetadata(provider.useFactory, provider.dependencies);
compileDeps = compileFactoryMetadata.diDeps;
}
return {
token: token,
useClass: compileTypeMetadata,
useValue: provider.useValue,
useFactory: compileFactoryMetadata,
useExisting: provider.useExisting ? this._getTokenMetadata(provider.useExisting) : undefined,
deps: compileDeps,
multi: provider.multi
};
};
CompileMetadataResolver.prototype._getQueriesMetadata = function (queries, isViewQuery, directiveType) {
var _this = this;
var res = [];
Object.keys(queries).forEach(function (propertyName) {
var query = queries[propertyName];
if (query.isViewQuery === isViewQuery) {
res.push(_this._getQueryMetadata(query, propertyName, directiveType));
}
});
return res;
};
CompileMetadataResolver.prototype._queryVarBindings = function (selector) { return selector.split(/\s*,\s*/); };
CompileMetadataResolver.prototype._getQueryMetadata = function (q, propertyName, typeOrFunc) {
var _this = this;
var selectors;
if (typeof q.selector === 'string') {
selectors =
this._queryVarBindings(q.selector).map(function (varName) { return _this._getTokenMetadata(varName); });
}
else {
if (!q.selector) {
this._reportError(syntaxError("Can't construct a query for the property \"" + propertyName + "\" of \"" + stringifyType(typeOrFunc) + "\" since the query selector wasn't defined."), typeOrFunc);
selectors = [];
}
else {
selectors = [this._getTokenMetadata(q.selector)];
}
}
return {
selectors: selectors,
first: q.first,
descendants: q.descendants, propertyName: propertyName,
read: q.read ? this._getTokenMetadata(q.read) : null
};
};
CompileMetadataResolver.prototype._reportError = function (error$$1, type, otherType) {
if (this._errorCollector) {
this._errorCollector(error$$1, type);
if (otherType) {
this._errorCollector(error$$1, otherType);
}
}
else {
throw error$$1;
}
};
return CompileMetadataResolver;
}());
function flattenArray(tree, out) {
if (out === void 0) { out = []; }
if (tree) {
for (var i = 0; i < tree.length; i++) {
var item = resolveForwardRef(tree[i]);
if (Array.isArray(item)) {
flattenArray(item, out);
}
else {
out.push(item);
}
}
}
return out;
}
function dedupeArray(array) {
if (array) {
return Array.from(new Set(array));
}
return [];
}
function flattenAndDedupeArray(tree) {
return dedupeArray(flattenArray(tree));
}
function isValidType(value) {
return (value instanceof StaticSymbol) || (value instanceof Type);
}
function extractIdentifiers(value, targetIdentifiers) {
visitValue(value, new _CompileValueConverter(), targetIdentifiers);
}
var _CompileValueConverter = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(_CompileValueConverter, _super);
function _CompileValueConverter() {
return _super !== null && _super.apply(this, arguments) || this;
}
_CompileValueConverter.prototype.visitOther = function (value, targetIdentifiers) {
targetIdentifiers.push({ reference: value });
};
return _CompileValueConverter;
}(ValueTransformer));
function stringifyType(type) {
if (type instanceof StaticSymbol) {
return type.name + " in " + type.filePath;
}
else {
return stringify(type);
}
}
/**
* Indicates that a component is still being loaded in a synchronous compile.
*/
function componentStillLoadingError(compType) {
var error$$1 = Error("Can't compile synchronously as " + stringify(compType) + " is still being loaded!");
error$$1[ERROR_COMPONENT_TYPE] = compType;
return error$$1;
}
/**
* @license
* Copyright Google Inc. 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 ProviderError = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ProviderError, _super);
function ProviderError(message, span) {
return _super.call(this, span, message) || this;
}
return ProviderError;
}(ParseError));
var ProviderViewContext = /** @class */ (function () {
function ProviderViewContext(reflector, component) {
var _this = this;
this.reflector = reflector;
this.component = component;
this.errors = [];
this.viewQueries = _getViewQueries(component);
this.viewProviders = new Map();
component.viewProviders.forEach(function (provider) {
if (_this.viewProviders.get(tokenReference(provider.token)) == null) {
_this.viewProviders.set(tokenReference(provider.token), true);
}
});
}
return ProviderViewContext;
}());
var ProviderElementContext = /** @class */ (function () {
function ProviderElementContext(viewContext, _parent, _isViewRoot, _directiveAsts, attrs, refs, isTemplate, contentQueryStartId, _sourceSpan) {
var _this = this;
this.viewContext = viewContext;
this._parent = _parent;
this._isViewRoot = _isViewRoot;
this._directiveAsts = _directiveAsts;
this._sourceSpan = _sourceSpan;
this._transformedProviders = new Map();
this._seenProviders = new Map();
this._queriedTokens = new Map();
this.transformedHasViewContainer = false;
this._attrs = {};
attrs.forEach(function (attrAst) { return _this._attrs[attrAst.name] = attrAst.value; });
var directivesMeta = _directiveAsts.map(function (directiveAst) { return directiveAst.directive; });
this._allProviders =
_resolveProvidersFromDirectives(directivesMeta, _sourceSpan, viewContext.errors);
this._contentQueries = _getContentQueries(contentQueryStartId, directivesMeta);
Array.from(this._allProviders.values()).forEach(function (provider) {
_this._addQueryReadsTo(provider.token, provider.token, _this._queriedTokens);
});
if (isTemplate) {
var templateRefId = createTokenForExternalReference(this.viewContext.reflector, Identifiers.TemplateRef);
this._addQueryReadsTo(templateRefId, templateRefId, this._queriedTokens);
}
refs.forEach(function (refAst) {
var defaultQueryValue = refAst.value ||
createTokenForExternalReference(_this.viewContext.reflector, Identifiers.ElementRef);
_this._addQueryReadsTo({ value: refAst.name }, defaultQueryValue, _this._queriedTokens);
});
if (this._queriedTokens.get(this.viewContext.reflector.resolveExternalReference(Identifiers.ViewContainerRef))) {
this.transformedHasViewContainer = true;
}
// create the providers that we know are eager first
Array.from(this._allProviders.values()).forEach(function (provider) {
var eager = provider.eager || _this._queriedTokens.get(tokenReference(provider.token));
if (eager) {
_this._getOrCreateLocalProvider(provider.providerType, provider.token, true);
}
});
}
ProviderElementContext.prototype.afterElement = function () {
var _this = this;
// collect lazy providers
Array.from(this._allProviders.values()).forEach(function (provider) {
_this._getOrCreateLocalProvider(provider.providerType, provider.token, false);
});
};
Object.defineProperty(ProviderElementContext.prototype, "transformProviders", {
get: function () {
// Note: Maps keep their insertion order.
var lazyProviders = [];
var eagerProviders = [];
this._transformedProviders.forEach(function (provider) {
if (provider.eager) {
eagerProviders.push(provider);
}
else {
lazyProviders.push(provider);
}
});
return lazyProviders.concat(eagerProviders);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ProviderElementContext.prototype, "transformedDirectiveAsts", {
get: function () {
var sortedProviderTypes = this.transformProviders.map(function (provider) { return provider.token.identifier; });
var sortedDirectives = this._directiveAsts.slice();
sortedDirectives.sort(function (dir1, dir2) { return sortedProviderTypes.indexOf(dir1.directive.type) -
sortedProviderTypes.indexOf(dir2.directive.type); });
return sortedDirectives;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ProviderElementContext.prototype, "queryMatches", {
get: function () {
var allMatches = [];
this._queriedTokens.forEach(function (matches) { allMatches.push.apply(allMatches, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(matches)); });
return allMatches;
},
enumerable: true,
configurable: true
});
ProviderElementContext.prototype._addQueryReadsTo = function (token, defaultValue, queryReadTokens) {
this._getQueriesFor(token).forEach(function (query) {
var queryValue = query.meta.read || defaultValue;
var tokenRef = tokenReference(queryValue);
var queryMatches = queryReadTokens.get(tokenRef);
if (!queryMatches) {
queryMatches = [];
queryReadTokens.set(tokenRef, queryMatches);
}
queryMatches.push({ queryId: query.queryId, value: queryValue });
});
};
ProviderElementContext.prototype._getQueriesFor = function (token) {
var result = [];
var currentEl = this;
var distance = 0;
var queries;
while (currentEl !== null) {
queries = currentEl._contentQueries.get(tokenReference(token));
if (queries) {
result.push.apply(result, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(queries.filter(function (query) { return query.meta.descendants || distance <= 1; })));
}
if (currentEl._directiveAsts.length > 0) {
distance++;
}
currentEl = currentEl._parent;
}
queries = this.viewContext.viewQueries.get(tokenReference(token));
if (queries) {
result.push.apply(result, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(queries));
}
return result;
};
ProviderElementContext.prototype._getOrCreateLocalProvider = function (requestingProviderType, token, eager) {
var _this = this;
var resolvedProvider = this._allProviders.get(tokenReference(token));
if (!resolvedProvider || ((requestingProviderType === ProviderAstType.Directive ||
requestingProviderType === ProviderAstType.PublicService) &&
resolvedProvider.providerType === ProviderAstType.PrivateService) ||
((requestingProviderType === ProviderAstType.PrivateService ||
requestingProviderType === ProviderAstType.PublicService) &&
resolvedProvider.providerType === ProviderAstType.Builtin)) {
return null;
}
var transformedProviderAst = this._transformedProviders.get(tokenReference(token));
if (transformedProviderAst) {
return transformedProviderAst;
}
if (this._seenProviders.get(tokenReference(token)) != null) {
this.viewContext.errors.push(new ProviderError("Cannot instantiate cyclic dependency! " + tokenName(token), this._sourceSpan));
return null;
}
this._seenProviders.set(tokenReference(token), true);
var transformedProviders = resolvedProvider.providers.map(function (provider) {
var transformedUseValue = provider.useValue;
var transformedUseExisting = provider.useExisting;
var transformedDeps = undefined;
if (provider.useExisting != null) {
var existingDiDep = _this._getDependency(resolvedProvider.providerType, { token: provider.useExisting }, eager);
if (existingDiDep.token != null) {
transformedUseExisting = existingDiDep.token;
}
else {
transformedUseExisting = null;
transformedUseValue = existingDiDep.value;
}
}
else if (provider.useFactory) {
var deps = provider.deps || provider.useFactory.diDeps;
transformedDeps =
deps.map(function (dep) { return _this._getDependency(resolvedProvider.providerType, dep, eager); });
}
else if (provider.useClass) {
var deps = provider.deps || provider.useClass.diDeps;
transformedDeps =
deps.map(function (dep) { return _this._getDependency(resolvedProvider.providerType, dep, eager); });
}
return _transformProvider(provider, {
useExisting: transformedUseExisting,
useValue: transformedUseValue,
deps: transformedDeps
});
});
transformedProviderAst =
_transformProviderAst(resolvedProvider, { eager: eager, providers: transformedProviders });
this._transformedProviders.set(tokenReference(token), transformedProviderAst);
return transformedProviderAst;
};
ProviderElementContext.prototype._getLocalDependency = function (requestingProviderType, dep, eager) {
if (eager === void 0) { eager = false; }
if (dep.isAttribute) {
var attrValue = this._attrs[dep.token.value];
return { isValue: true, value: attrValue == null ? null : attrValue };
}
if (dep.token != null) {
// access builtints
if ((requestingProviderType === ProviderAstType.Directive ||
requestingProviderType === ProviderAstType.Component)) {
if (tokenReference(dep.token) ===
this.viewContext.reflector.resolveExternalReference(Identifiers.Renderer) ||
tokenReference(dep.token) ===
this.viewContext.reflector.resolveExternalReference(Identifiers.ElementRef) ||
tokenReference(dep.token) ===
this.viewContext.reflector.resolveExternalReference(Identifiers.ChangeDetectorRef) ||
tokenReference(dep.token) ===
this.viewContext.reflector.resolveExternalReference(Identifiers.TemplateRef)) {
return dep;
}
if (tokenReference(dep.token) ===
this.viewContext.reflector.resolveExternalReference(Identifiers.ViewContainerRef)) {
this.transformedHasViewContainer = true;
}
}
// access the injector
if (tokenReference(dep.token) ===
this.viewContext.reflector.resolveExternalReference(Identifiers.Injector)) {
return dep;
}
// access providers
if (this._getOrCreateLocalProvider(requestingProviderType, dep.token, eager) != null) {
return dep;
}
}
return null;
};
ProviderElementContext.prototype._getDependency = function (requestingProviderType, dep, eager) {
if (eager === void 0) { eager = false; }
var currElement = this;
var currEager = eager;
var result = null;
if (!dep.isSkipSelf) {
result = this._getLocalDependency(requestingProviderType, dep, eager);
}
if (dep.isSelf) {
if (!result && dep.isOptional) {
result = { isValue: true, value: null };
}
}
else {
// check parent elements
while (!result && currElement._parent) {
var prevElement = currElement;
currElement = currElement._parent;
if (prevElement._isViewRoot) {
currEager = false;
}
result = currElement._getLocalDependency(ProviderAstType.PublicService, dep, currEager);
}
// check @Host restriction
if (!result) {
if (!dep.isHost || this.viewContext.component.isHost ||
this.viewContext.component.type.reference === tokenReference(dep.token) ||
this.viewContext.viewProviders.get(tokenReference(dep.token)) != null) {
result = dep;
}
else {
result = dep.isOptional ? { isValue: true, value: null } : null;
}
}
}
if (!result) {
this.viewContext.errors.push(new ProviderError("No provider for " + tokenName(dep.token), this._sourceSpan));
}
return result;
};
return ProviderElementContext;
}());
var NgModuleProviderAnalyzer = /** @class */ (function () {
function NgModuleProviderAnalyzer(reflector, ngModule, extraProviders, sourceSpan) {
var _this = this;
this.reflector = reflector;
this._transformedProviders = new Map();
this._seenProviders = new Map();
this._errors = [];
this._allProviders = new Map();
ngModule.transitiveModule.modules.forEach(function (ngModuleType) {
var ngModuleProvider = { token: { identifier: ngModuleType }, useClass: ngModuleType };
_resolveProviders([ngModuleProvider], ProviderAstType.PublicService, true, sourceSpan, _this._errors, _this._allProviders, /* isModule */ true);
});
_resolveProviders(ngModule.transitiveModule.providers.map(function (entry) { return entry.provider; }).concat(extraProviders), ProviderAstType.PublicService, false, sourceSpan, this._errors, this._allProviders,
/* isModule */ false);
}
NgModuleProviderAnalyzer.prototype.parse = function () {
var _this = this;
Array.from(this._allProviders.values()).forEach(function (provider) {
_this._getOrCreateLocalProvider(provider.token, provider.eager);
});
if (this._errors.length > 0) {
var errorString = this._errors.join('\n');
throw new Error("Provider parse errors:\n" + errorString);
}
// Note: Maps keep their insertion order.
var lazyProviders = [];
var eagerProviders = [];
this._transformedProviders.forEach(function (provider) {
if (provider.eager) {
eagerProviders.push(provider);
}
else {
lazyProviders.push(provider);
}
});
return lazyProviders.concat(eagerProviders);
};
NgModuleProviderAnalyzer.prototype._getOrCreateLocalProvider = function (token, eager) {
var _this = this;
var resolvedProvider = this._allProviders.get(tokenReference(token));
if (!resolvedProvider) {
return null;
}
var transformedProviderAst = this._transformedProviders.get(tokenReference(token));
if (transformedProviderAst) {
return transformedProviderAst;
}
if (this._seenProviders.get(tokenReference(token)) != null) {
this._errors.push(new ProviderError("Cannot instantiate cyclic dependency! " + tokenName(token), resolvedProvider.sourceSpan));
return null;
}
this._seenProviders.set(tokenReference(token), true);
var transformedProviders = resolvedProvider.providers.map(function (provider) {
var transformedUseValue = provider.useValue;
var transformedUseExisting = provider.useExisting;
var transformedDeps = undefined;
if (provider.useExisting != null) {
var existingDiDep = _this._getDependency({ token: provider.useExisting }, eager, resolvedProvider.sourceSpan);
if (existingDiDep.token != null) {
transformedUseExisting = existingDiDep.token;
}
else {
transformedUseExisting = null;
transformedUseValue = existingDiDep.value;
}
}
else if (provider.useFactory) {
var deps = provider.deps || provider.useFactory.diDeps;
transformedDeps =
deps.map(function (dep) { return _this._getDependency(dep, eager, resolvedProvider.sourceSpan); });
}
else if (provider.useClass) {
var deps = provider.deps || provider.useClass.diDeps;
transformedDeps =
deps.map(function (dep) { return _this._getDependency(dep, eager, resolvedProvider.sourceSpan); });
}
return _transformProvider(provider, {
useExisting: transformedUseExisting,
useValue: transformedUseValue,
deps: transformedDeps
});
});
transformedProviderAst =
_transformProviderAst(resolvedProvider, { eager: eager, providers: transformedProviders });
this._transformedProviders.set(tokenReference(token), transformedProviderAst);
return transformedProviderAst;
};
NgModuleProviderAnalyzer.prototype._getDependency = function (dep, eager, requestorSourceSpan) {
if (eager === void 0) { eager = false; }
if (!dep.isSkipSelf && dep.token != null) {
// access the injector
if (tokenReference(dep.token) ===
this.reflector.resolveExternalReference(Identifiers.Injector) ||
tokenReference(dep.token) ===
this.reflector.resolveExternalReference(Identifiers.ComponentFactoryResolver)) ;
else if (this._getOrCreateLocalProvider(dep.token, eager) != null) ;
}
return dep;
};
return NgModuleProviderAnalyzer;
}());
function _transformProvider(provider, _a) {
var useExisting = _a.useExisting, useValue = _a.useValue, deps = _a.deps;
return {
token: provider.token,
useClass: provider.useClass,
useExisting: useExisting,
useFactory: provider.useFactory,
useValue: useValue,
deps: deps,
multi: provider.multi
};
}
function _transformProviderAst(provider, _a) {
var eager = _a.eager, providers = _a.providers;
return new ProviderAst(provider.token, provider.multiProvider, provider.eager || eager, providers, provider.providerType, provider.lifecycleHooks, provider.sourceSpan, provider.isModule);
}
function _resolveProvidersFromDirectives(directives, sourceSpan, targetErrors) {
var providersByToken = new Map();
directives.forEach(function (directive) {
var dirProvider = { token: { identifier: directive.type }, useClass: directive.type };
_resolveProviders([dirProvider], directive.isComponent ? ProviderAstType.Component : ProviderAstType.Directive, true, sourceSpan, targetErrors, providersByToken, /* isModule */ false);
});
// Note: directives need to be able to overwrite providers of a component!
var directivesWithComponentFirst = directives.filter(function (dir) { return dir.isComponent; }).concat(directives.filter(function (dir) { return !dir.isComponent; }));
directivesWithComponentFirst.forEach(function (directive) {
_resolveProviders(directive.providers, ProviderAstType.PublicService, false, sourceSpan, targetErrors, providersByToken, /* isModule */ false);
_resolveProviders(directive.viewProviders, ProviderAstType.PrivateService, false, sourceSpan, targetErrors, providersByToken, /* isModule */ false);
});
return providersByToken;
}
function _resolveProviders(providers, providerType, eager, sourceSpan, targetErrors, targetProvidersByToken, isModule) {
providers.forEach(function (provider) {
var resolvedProvider = targetProvidersByToken.get(tokenReference(provider.token));
if (resolvedProvider != null && !!resolvedProvider.multiProvider !== !!provider.multi) {
targetErrors.push(new ProviderError("Mixing multi and non multi provider is not possible for token " + tokenName(resolvedProvider.token), sourceSpan));
}
if (!resolvedProvider) {
var lifecycleHooks = provider.token.identifier &&
provider.token.identifier.lifecycleHooks ?
provider.token.identifier.lifecycleHooks :
[];
var isUseValue = !(provider.useClass || provider.useExisting || provider.useFactory);
resolvedProvider = new ProviderAst(provider.token, !!provider.multi, eager || isUseValue, [provider], providerType, lifecycleHooks, sourceSpan, isModule);
targetProvidersByToken.set(tokenReference(provider.token), resolvedProvider);
}
else {
if (!provider.multi) {
resolvedProvider.providers.length = 0;
}
resolvedProvider.providers.push(provider);
}
});
}
function _getViewQueries(component) {
// Note: queries start with id 1 so we can use the number in a Bloom filter!
var viewQueryId = 1;
var viewQueries = new Map();
if (component.viewQueries) {
component.viewQueries.forEach(function (query) { return _addQueryToTokenMap(viewQueries, { meta: query, queryId: viewQueryId++ }); });
}
return viewQueries;
}
function _getContentQueries(contentQueryStartId, directives) {
var contentQueryId = contentQueryStartId;
var contentQueries = new Map();
directives.forEach(function (directive, directiveIndex) {
if (directive.queries) {
directive.queries.forEach(function (query) { return _addQueryToTokenMap(contentQueries, { meta: query, queryId: contentQueryId++ }); });
}
});
return contentQueries;
}
function _addQueryToTokenMap(map, query) {
query.meta.selectors.forEach(function (token) {
var entry = map.get(tokenReference(token));
if (!entry) {
entry = [];
map.set(tokenReference(token), entry);
}
entry.push(query);
});
}
/**
* @license
* Copyright Google Inc. 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
*/
function providerDef(ctx, providerAst) {
var flags = 0 /* None */;
if (!providerAst.eager) {
flags |= 4096 /* LazyProvider */;
}
if (providerAst.providerType === ProviderAstType.PrivateService) {
flags |= 8192 /* PrivateProvider */;
}
if (providerAst.isModule) {
flags |= 1073741824 /* TypeModuleProvider */;
}
providerAst.lifecycleHooks.forEach(function (lifecycleHook) {
// for regular providers, we only support ngOnDestroy
if (lifecycleHook === LifecycleHooks.OnDestroy ||
providerAst.providerType === ProviderAstType.Directive ||
providerAst.providerType === ProviderAstType.Component) {
flags |= lifecycleHookToNodeFlag(lifecycleHook);
}
});
var _a = providerAst.multiProvider ?
multiProviderDef(ctx, flags, providerAst.providers) :
singleProviderDef(ctx, flags, providerAst.providerType, providerAst.providers[0]), providerExpr = _a.providerExpr, providerFlags = _a.flags, depsExpr = _a.depsExpr;
return {
providerExpr: providerExpr,
flags: providerFlags, depsExpr: depsExpr,
tokenExpr: tokenExpr(ctx, providerAst.token),
};
}
function multiProviderDef(ctx, flags, providers) {
var allDepDefs = [];
var allParams = [];
var exprs = providers.map(function (provider, providerIndex) {
var expr;
if (provider.useClass) {
var depExprs = convertDeps(providerIndex, provider.deps || provider.useClass.diDeps);
expr = ctx.importExpr(provider.useClass.reference).instantiate(depExprs);
}
else if (provider.useFactory) {
var depExprs = convertDeps(providerIndex, provider.deps || provider.useFactory.diDeps);
expr = ctx.importExpr(provider.useFactory.reference).callFn(depExprs);
}
else if (provider.useExisting) {
var depExprs = convertDeps(providerIndex, [{ token: provider.useExisting }]);
expr = depExprs[0];
}
else {
expr = convertValueToOutputAst(ctx, provider.useValue);
}
return expr;
});
var providerExpr = fn(allParams, [new ReturnStatement(literalArr(exprs))], INFERRED_TYPE);
return {
providerExpr: providerExpr,
flags: flags | 1024 /* TypeFactoryProvider */,
depsExpr: literalArr(allDepDefs)
};
function convertDeps(providerIndex, deps) {
return deps.map(function (dep, depIndex) {
var paramName = "p" + providerIndex + "_" + depIndex;
allParams.push(new FnParam(paramName, DYNAMIC_TYPE));
allDepDefs.push(depDef(ctx, dep));
return variable(paramName);
});
}
}
function singleProviderDef(ctx, flags, providerType, providerMeta) {
var providerExpr;
var deps;
if (providerType === ProviderAstType.Directive || providerType === ProviderAstType.Component) {
providerExpr = ctx.importExpr(providerMeta.useClass.reference);
flags |= 16384 /* TypeDirective */;
deps = providerMeta.deps || providerMeta.useClass.diDeps;
}
else {
if (providerMeta.useClass) {
providerExpr = ctx.importExpr(providerMeta.useClass.reference);
flags |= 512 /* TypeClassProvider */;
deps = providerMeta.deps || providerMeta.useClass.diDeps;
}
else if (providerMeta.useFactory) {
providerExpr = ctx.importExpr(providerMeta.useFactory.reference);
flags |= 1024 /* TypeFactoryProvider */;
deps = providerMeta.deps || providerMeta.useFactory.diDeps;
}
else if (providerMeta.useExisting) {
providerExpr = NULL_EXPR;
flags |= 2048 /* TypeUseExistingProvider */;
deps = [{ token: providerMeta.useExisting }];
}
else {
providerExpr = convertValueToOutputAst(ctx, providerMeta.useValue);
flags |= 256 /* TypeValueProvider */;
deps = [];
}
}
var depsExpr = literalArr(deps.map(function (dep) { return depDef(ctx, dep); }));
return { providerExpr: providerExpr, flags: flags, depsExpr: depsExpr };
}
function tokenExpr(ctx, tokenMeta) {
return tokenMeta.identifier ? ctx.importExpr(tokenMeta.identifier.reference) :
literal(tokenMeta.value);
}
function depDef(ctx, dep) {
// Note: the following fields have already been normalized out by provider_analyzer:
// - isAttribute, isHost
var expr = dep.isValue ? convertValueToOutputAst(ctx, dep.value) : tokenExpr(ctx, dep.token);
var flags = 0 /* None */;
if (dep.isSkipSelf) {
flags |= 1 /* SkipSelf */;
}
if (dep.isOptional) {
flags |= 2 /* Optional */;
}
if (dep.isSelf) {
flags |= 4 /* Self */;
}
if (dep.isValue) {
flags |= 8 /* Value */;
}
return flags === 0 /* None */ ? expr : literalArr([literal(flags), expr]);
}
function lifecycleHookToNodeFlag(lifecycleHook) {
var nodeFlag = 0 /* None */;
switch (lifecycleHook) {
case LifecycleHooks.AfterContentChecked:
nodeFlag = 2097152 /* AfterContentChecked */;
break;
case LifecycleHooks.AfterContentInit:
nodeFlag = 1048576 /* AfterContentInit */;
break;
case LifecycleHooks.AfterViewChecked:
nodeFlag = 8388608 /* AfterViewChecked */;
break;
case LifecycleHooks.AfterViewInit:
nodeFlag = 4194304 /* AfterViewInit */;
break;
case LifecycleHooks.DoCheck:
nodeFlag = 262144 /* DoCheck */;
break;
case LifecycleHooks.OnChanges:
nodeFlag = 524288 /* OnChanges */;
break;
case LifecycleHooks.OnDestroy:
nodeFlag = 131072 /* OnDestroy */;
break;
case LifecycleHooks.OnInit:
nodeFlag = 65536 /* OnInit */;
break;
}
return nodeFlag;
}
function componentFactoryResolverProviderDef(reflector, ctx, flags, entryComponents) {
var entryComponentFactories = entryComponents.map(function (entryComponent) { return ctx.importExpr(entryComponent.componentFactory); });
var token = createTokenForExternalReference(reflector, Identifiers.ComponentFactoryResolver);
var classMeta = {
diDeps: [
{ isValue: true, value: literalArr(entryComponentFactories) },
{ token: token, isSkipSelf: true, isOptional: true },
{ token: createTokenForExternalReference(reflector, Identifiers.NgModuleRef) },
],
lifecycleHooks: [],
reference: reflector.resolveExternalReference(Identifiers.CodegenComponentFactoryResolver)
};
var _a = singleProviderDef(ctx, flags, ProviderAstType.PrivateService, {
token: token,
multi: false,
useClass: classMeta,
}), providerExpr = _a.providerExpr, providerFlags = _a.flags, depsExpr = _a.depsExpr;
return { providerExpr: providerExpr, flags: providerFlags, depsExpr: depsExpr, tokenExpr: tokenExpr(ctx, token) };
}
/**
* @license
* Copyright Google Inc. 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 NgModuleCompileResult = /** @class */ (function () {
function NgModuleCompileResult(ngModuleFactoryVar) {
this.ngModuleFactoryVar = ngModuleFactoryVar;
}
return NgModuleCompileResult;
}());
var LOG_VAR = variable('_l');
var NgModuleCompiler = /** @class */ (function () {
function NgModuleCompiler(reflector) {
this.reflector = reflector;
}
NgModuleCompiler.prototype.compile = function (ctx, ngModuleMeta, extraProviders) {
var sourceSpan = typeSourceSpan('NgModule', ngModuleMeta.type);
var entryComponentFactories = ngModuleMeta.transitiveModule.entryComponents;
var bootstrapComponents = ngModuleMeta.bootstrapComponents;
var providerParser = new NgModuleProviderAnalyzer(this.reflector, ngModuleMeta, extraProviders, sourceSpan);
var providerDefs = [componentFactoryResolverProviderDef(this.reflector, ctx, 0 /* None */, entryComponentFactories)]
.concat(providerParser.parse().map(function (provider) { return providerDef(ctx, provider); }))
.map(function (_a) {
var providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, flags = _a.flags, tokenExpr = _a.tokenExpr;
return importExpr(Identifiers.moduleProviderDef).callFn([
literal(flags), tokenExpr, providerExpr, depsExpr
]);
});
var ngModuleDef = importExpr(Identifiers.moduleDef).callFn([literalArr(providerDefs)]);
var ngModuleDefFactory = fn([new FnParam(LOG_VAR.name)], [new ReturnStatement(ngModuleDef)], INFERRED_TYPE);
var ngModuleFactoryVar = identifierName(ngModuleMeta.type) + "NgFactory";
this._createNgModuleFactory(ctx, ngModuleMeta.type.reference, importExpr(Identifiers.createModuleFactory).callFn([
ctx.importExpr(ngModuleMeta.type.reference),
literalArr(bootstrapComponents.map(function (id) { return ctx.importExpr(id.reference); })),
ngModuleDefFactory
]));
if (ngModuleMeta.id) {
var id = typeof ngModuleMeta.id === 'string' ? literal(ngModuleMeta.id) :
ctx.importExpr(ngModuleMeta.id);
var registerFactoryStmt = importExpr(Identifiers.RegisterModuleFactoryFn)
.callFn([id, variable(ngModuleFactoryVar)])
.toStmt();
ctx.statements.push(registerFactoryStmt);
}
return new NgModuleCompileResult(ngModuleFactoryVar);
};
NgModuleCompiler.prototype.createStub = function (ctx, ngModuleReference) {
this._createNgModuleFactory(ctx, ngModuleReference, NULL_EXPR);
};
NgModuleCompiler.prototype._createNgModuleFactory = function (ctx, reference, value) {
var ngModuleFactoryVar = identifierName({ reference: reference }) + "NgFactory";
var ngModuleFactoryStmt = variable(ngModuleFactoryVar)
.set(value)
.toDeclStmt(importType(Identifiers.NgModuleFactory, [expressionType(ctx.importExpr(reference))], [TypeModifier.Const]), [StmtModifier.Final, StmtModifier.Exported]);
ctx.statements.push(ngModuleFactoryStmt);
};
return NgModuleCompiler;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Resolves types to {@link NgModule}.
*/
var NgModuleResolver = /** @class */ (function () {
function NgModuleResolver(_reflector) {
this._reflector = _reflector;
}
NgModuleResolver.prototype.isNgModule = function (type) { return this._reflector.annotations(type).some(createNgModule.isTypeOf); };
NgModuleResolver.prototype.resolve = function (type, throwIfNotFound) {
if (throwIfNotFound === void 0) { throwIfNotFound = true; }
var ngModuleMeta = findLast(this._reflector.annotations(type), createNgModule.isTypeOf);
if (ngModuleMeta) {
return ngModuleMeta;
}
else {
if (throwIfNotFound) {
throw new Error("No NgModule metadata found for '" + stringify(type) + "'.");
}
return null;
}
};
return NgModuleResolver;
}());
/**
* @license
* Copyright Google Inc. 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
*/
// https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
var VERSION$1 = 3;
var JS_B64_PREFIX = '# sourceMappingURL=data:application/json;base64,';
var SourceMapGenerator = /** @class */ (function () {
function SourceMapGenerator(file) {
if (file === void 0) { file = null; }
this.file = file;
this.sourcesContent = new Map();
this.lines = [];
this.lastCol0 = 0;
this.hasMappings = false;
}
// The content is `null` when the content is expected to be loaded using the URL
SourceMapGenerator.prototype.addSource = function (url, content) {
if (content === void 0) { content = null; }
if (!this.sourcesContent.has(url)) {
this.sourcesContent.set(url, content);
}
return this;
};
SourceMapGenerator.prototype.addLine = function () {
this.lines.push([]);
this.lastCol0 = 0;
return this;
};
SourceMapGenerator.prototype.addMapping = function (col0, sourceUrl, sourceLine0, sourceCol0) {
if (!this.currentLine) {
throw new Error("A line must be added before mappings can be added");
}
if (sourceUrl != null && !this.sourcesContent.has(sourceUrl)) {
throw new Error("Unknown source file \"" + sourceUrl + "\"");
}
if (col0 == null) {
throw new Error("The column in the generated code must be provided");
}
if (col0 < this.lastCol0) {
throw new Error("Mapping should be added in output order");
}
if (sourceUrl && (sourceLine0 == null || sourceCol0 == null)) {
throw new Error("The source location must be provided when a source url is provided");
}
this.hasMappings = true;
this.lastCol0 = col0;
this.currentLine.push({ col0: col0, sourceUrl: sourceUrl, sourceLine0: sourceLine0, sourceCol0: sourceCol0 });
return this;
};
Object.defineProperty(SourceMapGenerator.prototype, "currentLine", {
get: function () { return this.lines.slice(-1)[0]; },
enumerable: true,
configurable: true
});
SourceMapGenerator.prototype.toJSON = function () {
var _this = this;
if (!this.hasMappings) {
return null;
}
var sourcesIndex = new Map();
var sources = [];
var sourcesContent = [];
Array.from(this.sourcesContent.keys()).forEach(function (url, i) {
sourcesIndex.set(url, i);
sources.push(url);
sourcesContent.push(_this.sourcesContent.get(url) || null);
});
var mappings = '';
var lastCol0 = 0;
var lastSourceIndex = 0;
var lastSourceLine0 = 0;
var lastSourceCol0 = 0;
this.lines.forEach(function (segments) {
lastCol0 = 0;
mappings += segments
.map(function (segment) {
// zero-based starting column of the line in the generated code
var segAsStr = toBase64VLQ(segment.col0 - lastCol0);
lastCol0 = segment.col0;
if (segment.sourceUrl != null) {
// zero-based index into the “sources” list
segAsStr +=
toBase64VLQ(sourcesIndex.get(segment.sourceUrl) - lastSourceIndex);
lastSourceIndex = sourcesIndex.get(segment.sourceUrl);
// the zero-based starting line in the original source
segAsStr += toBase64VLQ(segment.sourceLine0 - lastSourceLine0);
lastSourceLine0 = segment.sourceLine0;
// the zero-based starting column in the original source
segAsStr += toBase64VLQ(segment.sourceCol0 - lastSourceCol0);
lastSourceCol0 = segment.sourceCol0;
}
return segAsStr;
})
.join(',');
mappings += ';';
});
mappings = mappings.slice(0, -1);
return {
'file': this.file || '',
'version': VERSION$1,
'sourceRoot': '',
'sources': sources,
'sourcesContent': sourcesContent,
'mappings': mappings,
};
};
SourceMapGenerator.prototype.toJsComment = function () {
return this.hasMappings ? '//' + JS_B64_PREFIX + toBase64String(JSON.stringify(this, null, 0)) :
'';
};
return SourceMapGenerator;
}());
function toBase64String(value) {
var b64 = '';
value = utf8Encode(value);
for (var i = 0; i < value.length;) {
var i1 = value.charCodeAt(i++);
var i2 = value.charCodeAt(i++);
var i3 = value.charCodeAt(i++);
b64 += toBase64Digit(i1 >> 2);
b64 += toBase64Digit(((i1 & 3) << 4) | (isNaN(i2) ? 0 : i2 >> 4));
b64 += isNaN(i2) ? '=' : toBase64Digit(((i2 & 15) << 2) | (i3 >> 6));
b64 += isNaN(i2) || isNaN(i3) ? '=' : toBase64Digit(i3 & 63);
}
return b64;
}
function toBase64VLQ(value) {
value = value < 0 ? ((-value) << 1) + 1 : value << 1;
var out = '';
do {
var digit = value & 31;
value = value >> 5;
if (value > 0) {
digit = digit | 32;
}
out += toBase64Digit(digit);
} while (value > 0);
return out;
}
var B64_DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
function toBase64Digit(value) {
if (value < 0 || value >= 64) {
throw new Error("Can only encode value in the range [0, 63]");
}
return B64_DIGITS[value];
}
/**
* @license
* Copyright Google Inc. 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 _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
var _INDENT_WITH = ' ';
var CATCH_ERROR_VAR$1 = variable('error', null, null);
var CATCH_STACK_VAR$1 = variable('stack', null, null);
var _EmittedLine = /** @class */ (function () {
function _EmittedLine(indent) {
this.indent = indent;
this.partsLength = 0;
this.parts = [];
this.srcSpans = [];
}
return _EmittedLine;
}());
var EmitterVisitorContext = /** @class */ (function () {
function EmitterVisitorContext(_indent) {
this._indent = _indent;
this._classes = [];
this._preambleLineCount = 0;
this._lines = [new _EmittedLine(_indent)];
}
EmitterVisitorContext.createRoot = function () { return new EmitterVisitorContext(0); };
Object.defineProperty(EmitterVisitorContext.prototype, "_currentLine", {
get: function () { return this._lines[this._lines.length - 1]; },
enumerable: true,
configurable: true
});
EmitterVisitorContext.prototype.println = function (from, lastPart) {
if (lastPart === void 0) { lastPart = ''; }
this.print(from || null, lastPart, true);
};
EmitterVisitorContext.prototype.lineIsEmpty = function () { return this._currentLine.parts.length === 0; };
EmitterVisitorContext.prototype.lineLength = function () {
return this._currentLine.indent * _INDENT_WITH.length + this._currentLine.partsLength;
};
EmitterVisitorContext.prototype.print = function (from, part, newLine) {
if (newLine === void 0) { newLine = false; }
if (part.length > 0) {
this._currentLine.parts.push(part);
this._currentLine.partsLength += part.length;
this._currentLine.srcSpans.push(from && from.sourceSpan || null);
}
if (newLine) {
this._lines.push(new _EmittedLine(this._indent));
}
};
EmitterVisitorContext.prototype.removeEmptyLastLine = function () {
if (this.lineIsEmpty()) {
this._lines.pop();
}
};
EmitterVisitorContext.prototype.incIndent = function () {
this._indent++;
if (this.lineIsEmpty()) {
this._currentLine.indent = this._indent;
}
};
EmitterVisitorContext.prototype.decIndent = function () {
this._indent--;
if (this.lineIsEmpty()) {
this._currentLine.indent = this._indent;
}
};
EmitterVisitorContext.prototype.pushClass = function (clazz) { this._classes.push(clazz); };
EmitterVisitorContext.prototype.popClass = function () { return this._classes.pop(); };
Object.defineProperty(EmitterVisitorContext.prototype, "currentClass", {
get: function () {
return this._classes.length > 0 ? this._classes[this._classes.length - 1] : null;
},
enumerable: true,
configurable: true
});
EmitterVisitorContext.prototype.toSource = function () {
return this.sourceLines
.map(function (l) { return l.parts.length > 0 ? _createIndent(l.indent) + l.parts.join('') : ''; })
.join('\n');
};
EmitterVisitorContext.prototype.toSourceMapGenerator = function (genFilePath, startsAtLine) {
if (startsAtLine === void 0) { startsAtLine = 0; }
var map = new SourceMapGenerator(genFilePath);
var firstOffsetMapped = false;
var mapFirstOffsetIfNeeded = function () {
if (!firstOffsetMapped) {
// Add a single space so that tools won't try to load the file from disk.
// Note: We are using virtual urls like `ng:///`, so we have to
// provide a content here.
map.addSource(genFilePath, ' ').addMapping(0, genFilePath, 0, 0);
firstOffsetMapped = true;
}
};
for (var i = 0; i < startsAtLine; i++) {
map.addLine();
mapFirstOffsetIfNeeded();
}
this.sourceLines.forEach(function (line, lineIdx) {
map.addLine();
var spans = line.srcSpans;
var parts = line.parts;
var col0 = line.indent * _INDENT_WITH.length;
var spanIdx = 0;
// skip leading parts without source spans
while (spanIdx < spans.length && !spans[spanIdx]) {
col0 += parts[spanIdx].length;
spanIdx++;
}
if (spanIdx < spans.length && lineIdx === 0 && col0 === 0) {
firstOffsetMapped = true;
}
else {
mapFirstOffsetIfNeeded();
}
while (spanIdx < spans.length) {
var span = spans[spanIdx];
var source = span.start.file;
var sourceLine = span.start.line;
var sourceCol = span.start.col;
map.addSource(source.url, source.content)
.addMapping(col0, source.url, sourceLine, sourceCol);
col0 += parts[spanIdx].length;
spanIdx++;
// assign parts without span or the same span to the previous segment
while (spanIdx < spans.length && (span === spans[spanIdx] || !spans[spanIdx])) {
col0 += parts[spanIdx].length;
spanIdx++;
}
}
});
return map;
};
EmitterVisitorContext.prototype.setPreambleLineCount = function (count) { return this._preambleLineCount = count; };
EmitterVisitorContext.prototype.spanOf = function (line, column) {
var emittedLine = this._lines[line - this._preambleLineCount];
if (emittedLine) {
var columnsLeft = column - _createIndent(emittedLine.indent).length;
for (var partIndex = 0; partIndex < emittedLine.parts.length; partIndex++) {
var part = emittedLine.parts[partIndex];
if (part.length > columnsLeft) {
return emittedLine.srcSpans[partIndex];
}
columnsLeft -= part.length;
}
}
return null;
};
Object.defineProperty(EmitterVisitorContext.prototype, "sourceLines", {
get: function () {
if (this._lines.length && this._lines[this._lines.length - 1].parts.length === 0) {
return this._lines.slice(0, -1);
}
return this._lines;
},
enumerable: true,
configurable: true
});
return EmitterVisitorContext;
}());
var AbstractEmitterVisitor = /** @class */ (function () {
function AbstractEmitterVisitor(_escapeDollarInStrings) {
this._escapeDollarInStrings = _escapeDollarInStrings;
}
AbstractEmitterVisitor.prototype.visitExpressionStmt = function (stmt, ctx) {
stmt.expr.visitExpression(this, ctx);
ctx.println(stmt, ';');
return null;
};
AbstractEmitterVisitor.prototype.visitReturnStmt = function (stmt, ctx) {
ctx.print(stmt, "return ");
stmt.value.visitExpression(this, ctx);
ctx.println(stmt, ';');
return null;
};
AbstractEmitterVisitor.prototype.visitIfStmt = function (stmt, ctx) {
ctx.print(stmt, "if (");
stmt.condition.visitExpression(this, ctx);
ctx.print(stmt, ") {");
var hasElseCase = stmt.falseCase != null && stmt.falseCase.length > 0;
if (stmt.trueCase.length <= 1 && !hasElseCase) {
ctx.print(stmt, " ");
this.visitAllStatements(stmt.trueCase, ctx);
ctx.removeEmptyLastLine();
ctx.print(stmt, " ");
}
else {
ctx.println();
ctx.incIndent();
this.visitAllStatements(stmt.trueCase, ctx);
ctx.decIndent();
if (hasElseCase) {
ctx.println(stmt, "} else {");
ctx.incIndent();
this.visitAllStatements(stmt.falseCase, ctx);
ctx.decIndent();
}
}
ctx.println(stmt, "}");
return null;
};
AbstractEmitterVisitor.prototype.visitThrowStmt = function (stmt, ctx) {
ctx.print(stmt, "throw ");
stmt.error.visitExpression(this, ctx);
ctx.println(stmt, ";");
return null;
};
AbstractEmitterVisitor.prototype.visitCommentStmt = function (stmt, ctx) {
if (stmt.multiline) {
ctx.println(stmt, "/* " + stmt.comment + " */");
}
else {
stmt.comment.split('\n').forEach(function (line) { ctx.println(stmt, "// " + line); });
}
return null;
};
AbstractEmitterVisitor.prototype.visitJSDocCommentStmt = function (stmt, ctx) {
ctx.println(stmt, "/*" + stmt.toString() + "*/");
return null;
};
AbstractEmitterVisitor.prototype.visitWriteVarExpr = function (expr, ctx) {
var lineWasEmpty = ctx.lineIsEmpty();
if (!lineWasEmpty) {
ctx.print(expr, '(');
}
ctx.print(expr, expr.name + " = ");
expr.value.visitExpression(this, ctx);
if (!lineWasEmpty) {
ctx.print(expr, ')');
}
return null;
};
AbstractEmitterVisitor.prototype.visitWriteKeyExpr = function (expr, ctx) {
var lineWasEmpty = ctx.lineIsEmpty();
if (!lineWasEmpty) {
ctx.print(expr, '(');
}
expr.receiver.visitExpression(this, ctx);
ctx.print(expr, "[");
expr.index.visitExpression(this, ctx);
ctx.print(expr, "] = ");
expr.value.visitExpression(this, ctx);
if (!lineWasEmpty) {
ctx.print(expr, ')');
}
return null;
};
AbstractEmitterVisitor.prototype.visitWritePropExpr = function (expr, ctx) {
var lineWasEmpty = ctx.lineIsEmpty();
if (!lineWasEmpty) {
ctx.print(expr, '(');
}
expr.receiver.visitExpression(this, ctx);
ctx.print(expr, "." + expr.name + " = ");
expr.value.visitExpression(this, ctx);
if (!lineWasEmpty) {
ctx.print(expr, ')');
}
return null;
};
AbstractEmitterVisitor.prototype.visitInvokeMethodExpr = function (expr, ctx) {
expr.receiver.visitExpression(this, ctx);
var name = expr.name;
if (expr.builtin != null) {
name = this.getBuiltinMethodName(expr.builtin);
if (name == null) {
// some builtins just mean to skip the call.
return null;
}
}
ctx.print(expr, "." + name + "(");
this.visitAllExpressions(expr.args, ctx, ",");
ctx.print(expr, ")");
return null;
};
AbstractEmitterVisitor.prototype.visitInvokeFunctionExpr = function (expr, ctx) {
expr.fn.visitExpression(this, ctx);
ctx.print(expr, "(");
this.visitAllExpressions(expr.args, ctx, ',');
ctx.print(expr, ")");
return null;
};
AbstractEmitterVisitor.prototype.visitReadVarExpr = function (ast, ctx) {
var varName = ast.name;
if (ast.builtin != null) {
switch (ast.builtin) {
case BuiltinVar.Super:
varName = 'super';
break;
case BuiltinVar.This:
varName = 'this';
break;
case BuiltinVar.CatchError:
varName = CATCH_ERROR_VAR$1.name;
break;
case BuiltinVar.CatchStack:
varName = CATCH_STACK_VAR$1.name;
break;
default:
throw new Error("Unknown builtin variable " + ast.builtin);
}
}
ctx.print(ast, varName);
return null;
};
AbstractEmitterVisitor.prototype.visitInstantiateExpr = function (ast, ctx) {
ctx.print(ast, "new ");
ast.classExpr.visitExpression(this, ctx);
ctx.print(ast, "(");
this.visitAllExpressions(ast.args, ctx, ',');
ctx.print(ast, ")");
return null;
};
AbstractEmitterVisitor.prototype.visitLiteralExpr = function (ast, ctx) {
var value = ast.value;
if (typeof value === 'string') {
ctx.print(ast, escapeIdentifier(value, this._escapeDollarInStrings));
}
else {
ctx.print(ast, "" + value);
}
return null;
};
AbstractEmitterVisitor.prototype.visitConditionalExpr = function (ast, ctx) {
ctx.print(ast, "(");
ast.condition.visitExpression(this, ctx);
ctx.print(ast, '? ');
ast.trueCase.visitExpression(this, ctx);
ctx.print(ast, ': ');
ast.falseCase.visitExpression(this, ctx);
ctx.print(ast, ")");
return null;
};
AbstractEmitterVisitor.prototype.visitNotExpr = function (ast, ctx) {
ctx.print(ast, '!');
ast.condition.visitExpression(this, ctx);
return null;
};
AbstractEmitterVisitor.prototype.visitAssertNotNullExpr = function (ast, ctx) {
ast.condition.visitExpression(this, ctx);
return null;
};
AbstractEmitterVisitor.prototype.visitBinaryOperatorExpr = function (ast, ctx) {
var opStr;
switch (ast.operator) {
case BinaryOperator.Equals:
opStr = '==';
break;
case BinaryOperator.Identical:
opStr = '===';
break;
case BinaryOperator.NotEquals:
opStr = '!=';
break;
case BinaryOperator.NotIdentical:
opStr = '!==';
break;
case BinaryOperator.And:
opStr = '&&';
break;
case BinaryOperator.BitwiseAnd:
opStr = '&';
break;
case BinaryOperator.Or:
opStr = '||';
break;
case BinaryOperator.Plus:
opStr = '+';
break;
case BinaryOperator.Minus:
opStr = '-';
break;
case BinaryOperator.Divide:
opStr = '/';
break;
case BinaryOperator.Multiply:
opStr = '*';
break;
case BinaryOperator.Modulo:
opStr = '%';
break;
case BinaryOperator.Lower:
opStr = '<';
break;
case BinaryOperator.LowerEquals:
opStr = '<=';
break;
case BinaryOperator.Bigger:
opStr = '>';
break;
case BinaryOperator.BiggerEquals:
opStr = '>=';
break;
default:
throw new Error("Unknown operator " + ast.operator);
}
if (ast.parens)
ctx.print(ast, "(");
ast.lhs.visitExpression(this, ctx);
ctx.print(ast, " " + opStr + " ");
ast.rhs.visitExpression(this, ctx);
if (ast.parens)
ctx.print(ast, ")");
return null;
};
AbstractEmitterVisitor.prototype.visitReadPropExpr = function (ast, ctx) {
ast.receiver.visitExpression(this, ctx);
ctx.print(ast, ".");
ctx.print(ast, ast.name);
return null;
};
AbstractEmitterVisitor.prototype.visitReadKeyExpr = function (ast, ctx) {
ast.receiver.visitExpression(this, ctx);
ctx.print(ast, "[");
ast.index.visitExpression(this, ctx);
ctx.print(ast, "]");
return null;
};
AbstractEmitterVisitor.prototype.visitLiteralArrayExpr = function (ast, ctx) {
ctx.print(ast, "[");
this.visitAllExpressions(ast.entries, ctx, ',');
ctx.print(ast, "]");
return null;
};
AbstractEmitterVisitor.prototype.visitLiteralMapExpr = function (ast, ctx) {
var _this = this;
ctx.print(ast, "{");
this.visitAllObjects(function (entry) {
ctx.print(ast, escapeIdentifier(entry.key, _this._escapeDollarInStrings, entry.quoted) + ":");
entry.value.visitExpression(_this, ctx);
}, ast.entries, ctx, ',');
ctx.print(ast, "}");
return null;
};
AbstractEmitterVisitor.prototype.visitCommaExpr = function (ast, ctx) {
ctx.print(ast, '(');
this.visitAllExpressions(ast.parts, ctx, ',');
ctx.print(ast, ')');
return null;
};
AbstractEmitterVisitor.prototype.visitAllExpressions = function (expressions, ctx, separator) {
var _this = this;
this.visitAllObjects(function (expr) { return expr.visitExpression(_this, ctx); }, expressions, ctx, separator);
};
AbstractEmitterVisitor.prototype.visitAllObjects = function (handler, expressions, ctx, separator) {
var incrementedIndent = false;
for (var i = 0; i < expressions.length; i++) {
if (i > 0) {
if (ctx.lineLength() > 80) {
ctx.print(null, separator, true);
if (!incrementedIndent) {
// continuation are marked with double indent.
ctx.incIndent();
ctx.incIndent();
incrementedIndent = true;
}
}
else {
ctx.print(null, separator, false);
}
}
handler(expressions[i]);
}
if (incrementedIndent) {
// continuation are marked with double indent.
ctx.decIndent();
ctx.decIndent();
}
};
AbstractEmitterVisitor.prototype.visitAllStatements = function (statements, ctx) {
var _this = this;
statements.forEach(function (stmt) { return stmt.visitStatement(_this, ctx); });
};
return AbstractEmitterVisitor;
}());
function escapeIdentifier(input, escapeDollar, alwaysQuote) {
if (alwaysQuote === void 0) { alwaysQuote = true; }
if (input == null) {
return null;
}
var body = input.replace(_SINGLE_QUOTE_ESCAPE_STRING_RE, function () {
var match = [];
for (var _i = 0; _i < arguments.length; _i++) {
match[_i] = arguments[_i];
}
if (match[0] == '$') {
return escapeDollar ? '\\$' : '$';
}
else if (match[0] == '\n') {
return '\\n';
}
else if (match[0] == '\r') {
return '\\r';
}
else {
return "\\" + match[0];
}
});
var requiresQuotes = alwaysQuote || !_LEGAL_IDENTIFIER_RE.test(body);
return requiresQuotes ? "'" + body + "'" : body;
}
function _createIndent(count) {
var res = '';
for (var i = 0; i < count; i++) {
res += _INDENT_WITH;
}
return res;
}
/**
* @license
* Copyright Google Inc. 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
*/
function debugOutputAstAsTypeScript(ast) {
var converter = new _TsEmitterVisitor();
var ctx = EmitterVisitorContext.createRoot();
var asts = Array.isArray(ast) ? ast : [ast];
asts.forEach(function (ast) {
if (ast instanceof Statement) {
ast.visitStatement(converter, ctx);
}
else if (ast instanceof Expression) {
ast.visitExpression(converter, ctx);
}
else if (ast instanceof Type$1) {
ast.visitType(converter, ctx);
}
else {
throw new Error("Don't know how to print debug info for " + ast);
}
});
return ctx.toSource();
}
var TypeScriptEmitter = /** @class */ (function () {
function TypeScriptEmitter() {
}
TypeScriptEmitter.prototype.emitStatementsAndContext = function (genFilePath, stmts, preamble, emitSourceMaps, referenceFilter, importFilter) {
if (preamble === void 0) { preamble = ''; }
if (emitSourceMaps === void 0) { emitSourceMaps = true; }
var converter = new _TsEmitterVisitor(referenceFilter, importFilter);
var ctx = EmitterVisitorContext.createRoot();
converter.visitAllStatements(stmts, ctx);
var preambleLines = preamble ? preamble.split('\n') : [];
converter.reexports.forEach(function (reexports, exportedModuleName) {
var reexportsCode = reexports.map(function (reexport) { return reexport.name + " as " + reexport.as; }).join(',');
preambleLines.push("export {" + reexportsCode + "} from '" + exportedModuleName + "';");
});
converter.importsWithPrefixes.forEach(function (prefix, importedModuleName) {
// Note: can't write the real word for import as it screws up system.js auto detection...
preambleLines.push("imp" +
("ort * as " + prefix + " from '" + importedModuleName + "';"));
});
var sm = emitSourceMaps ?
ctx.toSourceMapGenerator(genFilePath, preambleLines.length).toJsComment() :
'';
var lines = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(preambleLines, [ctx.toSource(), sm]);
if (sm) {
// always add a newline at the end, as some tools have bugs without it.
lines.push('');
}
ctx.setPreambleLineCount(preambleLines.length);
return { sourceText: lines.join('\n'), context: ctx };
};
TypeScriptEmitter.prototype.emitStatements = function (genFilePath, stmts, preamble) {
if (preamble === void 0) { preamble = ''; }
return this.emitStatementsAndContext(genFilePath, stmts, preamble).sourceText;
};
return TypeScriptEmitter;
}());
var _TsEmitterVisitor = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(_TsEmitterVisitor, _super);
function _TsEmitterVisitor(referenceFilter, importFilter) {
var _this = _super.call(this, false) || this;
_this.referenceFilter = referenceFilter;
_this.importFilter = importFilter;
_this.typeExpression = 0;
_this.importsWithPrefixes = new Map();
_this.reexports = new Map();
return _this;
}
_TsEmitterVisitor.prototype.visitType = function (t, ctx, defaultType) {
if (defaultType === void 0) { defaultType = 'any'; }
if (t) {
this.typeExpression++;
t.visitType(this, ctx);
this.typeExpression--;
}
else {
ctx.print(null, defaultType);
}
};
_TsEmitterVisitor.prototype.visitLiteralExpr = function (ast, ctx) {
var value = ast.value;
if (value == null && ast.type != INFERRED_TYPE) {
ctx.print(ast, "(" + value + " as any)");
return null;
}
return _super.prototype.visitLiteralExpr.call(this, ast, ctx);
};
// Temporary workaround to support strictNullCheck enabled consumers of ngc emit.
// In SNC mode, [] have the type never[], so we cast here to any[].
// TODO: narrow the cast to a more explicit type, or use a pattern that does not
// start with [].concat. see https://github.com/angular/angular/pull/11846
_TsEmitterVisitor.prototype.visitLiteralArrayExpr = function (ast, ctx) {
if (ast.entries.length === 0) {
ctx.print(ast, '(');
}
var result = _super.prototype.visitLiteralArrayExpr.call(this, ast, ctx);
if (ast.entries.length === 0) {
ctx.print(ast, ' as any[])');
}
return result;
};
_TsEmitterVisitor.prototype.visitExternalExpr = function (ast, ctx) {
this._visitIdentifier(ast.value, ast.typeParams, ctx);
return null;
};
_TsEmitterVisitor.prototype.visitAssertNotNullExpr = function (ast, ctx) {
var result = _super.prototype.visitAssertNotNullExpr.call(this, ast, ctx);
ctx.print(ast, '!');
return result;
};
_TsEmitterVisitor.prototype.visitDeclareVarStmt = function (stmt, ctx) {
if (stmt.hasModifier(StmtModifier.Exported) && stmt.value instanceof ExternalExpr &&
!stmt.type) {
// check for a reexport
var _a = stmt.value.value, name_1 = _a.name, moduleName = _a.moduleName;
if (moduleName) {
var reexports = this.reexports.get(moduleName);
if (!reexports) {
reexports = [];
this.reexports.set(moduleName, reexports);
}
reexports.push({ name: name_1, as: stmt.name });
return null;
}
}
if (stmt.hasModifier(StmtModifier.Exported)) {
ctx.print(stmt, "export ");
}
if (stmt.hasModifier(StmtModifier.Final)) {
ctx.print(stmt, "const");
}
else {
ctx.print(stmt, "var");
}
ctx.print(stmt, " " + stmt.name);
this._printColonType(stmt.type, ctx);
if (stmt.value) {
ctx.print(stmt, " = ");
stmt.value.visitExpression(this, ctx);
}
ctx.println(stmt, ";");
return null;
};
_TsEmitterVisitor.prototype.visitCastExpr = function (ast, ctx) {
ctx.print(ast, "(<");
ast.type.visitType(this, ctx);
ctx.print(ast, ">");
ast.value.visitExpression(this, ctx);
ctx.print(ast, ")");
return null;
};
_TsEmitterVisitor.prototype.visitInstantiateExpr = function (ast, ctx) {
ctx.print(ast, "new ");
this.typeExpression++;
ast.classExpr.visitExpression(this, ctx);
this.typeExpression--;
ctx.print(ast, "(");
this.visitAllExpressions(ast.args, ctx, ',');
ctx.print(ast, ")");
return null;
};
_TsEmitterVisitor.prototype.visitDeclareClassStmt = function (stmt, ctx) {
var _this = this;
ctx.pushClass(stmt);
if (stmt.hasModifier(StmtModifier.Exported)) {
ctx.print(stmt, "export ");
}
ctx.print(stmt, "class " + stmt.name);
if (stmt.parent != null) {
ctx.print(stmt, " extends ");
this.typeExpression++;
stmt.parent.visitExpression(this, ctx);
this.typeExpression--;
}
ctx.println(stmt, " {");
ctx.incIndent();
stmt.fields.forEach(function (field) { return _this._visitClassField(field, ctx); });
if (stmt.constructorMethod != null) {
this._visitClassConstructor(stmt, ctx);
}
stmt.getters.forEach(function (getter) { return _this._visitClassGetter(getter, ctx); });
stmt.methods.forEach(function (method) { return _this._visitClassMethod(method, ctx); });
ctx.decIndent();
ctx.println(stmt, "}");
ctx.popClass();
return null;
};
_TsEmitterVisitor.prototype._visitClassField = function (field, ctx) {
if (field.hasModifier(StmtModifier.Private)) {
// comment out as a workaround for #10967
ctx.print(null, "/*private*/ ");
}
if (field.hasModifier(StmtModifier.Static)) {
ctx.print(null, 'static ');
}
ctx.print(null, field.name);
this._printColonType(field.type, ctx);
if (field.initializer) {
ctx.print(null, ' = ');
field.initializer.visitExpression(this, ctx);
}
ctx.println(null, ";");
};
_TsEmitterVisitor.prototype._visitClassGetter = function (getter, ctx) {
if (getter.hasModifier(StmtModifier.Private)) {
ctx.print(null, "private ");
}
ctx.print(null, "get " + getter.name + "()");
this._printColonType(getter.type, ctx);
ctx.println(null, " {");
ctx.incIndent();
this.visitAllStatements(getter.body, ctx);
ctx.decIndent();
ctx.println(null, "}");
};
_TsEmitterVisitor.prototype._visitClassConstructor = function (stmt, ctx) {
ctx.print(stmt, "constructor(");
this._visitParams(stmt.constructorMethod.params, ctx);
ctx.println(stmt, ") {");
ctx.incIndent();
this.visitAllStatements(stmt.constructorMethod.body, ctx);
ctx.decIndent();
ctx.println(stmt, "}");
};
_TsEmitterVisitor.prototype._visitClassMethod = function (method, ctx) {
if (method.hasModifier(StmtModifier.Private)) {
ctx.print(null, "private ");
}
ctx.print(null, method.name + "(");
this._visitParams(method.params, ctx);
ctx.print(null, ")");
this._printColonType(method.type, ctx, 'void');
ctx.println(null, " {");
ctx.incIndent();
this.visitAllStatements(method.body, ctx);
ctx.decIndent();
ctx.println(null, "}");
};
_TsEmitterVisitor.prototype.visitFunctionExpr = function (ast, ctx) {
if (ast.name) {
ctx.print(ast, 'function ');
ctx.print(ast, ast.name);
}
ctx.print(ast, "(");
this._visitParams(ast.params, ctx);
ctx.print(ast, ")");
this._printColonType(ast.type, ctx, 'void');
if (!ast.name) {
ctx.print(ast, " => ");
}
ctx.println(ast, '{');
ctx.incIndent();
this.visitAllStatements(ast.statements, ctx);
ctx.decIndent();
ctx.print(ast, "}");
return null;
};
_TsEmitterVisitor.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {
if (stmt.hasModifier(StmtModifier.Exported)) {
ctx.print(stmt, "export ");
}
ctx.print(stmt, "function " + stmt.name + "(");
this._visitParams(stmt.params, ctx);
ctx.print(stmt, ")");
this._printColonType(stmt.type, ctx, 'void');
ctx.println(stmt, " {");
ctx.incIndent();
this.visitAllStatements(stmt.statements, ctx);
ctx.decIndent();
ctx.println(stmt, "}");
return null;
};
_TsEmitterVisitor.prototype.visitTryCatchStmt = function (stmt, ctx) {
ctx.println(stmt, "try {");
ctx.incIndent();
this.visitAllStatements(stmt.bodyStmts, ctx);
ctx.decIndent();
ctx.println(stmt, "} catch (" + CATCH_ERROR_VAR$1.name + ") {");
ctx.incIndent();
var catchStmts = [CATCH_STACK_VAR$1.set(CATCH_ERROR_VAR$1.prop('stack', null)).toDeclStmt(null, [
StmtModifier.Final
])].concat(stmt.catchStmts);
this.visitAllStatements(catchStmts, ctx);
ctx.decIndent();
ctx.println(stmt, "}");
return null;
};
_TsEmitterVisitor.prototype.visitBuiltinType = function (type, ctx) {
var typeStr;
switch (type.name) {
case BuiltinTypeName.Bool:
typeStr = 'boolean';
break;
case BuiltinTypeName.Dynamic:
typeStr = 'any';
break;
case BuiltinTypeName.Function:
typeStr = 'Function';
break;
case BuiltinTypeName.Number:
typeStr = 'number';
break;
case BuiltinTypeName.Int:
typeStr = 'number';
break;
case BuiltinTypeName.String:
typeStr = 'string';
break;
default:
throw new Error("Unsupported builtin type " + type.name);
}
ctx.print(null, typeStr);
return null;
};
_TsEmitterVisitor.prototype.visitExpressionType = function (ast, ctx) {
ast.value.visitExpression(this, ctx);
return null;
};
_TsEmitterVisitor.prototype.visitArrayType = function (type, ctx) {
this.visitType(type.of, ctx);
ctx.print(null, "[]");
return null;
};
_TsEmitterVisitor.prototype.visitMapType = function (type, ctx) {
ctx.print(null, "{[key: string]:");
this.visitType(type.valueType, ctx);
ctx.print(null, "}");
return null;
};
_TsEmitterVisitor.prototype.getBuiltinMethodName = function (method) {
var name;
switch (method) {
case BuiltinMethod.ConcatArray:
name = 'concat';
break;
case BuiltinMethod.SubscribeObservable:
name = 'subscribe';
break;
case BuiltinMethod.Bind:
name = 'bind';
break;
default:
throw new Error("Unknown builtin method: " + method);
}
return name;
};
_TsEmitterVisitor.prototype._visitParams = function (params, ctx) {
var _this = this;
this.visitAllObjects(function (param) {
ctx.print(null, param.name);
_this._printColonType(param.type, ctx);
}, params, ctx, ',');
};
_TsEmitterVisitor.prototype._visitIdentifier = function (value, typeParams, ctx) {
var _this = this;
var name = value.name, moduleName = value.moduleName;
if (this.referenceFilter && this.referenceFilter(value)) {
ctx.print(null, '(null as any)');
return;
}
if (moduleName && (!this.importFilter || !this.importFilter(value))) {
var prefix = this.importsWithPrefixes.get(moduleName);
if (prefix == null) {
prefix = "i" + this.importsWithPrefixes.size;
this.importsWithPrefixes.set(moduleName, prefix);
}
ctx.print(null, prefix + ".");
}
ctx.print(null, name);
if (this.typeExpression > 0) {
// If we are in a type expression that refers to a generic type then supply
// the required type parameters. If there were not enough type parameters
// supplied, supply any as the type. Outside a type expression the reference
// should not supply type parameters and be treated as a simple value reference
// to the constructor function itself.
var suppliedParameters = typeParams || [];
if (suppliedParameters.length > 0) {
ctx.print(null, "<");
this.visitAllObjects(function (type) { return type.visitType(_this, ctx); }, typeParams, ctx, ',');
ctx.print(null, ">");
}
}
};
_TsEmitterVisitor.prototype._printColonType = function (type, ctx, defaultType) {
if (type !== INFERRED_TYPE) {
ctx.print(null, ':');
this.visitType(type, ctx, defaultType);
}
};
return _TsEmitterVisitor;
}(AbstractEmitterVisitor));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Resolve a `Type` for {@link Pipe}.
*
* This interface can be overridden by the application developer to create custom behavior.
*
* See {@link Compiler}
*/
var PipeResolver = /** @class */ (function () {
function PipeResolver(_reflector) {
this._reflector = _reflector;
}
PipeResolver.prototype.isPipe = function (type) {
var typeMetadata = this._reflector.annotations(resolveForwardRef(type));
return typeMetadata && typeMetadata.some(createPipe.isTypeOf);
};
/**
* Return {@link Pipe} for a given `Type`.
*/
PipeResolver.prototype.resolve = function (type, throwIfNotFound) {
if (throwIfNotFound === void 0) { throwIfNotFound = true; }
var metas = this._reflector.annotations(resolveForwardRef(type));
if (metas) {
var annotation = findLast(metas, createPipe.isTypeOf);
if (annotation) {
return annotation;
}
}
if (throwIfNotFound) {
throw new Error("No Pipe decorator found on " + stringify(type));
}
return null;
};
return PipeResolver;
}());
/**
* @license
* Copyright Google Inc. 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
*/
// =================================================================================================
// =================================================================================================
// =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P ===========
// =================================================================================================
// =================================================================================================
//
// DO NOT EDIT THIS LIST OF SECURITY SENSITIVE PROPERTIES WITHOUT A SECURITY REVIEW!
// Reach out to mprobst for details.
//
// =================================================================================================
/** Map from tagName|propertyName SecurityContext. Properties applying to all tags use '*'. */
var SECURITY_SCHEMA = {};
function registerContext(ctx, specs) {
try {
for (var specs_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(specs), specs_1_1 = specs_1.next(); !specs_1_1.done; specs_1_1 = specs_1.next()) {
var spec = specs_1_1.value;
SECURITY_SCHEMA[spec.toLowerCase()] = ctx;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (specs_1_1 && !specs_1_1.done && (_a = specs_1.return)) _a.call(specs_1);
}
finally { if (e_1) throw e_1.error; }
}
var e_1, _a;
}
// Case is insignificant below, all element and attribute names are lower-cased for lookup.
registerContext(SecurityContext.HTML, [
'iframe|srcdoc',
'*|innerHTML',
'*|outerHTML',
]);
registerContext(SecurityContext.STYLE, ['*|style']);
// NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.
registerContext(SecurityContext.URL, [
'*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href',
'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action',
'img|src', 'img|srcset', 'input|src', 'ins|cite', 'q|cite',
'source|src', 'source|srcset', 'track|src', 'video|poster', 'video|src',
]);
registerContext(SecurityContext.RESOURCE_URL, [
'applet|code',
'applet|codebase',
'base|href',
'embed|src',
'frame|src',
'head|profile',
'html|manifest',
'iframe|src',
'link|href',
'media|src',
'object|codebase',
'object|data',
'script|src',
]);
/**
* @license
* Copyright Google Inc. 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 ElementSchemaRegistry = /** @class */ (function () {
function ElementSchemaRegistry() {
}
return ElementSchemaRegistry;
}());
/**
* @license
* Copyright Google Inc. 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 BOOLEAN = 'boolean';
var NUMBER = 'number';
var STRING = 'string';
var OBJECT = 'object';
/**
* This array represents the DOM schema. It encodes inheritance, properties, and events.
*
* ## Overview
*
* Each line represents one kind of element. The `element_inheritance` and properties are joined
* using `element_inheritance|properties` syntax.
*
* ## Element Inheritance
*
* The `element_inheritance` can be further subdivided as `element1,element2,...^parentElement`.
* Here the individual elements are separated by `,` (commas). Every element in the list
* has identical properties.
*
* An `element` may inherit additional properties from `parentElement` If no `^parentElement` is
* specified then `""` (blank) element is assumed.
*
* NOTE: The blank element inherits from root `[Element]` element, the super element of all
* elements.
*
* NOTE an element prefix such as `:svg:` has no special meaning to the schema.
*
* ## Properties
*
* Each element has a set of properties separated by `,` (commas). Each property can be prefixed
* by a special character designating its type:
*
* - (no prefix): property is a string.
* - `*`: property represents an event.
* - `!`: property is a boolean.
* - `#`: property is a number.
* - `%`: property is an object.
*
* ## Query
*
* The class creates an internal squas representation which allows to easily answer the query of
* if a given property exist on a given element.
*
* NOTE: We don't yet support querying for types or events.
* NOTE: This schema is auto extracted from `schema_extractor.ts` located in the test folder,
* see dom_element_schema_registry_spec.ts
*/
// =================================================================================================
// =================================================================================================
// =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P ===========
// =================================================================================================
// =================================================================================================
//
// DO NOT EDIT THIS DOM SCHEMA WITHOUT A SECURITY REVIEW!
//
// Newly added properties must be security reviewed and assigned an appropriate SecurityContext in
// dom_security_schema.ts. Reach out to mprobst & rjamet for details.
//
// =================================================================================================
var SCHEMA = [
'[Element]|textContent,%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop,slot' +
/* added manually to avoid breaking changes */
',*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored',
'[HTMLElement]^[Element]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,outerText,!spellcheck,%style,#tabIndex,title,!translate',
'abbr,address,article,aside,b,bdi,bdo,cite,code,dd,dfn,dt,em,figcaption,figure,footer,header,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,outerText,!spellcheck,%style,#tabIndex,title,!translate',
'media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,src,%srcObject,#volume',
':svg:^[HTMLElement]|*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex',
':svg:graphics^:svg:|',
':svg:animation^:svg:|*begin,*end,*repeat',
':svg:geometry^:svg:|',
':svg:componentTransferFunction^:svg:|',
':svg:gradient^:svg:|',
':svg:textContent^:svg:graphics|',
':svg:textPositioning^:svg:textContent|',
'a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,rev,search,shape,target,text,type,username',
'area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,search,shape,target,username',
'audio^media|',
'br^[HTMLElement]|clear',
'base^[HTMLElement]|href,target',
'body^[HTMLElement]|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink',
'button^[HTMLElement]|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',
'canvas^[HTMLElement]|#height,#width',
'content^[HTMLElement]|select',
'dl^[HTMLElement]|!compact',
'datalist^[HTMLElement]|',
'details^[HTMLElement]|!open',
'dialog^[HTMLElement]|!open,returnValue',
'dir^[HTMLElement]|!compact',
'div^[HTMLElement]|align',
'embed^[HTMLElement]|align,height,name,src,type,width',
'fieldset^[HTMLElement]|!disabled,name',
'font^[HTMLElement]|color,face,size',
'form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',
'frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src',
'frameset^[HTMLElement]|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows',
'hr^[HTMLElement]|align,color,!noShade,size,width',
'head^[HTMLElement]|',
'h1,h2,h3,h4,h5,h6^[HTMLElement]|align',
'html^[HTMLElement]|version',
'iframe^[HTMLElement]|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width',
'img^[HTMLElement]|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width',
'input^[HTMLElement]|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width',
'li^[HTMLElement]|type,#value',
'label^[HTMLElement]|htmlFor',
'legend^[HTMLElement]|align',
'link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type',
'map^[HTMLElement]|name',
'marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',
'menu^[HTMLElement]|!compact',
'meta^[HTMLElement]|content,httpEquiv,name,scheme',
'meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value',
'ins,del^[HTMLElement]|cite,dateTime',
'ol^[HTMLElement]|!compact,!reversed,#start,type',
'object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',
'optgroup^[HTMLElement]|!disabled,label',
'option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value',
'output^[HTMLElement]|defaultValue,%htmlFor,name,value',
'p^[HTMLElement]|align',
'param^[HTMLElement]|name,type,value,valueType',
'picture^[HTMLElement]|',
'pre^[HTMLElement]|#width',
'progress^[HTMLElement]|#max,#value',
'q,blockquote,cite^[HTMLElement]|',
'script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',
'select^[HTMLElement]|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',
'shadow^[HTMLElement]|',
'slot^[HTMLElement]|name',
'source^[HTMLElement]|media,sizes,src,srcset,type',
'span^[HTMLElement]|',
'style^[HTMLElement]|!disabled,media,type',
'caption^[HTMLElement]|align',
'th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',
'col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width',
'table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',
'tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign',
'tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign',
'template^[HTMLElement]|',
'textarea^[HTMLElement]|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',
'title^[HTMLElement]|text',
'track^[HTMLElement]|!default,kind,label,src,srclang',
'ul^[HTMLElement]|!compact,type',
'unknown^[HTMLElement]|',
'video^media|#height,poster,#width',
':svg:a^:svg:graphics|',
':svg:animate^:svg:animation|',
':svg:animateMotion^:svg:animation|',
':svg:animateTransform^:svg:animation|',
':svg:circle^:svg:geometry|',
':svg:clipPath^:svg:graphics|',
':svg:defs^:svg:graphics|',
':svg:desc^:svg:|',
':svg:discard^:svg:|',
':svg:ellipse^:svg:geometry|',
':svg:feBlend^:svg:|',
':svg:feColorMatrix^:svg:|',
':svg:feComponentTransfer^:svg:|',
':svg:feComposite^:svg:|',
':svg:feConvolveMatrix^:svg:|',
':svg:feDiffuseLighting^:svg:|',
':svg:feDisplacementMap^:svg:|',
':svg:feDistantLight^:svg:|',
':svg:feDropShadow^:svg:|',
':svg:feFlood^:svg:|',
':svg:feFuncA^:svg:componentTransferFunction|',
':svg:feFuncB^:svg:componentTransferFunction|',
':svg:feFuncG^:svg:componentTransferFunction|',
':svg:feFuncR^:svg:componentTransferFunction|',
':svg:feGaussianBlur^:svg:|',
':svg:feImage^:svg:|',
':svg:feMerge^:svg:|',
':svg:feMergeNode^:svg:|',
':svg:feMorphology^:svg:|',
':svg:feOffset^:svg:|',
':svg:fePointLight^:svg:|',
':svg:feSpecularLighting^:svg:|',
':svg:feSpotLight^:svg:|',
':svg:feTile^:svg:|',
':svg:feTurbulence^:svg:|',
':svg:filter^:svg:|',
':svg:foreignObject^:svg:graphics|',
':svg:g^:svg:graphics|',
':svg:image^:svg:graphics|',
':svg:line^:svg:geometry|',
':svg:linearGradient^:svg:gradient|',
':svg:mpath^:svg:|',
':svg:marker^:svg:|',
':svg:mask^:svg:|',
':svg:metadata^:svg:|',
':svg:path^:svg:geometry|',
':svg:pattern^:svg:|',
':svg:polygon^:svg:geometry|',
':svg:polyline^:svg:geometry|',
':svg:radialGradient^:svg:gradient|',
':svg:rect^:svg:geometry|',
':svg:svg^:svg:graphics|#currentScale,#zoomAndPan',
':svg:script^:svg:|type',
':svg:set^:svg:animation|',
':svg:stop^:svg:|',
':svg:style^:svg:|!disabled,media,title,type',
':svg:switch^:svg:graphics|',
':svg:symbol^:svg:|',
':svg:tspan^:svg:textPositioning|',
':svg:text^:svg:textPositioning|',
':svg:textPath^:svg:textContent|',
':svg:title^:svg:|',
':svg:use^:svg:graphics|',
':svg:view^:svg:|#zoomAndPan',
'data^[HTMLElement]|value',
'keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name',
'menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default',
'summary^[HTMLElement]|',
'time^[HTMLElement]|dateTime',
':svg:cursor^:svg:|',
];
var _ATTR_TO_PROP = {
'class': 'className',
'for': 'htmlFor',
'formaction': 'formAction',
'innerHtml': 'innerHTML',
'readonly': 'readOnly',
'tabindex': 'tabIndex',
};
var DomElementSchemaRegistry = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(DomElementSchemaRegistry, _super);
function DomElementSchemaRegistry() {
var _this = _super.call(this) || this;
_this._schema = {};
SCHEMA.forEach(function (encodedType) {
var type = {};
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(encodedType.split('|'), 2), strType = _a[0], strProperties = _a[1];
var properties = strProperties.split(',');
var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(strType.split('^'), 2), typeNames = _b[0], superName = _b[1];
typeNames.split(',').forEach(function (tag) { return _this._schema[tag.toLowerCase()] = type; });
var superType = superName && _this._schema[superName.toLowerCase()];
if (superType) {
Object.keys(superType).forEach(function (prop) { type[prop] = superType[prop]; });
}
properties.forEach(function (property) {
if (property.length > 0) {
switch (property[0]) {
case '*':
// We don't yet support events.
// If ever allowing to bind to events, GO THROUGH A SECURITY REVIEW, allowing events
// will
// almost certainly introduce bad XSS vulnerabilities.
// type[property.substring(1)] = EVENT;
break;
case '!':
type[property.substring(1)] = BOOLEAN;
break;
case '#':
type[property.substring(1)] = NUMBER;
break;
case '%':
type[property.substring(1)] = OBJECT;
break;
default:
type[property] = STRING;
}
}
});
});
return _this;
}
DomElementSchemaRegistry.prototype.hasProperty = function (tagName, propName, schemaMetas) {
if (schemaMetas.some(function (schema) { return schema.name === NO_ERRORS_SCHEMA.name; })) {
return true;
}
if (tagName.indexOf('-') > -1) {
if (isNgContainer(tagName) || isNgContent(tagName)) {
return false;
}
if (schemaMetas.some(function (schema) { return schema.name === CUSTOM_ELEMENTS_SCHEMA.name; })) {
// Can't tell now as we don't know which properties a custom element will get
// once it is instantiated
return true;
}
}
var elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];
return !!elementProperties[propName];
};
DomElementSchemaRegistry.prototype.hasElement = function (tagName, schemaMetas) {
if (schemaMetas.some(function (schema) { return schema.name === NO_ERRORS_SCHEMA.name; })) {
return true;
}
if (tagName.indexOf('-') > -1) {
if (isNgContainer(tagName) || isNgContent(tagName)) {
return true;
}
if (schemaMetas.some(function (schema) { return schema.name === CUSTOM_ELEMENTS_SCHEMA.name; })) {
// Allow any custom elements
return true;
}
}
return !!this._schema[tagName.toLowerCase()];
};
/**
* securityContext returns the security context for the given property on the given DOM tag.
*
* Tag and property name are statically known and cannot change at runtime, i.e. it is not
* possible to bind a value into a changing attribute or tag name.
*
* The filtering is white list based. All attributes in the schema above are assumed to have the
* 'NONE' security context, i.e. that they are safe inert string values. Only specific well known
* attack vectors are assigned their appropriate context.
*/
DomElementSchemaRegistry.prototype.securityContext = function (tagName, propName, isAttribute) {
if (isAttribute) {
// NB: For security purposes, use the mapped property name, not the attribute name.
propName = this.getMappedPropName(propName);
}
// Make sure comparisons are case insensitive, so that case differences between attribute and
// property names do not have a security impact.
tagName = tagName.toLowerCase();
propName = propName.toLowerCase();
var ctx = SECURITY_SCHEMA[tagName + '|' + propName];
if (ctx) {
return ctx;
}
ctx = SECURITY_SCHEMA['*|' + propName];
return ctx ? ctx : SecurityContext.NONE;
};
DomElementSchemaRegistry.prototype.getMappedPropName = function (propName) { return _ATTR_TO_PROP[propName] || propName; };
DomElementSchemaRegistry.prototype.getDefaultComponentElementName = function () { return 'ng-component'; };
DomElementSchemaRegistry.prototype.validateProperty = function (name) {
if (name.toLowerCase().startsWith('on')) {
var msg = "Binding to event property '" + name + "' is disallowed for security reasons, " +
("please use (" + name.slice(2) + ")=...") +
("\nIf '" + name + "' is a directive input, make sure the directive is imported by the") +
" current module.";
return { error: true, msg: msg };
}
else {
return { error: false };
}
};
DomElementSchemaRegistry.prototype.validateAttribute = function (name) {
if (name.toLowerCase().startsWith('on')) {
var msg = "Binding to event attribute '" + name + "' is disallowed for security reasons, " +
("please use (" + name.slice(2) + ")=...");
return { error: true, msg: msg };
}
else {
return { error: false };
}
};
DomElementSchemaRegistry.prototype.allKnownElementNames = function () { return Object.keys(this._schema); };
DomElementSchemaRegistry.prototype.normalizeAnimationStyleProperty = function (propName) {
return dashCaseToCamelCase(propName);
};
DomElementSchemaRegistry.prototype.normalizeAnimationStyleValue = function (camelCaseProp, userProvidedProp, val) {
var unit = '';
var strVal = val.toString().trim();
var errorMsg = null;
if (_isPixelDimensionStyle(camelCaseProp) && val !== 0 && val !== '0') {
if (typeof val === 'number') {
unit = 'px';
}
else {
var valAndSuffixMatch = val.match(/^[+-]?[\d\.]+([a-z]*)$/);
if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {
errorMsg = "Please provide a CSS unit value for " + userProvidedProp + ":" + val;
}
}
}
return { error: errorMsg, value: strVal + unit };
};
return DomElementSchemaRegistry;
}(ElementSchemaRegistry));
function _isPixelDimensionStyle(prop) {
switch (prop) {
case 'width':
case 'height':
case 'minWidth':
case 'minHeight':
case 'maxWidth':
case 'maxHeight':
case 'left':
case 'top':
case 'bottom':
case 'right':
case 'fontSize':
case 'outlineWidth':
case 'outlineOffset':
case 'paddingTop':
case 'paddingLeft':
case 'paddingBottom':
case 'paddingRight':
case 'marginTop':
case 'marginLeft':
case 'marginBottom':
case 'marginRight':
case 'borderRadius':
case 'borderWidth':
case 'borderTopWidth':
case 'borderLeftWidth':
case 'borderRightWidth':
case 'borderBottomWidth':
case 'textIndent':
return true;
default:
return false;
}
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* This file is a port of shadowCSS from webcomponents.js to TypeScript.
*
* Please make sure to keep to edits in sync with the source file.
*
* Source:
* https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
*
* The original file level comment is reproduced below
*/
/*
This is a limited shim for ShadowDOM css styling.
https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles
The intention here is to support only the styling features which can be
relatively simply implemented. The goal is to allow users to avoid the
most obvious pitfalls and do so without compromising performance significantly.
For ShadowDOM styling that's not covered here, a set of best practices
can be provided that should allow users to accomplish more complex styling.
The following is a list of specific ShadowDOM styling features and a brief
discussion of the approach used to shim.
Shimmed features:
* :host, :host-context: ShadowDOM allows styling of the shadowRoot's host
element using the :host rule. To shim this feature, the :host styles are
reformatted and prefixed with a given scope name and promoted to a
document level stylesheet.
For example, given a scope name of .foo, a rule like this:
:host {
background: red;
}
}
becomes:
.foo {
background: red;
}
* encapsulation: Styles defined within ShadowDOM, apply only to
dom inside the ShadowDOM. Polymer uses one of two techniques to implement
this feature.
By default, rules are prefixed with the host element tag name
as a descendant selector. This ensures styling does not leak out of the 'top'
of the element's ShadowDOM. For example,
div {
font-weight: bold;
}
becomes:
x-foo div {
font-weight: bold;
}
becomes:
Alternatively, if WebComponents.ShadowCSS.strictStyling is set to true then
selectors are scoped by adding an attribute selector suffix to each
simple selector that contains the host element tag name. Each element
in the element's ShadowDOM template is also given the scope attribute.
Thus, these rules match only elements that have the scope attribute.
For example, given a scope name of x-foo, a rule like this:
div {
font-weight: bold;
}
becomes:
div[x-foo] {
font-weight: bold;
}
Note that elements that are dynamically added to a scope must have the scope
selector added to them manually.
* upper/lower bound encapsulation: Styles which are defined outside a
shadowRoot should not cross the ShadowDOM boundary and should not apply
inside a shadowRoot.
This styling behavior is not emulated. Some possible ways to do this that
were rejected due to complexity and/or performance concerns include: (1) reset
every possible property for every possible selector for a given scope name;
(2) re-implement css in javascript.
As an alternative, users should make sure to use selectors
specific to the scope in which they are working.
* ::distributed: This behavior is not emulated. It's often not necessary
to style the contents of a specific insertion point and instead, descendants
of the host element can be styled selectively. Users can also create an
extra node around an insertion point and style that node's contents
via descendent selectors. For example, with a shadowRoot like this:
<style>
::content(div) {
background: red;
}
</style>
<content></content>
could become:
<style>
/ *@polyfill .content-container div * /
::content(div) {
background: red;
}
</style>
<div class="content-container">
<content></content>
</div>
Note the use of @polyfill in the comment above a ShadowDOM specific style
declaration. This is a directive to the styling shim to use the selector
in comments in lieu of the next selector when running under polyfill.
*/
var ShadowCss = /** @class */ (function () {
function ShadowCss() {
this.strictStyling = true;
}
/*
* Shim some cssText with the given selector. Returns cssText that can
* be included in the document via WebComponents.ShadowCSS.addCssToDocument(css).
*
* When strictStyling is true:
* - selector is the attribute added to all elements inside the host,
* - hostSelector is the attribute added to the host itself.
*/
ShadowCss.prototype.shimCssText = function (cssText, selector, hostSelector) {
if (hostSelector === void 0) { hostSelector = ''; }
var commentsWithHash = extractCommentsWithHash(cssText);
cssText = stripComments(cssText);
cssText = this._insertDirectives(cssText);
var scopedCssText = this._scopeCssText(cssText, selector, hostSelector);
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([scopedCssText], commentsWithHash).join('\n');
};
ShadowCss.prototype._insertDirectives = function (cssText) {
cssText = this._insertPolyfillDirectivesInCssText(cssText);
return this._insertPolyfillRulesInCssText(cssText);
};
/*
* Process styles to convert native ShadowDOM rules that will trip
* up the css parser; we rely on decorating the stylesheet with inert rules.
*
* For example, we convert this rule:
*
* polyfill-next-selector { content: ':host menu-item'; }
* ::content menu-item {
*
* to this:
*
* scopeName menu-item {
*
**/
ShadowCss.prototype._insertPolyfillDirectivesInCssText = function (cssText) {
// Difference with webcomponents.js: does not handle comments
return cssText.replace(_cssContentNextSelectorRe, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i] = arguments[_i];
}
return m[2] + '{';
});
};
/*
* Process styles to add rules which will only apply under the polyfill
*
* For example, we convert this rule:
*
* polyfill-rule {
* content: ':host menu-item';
* ...
* }
*
* to this:
*
* scopeName menu-item {...}
*
**/
ShadowCss.prototype._insertPolyfillRulesInCssText = function (cssText) {
// Difference with webcomponents.js: does not handle comments
return cssText.replace(_cssContentRuleRe, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i] = arguments[_i];
}
var rule = m[0].replace(m[1], '').replace(m[2], '');
return m[4] + rule;
});
};
/* Ensure styles are scoped. Pseudo-scoping takes a rule like:
*
* .foo {... }
*
* and converts this to
*
* scopeName .foo { ... }
*/
ShadowCss.prototype._scopeCssText = function (cssText, scopeSelector, hostSelector) {
var unscopedRules = this._extractUnscopedRulesFromCssText(cssText);
// replace :host and :host-context -shadowcsshost and -shadowcsshost respectively
cssText = this._insertPolyfillHostInCssText(cssText);
cssText = this._convertColonHost(cssText);
cssText = this._convertColonHostContext(cssText);
cssText = this._convertShadowDOMSelectors(cssText);
if (scopeSelector) {
cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);
}
cssText = cssText + '\n' + unscopedRules;
return cssText.trim();
};
/*
* Process styles to add rules which will only apply under the polyfill
* and do not process via CSSOM. (CSSOM is destructive to rules on rare
* occasions, e.g. -webkit-calc on Safari.)
* For example, we convert this rule:
*
* @polyfill-unscoped-rule {
* content: 'menu-item';
* ... }
*
* to this:
*
* menu-item {...}
*
**/
ShadowCss.prototype._extractUnscopedRulesFromCssText = function (cssText) {
// Difference with webcomponents.js: does not handle comments
var r = '';
var m;
_cssContentUnscopedRuleRe.lastIndex = 0;
while ((m = _cssContentUnscopedRuleRe.exec(cssText)) !== null) {
var rule = m[0].replace(m[2], '').replace(m[1], m[4]);
r += rule + '\n\n';
}
return r;
};
/*
* convert a rule like :host(.foo) > .bar { }
*
* to
*
* .foo<scopeName> > .bar
*/
ShadowCss.prototype._convertColonHost = function (cssText) {
return this._convertColonRule(cssText, _cssColonHostRe, this._colonHostPartReplacer);
};
/*
* convert a rule like :host-context(.foo) > .bar { }
*
* to
*
* .foo<scopeName> > .bar, .foo scopeName > .bar { }
*
* and
*
* :host-context(.foo:host) .bar { ... }
*
* to
*
* .foo<scopeName> .bar { ... }
*/
ShadowCss.prototype._convertColonHostContext = function (cssText) {
return this._convertColonRule(cssText, _cssColonHostContextRe, this._colonHostContextPartReplacer);
};
ShadowCss.prototype._convertColonRule = function (cssText, regExp, partReplacer) {
// m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
return cssText.replace(regExp, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i] = arguments[_i];
}
if (m[2]) {
var parts = m[2].split(',');
var r = [];
for (var i = 0; i < parts.length; i++) {
var p = parts[i].trim();
if (!p)
break;
r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
}
return r.join(',');
}
else {
return _polyfillHostNoCombinator + m[3];
}
});
};
ShadowCss.prototype._colonHostContextPartReplacer = function (host, part, suffix) {
if (part.indexOf(_polyfillHost) > -1) {
return this._colonHostPartReplacer(host, part, suffix);
}
else {
return host + part + suffix + ', ' + part + ' ' + host + suffix;
}
};
ShadowCss.prototype._colonHostPartReplacer = function (host, part, suffix) {
return host + part.replace(_polyfillHost, '') + suffix;
};
/*
* Convert combinators like ::shadow and pseudo-elements like ::content
* by replacing with space.
*/
ShadowCss.prototype._convertShadowDOMSelectors = function (cssText) {
return _shadowDOMSelectorsRe.reduce(function (result, pattern) { return result.replace(pattern, ' '); }, cssText);
};
// change a selector like 'div' to 'name div'
ShadowCss.prototype._scopeSelectors = function (cssText, scopeSelector, hostSelector) {
var _this = this;
return processRules(cssText, function (rule) {
var selector = rule.selector;
var content = rule.content;
if (rule.selector[0] != '@') {
selector =
_this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling);
}
else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||
rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) {
content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector);
}
return new CssRule(selector, content);
});
};
ShadowCss.prototype._scopeSelector = function (selector, scopeSelector, hostSelector, strict) {
var _this = this;
return selector.split(',')
.map(function (part) { return part.trim().split(_shadowDeepSelectors); })
.map(function (deepParts) {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(deepParts), shallowPart = _a[0], otherParts = _a.slice(1);
var applyScope = function (shallowPart) {
if (_this._selectorNeedsScoping(shallowPart, scopeSelector)) {
return strict ?
_this._applyStrictSelectorScope(shallowPart, scopeSelector, hostSelector) :
_this._applySelectorScope(shallowPart, scopeSelector, hostSelector);
}
else {
return shallowPart;
}
};
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([applyScope(shallowPart)], otherParts).join(' ');
})
.join(', ');
};
ShadowCss.prototype._selectorNeedsScoping = function (selector, scopeSelector) {
var re = this._makeScopeMatcher(scopeSelector);
return !re.test(selector);
};
ShadowCss.prototype._makeScopeMatcher = function (scopeSelector) {
var lre = /\[/g;
var rre = /\]/g;
scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
};
ShadowCss.prototype._applySelectorScope = function (selector, scopeSelector, hostSelector) {
// Difference from webcomponents.js: scopeSelector could not be an array
return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector);
};
// scope via name and [is=name]
ShadowCss.prototype._applySimpleSelectorScope = function (selector, scopeSelector, hostSelector) {
// In Android browser, the lastIndex is not reset when the regex is used in String.replace()
_polyfillHostRe.lastIndex = 0;
if (_polyfillHostRe.test(selector)) {
var replaceBy_1 = this.strictStyling ? "[" + hostSelector + "]" : scopeSelector;
return selector
.replace(_polyfillHostNoCombinatorRe, function (hnc, selector) {
return selector.replace(/([^:]*)(:*)(.*)/, function (_, before, colon, after) {
return before + replaceBy_1 + colon + after;
});
})
.replace(_polyfillHostRe, replaceBy_1 + ' ');
}
return scopeSelector + ' ' + selector;
};
// return a selector with [name] suffix on each simple selector
// e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name] /** @internal */
ShadowCss.prototype._applyStrictSelectorScope = function (selector, scopeSelector, hostSelector) {
var _this = this;
var isRe = /\[is=([^\]]*)\]/g;
scopeSelector = scopeSelector.replace(isRe, function (_) {
var parts = [];
for (var _i = 1; _i < arguments.length; _i++) {
parts[_i - 1] = arguments[_i];
}
return parts[0];
});
var attrName = '[' + scopeSelector + ']';
var _scopeSelectorPart = function (p) {
var scopedP = p.trim();
if (!scopedP) {
return '';
}
if (p.indexOf(_polyfillHostNoCombinator) > -1) {
scopedP = _this._applySimpleSelectorScope(p, scopeSelector, hostSelector);
}
else {
// remove :host since it should be unnecessary
var t = p.replace(_polyfillHostRe, '');
if (t.length > 0) {
var matches = t.match(/([^:]*)(:*)(.*)/);
if (matches) {
scopedP = matches[1] + attrName + matches[2] + matches[3];
}
}
}
return scopedP;
};
var safeContent = new SafeSelector(selector);
selector = safeContent.content();
var scopedSelector = '';
var startIndex = 0;
var res;
var sep = /( |>|\+|~(?!=))\s*/g;
// If a selector appears before :host it should not be shimmed as it
// matches on ancestor elements and not on elements in the host's shadow
// `:host-context(div)` is transformed to
// `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`
// the `div` is not part of the component in the 2nd selectors and should not be scoped.
// Historically `component-tag:host` was matching the component so we also want to preserve
// this behavior to avoid breaking legacy apps (it should not match).
// The behavior should be:
// - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
// - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
// `:host-context(tag)`)
var hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
// Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
var shouldScope = !hasHost;
while ((res = sep.exec(selector)) !== null) {
var separator = res[1];
var part_1 = selector.slice(startIndex, res.index).trim();
shouldScope = shouldScope || part_1.indexOf(_polyfillHostNoCombinator) > -1;
var scopedPart = shouldScope ? _scopeSelectorPart(part_1) : part_1;
scopedSelector += scopedPart + " " + separator + " ";
startIndex = sep.lastIndex;
}
var part = selector.substring(startIndex);
shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
// replace the placeholders with their original values
return safeContent.restore(scopedSelector);
};
ShadowCss.prototype._insertPolyfillHostInCssText = function (selector) {
return selector.replace(_colonHostContextRe, _polyfillHostContext)
.replace(_colonHostRe, _polyfillHost);
};
return ShadowCss;
}());
var SafeSelector = /** @class */ (function () {
function SafeSelector(selector) {
var _this = this;
this.placeholders = [];
this.index = 0;
// Replaces attribute selectors with placeholders.
// The WS in [attr="va lue"] would otherwise be interpreted as a selector separator.
selector = selector.replace(/(\[[^\]]*\])/g, function (_, keep) {
var replaceBy = "__ph-" + _this.index + "__";
_this.placeholders.push(keep);
_this.index++;
return replaceBy;
});
// Replaces the expression in `:nth-child(2n + 1)` with a placeholder.
// WS and "+" would otherwise be interpreted as selector separators.
this._content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, function (_, pseudo, exp) {
var replaceBy = "__ph-" + _this.index + "__";
_this.placeholders.push(exp);
_this.index++;
return pseudo + replaceBy;
});
}
SafeSelector.prototype.restore = function (content) {
var _this = this;
return content.replace(/__ph-(\d+)__/g, function (ph, index) { return _this.placeholders[+index]; });
};
SafeSelector.prototype.content = function () { return this._content; };
return SafeSelector;
}());
var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim;
var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
var _polyfillHost = '-shadowcsshost';
// note: :host-context pre-processed to -shadowcsshostcontext.
var _polyfillHostContext = '-shadowcsscontext';
var _parenSuffix = ')(?:\\((' +
'(?:\\([^)(]*\\)|[^)(]*)+?' +
')\\))?([^,{]*)';
var _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');
var _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');
var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
var _shadowDOMSelectorsRe = [
/::shadow/g,
/::content/g,
// Deprecated selectors
/\/shadow-deep\//g,
/\/shadow\//g,
];
// The deep combinator is deprecated in the CSS spec
// Support for `>>>`, `deep`, `::ng-deep` is then also deprecated and will be removed in the future.
// see https://github.com/angular/angular/pull/17677
var _shadowDeepSelectors = /(?:>>>)|(?:\/deep\/)|(?:::ng-deep)/g;
var _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$';
var _polyfillHostRe = /-shadowcsshost/gim;
var _colonHostRe = /:host/gim;
var _colonHostContextRe = /:host-context/gim;
var _commentRe = /\/\*\s*[\s\S]*?\*\//g;
function stripComments(input) {
return input.replace(_commentRe, '');
}
var _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
function extractCommentsWithHash(input) {
return input.match(_commentWithHashRe) || [];
}
var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
var _curlyRe = /([{}])/g;
var OPEN_CURLY = '{';
var CLOSE_CURLY = '}';
var BLOCK_PLACEHOLDER = '%BLOCK%';
var CssRule = /** @class */ (function () {
function CssRule(selector, content) {
this.selector = selector;
this.content = content;
}
return CssRule;
}());
function processRules(input, ruleCallback) {
var inputWithEscapedBlocks = escapeBlocks(input);
var nextBlockIndex = 0;
return inputWithEscapedBlocks.escapedString.replace(_ruleRe, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i] = arguments[_i];
}
var selector = m[2];
var content = '';
var suffix = m[4];
var contentPrefix = '';
if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
contentPrefix = '{';
}
var rule = ruleCallback(new CssRule(selector, content));
return "" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix;
});
}
var StringWithEscapedBlocks = /** @class */ (function () {
function StringWithEscapedBlocks(escapedString, blocks) {
this.escapedString = escapedString;
this.blocks = blocks;
}
return StringWithEscapedBlocks;
}());
function escapeBlocks(input) {
var inputParts = input.split(_curlyRe);
var resultParts = [];
var escapedBlocks = [];
var bracketCount = 0;
var currentBlockParts = [];
for (var partIndex = 0; partIndex < inputParts.length; partIndex++) {
var part = inputParts[partIndex];
if (part == CLOSE_CURLY) {
bracketCount--;
}
if (bracketCount > 0) {
currentBlockParts.push(part);
}
else {
if (currentBlockParts.length > 0) {
escapedBlocks.push(currentBlockParts.join(''));
resultParts.push(BLOCK_PLACEHOLDER);
currentBlockParts = [];
}
resultParts.push(part);
}
if (part == OPEN_CURLY) {
bracketCount++;
}
}
if (currentBlockParts.length > 0) {
escapedBlocks.push(currentBlockParts.join(''));
resultParts.push(BLOCK_PLACEHOLDER);
}
return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks);
}
/**
* @license
* Copyright Google Inc. 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 COMPONENT_VARIABLE = '%COMP%';
var HOST_ATTR = "_nghost-" + COMPONENT_VARIABLE;
var CONTENT_ATTR = "_ngcontent-" + COMPONENT_VARIABLE;
var StylesCompileDependency = /** @class */ (function () {
function StylesCompileDependency(name, moduleUrl, setValue) {
this.name = name;
this.moduleUrl = moduleUrl;
this.setValue = setValue;
}
return StylesCompileDependency;
}());
var CompiledStylesheet = /** @class */ (function () {
function CompiledStylesheet(outputCtx, stylesVar, dependencies, isShimmed, meta) {
this.outputCtx = outputCtx;
this.stylesVar = stylesVar;
this.dependencies = dependencies;
this.isShimmed = isShimmed;
this.meta = meta;
}
return CompiledStylesheet;
}());
var StyleCompiler = /** @class */ (function () {
function StyleCompiler(_urlResolver) {
this._urlResolver = _urlResolver;
this._shadowCss = new ShadowCss();
}
StyleCompiler.prototype.compileComponent = function (outputCtx, comp) {
var template = comp.template;
return this._compileStyles(outputCtx, comp, new CompileStylesheetMetadata({
styles: template.styles,
styleUrls: template.styleUrls,
moduleUrl: identifierModuleUrl(comp.type)
}), this.needsStyleShim(comp), true);
};
StyleCompiler.prototype.compileStyles = function (outputCtx, comp, stylesheet, shim) {
if (shim === void 0) { shim = this.needsStyleShim(comp); }
return this._compileStyles(outputCtx, comp, stylesheet, shim, false);
};
StyleCompiler.prototype.needsStyleShim = function (comp) {
return comp.template.encapsulation === ViewEncapsulation.Emulated;
};
StyleCompiler.prototype._compileStyles = function (outputCtx, comp, stylesheet, shim, isComponentStylesheet) {
var _this = this;
var styleExpressions = stylesheet.styles.map(function (plainStyle) { return literal(_this._shimIfNeeded(plainStyle, shim)); });
var dependencies = [];
stylesheet.styleUrls.forEach(function (styleUrl) {
var exprIndex = styleExpressions.length;
// Note: This placeholder will be filled later.
styleExpressions.push(null);
dependencies.push(new StylesCompileDependency(getStylesVarName(null), styleUrl, function (value) { return styleExpressions[exprIndex] = outputCtx.importExpr(value); }));
});
// styles variable contains plain strings and arrays of other styles arrays (recursive),
// so we set its type to dynamic.
var stylesVar = getStylesVarName(isComponentStylesheet ? comp : null);
var stmt = variable(stylesVar)
.set(literalArr(styleExpressions, new ArrayType(DYNAMIC_TYPE, [TypeModifier.Const])))
.toDeclStmt(null, isComponentStylesheet ? [StmtModifier.Final] : [
StmtModifier.Final, StmtModifier.Exported
]);
outputCtx.statements.push(stmt);
return new CompiledStylesheet(outputCtx, stylesVar, dependencies, shim, stylesheet);
};
StyleCompiler.prototype._shimIfNeeded = function (style, shim) {
return shim ? this._shadowCss.shimCssText(style, CONTENT_ATTR, HOST_ATTR) : style;
};
return StyleCompiler;
}());
function getStylesVarName(component) {
var result = "styles";
if (component) {
result += "_" + identifierName(component.type);
}
return result;
}
/**
* @license
* Copyright Google Inc. 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 PRESERVE_WS_ATTR_NAME = 'ngPreserveWhitespaces';
var SKIP_WS_TRIM_TAGS = new Set(['pre', 'template', 'textarea', 'script', 'style']);
// Equivalent to \s with \u00a0 (non-breaking space) excluded.
// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
var WS_CHARS = ' \f\n\r\t\v\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff';
var NO_WS_REGEXP = new RegExp("[^" + WS_CHARS + "]");
var WS_REPLACE_REGEXP = new RegExp("[" + WS_CHARS + "]{2,}", 'g');
function hasPreserveWhitespacesAttr(attrs) {
return attrs.some(function (attr) { return attr.name === PRESERVE_WS_ATTR_NAME; });
}
/**
* Angular Dart introduced &ngsp; as a placeholder for non-removable space, see:
* https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart#L25-L32
* In Angular Dart &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character
* and later on replaced by a space. We are re-implementing the same idea here.
*/
function replaceNgsp(value) {
// lexer is replacing the &ngsp; pseudo-entity with NGSP_UNICODE
return value.replace(new RegExp(NGSP_UNICODE, 'g'), ' ');
}
/**
* This visitor can walk HTML parse tree and remove / trim text nodes using the following rules:
* - consider spaces, tabs and new lines as whitespace characters;
* - drop text nodes consisting of whitespace characters only;
* - for all other text nodes replace consecutive whitespace characters with one space;
* - convert &ngsp; pseudo-entity to a single space;
*
* Removal and trimming of whitespaces have positive performance impact (less code to generate
* while compiling templates, faster view creation). At the same time it can be "destructive"
* in some cases (whitespaces can influence layout). Because of the potential of breaking layout
* this visitor is not activated by default in Angular 5 and people need to explicitly opt-in for
* whitespace removal. The default option for whitespace removal will be revisited in Angular 6
* and might be changed to "on" by default.
*/
var WhitespaceVisitor = /** @class */ (function () {
function WhitespaceVisitor() {
}
WhitespaceVisitor.prototype.visitElement = function (element, context) {
if (SKIP_WS_TRIM_TAGS.has(element.name) || hasPreserveWhitespacesAttr(element.attrs)) {
// don't descent into elements where we need to preserve whitespaces
// but still visit all attributes to eliminate one used as a market to preserve WS
return new Element(element.name, visitAll(this, element.attrs), element.children, element.sourceSpan, element.startSourceSpan, element.endSourceSpan);
}
return new Element(element.name, element.attrs, visitAll(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan);
};
WhitespaceVisitor.prototype.visitAttribute = function (attribute, context) {
return attribute.name !== PRESERVE_WS_ATTR_NAME ? attribute : null;
};
WhitespaceVisitor.prototype.visitText = function (text, context) {
var isNotBlank = text.value.match(NO_WS_REGEXP);
if (isNotBlank) {
return new Text(replaceNgsp(text.value).replace(WS_REPLACE_REGEXP, ' '), text.sourceSpan);
}
return null;
};
WhitespaceVisitor.prototype.visitComment = function (comment, context) { return comment; };
WhitespaceVisitor.prototype.visitExpansion = function (expansion, context) { return expansion; };
WhitespaceVisitor.prototype.visitExpansionCase = function (expansionCase, context) { return expansionCase; };
return WhitespaceVisitor;
}());
function removeWhitespaces(htmlAstWithErrors) {
return new ParseTreeResult(visitAll(new WhitespaceVisitor(), htmlAstWithErrors.rootNodes), htmlAstWithErrors.errors);
}
/**
* @license
* Copyright Google Inc. 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
*/
// http://cldr.unicode.org/index/cldr-spec/plural-rules
var PLURAL_CASES = ['zero', 'one', 'two', 'few', 'many', 'other'];
/**
* Expands special forms into elements.
*
* For example,
*
* ```
* { messages.length, plural,
* =0 {zero}
* =1 {one}
* other {more than one}
* }
* ```
*
* will be expanded into
*
* ```
* <ng-container [ngPlural]="messages.length">
* <ng-template ngPluralCase="=0">zero</ng-template>
* <ng-template ngPluralCase="=1">one</ng-template>
* <ng-template ngPluralCase="other">more than one</ng-template>
* </ng-container>
* ```
*/
function expandNodes(nodes) {
var expander = new _Expander();
return new ExpansionResult(visitAll(expander, nodes), expander.isExpanded, expander.errors);
}
var ExpansionResult = /** @class */ (function () {
function ExpansionResult(nodes, expanded, errors) {
this.nodes = nodes;
this.expanded = expanded;
this.errors = errors;
}
return ExpansionResult;
}());
var ExpansionError = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ExpansionError, _super);
function ExpansionError(span, errorMsg) {
return _super.call(this, span, errorMsg) || this;
}
return ExpansionError;
}(ParseError));
/**
* Expand expansion forms (plural, select) to directives
*
* @internal
*/
var _Expander = /** @class */ (function () {
function _Expander() {
this.isExpanded = false;
this.errors = [];
}
_Expander.prototype.visitElement = function (element, context) {
return new Element(element.name, element.attrs, visitAll(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan);
};
_Expander.prototype.visitAttribute = function (attribute, context) { return attribute; };
_Expander.prototype.visitText = function (text, context) { return text; };
_Expander.prototype.visitComment = function (comment, context) { return comment; };
_Expander.prototype.visitExpansion = function (icu, context) {
this.isExpanded = true;
return icu.type == 'plural' ? _expandPluralForm(icu, this.errors) :
_expandDefaultForm(icu, this.errors);
};
_Expander.prototype.visitExpansionCase = function (icuCase, context) {
throw new Error('Should not be reached');
};
return _Expander;
}());
// Plural forms are expanded to `NgPlural` and `NgPluralCase`s
function _expandPluralForm(ast, errors) {
var children = ast.cases.map(function (c) {
if (PLURAL_CASES.indexOf(c.value) == -1 && !c.value.match(/^=\d+$/)) {
errors.push(new ExpansionError(c.valueSourceSpan, "Plural cases should be \"=<number>\" or one of " + PLURAL_CASES.join(", ")));
}
var expansionResult = expandNodes(c.expression);
errors.push.apply(errors, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(expansionResult.errors));
return new Element("ng-template", [new Attribute('ngPluralCase', "" + c.value, c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);
});
var switchAttr = new Attribute('[ngPlural]', ast.switchValue, ast.switchValueSourceSpan);
return new Element('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);
}
// ICU messages (excluding plural form) are expanded to `NgSwitch` and `NgSwitchCase`s
function _expandDefaultForm(ast, errors) {
var children = ast.cases.map(function (c) {
var expansionResult = expandNodes(c.expression);
errors.push.apply(errors, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(expansionResult.errors));
if (c.value === 'other') {
// other is the default case when no values match
return new Element("ng-template", [new Attribute('ngSwitchDefault', '', c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);
}
return new Element("ng-template", [new Attribute('ngSwitchCase', "" + c.value, c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);
});
var switchAttr = new Attribute('[ngSwitch]', ast.switchValue, ast.switchValueSourceSpan);
return new Element('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);
}
/**
* @license
* Copyright Google Inc. 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 PROPERTY_PARTS_SEPARATOR = '.';
var ATTRIBUTE_PREFIX = 'attr';
var CLASS_PREFIX = 'class';
var STYLE_PREFIX = 'style';
var ANIMATE_PROP_PREFIX = 'animate-';
var BoundPropertyType;
(function (BoundPropertyType) {
BoundPropertyType[BoundPropertyType["DEFAULT"] = 0] = "DEFAULT";
BoundPropertyType[BoundPropertyType["LITERAL_ATTR"] = 1] = "LITERAL_ATTR";
BoundPropertyType[BoundPropertyType["ANIMATION"] = 2] = "ANIMATION";
})(BoundPropertyType || (BoundPropertyType = {}));
/**
* Represents a parsed property.
*/
var BoundProperty = /** @class */ (function () {
function BoundProperty(name, expression, type, sourceSpan) {
this.name = name;
this.expression = expression;
this.type = type;
this.sourceSpan = sourceSpan;
this.isLiteral = this.type === BoundPropertyType.LITERAL_ATTR;
this.isAnimation = this.type === BoundPropertyType.ANIMATION;
}
return BoundProperty;
}());
/**
* Parses bindings in templates and in the directive host area.
*/
var BindingParser = /** @class */ (function () {
function BindingParser(_exprParser, _interpolationConfig, _schemaRegistry, pipes, _targetErrors) {
var _this = this;
this._exprParser = _exprParser;
this._interpolationConfig = _interpolationConfig;
this._schemaRegistry = _schemaRegistry;
this._targetErrors = _targetErrors;
this.pipesByName = new Map();
this._usedPipes = new Map();
pipes.forEach(function (pipe) { return _this.pipesByName.set(pipe.name, pipe); });
}
BindingParser.prototype.getUsedPipes = function () { return Array.from(this._usedPipes.values()); };
BindingParser.prototype.createBoundHostProperties = function (dirMeta, sourceSpan) {
var _this = this;
if (dirMeta.hostProperties) {
var boundProps_1 = [];
Object.keys(dirMeta.hostProperties).forEach(function (propName) {
var expression = dirMeta.hostProperties[propName];
if (typeof expression === 'string') {
_this.parsePropertyBinding(propName, expression, true, sourceSpan, [], boundProps_1);
}
else {
_this._reportError("Value of the host property binding \"" + propName + "\" needs to be a string representing an expression but got \"" + expression + "\" (" + typeof expression + ")", sourceSpan);
}
});
return boundProps_1;
}
return null;
};
BindingParser.prototype.createDirectiveHostPropertyAsts = function (dirMeta, elementSelector, sourceSpan) {
var _this = this;
var boundProps = this.createBoundHostProperties(dirMeta, sourceSpan);
return boundProps &&
boundProps.map(function (prop) { return _this.createElementPropertyAst(elementSelector, prop); });
};
BindingParser.prototype.createDirectiveHostEventAsts = function (dirMeta, sourceSpan) {
var _this = this;
if (dirMeta.hostListeners) {
var targetEventAsts_1 = [];
Object.keys(dirMeta.hostListeners).forEach(function (propName) {
var expression = dirMeta.hostListeners[propName];
if (typeof expression === 'string') {
_this.parseEvent(propName, expression, sourceSpan, [], targetEventAsts_1);
}
else {
_this._reportError("Value of the host listener \"" + propName + "\" needs to be a string representing an expression but got \"" + expression + "\" (" + typeof expression + ")", sourceSpan);
}
});
return targetEventAsts_1;
}
return null;
};
BindingParser.prototype.parseInterpolation = function (value, sourceSpan) {
var sourceInfo = sourceSpan.start.toString();
try {
var ast = this._exprParser.parseInterpolation(value, sourceInfo, this._interpolationConfig);
if (ast)
this._reportExpressionParserErrors(ast.errors, sourceSpan);
this._checkPipes(ast, sourceSpan);
return ast;
}
catch (e) {
this._reportError("" + e, sourceSpan);
return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);
}
};
BindingParser.prototype.parseInlineTemplateBinding = function (prefixToken, value, sourceSpan, targetMatchableAttrs, targetProps, targetVars) {
var bindings = this._parseTemplateBindings(prefixToken, value, sourceSpan);
for (var i = 0; i < bindings.length; i++) {
var binding = bindings[i];
if (binding.keyIsVar) {
targetVars.push(new VariableAst(binding.key, binding.name, sourceSpan));
}
else if (binding.expression) {
this._parsePropertyAst(binding.key, binding.expression, sourceSpan, targetMatchableAttrs, targetProps);
}
else {
targetMatchableAttrs.push([binding.key, '']);
this.parseLiteralAttr(binding.key, null, sourceSpan, targetMatchableAttrs, targetProps);
}
}
};
BindingParser.prototype._parseTemplateBindings = function (prefixToken, value, sourceSpan) {
var _this = this;
var sourceInfo = sourceSpan.start.toString();
try {
var bindingsResult = this._exprParser.parseTemplateBindings(prefixToken, value, sourceInfo);
this._reportExpressionParserErrors(bindingsResult.errors, sourceSpan);
bindingsResult.templateBindings.forEach(function (binding) {
if (binding.expression) {
_this._checkPipes(binding.expression, sourceSpan);
}
});
bindingsResult.warnings.forEach(function (warning) { _this._reportError(warning, sourceSpan, ParseErrorLevel.WARNING); });
return bindingsResult.templateBindings;
}
catch (e) {
this._reportError("" + e, sourceSpan);
return [];
}
};
BindingParser.prototype.parseLiteralAttr = function (name, value, sourceSpan, targetMatchableAttrs, targetProps) {
if (_isAnimationLabel(name)) {
name = name.substring(1);
if (value) {
this._reportError("Assigning animation triggers via @prop=\"exp\" attributes with an expression is invalid." +
" Use property bindings (e.g. [@prop]=\"exp\") or use an attribute without a value (e.g. @prop) instead.", sourceSpan, ParseErrorLevel.ERROR);
}
this._parseAnimation(name, value, sourceSpan, targetMatchableAttrs, targetProps);
}
else {
targetProps.push(new BoundProperty(name, this._exprParser.wrapLiteralPrimitive(value, ''), BoundPropertyType.LITERAL_ATTR, sourceSpan));
}
};
BindingParser.prototype.parsePropertyBinding = function (name, expression, isHost, sourceSpan, targetMatchableAttrs, targetProps) {
var isAnimationProp = false;
if (name.startsWith(ANIMATE_PROP_PREFIX)) {
isAnimationProp = true;
name = name.substring(ANIMATE_PROP_PREFIX.length);
}
else if (_isAnimationLabel(name)) {
isAnimationProp = true;
name = name.substring(1);
}
if (isAnimationProp) {
this._parseAnimation(name, expression, sourceSpan, targetMatchableAttrs, targetProps);
}
else {
this._parsePropertyAst(name, this._parseBinding(expression, isHost, sourceSpan), sourceSpan, targetMatchableAttrs, targetProps);
}
};
BindingParser.prototype.parsePropertyInterpolation = function (name, value, sourceSpan, targetMatchableAttrs, targetProps) {
var expr = this.parseInterpolation(value, sourceSpan);
if (expr) {
this._parsePropertyAst(name, expr, sourceSpan, targetMatchableAttrs, targetProps);
return true;
}
return false;
};
BindingParser.prototype._parsePropertyAst = function (name, ast, sourceSpan, targetMatchableAttrs, targetProps) {
targetMatchableAttrs.push([name, ast.source]);
targetProps.push(new BoundProperty(name, ast, BoundPropertyType.DEFAULT, sourceSpan));
};
BindingParser.prototype._parseAnimation = function (name, expression, sourceSpan, targetMatchableAttrs, targetProps) {
// This will occur when a @trigger is not paired with an expression.
// For animations it is valid to not have an expression since */void
// states will be applied by angular when the element is attached/detached
var ast = this._parseBinding(expression || 'undefined', false, sourceSpan);
targetMatchableAttrs.push([name, ast.source]);
targetProps.push(new BoundProperty(name, ast, BoundPropertyType.ANIMATION, sourceSpan));
};
BindingParser.prototype._parseBinding = function (value, isHostBinding, sourceSpan) {
var sourceInfo = sourceSpan.start.toString();
try {
var ast = isHostBinding ?
this._exprParser.parseSimpleBinding(value, sourceInfo, this._interpolationConfig) :
this._exprParser.parseBinding(value, sourceInfo, this._interpolationConfig);
if (ast)
this._reportExpressionParserErrors(ast.errors, sourceSpan);
this._checkPipes(ast, sourceSpan);
return ast;
}
catch (e) {
this._reportError("" + e, sourceSpan);
return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);
}
};
BindingParser.prototype.createElementPropertyAst = function (elementSelector, boundProp) {
if (boundProp.isAnimation) {
return new BoundElementPropertyAst(boundProp.name, PropertyBindingType.Animation, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan);
}
var unit = null;
var bindingType = undefined;
var boundPropertyName = null;
var parts = boundProp.name.split(PROPERTY_PARTS_SEPARATOR);
var securityContexts = undefined;
// Check check for special cases (prefix style, attr, class)
if (parts.length > 1) {
if (parts[0] == ATTRIBUTE_PREFIX) {
boundPropertyName = parts[1];
this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, true);
securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, true);
var nsSeparatorIdx = boundPropertyName.indexOf(':');
if (nsSeparatorIdx > -1) {
var ns = boundPropertyName.substring(0, nsSeparatorIdx);
var name_1 = boundPropertyName.substring(nsSeparatorIdx + 1);
boundPropertyName = mergeNsAndName(ns, name_1);
}
bindingType = PropertyBindingType.Attribute;
}
else if (parts[0] == CLASS_PREFIX) {
boundPropertyName = parts[1];
bindingType = PropertyBindingType.Class;
securityContexts = [SecurityContext.NONE];
}
else if (parts[0] == STYLE_PREFIX) {
unit = parts.length > 2 ? parts[2] : null;
boundPropertyName = parts[1];
bindingType = PropertyBindingType.Style;
securityContexts = [SecurityContext.STYLE];
}
}
// If not a special case, use the full property name
if (boundPropertyName === null) {
boundPropertyName = this._schemaRegistry.getMappedPropName(boundProp.name);
securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, false);
bindingType = PropertyBindingType.Property;
this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, false);
}
return new BoundElementPropertyAst(boundPropertyName, bindingType, securityContexts[0], boundProp.expression, unit, boundProp.sourceSpan);
};
BindingParser.prototype.parseEvent = function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {
if (_isAnimationLabel(name)) {
name = name.substr(1);
this._parseAnimationEvent(name, expression, sourceSpan, targetEvents);
}
else {
this._parseEvent(name, expression, sourceSpan, targetMatchableAttrs, targetEvents);
}
};
BindingParser.prototype._parseAnimationEvent = function (name, expression, sourceSpan, targetEvents) {
var matches = splitAtPeriod(name, [name, '']);
var eventName = matches[0];
var phase = matches[1].toLowerCase();
if (phase) {
switch (phase) {
case 'start':
case 'done':
var ast = this._parseAction(expression, sourceSpan);
targetEvents.push(new BoundEventAst(eventName, null, phase, ast, sourceSpan));
break;
default:
this._reportError("The provided animation output phase value \"" + phase + "\" for \"@" + eventName + "\" is not supported (use start or done)", sourceSpan);
break;
}
}
else {
this._reportError("The animation trigger output event (@" + eventName + ") is missing its phase value name (start or done are currently supported)", sourceSpan);
}
};
BindingParser.prototype._parseEvent = function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {
// long format: 'target: eventName'
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(splitAtColon(name, [null, name]), 2), target = _a[0], eventName = _a[1];
var ast = this._parseAction(expression, sourceSpan);
targetMatchableAttrs.push([name, ast.source]);
targetEvents.push(new BoundEventAst(eventName, target, null, ast, sourceSpan));
// Don't detect directives for event names for now,
// so don't add the event name to the matchableAttrs
};
BindingParser.prototype._parseAction = function (value, sourceSpan) {
var sourceInfo = sourceSpan.start.toString();
try {
var ast = this._exprParser.parseAction(value, sourceInfo, this._interpolationConfig);
if (ast) {
this._reportExpressionParserErrors(ast.errors, sourceSpan);
}
if (!ast || ast.ast instanceof EmptyExpr) {
this._reportError("Empty expressions are not allowed", sourceSpan);
return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);
}
this._checkPipes(ast, sourceSpan);
return ast;
}
catch (e) {
this._reportError("" + e, sourceSpan);
return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);
}
};
BindingParser.prototype._reportError = function (message, sourceSpan, level) {
if (level === void 0) { level = ParseErrorLevel.ERROR; }
this._targetErrors.push(new ParseError(sourceSpan, message, level));
};
BindingParser.prototype._reportExpressionParserErrors = function (errors, sourceSpan) {
try {
for (var errors_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(errors), errors_1_1 = errors_1.next(); !errors_1_1.done; errors_1_1 = errors_1.next()) {
var error$$1 = errors_1_1.value;
this._reportError(error$$1.message, sourceSpan);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (errors_1_1 && !errors_1_1.done && (_a = errors_1.return)) _a.call(errors_1);
}
finally { if (e_1) throw e_1.error; }
}
var e_1, _a;
};
BindingParser.prototype._checkPipes = function (ast, sourceSpan) {
var _this = this;
if (ast) {
var collector = new PipeCollector();
ast.visit(collector);
collector.pipes.forEach(function (ast, pipeName) {
var pipeMeta = _this.pipesByName.get(pipeName);
if (!pipeMeta) {
_this._reportError("The pipe '" + pipeName + "' could not be found", new ParseSourceSpan(sourceSpan.start.moveBy(ast.span.start), sourceSpan.start.moveBy(ast.span.end)));
}
else {
_this._usedPipes.set(pipeName, pipeMeta);
}
});
}
};
/**
* @param propName the name of the property / attribute
* @param sourceSpan
* @param isAttr true when binding to an attribute
*/
BindingParser.prototype._validatePropertyOrAttributeName = function (propName, sourceSpan, isAttr) {
var report = isAttr ? this._schemaRegistry.validateAttribute(propName) :
this._schemaRegistry.validateProperty(propName);
if (report.error) {
this._reportError(report.msg, sourceSpan, ParseErrorLevel.ERROR);
}
};
return BindingParser;
}());
var PipeCollector = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PipeCollector, _super);
function PipeCollector() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.pipes = new Map();
return _this;
}
PipeCollector.prototype.visitPipe = function (ast, context) {
this.pipes.set(ast.name, ast);
ast.exp.visit(this);
this.visitAll(ast.args, context);
return null;
};
return PipeCollector;
}(RecursiveAstVisitor));
function _isAnimationLabel(name) {
return name[0] == '@';
}
function calcPossibleSecurityContexts(registry, selector, propName, isAttribute) {
var ctxs = [];
CssSelector.parse(selector).forEach(function (selector) {
var elementNames = selector.element ? [selector.element] : registry.allKnownElementNames();
var notElementNames = new Set(selector.notSelectors.filter(function (selector) { return selector.isElementSelector(); })
.map(function (selector) { return selector.element; }));
var possibleElementNames = elementNames.filter(function (elementName) { return !notElementNames.has(elementName); });
ctxs.push.apply(ctxs, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(possibleElementNames.map(function (elementName) { return registry.securityContext(elementName, propName, isAttribute); })));
});
return ctxs.length === 0 ? [SecurityContext.NONE] : Array.from(new Set(ctxs)).sort();
}
/**
* @license
* Copyright Google Inc. 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 BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/;
// Group 1 = "bind-"
var KW_BIND_IDX = 1;
// Group 2 = "let-"
var KW_LET_IDX = 2;
// Group 3 = "ref-/#"
var KW_REF_IDX = 3;
// Group 4 = "on-"
var KW_ON_IDX = 4;
// Group 5 = "bindon-"
var KW_BINDON_IDX = 5;
// Group 6 = "@"
var KW_AT_IDX = 6;
// Group 7 = the identifier after "bind-", "let-", "ref-/#", "on-", "bindon-" or "@"
var IDENT_KW_IDX = 7;
// Group 8 = identifier inside [()]
var IDENT_BANANA_BOX_IDX = 8;
// Group 9 = identifier inside []
var IDENT_PROPERTY_IDX = 9;
// Group 10 = identifier inside ()
var IDENT_EVENT_IDX = 10;
var TEMPLATE_ATTR_PREFIX = '*';
var CLASS_ATTR = 'class';
var TEXT_CSS_SELECTOR = CssSelector.parse('*')[0];
var TemplateParseError = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TemplateParseError, _super);
function TemplateParseError(message, span, level) {
return _super.call(this, span, message, level) || this;
}
return TemplateParseError;
}(ParseError));
var TemplateParseResult = /** @class */ (function () {
function TemplateParseResult(templateAst, usedPipes, errors) {
this.templateAst = templateAst;
this.usedPipes = usedPipes;
this.errors = errors;
}
return TemplateParseResult;
}());
var TemplateParser = /** @class */ (function () {
function TemplateParser(_config, _reflector, _exprParser, _schemaRegistry, _htmlParser, _console, transforms) {
this._config = _config;
this._reflector = _reflector;
this._exprParser = _exprParser;
this._schemaRegistry = _schemaRegistry;
this._htmlParser = _htmlParser;
this._console = _console;
this.transforms = transforms;
}
Object.defineProperty(TemplateParser.prototype, "expressionParser", {
get: function () { return this._exprParser; },
enumerable: true,
configurable: true
});
TemplateParser.prototype.parse = function (component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces) {
var result = this.tryParse(component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces);
var warnings = result.errors.filter(function (error$$1) { return error$$1.level === ParseErrorLevel.WARNING; });
var errors = result.errors.filter(function (error$$1) { return error$$1.level === ParseErrorLevel.ERROR; });
if (warnings.length > 0) {
this._console.warn("Template parse warnings:\n" + warnings.join('\n'));
}
if (errors.length > 0) {
var errorString = errors.join('\n');
throw syntaxError("Template parse errors:\n" + errorString, errors);
}
return { template: result.templateAst, pipes: result.usedPipes };
};
TemplateParser.prototype.tryParse = function (component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces) {
var htmlParseResult = typeof template === 'string' ?
this._htmlParser.parse(template, templateUrl, true, this.getInterpolationConfig(component)) :
template;
if (!preserveWhitespaces) {
htmlParseResult = removeWhitespaces(htmlParseResult);
}
return this.tryParseHtml(this.expandHtml(htmlParseResult), component, directives, pipes, schemas);
};
TemplateParser.prototype.tryParseHtml = function (htmlAstWithErrors, component, directives, pipes, schemas) {
var result;
var errors = htmlAstWithErrors.errors;
var usedPipes = [];
if (htmlAstWithErrors.rootNodes.length > 0) {
var uniqDirectives = removeSummaryDuplicates(directives);
var uniqPipes = removeSummaryDuplicates(pipes);
var providerViewContext = new ProviderViewContext(this._reflector, component);
var interpolationConfig = undefined;
if (component.template && component.template.interpolation) {
interpolationConfig = {
start: component.template.interpolation[0],
end: component.template.interpolation[1]
};
}
var bindingParser = new BindingParser(this._exprParser, interpolationConfig, this._schemaRegistry, uniqPipes, errors);
var parseVisitor = new TemplateParseVisitor(this._reflector, this._config, providerViewContext, uniqDirectives, bindingParser, this._schemaRegistry, schemas, errors);
result = visitAll(parseVisitor, htmlAstWithErrors.rootNodes, EMPTY_ELEMENT_CONTEXT);
errors.push.apply(errors, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(providerViewContext.errors));
usedPipes.push.apply(usedPipes, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(bindingParser.getUsedPipes()));
}
else {
result = [];
}
this._assertNoReferenceDuplicationOnTemplate(result, errors);
if (errors.length > 0) {
return new TemplateParseResult(result, usedPipes, errors);
}
if (this.transforms) {
this.transforms.forEach(function (transform) { result = templateVisitAll(transform, result); });
}
return new TemplateParseResult(result, usedPipes, errors);
};
TemplateParser.prototype.expandHtml = function (htmlAstWithErrors, forced) {
if (forced === void 0) { forced = false; }
var errors = htmlAstWithErrors.errors;
if (errors.length == 0 || forced) {
// Transform ICU messages to angular directives
var expandedHtmlAst = expandNodes(htmlAstWithErrors.rootNodes);
errors.push.apply(errors, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(expandedHtmlAst.errors));
htmlAstWithErrors = new ParseTreeResult(expandedHtmlAst.nodes, errors);
}
return htmlAstWithErrors;
};
TemplateParser.prototype.getInterpolationConfig = function (component) {
if (component.template) {
return InterpolationConfig.fromArray(component.template.interpolation);
}
return undefined;
};
/** @internal */
TemplateParser.prototype._assertNoReferenceDuplicationOnTemplate = function (result, errors) {
var existingReferences = [];
result.filter(function (element) { return !!element.references; })
.forEach(function (element) { return element.references.forEach(function (reference) {
var name = reference.name;
if (existingReferences.indexOf(name) < 0) {
existingReferences.push(name);
}
else {
var error$$1 = new TemplateParseError("Reference \"#" + name + "\" is defined several times", reference.sourceSpan, ParseErrorLevel.ERROR);
errors.push(error$$1);
}
}); });
};
return TemplateParser;
}());
var TemplateParseVisitor = /** @class */ (function () {
function TemplateParseVisitor(reflector, config, providerViewContext, directives, _bindingParser, _schemaRegistry, _schemas, _targetErrors) {
var _this = this;
this.reflector = reflector;
this.config = config;
this.providerViewContext = providerViewContext;
this._bindingParser = _bindingParser;
this._schemaRegistry = _schemaRegistry;
this._schemas = _schemas;
this._targetErrors = _targetErrors;
this.selectorMatcher = new SelectorMatcher();
this.directivesIndex = new Map();
this.ngContentCount = 0;
// Note: queries start with id 1 so we can use the number in a Bloom filter!
this.contentQueryStartId = providerViewContext.component.viewQueries.length + 1;
directives.forEach(function (directive, index) {
var selector = CssSelector.parse(directive.selector);
_this.selectorMatcher.addSelectables(selector, directive);
_this.directivesIndex.set(directive, index);
});
}
TemplateParseVisitor.prototype.visitExpansion = function (expansion, context) { return null; };
TemplateParseVisitor.prototype.visitExpansionCase = function (expansionCase, context) { return null; };
TemplateParseVisitor.prototype.visitText = function (text, parent) {
var ngContentIndex = parent.findNgContentIndex(TEXT_CSS_SELECTOR);
var valueNoNgsp = replaceNgsp(text.value);
var expr = this._bindingParser.parseInterpolation(valueNoNgsp, text.sourceSpan);
return expr ? new BoundTextAst(expr, ngContentIndex, text.sourceSpan) :
new TextAst(valueNoNgsp, ngContentIndex, text.sourceSpan);
};
TemplateParseVisitor.prototype.visitAttribute = function (attribute, context) {
return new AttrAst(attribute.name, attribute.value, attribute.sourceSpan);
};
TemplateParseVisitor.prototype.visitComment = function (comment, context) { return null; };
TemplateParseVisitor.prototype.visitElement = function (element, parent) {
var _this = this;
var queryStartIndex = this.contentQueryStartId;
var nodeName = element.name;
var preparsedElement = preparseElement(element);
if (preparsedElement.type === PreparsedElementType.SCRIPT ||
preparsedElement.type === PreparsedElementType.STYLE) {
// Skipping <script> for security reasons
// Skipping <style> as we already processed them
// in the StyleCompiler
return null;
}
if (preparsedElement.type === PreparsedElementType.STYLESHEET &&
isStyleUrlResolvable(preparsedElement.hrefAttr)) {
// Skipping stylesheets with either relative urls or package scheme as we already processed
// them in the StyleCompiler
return null;
}
var matchableAttrs = [];
var elementOrDirectiveProps = [];
var elementOrDirectiveRefs = [];
var elementVars = [];
var events = [];
var templateElementOrDirectiveProps = [];
var templateMatchableAttrs = [];
var templateElementVars = [];
var hasInlineTemplates = false;
var attrs = [];
var isTemplateElement = isNgTemplate(element.name);
element.attrs.forEach(function (attr) {
var hasBinding = _this._parseAttr(isTemplateElement, attr, matchableAttrs, elementOrDirectiveProps, events, elementOrDirectiveRefs, elementVars);
var templateBindingsSource;
var prefixToken;
var normalizedName = _this._normalizeAttributeName(attr.name);
if (normalizedName.startsWith(TEMPLATE_ATTR_PREFIX)) {
templateBindingsSource = attr.value;
prefixToken = normalizedName.substring(TEMPLATE_ATTR_PREFIX.length) + ':';
}
var hasTemplateBinding = templateBindingsSource != null;
if (hasTemplateBinding) {
if (hasInlineTemplates) {
_this._reportError("Can't have multiple template bindings on one element. Use only one attribute prefixed with *", attr.sourceSpan);
}
hasInlineTemplates = true;
_this._bindingParser.parseInlineTemplateBinding(prefixToken, templateBindingsSource, attr.sourceSpan, templateMatchableAttrs, templateElementOrDirectiveProps, templateElementVars);
}
if (!hasBinding && !hasTemplateBinding) {
// don't include the bindings as attributes as well in the AST
attrs.push(_this.visitAttribute(attr, null));
matchableAttrs.push([attr.name, attr.value]);
}
});
var elementCssSelector = createElementCssSelector(nodeName, matchableAttrs);
var _a = this._parseDirectives(this.selectorMatcher, elementCssSelector), directiveMetas = _a.directives, matchElement = _a.matchElement;
var references = [];
var boundDirectivePropNames = new Set();
var directiveAsts = this._createDirectiveAsts(isTemplateElement, element.name, directiveMetas, elementOrDirectiveProps, elementOrDirectiveRefs, element.sourceSpan, references, boundDirectivePropNames);
var elementProps = this._createElementPropertyAsts(element.name, elementOrDirectiveProps, boundDirectivePropNames);
var isViewRoot = parent.isTemplateElement || hasInlineTemplates;
var providerContext = new ProviderElementContext(this.providerViewContext, parent.providerContext, isViewRoot, directiveAsts, attrs, references, isTemplateElement, queryStartIndex, element.sourceSpan);
var children = visitAll(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR : this, element.children, ElementContext.create(isTemplateElement, directiveAsts, isTemplateElement ? parent.providerContext : providerContext));
providerContext.afterElement();
// Override the actual selector when the `ngProjectAs` attribute is provided
var projectionSelector = preparsedElement.projectAs != null ?
CssSelector.parse(preparsedElement.projectAs)[0] :
elementCssSelector;
var ngContentIndex = parent.findNgContentIndex(projectionSelector);
var parsedElement;
if (preparsedElement.type === PreparsedElementType.NG_CONTENT) {
if (element.children && !element.children.every(_isEmptyTextNode)) {
this._reportError("<ng-content> element cannot have content.", element.sourceSpan);
}
parsedElement = new NgContentAst(this.ngContentCount++, hasInlineTemplates ? null : ngContentIndex, element.sourceSpan);
}
else if (isTemplateElement) {
this._assertAllEventsPublishedByDirectives(directiveAsts, events);
this._assertNoComponentsNorElementBindingsOnTemplate(directiveAsts, elementProps, element.sourceSpan);
parsedElement = new EmbeddedTemplateAst(attrs, events, references, elementVars, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, providerContext.queryMatches, children, hasInlineTemplates ? null : ngContentIndex, element.sourceSpan);
}
else {
this._assertElementExists(matchElement, element);
this._assertOnlyOneComponent(directiveAsts, element.sourceSpan);
var ngContentIndex_1 = hasInlineTemplates ? null : parent.findNgContentIndex(projectionSelector);
parsedElement = new ElementAst(nodeName, attrs, elementProps, events, references, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, providerContext.queryMatches, children, hasInlineTemplates ? null : ngContentIndex_1, element.sourceSpan, element.endSourceSpan || null);
}
if (hasInlineTemplates) {
var templateQueryStartIndex = this.contentQueryStartId;
var templateSelector = createElementCssSelector('ng-template', templateMatchableAttrs);
var templateDirectiveMetas = this._parseDirectives(this.selectorMatcher, templateSelector).directives;
var templateBoundDirectivePropNames = new Set();
var templateDirectiveAsts = this._createDirectiveAsts(true, element.name, templateDirectiveMetas, templateElementOrDirectiveProps, [], element.sourceSpan, [], templateBoundDirectivePropNames);
var templateElementProps = this._createElementPropertyAsts(element.name, templateElementOrDirectiveProps, templateBoundDirectivePropNames);
this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectiveAsts, templateElementProps, element.sourceSpan);
var templateProviderContext = new ProviderElementContext(this.providerViewContext, parent.providerContext, parent.isTemplateElement, templateDirectiveAsts, [], [], true, templateQueryStartIndex, element.sourceSpan);
templateProviderContext.afterElement();
parsedElement = new EmbeddedTemplateAst([], [], [], templateElementVars, templateProviderContext.transformedDirectiveAsts, templateProviderContext.transformProviders, templateProviderContext.transformedHasViewContainer, templateProviderContext.queryMatches, [parsedElement], ngContentIndex, element.sourceSpan);
}
return parsedElement;
};
TemplateParseVisitor.prototype._parseAttr = function (isTemplateElement, attr, targetMatchableAttrs, targetProps, targetEvents, targetRefs, targetVars) {
var name = this._normalizeAttributeName(attr.name);
var value = attr.value;
var srcSpan = attr.sourceSpan;
var bindParts = name.match(BIND_NAME_REGEXP);
var hasBinding = false;
if (bindParts !== null) {
hasBinding = true;
if (bindParts[KW_BIND_IDX] != null) {
this._bindingParser.parsePropertyBinding(bindParts[IDENT_KW_IDX], value, false, srcSpan, targetMatchableAttrs, targetProps);
}
else if (bindParts[KW_LET_IDX]) {
if (isTemplateElement) {
var identifier = bindParts[IDENT_KW_IDX];
this._parseVariable(identifier, value, srcSpan, targetVars);
}
else {
this._reportError("\"let-\" is only supported on ng-template elements.", srcSpan);
}
}
else if (bindParts[KW_REF_IDX]) {
var identifier = bindParts[IDENT_KW_IDX];
this._parseReference(identifier, value, srcSpan, targetRefs);
}
else if (bindParts[KW_ON_IDX]) {
this._bindingParser.parseEvent(bindParts[IDENT_KW_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);
}
else if (bindParts[KW_BINDON_IDX]) {
this._bindingParser.parsePropertyBinding(bindParts[IDENT_KW_IDX], value, false, srcSpan, targetMatchableAttrs, targetProps);
this._parseAssignmentEvent(bindParts[IDENT_KW_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);
}
else if (bindParts[KW_AT_IDX]) {
this._bindingParser.parseLiteralAttr(name, value, srcSpan, targetMatchableAttrs, targetProps);
}
else if (bindParts[IDENT_BANANA_BOX_IDX]) {
this._bindingParser.parsePropertyBinding(bindParts[IDENT_BANANA_BOX_IDX], value, false, srcSpan, targetMatchableAttrs, targetProps);
this._parseAssignmentEvent(bindParts[IDENT_BANANA_BOX_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);
}
else if (bindParts[IDENT_PROPERTY_IDX]) {
this._bindingParser.parsePropertyBinding(bindParts[IDENT_PROPERTY_IDX], value, false, srcSpan, targetMatchableAttrs, targetProps);
}
else if (bindParts[IDENT_EVENT_IDX]) {
this._bindingParser.parseEvent(bindParts[IDENT_EVENT_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);
}
}
else {
hasBinding = this._bindingParser.parsePropertyInterpolation(name, value, srcSpan, targetMatchableAttrs, targetProps);
}
if (!hasBinding) {
this._bindingParser.parseLiteralAttr(name, value, srcSpan, targetMatchableAttrs, targetProps);
}
return hasBinding;
};
TemplateParseVisitor.prototype._normalizeAttributeName = function (attrName) {
return /^data-/i.test(attrName) ? attrName.substring(5) : attrName;
};
TemplateParseVisitor.prototype._parseVariable = function (identifier, value, sourceSpan, targetVars) {
if (identifier.indexOf('-') > -1) {
this._reportError("\"-\" is not allowed in variable names", sourceSpan);
}
targetVars.push(new VariableAst(identifier, value, sourceSpan));
};
TemplateParseVisitor.prototype._parseReference = function (identifier, value, sourceSpan, targetRefs) {
if (identifier.indexOf('-') > -1) {
this._reportError("\"-\" is not allowed in reference names", sourceSpan);
}
targetRefs.push(new ElementOrDirectiveRef(identifier, value, sourceSpan));
};
TemplateParseVisitor.prototype._parseAssignmentEvent = function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {
this._bindingParser.parseEvent(name + "Change", expression + "=$event", sourceSpan, targetMatchableAttrs, targetEvents);
};
TemplateParseVisitor.prototype._parseDirectives = function (selectorMatcher, elementCssSelector) {
var _this = this;
// Need to sort the directives so that we get consistent results throughout,
// as selectorMatcher uses Maps inside.
// Also deduplicate directives as they might match more than one time!
var directives = new Array(this.directivesIndex.size);
// Whether any directive selector matches on the element name
var matchElement = false;
selectorMatcher.match(elementCssSelector, function (selector, directive) {
directives[_this.directivesIndex.get(directive)] = directive;
matchElement = matchElement || selector.hasElementSelector();
});
return {
directives: directives.filter(function (dir) { return !!dir; }),
matchElement: matchElement,
};
};
TemplateParseVisitor.prototype._createDirectiveAsts = function (isTemplateElement, elementName, directives, props, elementOrDirectiveRefs, elementSourceSpan, targetReferences, targetBoundDirectivePropNames) {
var _this = this;
var matchedReferences = new Set();
var component = null;
var directiveAsts = directives.map(function (directive) {
var sourceSpan = new ParseSourceSpan(elementSourceSpan.start, elementSourceSpan.end, "Directive " + identifierName(directive.type));
if (directive.isComponent) {
component = directive;
}
var directiveProperties = [];
var hostProperties = _this._bindingParser.createDirectiveHostPropertyAsts(directive, elementName, sourceSpan);
// Note: We need to check the host properties here as well,
// as we don't know the element name in the DirectiveWrapperCompiler yet.
hostProperties = _this._checkPropertiesInSchema(elementName, hostProperties);
var hostEvents = _this._bindingParser.createDirectiveHostEventAsts(directive, sourceSpan);
_this._createDirectivePropertyAsts(directive.inputs, props, directiveProperties, targetBoundDirectivePropNames);
elementOrDirectiveRefs.forEach(function (elOrDirRef) {
if ((elOrDirRef.value.length === 0 && directive.isComponent) ||
(elOrDirRef.isReferenceToDirective(directive))) {
targetReferences.push(new ReferenceAst(elOrDirRef.name, createTokenForReference(directive.type.reference), elOrDirRef.value, elOrDirRef.sourceSpan));
matchedReferences.add(elOrDirRef.name);
}
});
var contentQueryStartId = _this.contentQueryStartId;
_this.contentQueryStartId += directive.queries.length;
return new DirectiveAst(directive, directiveProperties, hostProperties, hostEvents, contentQueryStartId, sourceSpan);
});
elementOrDirectiveRefs.forEach(function (elOrDirRef) {
if (elOrDirRef.value.length > 0) {
if (!matchedReferences.has(elOrDirRef.name)) {
_this._reportError("There is no directive with \"exportAs\" set to \"" + elOrDirRef.value + "\"", elOrDirRef.sourceSpan);
}
}
else if (!component) {
var refToken = null;
if (isTemplateElement) {
refToken = createTokenForExternalReference(_this.reflector, Identifiers.TemplateRef);
}
targetReferences.push(new ReferenceAst(elOrDirRef.name, refToken, elOrDirRef.value, elOrDirRef.sourceSpan));
}
});
return directiveAsts;
};
TemplateParseVisitor.prototype._createDirectivePropertyAsts = function (directiveProperties, boundProps, targetBoundDirectiveProps, targetBoundDirectivePropNames) {
if (directiveProperties) {
var boundPropsByName_1 = new Map();
boundProps.forEach(function (boundProp) {
var prevValue = boundPropsByName_1.get(boundProp.name);
if (!prevValue || prevValue.isLiteral) {
// give [a]="b" a higher precedence than a="b" on the same element
boundPropsByName_1.set(boundProp.name, boundProp);
}
});
Object.keys(directiveProperties).forEach(function (dirProp) {
var elProp = directiveProperties[dirProp];
var boundProp = boundPropsByName_1.get(elProp);
// Bindings are optional, so this binding only needs to be set up if an expression is given.
if (boundProp) {
targetBoundDirectivePropNames.add(boundProp.name);
if (!isEmptyExpression(boundProp.expression)) {
targetBoundDirectiveProps.push(new BoundDirectivePropertyAst(dirProp, boundProp.name, boundProp.expression, boundProp.sourceSpan));
}
}
});
}
};
TemplateParseVisitor.prototype._createElementPropertyAsts = function (elementName, props, boundDirectivePropNames) {
var _this = this;
var boundElementProps = [];
props.forEach(function (prop) {
if (!prop.isLiteral && !boundDirectivePropNames.has(prop.name)) {
boundElementProps.push(_this._bindingParser.createElementPropertyAst(elementName, prop));
}
});
return this._checkPropertiesInSchema(elementName, boundElementProps);
};
TemplateParseVisitor.prototype._findComponentDirectives = function (directives) {
return directives.filter(function (directive) { return directive.directive.isComponent; });
};
TemplateParseVisitor.prototype._findComponentDirectiveNames = function (directives) {
return this._findComponentDirectives(directives)
.map(function (directive) { return identifierName(directive.directive.type); });
};
TemplateParseVisitor.prototype._assertOnlyOneComponent = function (directives, sourceSpan) {
var componentTypeNames = this._findComponentDirectiveNames(directives);
if (componentTypeNames.length > 1) {
this._reportError("More than one component matched on this element.\n" +
"Make sure that only one component's selector can match a given element.\n" +
("Conflicting components: " + componentTypeNames.join(',')), sourceSpan);
}
};
/**
* Make sure that non-angular tags conform to the schemas.
*
* Note: An element is considered an angular tag when at least one directive selector matches the
* tag name.
*
* @param matchElement Whether any directive has matched on the tag name
* @param element the html element
*/
TemplateParseVisitor.prototype._assertElementExists = function (matchElement, element) {
var elName = element.name.replace(/^:xhtml:/, '');
if (!matchElement && !this._schemaRegistry.hasElement(elName, this._schemas)) {
var errorMsg = "'" + elName + "' is not a known element:\n";
errorMsg +=
"1. If '" + elName + "' is an Angular component, then verify that it is part of this module.\n";
if (elName.indexOf('-') > -1) {
errorMsg +=
"2. If '" + elName + "' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.";
}
else {
errorMsg +=
"2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.";
}
this._reportError(errorMsg, element.sourceSpan);
}
};
TemplateParseVisitor.prototype._assertNoComponentsNorElementBindingsOnTemplate = function (directives, elementProps, sourceSpan) {
var _this = this;
var componentTypeNames = this._findComponentDirectiveNames(directives);
if (componentTypeNames.length > 0) {
this._reportError("Components on an embedded template: " + componentTypeNames.join(','), sourceSpan);
}
elementProps.forEach(function (prop) {
_this._reportError("Property binding " + prop.name + " not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the \"@NgModule.declarations\".", sourceSpan);
});
};
TemplateParseVisitor.prototype._assertAllEventsPublishedByDirectives = function (directives, events) {
var _this = this;
var allDirectiveEvents = new Set();
directives.forEach(function (directive) {
Object.keys(directive.directive.outputs).forEach(function (k) {
var eventName = directive.directive.outputs[k];
allDirectiveEvents.add(eventName);
});
});
events.forEach(function (event) {
if (event.target != null || !allDirectiveEvents.has(event.name)) {
_this._reportError("Event binding " + event.fullName + " not emitted by any directive on an embedded template. Make sure that the event name is spelled correctly and all directives are listed in the \"@NgModule.declarations\".", event.sourceSpan);
}
});
};
TemplateParseVisitor.prototype._checkPropertiesInSchema = function (elementName, boundProps) {
var _this = this;
// Note: We can't filter out empty expressions before this method,
// as we still want to validate them!
return boundProps.filter(function (boundProp) {
if (boundProp.type === PropertyBindingType.Property &&
!_this._schemaRegistry.hasProperty(elementName, boundProp.name, _this._schemas)) {
var errorMsg = "Can't bind to '" + boundProp.name + "' since it isn't a known property of '" + elementName + "'.";
if (elementName.startsWith('ng-')) {
errorMsg +=
"\n1. If '" + boundProp.name + "' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component." +
"\n2. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.";
}
else if (elementName.indexOf('-') > -1) {
errorMsg +=
"\n1. If '" + elementName + "' is an Angular component and it has '" + boundProp.name + "' input, then verify that it is part of this module." +
("\n2. If '" + elementName + "' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.") +
"\n3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.";
}
_this._reportError(errorMsg, boundProp.sourceSpan);
}
return !isEmptyExpression(boundProp.value);
});
};
TemplateParseVisitor.prototype._reportError = function (message, sourceSpan, level) {
if (level === void 0) { level = ParseErrorLevel.ERROR; }
this._targetErrors.push(new ParseError(sourceSpan, message, level));
};
return TemplateParseVisitor;
}());
var NonBindableVisitor = /** @class */ (function () {
function NonBindableVisitor() {
}
NonBindableVisitor.prototype.visitElement = function (ast, parent) {
var preparsedElement = preparseElement(ast);
if (preparsedElement.type === PreparsedElementType.SCRIPT ||
preparsedElement.type === PreparsedElementType.STYLE ||
preparsedElement.type === PreparsedElementType.STYLESHEET) {
// Skipping <script> for security reasons
// Skipping <style> and stylesheets as we already processed them
// in the StyleCompiler
return null;
}
var attrNameAndValues = ast.attrs.map(function (attr) { return [attr.name, attr.value]; });
var selector = createElementCssSelector(ast.name, attrNameAndValues);
var ngContentIndex = parent.findNgContentIndex(selector);
var children = visitAll(this, ast.children, EMPTY_ELEMENT_CONTEXT);
return new ElementAst(ast.name, visitAll(this, ast.attrs), [], [], [], [], [], false, [], children, ngContentIndex, ast.sourceSpan, ast.endSourceSpan);
};
NonBindableVisitor.prototype.visitComment = function (comment, context) { return null; };
NonBindableVisitor.prototype.visitAttribute = function (attribute, context) {
return new AttrAst(attribute.name, attribute.value, attribute.sourceSpan);
};
NonBindableVisitor.prototype.visitText = function (text, parent) {
var ngContentIndex = parent.findNgContentIndex(TEXT_CSS_SELECTOR);
return new TextAst(text.value, ngContentIndex, text.sourceSpan);
};
NonBindableVisitor.prototype.visitExpansion = function (expansion, context) { return expansion; };
NonBindableVisitor.prototype.visitExpansionCase = function (expansionCase, context) { return expansionCase; };
return NonBindableVisitor;
}());
/**
* A reference to an element or directive in a template. E.g., the reference in this template:
*
* <div #myMenu="coolMenu">
*
* would be {name: 'myMenu', value: 'coolMenu', sourceSpan: ...}
*/
var ElementOrDirectiveRef = /** @class */ (function () {
function ElementOrDirectiveRef(name, value, sourceSpan) {
this.name = name;
this.value = value;
this.sourceSpan = sourceSpan;
}
/** Gets whether this is a reference to the given directive. */
ElementOrDirectiveRef.prototype.isReferenceToDirective = function (directive) {
return splitExportAs(directive.exportAs).indexOf(this.value) !== -1;
};
return ElementOrDirectiveRef;
}());
/** Splits a raw, potentially comma-delimited `exportAs` value into an array of names. */
function splitExportAs(exportAs) {
return exportAs ? exportAs.split(',').map(function (e) { return e.trim(); }) : [];
}
function splitClasses(classAttrValue) {
return classAttrValue.trim().split(/\s+/g);
}
var ElementContext = /** @class */ (function () {
function ElementContext(isTemplateElement, _ngContentIndexMatcher, _wildcardNgContentIndex, providerContext) {
this.isTemplateElement = isTemplateElement;
this._ngContentIndexMatcher = _ngContentIndexMatcher;
this._wildcardNgContentIndex = _wildcardNgContentIndex;
this.providerContext = providerContext;
}
ElementContext.create = function (isTemplateElement, directives, providerContext) {
var matcher = new SelectorMatcher();
var wildcardNgContentIndex = null;
var component = directives.find(function (directive) { return directive.directive.isComponent; });
if (component) {
var ngContentSelectors = component.directive.template.ngContentSelectors;
for (var i = 0; i < ngContentSelectors.length; i++) {
var selector = ngContentSelectors[i];
if (selector === '*') {
wildcardNgContentIndex = i;
}
else {
matcher.addSelectables(CssSelector.parse(ngContentSelectors[i]), i);
}
}
}
return new ElementContext(isTemplateElement, matcher, wildcardNgContentIndex, providerContext);
};
ElementContext.prototype.findNgContentIndex = function (selector) {
var ngContentIndices = [];
this._ngContentIndexMatcher.match(selector, function (selector, ngContentIndex) { ngContentIndices.push(ngContentIndex); });
ngContentIndices.sort();
if (this._wildcardNgContentIndex != null) {
ngContentIndices.push(this._wildcardNgContentIndex);
}
return ngContentIndices.length > 0 ? ngContentIndices[0] : null;
};
return ElementContext;
}());
function createElementCssSelector(elementName, attributes) {
var cssSelector = new CssSelector();
var elNameNoNs = splitNsName(elementName)[1];
cssSelector.setElement(elNameNoNs);
for (var i = 0; i < attributes.length; i++) {
var attrName = attributes[i][0];
var attrNameNoNs = splitNsName(attrName)[1];
var attrValue = attributes[i][1];
cssSelector.addAttribute(attrNameNoNs, attrValue);
if (attrName.toLowerCase() == CLASS_ATTR) {
var classes = splitClasses(attrValue);
classes.forEach(function (className) { return cssSelector.addClassName(className); });
}
}
return cssSelector;
}
var EMPTY_ELEMENT_CONTEXT = new ElementContext(true, new SelectorMatcher(), null, null);
var NON_BINDABLE_VISITOR = new NonBindableVisitor();
function _isEmptyTextNode(node) {
return node instanceof Text && node.value.trim().length == 0;
}
function removeSummaryDuplicates(items) {
var map = new Map();
items.forEach(function (item) {
if (!map.get(item.type.reference)) {
map.set(item.type.reference, item);
}
});
return Array.from(map.values());
}
function isEmptyExpression(ast) {
if (ast instanceof ASTWithSource) {
ast = ast.ast;
}
return ast instanceof EmptyExpr;
}
/**
* @license
* Copyright Google Inc. 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 EventHandlerVars = /** @class */ (function () {
function EventHandlerVars() {
}
EventHandlerVars.event = variable('$event');
return EventHandlerVars;
}());
var ConvertActionBindingResult = /** @class */ (function () {
function ConvertActionBindingResult(
/**
* Render2 compatible statements,
*/
stmts,
/**
* Variable name used with render2 compatible statements.
*/
allowDefault) {
this.stmts = stmts;
this.allowDefault = allowDefault;
/**
* This is bit of a hack. It converts statements which render2 expects to statements which are
* expected by render3.
*
* Example: `<div click="doSomething($event)">` will generate:
*
* Render3:
* ```
* const pd_b:any = ((<any>ctx.doSomething($event)) !== false);
* return pd_b;
* ```
*
* but render2 expects:
* ```
* return ctx.doSomething($event);
* ```
*/
// TODO(misko): remove this hack once we no longer support ViewEngine.
this.render3Stmts = stmts.map(function (statement) {
if (statement instanceof DeclareVarStmt && statement.name == allowDefault.name &&
statement.value instanceof BinaryOperatorExpr) {
var lhs = statement.value.lhs;
return new ReturnStatement(lhs.value);
}
return statement;
});
}
return ConvertActionBindingResult;
}());
/**
* Converts the given expression AST into an executable output AST, assuming the expression is
* used in an action binding (e.g. an event handler).
*/
function convertActionBinding(localResolver, implicitReceiver, action, bindingId, interpolationFunction) {
if (!localResolver) {
localResolver = new DefaultLocalResolver();
}
var actionWithoutBuiltins = convertPropertyBindingBuiltins({
createLiteralArrayConverter: function (argCount) {
// Note: no caching for literal arrays in actions.
return function (args) { return literalArr(args); };
},
createLiteralMapConverter: function (keys) {
// Note: no caching for literal maps in actions.
return function (values) {
var entries = keys.map(function (k, i) { return ({
key: k.key,
value: values[i],
quoted: k.quoted,
}); });
return literalMap(entries);
};
},
createPipeConverter: function (name) {
throw new Error("Illegal State: Actions are not allowed to contain pipes. Pipe: " + name);
}
}, action);
var visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, interpolationFunction);
var actionStmts = [];
flattenStatements(actionWithoutBuiltins.visit(visitor, _Mode.Statement), actionStmts);
prependTemporaryDecls(visitor.temporaryCount, bindingId, actionStmts);
var lastIndex = actionStmts.length - 1;
var preventDefaultVar = null;
if (lastIndex >= 0) {
var lastStatement = actionStmts[lastIndex];
var returnExpr = convertStmtIntoExpression(lastStatement);
if (returnExpr) {
// Note: We need to cast the result of the method call to dynamic,
// as it might be a void method!
preventDefaultVar = createPreventDefaultVar(bindingId);
actionStmts[lastIndex] =
preventDefaultVar.set(returnExpr.cast(DYNAMIC_TYPE).notIdentical(literal(false)))
.toDeclStmt(null, [StmtModifier.Final]);
}
}
return new ConvertActionBindingResult(actionStmts, preventDefaultVar);
}
function convertPropertyBindingBuiltins(converterFactory, ast) {
return convertBuiltins(converterFactory, ast);
}
var ConvertPropertyBindingResult = /** @class */ (function () {
function ConvertPropertyBindingResult(stmts, currValExpr) {
this.stmts = stmts;
this.currValExpr = currValExpr;
}
return ConvertPropertyBindingResult;
}());
var BindingForm;
(function (BindingForm) {
// The general form of binding expression, supports all expressions.
BindingForm[BindingForm["General"] = 0] = "General";
// Try to generate a simple binding (no temporaries or statements)
// otherwise generate a general binding
BindingForm[BindingForm["TrySimple"] = 1] = "TrySimple";
})(BindingForm || (BindingForm = {}));
/**
* Converts the given expression AST into an executable output AST, assuming the expression
* is used in property binding. The expression has to be preprocessed via
* `convertPropertyBindingBuiltins`.
*/
function convertPropertyBinding(localResolver, implicitReceiver, expressionWithoutBuiltins, bindingId, form, interpolationFunction) {
if (!localResolver) {
localResolver = new DefaultLocalResolver();
}
var currValExpr = createCurrValueExpr(bindingId);
var stmts = [];
var visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, interpolationFunction);
var outputExpr = expressionWithoutBuiltins.visit(visitor, _Mode.Expression);
if (visitor.temporaryCount) {
for (var i = 0; i < visitor.temporaryCount; i++) {
stmts.push(temporaryDeclaration(bindingId, i));
}
}
else if (form == BindingForm.TrySimple) {
return new ConvertPropertyBindingResult([], outputExpr);
}
stmts.push(currValExpr.set(outputExpr).toDeclStmt(DYNAMIC_TYPE, [StmtModifier.Final]));
return new ConvertPropertyBindingResult(stmts, currValExpr);
}
function convertBuiltins(converterFactory, ast) {
var visitor = new _BuiltinAstConverter(converterFactory);
return ast.visit(visitor);
}
function temporaryName(bindingId, temporaryNumber) {
return "tmp_" + bindingId + "_" + temporaryNumber;
}
function temporaryDeclaration(bindingId, temporaryNumber) {
return new DeclareVarStmt(temporaryName(bindingId, temporaryNumber), NULL_EXPR);
}
function prependTemporaryDecls(temporaryCount, bindingId, statements) {
for (var i = temporaryCount - 1; i >= 0; i--) {
statements.unshift(temporaryDeclaration(bindingId, i));
}
}
var _Mode;
(function (_Mode) {
_Mode[_Mode["Statement"] = 0] = "Statement";
_Mode[_Mode["Expression"] = 1] = "Expression";
})(_Mode || (_Mode = {}));
function ensureStatementMode(mode, ast) {
if (mode !== _Mode.Statement) {
throw new Error("Expected a statement, but saw " + ast);
}
}
function ensureExpressionMode(mode, ast) {
if (mode !== _Mode.Expression) {
throw new Error("Expected an expression, but saw " + ast);
}
}
function convertToStatementIfNeeded(mode, expr) {
if (mode === _Mode.Statement) {
return expr.toStmt();
}
else {
return expr;
}
}
var _BuiltinAstConverter = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(_BuiltinAstConverter, _super);
function _BuiltinAstConverter(_converterFactory) {
var _this = _super.call(this) || this;
_this._converterFactory = _converterFactory;
return _this;
}
_BuiltinAstConverter.prototype.visitPipe = function (ast, context) {
var _this = this;
var args = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([ast.exp], ast.args).map(function (ast) { return ast.visit(_this, context); });
return new BuiltinFunctionCall(ast.span, args, this._converterFactory.createPipeConverter(ast.name, args.length));
};
_BuiltinAstConverter.prototype.visitLiteralArray = function (ast, context) {
var _this = this;
var args = ast.expressions.map(function (ast) { return ast.visit(_this, context); });
return new BuiltinFunctionCall(ast.span, args, this._converterFactory.createLiteralArrayConverter(ast.expressions.length));
};
_BuiltinAstConverter.prototype.visitLiteralMap = function (ast, context) {
var _this = this;
var args = ast.values.map(function (ast) { return ast.visit(_this, context); });
return new BuiltinFunctionCall(ast.span, args, this._converterFactory.createLiteralMapConverter(ast.keys));
};
return _BuiltinAstConverter;
}(AstTransformer));
var _AstToIrVisitor = /** @class */ (function () {
function _AstToIrVisitor(_localResolver, _implicitReceiver, bindingId, interpolationFunction) {
this._localResolver = _localResolver;
this._implicitReceiver = _implicitReceiver;
this.bindingId = bindingId;
this.interpolationFunction = interpolationFunction;
this._nodeMap = new Map();
this._resultMap = new Map();
this._currentTemporary = 0;
this.temporaryCount = 0;
}
_AstToIrVisitor.prototype.visitBinary = function (ast, mode) {
var op;
switch (ast.operation) {
case '+':
op = BinaryOperator.Plus;
break;
case '-':
op = BinaryOperator.Minus;
break;
case '*':
op = BinaryOperator.Multiply;
break;
case '/':
op = BinaryOperator.Divide;
break;
case '%':
op = BinaryOperator.Modulo;
break;
case '&&':
op = BinaryOperator.And;
break;
case '||':
op = BinaryOperator.Or;
break;
case '==':
op = BinaryOperator.Equals;
break;
case '!=':
op = BinaryOperator.NotEquals;
break;
case '===':
op = BinaryOperator.Identical;
break;
case '!==':
op = BinaryOperator.NotIdentical;
break;
case '<':
op = BinaryOperator.Lower;
break;
case '>':
op = BinaryOperator.Bigger;
break;
case '<=':
op = BinaryOperator.LowerEquals;
break;
case '>=':
op = BinaryOperator.BiggerEquals;
break;
default:
throw new Error("Unsupported operation " + ast.operation);
}
return convertToStatementIfNeeded(mode, new BinaryOperatorExpr(op, this._visit(ast.left, _Mode.Expression), this._visit(ast.right, _Mode.Expression)));
};
_AstToIrVisitor.prototype.visitChain = function (ast, mode) {
ensureStatementMode(mode, ast);
return this.visitAll(ast.expressions, mode);
};
_AstToIrVisitor.prototype.visitConditional = function (ast, mode) {
var value = this._visit(ast.condition, _Mode.Expression);
return convertToStatementIfNeeded(mode, value.conditional(this._visit(ast.trueExp, _Mode.Expression), this._visit(ast.falseExp, _Mode.Expression)));
};
_AstToIrVisitor.prototype.visitPipe = function (ast, mode) {
throw new Error("Illegal state: Pipes should have been converted into functions. Pipe: " + ast.name);
};
_AstToIrVisitor.prototype.visitFunctionCall = function (ast, mode) {
var convertedArgs = this.visitAll(ast.args, _Mode.Expression);
var fnResult;
if (ast instanceof BuiltinFunctionCall) {
fnResult = ast.converter(convertedArgs);
}
else {
fnResult = this._visit(ast.target, _Mode.Expression).callFn(convertedArgs);
}
return convertToStatementIfNeeded(mode, fnResult);
};
_AstToIrVisitor.prototype.visitImplicitReceiver = function (ast, mode) {
ensureExpressionMode(mode, ast);
return this._implicitReceiver;
};
_AstToIrVisitor.prototype.visitInterpolation = function (ast, mode) {
ensureExpressionMode(mode, ast);
var args = [literal(ast.expressions.length)];
for (var i = 0; i < ast.strings.length - 1; i++) {
args.push(literal(ast.strings[i]));
args.push(this._visit(ast.expressions[i], _Mode.Expression));
}
args.push(literal(ast.strings[ast.strings.length - 1]));
if (this.interpolationFunction) {
return this.interpolationFunction(args);
}
return ast.expressions.length <= 9 ?
importExpr(Identifiers.inlineInterpolate).callFn(args) :
importExpr(Identifiers.interpolate).callFn([args[0], literalArr(args.slice(1))]);
};
_AstToIrVisitor.prototype.visitKeyedRead = function (ast, mode) {
var leftMostSafe = this.leftMostSafeNode(ast);
if (leftMostSafe) {
return this.convertSafeAccess(ast, leftMostSafe, mode);
}
else {
return convertToStatementIfNeeded(mode, this._visit(ast.obj, _Mode.Expression).key(this._visit(ast.key, _Mode.Expression)));
}
};
_AstToIrVisitor.prototype.visitKeyedWrite = function (ast, mode) {
var obj = this._visit(ast.obj, _Mode.Expression);
var key = this._visit(ast.key, _Mode.Expression);
var value = this._visit(ast.value, _Mode.Expression);
return convertToStatementIfNeeded(mode, obj.key(key).set(value));
};
_AstToIrVisitor.prototype.visitLiteralArray = function (ast, mode) {
throw new Error("Illegal State: literal arrays should have been converted into functions");
};
_AstToIrVisitor.prototype.visitLiteralMap = function (ast, mode) {
throw new Error("Illegal State: literal maps should have been converted into functions");
};
_AstToIrVisitor.prototype.visitLiteralPrimitive = function (ast, mode) {
// For literal values of null, undefined, true, or false allow type interference
// to infer the type.
var type = ast.value === null || ast.value === undefined || ast.value === true || ast.value === true ?
INFERRED_TYPE :
undefined;
return convertToStatementIfNeeded(mode, literal(ast.value, type));
};
_AstToIrVisitor.prototype._getLocal = function (name) { return this._localResolver.getLocal(name); };
_AstToIrVisitor.prototype.visitMethodCall = function (ast, mode) {
if (ast.receiver instanceof ImplicitReceiver && ast.name == '$any') {
var args = this.visitAll(ast.args, _Mode.Expression);
if (args.length != 1) {
throw new Error("Invalid call to $any, expected 1 argument but received " + (args.length || 'none'));
}
return args[0].cast(DYNAMIC_TYPE);
}
var leftMostSafe = this.leftMostSafeNode(ast);
if (leftMostSafe) {
return this.convertSafeAccess(ast, leftMostSafe, mode);
}
else {
var args = this.visitAll(ast.args, _Mode.Expression);
var result = null;
var receiver = this._visit(ast.receiver, _Mode.Expression);
if (receiver === this._implicitReceiver) {
var varExpr = this._getLocal(ast.name);
if (varExpr) {
result = varExpr.callFn(args);
}
}
if (result == null) {
result = receiver.callMethod(ast.name, args);
}
return convertToStatementIfNeeded(mode, result);
}
};
_AstToIrVisitor.prototype.visitPrefixNot = function (ast, mode) {
return convertToStatementIfNeeded(mode, not(this._visit(ast.expression, _Mode.Expression)));
};
_AstToIrVisitor.prototype.visitNonNullAssert = function (ast, mode) {
return convertToStatementIfNeeded(mode, assertNotNull(this._visit(ast.expression, _Mode.Expression)));
};
_AstToIrVisitor.prototype.visitPropertyRead = function (ast, mode) {
var leftMostSafe = this.leftMostSafeNode(ast);
if (leftMostSafe) {
return this.convertSafeAccess(ast, leftMostSafe, mode);
}
else {
var result = null;
var receiver = this._visit(ast.receiver, _Mode.Expression);
if (receiver === this._implicitReceiver) {
result = this._getLocal(ast.name);
}
if (result == null) {
result = receiver.prop(ast.name);
}
return convertToStatementIfNeeded(mode, result);
}
};
_AstToIrVisitor.prototype.visitPropertyWrite = function (ast, mode) {
var receiver = this._visit(ast.receiver, _Mode.Expression);
if (receiver === this._implicitReceiver) {
var varExpr = this._getLocal(ast.name);
if (varExpr) {
throw new Error('Cannot assign to a reference or variable!');
}
}
return convertToStatementIfNeeded(mode, receiver.prop(ast.name).set(this._visit(ast.value, _Mode.Expression)));
};
_AstToIrVisitor.prototype.visitSafePropertyRead = function (ast, mode) {
return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);
};
_AstToIrVisitor.prototype.visitSafeMethodCall = function (ast, mode) {
return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);
};
_AstToIrVisitor.prototype.visitAll = function (asts, mode) {
var _this = this;
return asts.map(function (ast) { return _this._visit(ast, mode); });
};
_AstToIrVisitor.prototype.visitQuote = function (ast, mode) {
throw new Error("Quotes are not supported for evaluation!\n Statement: " + ast.uninterpretedExpression + " located at " + ast.location);
};
_AstToIrVisitor.prototype._visit = function (ast, mode) {
var result = this._resultMap.get(ast);
if (result)
return result;
return (this._nodeMap.get(ast) || ast).visit(this, mode);
};
_AstToIrVisitor.prototype.convertSafeAccess = function (ast, leftMostSafe, mode) {
// If the expression contains a safe access node on the left it needs to be converted to
// an expression that guards the access to the member by checking the receiver for blank. As
// execution proceeds from left to right, the left most part of the expression must be guarded
// first but, because member access is left associative, the right side of the expression is at
// the top of the AST. The desired result requires lifting a copy of the the left part of the
// expression up to test it for blank before generating the unguarded version.
// Consider, for example the following expression: a?.b.c?.d.e
// This results in the ast:
// .
// / \
// ?. e
// / \
// . d
// / \
// ?. c
// / \
// a b
// The following tree should be generated:
//
// /---- ? ----\
// / | \
// a /--- ? ---\ null
// / | \
// . . null
// / \ / \
// . c . e
// / \ / \
// a b , d
// / \
// . c
// / \
// a b
//
// Notice that the first guard condition is the left hand of the left most safe access node
// which comes in as leftMostSafe to this routine.
var guardedExpression = this._visit(leftMostSafe.receiver, _Mode.Expression);
var temporary = undefined;
if (this.needsTemporary(leftMostSafe.receiver)) {
// If the expression has method calls or pipes then we need to save the result into a
// temporary variable to avoid calling stateful or impure code more than once.
temporary = this.allocateTemporary();
// Preserve the result in the temporary variable
guardedExpression = temporary.set(guardedExpression);
// Ensure all further references to the guarded expression refer to the temporary instead.
this._resultMap.set(leftMostSafe.receiver, temporary);
}
var condition = guardedExpression.isBlank();
// Convert the ast to an unguarded access to the receiver's member. The map will substitute
// leftMostNode with its unguarded version in the call to `this.visit()`.
if (leftMostSafe instanceof SafeMethodCall) {
this._nodeMap.set(leftMostSafe, new MethodCall(leftMostSafe.span, leftMostSafe.receiver, leftMostSafe.name, leftMostSafe.args));
}
else {
this._nodeMap.set(leftMostSafe, new PropertyRead(leftMostSafe.span, leftMostSafe.receiver, leftMostSafe.name));
}
// Recursively convert the node now without the guarded member access.
var access = this._visit(ast, _Mode.Expression);
// Remove the mapping. This is not strictly required as the converter only traverses each node
// once but is safer if the conversion is changed to traverse the nodes more than once.
this._nodeMap.delete(leftMostSafe);
// If we allocated a temporary, release it.
if (temporary) {
this.releaseTemporary(temporary);
}
// Produce the conditional
return convertToStatementIfNeeded(mode, condition.conditional(literal(null), access));
};
// Given a expression of the form a?.b.c?.d.e the the left most safe node is
// the (a?.b). The . and ?. are left associative thus can be rewritten as:
// ((((a?.c).b).c)?.d).e. This returns the most deeply nested safe read or
// safe method call as this needs be transform initially to:
// a == null ? null : a.c.b.c?.d.e
// then to:
// a == null ? null : a.b.c == null ? null : a.b.c.d.e
_AstToIrVisitor.prototype.leftMostSafeNode = function (ast) {
var _this = this;
var visit = function (visitor, ast) {
return (_this._nodeMap.get(ast) || ast).visit(visitor);
};
return ast.visit({
visitBinary: function (ast) { return null; },
visitChain: function (ast) { return null; },
visitConditional: function (ast) { return null; },
visitFunctionCall: function (ast) { return null; },
visitImplicitReceiver: function (ast) { return null; },
visitInterpolation: function (ast) { return null; },
visitKeyedRead: function (ast) { return visit(this, ast.obj); },
visitKeyedWrite: function (ast) { return null; },
visitLiteralArray: function (ast) { return null; },
visitLiteralMap: function (ast) { return null; },
visitLiteralPrimitive: function (ast) { return null; },
visitMethodCall: function (ast) { return visit(this, ast.receiver); },
visitPipe: function (ast) { return null; },
visitPrefixNot: function (ast) { return null; },
visitNonNullAssert: function (ast) { return null; },
visitPropertyRead: function (ast) { return visit(this, ast.receiver); },
visitPropertyWrite: function (ast) { return null; },
visitQuote: function (ast) { return null; },
visitSafeMethodCall: function (ast) { return visit(this, ast.receiver) || ast; },
visitSafePropertyRead: function (ast) {
return visit(this, ast.receiver) || ast;
}
});
};
// Returns true of the AST includes a method or a pipe indicating that, if the
// expression is used as the target of a safe property or method access then
// the expression should be stored into a temporary variable.
_AstToIrVisitor.prototype.needsTemporary = function (ast) {
var _this = this;
var visit = function (visitor, ast) {
return ast && (_this._nodeMap.get(ast) || ast).visit(visitor);
};
var visitSome = function (visitor, ast) {
return ast.some(function (ast) { return visit(visitor, ast); });
};
return ast.visit({
visitBinary: function (ast) { return visit(this, ast.left) || visit(this, ast.right); },
visitChain: function (ast) { return false; },
visitConditional: function (ast) {
return visit(this, ast.condition) || visit(this, ast.trueExp) ||
visit(this, ast.falseExp);
},
visitFunctionCall: function (ast) { return true; },
visitImplicitReceiver: function (ast) { return false; },
visitInterpolation: function (ast) { return visitSome(this, ast.expressions); },
visitKeyedRead: function (ast) { return false; },
visitKeyedWrite: function (ast) { return false; },
visitLiteralArray: function (ast) { return true; },
visitLiteralMap: function (ast) { return true; },
visitLiteralPrimitive: function (ast) { return false; },
visitMethodCall: function (ast) { return true; },
visitPipe: function (ast) { return true; },
visitPrefixNot: function (ast) { return visit(this, ast.expression); },
visitNonNullAssert: function (ast) { return visit(this, ast.expression); },
visitPropertyRead: function (ast) { return false; },
visitPropertyWrite: function (ast) { return false; },
visitQuote: function (ast) { return false; },
visitSafeMethodCall: function (ast) { return true; },
visitSafePropertyRead: function (ast) { return false; }
});
};
_AstToIrVisitor.prototype.allocateTemporary = function () {
var tempNumber = this._currentTemporary++;
this.temporaryCount = Math.max(this._currentTemporary, this.temporaryCount);
return new ReadVarExpr(temporaryName(this.bindingId, tempNumber));
};
_AstToIrVisitor.prototype.releaseTemporary = function (temporary) {
this._currentTemporary--;
if (temporary.name != temporaryName(this.bindingId, this._currentTemporary)) {
throw new Error("Temporary " + temporary.name + " released out of order");
}
};
return _AstToIrVisitor;
}());
function flattenStatements(arg, output) {
if (Array.isArray(arg)) {
arg.forEach(function (entry) { return flattenStatements(entry, output); });
}
else {
output.push(arg);
}
}
var DefaultLocalResolver = /** @class */ (function () {
function DefaultLocalResolver() {
}
DefaultLocalResolver.prototype.getLocal = function (name) {
if (name === EventHandlerVars.event.name) {
return EventHandlerVars.event;
}
return null;
};
return DefaultLocalResolver;
}());
function createCurrValueExpr(bindingId) {
return variable("currVal_" + bindingId); // fix syntax highlighting: `
}
function createPreventDefaultVar(bindingId) {
return variable("pd_" + bindingId);
}
function convertStmtIntoExpression(stmt) {
if (stmt instanceof ExpressionStatement) {
return stmt.expr;
}
else if (stmt instanceof ReturnStatement) {
return stmt.value;
}
return null;
}
var BuiltinFunctionCall = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BuiltinFunctionCall, _super);
function BuiltinFunctionCall(span, args, converter) {
var _this = _super.call(this, span, null, args) || this;
_this.args = args;
_this.converter = converter;
return _this;
}
return BuiltinFunctionCall;
}(FunctionCall));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Generates code that is used to type check templates.
*/
var TypeCheckCompiler = /** @class */ (function () {
function TypeCheckCompiler(options, reflector) {
this.options = options;
this.reflector = reflector;
}
/**
* Important notes:
* - This must not produce new `import` statements, but only refer to types outside
* of the file via the variables provided via externalReferenceVars.
* This allows Typescript to reuse the old program's structure as no imports have changed.
* - This must not produce any exports, as this would pollute the .d.ts file
* and also violate the point above.
*/
TypeCheckCompiler.prototype.compileComponent = function (componentId, component, template, usedPipes, externalReferenceVars, ctx) {
var _this = this;
var pipes = new Map();
usedPipes.forEach(function (p) { return pipes.set(p.name, p.type.reference); });
var embeddedViewCount = 0;
var viewBuilderFactory = function (parent, guards) {
var embeddedViewIndex = embeddedViewCount++;
return new ViewBuilder(_this.options, _this.reflector, externalReferenceVars, parent, component.type.reference, component.isHost, embeddedViewIndex, pipes, guards, ctx, viewBuilderFactory);
};
var visitor = viewBuilderFactory(null, []);
visitor.visitAll([], template);
return visitor.build(componentId);
};
return TypeCheckCompiler;
}());
var DYNAMIC_VAR_NAME = '_any';
var TypeCheckLocalResolver = /** @class */ (function () {
function TypeCheckLocalResolver() {
}
TypeCheckLocalResolver.prototype.getLocal = function (name) {
if (name === EventHandlerVars.event.name) {
// References to the event should not be type-checked.
// TODO(chuckj): determine a better type for the event.
return variable(DYNAMIC_VAR_NAME);
}
return null;
};
return TypeCheckLocalResolver;
}());
var defaultResolver = new TypeCheckLocalResolver();
var ViewBuilder = /** @class */ (function () {
function ViewBuilder(options, reflector, externalReferenceVars, parent, component, isHostComponent, embeddedViewIndex, pipes, guards, ctx, viewBuilderFactory) {
this.options = options;
this.reflector = reflector;
this.externalReferenceVars = externalReferenceVars;
this.parent = parent;
this.component = component;
this.isHostComponent = isHostComponent;
this.embeddedViewIndex = embeddedViewIndex;
this.pipes = pipes;
this.guards = guards;
this.ctx = ctx;
this.viewBuilderFactory = viewBuilderFactory;
this.refOutputVars = new Map();
this.variables = [];
this.children = [];
this.updates = [];
this.actions = [];
}
ViewBuilder.prototype.getOutputVar = function (type) {
var varName;
if (type === this.component && this.isHostComponent) {
varName = DYNAMIC_VAR_NAME;
}
else if (type instanceof StaticSymbol) {
varName = this.externalReferenceVars.get(type);
}
else {
varName = DYNAMIC_VAR_NAME;
}
if (!varName) {
throw new Error("Illegal State: referring to a type without a variable " + JSON.stringify(type));
}
return varName;
};
ViewBuilder.prototype.getTypeGuardExpressions = function (ast) {
var result = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(this.guards);
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(ast.directives), _b = _a.next(); !_b.done; _b = _a.next()) {
var directive = _b.value;
try {
for (var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(directive.inputs), _d = _c.next(); !_d.done; _d = _c.next()) {
var input = _d.value;
var guard = directive.directive.guards[input.directiveName];
if (guard) {
var useIf = guard === 'UseIf';
result.push({
guard: guard,
useIf: useIf,
expression: { context: this.component, value: input.value }
});
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_d && !_d.done && (_e = _c.return)) _e.call(_c);
}
finally { if (e_1) throw e_1.error; }
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_b && !_b.done && (_f = _a.return)) _f.call(_a);
}
finally { if (e_2) throw e_2.error; }
}
return result;
var e_2, _f, e_1, _e;
};
ViewBuilder.prototype.visitAll = function (variables, astNodes) {
this.variables = variables;
templateVisitAll(this, astNodes);
};
ViewBuilder.prototype.build = function (componentId, targetStatements) {
var _this = this;
if (targetStatements === void 0) { targetStatements = []; }
this.children.forEach(function (child) { return child.build(componentId, targetStatements); });
var viewStmts = [variable(DYNAMIC_VAR_NAME).set(NULL_EXPR).toDeclStmt(DYNAMIC_TYPE)];
var bindingCount = 0;
this.updates.forEach(function (expression) {
var _a = _this.preprocessUpdateExpression(expression), sourceSpan = _a.sourceSpan, context = _a.context, value = _a.value;
var bindingId = "" + bindingCount++;
var nameResolver = context === _this.component ? _this : defaultResolver;
var _b = convertPropertyBinding(nameResolver, variable(_this.getOutputVar(context)), value, bindingId, BindingForm.General), stmts = _b.stmts, currValExpr = _b.currValExpr;
stmts.push(new ExpressionStatement(currValExpr));
viewStmts.push.apply(viewStmts, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(stmts.map(function (stmt) { return applySourceSpanToStatementIfNeeded(stmt, sourceSpan); })));
});
this.actions.forEach(function (_a) {
var sourceSpan = _a.sourceSpan, context = _a.context, value = _a.value;
var bindingId = "" + bindingCount++;
var nameResolver = context === _this.component ? _this : defaultResolver;
var stmts = convertActionBinding(nameResolver, variable(_this.getOutputVar(context)), value, bindingId).stmts;
viewStmts.push.apply(viewStmts, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(stmts.map(function (stmt) { return applySourceSpanToStatementIfNeeded(stmt, sourceSpan); })));
});
if (this.guards.length) {
var guardExpression = undefined;
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(this.guards), _b = _a.next(); !_b.done; _b = _a.next()) {
var guard = _b.value;
var _c = this.preprocessUpdateExpression(guard.expression), context = _c.context, value = _c.value;
var bindingId = "" + bindingCount++;
var nameResolver = context === this.component ? this : defaultResolver;
// We only support support simple expressions and ignore others as they
// are unlikely to affect type narrowing.
var _d = convertPropertyBinding(nameResolver, variable(this.getOutputVar(context)), value, bindingId, BindingForm.TrySimple), stmts = _d.stmts, currValExpr = _d.currValExpr;
if (stmts.length == 0) {
var guardClause = guard.useIf ? currValExpr : this.ctx.importExpr(guard.guard).callFn([currValExpr]);
guardExpression = guardExpression ? guardExpression.and(guardClause) : guardClause;
}
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
}
finally { if (e_3) throw e_3.error; }
}
if (guardExpression) {
viewStmts = [new IfStmt(guardExpression, viewStmts)];
}
}
var viewName = "_View_" + componentId + "_" + this.embeddedViewIndex;
var viewFactory = new DeclareFunctionStmt(viewName, [], viewStmts);
targetStatements.push(viewFactory);
return targetStatements;
var e_3, _e;
};
ViewBuilder.prototype.visitBoundText = function (ast, context) {
var _this = this;
var astWithSource = ast.value;
var inter = astWithSource.ast;
inter.expressions.forEach(function (expr) {
return _this.updates.push({ context: _this.component, value: expr, sourceSpan: ast.sourceSpan });
});
};
ViewBuilder.prototype.visitEmbeddedTemplate = function (ast, context) {
this.visitElementOrTemplate(ast);
// Note: The old view compiler used to use an `any` type
// for the context in any embedded view.
// We keep this behaivor behind a flag for now.
if (this.options.fullTemplateTypeCheck) {
// Find any applicable type guards. For example, NgIf has a type guard on ngIf
// (see NgIf.ngIfTypeGuard) that can be used to indicate that a template is only
// stamped out if ngIf is truthy so any bindings in the template can assume that,
// if a nullable type is used for ngIf, that expression is not null or undefined.
var guards = this.getTypeGuardExpressions(ast);
var childVisitor = this.viewBuilderFactory(this, guards);
this.children.push(childVisitor);
childVisitor.visitAll(ast.variables, ast.children);
}
};
ViewBuilder.prototype.visitElement = function (ast, context) {
var _this = this;
this.visitElementOrTemplate(ast);
ast.inputs.forEach(function (inputAst) {
_this.updates.push({ context: _this.component, value: inputAst.value, sourceSpan: inputAst.sourceSpan });
});
templateVisitAll(this, ast.children);
};
ViewBuilder.prototype.visitElementOrTemplate = function (ast) {
var _this = this;
ast.directives.forEach(function (dirAst) { _this.visitDirective(dirAst); });
ast.references.forEach(function (ref) {
var outputVarType = null;
// Note: The old view compiler used to use an `any` type
// for directives exposed via `exportAs`.
// We keep this behaivor behind a flag for now.
if (ref.value && ref.value.identifier && _this.options.fullTemplateTypeCheck) {
outputVarType = ref.value.identifier.reference;
}
else {
outputVarType = BuiltinTypeName.Dynamic;
}
_this.refOutputVars.set(ref.name, outputVarType);
});
ast.outputs.forEach(function (outputAst) {
_this.actions.push({ context: _this.component, value: outputAst.handler, sourceSpan: outputAst.sourceSpan });
});
};
ViewBuilder.prototype.visitDirective = function (dirAst) {
var _this = this;
var dirType = dirAst.directive.type.reference;
dirAst.inputs.forEach(function (input) { return _this.updates.push({ context: _this.component, value: input.value, sourceSpan: input.sourceSpan }); });
// Note: The old view compiler used to use an `any` type
// for expressions in host properties / events.
// We keep this behaivor behind a flag for now.
if (this.options.fullTemplateTypeCheck) {
dirAst.hostProperties.forEach(function (inputAst) { return _this.updates.push({ context: dirType, value: inputAst.value, sourceSpan: inputAst.sourceSpan }); });
dirAst.hostEvents.forEach(function (hostEventAst) { return _this.actions.push({
context: dirType,
value: hostEventAst.handler,
sourceSpan: hostEventAst.sourceSpan
}); });
}
};
ViewBuilder.prototype.getLocal = function (name) {
if (name == EventHandlerVars.event.name) {
return variable(this.getOutputVar(BuiltinTypeName.Dynamic));
}
for (var currBuilder = this; currBuilder; currBuilder = currBuilder.parent) {
var outputVarType = void 0;
// check references
outputVarType = currBuilder.refOutputVars.get(name);
if (outputVarType == null) {
// check variables
var varAst = currBuilder.variables.find(function (varAst) { return varAst.name === name; });
if (varAst) {
outputVarType = BuiltinTypeName.Dynamic;
}
}
if (outputVarType != null) {
return variable(this.getOutputVar(outputVarType));
}
}
return null;
};
ViewBuilder.prototype.pipeOutputVar = function (name) {
var pipe = this.pipes.get(name);
if (!pipe) {
throw new Error("Illegal State: Could not find pipe " + name + " in template of " + this.component);
}
return this.getOutputVar(pipe);
};
ViewBuilder.prototype.preprocessUpdateExpression = function (expression) {
var _this = this;
return {
sourceSpan: expression.sourceSpan,
context: expression.context,
value: convertPropertyBindingBuiltins({
createLiteralArrayConverter: function (argCount) { return function (args) {
var arr = literalArr(args);
// Note: The old view compiler used to use an `any` type
// for arrays.
return _this.options.fullTemplateTypeCheck ? arr : arr.cast(DYNAMIC_TYPE);
}; },
createLiteralMapConverter: function (keys) { return function (values) {
var entries = keys.map(function (k, i) { return ({
key: k.key,
value: values[i],
quoted: k.quoted,
}); });
var map = literalMap(entries);
// Note: The old view compiler used to use an `any` type
// for maps.
return _this.options.fullTemplateTypeCheck ? map : map.cast(DYNAMIC_TYPE);
}; },
createPipeConverter: function (name, argCount) { return function (args) {
// Note: The old view compiler used to use an `any` type
// for pipes.
var pipeExpr = _this.options.fullTemplateTypeCheck ?
variable(_this.pipeOutputVar(name)) :
variable(_this.getOutputVar(BuiltinTypeName.Dynamic));
return pipeExpr.callMethod('transform', args);
}; },
}, expression.value)
};
};
ViewBuilder.prototype.visitNgContent = function (ast, context) { };
ViewBuilder.prototype.visitText = function (ast, context) { };
ViewBuilder.prototype.visitDirectiveProperty = function (ast, context) { };
ViewBuilder.prototype.visitReference = function (ast, context) { };
ViewBuilder.prototype.visitVariable = function (ast, context) { };
ViewBuilder.prototype.visitEvent = function (ast, context) { };
ViewBuilder.prototype.visitElementProperty = function (ast, context) { };
ViewBuilder.prototype.visitAttr = function (ast, context) { };
return ViewBuilder;
}());
/**
* @license
* Copyright Google Inc. 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 CLASS_ATTR$1 = 'class';
var STYLE_ATTR = 'style';
var IMPLICIT_TEMPLATE_VAR = '\$implicit';
var ViewCompileResult = /** @class */ (function () {
function ViewCompileResult(viewClassVar, rendererTypeVar) {
this.viewClassVar = viewClassVar;
this.rendererTypeVar = rendererTypeVar;
}
return ViewCompileResult;
}());
var ViewCompiler = /** @class */ (function () {
function ViewCompiler(_reflector) {
this._reflector = _reflector;
}
ViewCompiler.prototype.compileComponent = function (outputCtx, component, template, styles, usedPipes) {
var _this = this;
var embeddedViewCount = 0;
var staticQueryIds = findStaticQueryIds(template);
var renderComponentVarName = undefined;
if (!component.isHost) {
var template_1 = component.template;
var customRenderData = [];
if (template_1.animations && template_1.animations.length) {
customRenderData.push(new LiteralMapEntry('animation', convertValueToOutputAst(outputCtx, template_1.animations), true));
}
var renderComponentVar = variable(rendererTypeName(component.type.reference));
renderComponentVarName = renderComponentVar.name;
outputCtx.statements.push(renderComponentVar
.set(importExpr(Identifiers.createRendererType2).callFn([new LiteralMapExpr([
new LiteralMapEntry('encapsulation', literal(template_1.encapsulation), false),
new LiteralMapEntry('styles', styles, false),
new LiteralMapEntry('data', new LiteralMapExpr(customRenderData), false)
])]))
.toDeclStmt(importType(Identifiers.RendererType2), [StmtModifier.Final, StmtModifier.Exported]));
}
var viewBuilderFactory = function (parent) {
var embeddedViewIndex = embeddedViewCount++;
return new ViewBuilder$1(_this._reflector, outputCtx, parent, component, embeddedViewIndex, usedPipes, staticQueryIds, viewBuilderFactory);
};
var visitor = viewBuilderFactory(null);
visitor.visitAll([], template);
(_a = outputCtx.statements).push.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(visitor.build()));
return new ViewCompileResult(visitor.viewName, renderComponentVarName);
var _a;
};
return ViewCompiler;
}());
var LOG_VAR$1 = variable('_l');
var VIEW_VAR = variable('_v');
var CHECK_VAR = variable('_ck');
var COMP_VAR = variable('_co');
var EVENT_NAME_VAR = variable('en');
var ALLOW_DEFAULT_VAR = variable("ad");
var ViewBuilder$1 = /** @class */ (function () {
function ViewBuilder(reflector, outputCtx, parent, component, embeddedViewIndex, usedPipes, staticQueryIds, viewBuilderFactory) {
this.reflector = reflector;
this.outputCtx = outputCtx;
this.parent = parent;
this.component = component;
this.embeddedViewIndex = embeddedViewIndex;
this.usedPipes = usedPipes;
this.staticQueryIds = staticQueryIds;
this.viewBuilderFactory = viewBuilderFactory;
this.nodes = [];
this.purePipeNodeIndices = Object.create(null);
// Need Object.create so that we don't have builtin values...
this.refNodeIndices = Object.create(null);
this.variables = [];
this.children = [];
// TODO(tbosch): The old view compiler used to use an `any` type
// for the context in any embedded view. We keep this behaivor for now
// to be able to introduce the new view compiler without too many errors.
this.compType = this.embeddedViewIndex > 0 ?
DYNAMIC_TYPE :
expressionType(outputCtx.importExpr(this.component.type.reference));
this.viewName = viewClassName(this.component.type.reference, this.embeddedViewIndex);
}
ViewBuilder.prototype.visitAll = function (variables, astNodes) {
var _this = this;
this.variables = variables;
// create the pipes for the pure pipes immediately, so that we know their indices.
if (!this.parent) {
this.usedPipes.forEach(function (pipe) {
if (pipe.pure) {
_this.purePipeNodeIndices[pipe.name] = _this._createPipe(null, pipe);
}
});
}
if (!this.parent) {
var queryIds_1 = staticViewQueryIds(this.staticQueryIds);
this.component.viewQueries.forEach(function (query, queryIndex) {
// Note: queries start with id 1 so we can use the number in a Bloom filter!
var queryId = queryIndex + 1;
var bindingType = query.first ? 0 /* First */ : 1 /* All */;
var flags = 134217728 /* TypeViewQuery */ | calcStaticDynamicQueryFlags(queryIds_1, queryId, query.first);
_this.nodes.push(function () { return ({
sourceSpan: null,
nodeFlags: flags,
nodeDef: importExpr(Identifiers.queryDef).callFn([
literal(flags), literal(queryId),
new LiteralMapExpr([new LiteralMapEntry(query.propertyName, literal(bindingType), false)])
])
}); });
});
}
templateVisitAll(this, astNodes);
if (this.parent && (astNodes.length === 0 || needsAdditionalRootNode(astNodes))) {
// if the view is an embedded view, then we need to add an additional root node in some cases
this.nodes.push(function () { return ({
sourceSpan: null,
nodeFlags: 1 /* TypeElement */,
nodeDef: importExpr(Identifiers.anchorDef).callFn([
literal(0 /* None */), NULL_EXPR, NULL_EXPR, literal(0)
])
}); });
}
};
ViewBuilder.prototype.build = function (targetStatements) {
if (targetStatements === void 0) { targetStatements = []; }
this.children.forEach(function (child) { return child.build(targetStatements); });
var _a = this._createNodeExpressions(), updateRendererStmts = _a.updateRendererStmts, updateDirectivesStmts = _a.updateDirectivesStmts, nodeDefExprs = _a.nodeDefExprs;
var updateRendererFn = this._createUpdateFn(updateRendererStmts);
var updateDirectivesFn = this._createUpdateFn(updateDirectivesStmts);
var viewFlags = 0 /* None */;
if (!this.parent && this.component.changeDetection === ChangeDetectionStrategy.OnPush) {
viewFlags |= 2 /* OnPush */;
}
var viewFactory = new DeclareFunctionStmt(this.viewName, [new FnParam(LOG_VAR$1.name)], [new ReturnStatement(importExpr(Identifiers.viewDef).callFn([
literal(viewFlags),
literalArr(nodeDefExprs),
updateDirectivesFn,
updateRendererFn,
]))], importType(Identifiers.ViewDefinition), this.embeddedViewIndex === 0 ? [StmtModifier.Exported] : []);
targetStatements.push(viewFactory);
return targetStatements;
};
ViewBuilder.prototype._createUpdateFn = function (updateStmts) {
var updateFn;
if (updateStmts.length > 0) {
var preStmts = [];
if (!this.component.isHost && findReadVarNames(updateStmts).has(COMP_VAR.name)) {
preStmts.push(COMP_VAR.set(VIEW_VAR.prop('component')).toDeclStmt(this.compType));
}
updateFn = fn([
new FnParam(CHECK_VAR.name, INFERRED_TYPE),
new FnParam(VIEW_VAR.name, INFERRED_TYPE)
], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(preStmts, updateStmts), INFERRED_TYPE);
}
else {
updateFn = NULL_EXPR;
}
return updateFn;
};
ViewBuilder.prototype.visitNgContent = function (ast, context) {
// ngContentDef(ngContentIndex: number, index: number): NodeDef;
this.nodes.push(function () { return ({
sourceSpan: ast.sourceSpan,
nodeFlags: 8 /* TypeNgContent */,
nodeDef: importExpr(Identifiers.ngContentDef).callFn([
literal(ast.ngContentIndex), literal(ast.index)
])
}); });
};
ViewBuilder.prototype.visitText = function (ast, context) {
// Static text nodes have no check function
var checkIndex = -1;
this.nodes.push(function () { return ({
sourceSpan: ast.sourceSpan,
nodeFlags: 2 /* TypeText */,
nodeDef: importExpr(Identifiers.textDef).callFn([
literal(checkIndex),
literal(ast.ngContentIndex),
literalArr([literal(ast.value)]),
])
}); });
};
ViewBuilder.prototype.visitBoundText = function (ast, context) {
var _this = this;
var nodeIndex = this.nodes.length;
// reserve the space in the nodeDefs array
this.nodes.push(null);
var astWithSource = ast.value;
var inter = astWithSource.ast;
var updateRendererExpressions = inter.expressions.map(function (expr, bindingIndex) { return _this._preprocessUpdateExpression({ nodeIndex: nodeIndex, bindingIndex: bindingIndex, sourceSpan: ast.sourceSpan, context: COMP_VAR, value: expr }); });
// Check index is the same as the node index during compilation
// They might only differ at runtime
var checkIndex = nodeIndex;
this.nodes[nodeIndex] = function () { return ({
sourceSpan: ast.sourceSpan,
nodeFlags: 2 /* TypeText */,
nodeDef: importExpr(Identifiers.textDef).callFn([
literal(checkIndex),
literal(ast.ngContentIndex),
literalArr(inter.strings.map(function (s) { return literal(s); })),
]),
updateRenderer: updateRendererExpressions
}); };
};
ViewBuilder.prototype.visitEmbeddedTemplate = function (ast, context) {
var _this = this;
var nodeIndex = this.nodes.length;
// reserve the space in the nodeDefs array
this.nodes.push(null);
var _a = this._visitElementOrTemplate(nodeIndex, ast), flags = _a.flags, queryMatchesExpr = _a.queryMatchesExpr, hostEvents = _a.hostEvents;
var childVisitor = this.viewBuilderFactory(this);
this.children.push(childVisitor);
childVisitor.visitAll(ast.variables, ast.children);
var childCount = this.nodes.length - nodeIndex - 1;
// anchorDef(
// flags: NodeFlags, matchedQueries: [string, QueryValueType][], ngContentIndex: number,
// childCount: number, handleEventFn?: ElementHandleEventFn, templateFactory?:
// ViewDefinitionFactory): NodeDef;
this.nodes[nodeIndex] = function () { return ({
sourceSpan: ast.sourceSpan,
nodeFlags: 1 /* TypeElement */ | flags,
nodeDef: importExpr(Identifiers.anchorDef).callFn([
literal(flags),
queryMatchesExpr,
literal(ast.ngContentIndex),
literal(childCount),
_this._createElementHandleEventFn(nodeIndex, hostEvents),
variable(childVisitor.viewName),
])
}); };
};
ViewBuilder.prototype.visitElement = function (ast, context) {
var _this = this;
var nodeIndex = this.nodes.length;
// reserve the space in the nodeDefs array so we can add children
this.nodes.push(null);
// Using a null element name creates an anchor.
var elName = isNgContainer(ast.name) ? null : ast.name;
var _a = this._visitElementOrTemplate(nodeIndex, ast), flags = _a.flags, usedEvents = _a.usedEvents, queryMatchesExpr = _a.queryMatchesExpr, dirHostBindings = _a.hostBindings, hostEvents = _a.hostEvents;
var inputDefs = [];
var updateRendererExpressions = [];
var outputDefs = [];
if (elName) {
var hostBindings = ast.inputs
.map(function (inputAst) { return ({
context: COMP_VAR,
inputAst: inputAst,
dirAst: null,
}); })
.concat(dirHostBindings);
if (hostBindings.length) {
updateRendererExpressions =
hostBindings.map(function (hostBinding, bindingIndex) { return _this._preprocessUpdateExpression({
context: hostBinding.context,
nodeIndex: nodeIndex,
bindingIndex: bindingIndex,
sourceSpan: hostBinding.inputAst.sourceSpan,
value: hostBinding.inputAst.value
}); });
inputDefs = hostBindings.map(function (hostBinding) { return elementBindingDef(hostBinding.inputAst, hostBinding.dirAst); });
}
outputDefs = usedEvents.map(function (_a) {
var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_a, 2), target = _b[0], eventName = _b[1];
return literalArr([literal(target), literal(eventName)]);
});
}
templateVisitAll(this, ast.children);
var childCount = this.nodes.length - nodeIndex - 1;
var compAst = ast.directives.find(function (dirAst) { return dirAst.directive.isComponent; });
var compRendererType = NULL_EXPR;
var compView = NULL_EXPR;
if (compAst) {
compView = this.outputCtx.importExpr(compAst.directive.componentViewType);
compRendererType = this.outputCtx.importExpr(compAst.directive.rendererType);
}
// Check index is the same as the node index during compilation
// They might only differ at runtime
var checkIndex = nodeIndex;
this.nodes[nodeIndex] = function () { return ({
sourceSpan: ast.sourceSpan,
nodeFlags: 1 /* TypeElement */ | flags,
nodeDef: importExpr(Identifiers.elementDef).callFn([
literal(checkIndex),
literal(flags),
queryMatchesExpr,
literal(ast.ngContentIndex),
literal(childCount),
literal(elName),
elName ? fixedAttrsDef(ast) : NULL_EXPR,
inputDefs.length ? literalArr(inputDefs) : NULL_EXPR,
outputDefs.length ? literalArr(outputDefs) : NULL_EXPR,
_this._createElementHandleEventFn(nodeIndex, hostEvents),
compView,
compRendererType,
]),
updateRenderer: updateRendererExpressions
}); };
};
ViewBuilder.prototype._visitElementOrTemplate = function (nodeIndex, ast) {
var _this = this;
var flags = 0 /* None */;
if (ast.hasViewContainer) {
flags |= 16777216 /* EmbeddedViews */;
}
var usedEvents = new Map();
ast.outputs.forEach(function (event) {
var _a = elementEventNameAndTarget(event, null), name = _a.name, target = _a.target;
usedEvents.set(elementEventFullName(target, name), [target, name]);
});
ast.directives.forEach(function (dirAst) {
dirAst.hostEvents.forEach(function (event) {
var _a = elementEventNameAndTarget(event, dirAst), name = _a.name, target = _a.target;
usedEvents.set(elementEventFullName(target, name), [target, name]);
});
});
var hostBindings = [];
var hostEvents = [];
this._visitComponentFactoryResolverProvider(ast.directives);
ast.providers.forEach(function (providerAst, providerIndex) {
var dirAst = undefined;
var dirIndex = undefined;
ast.directives.forEach(function (localDirAst, i) {
if (localDirAst.directive.type.reference === tokenReference(providerAst.token)) {
dirAst = localDirAst;
dirIndex = i;
}
});
if (dirAst) {
var _a = _this._visitDirective(providerAst, dirAst, dirIndex, nodeIndex, ast.references, ast.queryMatches, usedEvents, _this.staticQueryIds.get(ast)), dirHostBindings = _a.hostBindings, dirHostEvents = _a.hostEvents;
hostBindings.push.apply(hostBindings, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(dirHostBindings));
hostEvents.push.apply(hostEvents, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(dirHostEvents));
}
else {
_this._visitProvider(providerAst, ast.queryMatches);
}
});
var queryMatchExprs = [];
ast.queryMatches.forEach(function (match) {
var valueType = undefined;
if (tokenReference(match.value) ===
_this.reflector.resolveExternalReference(Identifiers.ElementRef)) {
valueType = 0 /* ElementRef */;
}
else if (tokenReference(match.value) ===
_this.reflector.resolveExternalReference(Identifiers.ViewContainerRef)) {
valueType = 3 /* ViewContainerRef */;
}
else if (tokenReference(match.value) ===
_this.reflector.resolveExternalReference(Identifiers.TemplateRef)) {
valueType = 2 /* TemplateRef */;
}
if (valueType != null) {
queryMatchExprs.push(literalArr([literal(match.queryId), literal(valueType)]));
}
});
ast.references.forEach(function (ref) {
var valueType = undefined;
if (!ref.value) {
valueType = 1 /* RenderElement */;
}
else if (tokenReference(ref.value) ===
_this.reflector.resolveExternalReference(Identifiers.TemplateRef)) {
valueType = 2 /* TemplateRef */;
}
if (valueType != null) {
_this.refNodeIndices[ref.name] = nodeIndex;
queryMatchExprs.push(literalArr([literal(ref.name), literal(valueType)]));
}
});
ast.outputs.forEach(function (outputAst) {
hostEvents.push({ context: COMP_VAR, eventAst: outputAst, dirAst: null });
});
return {
flags: flags,
usedEvents: Array.from(usedEvents.values()),
queryMatchesExpr: queryMatchExprs.length ? literalArr(queryMatchExprs) : NULL_EXPR,
hostBindings: hostBindings,
hostEvents: hostEvents
};
};
ViewBuilder.prototype._visitDirective = function (providerAst, dirAst, directiveIndex, elementNodeIndex, refs, queryMatches, usedEvents, queryIds) {
var _this = this;
var nodeIndex = this.nodes.length;
// reserve the space in the nodeDefs array so we can add children
this.nodes.push(null);
dirAst.directive.queries.forEach(function (query, queryIndex) {
var queryId = dirAst.contentQueryStartId + queryIndex;
var flags = 67108864 /* TypeContentQuery */ | calcStaticDynamicQueryFlags(queryIds, queryId, query.first);
var bindingType = query.first ? 0 /* First */ : 1 /* All */;
_this.nodes.push(function () { return ({
sourceSpan: dirAst.sourceSpan,
nodeFlags: flags,
nodeDef: importExpr(Identifiers.queryDef).callFn([
literal(flags), literal(queryId),
new LiteralMapExpr([new LiteralMapEntry(query.propertyName, literal(bindingType), false)])
]),
}); });
});
// Note: the operation below might also create new nodeDefs,
// but we don't want them to be a child of a directive,
// as they might be a provider/pipe on their own.
// I.e. we only allow queries as children of directives nodes.
var childCount = this.nodes.length - nodeIndex - 1;
var _a = this._visitProviderOrDirective(providerAst, queryMatches), flags = _a.flags, queryMatchExprs = _a.queryMatchExprs, providerExpr = _a.providerExpr, depsExpr = _a.depsExpr;
refs.forEach(function (ref) {
if (ref.value && tokenReference(ref.value) === tokenReference(providerAst.token)) {
_this.refNodeIndices[ref.name] = nodeIndex;
queryMatchExprs.push(literalArr([literal(ref.name), literal(4 /* Provider */)]));
}
});
if (dirAst.directive.isComponent) {
flags |= 32768 /* Component */;
}
var inputDefs = dirAst.inputs.map(function (inputAst, inputIndex) {
var mapValue = literalArr([literal(inputIndex), literal(inputAst.directiveName)]);
// Note: it's important to not quote the key so that we can capture renames by minifiers!
return new LiteralMapEntry(inputAst.directiveName, mapValue, false);
});
var outputDefs = [];
var dirMeta = dirAst.directive;
Object.keys(dirMeta.outputs).forEach(function (propName) {
var eventName = dirMeta.outputs[propName];
if (usedEvents.has(eventName)) {
// Note: it's important to not quote the key so that we can capture renames by minifiers!
outputDefs.push(new LiteralMapEntry(propName, literal(eventName), false));
}
});
var updateDirectiveExpressions = [];
if (dirAst.inputs.length || (flags & (262144 /* DoCheck */ | 65536 /* OnInit */)) > 0) {
updateDirectiveExpressions =
dirAst.inputs.map(function (input, bindingIndex) { return _this._preprocessUpdateExpression({
nodeIndex: nodeIndex,
bindingIndex: bindingIndex,
sourceSpan: input.sourceSpan,
context: COMP_VAR,
value: input.value
}); });
}
var dirContextExpr = importExpr(Identifiers.nodeValue).callFn([VIEW_VAR, literal(nodeIndex)]);
var hostBindings = dirAst.hostProperties.map(function (inputAst) { return ({
context: dirContextExpr,
dirAst: dirAst,
inputAst: inputAst,
}); });
var hostEvents = dirAst.hostEvents.map(function (hostEventAst) { return ({
context: dirContextExpr,
eventAst: hostEventAst, dirAst: dirAst,
}); });
// Check index is the same as the node index during compilation
// They might only differ at runtime
var checkIndex = nodeIndex;
this.nodes[nodeIndex] = function () { return ({
sourceSpan: dirAst.sourceSpan,
nodeFlags: 16384 /* TypeDirective */ | flags,
nodeDef: importExpr(Identifiers.directiveDef).callFn([
literal(checkIndex),
literal(flags),
queryMatchExprs.length ? literalArr(queryMatchExprs) : NULL_EXPR,
literal(childCount),
providerExpr,
depsExpr,
inputDefs.length ? new LiteralMapExpr(inputDefs) : NULL_EXPR,
outputDefs.length ? new LiteralMapExpr(outputDefs) : NULL_EXPR,
]),
updateDirectives: updateDirectiveExpressions,
directive: dirAst.directive.type,
}); };
return { hostBindings: hostBindings, hostEvents: hostEvents };
};
ViewBuilder.prototype._visitProvider = function (providerAst, queryMatches) {
this._addProviderNode(this._visitProviderOrDirective(providerAst, queryMatches));
};
ViewBuilder.prototype._visitComponentFactoryResolverProvider = function (directives) {
var componentDirMeta = directives.find(function (dirAst) { return dirAst.directive.isComponent; });
if (componentDirMeta && componentDirMeta.directive.entryComponents.length) {
var _a = componentFactoryResolverProviderDef(this.reflector, this.outputCtx, 8192 /* PrivateProvider */, componentDirMeta.directive.entryComponents), providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, flags = _a.flags, tokenExpr = _a.tokenExpr;
this._addProviderNode({
providerExpr: providerExpr,
depsExpr: depsExpr,
flags: flags,
tokenExpr: tokenExpr,
queryMatchExprs: [],
sourceSpan: componentDirMeta.sourceSpan
});
}
};
ViewBuilder.prototype._addProviderNode = function (data) {
var nodeIndex = this.nodes.length;
// providerDef(
// flags: NodeFlags, matchedQueries: [string, QueryValueType][], token:any,
// value: any, deps: ([DepFlags, any] | any)[]): NodeDef;
this.nodes.push(function () { return ({
sourceSpan: data.sourceSpan,
nodeFlags: data.flags,
nodeDef: importExpr(Identifiers.providerDef).callFn([
literal(data.flags),
data.queryMatchExprs.length ? literalArr(data.queryMatchExprs) : NULL_EXPR,
data.tokenExpr, data.providerExpr, data.depsExpr
])
}); });
};
ViewBuilder.prototype._visitProviderOrDirective = function (providerAst, queryMatches) {
var flags = 0 /* None */;
var queryMatchExprs = [];
queryMatches.forEach(function (match) {
if (tokenReference(match.value) === tokenReference(providerAst.token)) {
queryMatchExprs.push(literalArr([literal(match.queryId), literal(4 /* Provider */)]));
}
});
var _a = providerDef(this.outputCtx, providerAst), providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, providerFlags = _a.flags, tokenExpr = _a.tokenExpr;
return {
flags: flags | providerFlags,
queryMatchExprs: queryMatchExprs,
providerExpr: providerExpr,
depsExpr: depsExpr,
tokenExpr: tokenExpr,
sourceSpan: providerAst.sourceSpan
};
};
ViewBuilder.prototype.getLocal = function (name) {
if (name == EventHandlerVars.event.name) {
return EventHandlerVars.event;
}
var currViewExpr = VIEW_VAR;
for (var currBuilder = this; currBuilder; currBuilder = currBuilder.parent,
currViewExpr = currViewExpr.prop('parent').cast(DYNAMIC_TYPE)) {
// check references
var refNodeIndex = currBuilder.refNodeIndices[name];
if (refNodeIndex != null) {
return importExpr(Identifiers.nodeValue).callFn([currViewExpr, literal(refNodeIndex)]);
}
// check variables
var varAst = currBuilder.variables.find(function (varAst) { return varAst.name === name; });
if (varAst) {
var varValue = varAst.value || IMPLICIT_TEMPLATE_VAR;
return currViewExpr.prop('context').prop(varValue);
}
}
return null;
};
ViewBuilder.prototype._createLiteralArrayConverter = function (sourceSpan, argCount) {
if (argCount === 0) {
var valueExpr_1 = importExpr(Identifiers.EMPTY_ARRAY);
return function () { return valueExpr_1; };
}
var checkIndex = this.nodes.length;
this.nodes.push(function () { return ({
sourceSpan: sourceSpan,
nodeFlags: 32 /* TypePureArray */,
nodeDef: importExpr(Identifiers.pureArrayDef).callFn([
literal(checkIndex),
literal(argCount),
])
}); });
return function (args) { return callCheckStmt(checkIndex, args); };
};
ViewBuilder.prototype._createLiteralMapConverter = function (sourceSpan, keys) {
if (keys.length === 0) {
var valueExpr_2 = importExpr(Identifiers.EMPTY_MAP);
return function () { return valueExpr_2; };
}
var map = literalMap(keys.map(function (e, i) { return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, e, { value: literal(i) })); }));
var checkIndex = this.nodes.length;
this.nodes.push(function () { return ({
sourceSpan: sourceSpan,
nodeFlags: 64 /* TypePureObject */,
nodeDef: importExpr(Identifiers.pureObjectDef).callFn([
literal(checkIndex),
map,
])
}); });
return function (args) { return callCheckStmt(checkIndex, args); };
};
ViewBuilder.prototype._createPipeConverter = function (expression, name, argCount) {
var pipe = this.usedPipes.find(function (pipeSummary) { return pipeSummary.name === name; });
if (pipe.pure) {
var checkIndex_1 = this.nodes.length;
this.nodes.push(function () { return ({
sourceSpan: expression.sourceSpan,
nodeFlags: 128 /* TypePurePipe */,
nodeDef: importExpr(Identifiers.purePipeDef).callFn([
literal(checkIndex_1),
literal(argCount),
])
}); });
// find underlying pipe in the component view
var compViewExpr = VIEW_VAR;
var compBuilder = this;
while (compBuilder.parent) {
compBuilder = compBuilder.parent;
compViewExpr = compViewExpr.prop('parent').cast(DYNAMIC_TYPE);
}
var pipeNodeIndex = compBuilder.purePipeNodeIndices[name];
var pipeValueExpr_1 = importExpr(Identifiers.nodeValue).callFn([compViewExpr, literal(pipeNodeIndex)]);
return function (args) { return callUnwrapValue(expression.nodeIndex, expression.bindingIndex, callCheckStmt(checkIndex_1, [pipeValueExpr_1].concat(args))); };
}
else {
var nodeIndex = this._createPipe(expression.sourceSpan, pipe);
var nodeValueExpr_1 = importExpr(Identifiers.nodeValue).callFn([VIEW_VAR, literal(nodeIndex)]);
return function (args) { return callUnwrapValue(expression.nodeIndex, expression.bindingIndex, nodeValueExpr_1.callMethod('transform', args)); };
}
};
ViewBuilder.prototype._createPipe = function (sourceSpan, pipe) {
var _this = this;
var nodeIndex = this.nodes.length;
var flags = 0 /* None */;
pipe.type.lifecycleHooks.forEach(function (lifecycleHook) {
// for pipes, we only support ngOnDestroy
if (lifecycleHook === LifecycleHooks.OnDestroy) {
flags |= lifecycleHookToNodeFlag(lifecycleHook);
}
});
var depExprs = pipe.type.diDeps.map(function (diDep) { return depDef(_this.outputCtx, diDep); });
// function pipeDef(
// flags: NodeFlags, ctor: any, deps: ([DepFlags, any] | any)[]): NodeDef
this.nodes.push(function () { return ({
sourceSpan: sourceSpan,
nodeFlags: 16 /* TypePipe */,
nodeDef: importExpr(Identifiers.pipeDef).callFn([
literal(flags), _this.outputCtx.importExpr(pipe.type.reference), literalArr(depExprs)
])
}); });
return nodeIndex;
};
/**
* For the AST in `UpdateExpression.value`:
* - create nodes for pipes, literal arrays and, literal maps,
* - update the AST to replace pipes, literal arrays and, literal maps with calls to check fn.
*
* WARNING: This might create new nodeDefs (for pipes and literal arrays and literal maps)!
*/
ViewBuilder.prototype._preprocessUpdateExpression = function (expression) {
var _this = this;
return {
nodeIndex: expression.nodeIndex,
bindingIndex: expression.bindingIndex,
sourceSpan: expression.sourceSpan,
context: expression.context,
value: convertPropertyBindingBuiltins({
createLiteralArrayConverter: function (argCount) { return _this._createLiteralArrayConverter(expression.sourceSpan, argCount); },
createLiteralMapConverter: function (keys) {
return _this._createLiteralMapConverter(expression.sourceSpan, keys);
},
createPipeConverter: function (name, argCount) {
return _this._createPipeConverter(expression, name, argCount);
}
}, expression.value)
};
};
ViewBuilder.prototype._createNodeExpressions = function () {
var self = this;
var updateBindingCount = 0;
var updateRendererStmts = [];
var updateDirectivesStmts = [];
var nodeDefExprs = this.nodes.map(function (factory, nodeIndex) {
var _a = factory(), nodeDef = _a.nodeDef, nodeFlags = _a.nodeFlags, updateDirectives = _a.updateDirectives, updateRenderer = _a.updateRenderer, sourceSpan = _a.sourceSpan;
if (updateRenderer) {
updateRendererStmts.push.apply(updateRendererStmts, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(createUpdateStatements(nodeIndex, sourceSpan, updateRenderer, false)));
}
if (updateDirectives) {
updateDirectivesStmts.push.apply(updateDirectivesStmts, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(createUpdateStatements(nodeIndex, sourceSpan, updateDirectives, (nodeFlags & (262144 /* DoCheck */ | 65536 /* OnInit */)) > 0)));
}
// We use a comma expression to call the log function before
// the nodeDef function, but still use the result of the nodeDef function
// as the value.
// Note: We only add the logger to elements / text nodes,
// so we don't generate too much code.
var logWithNodeDef = nodeFlags & 3 /* CatRenderNode */ ?
new CommaExpr([LOG_VAR$1.callFn([]).callFn([]), nodeDef]) :
nodeDef;
return applySourceSpanToExpressionIfNeeded(logWithNodeDef, sourceSpan);
});
return { updateRendererStmts: updateRendererStmts, updateDirectivesStmts: updateDirectivesStmts, nodeDefExprs: nodeDefExprs };
function createUpdateStatements(nodeIndex, sourceSpan, expressions, allowEmptyExprs) {
var updateStmts = [];
var exprs = expressions.map(function (_a) {
var sourceSpan = _a.sourceSpan, context = _a.context, value = _a.value;
var bindingId = "" + updateBindingCount++;
var nameResolver = context === COMP_VAR ? self : null;
var _b = convertPropertyBinding(nameResolver, context, value, bindingId, BindingForm.General), stmts = _b.stmts, currValExpr = _b.currValExpr;
updateStmts.push.apply(updateStmts, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(stmts.map(function (stmt) { return applySourceSpanToStatementIfNeeded(stmt, sourceSpan); })));
return applySourceSpanToExpressionIfNeeded(currValExpr, sourceSpan);
});
if (expressions.length || allowEmptyExprs) {
updateStmts.push(applySourceSpanToStatementIfNeeded(callCheckStmt(nodeIndex, exprs).toStmt(), sourceSpan));
}
return updateStmts;
}
};
ViewBuilder.prototype._createElementHandleEventFn = function (nodeIndex, handlers) {
var _this = this;
var handleEventStmts = [];
var handleEventBindingCount = 0;
handlers.forEach(function (_a) {
var context = _a.context, eventAst = _a.eventAst, dirAst = _a.dirAst;
var bindingId = "" + handleEventBindingCount++;
var nameResolver = context === COMP_VAR ? _this : null;
var _b = convertActionBinding(nameResolver, context, eventAst.handler, bindingId), stmts = _b.stmts, allowDefault = _b.allowDefault;
var trueStmts = stmts;
if (allowDefault) {
trueStmts.push(ALLOW_DEFAULT_VAR.set(allowDefault.and(ALLOW_DEFAULT_VAR)).toStmt());
}
var _c = elementEventNameAndTarget(eventAst, dirAst), eventTarget = _c.target, eventName = _c.name;
var fullEventName = elementEventFullName(eventTarget, eventName);
handleEventStmts.push(applySourceSpanToStatementIfNeeded(new IfStmt(literal(fullEventName).identical(EVENT_NAME_VAR), trueStmts), eventAst.sourceSpan));
});
var handleEventFn;
if (handleEventStmts.length > 0) {
var preStmts = [ALLOW_DEFAULT_VAR.set(literal(true)).toDeclStmt(BOOL_TYPE)];
if (!this.component.isHost && findReadVarNames(handleEventStmts).has(COMP_VAR.name)) {
preStmts.push(COMP_VAR.set(VIEW_VAR.prop('component')).toDeclStmt(this.compType));
}
handleEventFn = fn([
new FnParam(VIEW_VAR.name, INFERRED_TYPE),
new FnParam(EVENT_NAME_VAR.name, INFERRED_TYPE),
new FnParam(EventHandlerVars.event.name, INFERRED_TYPE)
], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(preStmts, handleEventStmts, [new ReturnStatement(ALLOW_DEFAULT_VAR)]), INFERRED_TYPE);
}
else {
handleEventFn = NULL_EXPR;
}
return handleEventFn;
};
ViewBuilder.prototype.visitDirective = function (ast, context) { };
ViewBuilder.prototype.visitDirectiveProperty = function (ast, context) { };
ViewBuilder.prototype.visitReference = function (ast, context) { };
ViewBuilder.prototype.visitVariable = function (ast, context) { };
ViewBuilder.prototype.visitEvent = function (ast, context) { };
ViewBuilder.prototype.visitElementProperty = function (ast, context) { };
ViewBuilder.prototype.visitAttr = function (ast, context) { };
return ViewBuilder;
}());
function needsAdditionalRootNode(astNodes) {
var lastAstNode = astNodes[astNodes.length - 1];
if (lastAstNode instanceof EmbeddedTemplateAst) {
return lastAstNode.hasViewContainer;
}
if (lastAstNode instanceof ElementAst) {
if (isNgContainer(lastAstNode.name) && lastAstNode.children.length) {
return needsAdditionalRootNode(lastAstNode.children);
}
return lastAstNode.hasViewContainer;
}
return lastAstNode instanceof NgContentAst;
}
function elementBindingDef(inputAst, dirAst) {
switch (inputAst.type) {
case PropertyBindingType.Attribute:
return literalArr([
literal(1 /* TypeElementAttribute */), literal(inputAst.name),
literal(inputAst.securityContext)
]);
case PropertyBindingType.Property:
return literalArr([
literal(8 /* TypeProperty */), literal(inputAst.name),
literal(inputAst.securityContext)
]);
case PropertyBindingType.Animation:
var bindingType = 8 /* TypeProperty */ |
(dirAst && dirAst.directive.isComponent ? 32 /* SyntheticHostProperty */ :
16 /* SyntheticProperty */);
return literalArr([
literal(bindingType), literal('@' + inputAst.name), literal(inputAst.securityContext)
]);
case PropertyBindingType.Class:
return literalArr([literal(2 /* TypeElementClass */), literal(inputAst.name), NULL_EXPR]);
case PropertyBindingType.Style:
return literalArr([
literal(4 /* TypeElementStyle */), literal(inputAst.name), literal(inputAst.unit)
]);
}
}
function fixedAttrsDef(elementAst) {
var mapResult = Object.create(null);
elementAst.attrs.forEach(function (attrAst) { mapResult[attrAst.name] = attrAst.value; });
elementAst.directives.forEach(function (dirAst) {
Object.keys(dirAst.directive.hostAttributes).forEach(function (name) {
var value = dirAst.directive.hostAttributes[name];
var prevValue = mapResult[name];
mapResult[name] = prevValue != null ? mergeAttributeValue(name, prevValue, value) : value;
});
});
// Note: We need to sort to get a defined output order
// for tests and for caching generated artifacts...
return literalArr(Object.keys(mapResult).sort().map(function (attrName) { return literalArr([literal(attrName), literal(mapResult[attrName])]); }));
}
function mergeAttributeValue(attrName, attrValue1, attrValue2) {
if (attrName == CLASS_ATTR$1 || attrName == STYLE_ATTR) {
return attrValue1 + " " + attrValue2;
}
else {
return attrValue2;
}
}
function callCheckStmt(nodeIndex, exprs) {
if (exprs.length > 10) {
return CHECK_VAR.callFn([VIEW_VAR, literal(nodeIndex), literal(1 /* Dynamic */), literalArr(exprs)]);
}
else {
return CHECK_VAR.callFn(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([VIEW_VAR, literal(nodeIndex), literal(0 /* Inline */)], exprs));
}
}
function callUnwrapValue(nodeIndex, bindingIdx, expr) {
return importExpr(Identifiers.unwrapValue).callFn([
VIEW_VAR, literal(nodeIndex), literal(bindingIdx), expr
]);
}
function findStaticQueryIds(nodes, result) {
if (result === void 0) { result = new Map(); }
nodes.forEach(function (node) {
var staticQueryIds = new Set();
var dynamicQueryIds = new Set();
var queryMatches = undefined;
if (node instanceof ElementAst) {
findStaticQueryIds(node.children, result);
node.children.forEach(function (child) {
var childData = result.get(child);
childData.staticQueryIds.forEach(function (queryId) { return staticQueryIds.add(queryId); });
childData.dynamicQueryIds.forEach(function (queryId) { return dynamicQueryIds.add(queryId); });
});
queryMatches = node.queryMatches;
}
else if (node instanceof EmbeddedTemplateAst) {
findStaticQueryIds(node.children, result);
node.children.forEach(function (child) {
var childData = result.get(child);
childData.staticQueryIds.forEach(function (queryId) { return dynamicQueryIds.add(queryId); });
childData.dynamicQueryIds.forEach(function (queryId) { return dynamicQueryIds.add(queryId); });
});
queryMatches = node.queryMatches;
}
if (queryMatches) {
queryMatches.forEach(function (match) { return staticQueryIds.add(match.queryId); });
}
dynamicQueryIds.forEach(function (queryId) { return staticQueryIds.delete(queryId); });
result.set(node, { staticQueryIds: staticQueryIds, dynamicQueryIds: dynamicQueryIds });
});
return result;
}
function staticViewQueryIds(nodeStaticQueryIds) {
var staticQueryIds = new Set();
var dynamicQueryIds = new Set();
Array.from(nodeStaticQueryIds.values()).forEach(function (entry) {
entry.staticQueryIds.forEach(function (queryId) { return staticQueryIds.add(queryId); });
entry.dynamicQueryIds.forEach(function (queryId) { return dynamicQueryIds.add(queryId); });
});
dynamicQueryIds.forEach(function (queryId) { return staticQueryIds.delete(queryId); });
return { staticQueryIds: staticQueryIds, dynamicQueryIds: dynamicQueryIds };
}
function elementEventNameAndTarget(eventAst, dirAst) {
if (eventAst.isAnimation) {
return {
name: "@" + eventAst.name + "." + eventAst.phase,
target: dirAst && dirAst.directive.isComponent ? 'component' : null
};
}
else {
return eventAst;
}
}
function calcStaticDynamicQueryFlags(queryIds, queryId, isFirst) {
var flags = 0 /* None */;
// Note: We only make queries static that query for a single item.
// This is because of backwards compatibility with the old view compiler...
if (isFirst && (queryIds.staticQueryIds.has(queryId) || !queryIds.dynamicQueryIds.has(queryId))) {
flags |= 268435456 /* StaticQuery */;
}
else {
flags |= 536870912 /* DynamicQuery */;
}
return flags;
}
function elementEventFullName(target, name) {
return target ? target + ":" + name : name;
}
/**
* @license
* Copyright Google Inc. 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 CONSTANT_PREFIX = '_c';
// Closure variables holding messages must be named `MSG_[A-Z0-9]+`
var TRANSLATION_PREFIX = 'MSG_';
/**
* Closure uses `goog.getMsg(message)` to lookup translations
*/
var GOOG_GET_MSG = 'goog.getMsg';
/**
* Context to use when producing a key.
*
* This ensures we see the constant not the reference variable when producing
* a key.
*/
var KEY_CONTEXT = {};
/**
* A node that is a place-holder that allows the node to be replaced when the actual
* node is known.
*
* This allows the constant pool to change an expression from a direct reference to
* a constant to a shared constant. It returns a fix-up node that is later allowed to
* change the referenced expression.
*/
var FixupExpression = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FixupExpression, _super);
function FixupExpression(resolved) {
var _this = _super.call(this, resolved.type) || this;
_this.resolved = resolved;
_this.original = resolved;
return _this;
}
FixupExpression.prototype.visitExpression = function (visitor, context) {
if (context === KEY_CONTEXT) {
// When producing a key we want to traverse the constant not the
// variable used to refer to it.
return this.original.visitExpression(visitor, context);
}
else {
return this.resolved.visitExpression(visitor, context);
}
};
FixupExpression.prototype.isEquivalent = function (e) {
return e instanceof FixupExpression && this.resolved.isEquivalent(e.resolved);
};
FixupExpression.prototype.isConstant = function () { return true; };
FixupExpression.prototype.fixup = function (expression) {
this.resolved = expression;
this.shared = true;
};
return FixupExpression;
}(Expression));
/**
* A constant pool allows a code emitter to share constant in an output context.
*
* The constant pool also supports sharing access to ivy definitions references.
*/
var ConstantPool = /** @class */ (function () {
function ConstantPool() {
this.statements = [];
this.translations = new Map();
this.literals = new Map();
this.literalFactories = new Map();
this.injectorDefinitions = new Map();
this.directiveDefinitions = new Map();
this.componentDefinitions = new Map();
this.pipeDefinitions = new Map();
this.nextNameIndex = 0;
}
ConstantPool.prototype.getConstLiteral = function (literal$$1, forceShared) {
if (literal$$1 instanceof LiteralExpr || literal$$1 instanceof FixupExpression) {
// Do no put simple literals into the constant pool or try to produce a constant for a
// reference to a constant.
return literal$$1;
}
var key = this.keyOf(literal$$1);
var fixup = this.literals.get(key);
var newValue = false;
if (!fixup) {
fixup = new FixupExpression(literal$$1);
this.literals.set(key, fixup);
newValue = true;
}
if ((!newValue && !fixup.shared) || (newValue && forceShared)) {
// Replace the expression with a variable
var name_1 = this.freshName();
this.statements.push(variable(name_1).set(literal$$1).toDeclStmt(INFERRED_TYPE, [StmtModifier.Final]));
fixup.fixup(variable(name_1));
}
return fixup;
};
// Generates closure specific code for translation.
//
// ```
// /**
// * @desc description?
// * @meaning meaning?
// */
// const MSG_XYZ = goog.getMsg('message');
// ```
ConstantPool.prototype.getTranslation = function (message, meta) {
// The identity of an i18n message depends on the message and its meaning
var key = meta.meaning ? message + "\0\0" + meta.meaning : message;
var exp = this.translations.get(key);
if (exp) {
return exp;
}
var docStmt = i18nMetaToDocStmt(meta);
if (docStmt) {
this.statements.push(docStmt);
}
// Call closure to get the translation
var variable$$1 = variable(this.freshTranslationName());
var fnCall = variable(GOOG_GET_MSG).callFn([literal(message)]);
var msgStmt = variable$$1.set(fnCall).toDeclStmt(INFERRED_TYPE, [StmtModifier.Final]);
this.statements.push(msgStmt);
this.translations.set(key, variable$$1);
return variable$$1;
};
ConstantPool.prototype.getDefinition = function (type, kind, ctx, forceShared) {
if (forceShared === void 0) { forceShared = false; }
var definitions = this.definitionsOf(kind);
var fixup = definitions.get(type);
var newValue = false;
if (!fixup) {
var property = this.propertyNameOf(kind);
fixup = new FixupExpression(ctx.importExpr(type).prop(property));
definitions.set(type, fixup);
newValue = true;
}
if ((!newValue && !fixup.shared) || (newValue && forceShared)) {
var name_2 = this.freshName();
this.statements.push(variable(name_2).set(fixup.resolved).toDeclStmt(INFERRED_TYPE, [StmtModifier.Final]));
fixup.fixup(variable(name_2));
}
return fixup;
};
ConstantPool.prototype.getLiteralFactory = function (literal$$1) {
// Create a pure function that builds an array of a mix of constant and variable expressions
if (literal$$1 instanceof LiteralArrayExpr) {
var argumentsForKey = literal$$1.entries.map(function (e) { return e.isConstant() ? e : literal(null); });
var key = this.keyOf(literalArr(argumentsForKey));
return this._getLiteralFactory(key, literal$$1.entries, function (entries) { return literalArr(entries); });
}
else {
var expressionForKey = literalMap(literal$$1.entries.map(function (e) { return ({
key: e.key,
value: e.value.isConstant() ? e.value : literal(null),
quoted: e.quoted
}); }));
var key = this.keyOf(expressionForKey);
return this._getLiteralFactory(key, literal$$1.entries.map(function (e) { return e.value; }), function (entries) { return literalMap(entries.map(function (value, index) { return ({
key: literal$$1.entries[index].key,
value: value,
quoted: literal$$1.entries[index].quoted
}); })); });
}
};
ConstantPool.prototype._getLiteralFactory = function (key, values, resultMap) {
var _this = this;
var literalFactory = this.literalFactories.get(key);
var literalFactoryArguments = values.filter((function (e) { return !e.isConstant(); }));
if (!literalFactory) {
var resultExpressions = values.map(function (e, index) { return e.isConstant() ? _this.getConstLiteral(e, true) : variable("a" + index); });
var parameters = resultExpressions.filter(isVariable).map(function (e) { return new FnParam(e.name, DYNAMIC_TYPE); });
var pureFunctionDeclaration = fn(parameters, [new ReturnStatement(resultMap(resultExpressions))], INFERRED_TYPE);
var name_3 = this.freshName();
this.statements.push(variable(name_3).set(pureFunctionDeclaration).toDeclStmt(INFERRED_TYPE, [
StmtModifier.Final
]));
literalFactory = variable(name_3);
this.literalFactories.set(key, literalFactory);
}
return { literalFactory: literalFactory, literalFactoryArguments: literalFactoryArguments };
};
/**
* Produce a unique name.
*
* The name might be unique among different prefixes if any of the prefixes end in
* a digit so the prefix should be a constant string (not based on user input) and
* must not end in a digit.
*/
ConstantPool.prototype.uniqueName = function (prefix) { return "" + prefix + this.nextNameIndex++; };
ConstantPool.prototype.definitionsOf = function (kind) {
switch (kind) {
case 2 /* Component */:
return this.componentDefinitions;
case 1 /* Directive */:
return this.directiveDefinitions;
case 0 /* Injector */:
return this.injectorDefinitions;
case 3 /* Pipe */:
return this.pipeDefinitions;
}
error("Unknown definition kind " + kind);
return this.componentDefinitions;
};
ConstantPool.prototype.propertyNameOf = function (kind) {
switch (kind) {
case 2 /* Component */:
return 'ngComponentDef';
case 1 /* Directive */:
return 'ngDirectiveDef';
case 0 /* Injector */:
return 'ngInjectorDef';
case 3 /* Pipe */:
return 'ngPipeDef';
}
error("Unknown definition kind " + kind);
return '<unknown>';
};
ConstantPool.prototype.freshName = function () { return this.uniqueName(CONSTANT_PREFIX); };
ConstantPool.prototype.freshTranslationName = function () {
return this.uniqueName(TRANSLATION_PREFIX).toUpperCase();
};
ConstantPool.prototype.keyOf = function (expression) {
return expression.visitExpression(new KeyVisitor(), KEY_CONTEXT);
};
return ConstantPool;
}());
/**
* Visitor used to determine if 2 expressions are equivalent and can be shared in the
* `ConstantPool`.
*
* When the id (string) generated by the visitor is equal, expressions are considered equivalent.
*/
var KeyVisitor = /** @class */ (function () {
function KeyVisitor() {
this.visitReadVarExpr = invalid;
this.visitWriteVarExpr = invalid;
this.visitWriteKeyExpr = invalid;
this.visitWritePropExpr = invalid;
this.visitInvokeMethodExpr = invalid;
this.visitInvokeFunctionExpr = invalid;
this.visitInstantiateExpr = invalid;
this.visitConditionalExpr = invalid;
this.visitNotExpr = invalid;
this.visitAssertNotNullExpr = invalid;
this.visitCastExpr = invalid;
this.visitFunctionExpr = invalid;
this.visitBinaryOperatorExpr = invalid;
this.visitReadPropExpr = invalid;
this.visitReadKeyExpr = invalid;
this.visitCommaExpr = invalid;
}
KeyVisitor.prototype.visitLiteralExpr = function (ast) {
return "" + (typeof ast.value === 'string' ? '"' + ast.value + '"' : ast.value);
};
KeyVisitor.prototype.visitLiteralArrayExpr = function (ast, context) {
var _this = this;
return "[" + ast.entries.map(function (entry) { return entry.visitExpression(_this, context); }).join(',') + "]";
};
KeyVisitor.prototype.visitLiteralMapExpr = function (ast, context) {
var _this = this;
var mapKey = function (entry) {
var quote = entry.quoted ? '"' : '';
return "" + quote + entry.key + quote;
};
var mapEntry = function (entry) {
return mapKey(entry) + ":" + entry.value.visitExpression(_this, context);
};
return "{" + ast.entries.map(mapEntry).join(',');
};
KeyVisitor.prototype.visitExternalExpr = function (ast) {
return ast.value.moduleName ? "EX:" + ast.value.moduleName + ":" + ast.value.name :
"EX:" + ast.value.runtime.name;
};
return KeyVisitor;
}());
function invalid(arg) {
throw new Error("Invalid state: Visitor " + this.constructor.name + " doesn't handle " + arg.constructor.name);
}
function isVariable(e) {
return e instanceof ReadVarExpr;
}
// Converts i18n meta informations for a message (description, meaning) to a JsDoc statement
// formatted as expected by the Closure compiler.
function i18nMetaToDocStmt(meta) {
var tags = [];
if (meta.description) {
tags.push({ tagName: "desc" /* Desc */, text: meta.description });
}
if (meta.meaning) {
tags.push({ tagName: "meaning" /* Meaning */, text: meta.meaning });
}
return tags.length == 0 ? null : new JSDocCommentStmt(tags);
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A container for message extracted from the templates.
*/
var MessageBundle = /** @class */ (function () {
function MessageBundle(_htmlParser, _implicitTags, _implicitAttrs, _locale) {
if (_locale === void 0) { _locale = null; }
this._htmlParser = _htmlParser;
this._implicitTags = _implicitTags;
this._implicitAttrs = _implicitAttrs;
this._locale = _locale;
this._messages = [];
}
MessageBundle.prototype.updateFromTemplate = function (html, url, interpolationConfig) {
var htmlParserResult = this._htmlParser.parse(html, url, true, interpolationConfig);
if (htmlParserResult.errors.length) {
return htmlParserResult.errors;
}
var i18nParserResult = extractMessages(htmlParserResult.rootNodes, interpolationConfig, this._implicitTags, this._implicitAttrs);
if (i18nParserResult.errors.length) {
return i18nParserResult.errors;
}
(_a = this._messages).push.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(i18nParserResult.messages));
return [];
var _a;
};
// Return the message in the internal format
// The public (serialized) format might be different, see the `write` method.
MessageBundle.prototype.getMessages = function () { return this._messages; };
MessageBundle.prototype.write = function (serializer, filterSources) {
var messages = {};
var mapperVisitor = new MapPlaceholderNames();
// Deduplicate messages based on their ID
this._messages.forEach(function (message) {
var id = serializer.digest(message);
if (!messages.hasOwnProperty(id)) {
messages[id] = message;
}
else {
(_a = messages[id].sources).push.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(message.sources));
}
var _a;
});
// Transform placeholder names using the serializer mapping
var msgList = Object.keys(messages).map(function (id) {
var mapper = serializer.createNameMapper(messages[id]);
var src = messages[id];
var nodes = mapper ? mapperVisitor.convert(src.nodes, mapper) : src.nodes;
var transformedMessage = new Message(nodes, {}, {}, src.meaning, src.description, id);
transformedMessage.sources = src.sources;
if (filterSources) {
transformedMessage.sources.forEach(function (source) { return source.filePath = filterSources(source.filePath); });
}
return transformedMessage;
});
return serializer.write(msgList, this._locale);
};
return MessageBundle;
}());
// Transform an i18n AST by renaming the placeholder nodes with the given mapper
var MapPlaceholderNames = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MapPlaceholderNames, _super);
function MapPlaceholderNames() {
return _super !== null && _super.apply(this, arguments) || this;
}
MapPlaceholderNames.prototype.convert = function (nodes, mapper) {
var _this = this;
return mapper ? nodes.map(function (n) { return n.visit(_this, mapper); }) : nodes;
};
MapPlaceholderNames.prototype.visitTagPlaceholder = function (ph, mapper) {
var _this = this;
var startName = mapper.toPublicName(ph.startName);
var closeName = ph.closeName ? mapper.toPublicName(ph.closeName) : ph.closeName;
var children = ph.children.map(function (n) { return n.visit(_this, mapper); });
return new TagPlaceholder(ph.tag, ph.attrs, startName, closeName, children, ph.isVoid, ph.sourceSpan);
};
MapPlaceholderNames.prototype.visitPlaceholder = function (ph, mapper) {
return new Placeholder(ph.value, mapper.toPublicName(ph.name), ph.sourceSpan);
};
MapPlaceholderNames.prototype.visitIcuPlaceholder = function (ph, mapper) {
return new IcuPlaceholder(ph.value, mapper.toPublicName(ph.name), ph.sourceSpan);
};
return MapPlaceholderNames;
}(CloneVisitor));
/**
* @license
* Copyright Google Inc. 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
*/
function mapLiteral(obj) {
return literalMap(Object.keys(obj).map(function (key) { return ({
key: key,
quoted: false,
value: obj[key],
}); }));
}
/**
* @license
* Copyright Google Inc. 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 CORE$1 = '@angular/core';
var Identifiers$1 = /** @class */ (function () {
function Identifiers() {
}
/* Methods */
Identifiers.NEW_METHOD = 'factory';
Identifiers.TRANSFORM_METHOD = 'transform';
Identifiers.PATCH_DEPS = 'patchedDeps';
/* Instructions */
Identifiers.createElement = { name: 'ɵE', moduleName: CORE$1 };
Identifiers.elementEnd = { name: 'ɵe', moduleName: CORE$1 };
Identifiers.elementProperty = { name: 'ɵp', moduleName: CORE$1 };
Identifiers.elementAttribute = { name: 'ɵa', moduleName: CORE$1 };
Identifiers.elementClassNamed = { name: 'ɵkn', moduleName: CORE$1 };
Identifiers.elementStyleNamed = { name: 'ɵsn', moduleName: CORE$1 };
Identifiers.containerCreate = { name: 'ɵC', moduleName: CORE$1 };
Identifiers.containerEnd = { name: 'ɵc', moduleName: CORE$1 };
Identifiers.directiveCreate = { name: 'ɵD', moduleName: CORE$1 };
Identifiers.text = { name: 'ɵT', moduleName: CORE$1 };
Identifiers.directiveInput = { name: 'ɵi', moduleName: CORE$1 };
Identifiers.textCreateBound = { name: 'ɵt', moduleName: CORE$1 };
Identifiers.bind = { name: 'ɵb', moduleName: CORE$1 };
Identifiers.interpolation1 = { name: 'ɵi1', moduleName: CORE$1 };
Identifiers.interpolation2 = { name: 'ɵi2', moduleName: CORE$1 };
Identifiers.interpolation3 = { name: 'ɵi3', moduleName: CORE$1 };
Identifiers.interpolation4 = { name: 'ɵi4', moduleName: CORE$1 };
Identifiers.interpolation5 = { name: 'ɵi5', moduleName: CORE$1 };
Identifiers.interpolation6 = { name: 'ɵi6', moduleName: CORE$1 };
Identifiers.interpolation7 = { name: 'ɵi7', moduleName: CORE$1 };
Identifiers.interpolation8 = { name: 'ɵi8', moduleName: CORE$1 };
Identifiers.interpolationV = { name: 'ɵiV', moduleName: CORE$1 };
Identifiers.pureFunction0 = { name: 'ɵf0', moduleName: CORE$1 };
Identifiers.pureFunction1 = { name: 'ɵf1', moduleName: CORE$1 };
Identifiers.pureFunction2 = { name: 'ɵf2', moduleName: CORE$1 };
Identifiers.pureFunction3 = { name: 'ɵf3', moduleName: CORE$1 };
Identifiers.pureFunction4 = { name: 'ɵf4', moduleName: CORE$1 };
Identifiers.pureFunction5 = { name: 'ɵf5', moduleName: CORE$1 };
Identifiers.pureFunction6 = { name: 'ɵf6', moduleName: CORE$1 };
Identifiers.pureFunction7 = { name: 'ɵf7', moduleName: CORE$1 };
Identifiers.pureFunction8 = { name: 'ɵf8', moduleName: CORE$1 };
Identifiers.pureFunctionV = { name: 'ɵfV', moduleName: CORE$1 };
Identifiers.pipeBind1 = { name: 'ɵpb1', moduleName: CORE$1 };
Identifiers.pipeBind2 = { name: 'ɵpb2', moduleName: CORE$1 };
Identifiers.pipeBind3 = { name: 'ɵpb3', moduleName: CORE$1 };
Identifiers.pipeBind4 = { name: 'ɵpb4', moduleName: CORE$1 };
Identifiers.pipeBindV = { name: 'ɵpbV', moduleName: CORE$1 };
Identifiers.load = { name: 'ɵld', moduleName: CORE$1 };
Identifiers.pipe = { name: 'ɵPp', moduleName: CORE$1 };
Identifiers.projection = { name: 'ɵP', moduleName: CORE$1 };
Identifiers.projectionDef = { name: 'ɵpD', moduleName: CORE$1 };
Identifiers.refreshComponent = { name: 'ɵr', moduleName: CORE$1 };
Identifiers.directiveLifeCycle = { name: 'ɵl', moduleName: CORE$1 };
Identifiers.injectAttribute = { name: 'ɵinjectAttribute', moduleName: CORE$1 };
Identifiers.injectElementRef = { name: 'ɵinjectElementRef', moduleName: CORE$1 };
Identifiers.injectTemplateRef = { name: 'ɵinjectTemplateRef', moduleName: CORE$1 };
Identifiers.injectViewContainerRef = { name: 'ɵinjectViewContainerRef', moduleName: CORE$1 };
Identifiers.directiveInject = { name: 'ɵdirectiveInject', moduleName: CORE$1 };
Identifiers.defineComponent = { name: 'ɵdefineComponent', moduleName: CORE$1 };
Identifiers.defineDirective = {
name: 'ɵdefineDirective',
moduleName: CORE$1,
};
Identifiers.defineInjector = {
name: 'defineInjector',
moduleName: CORE$1,
};
Identifiers.definePipe = { name: 'ɵdefinePipe', moduleName: CORE$1 };
Identifiers.query = { name: 'ɵQ', moduleName: CORE$1 };
Identifiers.queryRefresh = { name: 'ɵqR', moduleName: CORE$1 };
Identifiers.NgOnChangesFeature = { name: 'ɵNgOnChangesFeature', moduleName: CORE$1 };
Identifiers.listener = { name: 'ɵL', moduleName: CORE$1 };
return Identifiers;
}());
/**
* @license
* Copyright Google Inc. 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 EMPTY_ARRAY = literalArr([]);
function convertMetaToOutput(meta, ctx) {
if (Array.isArray(meta)) {
return literalArr(meta.map(function (entry) { return convertMetaToOutput(entry, ctx); }));
}
else if (meta instanceof StaticSymbol) {
return ctx.importExpr(meta);
}
else if (meta == null) {
return literal(meta);
}
else {
throw new Error("Internal error: Unsupported or unknown metadata: " + meta);
}
}
function compileNgModule(ctx, ngModule, injectableCompiler) {
var className = identifierName(ngModule.type);
var rawImports = ngModule.rawImports ? [ngModule.rawImports] : [];
var rawExports = ngModule.rawExports ? [ngModule.rawExports] : [];
var injectorDefArg = mapLiteral({
'factory': injectableCompiler.factoryFor({ type: ngModule.type, symbol: ngModule.type.reference }, ctx),
'providers': convertMetaToOutput(ngModule.rawProviders, ctx),
'imports': convertMetaToOutput(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(rawImports, rawExports), ctx),
});
var injectorDef = importExpr(Identifiers$1.defineInjector).callFn([injectorDefArg]);
ctx.statements.push(new ClassStmt(
/* name */ className,
/* parent */ null,
/* fields */ [new ClassField(
/* name */ 'ngInjectorDef',
/* type */ INFERRED_TYPE,
/* modifiers */ [StmtModifier.Static],
/* initializer */ injectorDef)],
/* getters */ [],
/* constructorMethod */ new ClassMethod(null, [], []),
/* methods */ []));
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Comment to insert above back-patch
*/
var BUILD_OPTIMIZER_COLOCATE = '@__BUILD_OPTIMIZER_COLOCATE__';
/**
* @license
* Copyright Google Inc. 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
*/
/** Name of the context parameter passed into a template function */
var CONTEXT_NAME = 'ctx';
/** Name of the RenderFlag passed into a template function */
var RENDER_FLAGS = 'rf';
/** Name of the temporary to use during data binding */
var TEMPORARY_NAME = '_t';
/** The prefix reference variables */
var REFERENCE_PREFIX = '_r';
/** The name of the implicit context reference */
var IMPLICIT_REFERENCE = '$implicit';
/** Name of the i18n attributes **/
var I18N_ATTR = 'i18n';
var I18N_ATTR_PREFIX = 'i18n-';
/** I18n separators for metadata **/
var MEANING_SEPARATOR$1 = '|';
var ID_SEPARATOR$1 = '@@';
function compileDirective(outputCtx, directive, reflector, bindingParser, mode) {
var definitionMapValues = [];
var field = function (key, value) {
if (value) {
definitionMapValues.push({ key: key, value: value, quoted: false });
}
};
// e.g. 'type: MyDirective`
field('type', outputCtx.importExpr(directive.type.reference));
// e.g. `selectors: [['', 'someDir', '']]`
field('selectors', createDirectiveSelector(directive.selector));
// e.g. `factory: () => new MyApp(injectElementRef())`
field('factory', createFactory(directive.type, outputCtx, reflector, directive.queries));
// e.g. `hostBindings: (dirIndex, elIndex) => { ... }
field('hostBindings', createHostBindingsFunction(directive, outputCtx, bindingParser));
// e.g. `attributes: ['role', 'listbox']`
field('attributes', createHostAttributesArray(directive, outputCtx));
// e.g 'inputs: {a: 'a'}`
field('inputs', conditionallyCreateMapObjectLiteral(directive.inputs, outputCtx));
// e.g 'outputs: {a: 'a'}`
field('outputs', conditionallyCreateMapObjectLiteral(directive.outputs, outputCtx));
var className = identifierName(directive.type);
className || error("Cannot resolver the name of " + directive.type);
var definitionField = outputCtx.constantPool.propertyNameOf(1 /* Directive */);
var definitionFunction = importExpr(Identifiers$1.defineDirective).callFn([literalMap(definitionMapValues)]);
if (mode === 0 /* PartialClass */) {
// Create the partial class to be merged with the actual class.
outputCtx.statements.push(new ClassStmt(
/* name */ className,
/* parent */ null,
/* fields */ [new ClassField(
/* name */ definitionField,
/* type */ INFERRED_TYPE,
/* modifiers */ [StmtModifier.Static],
/* initializer */ definitionFunction)],
/* getters */ [],
/* constructorMethod */ new ClassMethod(null, [], []),
/* methods */ []));
}
else {
// Create back-patch definition.
var classReference = outputCtx.importExpr(directive.type.reference);
// Create the back-patch statement
outputCtx.statements.push(new CommentStmt(BUILD_OPTIMIZER_COLOCATE));
outputCtx.statements.push(classReference.prop(definitionField).set(definitionFunction).toStmt());
}
}
function compileComponent(outputCtx, component, pipeSummaries, template, reflector, bindingParser, mode) {
var definitionMapValues = [];
// Pipes and Directives found in the template
var pipes = new Set();
var directives = new Set();
var field = function (key, value) {
if (value) {
definitionMapValues.push({ key: key, value: value, quoted: false });
}
};
// e.g. `type: MyApp`
field('type', outputCtx.importExpr(component.type.reference));
// e.g. `selectors: [['my-app']]`
field('selectors', createDirectiveSelector(component.selector));
var selector = component.selector && CssSelector.parse(component.selector);
var firstSelector = selector && selector[0];
// e.g. `attr: ["class", ".my.app"]
// This is optional an only included if the first selector of a component specifies attributes.
if (firstSelector) {
var selectorAttributes = firstSelector.getAttrs();
if (selectorAttributes.length) {
field('attrs', outputCtx.constantPool.getConstLiteral(literalArr(selectorAttributes.map(function (value) { return value != null ? literal(value) : literal(undefined); })),
/* forceShared */ true));
}
}
// e.g. `factory: function MyApp_Factory() { return new MyApp(injectElementRef()); }`
field('factory', createFactory(component.type, outputCtx, reflector, component.queries));
// e.g `hostBindings: function MyApp_HostBindings { ... }
field('hostBindings', createHostBindingsFunction(component, outputCtx, bindingParser));
// e.g. `template: function MyComponent_Template(_ctx, _cm) {...}`
var templateTypeName = component.type.reference.name;
var templateName = templateTypeName ? templateTypeName + "_Template" : null;
var pipeMap = new Map(pipeSummaries.map(function (pipe) { return [pipe.name, pipe]; }));
var templateFunctionExpression = new TemplateDefinitionBuilder(outputCtx, outputCtx.constantPool, reflector, CONTEXT_NAME, BindingScope.ROOT_SCOPE, 0, component.template.ngContentSelectors, templateTypeName, templateName, pipeMap, component.viewQueries, directives, pipes)
.buildTemplateFunction(template, []);
field('template', templateFunctionExpression);
// e.g. `directives: [MyDirective]`
if (directives.size) {
var expressions = Array.from(directives).map(function (d) { return outputCtx.importExpr(d); });
field('directives', literalArr(expressions));
}
// e.g. `pipes: [MyPipe]`
if (pipes.size) {
var expressions = Array.from(pipes).map(function (p) { return outputCtx.importExpr(p); });
field('pipes', literalArr(expressions));
}
// e.g `inputs: {a: 'a'}`
field('inputs', conditionallyCreateMapObjectLiteral(component.inputs, outputCtx));
// e.g 'outputs: {a: 'a'}`
field('outputs', conditionallyCreateMapObjectLiteral(component.outputs, outputCtx));
// e.g. `features: [NgOnChangesFeature(MyComponent)]`
var features = [];
if (component.type.lifecycleHooks.some(function (lifecycle) { return lifecycle == LifecycleHooks.OnChanges; })) {
features.push(importExpr(Identifiers$1.NgOnChangesFeature, null, null).callFn([outputCtx.importExpr(component.type.reference)]));
}
if (features.length) {
field('features', literalArr(features));
}
var definitionField = outputCtx.constantPool.propertyNameOf(2 /* Component */);
var definitionFunction = importExpr(Identifiers$1.defineComponent).callFn([literalMap(definitionMapValues)]);
if (mode === 0 /* PartialClass */) {
var className = identifierName(component.type);
className || error("Cannot resolver the name of " + component.type);
// Create the partial class to be merged with the actual class.
outputCtx.statements.push(new ClassStmt(
/* name */ className,
/* parent */ null,
/* fields */ [new ClassField(
/* name */ definitionField,
/* type */ INFERRED_TYPE,
/* modifiers */ [StmtModifier.Static],
/* initializer */ definitionFunction)],
/* getters */ [],
/* constructorMethod */ new ClassMethod(null, [], []),
/* methods */ []));
}
else {
var classReference = outputCtx.importExpr(component.type.reference);
// Create the back-patch statement
outputCtx.statements.push(new CommentStmt(BUILD_OPTIMIZER_COLOCATE), classReference.prop(definitionField).set(definitionFunction).toStmt());
}
}
function unsupported(feature) {
if (this) {
throw new Error("Builder " + this.constructor.name + " doesn't support " + feature + " yet");
}
throw new Error("Feature " + feature + " is not supported yet");
}
var BINDING_INSTRUCTION_MAP = (_a = {},
_a[PropertyBindingType.Property] = Identifiers$1.elementProperty,
_a[PropertyBindingType.Attribute] = Identifiers$1.elementAttribute,
_a[PropertyBindingType.Class] = Identifiers$1.elementClassNamed,
_a[PropertyBindingType.Style] = Identifiers$1.elementStyleNamed,
_a);
function interpolate(args) {
args = args.slice(1); // Ignore the length prefix added for render2
switch (args.length) {
case 3:
return importExpr(Identifiers$1.interpolation1).callFn(args);
case 5:
return importExpr(Identifiers$1.interpolation2).callFn(args);
case 7:
return importExpr(Identifiers$1.interpolation3).callFn(args);
case 9:
return importExpr(Identifiers$1.interpolation4).callFn(args);
case 11:
return importExpr(Identifiers$1.interpolation5).callFn(args);
case 13:
return importExpr(Identifiers$1.interpolation6).callFn(args);
case 15:
return importExpr(Identifiers$1.interpolation7).callFn(args);
case 17:
return importExpr(Identifiers$1.interpolation8).callFn(args);
}
(args.length >= 19 && args.length % 2 == 1) ||
error("Invalid interpolation argument length " + args.length);
return importExpr(Identifiers$1.interpolationV).callFn([literalArr(args)]);
}
function pipeBinding(args) {
switch (args.length) {
case 0:
// The first parameter to pipeBind is always the value to be transformed followed
// by arg.length arguments so the total number of arguments to pipeBind are
// arg.length + 1.
return Identifiers$1.pipeBind1;
case 1:
return Identifiers$1.pipeBind2;
case 2:
return Identifiers$1.pipeBind3;
default:
return Identifiers$1.pipeBindV;
}
}
var pureFunctionIdentifiers = [
Identifiers$1.pureFunction0, Identifiers$1.pureFunction1, Identifiers$1.pureFunction2, Identifiers$1.pureFunction3, Identifiers$1.pureFunction4,
Identifiers$1.pureFunction5, Identifiers$1.pureFunction6, Identifiers$1.pureFunction7, Identifiers$1.pureFunction8
];
function getLiteralFactory(outputContext, literal$$1) {
var _a = outputContext.constantPool.getLiteralFactory(literal$$1), literalFactory = _a.literalFactory, literalFactoryArguments = _a.literalFactoryArguments;
literalFactoryArguments.length > 0 || error("Expected arguments to a literal factory function");
var pureFunctionIdent = pureFunctionIdentifiers[literalFactoryArguments.length] || Identifiers$1.pureFunctionV;
// Literal factories are pure functions that only need to be re-invoked when the parameters
// change.
return importExpr(pureFunctionIdent).callFn(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([literalFactory], literalFactoryArguments));
}
function noop() { }
var BindingScope = /** @class */ (function () {
function BindingScope(parent, declareLocalVarCallback) {
if (parent === void 0) { parent = null; }
if (declareLocalVarCallback === void 0) { declareLocalVarCallback = noop; }
this.parent = parent;
this.declareLocalVarCallback = declareLocalVarCallback;
/**
* Keeps a map from local variables to their expressions.
*
* This is used when one refers to variable such as: 'let abc = a.b.c`.
* - key to the map is the string literal `"abc"`.
* - value `lhs` is the left hand side which is an AST representing `abc`.
* - value `rhs` is the right hand side which is an AST representing `a.b.c`.
* - value `declared` is true if the `declareLocalVarCallback` has been called for this scope
* already.
*/
this.map = new Map();
this.referenceNameIndex = 0;
}
BindingScope.prototype.get = function (name) {
var current = this;
while (current) {
var value = current.map.get(name);
if (value != null) {
if (current !== this) {
// make a local copy and reset the `declared` state.
value = { lhs: value.lhs, rhs: value.rhs, declared: false };
// Cache the value locally.
this.map.set(name, value);
}
if (value.rhs && !value.declared) {
// if it is first time we are referencing the variable in the scope
// than invoke the callback to insert variable declaration.
this.declareLocalVarCallback(value.lhs, value.rhs);
value.declared = true;
}
return value.lhs;
}
current = current.parent;
}
return null;
};
/**
* Create a local variable for later reference.
*
* @param name Name of the variable.
* @param lhs AST representing the left hand side of the `let lhs = rhs;`.
* @param rhs AST representing the right hand side of the `let lhs = rhs;`. The `rhs` can be
* `undefined` for variable that are ambient such as `$event` and which don't have `rhs`
* declaration.
*/
BindingScope.prototype.set = function (name, lhs, rhs) {
!this.map.has(name) ||
error("The name " + name + " is already defined in scope to be " + this.map.get(name));
this.map.set(name, { lhs: lhs, rhs: rhs, declared: false });
return this;
};
BindingScope.prototype.getLocal = function (name) { return this.get(name); };
BindingScope.prototype.nestedScope = function (declareCallback) {
return new BindingScope(this, declareCallback);
};
BindingScope.prototype.freshReferenceName = function () {
var current = this;
// Find the top scope as it maintains the global reference count
while (current.parent)
current = current.parent;
var ref = "" + REFERENCE_PREFIX + current.referenceNameIndex++;
return ref;
};
BindingScope.ROOT_SCOPE = new BindingScope().set('$event', variable('$event'));
return BindingScope;
}());
var TemplateDefinitionBuilder = /** @class */ (function () {
function TemplateDefinitionBuilder(outputCtx, constantPool, reflector, contextParameter, parentBindingScope, level, ngContentSelectors, contextName, templateName, pipeMap, viewQueries, directives, pipes) {
if (level === void 0) { level = 0; }
var _this = this;
this.outputCtx = outputCtx;
this.constantPool = constantPool;
this.reflector = reflector;
this.contextParameter = contextParameter;
this.level = level;
this.ngContentSelectors = ngContentSelectors;
this.contextName = contextName;
this.templateName = templateName;
this.pipeMap = pipeMap;
this.viewQueries = viewQueries;
this.directives = directives;
this.pipes = pipes;
this._dataIndex = 0;
this._bindingContext = 0;
this._temporaryAllocated = false;
this._prefix = [];
this._creationMode = [];
this._variableMode = [];
this._bindingMode = [];
this._postfix = [];
this._projectionDefinitionIndex = 0;
this.unsupported = unsupported;
this.invalid = invalid$1;
// Whether we are inside a translatable element (`<p i18n>... somewhere here ... </p>)
this._inI18nSection = false;
this._i18nSectionIndex = -1;
// Maps of placeholder to node indexes for each of the i18n section
this._phToNodeIdxes = [{}];
// These should be handled in the template or element directly.
this.visitReference = invalid$1;
this.visitVariable = invalid$1;
this.visitEvent = invalid$1;
this.visitElementProperty = invalid$1;
this.visitAttr = invalid$1;
// These should be handled in the template or element directly
this.visitDirective = invalid$1;
this.visitDirectiveProperty = invalid$1;
this.bindingScope =
parentBindingScope.nestedScope(function (lhsVar, expression) {
_this._bindingMode.push(lhsVar.set(expression).toDeclStmt(INFERRED_TYPE, [StmtModifier.Final]));
});
this._valueConverter = new ValueConverter(outputCtx, function () { return _this.allocateDataSlot(); }, function (name, localName, slot, value) {
_this.bindingScope.set(localName, value);
var pipe = pipeMap.get(name);
pipe || error("Could not find pipe " + name);
_this.pipes.add(pipe.type.reference);
_this._creationMode.push(importExpr(Identifiers$1.pipe).callFn([literal(slot), literal(name)]).toStmt());
});
}
TemplateDefinitionBuilder.prototype.buildTemplateFunction = function (nodes, variables) {
try {
// Create variable bindings
for (var variables_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(variables), variables_1_1 = variables_1.next(); !variables_1_1.done; variables_1_1 = variables_1.next()) {
var variable$$1 = variables_1_1.value;
var variableName = variable$$1.name;
var expression = variable(this.contextParameter).prop(variable$$1.value || IMPLICIT_REFERENCE);
var scopedName = this.bindingScope.freshReferenceName();
// Add the reference to the local scope.
this.bindingScope.set(variableName, variable(variableName + scopedName), expression);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (variables_1_1 && !variables_1_1.done && (_a = variables_1.return)) _a.call(variables_1);
}
finally { if (e_1) throw e_1.error; }
}
// Collect content projections
if (this.ngContentSelectors && this.ngContentSelectors.length > 0) {
var contentProjections = getContentProjection(nodes, this.ngContentSelectors);
this._contentProjections = contentProjections;
if (contentProjections.size > 0) {
var selectors_1 = [];
Array.from(contentProjections.values()).forEach(function (info) {
if (info.selector) {
selectors_1[info.index - 1] = info.selector;
}
});
var projectionIndex = this._projectionDefinitionIndex = this.allocateDataSlot();
var parameters = [literal(projectionIndex)];
if (selectors_1.some(function (value) { return !value; })) {
error("content project information skipped an index");
}
if (selectors_1.length > 1) {
var r3Selectors = selectors_1.map(function (s) { return parseSelectorToR3Selector(s); });
// `projectionDef` needs both the parsed and raw value of the selectors
var parsed = this.outputCtx.constantPool.getConstLiteral(asLiteral(r3Selectors), true);
var unParsed = this.outputCtx.constantPool.getConstLiteral(asLiteral(selectors_1), true);
parameters.push(parsed, unParsed);
}
this.instruction.apply(this, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([this._creationMode, null, Identifiers$1.projectionDef], parameters));
}
}
try {
// Define and update any view queries
for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(this.viewQueries), _c = _b.next(); !_c.done; _c = _b.next()) {
var query = _c.value;
// e.g. r3.Q(0, somePredicate, true);
var querySlot = this.allocateDataSlot();
var predicate = getQueryPredicate(query, this.outputCtx);
var args = [
/* memoryIndex */ literal(querySlot, INFERRED_TYPE),
/* predicate */ predicate,
/* descend */ literal(query.descendants, INFERRED_TYPE)
];
if (query.read) {
args.push(this.outputCtx.importExpr(query.read.identifier.reference));
}
this.instruction.apply(this, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([this._creationMode, null, Identifiers$1.query], args));
// (r3.qR(tmp = r3.ɵld(0)) && (ctx.someDir = tmp));
var temporary = this.temp();
var getQueryList = importExpr(Identifiers$1.load).callFn([literal(querySlot)]);
var refresh = importExpr(Identifiers$1.queryRefresh).callFn([temporary.set(getQueryList)]);
var updateDirective = variable(CONTEXT_NAME)
.prop(query.propertyName)
.set(query.first ? temporary.prop('first') : temporary);
this._bindingMode.push(refresh.and(updateDirective).toStmt());
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_d = _b.return)) _d.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
templateVisitAll(this, nodes);
var creationMode = this._creationMode.length > 0 ?
[ifStmt(variable(RENDER_FLAGS).bitwiseAnd(literal(1 /* Create */), null, false), this._creationMode)] :
[];
var updateMode = this._bindingMode.length > 0 ?
[ifStmt(variable(RENDER_FLAGS).bitwiseAnd(literal(2 /* Update */), null, false), this._bindingMode)] :
[];
try {
// Generate maps of placeholder name to node indexes
// TODO(vicb): This is a WIP, not fully supported yet
for (var _e = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(this._phToNodeIdxes), _f = _e.next(); !_f.done; _f = _e.next()) {
var phToNodeIdx = _f.value;
if (Object.keys(phToNodeIdx).length > 0) {
var scopedName = this.bindingScope.freshReferenceName();
var phMap = variable(scopedName)
.set(mapToExpression(phToNodeIdx, true))
.toDeclStmt(INFERRED_TYPE, [StmtModifier.Final]);
this._prefix.push(phMap);
}
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_f && !_f.done && (_g = _e.return)) _g.call(_e);
}
finally { if (e_3) throw e_3.error; }
}
return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(this.contextParameter, null)], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(this._prefix, creationMode, this._variableMode, updateMode, this._postfix), INFERRED_TYPE, null, this.templateName);
var e_1, _a, e_2, _d, e_3, _g;
};
// LocalResolver
TemplateDefinitionBuilder.prototype.getLocal = function (name) { return this.bindingScope.get(name); };
// TemplateAstVisitor
TemplateDefinitionBuilder.prototype.visitNgContent = function (ngContent) {
var info = this._contentProjections.get(ngContent);
info ||
error("Expected " + ngContent.sourceSpan + " to be included in content projection collection");
var slot = this.allocateDataSlot();
var parameters = [literal(slot), literal(this._projectionDefinitionIndex)];
if (info.index !== 0) {
parameters.push(literal(info.index));
}
this.instruction.apply(this, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([this._creationMode, ngContent.sourceSpan, Identifiers$1.projection], parameters));
};
// TemplateAstVisitor
TemplateDefinitionBuilder.prototype.visitElement = function (element) {
var _this = this;
var elementIndex = this.allocateDataSlot();
var referenceDataSlots = new Map();
var wasInI18nSection = this._inI18nSection;
var outputAttrs = {};
var attrI18nMetas = {};
var i18nMeta = '';
// Elements inside i18n sections are replaced with placeholders
// TODO(vicb): nested elements are a WIP in this phase
if (this._inI18nSection) {
var phName = element.name.toLowerCase();
if (!this._phToNodeIdxes[this._i18nSectionIndex][phName]) {
this._phToNodeIdxes[this._i18nSectionIndex][phName] = [];
}
this._phToNodeIdxes[this._i18nSectionIndex][phName].push(elementIndex);
}
try {
// Handle i18n attributes
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(element.attrs), _b = _a.next(); !_b.done; _b = _a.next()) {
var attr = _b.value;
var name_1 = attr.name;
var value = attr.value;
if (name_1 === I18N_ATTR) {
if (this._inI18nSection) {
throw new Error("Could not mark an element as translatable inside of a translatable section");
}
this._inI18nSection = true;
this._i18nSectionIndex++;
this._phToNodeIdxes[this._i18nSectionIndex] = {};
i18nMeta = value;
}
else if (name_1.startsWith(I18N_ATTR_PREFIX)) {
attrI18nMetas[name_1.slice(I18N_ATTR_PREFIX.length)] = value;
}
else {
outputAttrs[name_1] = value;
}
}
}
catch (e_4_1) { e_4 = { error: e_4_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_4) throw e_4.error; }
}
// Element creation mode
var parameters = [
literal(elementIndex),
literal(element.name),
];
element.directives.forEach(function (directive) { return _this.directives.add(directive.directive.type.reference); });
// Add the attributes
var i18nMessages = [];
var attributes = [];
var hasI18nAttr = false;
Object.getOwnPropertyNames(outputAttrs).forEach(function (name) {
var value = outputAttrs[name];
attributes.push(literal(name));
if (attrI18nMetas.hasOwnProperty(name)) {
hasI18nAttr = true;
var meta = parseI18nMeta(attrI18nMetas[name]);
var variable$$1 = _this.constantPool.getTranslation(value, meta);
attributes.push(variable$$1);
}
else {
attributes.push(literal(value));
}
});
var attrArg = TYPED_NULL_EXPR;
if (attributes.length > 0) {
attrArg = hasI18nAttr ? getLiteralFactory(this.outputCtx, literalArr(attributes)) :
this.constantPool.getConstLiteral(literalArr(attributes), true);
}
parameters.push(attrArg);
if (element.references && element.references.length > 0) {
var references = flatten(element.references.map(function (reference) {
var slot = _this.allocateDataSlot();
referenceDataSlots.set(reference.name, slot);
// Generate the update temporary.
var variableName = _this.bindingScope.freshReferenceName();
_this._variableMode.push(variable(variableName, INFERRED_TYPE)
.set(importExpr(Identifiers$1.load).callFn([literal(slot)]))
.toDeclStmt(INFERRED_TYPE, [StmtModifier.Final]));
_this.bindingScope.set(reference.name, variable(variableName));
return [reference.name, reference.originalValue];
})).map(function (value) { return literal(value); });
parameters.push(this.constantPool.getConstLiteral(literalArr(references), /* forceShared */ true));
}
else {
parameters.push(TYPED_NULL_EXPR);
}
// Generate the instruction create element instruction
if (i18nMessages.length > 0) {
(_d = this._creationMode).push.apply(_d, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(i18nMessages));
}
this.instruction.apply(this, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([this._creationMode, element.sourceSpan, Identifiers$1.createElement], trimTrailingNulls(parameters)));
var implicit = variable(CONTEXT_NAME);
// Generate Listeners (outputs)
element.outputs.forEach(function (outputAst) {
var functionName = _this.templateName + "_" + element.name + "_" + outputAst.name + "_listener";
var localVars = [];
var bindingScope = _this.bindingScope.nestedScope(function (lhsVar, rhsExpression) {
localVars.push(lhsVar.set(rhsExpression).toDeclStmt(INFERRED_TYPE, [StmtModifier.Final]));
});
var bindingExpr = convertActionBinding(bindingScope, variable(CONTEXT_NAME), outputAst.handler, 'b', function () { return error('Unexpected interpolation'); });
var handler = fn([new FnParam('$event', DYNAMIC_TYPE)], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(localVars, bindingExpr.render3Stmts), INFERRED_TYPE, null, functionName);
_this.instruction(_this._creationMode, outputAst.sourceSpan, Identifiers$1.listener, literal(outputAst.name), handler);
});
try {
// Generate element input bindings
for (var _e = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(element.inputs), _f = _e.next(); !_f.done; _f = _e.next()) {
var input = _f.value;
if (input.isAnimation) {
this.unsupported('animations');
}
var convertedBinding = this.convertPropertyBinding(implicit, input.value);
var instruction = BINDING_INSTRUCTION_MAP[input.type];
if (instruction) {
// TODO(chuckj): runtime: security context?
this.instruction(this._bindingMode, input.sourceSpan, instruction, literal(elementIndex), literal(input.name), convertedBinding);
}
else {
this.unsupported("binding " + PropertyBindingType[input.type]);
}
}
}
catch (e_5_1) { e_5 = { error: e_5_1 }; }
finally {
try {
if (_f && !_f.done && (_g = _e.return)) _g.call(_e);
}
finally { if (e_5) throw e_5.error; }
}
// Generate directives input bindings
this._visitDirectives(element.directives, implicit, elementIndex);
// Traverse element child nodes
if (this._inI18nSection && element.children.length == 1 &&
element.children[0] instanceof TextAst) {
var text = element.children[0];
this.visitSingleI18nTextChild(text, i18nMeta);
}
else {
templateVisitAll(this, element.children);
}
// Finish element construction mode.
this.instruction(this._creationMode, element.endSourceSpan || element.sourceSpan, Identifiers$1.elementEnd);
// Restore the state before exiting this node
this._inI18nSection = wasInI18nSection;
var e_4, _c, _d, e_5, _g;
};
TemplateDefinitionBuilder.prototype._visitDirectives = function (directives, implicit, nodeIndex) {
try {
for (var directives_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(directives), directives_1_1 = directives_1.next(); !directives_1_1.done; directives_1_1 = directives_1.next()) {
var directive = directives_1_1.value;
// Creation mode
// e.g. D(0, TodoComponentDef.n(), TodoComponentDef);
var directiveType = directive.directive.type.reference;
var kind = directive.directive.isComponent ? 2 /* Component */ : 1 /* Directive */;
try {
// Note: *do not cache* calls to this.directiveOf() as the constant pool needs to know if the
// node is referenced multiple times to know that it must generate the reference into a
// temporary.
// Bindings
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(directive.inputs), _b = _a.next(); !_b.done; _b = _a.next()) {
var input = _b.value;
var convertedBinding = this.convertPropertyBinding(implicit, input.value);
this.instruction(this._bindingMode, directive.sourceSpan, Identifiers$1.elementProperty, literal(nodeIndex), literal(input.templateName), importExpr(Identifiers$1.bind).callFn([convertedBinding]));
}
}
catch (e_6_1) { e_6 = { error: e_6_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_6) throw e_6.error; }
}
}
}
catch (e_7_1) { e_7 = { error: e_7_1 }; }
finally {
try {
if (directives_1_1 && !directives_1_1.done && (_d = directives_1.return)) _d.call(directives_1);
}
finally { if (e_7) throw e_7.error; }
}
var e_7, _d, e_6, _c;
};
// TemplateAstVisitor
TemplateDefinitionBuilder.prototype.visitEmbeddedTemplate = function (template) {
var _this = this;
var templateIndex = this.allocateDataSlot();
var templateRef = this.reflector.resolveExternalReference(Identifiers.TemplateRef);
var templateDirective = template.directives.find(function (directive) { return directive.directive.type.diDeps.some(function (dependency) {
return dependency.token != null && (tokenReference(dependency.token) == templateRef);
}); });
var contextName = this.contextName && templateDirective && templateDirective.directive.type.reference.name ?
this.contextName + "_" + templateDirective.directive.type.reference.name :
null;
var templateName = contextName ? contextName + "_Template_" + templateIndex : "Template_" + templateIndex;
var templateContext = "ctx" + this.level;
var parameters = [variable(templateName), literal(null, INFERRED_TYPE)];
var attributeNames = [];
template.directives.forEach(function (directiveAst) {
_this.directives.add(directiveAst.directive.type.reference);
CssSelector.parse(directiveAst.directive.selector).forEach(function (selector) {
selector.attrs.forEach(function (value) {
// Convert '' (falsy) strings into `null`. This is needed because we want
// to communicate to runtime that these attributes are present for
// selector matching, but should not actually be added to the DOM.
// attributeNames.push(o.literal(value ? value : null));
// TODO(misko): make the above comment true, for now just write to DOM because
// the runtime selectors have not been updated.
attributeNames.push(literal(value));
});
});
});
if (attributeNames.length) {
parameters.push(this.constantPool.getConstLiteral(literalArr(attributeNames), /* forcedShared */ true));
}
// e.g. C(1, C1Template)
this.instruction.apply(this, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([this._creationMode, template.sourceSpan, Identifiers$1.containerCreate, literal(templateIndex)], trimTrailingNulls(parameters)));
// Generate directives
this._visitDirectives(template.directives, variable(CONTEXT_NAME), templateIndex);
// Create the template function
var templateVisitor = new TemplateDefinitionBuilder(this.outputCtx, this.constantPool, this.reflector, templateContext, this.bindingScope, this.level + 1, this.ngContentSelectors, contextName, templateName, this.pipeMap, [], this.directives, this.pipes);
var templateFunctionExpr = templateVisitor.buildTemplateFunction(template.children, template.variables);
this._postfix.push(templateFunctionExpr.toDeclStmt(templateName, null));
};
// TemplateAstVisitor
TemplateDefinitionBuilder.prototype.visitBoundText = function (text) {
var nodeIndex = this.allocateDataSlot();
// Creation mode
this.instruction(this._creationMode, text.sourceSpan, Identifiers$1.text, literal(nodeIndex));
this.instruction(this._bindingMode, text.sourceSpan, Identifiers$1.textCreateBound, literal(nodeIndex), this.convertPropertyBinding(variable(CONTEXT_NAME), text.value));
};
// TemplateAstVisitor
TemplateDefinitionBuilder.prototype.visitText = function (text) {
// Text is defined in creation mode only.
this.instruction(this._creationMode, text.sourceSpan, Identifiers$1.text, literal(this.allocateDataSlot()), literal(text.value));
};
// When the content of the element is a single text node the translation can be inlined:
//
// `<p i18n="desc|mean">some content</p>`
// compiles to
// ```
// /**
// * @desc desc
// * @meaning mean
// */
// const MSG_XYZ = goog.getMsg('some content');
// i0.ɵT(1, MSG_XYZ);
// ```
TemplateDefinitionBuilder.prototype.visitSingleI18nTextChild = function (text, i18nMeta) {
var meta = parseI18nMeta(i18nMeta);
var variable$$1 = this.constantPool.getTranslation(text.value, meta);
this.instruction(this._creationMode, text.sourceSpan, Identifiers$1.text, literal(this.allocateDataSlot()), variable$$1);
};
TemplateDefinitionBuilder.prototype.allocateDataSlot = function () { return this._dataIndex++; };
TemplateDefinitionBuilder.prototype.bindingContext = function () { return "" + this._bindingContext++; };
TemplateDefinitionBuilder.prototype.instruction = function (statements, span, reference) {
var params = [];
for (var _i = 3; _i < arguments.length; _i++) {
params[_i - 3] = arguments[_i];
}
statements.push(importExpr(reference, null, span).callFn(params, span).toStmt());
};
TemplateDefinitionBuilder.prototype.definitionOf = function (type, kind) {
return this.constantPool.getDefinition(type, kind, this.outputCtx);
};
TemplateDefinitionBuilder.prototype.temp = function () {
if (!this._temporaryAllocated) {
this._prefix.push(new DeclareVarStmt(TEMPORARY_NAME, undefined, DYNAMIC_TYPE));
this._temporaryAllocated = true;
}
return variable(TEMPORARY_NAME);
};
TemplateDefinitionBuilder.prototype.convertPropertyBinding = function (implicit, value) {
var pipesConvertedValue = value.visit(this._valueConverter);
var convertedPropertyBinding = convertPropertyBinding(this, implicit, pipesConvertedValue, this.bindingContext(), BindingForm.TrySimple, interpolate);
(_a = this._bindingMode).push.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(convertedPropertyBinding.stmts));
return convertedPropertyBinding.currValExpr;
var _a;
};
return TemplateDefinitionBuilder;
}());
function getQueryPredicate(query, outputCtx) {
if (query.selectors.length > 1 || (query.selectors.length == 1 && query.selectors[0].value)) {
var selectors = query.selectors.map(function (value) { return value.value; });
selectors.some(function (value) { return !value; }) && error('Found a type among the string selectors expected');
return outputCtx.constantPool.getConstLiteral(literalArr(selectors.map(function (value) { return literal(value); })));
}
if (query.selectors.length == 1) {
var first = query.selectors[0];
if (first.identifier) {
return outputCtx.importExpr(first.identifier.reference);
}
}
error('Unexpected query form');
return NULL_EXPR;
}
function createFactory(type, outputCtx, reflector, queries) {
var args = [];
var elementRef = reflector.resolveExternalReference(Identifiers.ElementRef);
var templateRef = reflector.resolveExternalReference(Identifiers.TemplateRef);
var viewContainerRef = reflector.resolveExternalReference(Identifiers.ViewContainerRef);
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(type.diDeps), _b = _a.next(); !_b.done; _b = _a.next()) {
var dependency = _b.value;
var token = dependency.token;
if (token) {
var tokenRef = tokenReference(token);
if (tokenRef === elementRef) {
args.push(importExpr(Identifiers$1.injectElementRef).callFn([]));
}
else if (tokenRef === templateRef) {
args.push(importExpr(Identifiers$1.injectTemplateRef).callFn([]));
}
else if (tokenRef === viewContainerRef) {
args.push(importExpr(Identifiers$1.injectViewContainerRef).callFn([]));
}
else if (dependency.isAttribute) {
args.push(importExpr(Identifiers$1.injectAttribute).callFn([literal(dependency.token.value)]));
}
else {
var tokenValue = token.identifier != null ? outputCtx.importExpr(tokenRef) : literal(tokenRef);
var directiveInjectArgs = [tokenValue];
var flags = extractFlags(dependency);
if (flags != 0 /* Default */) {
// Append flag information if other than default.
directiveInjectArgs.push(literal(flags));
}
args.push(importExpr(Identifiers$1.directiveInject).callFn(directiveInjectArgs));
}
}
else {
unsupported('dependency without a token');
}
}
}
catch (e_8_1) { e_8 = { error: e_8_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_8) throw e_8.error; }
}
var queryDefinitions = [];
try {
for (var queries_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(queries), queries_1_1 = queries_1.next(); !queries_1_1.done; queries_1_1 = queries_1.next()) {
var query = queries_1_1.value;
var predicate = getQueryPredicate(query, outputCtx);
// e.g. r3.Q(null, somePredicate, false) or r3.Q(null, ['div'], false)
var parameters = [
/* memoryIndex */ literal(null, INFERRED_TYPE),
/* predicate */ predicate,
/* descend */ literal(query.descendants)
];
if (query.read) {
parameters.push(outputCtx.importExpr(query.read.identifier.reference));
}
queryDefinitions.push(importExpr(Identifiers$1.query).callFn(parameters));
}
}
catch (e_9_1) { e_9 = { error: e_9_1 }; }
finally {
try {
if (queries_1_1 && !queries_1_1.done && (_d = queries_1.return)) _d.call(queries_1);
}
finally { if (e_9) throw e_9.error; }
}
var createInstance = new InstantiateExpr(outputCtx.importExpr(type.reference), args);
var result = queryDefinitions.length > 0 ? literalArr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([createInstance], queryDefinitions)) :
createInstance;
return fn([], [new ReturnStatement(result)], INFERRED_TYPE, null, type.reference.name ? type.reference.name + "_Factory" : null);
var e_8, _c, e_9, _d;
}
function extractFlags(dependency) {
var flags = 0 /* Default */;
if (dependency.isHost) {
flags |= 1 /* Host */;
}
if (dependency.isOptional) {
flags |= 8 /* Optional */;
}
if (dependency.isSelf) {
flags |= 2 /* Self */;
}
if (dependency.isSkipSelf) {
flags |= 4 /* SkipSelf */;
}
if (dependency.isValue) {
unsupported('value dependencies');
}
return flags;
}
/**
* Remove trailing null nodes as they are implied.
*/
function trimTrailingNulls(parameters) {
while (isNull(parameters[parameters.length - 1])) {
parameters.pop();
}
return parameters;
}
// Turn a directive selector into an R3-compatible selector for directive def
function createDirectiveSelector(selector) {
return asLiteral(parseSelectorToR3Selector(selector));
}
function createHostAttributesArray(directiveMetadata, outputCtx) {
var values = [];
var attributes = directiveMetadata.hostAttributes;
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(Object.getOwnPropertyNames(attributes)), _b = _a.next(); !_b.done; _b = _a.next()) {
var key = _b.value;
var value = attributes[key];
values.push(literal(key), literal(value));
}
}
catch (e_10_1) { e_10 = { error: e_10_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_10) throw e_10.error; }
}
if (values.length > 0) {
return outputCtx.constantPool.getConstLiteral(literalArr(values));
}
return null;
var e_10, _c;
}
// Return a host binding function or null if one is not necessary.
function createHostBindingsFunction(directiveMetadata, outputCtx, bindingParser) {
var statements = [];
var temporary = function () {
var declared = false;
return function () {
if (!declared) {
statements.push(new DeclareVarStmt(TEMPORARY_NAME, undefined, DYNAMIC_TYPE));
declared = true;
}
return variable(TEMPORARY_NAME);
};
}();
var hostBindingSourceSpan = typeSourceSpan(directiveMetadata.isComponent ? 'Component' : 'Directive', directiveMetadata.type);
// Calculate the queries
for (var index = 0; index < directiveMetadata.queries.length; index++) {
var query = directiveMetadata.queries[index];
// e.g. r3.qR(tmp = r3.ld(dirIndex)[1]) && (r3.ld(dirIndex)[0].someDir = tmp);
var getDirectiveMemory = importExpr(Identifiers$1.load).callFn([variable('dirIndex')]);
// The query list is at the query index + 1 because the directive itself is in slot 0.
var getQueryList = getDirectiveMemory.key(literal(index + 1));
var assignToTemporary = temporary().set(getQueryList);
var callQueryRefresh = importExpr(Identifiers$1.queryRefresh).callFn([assignToTemporary]);
var updateDirective = getDirectiveMemory.key(literal(0, INFERRED_TYPE))
.prop(query.propertyName)
.set(query.first ? temporary().prop('first') : temporary());
var andExpression = callQueryRefresh.and(updateDirective);
statements.push(andExpression.toStmt());
}
var directiveSummary = directiveMetadata.toSummary();
// Calculate the host property bindings
var bindings = bindingParser.createBoundHostProperties(directiveSummary, hostBindingSourceSpan);
var bindingContext = importExpr(Identifiers$1.load).callFn([variable('dirIndex')]);
if (bindings) {
try {
for (var bindings_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(bindings), bindings_1_1 = bindings_1.next(); !bindings_1_1.done; bindings_1_1 = bindings_1.next()) {
var binding = bindings_1_1.value;
var bindingExpr = convertPropertyBinding(null, bindingContext, binding.expression, 'b', BindingForm.TrySimple, function () { return error('Unexpected interpolation'); });
statements.push.apply(statements, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(bindingExpr.stmts));
statements.push(importExpr(Identifiers$1.elementProperty)
.callFn([
variable('elIndex'), literal(binding.name),
importExpr(Identifiers$1.bind).callFn([bindingExpr.currValExpr])
])
.toStmt());
}
}
catch (e_11_1) { e_11 = { error: e_11_1 }; }
finally {
try {
if (bindings_1_1 && !bindings_1_1.done && (_a = bindings_1.return)) _a.call(bindings_1);
}
finally { if (e_11) throw e_11.error; }
}
}
// Calculate host event bindings
var eventBindings = bindingParser.createDirectiveHostEventAsts(directiveSummary, hostBindingSourceSpan);
if (eventBindings) {
try {
for (var eventBindings_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(eventBindings), eventBindings_1_1 = eventBindings_1.next(); !eventBindings_1_1.done; eventBindings_1_1 = eventBindings_1.next()) {
var binding = eventBindings_1_1.value;
var bindingExpr = convertActionBinding(null, bindingContext, binding.handler, 'b', function () { return error('Unexpected interpolation'); });
var bindingName = binding.name && sanitizeIdentifier(binding.name);
var typeName = identifierName(directiveMetadata.type);
var functionName = typeName && bindingName ? typeName + "_" + bindingName + "_HostBindingHandler" : null;
var handler = fn([new FnParam('$event', DYNAMIC_TYPE)], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(bindingExpr.stmts, [new ReturnStatement(bindingExpr.allowDefault)]), INFERRED_TYPE, null, functionName);
statements.push(importExpr(Identifiers$1.listener).callFn([literal(binding.name), handler]).toStmt());
}
}
catch (e_12_1) { e_12 = { error: e_12_1 }; }
finally {
try {
if (eventBindings_1_1 && !eventBindings_1_1.done && (_b = eventBindings_1.return)) _b.call(eventBindings_1);
}
finally { if (e_12) throw e_12.error; }
}
}
if (statements.length > 0) {
var typeName = directiveMetadata.type.reference.name;
return fn([new FnParam('dirIndex', NUMBER_TYPE), new FnParam('elIndex', NUMBER_TYPE)], statements, INFERRED_TYPE, null, typeName ? typeName + "_HostBindings" : null);
}
return null;
var e_11, _a, e_12, _b;
}
function conditionallyCreateMapObjectLiteral(keys, outputCtx) {
if (Object.getOwnPropertyNames(keys).length > 0) {
return mapToExpression(keys);
}
return null;
}
var ValueConverter = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ValueConverter, _super);
function ValueConverter(outputCtx, allocateSlot, definePipe) {
var _this = _super.call(this) || this;
_this.outputCtx = outputCtx;
_this.allocateSlot = allocateSlot;
_this.definePipe = definePipe;
_this.pipeSlots = new Map();
return _this;
}
// AstMemoryEfficientTransformer
ValueConverter.prototype.visitPipe = function (pipe, context) {
// Allocate a slot to create the pipe
var slot = this.allocateSlot();
var slotPseudoLocal = "PIPE:" + slot;
var target = new PropertyRead(pipe.span, new ImplicitReceiver(pipe.span), slotPseudoLocal);
var bindingId = pipeBinding(pipe.args);
this.definePipe(pipe.name, slotPseudoLocal, slot, importExpr(bindingId));
var value = pipe.exp.visit(this);
var args = this.visitAll(pipe.args);
return new FunctionCall(pipe.span, target, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([new LiteralPrimitive(pipe.span, slot), value], args));
};
ValueConverter.prototype.visitLiteralArray = function (array, context) {
var _this = this;
return new BuiltinFunctionCall(array.span, this.visitAll(array.expressions), function (values) {
// If the literal has calculated (non-literal) elements transform it into
// calls to literal factories that compose the literal and will cache intermediate
// values. Otherwise, just return an literal array that contains the values.
var literal$$1 = literalArr(values);
return values.every(function (a) { return a.isConstant(); }) ?
_this.outputCtx.constantPool.getConstLiteral(literal$$1, true) :
getLiteralFactory(_this.outputCtx, literal$$1);
});
};
ValueConverter.prototype.visitLiteralMap = function (map, context) {
var _this = this;
return new BuiltinFunctionCall(map.span, this.visitAll(map.values), function (values) {
// If the literal has calculated (non-literal) elements transform it into
// calls to literal factories that compose the literal and will cache intermediate
// values. Otherwise, just return an literal array that contains the values.
var literal$$1 = literalMap(values.map(function (value, index) { return ({ key: map.keys[index].key, value: value, quoted: map.keys[index].quoted }); }));
return values.every(function (a) { return a.isConstant(); }) ?
_this.outputCtx.constantPool.getConstLiteral(literal$$1, true) :
getLiteralFactory(_this.outputCtx, literal$$1);
});
};
return ValueConverter;
}(AstMemoryEfficientTransformer));
function invalid$1(arg) {
throw new Error("Invalid state: Visitor " + this.constructor.name + " doesn't handle " + undefined);
}
var ContentProjectionVisitor = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ContentProjectionVisitor, _super);
function ContentProjectionVisitor(projectionMap, ngContentSelectors) {
var _this = _super.call(this) || this;
_this.projectionMap = projectionMap;
_this.ngContentSelectors = ngContentSelectors;
_this.index = 1;
return _this;
}
ContentProjectionVisitor.prototype.visitNgContent = function (ngContent) {
var selector = this.ngContentSelectors[ngContent.index];
if (selector == null) {
error("could not find selector for index " + ngContent.index + " in " + ngContent);
}
if (!selector || selector === '*') {
this.projectionMap.set(ngContent, { index: 0 });
}
else {
this.projectionMap.set(ngContent, { index: this.index++, selector: selector });
}
};
return ContentProjectionVisitor;
}(RecursiveTemplateAstVisitor));
function getContentProjection(nodes, ngContentSelectors) {
var projectIndexMap = new Map();
var visitor = new ContentProjectionVisitor(projectIndexMap, ngContentSelectors);
templateVisitAll(visitor, nodes);
return projectIndexMap;
}
function parserSelectorToSimpleSelector(selector) {
var classes = selector.classNames && selector.classNames.length ? Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([8 /* CLASS */], selector.classNames) :
[];
var elementName = selector.element && selector.element !== '*' ? selector.element : '';
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([elementName], selector.attrs, classes);
}
function parserSelectorToNegativeSelector(selector) {
var classes = selector.classNames && selector.classNames.length ? Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([8 /* CLASS */], selector.classNames) :
[];
if (selector.element) {
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([
1 /* NOT */ | 4 /* ELEMENT */, selector.element
], selector.attrs, classes);
}
else if (selector.attrs.length) {
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([1 /* NOT */ | 2 /* ATTRIBUTE */], selector.attrs, classes);
}
else {
return selector.classNames && selector.classNames.length ? Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([1 /* NOT */ | 8 /* CLASS */], selector.classNames) :
[];
}
}
function parserSelectorToR3Selector(selector) {
var positive = parserSelectorToSimpleSelector(selector);
var negative = selector.notSelectors && selector.notSelectors.length ?
selector.notSelectors.map(function (notSelector) { return parserSelectorToNegativeSelector(notSelector); }) :
[];
return positive.concat.apply(positive, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(negative));
}
function parseSelectorToR3Selector(selector) {
var selectors = CssSelector.parse(selector);
return selectors.map(parserSelectorToR3Selector);
}
function asLiteral(value) {
if (Array.isArray(value)) {
return literalArr(value.map(asLiteral));
}
return literal(value, INFERRED_TYPE);
}
function mapToExpression(map, quoted) {
if (quoted === void 0) { quoted = false; }
return literalMap(Object.getOwnPropertyNames(map).map(function (key) { return ({ key: key, quoted: quoted, value: asLiteral(map[key]) }); }));
}
// Parse i18n metas like:
// - "@@id",
// - "description[@@id]",
// - "meaning|description[@@id]"
function parseI18nMeta(i18n) {
var meaning;
var description;
var id;
if (i18n) {
// TODO(vicb): figure out how to force a message ID with closure ?
var idIndex = i18n.indexOf(ID_SEPARATOR$1);
var descIndex = i18n.indexOf(MEANING_SEPARATOR$1);
var meaningAndDesc = void 0;
_a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])((idIndex > -1) ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, ''], 2), meaningAndDesc = _a[0], id = _a[1];
_b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])((descIndex > -1) ?
[meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] :
['', meaningAndDesc], 2), meaning = _b[0], description = _b[1];
}
return { description: description, id: id, meaning: meaning };
var _a, _b;
}
var _a;
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Write a pipe definition to the output context.
*/
function compilePipe(outputCtx, pipe, reflector, mode) {
var definitionMapValues = [];
// e.g. `name: 'myPipe'`
definitionMapValues.push({ key: 'name', value: literal(pipe.name), quoted: false });
// e.g. `type: MyPipe`
definitionMapValues.push({ key: 'type', value: outputCtx.importExpr(pipe.type.reference), quoted: false });
// e.g. factory: function MyPipe_Factory() { return new MyPipe(); },
var templateFactory = createFactory(pipe.type, outputCtx, reflector, []);
definitionMapValues.push({ key: 'factory', value: templateFactory, quoted: false });
// e.g. pure: true
if (pipe.pure) {
definitionMapValues.push({ key: 'pure', value: literal(true), quoted: false });
}
var className = identifierName(pipe.type);
className || error("Cannot resolve the name of " + pipe.type);
var definitionField = outputCtx.constantPool.propertyNameOf(3 /* Pipe */);
var definitionFunction = importExpr(Identifiers$1.definePipe).callFn([literalMap(definitionMapValues)]);
if (mode === 0 /* PartialClass */) {
outputCtx.statements.push(new ClassStmt(
/* name */ className,
/* parent */ null,
/* fields */ [new ClassField(
/* name */ definitionField,
/* type */ INFERRED_TYPE,
/* modifiers */ [StmtModifier.Static],
/* initializer */ definitionFunction)],
/* getters */ [],
/* constructorMethod */ new ClassMethod(null, [], []),
/* methods */ []));
}
else {
// Create back-patch definition.
var classReference = outputCtx.importExpr(pipe.type.reference);
// Create the back-patch statement
outputCtx.statements.push(new CommentStmt(BUILD_OPTIMIZER_COLOCATE), classReference.prop(definitionField).set(definitionFunction).toStmt());
}
}
/**
* @license
* Copyright Google Inc. 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 GeneratedFile = /** @class */ (function () {
function GeneratedFile(srcFileUrl, genFileUrl, sourceOrStmts) {
this.srcFileUrl = srcFileUrl;
this.genFileUrl = genFileUrl;
if (typeof sourceOrStmts === 'string') {
this.source = sourceOrStmts;
this.stmts = null;
}
else {
this.source = null;
this.stmts = sourceOrStmts;
}
}
GeneratedFile.prototype.isEquivalent = function (other) {
if (this.genFileUrl !== other.genFileUrl) {
return false;
}
if (this.source) {
return this.source === other.source;
}
if (other.stmts == null) {
return false;
}
// Note: the constructor guarantees that if this.source is not filled,
// then this.stmts is.
return areAllEquivalent(this.stmts, other.stmts);
};
return GeneratedFile;
}());
function toTypeScript(file, preamble) {
if (preamble === void 0) { preamble = ''; }
if (!file.stmts) {
throw new Error("Illegal state: No stmts present on GeneratedFile " + file.genFileUrl);
}
return new TypeScriptEmitter().emitStatements(file.genFileUrl, file.stmts, preamble);
}
/**
* @license
* Copyright Google Inc. 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
*/
function listLazyRoutes(moduleMeta, reflector) {
var allLazyRoutes = [];
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(moduleMeta.transitiveModule.providers), _b = _a.next(); !_b.done; _b = _a.next()) {
var _c = _b.value, provider = _c.provider, module = _c.module;
if (tokenReference(provider.token) === reflector.ROUTES) {
var loadChildren = _collectLoadChildren(provider.useValue);
try {
for (var loadChildren_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(loadChildren), loadChildren_1_1 = loadChildren_1.next(); !loadChildren_1_1.done; loadChildren_1_1 = loadChildren_1.next()) {
var route = loadChildren_1_1.value;
allLazyRoutes.push(parseLazyRoute(route, reflector, module.reference));
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (loadChildren_1_1 && !loadChildren_1_1.done && (_d = loadChildren_1.return)) _d.call(loadChildren_1);
}
finally { if (e_1) throw e_1.error; }
}
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
}
finally { if (e_2) throw e_2.error; }
}
return allLazyRoutes;
var e_2, _e, e_1, _d;
}
function _collectLoadChildren(routes, target) {
if (target === void 0) { target = []; }
if (typeof routes === 'string') {
target.push(routes);
}
else if (Array.isArray(routes)) {
try {
for (var routes_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(routes), routes_1_1 = routes_1.next(); !routes_1_1.done; routes_1_1 = routes_1.next()) {
var route = routes_1_1.value;
_collectLoadChildren(route, target);
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (routes_1_1 && !routes_1_1.done && (_a = routes_1.return)) _a.call(routes_1);
}
finally { if (e_3) throw e_3.error; }
}
}
else if (routes.loadChildren) {
_collectLoadChildren(routes.loadChildren, target);
}
else if (routes.children) {
_collectLoadChildren(routes.children, target);
}
return target;
var e_3, _a;
}
function parseLazyRoute(route, reflector, module) {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(route.split('#'), 2), routePath = _a[0], routeName = _a[1];
var referencedModule = reflector.resolveExternalReference({
moduleName: routePath,
name: routeName,
}, module ? module.filePath : undefined);
return { route: route, module: module || referencedModule, referencedModule: referencedModule };
}
/**
* @license
* Copyright Google Inc. 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 TS = /^(?!.*\.d\.ts$).*\.ts$/;
var ResolvedStaticSymbol = /** @class */ (function () {
function ResolvedStaticSymbol(symbol, metadata) {
this.symbol = symbol;
this.metadata = metadata;
}
return ResolvedStaticSymbol;
}());
var SUPPORTED_SCHEMA_VERSION = 4;
/**
* This class is responsible for loading metadata per symbol,
* and normalizing references between symbols.
*
* Internally, it only uses symbols without members,
* and deduces the values for symbols with members based
* on these symbols.
*/
var StaticSymbolResolver = /** @class */ (function () {
function StaticSymbolResolver(host, staticSymbolCache, summaryResolver, errorRecorder) {
this.host = host;
this.staticSymbolCache = staticSymbolCache;
this.summaryResolver = summaryResolver;
this.errorRecorder = errorRecorder;
this.metadataCache = new Map();
// Note: this will only contain StaticSymbols without members!
this.resolvedSymbols = new Map();
this.resolvedFilePaths = new Set();
// Note: this will only contain StaticSymbols without members!
this.importAs = new Map();
this.symbolResourcePaths = new Map();
this.symbolFromFile = new Map();
this.knownFileNameToModuleNames = new Map();
}
StaticSymbolResolver.prototype.resolveSymbol = function (staticSymbol) {
if (staticSymbol.members.length > 0) {
return this._resolveSymbolMembers(staticSymbol);
}
// Note: always ask for a summary first,
// as we might have read shallow metadata via a .d.ts file
// for the symbol.
var resultFromSummary = this._resolveSymbolFromSummary(staticSymbol);
if (resultFromSummary) {
return resultFromSummary;
}
var resultFromCache = this.resolvedSymbols.get(staticSymbol);
if (resultFromCache) {
return resultFromCache;
}
// Note: Some users use libraries that were not compiled with ngc, i.e. they don't
// have summaries, only .d.ts files. So we always need to check both, the summary
// and metadata.
this._createSymbolsOf(staticSymbol.filePath);
return this.resolvedSymbols.get(staticSymbol);
};
/**
* getImportAs produces a symbol that can be used to import the given symbol.
* The import might be different than the symbol if the symbol is exported from
* a library with a summary; in which case we want to import the symbol from the
* ngfactory re-export instead of directly to avoid introducing a direct dependency
* on an otherwise indirect dependency.
*
* @param staticSymbol the symbol for which to generate a import symbol
*/
StaticSymbolResolver.prototype.getImportAs = function (staticSymbol, useSummaries) {
if (useSummaries === void 0) { useSummaries = true; }
if (staticSymbol.members.length) {
var baseSymbol = this.getStaticSymbol(staticSymbol.filePath, staticSymbol.name);
var baseImportAs = this.getImportAs(baseSymbol, useSummaries);
return baseImportAs ?
this.getStaticSymbol(baseImportAs.filePath, baseImportAs.name, staticSymbol.members) :
null;
}
var summarizedFileName = stripSummaryForJitFileSuffix(staticSymbol.filePath);
if (summarizedFileName !== staticSymbol.filePath) {
var summarizedName = stripSummaryForJitNameSuffix(staticSymbol.name);
var baseSymbol = this.getStaticSymbol(summarizedFileName, summarizedName, staticSymbol.members);
var baseImportAs = this.getImportAs(baseSymbol, useSummaries);
return baseImportAs ?
this.getStaticSymbol(summaryForJitFileName(baseImportAs.filePath), summaryForJitName(baseImportAs.name), baseSymbol.members) :
null;
}
var result = (useSummaries && this.summaryResolver.getImportAs(staticSymbol)) || null;
if (!result) {
result = this.importAs.get(staticSymbol);
}
return result;
};
/**
* getResourcePath produces the path to the original location of the symbol and should
* be used to determine the relative location of resource references recorded in
* symbol metadata.
*/
StaticSymbolResolver.prototype.getResourcePath = function (staticSymbol) {
return this.symbolResourcePaths.get(staticSymbol) || staticSymbol.filePath;
};
/**
* getTypeArity returns the number of generic type parameters the given symbol
* has. If the symbol is not a type the result is null.
*/
StaticSymbolResolver.prototype.getTypeArity = function (staticSymbol) {
// If the file is a factory/ngsummary file, don't resolve the symbol as doing so would
// cause the metadata for an factory/ngsummary file to be loaded which doesn't exist.
// All references to generated classes must include the correct arity whenever
// generating code.
if (isGeneratedFile(staticSymbol.filePath)) {
return null;
}
var resolvedSymbol = unwrapResolvedMetadata(this.resolveSymbol(staticSymbol));
while (resolvedSymbol && resolvedSymbol.metadata instanceof StaticSymbol) {
resolvedSymbol = unwrapResolvedMetadata(this.resolveSymbol(resolvedSymbol.metadata));
}
return (resolvedSymbol && resolvedSymbol.metadata && resolvedSymbol.metadata.arity) || null;
};
StaticSymbolResolver.prototype.getKnownModuleName = function (filePath) {
return this.knownFileNameToModuleNames.get(filePath) || null;
};
StaticSymbolResolver.prototype.recordImportAs = function (sourceSymbol, targetSymbol) {
sourceSymbol.assertNoMembers();
targetSymbol.assertNoMembers();
this.importAs.set(sourceSymbol, targetSymbol);
};
StaticSymbolResolver.prototype.recordModuleNameForFileName = function (fileName, moduleName) {
this.knownFileNameToModuleNames.set(fileName, moduleName);
};
/**
* Invalidate all information derived from the given file.
*
* @param fileName the file to invalidate
*/
StaticSymbolResolver.prototype.invalidateFile = function (fileName) {
this.metadataCache.delete(fileName);
this.resolvedFilePaths.delete(fileName);
var symbols = this.symbolFromFile.get(fileName);
if (symbols) {
this.symbolFromFile.delete(fileName);
try {
for (var symbols_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(symbols), symbols_1_1 = symbols_1.next(); !symbols_1_1.done; symbols_1_1 = symbols_1.next()) {
var symbol = symbols_1_1.value;
this.resolvedSymbols.delete(symbol);
this.importAs.delete(symbol);
this.symbolResourcePaths.delete(symbol);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (symbols_1_1 && !symbols_1_1.done && (_a = symbols_1.return)) _a.call(symbols_1);
}
finally { if (e_1) throw e_1.error; }
}
}
var e_1, _a;
};
/* @internal */
StaticSymbolResolver.prototype.ignoreErrorsFor = function (cb) {
var recorder = this.errorRecorder;
this.errorRecorder = function () { };
try {
return cb();
}
finally {
this.errorRecorder = recorder;
}
};
StaticSymbolResolver.prototype._resolveSymbolMembers = function (staticSymbol) {
var members = staticSymbol.members;
var baseResolvedSymbol = this.resolveSymbol(this.getStaticSymbol(staticSymbol.filePath, staticSymbol.name));
if (!baseResolvedSymbol) {
return null;
}
var baseMetadata = unwrapResolvedMetadata(baseResolvedSymbol.metadata);
if (baseMetadata instanceof StaticSymbol) {
return new ResolvedStaticSymbol(staticSymbol, this.getStaticSymbol(baseMetadata.filePath, baseMetadata.name, members));
}
else if (baseMetadata && baseMetadata.__symbolic === 'class') {
if (baseMetadata.statics && members.length === 1) {
return new ResolvedStaticSymbol(staticSymbol, baseMetadata.statics[members[0]]);
}
}
else {
var value = baseMetadata;
for (var i = 0; i < members.length && value; i++) {
value = value[members[i]];
}
return new ResolvedStaticSymbol(staticSymbol, value);
}
return null;
};
StaticSymbolResolver.prototype._resolveSymbolFromSummary = function (staticSymbol) {
var summary = this.summaryResolver.resolveSummary(staticSymbol);
return summary ? new ResolvedStaticSymbol(staticSymbol, summary.metadata) : null;
};
/**
* getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
* All types passed to the StaticResolver should be pseudo-types returned by this method.
*
* @param declarationFile the absolute path of the file where the symbol is declared
* @param name the name of the type.
* @param members a symbol for a static member of the named type
*/
StaticSymbolResolver.prototype.getStaticSymbol = function (declarationFile, name, members) {
return this.staticSymbolCache.get(declarationFile, name, members);
};
/**
* hasDecorators checks a file's metadata for the presence of decorators without evaluating the
* metadata.
*
* @param filePath the absolute path to examine for decorators.
* @returns true if any class in the file has a decorator.
*/
StaticSymbolResolver.prototype.hasDecorators = function (filePath) {
var metadata = this.getModuleMetadata(filePath);
if (metadata['metadata']) {
return Object.keys(metadata['metadata']).some(function (metadataKey) {
var entry = metadata['metadata'][metadataKey];
return entry && entry.__symbolic === 'class' && entry.decorators;
});
}
return false;
};
StaticSymbolResolver.prototype.getSymbolsOf = function (filePath) {
var summarySymbols = this.summaryResolver.getSymbolsOf(filePath);
if (summarySymbols) {
return summarySymbols;
}
// Note: Some users use libraries that were not compiled with ngc, i.e. they don't
// have summaries, only .d.ts files, but `summaryResolver.isLibraryFile` returns true.
this._createSymbolsOf(filePath);
var metadataSymbols = [];
this.resolvedSymbols.forEach(function (resolvedSymbol) {
if (resolvedSymbol.symbol.filePath === filePath) {
metadataSymbols.push(resolvedSymbol.symbol);
}
});
return metadataSymbols;
};
StaticSymbolResolver.prototype._createSymbolsOf = function (filePath) {
var _this = this;
if (this.resolvedFilePaths.has(filePath)) {
return;
}
this.resolvedFilePaths.add(filePath);
var resolvedSymbols = [];
var metadata = this.getModuleMetadata(filePath);
if (metadata['importAs']) {
// Index bundle indices should use the importAs module name defined
// in the bundle.
this.knownFileNameToModuleNames.set(filePath, metadata['importAs']);
}
// handle the symbols in one of the re-export location
if (metadata['exports']) {
var _loop_1 = function (moduleExport) {
// handle the symbols in the list of explicitly re-exported symbols.
if (moduleExport.export) {
moduleExport.export.forEach(function (exportSymbol) {
var symbolName;
if (typeof exportSymbol === 'string') {
symbolName = exportSymbol;
}
else {
symbolName = exportSymbol.as;
}
symbolName = unescapeIdentifier(symbolName);
var symName = symbolName;
if (typeof exportSymbol !== 'string') {
symName = unescapeIdentifier(exportSymbol.name);
}
var resolvedModule = _this.resolveModule(moduleExport.from, filePath);
if (resolvedModule) {
var targetSymbol = _this.getStaticSymbol(resolvedModule, symName);
var sourceSymbol = _this.getStaticSymbol(filePath, symbolName);
resolvedSymbols.push(_this.createExport(sourceSymbol, targetSymbol));
}
});
}
else {
// handle the symbols via export * directives.
var resolvedModule = this_1.resolveModule(moduleExport.from, filePath);
if (resolvedModule) {
var nestedExports = this_1.getSymbolsOf(resolvedModule);
nestedExports.forEach(function (targetSymbol) {
var sourceSymbol = _this.getStaticSymbol(filePath, targetSymbol.name);
resolvedSymbols.push(_this.createExport(sourceSymbol, targetSymbol));
});
}
}
};
var this_1 = this;
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(metadata['exports']), _b = _a.next(); !_b.done; _b = _a.next()) {
var moduleExport = _b.value;
_loop_1(moduleExport);
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_2) throw e_2.error; }
}
}
// handle the actual metadata. Has to be after the exports
// as there might be collisions in the names, and we want the symbols
// of the current module to win ofter reexports.
if (metadata['metadata']) {
// handle direct declarations of the symbol
var topLevelSymbolNames_1 = new Set(Object.keys(metadata['metadata']).map(unescapeIdentifier));
var origins_1 = metadata['origins'] || {};
Object.keys(metadata['metadata']).forEach(function (metadataKey) {
var symbolMeta = metadata['metadata'][metadataKey];
var name = unescapeIdentifier(metadataKey);
var symbol = _this.getStaticSymbol(filePath, name);
var origin = origins_1.hasOwnProperty(metadataKey) && origins_1[metadataKey];
if (origin) {
// If the symbol is from a bundled index, use the declaration location of the
// symbol so relative references (such as './my.html') will be calculated
// correctly.
var originFilePath = _this.resolveModule(origin, filePath);
if (!originFilePath) {
_this.reportError(new Error("Couldn't resolve original symbol for " + origin + " from " + filePath));
}
else {
_this.symbolResourcePaths.set(symbol, originFilePath);
}
}
resolvedSymbols.push(_this.createResolvedSymbol(symbol, filePath, topLevelSymbolNames_1, symbolMeta));
});
}
resolvedSymbols.forEach(function (resolvedSymbol) { return _this.resolvedSymbols.set(resolvedSymbol.symbol, resolvedSymbol); });
this.symbolFromFile.set(filePath, resolvedSymbols.map(function (resolvedSymbol) { return resolvedSymbol.symbol; }));
var e_2, _c;
};
StaticSymbolResolver.prototype.createResolvedSymbol = function (sourceSymbol, topLevelPath, topLevelSymbolNames, metadata) {
var _this = this;
// For classes that don't have Angular summaries / metadata,
// we only keep their arity, but nothing else
// (e.g. their constructor parameters).
// We do this to prevent introducing deep imports
// as we didn't generate .ngfactory.ts files with proper reexports.
var isTsFile = TS.test(sourceSymbol.filePath);
if (this.summaryResolver.isLibraryFile(sourceSymbol.filePath) && !isTsFile && metadata &&
metadata['__symbolic'] === 'class') {
var transformedMeta_1 = { __symbolic: 'class', arity: metadata.arity };
return new ResolvedStaticSymbol(sourceSymbol, transformedMeta_1);
}
var _originalFileMemo;
var getOriginalName = function () {
if (!_originalFileMemo) {
// Guess what the original file name is from the reference. If it has a `.d.ts` extension
// replace it with `.ts`. If it already has `.ts` just leave it in place. If it doesn't have
// .ts or .d.ts, append `.ts'. Also, if it is in `node_modules`, trim the `node_module`
// location as it is not important to finding the file.
_originalFileMemo =
_this.host.getOutputName(topLevelPath.replace(/((\.ts)|(\.d\.ts)|)$/, '.ts')
.replace(/^.*node_modules[/\\]/, ''));
}
return _originalFileMemo;
};
var self = this;
var ReferenceTransformer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ReferenceTransformer, _super);
function ReferenceTransformer() {
return _super !== null && _super.apply(this, arguments) || this;
}
ReferenceTransformer.prototype.visitStringMap = function (map, functionParams) {
var symbolic = map['__symbolic'];
if (symbolic === 'function') {
var oldLen = functionParams.length;
functionParams.push.apply(functionParams, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((map['parameters'] || [])));
var result = _super.prototype.visitStringMap.call(this, map, functionParams);
functionParams.length = oldLen;
return result;
}
else if (symbolic === 'reference') {
var module = map['module'];
var name_1 = map['name'] ? unescapeIdentifier(map['name']) : map['name'];
if (!name_1) {
return null;
}
var filePath = void 0;
if (module) {
filePath = self.resolveModule(module, sourceSymbol.filePath);
if (!filePath) {
return {
__symbolic: 'error',
message: "Could not resolve " + module + " relative to " + sourceSymbol.filePath + ".",
line: map.line,
character: map.character,
fileName: getOriginalName()
};
}
return {
__symbolic: 'resolved',
symbol: self.getStaticSymbol(filePath, name_1),
line: map.line,
character: map.character,
fileName: getOriginalName()
};
}
else if (functionParams.indexOf(name_1) >= 0) {
// reference to a function parameter
return { __symbolic: 'reference', name: name_1 };
}
else {
if (topLevelSymbolNames.has(name_1)) {
return self.getStaticSymbol(topLevelPath, name_1);
}
}
}
else if (symbolic === 'error') {
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, map, { fileName: getOriginalName() });
}
else {
return _super.prototype.visitStringMap.call(this, map, functionParams);
}
};
return ReferenceTransformer;
}(ValueTransformer));
var transformedMeta = visitValue(metadata, new ReferenceTransformer(), []);
var unwrappedTransformedMeta = unwrapResolvedMetadata(transformedMeta);
if (unwrappedTransformedMeta instanceof StaticSymbol) {
return this.createExport(sourceSymbol, unwrappedTransformedMeta);
}
return new ResolvedStaticSymbol(sourceSymbol, transformedMeta);
};
StaticSymbolResolver.prototype.createExport = function (sourceSymbol, targetSymbol) {
sourceSymbol.assertNoMembers();
targetSymbol.assertNoMembers();
if (this.summaryResolver.isLibraryFile(sourceSymbol.filePath) &&
this.summaryResolver.isLibraryFile(targetSymbol.filePath)) {
// This case is for an ng library importing symbols from a plain ts library
// transitively.
// Note: We rely on the fact that we discover symbols in the direction
// from source files to library files
this.importAs.set(targetSymbol, this.getImportAs(sourceSymbol) || sourceSymbol);
}
return new ResolvedStaticSymbol(sourceSymbol, targetSymbol);
};
StaticSymbolResolver.prototype.reportError = function (error$$1, context, path) {
if (this.errorRecorder) {
this.errorRecorder(error$$1, (context && context.filePath) || path);
}
else {
throw error$$1;
}
};
/**
* @param module an absolute path to a module file.
*/
StaticSymbolResolver.prototype.getModuleMetadata = function (module) {
var moduleMetadata = this.metadataCache.get(module);
if (!moduleMetadata) {
var moduleMetadatas = this.host.getMetadataFor(module);
if (moduleMetadatas) {
var maxVersion_1 = -1;
moduleMetadatas.forEach(function (md) {
if (md && md['version'] > maxVersion_1) {
maxVersion_1 = md['version'];
moduleMetadata = md;
}
});
}
if (!moduleMetadata) {
moduleMetadata =
{ __symbolic: 'module', version: SUPPORTED_SCHEMA_VERSION, module: module, metadata: {} };
}
if (moduleMetadata['version'] != SUPPORTED_SCHEMA_VERSION) {
var errorMessage = moduleMetadata['version'] == 2 ?
"Unsupported metadata version " + moduleMetadata['version'] + " for module " + module + ". This module should be compiled with a newer version of ngc" :
"Metadata version mismatch for module " + module + ", found version " + moduleMetadata['version'] + ", expected " + SUPPORTED_SCHEMA_VERSION;
this.reportError(new Error(errorMessage));
}
this.metadataCache.set(module, moduleMetadata);
}
return moduleMetadata;
};
StaticSymbolResolver.prototype.getSymbolByModule = function (module, symbolName, containingFile) {
var filePath = this.resolveModule(module, containingFile);
if (!filePath) {
this.reportError(new Error("Could not resolve module " + module + (containingFile ? ' relative to ' +
containingFile : '')));
return this.getStaticSymbol("ERROR:" + module, symbolName);
}
return this.getStaticSymbol(filePath, symbolName);
};
StaticSymbolResolver.prototype.resolveModule = function (module, containingFile) {
try {
return this.host.moduleNameToFileName(module, containingFile);
}
catch (e) {
console.error("Could not resolve module '" + module + "' relative to file " + containingFile);
this.reportError(e, undefined, containingFile);
}
return null;
};
return StaticSymbolResolver;
}());
// Remove extra underscore from escaped identifier.
// See https://github.com/Microsoft/TypeScript/blob/master/src/compiler/utilities.ts
function unescapeIdentifier(identifier) {
return identifier.startsWith('___') ? identifier.substr(1) : identifier;
}
function unwrapResolvedMetadata(metadata) {
if (metadata && metadata.__symbolic === 'resolved') {
return metadata.symbol;
}
return metadata;
}
function serializeSummaries(srcFileName, forJitCtx, summaryResolver, symbolResolver, symbols, types) {
var toJsonSerializer = new ToJsonSerializer(symbolResolver, summaryResolver, srcFileName);
// for symbols, we use everything except for the class metadata itself
// (we keep the statics though), as the class metadata is contained in the
// CompileTypeSummary.
symbols.forEach(function (resolvedSymbol) { return toJsonSerializer.addSummary({ symbol: resolvedSymbol.symbol, metadata: resolvedSymbol.metadata }); });
// Add type summaries.
types.forEach(function (_a) {
var summary = _a.summary, metadata = _a.metadata;
toJsonSerializer.addSummary({ symbol: summary.type.reference, metadata: undefined, type: summary });
});
var _a = toJsonSerializer.serialize(), json = _a.json, exportAs = _a.exportAs;
if (forJitCtx) {
var forJitSerializer_1 = new ForJitSerializer(forJitCtx, symbolResolver, summaryResolver);
types.forEach(function (_a) {
var summary = _a.summary, metadata = _a.metadata;
forJitSerializer_1.addSourceType(summary, metadata);
});
toJsonSerializer.unprocessedSymbolSummariesBySymbol.forEach(function (summary) {
if (summaryResolver.isLibraryFile(summary.symbol.filePath) && summary.type) {
forJitSerializer_1.addLibType(summary.type);
}
});
forJitSerializer_1.serialize(exportAs);
}
return { json: json, exportAs: exportAs };
}
function deserializeSummaries(symbolCache, summaryResolver, libraryFileName, json) {
var deserializer = new FromJsonDeserializer(symbolCache, summaryResolver);
return deserializer.deserialize(libraryFileName, json);
}
function createForJitStub(outputCtx, reference) {
return createSummaryForJitFunction(outputCtx, reference, NULL_EXPR);
}
function createSummaryForJitFunction(outputCtx, reference, value) {
var fnName = summaryForJitName(reference.name);
outputCtx.statements.push(fn([], [new ReturnStatement(value)], new ArrayType(DYNAMIC_TYPE)).toDeclStmt(fnName, [
StmtModifier.Final, StmtModifier.Exported
]));
}
var ToJsonSerializer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ToJsonSerializer, _super);
function ToJsonSerializer(symbolResolver, summaryResolver, srcFileName) {
var _this = _super.call(this) || this;
_this.symbolResolver = symbolResolver;
_this.summaryResolver = summaryResolver;
_this.srcFileName = srcFileName;
// Note: This only contains symbols without members.
_this.symbols = [];
_this.indexBySymbol = new Map();
_this.reexportedBy = new Map();
// This now contains a `__symbol: number` in the place of
// StaticSymbols, but otherwise has the same shape as the original objects.
_this.processedSummaryBySymbol = new Map();
_this.processedSummaries = [];
_this.unprocessedSymbolSummariesBySymbol = new Map();
_this.moduleName = symbolResolver.getKnownModuleName(srcFileName);
return _this;
}
ToJsonSerializer.prototype.addSummary = function (summary) {
var _this = this;
var unprocessedSummary = this.unprocessedSymbolSummariesBySymbol.get(summary.symbol);
var processedSummary = this.processedSummaryBySymbol.get(summary.symbol);
if (!unprocessedSummary) {
unprocessedSummary = { symbol: summary.symbol, metadata: undefined };
this.unprocessedSymbolSummariesBySymbol.set(summary.symbol, unprocessedSummary);
processedSummary = { symbol: this.processValue(summary.symbol, 0 /* None */) };
this.processedSummaries.push(processedSummary);
this.processedSummaryBySymbol.set(summary.symbol, processedSummary);
}
if (!unprocessedSummary.metadata && summary.metadata) {
var metadata_1 = summary.metadata || {};
if (metadata_1.__symbolic === 'class') {
// For classes, we keep everything except their class decorators.
// We need to keep e.g. the ctor args, method names, method decorators
// so that the class can be extended in another compilation unit.
// We don't keep the class decorators as
// 1) they refer to data
// that should not cause a rebuild of downstream compilation units
// (e.g. inline templates of @Component, or @NgModule.declarations)
// 2) their data is already captured in TypeSummaries, e.g. DirectiveSummary.
var clone_1 = {};
Object.keys(metadata_1).forEach(function (propName) {
if (propName !== 'decorators') {
clone_1[propName] = metadata_1[propName];
}
});
metadata_1 = clone_1;
}
else if (isCall(metadata_1)) {
if (!isFunctionCall(metadata_1) && !isMethodCallOnVariable(metadata_1)) {
// Don't store complex calls as we won't be able to simplify them anyways later on.
metadata_1 = {
__symbolic: 'error',
message: 'Complex function calls are not supported.',
};
}
}
// Note: We need to keep storing ctor calls for e.g.
// `export const x = new InjectionToken(...)`
unprocessedSummary.metadata = metadata_1;
processedSummary.metadata = this.processValue(metadata_1, 1 /* ResolveValue */);
if (metadata_1 instanceof StaticSymbol &&
this.summaryResolver.isLibraryFile(metadata_1.filePath)) {
var declarationSymbol = this.symbols[this.indexBySymbol.get(metadata_1)];
if (!isLoweredSymbol(declarationSymbol.name)) {
// Note: symbols that were introduced during codegen in the user file can have a reexport
// if a user used `export *`. However, we can't rely on this as tsickle will change
// `export *` into named exports, using only the information from the typechecker.
// As we introduce the new symbols after typecheck, Tsickle does not know about them,
// and omits them when expanding `export *`.
// So we have to keep reexporting these symbols manually via .ngfactory files.
this.reexportedBy.set(declarationSymbol, summary.symbol);
}
}
}
if (!unprocessedSummary.type && summary.type) {
unprocessedSummary.type = summary.type;
// Note: We don't add the summaries of all referenced symbols as for the ResolvedSymbols,
// as the type summaries already contain the transitive data that they require
// (in a minimal way).
processedSummary.type = this.processValue(summary.type, 0 /* None */);
// except for reexported directives / pipes, so we need to store
// their summaries explicitly.
if (summary.type.summaryKind === CompileSummaryKind.NgModule) {
var ngModuleSummary = summary.type;
ngModuleSummary.exportedDirectives.concat(ngModuleSummary.exportedPipes).forEach(function (id) {
var symbol = id.reference;
if (_this.summaryResolver.isLibraryFile(symbol.filePath) &&
!_this.unprocessedSymbolSummariesBySymbol.has(symbol)) {
var summary_1 = _this.summaryResolver.resolveSummary(symbol);
if (summary_1) {
_this.addSummary(summary_1);
}
}
});
}
}
};
ToJsonSerializer.prototype.serialize = function () {
var _this = this;
var exportAs = [];
var json = JSON.stringify({
moduleName: this.moduleName,
summaries: this.processedSummaries,
symbols: this.symbols.map(function (symbol, index) {
symbol.assertNoMembers();
var importAs = undefined;
if (_this.summaryResolver.isLibraryFile(symbol.filePath)) {
var reexportSymbol = _this.reexportedBy.get(symbol);
if (reexportSymbol) {
importAs = _this.indexBySymbol.get(reexportSymbol);
}
else {
var summary = _this.unprocessedSymbolSummariesBySymbol.get(symbol);
if (!summary || !summary.metadata || summary.metadata.__symbolic !== 'interface') {
importAs = symbol.name + "_" + index;
exportAs.push({ symbol: symbol, exportAs: importAs });
}
}
}
return {
__symbol: index,
name: symbol.name,
filePath: _this.summaryResolver.toSummaryFileName(symbol.filePath, _this.srcFileName),
importAs: importAs
};
})
});
return { json: json, exportAs: exportAs };
};
ToJsonSerializer.prototype.processValue = function (value, flags) {
return visitValue(value, this, flags);
};
ToJsonSerializer.prototype.visitOther = function (value, context) {
if (value instanceof StaticSymbol) {
var baseSymbol = this.symbolResolver.getStaticSymbol(value.filePath, value.name);
var index = this.visitStaticSymbol(baseSymbol, context);
return { __symbol: index, members: value.members };
}
};
/**
* Strip line and character numbers from ngsummaries.
* Emitting them causes white spaces changes to retrigger upstream
* recompilations in bazel.
* TODO: find out a way to have line and character numbers in errors without
* excessive recompilation in bazel.
*/
ToJsonSerializer.prototype.visitStringMap = function (map, context) {
if (map['__symbolic'] === 'resolved') {
return visitValue(map.symbol, this, context);
}
if (map['__symbolic'] === 'error') {
delete map['line'];
delete map['character'];
}
return _super.prototype.visitStringMap.call(this, map, context);
};
/**
* Returns null if the options.resolveValue is true, and the summary for the symbol
* resolved to a type or could not be resolved.
*/
ToJsonSerializer.prototype.visitStaticSymbol = function (baseSymbol, flags) {
var index = this.indexBySymbol.get(baseSymbol);
var summary = null;
if (flags & 1 /* ResolveValue */ &&
this.summaryResolver.isLibraryFile(baseSymbol.filePath)) {
if (this.unprocessedSymbolSummariesBySymbol.has(baseSymbol)) {
// the summary for this symbol was already added
// -> nothing to do.
return index;
}
summary = this.loadSummary(baseSymbol);
if (summary && summary.metadata instanceof StaticSymbol) {
// The summary is a reexport
index = this.visitStaticSymbol(summary.metadata, flags);
// reset the summary as it is just a reexport, so we don't want to store it.
summary = null;
}
}
else if (index != null) {
// Note: == on purpose to compare with undefined!
// No summary and the symbol is already added -> nothing to do.
return index;
}
// Note: == on purpose to compare with undefined!
if (index == null) {
index = this.symbols.length;
this.symbols.push(baseSymbol);
}
this.indexBySymbol.set(baseSymbol, index);
if (summary) {
this.addSummary(summary);
}
return index;
};
ToJsonSerializer.prototype.loadSummary = function (symbol) {
var summary = this.summaryResolver.resolveSummary(symbol);
if (!summary) {
// some symbols might originate from a plain typescript library
// that just exported .d.ts and .metadata.json files, i.e. where no summary
// files were created.
var resolvedSymbol = this.symbolResolver.resolveSymbol(symbol);
if (resolvedSymbol) {
summary = { symbol: resolvedSymbol.symbol, metadata: resolvedSymbol.metadata };
}
}
return summary;
};
return ToJsonSerializer;
}(ValueTransformer));
var ForJitSerializer = /** @class */ (function () {
function ForJitSerializer(outputCtx, symbolResolver, summaryResolver) {
this.outputCtx = outputCtx;
this.symbolResolver = symbolResolver;
this.summaryResolver = summaryResolver;
this.data = [];
}
ForJitSerializer.prototype.addSourceType = function (summary, metadata) {
this.data.push({ summary: summary, metadata: metadata, isLibrary: false });
};
ForJitSerializer.prototype.addLibType = function (summary) {
this.data.push({ summary: summary, metadata: null, isLibrary: true });
};
ForJitSerializer.prototype.serialize = function (exportAsArr) {
var _this = this;
var exportAsBySymbol = new Map();
try {
for (var exportAsArr_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(exportAsArr), exportAsArr_1_1 = exportAsArr_1.next(); !exportAsArr_1_1.done; exportAsArr_1_1 = exportAsArr_1.next()) {
var _a = exportAsArr_1_1.value, symbol = _a.symbol, exportAs = _a.exportAs;
exportAsBySymbol.set(symbol, exportAs);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (exportAsArr_1_1 && !exportAsArr_1_1.done && (_b = exportAsArr_1.return)) _b.call(exportAsArr_1);
}
finally { if (e_1) throw e_1.error; }
}
var ngModuleSymbols = new Set();
try {
for (var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(this.data), _d = _c.next(); !_d.done; _d = _c.next()) {
var _e = _d.value, summary = _e.summary, metadata = _e.metadata, isLibrary = _e.isLibrary;
if (summary.summaryKind === CompileSummaryKind.NgModule) {
// collect the symbols that refer to NgModule classes.
// Note: we can't just rely on `summary.type.summaryKind` to determine this as
// we don't add the summaries of all referenced symbols when we serialize type summaries.
// See serializeSummaries for details.
ngModuleSymbols.add(summary.type.reference);
var modSummary = summary;
try {
for (var _f = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(modSummary.modules), _g = _f.next(); !_g.done; _g = _f.next()) {
var mod = _g.value;
ngModuleSymbols.add(mod.reference);
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_g && !_g.done && (_h = _f.return)) _h.call(_f);
}
finally { if (e_2) throw e_2.error; }
}
}
if (!isLibrary) {
var fnName = summaryForJitName(summary.type.reference.name);
createSummaryForJitFunction(this.outputCtx, summary.type.reference, this.serializeSummaryWithDeps(summary, metadata));
}
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_d && !_d.done && (_j = _c.return)) _j.call(_c);
}
finally { if (e_3) throw e_3.error; }
}
ngModuleSymbols.forEach(function (ngModuleSymbol) {
if (_this.summaryResolver.isLibraryFile(ngModuleSymbol.filePath)) {
var exportAs = exportAsBySymbol.get(ngModuleSymbol) || ngModuleSymbol.name;
var jitExportAsName = summaryForJitName(exportAs);
_this.outputCtx.statements.push(variable(jitExportAsName)
.set(_this.serializeSummaryRef(ngModuleSymbol))
.toDeclStmt(null, [StmtModifier.Exported]));
}
});
var e_1, _b, e_3, _j, e_2, _h;
};
ForJitSerializer.prototype.serializeSummaryWithDeps = function (summary, metadata) {
var _this = this;
var expressions = [this.serializeSummary(summary)];
var providers = [];
if (metadata instanceof CompileNgModuleMetadata) {
expressions.push.apply(expressions, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(
// For directives / pipes, we only add the declared ones,
// and rely on transitively importing NgModules to get the transitive
// summaries.
metadata.declaredDirectives.concat(metadata.declaredPipes)
.map(function (type) { return type.reference; })
.concat(metadata.transitiveModule.modules.map(function (type) { return type.reference; })
.filter(function (ref) { return ref !== metadata.type.reference; }))
.map(function (ref) { return _this.serializeSummaryRef(ref); })));
// Note: We don't use `NgModuleSummary.providers`, as that one is transitive,
// and we already have transitive modules.
providers = metadata.providers;
}
else if (summary.summaryKind === CompileSummaryKind.Directive) {
var dirSummary = summary;
providers = dirSummary.providers.concat(dirSummary.viewProviders);
}
// Note: We can't just refer to the `ngsummary.ts` files for `useClass` providers (as we do for
// declaredDirectives / declaredPipes), as we allow
// providers without ctor arguments to skip the `@Injectable` decorator,
// i.e. we didn't generate .ngsummary.ts files for these.
expressions.push.apply(expressions, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(providers.filter(function (provider) { return !!provider.useClass; }).map(function (provider) { return _this.serializeSummary({
summaryKind: CompileSummaryKind.Injectable, type: provider.useClass
}); })));
return literalArr(expressions);
};
ForJitSerializer.prototype.serializeSummaryRef = function (typeSymbol) {
var jitImportedSymbol = this.symbolResolver.getStaticSymbol(summaryForJitFileName(typeSymbol.filePath), summaryForJitName(typeSymbol.name));
return this.outputCtx.importExpr(jitImportedSymbol);
};
ForJitSerializer.prototype.serializeSummary = function (data) {
var outputCtx = this.outputCtx;
var Transformer = /** @class */ (function () {
function Transformer() {
}
Transformer.prototype.visitArray = function (arr, context) {
var _this = this;
return literalArr(arr.map(function (entry) { return visitValue(entry, _this, context); }));
};
Transformer.prototype.visitStringMap = function (map, context) {
var _this = this;
return new LiteralMapExpr(Object.keys(map).map(function (key) { return new LiteralMapEntry(key, visitValue(map[key], _this, context), false); }));
};
Transformer.prototype.visitPrimitive = function (value, context) { return literal(value); };
Transformer.prototype.visitOther = function (value, context) {
if (value instanceof StaticSymbol) {
return outputCtx.importExpr(value);
}
else {
throw new Error("Illegal State: Encountered value " + value);
}
};
return Transformer;
}());
return visitValue(data, new Transformer(), null);
};
return ForJitSerializer;
}());
var FromJsonDeserializer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FromJsonDeserializer, _super);
function FromJsonDeserializer(symbolCache, summaryResolver) {
var _this = _super.call(this) || this;
_this.symbolCache = symbolCache;
_this.summaryResolver = summaryResolver;
return _this;
}
FromJsonDeserializer.prototype.deserialize = function (libraryFileName, json) {
var _this = this;
var data = JSON.parse(json);
var allImportAs = [];
this.symbols = data.symbols.map(function (serializedSymbol) { return _this.symbolCache.get(_this.summaryResolver.fromSummaryFileName(serializedSymbol.filePath, libraryFileName), serializedSymbol.name); });
data.symbols.forEach(function (serializedSymbol, index) {
var symbol = _this.symbols[index];
var importAs = serializedSymbol.importAs;
if (typeof importAs === 'number') {
allImportAs.push({ symbol: symbol, importAs: _this.symbols[importAs] });
}
else if (typeof importAs === 'string') {
allImportAs.push({ symbol: symbol, importAs: _this.symbolCache.get(ngfactoryFilePath(libraryFileName), importAs) });
}
});
var summaries = visitValue(data.summaries, this, null);
return { moduleName: data.moduleName, summaries: summaries, importAs: allImportAs };
};
FromJsonDeserializer.prototype.visitStringMap = function (map, context) {
if ('__symbol' in map) {
var baseSymbol = this.symbols[map['__symbol']];
var members = map['members'];
return members.length ? this.symbolCache.get(baseSymbol.filePath, baseSymbol.name, members) :
baseSymbol;
}
else {
return _super.prototype.visitStringMap.call(this, map, context);
}
};
return FromJsonDeserializer;
}(ValueTransformer));
function isCall(metadata) {
return metadata && metadata.__symbolic === 'call';
}
function isFunctionCall(metadata) {
return isCall(metadata) && unwrapResolvedMetadata(metadata.expression) instanceof StaticSymbol;
}
function isMethodCallOnVariable(metadata) {
return isCall(metadata) && metadata.expression && metadata.expression.__symbolic === 'select' &&
unwrapResolvedMetadata(metadata.expression.expression) instanceof StaticSymbol;
}
/**
* @license
* Copyright Google Inc. 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 StubEmitFlags;
(function (StubEmitFlags) {
StubEmitFlags[StubEmitFlags["Basic"] = 1] = "Basic";
StubEmitFlags[StubEmitFlags["TypeCheck"] = 2] = "TypeCheck";
StubEmitFlags[StubEmitFlags["All"] = 3] = "All";
})(StubEmitFlags || (StubEmitFlags = {}));
var AotCompiler = /** @class */ (function () {
function AotCompiler(_config, _options, _host, reflector, _metadataResolver, _templateParser, _styleCompiler, _viewCompiler, _typeCheckCompiler, _ngModuleCompiler, _injectableCompiler, _outputEmitter, _summaryResolver, _symbolResolver) {
this._config = _config;
this._options = _options;
this._host = _host;
this.reflector = reflector;
this._metadataResolver = _metadataResolver;
this._templateParser = _templateParser;
this._styleCompiler = _styleCompiler;
this._viewCompiler = _viewCompiler;
this._typeCheckCompiler = _typeCheckCompiler;
this._ngModuleCompiler = _ngModuleCompiler;
this._injectableCompiler = _injectableCompiler;
this._outputEmitter = _outputEmitter;
this._summaryResolver = _summaryResolver;
this._symbolResolver = _symbolResolver;
this._templateAstCache = new Map();
this._analyzedFiles = new Map();
this._analyzedFilesForInjectables = new Map();
}
AotCompiler.prototype.clearCache = function () { this._metadataResolver.clearCache(); };
AotCompiler.prototype.analyzeModulesSync = function (rootFiles) {
var _this = this;
var analyzeResult = analyzeAndValidateNgModules(rootFiles, this._host, this._symbolResolver, this._metadataResolver);
analyzeResult.ngModules.forEach(function (ngModule) { return _this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, true); });
return analyzeResult;
};
AotCompiler.prototype.analyzeModulesAsync = function (rootFiles) {
var _this = this;
var analyzeResult = analyzeAndValidateNgModules(rootFiles, this._host, this._symbolResolver, this._metadataResolver);
return Promise
.all(analyzeResult.ngModules.map(function (ngModule) { return _this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false); }))
.then(function () { return analyzeResult; });
};
AotCompiler.prototype._analyzeFile = function (fileName) {
var analyzedFile = this._analyzedFiles.get(fileName);
if (!analyzedFile) {
analyzedFile =
analyzeFile(this._host, this._symbolResolver, this._metadataResolver, fileName);
this._analyzedFiles.set(fileName, analyzedFile);
}
return analyzedFile;
};
AotCompiler.prototype._analyzeFileForInjectables = function (fileName) {
var analyzedFile = this._analyzedFilesForInjectables.get(fileName);
if (!analyzedFile) {
analyzedFile = analyzeFileForInjectables(this._host, this._symbolResolver, this._metadataResolver, fileName);
this._analyzedFilesForInjectables.set(fileName, analyzedFile);
}
return analyzedFile;
};
AotCompiler.prototype.findGeneratedFileNames = function (fileName) {
var _this = this;
var genFileNames = [];
var file = this._analyzeFile(fileName);
// Make sure we create a .ngfactory if we have a injectable/directive/pipe/NgModule
// or a reference to a non source file.
// Note: This is overestimating the required .ngfactory files as the real calculation is harder.
// Only do this for StubEmitFlags.Basic, as adding a type check block
// does not change this file (as we generate type check blocks based on NgModules).
if (this._options.allowEmptyCodegenFiles || file.directives.length || file.pipes.length ||
file.injectables.length || file.ngModules.length || file.exportsNonSourceFiles) {
genFileNames.push(ngfactoryFilePath(file.fileName, true));
if (this._options.enableSummariesForJit) {
genFileNames.push(summaryForJitFileName(file.fileName, true));
}
}
var fileSuffix = normalizeGenFileSuffix(splitTypescriptSuffix(file.fileName, true)[1]);
file.directives.forEach(function (dirSymbol) {
var compMeta = _this._metadataResolver.getNonNormalizedDirectiveMetadata(dirSymbol).metadata;
if (!compMeta.isComponent) {
return;
}
// Note: compMeta is a component and therefore template is non null.
compMeta.template.styleUrls.forEach(function (styleUrl) {
var normalizedUrl = _this._host.resourceNameToFileName(styleUrl, file.fileName);
if (!normalizedUrl) {
throw syntaxError("Couldn't resolve resource " + styleUrl + " relative to " + file.fileName);
}
var needsShim = (compMeta.template.encapsulation ||
_this._config.defaultEncapsulation) === ViewEncapsulation.Emulated;
genFileNames.push(_stylesModuleUrl(normalizedUrl, needsShim, fileSuffix));
if (_this._options.allowEmptyCodegenFiles) {
genFileNames.push(_stylesModuleUrl(normalizedUrl, !needsShim, fileSuffix));
}
});
});
return genFileNames;
};
AotCompiler.prototype.emitBasicStub = function (genFileName, originalFileName) {
var outputCtx = this._createOutputContext(genFileName);
if (genFileName.endsWith('.ngfactory.ts')) {
if (!originalFileName) {
throw new Error("Assertion error: require the original file for .ngfactory.ts stubs. File: " + genFileName);
}
var originalFile = this._analyzeFile(originalFileName);
this._createNgFactoryStub(outputCtx, originalFile, StubEmitFlags.Basic);
}
else if (genFileName.endsWith('.ngsummary.ts')) {
if (this._options.enableSummariesForJit) {
if (!originalFileName) {
throw new Error("Assertion error: require the original file for .ngsummary.ts stubs. File: " + genFileName);
}
var originalFile = this._analyzeFile(originalFileName);
_createEmptyStub(outputCtx);
originalFile.ngModules.forEach(function (ngModule) {
// create exports that user code can reference
createForJitStub(outputCtx, ngModule.type.reference);
});
}
}
else if (genFileName.endsWith('.ngstyle.ts')) {
_createEmptyStub(outputCtx);
}
// Note: for the stubs, we don't need a property srcFileUrl,
// as later on in emitAllImpls we will create the proper GeneratedFiles with the
// correct srcFileUrl.
// This is good as e.g. for .ngstyle.ts files we can't derive
// the url of components based on the genFileUrl.
return this._codegenSourceModule('unknown', outputCtx);
};
AotCompiler.prototype.emitTypeCheckStub = function (genFileName, originalFileName) {
var originalFile = this._analyzeFile(originalFileName);
var outputCtx = this._createOutputContext(genFileName);
if (genFileName.endsWith('.ngfactory.ts')) {
this._createNgFactoryStub(outputCtx, originalFile, StubEmitFlags.TypeCheck);
}
return outputCtx.statements.length > 0 ?
this._codegenSourceModule(originalFile.fileName, outputCtx) :
null;
};
AotCompiler.prototype.loadFilesAsync = function (fileNames, tsFiles) {
var _this = this;
var files = fileNames.map(function (fileName) { return _this._analyzeFile(fileName); });
var loadingPromises = [];
files.forEach(function (file) { return file.ngModules.forEach(function (ngModule) {
return loadingPromises.push(_this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false));
}); });
var analyzedInjectables = tsFiles.map(function (tsFile) { return _this._analyzeFileForInjectables(tsFile); });
return Promise.all(loadingPromises).then(function (_) { return ({
analyzedModules: mergeAndValidateNgFiles(files),
analyzedInjectables: analyzedInjectables,
}); });
};
AotCompiler.prototype.loadFilesSync = function (fileNames, tsFiles) {
var _this = this;
var files = fileNames.map(function (fileName) { return _this._analyzeFile(fileName); });
files.forEach(function (file) { return file.ngModules.forEach(function (ngModule) { return _this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, true); }); });
var analyzedInjectables = tsFiles.map(function (tsFile) { return _this._analyzeFileForInjectables(tsFile); });
return {
analyzedModules: mergeAndValidateNgFiles(files),
analyzedInjectables: analyzedInjectables,
};
};
AotCompiler.prototype._createNgFactoryStub = function (outputCtx, file, emitFlags) {
var _this = this;
var componentId = 0;
file.ngModules.forEach(function (ngModuleMeta, ngModuleIndex) {
// Note: the code below needs to executed for StubEmitFlags.Basic and StubEmitFlags.TypeCheck,
// so we don't change the .ngfactory file too much when adding the type-check block.
// create exports that user code can reference
_this._ngModuleCompiler.createStub(outputCtx, ngModuleMeta.type.reference);
// add references to the symbols from the metadata.
// These can be used by the type check block for components,
// and they also cause TypeScript to include these files into the program too,
// which will make them part of the analyzedFiles.
var externalReferences = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(ngModuleMeta.transitiveModule.directives.map(function (d) { return d.reference; }), ngModuleMeta.transitiveModule.pipes.map(function (d) { return d.reference; }), ngModuleMeta.importedModules.map(function (m) { return m.type.reference; }), ngModuleMeta.exportedModules.map(function (m) { return m.type.reference; }), _this._externalIdentifierReferences([Identifiers.TemplateRef, Identifiers.ElementRef]));
var externalReferenceVars = new Map();
externalReferences.forEach(function (ref, typeIndex) {
externalReferenceVars.set(ref, "_decl" + ngModuleIndex + "_" + typeIndex);
});
externalReferenceVars.forEach(function (varName, reference) {
outputCtx.statements.push(variable(varName)
.set(NULL_EXPR.cast(DYNAMIC_TYPE))
.toDeclStmt(expressionType(outputCtx.importExpr(reference, /* typeParams */ null, /* useSummaries */ false))));
});
if (emitFlags & StubEmitFlags.TypeCheck) {
// add the type-check block for all components of the NgModule
ngModuleMeta.declaredDirectives.forEach(function (dirId) {
var compMeta = _this._metadataResolver.getDirectiveMetadata(dirId.reference);
if (!compMeta.isComponent) {
return;
}
componentId++;
_this._createTypeCheckBlock(outputCtx, compMeta.type.reference.name + "_Host_" + componentId, ngModuleMeta, _this._metadataResolver.getHostComponentMetadata(compMeta), [compMeta.type], externalReferenceVars);
_this._createTypeCheckBlock(outputCtx, compMeta.type.reference.name + "_" + componentId, ngModuleMeta, compMeta, ngModuleMeta.transitiveModule.directives, externalReferenceVars);
});
}
});
if (outputCtx.statements.length === 0) {
_createEmptyStub(outputCtx);
}
};
AotCompiler.prototype._externalIdentifierReferences = function (references) {
var result = [];
try {
for (var references_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(references), references_1_1 = references_1.next(); !references_1_1.done; references_1_1 = references_1.next()) {
var reference = references_1_1.value;
var token = createTokenForExternalReference(this.reflector, reference);
if (token.identifier) {
result.push(token.identifier.reference);
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (references_1_1 && !references_1_1.done && (_a = references_1.return)) _a.call(references_1);
}
finally { if (e_1) throw e_1.error; }
}
return result;
var e_1, _a;
};
AotCompiler.prototype._createTypeCheckBlock = function (ctx, componentId, moduleMeta, compMeta, directives, externalReferenceVars) {
var _a = this._parseTemplate(compMeta, moduleMeta, directives), parsedTemplate = _a.template, usedPipes = _a.pipes;
(_b = ctx.statements).push.apply(_b, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(this._typeCheckCompiler.compileComponent(componentId, compMeta, parsedTemplate, usedPipes, externalReferenceVars, ctx)));
var _b;
};
AotCompiler.prototype.emitMessageBundle = function (analyzeResult, locale) {
var _this = this;
var errors = [];
var htmlParser = new HtmlParser();
// TODO(vicb): implicit tags & attributes
var messageBundle = new MessageBundle(htmlParser, [], {}, locale);
analyzeResult.files.forEach(function (file) {
var compMetas = [];
file.directives.forEach(function (directiveType) {
var dirMeta = _this._metadataResolver.getDirectiveMetadata(directiveType);
if (dirMeta && dirMeta.isComponent) {
compMetas.push(dirMeta);
}
});
compMetas.forEach(function (compMeta) {
var html = compMeta.template.template;
var interpolationConfig = InterpolationConfig.fromArray(compMeta.template.interpolation);
errors.push.apply(errors, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(messageBundle.updateFromTemplate(html, file.fileName, interpolationConfig)));
});
});
if (errors.length) {
throw new Error(errors.map(function (e) { return e.toString(); }).join('\n'));
}
return messageBundle;
};
AotCompiler.prototype.emitAllPartialModules = function (_a, r3Files) {
var _this = this;
var ngModuleByPipeOrDirective = _a.ngModuleByPipeOrDirective, files = _a.files;
var contextMap = new Map();
var getContext = function (fileName) {
if (!contextMap.has(fileName)) {
contextMap.set(fileName, _this._createOutputContext(fileName));
}
return contextMap.get(fileName);
};
files.forEach(function (file) { return _this._compilePartialModule(file.fileName, ngModuleByPipeOrDirective, file.directives, file.pipes, file.ngModules, file.injectables, getContext(file.fileName)); });
r3Files.forEach(function (file) { return _this._compileShallowModules(file.fileName, file.shallowModules, getContext(file.fileName)); });
return Array.from(contextMap.values())
.map(function (context) { return ({
fileName: context.genFilePath,
statements: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(context.constantPool.statements, context.statements),
}); });
};
AotCompiler.prototype._compileShallowModules = function (fileName, shallowModules, context) {
var _this = this;
shallowModules.forEach(function (module) { return compileNgModule(context, module, _this._injectableCompiler); });
};
AotCompiler.prototype._compilePartialModule = function (fileName, ngModuleByPipeOrDirective, directives, pipes, ngModules, injectables, context) {
var _this = this;
var errors = [];
var hostBindingParser = new BindingParser(this._templateParser.expressionParser, DEFAULT_INTERPOLATION_CONFIG, null, [], errors);
// Process all components and directives
directives.forEach(function (directiveType) {
var directiveMetadata = _this._metadataResolver.getDirectiveMetadata(directiveType);
if (directiveMetadata.isComponent) {
var module = ngModuleByPipeOrDirective.get(directiveType);
module ||
error("Cannot determine the module for component '" + identifierName(directiveMetadata.type) + "'");
var _a = _this._parseTemplate(directiveMetadata, module, module.transitiveModule.directives), parsedTemplate = _a.template, parsedPipes = _a.pipes;
compileComponent(context, directiveMetadata, parsedPipes, parsedTemplate, _this.reflector, hostBindingParser, 0 /* PartialClass */);
}
else {
compileDirective(context, directiveMetadata, _this.reflector, hostBindingParser, 0 /* PartialClass */);
}
});
pipes.forEach(function (pipeType) {
var pipeMetadata = _this._metadataResolver.getPipeMetadata(pipeType);
if (pipeMetadata) {
compilePipe(context, pipeMetadata, _this.reflector, 0 /* PartialClass */);
}
});
injectables.forEach(function (injectable) { return _this._injectableCompiler.compile(injectable, context); });
};
AotCompiler.prototype.emitAllPartialModules2 = function (files) {
var _this = this;
// Using reduce like this is a select many pattern (where map is a select pattern)
return files.reduce(function (r, file) {
r.push.apply(r, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(_this._emitPartialModule2(file.fileName, file.injectables)));
return r;
}, []);
};
AotCompiler.prototype._emitPartialModule2 = function (fileName, injectables) {
var _this = this;
var context = this._createOutputContext(fileName);
injectables.forEach(function (injectable) { return _this._injectableCompiler.compile(injectable, context); });
if (context.statements && context.statements.length > 0) {
return [{ fileName: fileName, statements: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(context.constantPool.statements, context.statements) }];
}
return [];
};
AotCompiler.prototype.emitAllImpls = function (analyzeResult) {
var _this = this;
var ngModuleByPipeOrDirective = analyzeResult.ngModuleByPipeOrDirective, files = analyzeResult.files;
var sourceModules = files.map(function (file) { return _this._compileImplFile(file.fileName, ngModuleByPipeOrDirective, file.directives, file.pipes, file.ngModules, file.injectables); });
return flatten(sourceModules);
};
AotCompiler.prototype._compileImplFile = function (srcFileUrl, ngModuleByPipeOrDirective, directives, pipes, ngModules, injectables) {
var _this = this;
var fileSuffix = normalizeGenFileSuffix(splitTypescriptSuffix(srcFileUrl, true)[1]);
var generatedFiles = [];
var outputCtx = this._createOutputContext(ngfactoryFilePath(srcFileUrl, true));
generatedFiles.push.apply(generatedFiles, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(this._createSummary(srcFileUrl, directives, pipes, ngModules, injectables, outputCtx)));
// compile all ng modules
ngModules.forEach(function (ngModuleMeta) { return _this._compileModule(outputCtx, ngModuleMeta); });
// compile components
directives.forEach(function (dirType) {
var compMeta = _this._metadataResolver.getDirectiveMetadata(dirType);
if (!compMeta.isComponent) {
return;
}
var ngModule = ngModuleByPipeOrDirective.get(dirType);
if (!ngModule) {
throw new Error("Internal Error: cannot determine the module for component " + identifierName(compMeta.type) + "!");
}
// compile styles
var componentStylesheet = _this._styleCompiler.compileComponent(outputCtx, compMeta);
// Note: compMeta is a component and therefore template is non null.
compMeta.template.externalStylesheets.forEach(function (stylesheetMeta) {
// Note: fill non shim and shim style files as they might
// be shared by component with and without ViewEncapsulation.
var shim = _this._styleCompiler.needsStyleShim(compMeta);
generatedFiles.push(_this._codegenStyles(srcFileUrl, compMeta, stylesheetMeta, shim, fileSuffix));
if (_this._options.allowEmptyCodegenFiles) {
generatedFiles.push(_this._codegenStyles(srcFileUrl, compMeta, stylesheetMeta, !shim, fileSuffix));
}
});
// compile components
var compViewVars = _this._compileComponent(outputCtx, compMeta, ngModule, ngModule.transitiveModule.directives, componentStylesheet, fileSuffix);
_this._compileComponentFactory(outputCtx, compMeta, ngModule, fileSuffix);
});
if (outputCtx.statements.length > 0 || this._options.allowEmptyCodegenFiles) {
var srcModule = this._codegenSourceModule(srcFileUrl, outputCtx);
generatedFiles.unshift(srcModule);
}
return generatedFiles;
};
AotCompiler.prototype._createSummary = function (srcFileName, directives, pipes, ngModules, injectables, ngFactoryCtx) {
var _this = this;
var symbolSummaries = this._symbolResolver.getSymbolsOf(srcFileName)
.map(function (symbol) { return _this._symbolResolver.resolveSymbol(symbol); });
var typeData = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(ngModules.map(function (meta) { return ({
summary: _this._metadataResolver.getNgModuleSummary(meta.type.reference),
metadata: _this._metadataResolver.getNgModuleMetadata(meta.type.reference)
}); }), directives.map(function (ref) { return ({
summary: _this._metadataResolver.getDirectiveSummary(ref),
metadata: _this._metadataResolver.getDirectiveMetadata(ref)
}); }), pipes.map(function (ref) { return ({
summary: _this._metadataResolver.getPipeSummary(ref),
metadata: _this._metadataResolver.getPipeMetadata(ref)
}); }), injectables.map(function (ref) { return ({
summary: _this._metadataResolver.getInjectableSummary(ref.symbol),
metadata: _this._metadataResolver.getInjectableSummary(ref.symbol).type
}); }));
var forJitOutputCtx = this._options.enableSummariesForJit ?
this._createOutputContext(summaryForJitFileName(srcFileName, true)) :
null;
var _a = serializeSummaries(srcFileName, forJitOutputCtx, this._summaryResolver, this._symbolResolver, symbolSummaries, typeData), json = _a.json, exportAs = _a.exportAs;
exportAs.forEach(function (entry) {
ngFactoryCtx.statements.push(variable(entry.exportAs).set(ngFactoryCtx.importExpr(entry.symbol)).toDeclStmt(null, [
StmtModifier.Exported
]));
});
var summaryJson = new GeneratedFile(srcFileName, summaryFileName(srcFileName), json);
var result = [summaryJson];
if (forJitOutputCtx) {
result.push(this._codegenSourceModule(srcFileName, forJitOutputCtx));
}
return result;
};
AotCompiler.prototype._compileModule = function (outputCtx, ngModule) {
var providers = [];
if (this._options.locale) {
var normalizedLocale = this._options.locale.replace(/_/g, '-');
providers.push({
token: createTokenForExternalReference(this.reflector, Identifiers.LOCALE_ID),
useValue: normalizedLocale,
});
}
if (this._options.i18nFormat) {
providers.push({
token: createTokenForExternalReference(this.reflector, Identifiers.TRANSLATIONS_FORMAT),
useValue: this._options.i18nFormat
});
}
this._ngModuleCompiler.compile(outputCtx, ngModule, providers);
};
AotCompiler.prototype._compileComponentFactory = function (outputCtx, compMeta, ngModule, fileSuffix) {
var hostMeta = this._metadataResolver.getHostComponentMetadata(compMeta);
var hostViewFactoryVar = this._compileComponent(outputCtx, hostMeta, ngModule, [compMeta.type], null, fileSuffix)
.viewClassVar;
var compFactoryVar = componentFactoryName(compMeta.type.reference);
var inputsExprs = [];
for (var propName in compMeta.inputs) {
var templateName = compMeta.inputs[propName];
// Don't quote so that the key gets minified...
inputsExprs.push(new LiteralMapEntry(propName, literal(templateName), false));
}
var outputsExprs = [];
for (var propName in compMeta.outputs) {
var templateName = compMeta.outputs[propName];
// Don't quote so that the key gets minified...
outputsExprs.push(new LiteralMapEntry(propName, literal(templateName), false));
}
outputCtx.statements.push(variable(compFactoryVar)
.set(importExpr(Identifiers.createComponentFactory).callFn([
literal(compMeta.selector), outputCtx.importExpr(compMeta.type.reference),
variable(hostViewFactoryVar), new LiteralMapExpr(inputsExprs),
new LiteralMapExpr(outputsExprs),
literalArr(compMeta.template.ngContentSelectors.map(function (selector) { return literal(selector); }))
]))
.toDeclStmt(importType(Identifiers.ComponentFactory, [expressionType(outputCtx.importExpr(compMeta.type.reference))], [TypeModifier.Const]), [StmtModifier.Final, StmtModifier.Exported]));
};
AotCompiler.prototype._compileComponent = function (outputCtx, compMeta, ngModule, directiveIdentifiers, componentStyles, fileSuffix) {
var _a = this._parseTemplate(compMeta, ngModule, directiveIdentifiers), parsedTemplate = _a.template, usedPipes = _a.pipes;
var stylesExpr = componentStyles ? variable(componentStyles.stylesVar) : literalArr([]);
var viewResult = this._viewCompiler.compileComponent(outputCtx, compMeta, parsedTemplate, stylesExpr, usedPipes);
if (componentStyles) {
_resolveStyleStatements(this._symbolResolver, componentStyles, this._styleCompiler.needsStyleShim(compMeta), fileSuffix);
}
return viewResult;
};
AotCompiler.prototype._parseTemplate = function (compMeta, ngModule, directiveIdentifiers) {
var _this = this;
if (this._templateAstCache.has(compMeta.type.reference)) {
return this._templateAstCache.get(compMeta.type.reference);
}
var preserveWhitespaces = compMeta.template.preserveWhitespaces;
var directives = directiveIdentifiers.map(function (dir) { return _this._metadataResolver.getDirectiveSummary(dir.reference); });
var pipes = ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });
var result = this._templateParser.parse(compMeta, compMeta.template.htmlAst, directives, pipes, ngModule.schemas, templateSourceUrl(ngModule.type, compMeta, compMeta.template), preserveWhitespaces);
this._templateAstCache.set(compMeta.type.reference, result);
return result;
};
AotCompiler.prototype._createOutputContext = function (genFilePath) {
var _this = this;
var importExpr$$1 = function (symbol, typeParams, useSummaries) {
if (typeParams === void 0) { typeParams = null; }
if (useSummaries === void 0) { useSummaries = true; }
if (!(symbol instanceof StaticSymbol)) {
throw new Error("Internal error: unknown identifier " + JSON.stringify(symbol));
}
var arity = _this._symbolResolver.getTypeArity(symbol) || 0;
var _a = _this._symbolResolver.getImportAs(symbol, useSummaries) || symbol, filePath = _a.filePath, name = _a.name, members = _a.members;
var importModule = _this._fileNameToModuleName(filePath, genFilePath);
// It should be good enough to compare filePath to genFilePath and if they are equal
// there is a self reference. However, ngfactory files generate to .ts but their
// symbols have .d.ts so a simple compare is insufficient. They should be canonical
// and is tracked by #17705.
var selfReference = _this._fileNameToModuleName(genFilePath, genFilePath);
var moduleName = importModule === selfReference ? null : importModule;
// If we are in a type expression that refers to a generic type then supply
// the required type parameters. If there were not enough type parameters
// supplied, supply any as the type. Outside a type expression the reference
// should not supply type parameters and be treated as a simple value reference
// to the constructor function itself.
var suppliedTypeParams = typeParams || [];
var missingTypeParamsCount = arity - suppliedTypeParams.length;
var allTypeParams = suppliedTypeParams.concat(new Array(missingTypeParamsCount).fill(DYNAMIC_TYPE));
return members.reduce(function (expr, memberName) { return expr.prop(memberName); }, importExpr(new ExternalReference(moduleName, name, null), allTypeParams));
};
return { statements: [], genFilePath: genFilePath, importExpr: importExpr$$1, constantPool: new ConstantPool() };
};
AotCompiler.prototype._fileNameToModuleName = function (importedFilePath, containingFilePath) {
return this._summaryResolver.getKnownModuleName(importedFilePath) ||
this._symbolResolver.getKnownModuleName(importedFilePath) ||
this._host.fileNameToModuleName(importedFilePath, containingFilePath);
};
AotCompiler.prototype._codegenStyles = function (srcFileUrl, compMeta, stylesheetMetadata, isShimmed, fileSuffix) {
var outputCtx = this._createOutputContext(_stylesModuleUrl(stylesheetMetadata.moduleUrl, isShimmed, fileSuffix));
var compiledStylesheet = this._styleCompiler.compileStyles(outputCtx, compMeta, stylesheetMetadata, isShimmed);
_resolveStyleStatements(this._symbolResolver, compiledStylesheet, isShimmed, fileSuffix);
return this._codegenSourceModule(srcFileUrl, outputCtx);
};
AotCompiler.prototype._codegenSourceModule = function (srcFileUrl, ctx) {
return new GeneratedFile(srcFileUrl, ctx.genFilePath, ctx.statements);
};
AotCompiler.prototype.listLazyRoutes = function (entryRoute, analyzedModules) {
var self = this;
if (entryRoute) {
var symbol = parseLazyRoute(entryRoute, this.reflector).referencedModule;
return visitLazyRoute(symbol);
}
else if (analyzedModules) {
var allLazyRoutes = [];
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(analyzedModules.ngModules), _b = _a.next(); !_b.done; _b = _a.next()) {
var ngModule = _b.value;
var lazyRoutes = listLazyRoutes(ngModule, this.reflector);
try {
for (var lazyRoutes_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(lazyRoutes), lazyRoutes_1_1 = lazyRoutes_1.next(); !lazyRoutes_1_1.done; lazyRoutes_1_1 = lazyRoutes_1.next()) {
var lazyRoute = lazyRoutes_1_1.value;
allLazyRoutes.push(lazyRoute);
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (lazyRoutes_1_1 && !lazyRoutes_1_1.done && (_c = lazyRoutes_1.return)) _c.call(lazyRoutes_1);
}
finally { if (e_2) throw e_2.error; }
}
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_b && !_b.done && (_d = _a.return)) _d.call(_a);
}
finally { if (e_3) throw e_3.error; }
}
return allLazyRoutes;
}
else {
throw new Error("Either route or analyzedModules has to be specified!");
}
function visitLazyRoute(symbol, seenRoutes, allLazyRoutes) {
if (seenRoutes === void 0) { seenRoutes = new Set(); }
if (allLazyRoutes === void 0) { allLazyRoutes = []; }
// Support pointing to default exports, but stop recursing there,
// as the StaticReflector does not yet support default exports.
if (seenRoutes.has(symbol) || !symbol.name) {
return allLazyRoutes;
}
seenRoutes.add(symbol);
var lazyRoutes = listLazyRoutes(self._metadataResolver.getNgModuleMetadata(symbol, true), self.reflector);
try {
for (var lazyRoutes_2 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(lazyRoutes), lazyRoutes_2_1 = lazyRoutes_2.next(); !lazyRoutes_2_1.done; lazyRoutes_2_1 = lazyRoutes_2.next()) {
var lazyRoute = lazyRoutes_2_1.value;
allLazyRoutes.push(lazyRoute);
visitLazyRoute(lazyRoute.referencedModule, seenRoutes, allLazyRoutes);
}
}
catch (e_4_1) { e_4 = { error: e_4_1 }; }
finally {
try {
if (lazyRoutes_2_1 && !lazyRoutes_2_1.done && (_a = lazyRoutes_2.return)) _a.call(lazyRoutes_2);
}
finally { if (e_4) throw e_4.error; }
}
return allLazyRoutes;
var e_4, _a;
}
var e_3, _d, e_2, _c;
};
return AotCompiler;
}());
function _createEmptyStub(outputCtx) {
// Note: We need to produce at least one import statement so that
// TypeScript knows that the file is an es6 module. Otherwise our generated
// exports / imports won't be emitted properly by TypeScript.
outputCtx.statements.push(importExpr(Identifiers.ComponentFactory).toStmt());
}
function _resolveStyleStatements(symbolResolver, compileResult, needsShim, fileSuffix) {
compileResult.dependencies.forEach(function (dep) {
dep.setValue(symbolResolver.getStaticSymbol(_stylesModuleUrl(dep.moduleUrl, needsShim, fileSuffix), dep.name));
});
}
function _stylesModuleUrl(stylesheetUrl, shim, suffix) {
return "" + stylesheetUrl + (shim ? '.shim' : '') + ".ngstyle" + suffix;
}
function analyzeNgModules(fileNames, host, staticSymbolResolver, metadataResolver) {
var files = _analyzeFilesIncludingNonProgramFiles(fileNames, host, staticSymbolResolver, metadataResolver);
return mergeAnalyzedFiles(files);
}
function analyzeAndValidateNgModules(fileNames, host, staticSymbolResolver, metadataResolver) {
return validateAnalyzedModules(analyzeNgModules(fileNames, host, staticSymbolResolver, metadataResolver));
}
function validateAnalyzedModules(analyzedModules) {
if (analyzedModules.symbolsMissingModule && analyzedModules.symbolsMissingModule.length) {
var messages = analyzedModules.symbolsMissingModule.map(function (s) {
return "Cannot determine the module for class " + s.name + " in " + s.filePath + "! Add " + s.name + " to the NgModule to fix it.";
});
throw syntaxError(messages.join('\n'));
}
return analyzedModules;
}
// Analyzes all of the program files,
// including files that are not part of the program
// but are referenced by an NgModule.
function _analyzeFilesIncludingNonProgramFiles(fileNames, host, staticSymbolResolver, metadataResolver) {
var seenFiles = new Set();
var files = [];
var visitFile = function (fileName) {
if (seenFiles.has(fileName) || !host.isSourceFile(fileName)) {
return false;
}
seenFiles.add(fileName);
var analyzedFile = analyzeFile(host, staticSymbolResolver, metadataResolver, fileName);
files.push(analyzedFile);
analyzedFile.ngModules.forEach(function (ngModule) {
ngModule.transitiveModule.modules.forEach(function (modMeta) { return visitFile(modMeta.reference.filePath); });
});
};
fileNames.forEach(function (fileName) { return visitFile(fileName); });
return files;
}
function analyzeFile(host, staticSymbolResolver, metadataResolver, fileName) {
var directives = [];
var pipes = [];
var injectables = [];
var ngModules = [];
var hasDecorators = staticSymbolResolver.hasDecorators(fileName);
var exportsNonSourceFiles = false;
// Don't analyze .d.ts files that have no decorators as a shortcut
// to speed up the analysis. This prevents us from
// resolving the references in these files.
// Note: exportsNonSourceFiles is only needed when compiling with summaries,
// which is not the case when .d.ts files are treated as input files.
if (!fileName.endsWith('.d.ts') || hasDecorators) {
staticSymbolResolver.getSymbolsOf(fileName).forEach(function (symbol) {
var resolvedSymbol = staticSymbolResolver.resolveSymbol(symbol);
var symbolMeta = resolvedSymbol.metadata;
if (!symbolMeta || symbolMeta.__symbolic === 'error') {
return;
}
var isNgSymbol = false;
if (symbolMeta.__symbolic === 'class') {
if (metadataResolver.isDirective(symbol)) {
isNgSymbol = true;
directives.push(symbol);
}
else if (metadataResolver.isPipe(symbol)) {
isNgSymbol = true;
pipes.push(symbol);
}
else if (metadataResolver.isNgModule(symbol)) {
var ngModule = metadataResolver.getNgModuleMetadata(symbol, false);
if (ngModule) {
isNgSymbol = true;
ngModules.push(ngModule);
}
}
else if (metadataResolver.isInjectable(symbol)) {
isNgSymbol = true;
var injectable = metadataResolver.getInjectableMetadata(symbol, null, false);
if (injectable) {
injectables.push(injectable);
}
}
}
if (!isNgSymbol) {
exportsNonSourceFiles =
exportsNonSourceFiles || isValueExportingNonSourceFile(host, symbolMeta);
}
});
}
return {
fileName: fileName, directives: directives, pipes: pipes, ngModules: ngModules, injectables: injectables, exportsNonSourceFiles: exportsNonSourceFiles,
};
}
function analyzeFileForInjectables(host, staticSymbolResolver, metadataResolver, fileName) {
var injectables = [];
var shallowModules = [];
if (staticSymbolResolver.hasDecorators(fileName)) {
staticSymbolResolver.getSymbolsOf(fileName).forEach(function (symbol) {
var resolvedSymbol = staticSymbolResolver.resolveSymbol(symbol);
var symbolMeta = resolvedSymbol.metadata;
if (!symbolMeta || symbolMeta.__symbolic === 'error') {
return;
}
if (symbolMeta.__symbolic === 'class') {
if (metadataResolver.isInjectable(symbol)) {
var injectable = metadataResolver.getInjectableMetadata(symbol, null, false);
if (injectable) {
injectables.push(injectable);
}
}
else if (metadataResolver.isNgModule(symbol)) {
var module = metadataResolver.getShallowModuleMetadata(symbol);
if (module) {
shallowModules.push(module);
}
}
}
});
}
return { fileName: fileName, injectables: injectables, shallowModules: shallowModules };
}
function isValueExportingNonSourceFile(host, metadata) {
var exportsNonSourceFiles = false;
var Visitor = /** @class */ (function () {
function Visitor() {
}
Visitor.prototype.visitArray = function (arr, context) {
var _this = this;
arr.forEach(function (v) { return visitValue(v, _this, context); });
};
Visitor.prototype.visitStringMap = function (map, context) {
var _this = this;
Object.keys(map).forEach(function (key) { return visitValue(map[key], _this, context); });
};
Visitor.prototype.visitPrimitive = function (value, context) { };
Visitor.prototype.visitOther = function (value, context) {
if (value instanceof StaticSymbol && !host.isSourceFile(value.filePath)) {
exportsNonSourceFiles = true;
}
};
return Visitor;
}());
visitValue(metadata, new Visitor(), null);
return exportsNonSourceFiles;
}
function mergeAnalyzedFiles(analyzedFiles) {
var allNgModules = [];
var ngModuleByPipeOrDirective = new Map();
var allPipesAndDirectives = new Set();
analyzedFiles.forEach(function (af) {
af.ngModules.forEach(function (ngModule) {
allNgModules.push(ngModule);
ngModule.declaredDirectives.forEach(function (d) { return ngModuleByPipeOrDirective.set(d.reference, ngModule); });
ngModule.declaredPipes.forEach(function (p) { return ngModuleByPipeOrDirective.set(p.reference, ngModule); });
});
af.directives.forEach(function (d) { return allPipesAndDirectives.add(d); });
af.pipes.forEach(function (p) { return allPipesAndDirectives.add(p); });
});
var symbolsMissingModule = [];
allPipesAndDirectives.forEach(function (ref) {
if (!ngModuleByPipeOrDirective.has(ref)) {
symbolsMissingModule.push(ref);
}
});
return {
ngModules: allNgModules,
ngModuleByPipeOrDirective: ngModuleByPipeOrDirective,
symbolsMissingModule: symbolsMissingModule,
files: analyzedFiles
};
}
function mergeAndValidateNgFiles(files) {
return validateAnalyzedModules(mergeAnalyzedFiles(files));
}
/**
* @license
* Copyright Google Inc. 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 FORMATTED_MESSAGE = 'ngFormattedMessage';
function indentStr(level) {
if (level <= 0)
return '';
if (level < 6)
return ['', ' ', ' ', ' ', ' ', ' '][level];
var half = indentStr(Math.floor(level / 2));
return half + half + (level % 2 === 1 ? ' ' : '');
}
function formatChain(chain, indent) {
if (indent === void 0) { indent = 0; }
if (!chain)
return '';
var position = chain.position ?
chain.position.fileName + "(" + (chain.position.line + 1) + "," + (chain.position.column + 1) + ")" :
'';
var prefix = position && indent === 0 ? position + ": " : '';
var postfix = position && indent !== 0 ? " at " + position : '';
var message = "" + prefix + chain.message + postfix;
return "" + indentStr(indent) + message + ((chain.next && ('\n' + formatChain(chain.next, indent + 2))) || '');
}
function formattedError(chain) {
var message = formatChain(chain) + '.';
var error$$1 = syntaxError(message);
error$$1[FORMATTED_MESSAGE] = true;
error$$1.chain = chain;
error$$1.position = chain.position;
return error$$1;
}
function isFormattedError(error$$1) {
return !!error$$1[FORMATTED_MESSAGE];
}
/**
* @license
* Copyright Google Inc. 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 ANGULAR_CORE = '@angular/core';
var ANGULAR_ROUTER = '@angular/router';
var HIDDEN_KEY = /^\$.*\$$/;
var IGNORE = {
__symbolic: 'ignore'
};
var USE_VALUE = 'useValue';
var PROVIDE = 'provide';
var REFERENCE_SET = new Set([USE_VALUE, 'useFactory', 'data', 'id', 'loadChildren']);
var TYPEGUARD_POSTFIX = 'TypeGuard';
var USE_IF = 'UseIf';
function shouldIgnore(value) {
return value && value.__symbolic == 'ignore';
}
/**
* A static reflector implements enough of the Reflector API that is necessary to compile
* templates statically.
*/
var StaticReflector = /** @class */ (function () {
function StaticReflector(summaryResolver, symbolResolver, knownMetadataClasses, knownMetadataFunctions, errorRecorder) {
if (knownMetadataClasses === void 0) { knownMetadataClasses = []; }
if (knownMetadataFunctions === void 0) { knownMetadataFunctions = []; }
var _this = this;
this.summaryResolver = summaryResolver;
this.symbolResolver = symbolResolver;
this.errorRecorder = errorRecorder;
this.annotationCache = new Map();
this.shallowAnnotationCache = new Map();
this.propertyCache = new Map();
this.parameterCache = new Map();
this.methodCache = new Map();
this.staticCache = new Map();
this.conversionMap = new Map();
this.resolvedExternalReferences = new Map();
this.annotationForParentClassWithSummaryKind = new Map();
this.initializeConversionMap();
knownMetadataClasses.forEach(function (kc) { return _this._registerDecoratorOrConstructor(_this.getStaticSymbol(kc.filePath, kc.name), kc.ctor); });
knownMetadataFunctions.forEach(function (kf) { return _this._registerFunction(_this.getStaticSymbol(kf.filePath, kf.name), kf.fn); });
this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.Directive, [createDirective, createComponent]);
this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.Pipe, [createPipe]);
this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.NgModule, [createNgModule]);
this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.Injectable, [createInjectable, createPipe, createDirective, createComponent, createNgModule]);
}
StaticReflector.prototype.componentModuleUrl = function (typeOrFunc) {
var staticSymbol = this.findSymbolDeclaration(typeOrFunc);
return this.symbolResolver.getResourcePath(staticSymbol);
};
StaticReflector.prototype.resolveExternalReference = function (ref, containingFile) {
var key = undefined;
if (!containingFile) {
key = ref.moduleName + ":" + ref.name;
var declarationSymbol_1 = this.resolvedExternalReferences.get(key);
if (declarationSymbol_1)
return declarationSymbol_1;
}
var refSymbol = this.symbolResolver.getSymbolByModule(ref.moduleName, ref.name, containingFile);
var declarationSymbol = this.findSymbolDeclaration(refSymbol);
if (!containingFile) {
this.symbolResolver.recordModuleNameForFileName(refSymbol.filePath, ref.moduleName);
this.symbolResolver.recordImportAs(declarationSymbol, refSymbol);
}
if (key) {
this.resolvedExternalReferences.set(key, declarationSymbol);
}
return declarationSymbol;
};
StaticReflector.prototype.findDeclaration = function (moduleUrl, name, containingFile) {
return this.findSymbolDeclaration(this.symbolResolver.getSymbolByModule(moduleUrl, name, containingFile));
};
StaticReflector.prototype.tryFindDeclaration = function (moduleUrl, name, containingFile) {
var _this = this;
return this.symbolResolver.ignoreErrorsFor(function () { return _this.findDeclaration(moduleUrl, name, containingFile); });
};
StaticReflector.prototype.findSymbolDeclaration = function (symbol) {
var resolvedSymbol = this.symbolResolver.resolveSymbol(symbol);
if (resolvedSymbol) {
var resolvedMetadata = resolvedSymbol.metadata;
if (resolvedMetadata && resolvedMetadata.__symbolic === 'resolved') {
resolvedMetadata = resolvedMetadata.symbol;
}
if (resolvedMetadata instanceof StaticSymbol) {
return this.findSymbolDeclaration(resolvedSymbol.metadata);
}
}
return symbol;
};
StaticReflector.prototype.tryAnnotations = function (type) {
var originalRecorder = this.errorRecorder;
this.errorRecorder = function (error$$1, fileName) { };
try {
return this.annotations(type);
}
finally {
this.errorRecorder = originalRecorder;
}
};
StaticReflector.prototype.annotations = function (type) {
var _this = this;
return this._annotations(type, function (type, decorators) { return _this.simplify(type, decorators); }, this.annotationCache);
};
StaticReflector.prototype.shallowAnnotations = function (type) {
var _this = this;
return this._annotations(type, function (type, decorators) { return _this.simplify(type, decorators, true); }, this.shallowAnnotationCache);
};
StaticReflector.prototype._annotations = function (type, simplify, annotationCache) {
var annotations = annotationCache.get(type);
if (!annotations) {
annotations = [];
var classMetadata = this.getTypeMetadata(type);
var parentType = this.findParentType(type, classMetadata);
if (parentType) {
var parentAnnotations = this.annotations(parentType);
annotations.push.apply(annotations, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(parentAnnotations));
}
var ownAnnotations_1 = [];
if (classMetadata['decorators']) {
ownAnnotations_1 = simplify(type, classMetadata['decorators']);
if (ownAnnotations_1) {
annotations.push.apply(annotations, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(ownAnnotations_1));
}
}
if (parentType && !this.summaryResolver.isLibraryFile(type.filePath) &&
this.summaryResolver.isLibraryFile(parentType.filePath)) {
var summary = this.summaryResolver.resolveSummary(parentType);
if (summary && summary.type) {
var requiredAnnotationTypes = this.annotationForParentClassWithSummaryKind.get(summary.type.summaryKind);
var typeHasRequiredAnnotation = requiredAnnotationTypes.some(function (requiredType) { return ownAnnotations_1.some(function (ann) { return requiredType.isTypeOf(ann); }); });
if (!typeHasRequiredAnnotation) {
this.reportError(formatMetadataError(metadataError("Class " + type.name + " in " + type.filePath + " extends from a " + CompileSummaryKind[summary.type.summaryKind] + " in another compilation unit without duplicating the decorator",
/* summary */ undefined, "Please add a " + requiredAnnotationTypes.map(function (type) { return type.ngMetadataName; }).join(' or ') + " decorator to the class"), type), type);
}
}
}
annotationCache.set(type, annotations.filter(function (ann) { return !!ann; }));
}
return annotations;
};
StaticReflector.prototype.propMetadata = function (type) {
var _this = this;
var propMetadata = this.propertyCache.get(type);
if (!propMetadata) {
var classMetadata = this.getTypeMetadata(type);
propMetadata = {};
var parentType = this.findParentType(type, classMetadata);
if (parentType) {
var parentPropMetadata_1 = this.propMetadata(parentType);
Object.keys(parentPropMetadata_1).forEach(function (parentProp) {
propMetadata[parentProp] = parentPropMetadata_1[parentProp];
});
}
var members_1 = classMetadata['members'] || {};
Object.keys(members_1).forEach(function (propName) {
var propData = members_1[propName];
var prop = propData
.find(function (a) { return a['__symbolic'] == 'property' || a['__symbolic'] == 'method'; });
var decorators = [];
if (propMetadata[propName]) {
decorators.push.apply(decorators, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(propMetadata[propName]));
}
propMetadata[propName] = decorators;
if (prop && prop['decorators']) {
decorators.push.apply(decorators, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(_this.simplify(type, prop['decorators'])));
}
});
this.propertyCache.set(type, propMetadata);
}
return propMetadata;
};
StaticReflector.prototype.parameters = function (type) {
var _this = this;
if (!(type instanceof StaticSymbol)) {
this.reportError(new Error("parameters received " + JSON.stringify(type) + " which is not a StaticSymbol"), type);
return [];
}
try {
var parameters_1 = this.parameterCache.get(type);
if (!parameters_1) {
var classMetadata = this.getTypeMetadata(type);
var parentType = this.findParentType(type, classMetadata);
var members = classMetadata ? classMetadata['members'] : null;
var ctorData = members ? members['__ctor__'] : null;
if (ctorData) {
var ctor = ctorData.find(function (a) { return a['__symbolic'] == 'constructor'; });
var rawParameterTypes = ctor['parameters'] || [];
var parameterDecorators_1 = this.simplify(type, ctor['parameterDecorators'] || []);
parameters_1 = [];
rawParameterTypes.forEach(function (rawParamType, index) {
var nestedResult = [];
var paramType = _this.trySimplify(type, rawParamType);
if (paramType)
nestedResult.push(paramType);
var decorators = parameterDecorators_1 ? parameterDecorators_1[index] : null;
if (decorators) {
nestedResult.push.apply(nestedResult, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(decorators));
}
parameters_1.push(nestedResult);
});
}
else if (parentType) {
parameters_1 = this.parameters(parentType);
}
if (!parameters_1) {
parameters_1 = [];
}
this.parameterCache.set(type, parameters_1);
}
return parameters_1;
}
catch (e) {
console.error("Failed on type " + JSON.stringify(type) + " with error " + e);
throw e;
}
};
StaticReflector.prototype._methodNames = function (type) {
var methodNames = this.methodCache.get(type);
if (!methodNames) {
var classMetadata = this.getTypeMetadata(type);
methodNames = {};
var parentType = this.findParentType(type, classMetadata);
if (parentType) {
var parentMethodNames_1 = this._methodNames(parentType);
Object.keys(parentMethodNames_1).forEach(function (parentProp) {
methodNames[parentProp] = parentMethodNames_1[parentProp];
});
}
var members_2 = classMetadata['members'] || {};
Object.keys(members_2).forEach(function (propName) {
var propData = members_2[propName];
var isMethod = propData.some(function (a) { return a['__symbolic'] == 'method'; });
methodNames[propName] = methodNames[propName] || isMethod;
});
this.methodCache.set(type, methodNames);
}
return methodNames;
};
StaticReflector.prototype._staticMembers = function (type) {
var staticMembers = this.staticCache.get(type);
if (!staticMembers) {
var classMetadata = this.getTypeMetadata(type);
var staticMemberData = classMetadata['statics'] || {};
staticMembers = Object.keys(staticMemberData);
this.staticCache.set(type, staticMembers);
}
return staticMembers;
};
StaticReflector.prototype.findParentType = function (type, classMetadata) {
var parentType = this.trySimplify(type, classMetadata['extends']);
if (parentType instanceof StaticSymbol) {
return parentType;
}
};
StaticReflector.prototype.hasLifecycleHook = function (type, lcProperty) {
if (!(type instanceof StaticSymbol)) {
this.reportError(new Error("hasLifecycleHook received " + JSON.stringify(type) + " which is not a StaticSymbol"), type);
}
try {
return !!this._methodNames(type)[lcProperty];
}
catch (e) {
console.error("Failed on type " + JSON.stringify(type) + " with error " + e);
throw e;
}
};
StaticReflector.prototype.guards = function (type) {
if (!(type instanceof StaticSymbol)) {
this.reportError(new Error("guards received " + JSON.stringify(type) + " which is not a StaticSymbol"), type);
return {};
}
var staticMembers = this._staticMembers(type);
var result = {};
try {
for (var staticMembers_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(staticMembers), staticMembers_1_1 = staticMembers_1.next(); !staticMembers_1_1.done; staticMembers_1_1 = staticMembers_1.next()) {
var name_1 = staticMembers_1_1.value;
if (name_1.endsWith(TYPEGUARD_POSTFIX)) {
var property = name_1.substr(0, name_1.length - TYPEGUARD_POSTFIX.length);
var value = void 0;
if (property.endsWith(USE_IF)) {
property = name_1.substr(0, property.length - USE_IF.length);
value = USE_IF;
}
else {
value = this.getStaticSymbol(type.filePath, type.name, [name_1]);
}
result[property] = value;
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (staticMembers_1_1 && !staticMembers_1_1.done && (_a = staticMembers_1.return)) _a.call(staticMembers_1);
}
finally { if (e_1) throw e_1.error; }
}
return result;
var e_1, _a;
};
StaticReflector.prototype._registerDecoratorOrConstructor = function (type, ctor) {
this.conversionMap.set(type, function (context, args) { return new (ctor.bind.apply(ctor, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], args)))(); });
};
StaticReflector.prototype._registerFunction = function (type, fn) {
this.conversionMap.set(type, function (context, args) { return fn.apply(undefined, args); });
};
StaticReflector.prototype.initializeConversionMap = function () {
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Injectable'), createInjectable);
this.injectionToken = this.findDeclaration(ANGULAR_CORE, 'InjectionToken');
this.opaqueToken = this.findDeclaration(ANGULAR_CORE, 'OpaqueToken');
this.ROUTES = this.tryFindDeclaration(ANGULAR_ROUTER, 'ROUTES');
this.ANALYZE_FOR_ENTRY_COMPONENTS =
this.findDeclaration(ANGULAR_CORE, 'ANALYZE_FOR_ENTRY_COMPONENTS');
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Host'), createHost);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Self'), createSelf);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'SkipSelf'), createSkipSelf);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Inject'), createInject);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Optional'), createOptional);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Attribute'), createAttribute);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ContentChild'), createContentChild);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ContentChildren'), createContentChildren);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ViewChild'), createViewChild);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ViewChildren'), createViewChildren);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Input'), createInput);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Output'), createOutput);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Pipe'), createPipe);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'HostBinding'), createHostBinding);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'HostListener'), createHostListener);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Directive'), createDirective);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Component'), createComponent);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'NgModule'), createNgModule);
// Note: Some metadata classes can be used directly with Provider.deps.
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Host'), createHost);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Self'), createSelf);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'SkipSelf'), createSkipSelf);
this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Optional'), createOptional);
};
/**
* getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
* All types passed to the StaticResolver should be pseudo-types returned by this method.
*
* @param declarationFile the absolute path of the file where the symbol is declared
* @param name the name of the type.
*/
StaticReflector.prototype.getStaticSymbol = function (declarationFile, name, members) {
return this.symbolResolver.getStaticSymbol(declarationFile, name, members);
};
/**
* Simplify but discard any errors
*/
StaticReflector.prototype.trySimplify = function (context, value) {
var originalRecorder = this.errorRecorder;
this.errorRecorder = function (error$$1, fileName) { };
var result = this.simplify(context, value);
this.errorRecorder = originalRecorder;
return result;
};
/** @internal */
StaticReflector.prototype.simplify = function (context, value, lazy) {
if (lazy === void 0) { lazy = false; }
var self = this;
var scope = BindingScope$1.empty;
var calling = new Map();
function simplifyInContext(context, value, depth, references) {
function resolveReferenceValue(staticSymbol) {
var resolvedSymbol = self.symbolResolver.resolveSymbol(staticSymbol);
return resolvedSymbol ? resolvedSymbol.metadata : null;
}
function simplifyEagerly(value) {
return simplifyInContext(context, value, depth, 0);
}
function simplifyLazily(value) {
return simplifyInContext(context, value, depth, references + 1);
}
function simplifyNested(nestedContext, value) {
if (nestedContext === context) {
// If the context hasn't changed let the exception propagate unmodified.
return simplifyInContext(nestedContext, value, depth + 1, references);
}
try {
return simplifyInContext(nestedContext, value, depth + 1, references);
}
catch (e) {
if (isMetadataError(e)) {
// Propagate the message text up but add a message to the chain that explains how we got
// here.
// e.chain implies e.symbol
var summaryMsg = e.chain ? 'references \'' + e.symbol.name + '\'' : errorSummary(e);
var summary = "'" + nestedContext.name + "' " + summaryMsg;
var chain = { message: summary, position: e.position, next: e.chain };
// TODO(chuckj): retrieve the position information indirectly from the collectors node
// map if the metadata is from a .ts file.
self.error({
message: e.message,
advise: e.advise,
context: e.context, chain: chain,
symbol: nestedContext
}, context);
}
else {
// It is probably an internal error.
throw e;
}
}
}
function simplifyCall(functionSymbol, targetFunction, args, targetExpression) {
if (targetFunction && targetFunction['__symbolic'] == 'function') {
if (calling.get(functionSymbol)) {
self.error({
message: 'Recursion is not supported',
summary: "called '" + functionSymbol.name + "' recursively",
value: targetFunction
}, functionSymbol);
}
try {
var value_1 = targetFunction['value'];
if (value_1 && (depth != 0 || value_1.__symbolic != 'error')) {
var parameters = targetFunction['parameters'];
var defaults = targetFunction.defaults;
args = args.map(function (arg) { return simplifyNested(context, arg); })
.map(function (arg) { return shouldIgnore(arg) ? undefined : arg; });
if (defaults && defaults.length > args.length) {
args.push.apply(args, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(defaults.slice(args.length).map(function (value) { return simplify(value); })));
}
calling.set(functionSymbol, true);
var functionScope = BindingScope$1.build();
for (var i = 0; i < parameters.length; i++) {
functionScope.define(parameters[i], args[i]);
}
var oldScope = scope;
var result_1;
try {
scope = functionScope.done();
result_1 = simplifyNested(functionSymbol, value_1);
}
finally {
scope = oldScope;
}
return result_1;
}
}
finally {
calling.delete(functionSymbol);
}
}
if (depth === 0) {
// If depth is 0 we are evaluating the top level expression that is describing element
// decorator. In this case, it is a decorator we don't understand, such as a custom
// non-angular decorator, and we should just ignore it.
return IGNORE;
}
var position = undefined;
if (targetExpression && targetExpression.__symbolic == 'resolved') {
var line = targetExpression.line;
var character = targetExpression.character;
var fileName = targetExpression.fileName;
if (fileName != null && line != null && character != null) {
position = { fileName: fileName, line: line, column: character };
}
}
self.error({
message: FUNCTION_CALL_NOT_SUPPORTED,
context: functionSymbol,
value: targetFunction, position: position
}, context);
}
function simplify(expression) {
if (isPrimitive(expression)) {
return expression;
}
if (expression instanceof Array) {
var result_2 = [];
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(expression), _b = _a.next(); !_b.done; _b = _a.next()) {
var item = _b.value;
// Check for a spread expression
if (item && item.__symbolic === 'spread') {
// We call with references as 0 because we require the actual value and cannot
// tolerate a reference here.
var spreadArray = simplifyEagerly(item.expression);
if (Array.isArray(spreadArray)) {
try {
for (var spreadArray_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(spreadArray), spreadArray_1_1 = spreadArray_1.next(); !spreadArray_1_1.done; spreadArray_1_1 = spreadArray_1.next()) {
var spreadItem = spreadArray_1_1.value;
result_2.push(spreadItem);
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (spreadArray_1_1 && !spreadArray_1_1.done && (_c = spreadArray_1.return)) _c.call(spreadArray_1);
}
finally { if (e_2) throw e_2.error; }
}
continue;
}
}
var value_2 = simplify(item);
if (shouldIgnore(value_2)) {
continue;
}
result_2.push(value_2);
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_b && !_b.done && (_d = _a.return)) _d.call(_a);
}
finally { if (e_3) throw e_3.error; }
}
return result_2;
}
if (expression instanceof StaticSymbol) {
// Stop simplification at builtin symbols or if we are in a reference context and
// the symbol doesn't have members.
if (expression === self.injectionToken || self.conversionMap.has(expression) ||
(references > 0 && !expression.members.length)) {
return expression;
}
else {
var staticSymbol = expression;
var declarationValue = resolveReferenceValue(staticSymbol);
if (declarationValue != null) {
return simplifyNested(staticSymbol, declarationValue);
}
else {
return staticSymbol;
}
}
}
if (expression) {
if (expression['__symbolic']) {
var staticSymbol = void 0;
switch (expression['__symbolic']) {
case 'binop':
var left = simplify(expression['left']);
if (shouldIgnore(left))
return left;
var right = simplify(expression['right']);
if (shouldIgnore(right))
return right;
switch (expression['operator']) {
case '&&':
return left && right;
case '||':
return left || right;
case '|':
return left | right;
case '^':
return left ^ right;
case '&':
return left & right;
case '==':
return left == right;
case '!=':
return left != right;
case '===':
return left === right;
case '!==':
return left !== right;
case '<':
return left < right;
case '>':
return left > right;
case '<=':
return left <= right;
case '>=':
return left >= right;
case '<<':
return left << right;
case '>>':
return left >> right;
case '+':
return left + right;
case '-':
return left - right;
case '*':
return left * right;
case '/':
return left / right;
case '%':
return left % right;
}
return null;
case 'if':
var condition = simplify(expression['condition']);
return condition ? simplify(expression['thenExpression']) :
simplify(expression['elseExpression']);
case 'pre':
var operand = simplify(expression['operand']);
if (shouldIgnore(operand))
return operand;
switch (expression['operator']) {
case '+':
return operand;
case '-':
return -operand;
case '!':
return !operand;
case '~':
return ~operand;
}
return null;
case 'index':
var indexTarget = simplifyEagerly(expression['expression']);
var index = simplifyEagerly(expression['index']);
if (indexTarget && isPrimitive(index))
return indexTarget[index];
return null;
case 'select':
var member = expression['member'];
var selectContext = context;
var selectTarget = simplify(expression['expression']);
if (selectTarget instanceof StaticSymbol) {
var members = selectTarget.members.concat(member);
selectContext =
self.getStaticSymbol(selectTarget.filePath, selectTarget.name, members);
var declarationValue = resolveReferenceValue(selectContext);
if (declarationValue != null) {
return simplifyNested(selectContext, declarationValue);
}
else {
return selectContext;
}
}
if (selectTarget && isPrimitive(member))
return simplifyNested(selectContext, selectTarget[member]);
return null;
case 'reference':
// Note: This only has to deal with variable references, as symbol references have
// been converted into 'resolved'
// in the StaticSymbolResolver.
var name_2 = expression['name'];
var localValue = scope.resolve(name_2);
if (localValue != BindingScope$1.missing) {
return localValue;
}
break;
case 'resolved':
try {
return simplify(expression.symbol);
}
catch (e) {
// If an error is reported evaluating the symbol record the position of the
// reference in the error so it can
// be reported in the error message generated from the exception.
if (isMetadataError(e) && expression.fileName != null &&
expression.line != null && expression.character != null) {
e.position = {
fileName: expression.fileName,
line: expression.line,
column: expression.character
};
}
throw e;
}
case 'class':
return context;
case 'function':
return context;
case 'new':
case 'call':
// Determine if the function is a built-in conversion
staticSymbol = simplifyInContext(context, expression['expression'], depth + 1, /* references */ 0);
if (staticSymbol instanceof StaticSymbol) {
if (staticSymbol === self.injectionToken || staticSymbol === self.opaqueToken) {
// if somebody calls new InjectionToken, don't create an InjectionToken,
// but rather return the symbol to which the InjectionToken is assigned to.
// OpaqueToken is supported too as it is required by the language service to
// support v4 and prior versions of Angular.
return context;
}
var argExpressions = expression['arguments'] || [];
var converter = self.conversionMap.get(staticSymbol);
if (converter) {
var args = argExpressions.map(function (arg) { return simplifyNested(context, arg); })
.map(function (arg) { return shouldIgnore(arg) ? undefined : arg; });
return converter(context, args);
}
else {
// Determine if the function is one we can simplify.
var targetFunction = resolveReferenceValue(staticSymbol);
return simplifyCall(staticSymbol, targetFunction, argExpressions, expression['expression']);
}
}
return IGNORE;
case 'error':
var message = expression.message;
if (expression['line'] != null) {
self.error({
message: message,
context: expression.context,
value: expression,
position: {
fileName: expression['fileName'],
line: expression['line'],
column: expression['character']
}
}, context);
}
else {
self.error({ message: message, context: expression.context }, context);
}
return IGNORE;
case 'ignore':
return expression;
}
return null;
}
return mapStringMap(expression, function (value, name) {
if (REFERENCE_SET.has(name)) {
if (name === USE_VALUE && PROVIDE in expression) {
// If this is a provider expression, check for special tokens that need the value
// during analysis.
var provide = simplify(expression.provide);
if (provide === self.ROUTES || provide == self.ANALYZE_FOR_ENTRY_COMPONENTS) {
return simplify(value);
}
}
return simplifyLazily(value);
}
return simplify(value);
});
}
return IGNORE;
var e_3, _d, e_2, _c;
}
return simplify(value);
}
var result;
try {
result = simplifyInContext(context, value, 0, lazy ? 1 : 0);
}
catch (e) {
if (this.errorRecorder) {
this.reportError(e, context);
}
else {
throw formatMetadataError(e, context);
}
}
if (shouldIgnore(result)) {
return undefined;
}
return result;
};
StaticReflector.prototype.getTypeMetadata = function (type) {
var resolvedSymbol = this.symbolResolver.resolveSymbol(type);
return resolvedSymbol && resolvedSymbol.metadata ? resolvedSymbol.metadata :
{ __symbolic: 'class' };
};
StaticReflector.prototype.reportError = function (error$$1, context, path) {
if (this.errorRecorder) {
this.errorRecorder(formatMetadataError(error$$1, context), (context && context.filePath) || path);
}
else {
throw error$$1;
}
};
StaticReflector.prototype.error = function (_a, reportingContext) {
var message = _a.message, summary = _a.summary, advise = _a.advise, position = _a.position, context = _a.context, value = _a.value, symbol = _a.symbol, chain = _a.chain;
this.reportError(metadataError(message, summary, advise, position, symbol, context, chain), reportingContext);
};
return StaticReflector;
}());
var METADATA_ERROR = 'ngMetadataError';
function metadataError(message, summary, advise, position, symbol, context, chain) {
var error$$1 = syntaxError(message);
error$$1[METADATA_ERROR] = true;
if (advise)
error$$1.advise = advise;
if (position)
error$$1.position = position;
if (summary)
error$$1.summary = summary;
if (context)
error$$1.context = context;
if (chain)
error$$1.chain = chain;
if (symbol)
error$$1.symbol = symbol;
return error$$1;
}
function isMetadataError(error$$1) {
return !!error$$1[METADATA_ERROR];
}
var REFERENCE_TO_NONEXPORTED_CLASS = 'Reference to non-exported class';
var VARIABLE_NOT_INITIALIZED = 'Variable not initialized';
var DESTRUCTURE_NOT_SUPPORTED = 'Destructuring not supported';
var COULD_NOT_RESOLVE_TYPE = 'Could not resolve type';
var FUNCTION_CALL_NOT_SUPPORTED = 'Function call not supported';
var REFERENCE_TO_LOCAL_SYMBOL = 'Reference to a local symbol';
var LAMBDA_NOT_SUPPORTED = 'Lambda not supported';
function expandedMessage(message, context) {
switch (message) {
case REFERENCE_TO_NONEXPORTED_CLASS:
if (context && context.className) {
return "References to a non-exported class are not supported in decorators but " + context.className + " was referenced.";
}
break;
case VARIABLE_NOT_INITIALIZED:
return 'Only initialized variables and constants can be referenced in decorators because the value of this variable is needed by the template compiler';
case DESTRUCTURE_NOT_SUPPORTED:
return 'Referencing an exported destructured variable or constant is not supported in decorators and this value is needed by the template compiler';
case COULD_NOT_RESOLVE_TYPE:
if (context && context.typeName) {
return "Could not resolve type " + context.typeName;
}
break;
case FUNCTION_CALL_NOT_SUPPORTED:
if (context && context.name) {
return "Function calls are not supported in decorators but '" + context.name + "' was called";
}
return 'Function calls are not supported in decorators';
case REFERENCE_TO_LOCAL_SYMBOL:
if (context && context.name) {
return "Reference to a local (non-exported) symbols are not supported in decorators but '" + context.name + "' was referenced";
}
break;
case LAMBDA_NOT_SUPPORTED:
return "Function expressions are not supported in decorators";
}
return message;
}
function messageAdvise(message, context) {
switch (message) {
case REFERENCE_TO_NONEXPORTED_CLASS:
if (context && context.className) {
return "Consider exporting '" + context.className + "'";
}
break;
case DESTRUCTURE_NOT_SUPPORTED:
return 'Consider simplifying to avoid destructuring';
case REFERENCE_TO_LOCAL_SYMBOL:
if (context && context.name) {
return "Consider exporting '" + context.name + "'";
}
break;
case LAMBDA_NOT_SUPPORTED:
return "Consider changing the function expression into an exported function";
}
return undefined;
}
function errorSummary(error$$1) {
if (error$$1.summary) {
return error$$1.summary;
}
switch (error$$1.message) {
case REFERENCE_TO_NONEXPORTED_CLASS:
if (error$$1.context && error$$1.context.className) {
return "references non-exported class " + error$$1.context.className;
}
break;
case VARIABLE_NOT_INITIALIZED:
return 'is not initialized';
case DESTRUCTURE_NOT_SUPPORTED:
return 'is a destructured variable';
case COULD_NOT_RESOLVE_TYPE:
return 'could not be resolved';
case FUNCTION_CALL_NOT_SUPPORTED:
if (error$$1.context && error$$1.context.name) {
return "calls '" + error$$1.context.name + "'";
}
return "calls a function";
case REFERENCE_TO_LOCAL_SYMBOL:
if (error$$1.context && error$$1.context.name) {
return "references local variable " + error$$1.context.name;
}
return "references a local variable";
}
return 'contains the error';
}
function mapStringMap(input, transform) {
if (!input)
return {};
var result = {};
Object.keys(input).forEach(function (key) {
var value = transform(input[key], key);
if (!shouldIgnore(value)) {
if (HIDDEN_KEY.test(key)) {
Object.defineProperty(result, key, { enumerable: false, configurable: true, value: value });
}
else {
result[key] = value;
}
}
});
return result;
}
function isPrimitive(o) {
return o === null || (typeof o !== 'function' && typeof o !== 'object');
}
var BindingScope$1 = /** @class */ (function () {
function BindingScope() {
}
BindingScope.build = function () {
var current = new Map();
return {
define: function (name, value) {
current.set(name, value);
return this;
},
done: function () {
return current.size > 0 ? new PopulatedScope(current) : BindingScope.empty;
}
};
};
BindingScope.missing = {};
BindingScope.empty = { resolve: function (name) { return BindingScope.missing; } };
return BindingScope;
}());
var PopulatedScope = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PopulatedScope, _super);
function PopulatedScope(bindings) {
var _this = _super.call(this) || this;
_this.bindings = bindings;
return _this;
}
PopulatedScope.prototype.resolve = function (name) {
return this.bindings.has(name) ? this.bindings.get(name) : BindingScope$1.missing;
};
return PopulatedScope;
}(BindingScope$1));
function formatMetadataMessageChain(chain, advise) {
var expanded = expandedMessage(chain.message, chain.context);
var nesting = chain.symbol ? " in '" + chain.symbol.name + "'" : '';
var message = "" + expanded + nesting;
var position = chain.position;
var next = chain.next ?
formatMetadataMessageChain(chain.next, advise) :
advise ? { message: advise } : undefined;
return { message: message, position: position, next: next };
}
function formatMetadataError(e, context) {
if (isMetadataError(e)) {
// Produce a formatted version of the and leaving enough information in the original error
// to recover the formatting information to eventually produce a diagnostic error message.
var position = e.position;
var chain = {
message: "Error during template compile of '" + context.name + "'",
position: position,
next: { message: e.message, next: e.chain, context: e.context, symbol: e.symbol }
};
var advise = e.advise || messageAdvise(e.message, e.context);
return formattedError(formatMetadataMessageChain(chain, advise));
}
return e;
}
/**
* @license
* Copyright Google Inc. 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 AotSummaryResolver = /** @class */ (function () {
function AotSummaryResolver(host, staticSymbolCache) {
this.host = host;
this.staticSymbolCache = staticSymbolCache;
// Note: this will only contain StaticSymbols without members!
this.summaryCache = new Map();
this.loadedFilePaths = new Map();
// Note: this will only contain StaticSymbols without members!
this.importAs = new Map();
this.knownFileNameToModuleNames = new Map();
}
AotSummaryResolver.prototype.isLibraryFile = function (filePath) {
// Note: We need to strip the .ngfactory. file path,
// so this method also works for generated files
// (for which host.isSourceFile will always return false).
return !this.host.isSourceFile(stripGeneratedFileSuffix(filePath));
};
AotSummaryResolver.prototype.toSummaryFileName = function (filePath, referringSrcFileName) {
return this.host.toSummaryFileName(filePath, referringSrcFileName);
};
AotSummaryResolver.prototype.fromSummaryFileName = function (fileName, referringLibFileName) {
return this.host.fromSummaryFileName(fileName, referringLibFileName);
};
AotSummaryResolver.prototype.resolveSummary = function (staticSymbol) {
var rootSymbol = staticSymbol.members.length ?
this.staticSymbolCache.get(staticSymbol.filePath, staticSymbol.name) :
staticSymbol;
var summary = this.summaryCache.get(rootSymbol);
if (!summary) {
this._loadSummaryFile(staticSymbol.filePath);
summary = this.summaryCache.get(staticSymbol);
}
return (rootSymbol === staticSymbol && summary) || null;
};
AotSummaryResolver.prototype.getSymbolsOf = function (filePath) {
if (this._loadSummaryFile(filePath)) {
return Array.from(this.summaryCache.keys()).filter(function (symbol) { return symbol.filePath === filePath; });
}
return null;
};
AotSummaryResolver.prototype.getImportAs = function (staticSymbol) {
staticSymbol.assertNoMembers();
return this.importAs.get(staticSymbol);
};
/**
* Converts a file path to a module name that can be used as an `import`.
*/
AotSummaryResolver.prototype.getKnownModuleName = function (importedFilePath) {
return this.knownFileNameToModuleNames.get(importedFilePath) || null;
};
AotSummaryResolver.prototype.addSummary = function (summary) { this.summaryCache.set(summary.symbol, summary); };
AotSummaryResolver.prototype._loadSummaryFile = function (filePath) {
var _this = this;
var hasSummary = this.loadedFilePaths.get(filePath);
if (hasSummary != null) {
return hasSummary;
}
var json = null;
if (this.isLibraryFile(filePath)) {
var summaryFilePath = summaryFileName(filePath);
try {
json = this.host.loadSummary(summaryFilePath);
}
catch (e) {
console.error("Error loading summary file " + summaryFilePath);
throw e;
}
}
hasSummary = json != null;
this.loadedFilePaths.set(filePath, hasSummary);
if (json) {
var _a = deserializeSummaries(this.staticSymbolCache, this, filePath, json), moduleName = _a.moduleName, summaries = _a.summaries, importAs = _a.importAs;
summaries.forEach(function (summary) { return _this.summaryCache.set(summary.symbol, summary); });
if (moduleName) {
this.knownFileNameToModuleNames.set(filePath, moduleName);
}
importAs.forEach(function (importAs) { _this.importAs.set(importAs.symbol, importAs.importAs); });
}
return hasSummary;
};
return AotSummaryResolver;
}());
/**
* @license
* Copyright Google Inc. 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
*/
function createAotUrlResolver(host) {
return {
resolve: function (basePath, url) {
var filePath = host.resourceNameToFileName(url, basePath);
if (!filePath) {
throw syntaxError("Couldn't resolve resource " + url + " from " + basePath);
}
return filePath;
}
};
}
/**
* Creates a new AotCompiler based on options and a host.
*/
function createAotCompiler(compilerHost, options, errorCollector) {
var translations = options.translations || '';
var urlResolver = createAotUrlResolver(compilerHost);
var symbolCache = new StaticSymbolCache();
var summaryResolver = new AotSummaryResolver(compilerHost, symbolCache);
var symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);
var staticReflector = new StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);
var htmlParser;
if (!!options.enableIvy) {
// Ivy handles i18n at the compiler level so we must use a regular parser
htmlParser = new HtmlParser();
}
else {
htmlParser = new I18NHtmlParser(new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);
}
var config = new CompilerConfig({
defaultEncapsulation: ViewEncapsulation.Emulated,
useJit: false,
missingTranslation: options.missingTranslation,
preserveWhitespaces: options.preserveWhitespaces,
strictInjectionParameters: options.strictInjectionParameters,
});
var normalizer = new DirectiveNormalizer({ get: function (url) { return compilerHost.loadResource(url); } }, urlResolver, htmlParser, config);
var expressionParser = new Parser(new Lexer());
var elementSchemaRegistry = new DomElementSchemaRegistry();
var tmplParser = new TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);
var resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector, errorCollector);
// TODO(vicb): do not pass options.i18nFormat here
var viewCompiler = new ViewCompiler(staticReflector);
var typeCheckCompiler = new TypeCheckCompiler(options, staticReflector);
var compiler = new AotCompiler(config, options, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver), viewCompiler, typeCheckCompiler, new NgModuleCompiler(staticReflector), new InjectableCompiler(staticReflector, !!options.enableIvy), new TypeScriptEmitter(), summaryResolver, symbolResolver);
return { compiler: compiler, reflector: staticReflector };
}
var SummaryResolver = /** @class */ (function () {
function SummaryResolver() {
}
return SummaryResolver;
}());
var JitSummaryResolver = /** @class */ (function () {
function JitSummaryResolver() {
this._summaries = new Map();
}
JitSummaryResolver.prototype.isLibraryFile = function () { return false; };
JitSummaryResolver.prototype.toSummaryFileName = function (fileName) { return fileName; };
JitSummaryResolver.prototype.fromSummaryFileName = function (fileName) { return fileName; };
JitSummaryResolver.prototype.resolveSummary = function (reference) {
return this._summaries.get(reference) || null;
};
JitSummaryResolver.prototype.getSymbolsOf = function () { return []; };
JitSummaryResolver.prototype.getImportAs = function (reference) { return reference; };
JitSummaryResolver.prototype.getKnownModuleName = function (fileName) { return null; };
JitSummaryResolver.prototype.addSummary = function (summary) { this._summaries.set(summary.symbol, summary); };
return JitSummaryResolver;
}());
/**
* @license
* Copyright Google Inc. 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
*/
function interpretStatements(statements, reflector) {
var ctx = new _ExecutionContext(null, null, null, new Map());
var visitor = new StatementInterpreter(reflector);
visitor.visitAllStatements(statements, ctx);
var result = {};
ctx.exports.forEach(function (exportName) { result[exportName] = ctx.vars.get(exportName); });
return result;
}
function _executeFunctionStatements(varNames, varValues, statements, ctx, visitor) {
var childCtx = ctx.createChildWihtLocalVars();
for (var i = 0; i < varNames.length; i++) {
childCtx.vars.set(varNames[i], varValues[i]);
}
var result = visitor.visitAllStatements(statements, childCtx);
return result ? result.value : null;
}
var _ExecutionContext = /** @class */ (function () {
function _ExecutionContext(parent, instance, className, vars) {
this.parent = parent;
this.instance = instance;
this.className = className;
this.vars = vars;
this.exports = [];
}
_ExecutionContext.prototype.createChildWihtLocalVars = function () {
return new _ExecutionContext(this, this.instance, this.className, new Map());
};
return _ExecutionContext;
}());
var ReturnValue = /** @class */ (function () {
function ReturnValue(value) {
this.value = value;
}
return ReturnValue;
}());
function createDynamicClass(_classStmt, _ctx, _visitor) {
var propertyDescriptors = {};
_classStmt.getters.forEach(function (getter) {
// Note: use `function` instead of arrow function to capture `this`
propertyDescriptors[getter.name] = {
configurable: false,
get: function () {
var instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);
return _executeFunctionStatements([], [], getter.body, instanceCtx, _visitor);
}
};
});
_classStmt.methods.forEach(function (method) {
var paramNames = method.params.map(function (param) { return param.name; });
// Note: use `function` instead of arrow function to capture `this`
propertyDescriptors[method.name] = {
writable: false,
configurable: false,
value: function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);
return _executeFunctionStatements(paramNames, args, method.body, instanceCtx, _visitor);
}
};
});
var ctorParamNames = _classStmt.constructorMethod.params.map(function (param) { return param.name; });
// Note: use `function` instead of arrow function to capture `this`
var ctor = function () {
var _this = this;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);
_classStmt.fields.forEach(function (field) { _this[field.name] = undefined; });
_executeFunctionStatements(ctorParamNames, args, _classStmt.constructorMethod.body, instanceCtx, _visitor);
};
var superClass = _classStmt.parent ? _classStmt.parent.visitExpression(_visitor, _ctx) : Object;
ctor.prototype = Object.create(superClass.prototype, propertyDescriptors);
return ctor;
}
var StatementInterpreter = /** @class */ (function () {
function StatementInterpreter(reflector) {
this.reflector = reflector;
}
StatementInterpreter.prototype.debugAst = function (ast) { return debugOutputAstAsTypeScript(ast); };
StatementInterpreter.prototype.visitDeclareVarStmt = function (stmt, ctx) {
var initialValue = stmt.value ? stmt.value.visitExpression(this, ctx) : undefined;
ctx.vars.set(stmt.name, initialValue);
if (stmt.hasModifier(StmtModifier.Exported)) {
ctx.exports.push(stmt.name);
}
return null;
};
StatementInterpreter.prototype.visitWriteVarExpr = function (expr, ctx) {
var value = expr.value.visitExpression(this, ctx);
var currCtx = ctx;
while (currCtx != null) {
if (currCtx.vars.has(expr.name)) {
currCtx.vars.set(expr.name, value);
return value;
}
currCtx = currCtx.parent;
}
throw new Error("Not declared variable " + expr.name);
};
StatementInterpreter.prototype.visitReadVarExpr = function (ast, ctx) {
var varName = ast.name;
if (ast.builtin != null) {
switch (ast.builtin) {
case BuiltinVar.Super:
return ctx.instance.__proto__;
case BuiltinVar.This:
return ctx.instance;
case BuiltinVar.CatchError:
varName = CATCH_ERROR_VAR$2;
break;
case BuiltinVar.CatchStack:
varName = CATCH_STACK_VAR$2;
break;
default:
throw new Error("Unknown builtin variable " + ast.builtin);
}
}
var currCtx = ctx;
while (currCtx != null) {
if (currCtx.vars.has(varName)) {
return currCtx.vars.get(varName);
}
currCtx = currCtx.parent;
}
throw new Error("Not declared variable " + varName);
};
StatementInterpreter.prototype.visitWriteKeyExpr = function (expr, ctx) {
var receiver = expr.receiver.visitExpression(this, ctx);
var index = expr.index.visitExpression(this, ctx);
var value = expr.value.visitExpression(this, ctx);
receiver[index] = value;
return value;
};
StatementInterpreter.prototype.visitWritePropExpr = function (expr, ctx) {
var receiver = expr.receiver.visitExpression(this, ctx);
var value = expr.value.visitExpression(this, ctx);
receiver[expr.name] = value;
return value;
};
StatementInterpreter.prototype.visitInvokeMethodExpr = function (expr, ctx) {
var receiver = expr.receiver.visitExpression(this, ctx);
var args = this.visitAllExpressions(expr.args, ctx);
var result;
if (expr.builtin != null) {
switch (expr.builtin) {
case BuiltinMethod.ConcatArray:
result = receiver.concat.apply(receiver, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(args));
break;
case BuiltinMethod.SubscribeObservable:
result = receiver.subscribe({ next: args[0] });
break;
case BuiltinMethod.Bind:
result = receiver.bind.apply(receiver, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(args));
break;
default:
throw new Error("Unknown builtin method " + expr.builtin);
}
}
else {
result = receiver[expr.name].apply(receiver, args);
}
return result;
};
StatementInterpreter.prototype.visitInvokeFunctionExpr = function (stmt, ctx) {
var args = this.visitAllExpressions(stmt.args, ctx);
var fnExpr = stmt.fn;
if (fnExpr instanceof ReadVarExpr && fnExpr.builtin === BuiltinVar.Super) {
ctx.instance.constructor.prototype.constructor.apply(ctx.instance, args);
return null;
}
else {
var fn$$1 = stmt.fn.visitExpression(this, ctx);
return fn$$1.apply(null, args);
}
};
StatementInterpreter.prototype.visitReturnStmt = function (stmt, ctx) {
return new ReturnValue(stmt.value.visitExpression(this, ctx));
};
StatementInterpreter.prototype.visitDeclareClassStmt = function (stmt, ctx) {
var clazz = createDynamicClass(stmt, ctx, this);
ctx.vars.set(stmt.name, clazz);
if (stmt.hasModifier(StmtModifier.Exported)) {
ctx.exports.push(stmt.name);
}
return null;
};
StatementInterpreter.prototype.visitExpressionStmt = function (stmt, ctx) {
return stmt.expr.visitExpression(this, ctx);
};
StatementInterpreter.prototype.visitIfStmt = function (stmt, ctx) {
var condition = stmt.condition.visitExpression(this, ctx);
if (condition) {
return this.visitAllStatements(stmt.trueCase, ctx);
}
else if (stmt.falseCase != null) {
return this.visitAllStatements(stmt.falseCase, ctx);
}
return null;
};
StatementInterpreter.prototype.visitTryCatchStmt = function (stmt, ctx) {
try {
return this.visitAllStatements(stmt.bodyStmts, ctx);
}
catch (e) {
var childCtx = ctx.createChildWihtLocalVars();
childCtx.vars.set(CATCH_ERROR_VAR$2, e);
childCtx.vars.set(CATCH_STACK_VAR$2, e.stack);
return this.visitAllStatements(stmt.catchStmts, childCtx);
}
};
StatementInterpreter.prototype.visitThrowStmt = function (stmt, ctx) {
throw stmt.error.visitExpression(this, ctx);
};
StatementInterpreter.prototype.visitCommentStmt = function (stmt, context) { return null; };
StatementInterpreter.prototype.visitJSDocCommentStmt = function (stmt, context) { return null; };
StatementInterpreter.prototype.visitInstantiateExpr = function (ast, ctx) {
var args = this.visitAllExpressions(ast.args, ctx);
var clazz = ast.classExpr.visitExpression(this, ctx);
return new (clazz.bind.apply(clazz, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], args)))();
};
StatementInterpreter.prototype.visitLiteralExpr = function (ast, ctx) { return ast.value; };
StatementInterpreter.prototype.visitExternalExpr = function (ast, ctx) {
return this.reflector.resolveExternalReference(ast.value);
};
StatementInterpreter.prototype.visitConditionalExpr = function (ast, ctx) {
if (ast.condition.visitExpression(this, ctx)) {
return ast.trueCase.visitExpression(this, ctx);
}
else if (ast.falseCase != null) {
return ast.falseCase.visitExpression(this, ctx);
}
return null;
};
StatementInterpreter.prototype.visitNotExpr = function (ast, ctx) {
return !ast.condition.visitExpression(this, ctx);
};
StatementInterpreter.prototype.visitAssertNotNullExpr = function (ast, ctx) {
return ast.condition.visitExpression(this, ctx);
};
StatementInterpreter.prototype.visitCastExpr = function (ast, ctx) {
return ast.value.visitExpression(this, ctx);
};
StatementInterpreter.prototype.visitFunctionExpr = function (ast, ctx) {
var paramNames = ast.params.map(function (param) { return param.name; });
return _declareFn(paramNames, ast.statements, ctx, this);
};
StatementInterpreter.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {
var paramNames = stmt.params.map(function (param) { return param.name; });
ctx.vars.set(stmt.name, _declareFn(paramNames, stmt.statements, ctx, this));
if (stmt.hasModifier(StmtModifier.Exported)) {
ctx.exports.push(stmt.name);
}
return null;
};
StatementInterpreter.prototype.visitBinaryOperatorExpr = function (ast, ctx) {
var _this = this;
var lhs = function () { return ast.lhs.visitExpression(_this, ctx); };
var rhs = function () { return ast.rhs.visitExpression(_this, ctx); };
switch (ast.operator) {
case BinaryOperator.Equals:
return lhs() == rhs();
case BinaryOperator.Identical:
return lhs() === rhs();
case BinaryOperator.NotEquals:
return lhs() != rhs();
case BinaryOperator.NotIdentical:
return lhs() !== rhs();
case BinaryOperator.And:
return lhs() && rhs();
case BinaryOperator.Or:
return lhs() || rhs();
case BinaryOperator.Plus:
return lhs() + rhs();
case BinaryOperator.Minus:
return lhs() - rhs();
case BinaryOperator.Divide:
return lhs() / rhs();
case BinaryOperator.Multiply:
return lhs() * rhs();
case BinaryOperator.Modulo:
return lhs() % rhs();
case BinaryOperator.Lower:
return lhs() < rhs();
case BinaryOperator.LowerEquals:
return lhs() <= rhs();
case BinaryOperator.Bigger:
return lhs() > rhs();
case BinaryOperator.BiggerEquals:
return lhs() >= rhs();
default:
throw new Error("Unknown operator " + ast.operator);
}
};
StatementInterpreter.prototype.visitReadPropExpr = function (ast, ctx) {
var result;
var receiver = ast.receiver.visitExpression(this, ctx);
result = receiver[ast.name];
return result;
};
StatementInterpreter.prototype.visitReadKeyExpr = function (ast, ctx) {
var receiver = ast.receiver.visitExpression(this, ctx);
var prop = ast.index.visitExpression(this, ctx);
return receiver[prop];
};
StatementInterpreter.prototype.visitLiteralArrayExpr = function (ast, ctx) {
return this.visitAllExpressions(ast.entries, ctx);
};
StatementInterpreter.prototype.visitLiteralMapExpr = function (ast, ctx) {
var _this = this;
var result = {};
ast.entries.forEach(function (entry) { return result[entry.key] = entry.value.visitExpression(_this, ctx); });
return result;
};
StatementInterpreter.prototype.visitCommaExpr = function (ast, context) {
var values = this.visitAllExpressions(ast.parts, context);
return values[values.length - 1];
};
StatementInterpreter.prototype.visitAllExpressions = function (expressions, ctx) {
var _this = this;
return expressions.map(function (expr) { return expr.visitExpression(_this, ctx); });
};
StatementInterpreter.prototype.visitAllStatements = function (statements, ctx) {
for (var i = 0; i < statements.length; i++) {
var stmt = statements[i];
var val = stmt.visitStatement(this, ctx);
if (val instanceof ReturnValue) {
return val;
}
}
return null;
};
return StatementInterpreter;
}());
function _declareFn(varNames, statements, ctx, visitor) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return _executeFunctionStatements(varNames, args, statements, ctx, visitor);
};
}
var CATCH_ERROR_VAR$2 = 'error';
var CATCH_STACK_VAR$2 = 'stack';
/**
* @license
* Copyright Google Inc. 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 AbstractJsEmitterVisitor = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(AbstractJsEmitterVisitor, _super);
function AbstractJsEmitterVisitor() {
return _super.call(this, false) || this;
}
AbstractJsEmitterVisitor.prototype.visitDeclareClassStmt = function (stmt, ctx) {
var _this = this;
ctx.pushClass(stmt);
this._visitClassConstructor(stmt, ctx);
if (stmt.parent != null) {
ctx.print(stmt, stmt.name + ".prototype = Object.create(");
stmt.parent.visitExpression(this, ctx);
ctx.println(stmt, ".prototype);");
}
stmt.getters.forEach(function (getter) { return _this._visitClassGetter(stmt, getter, ctx); });
stmt.methods.forEach(function (method) { return _this._visitClassMethod(stmt, method, ctx); });
ctx.popClass();
return null;
};
AbstractJsEmitterVisitor.prototype._visitClassConstructor = function (stmt, ctx) {
ctx.print(stmt, "function " + stmt.name + "(");
if (stmt.constructorMethod != null) {
this._visitParams(stmt.constructorMethod.params, ctx);
}
ctx.println(stmt, ") {");
ctx.incIndent();
if (stmt.constructorMethod != null) {
if (stmt.constructorMethod.body.length > 0) {
ctx.println(stmt, "var self = this;");
this.visitAllStatements(stmt.constructorMethod.body, ctx);
}
}
ctx.decIndent();
ctx.println(stmt, "}");
};
AbstractJsEmitterVisitor.prototype._visitClassGetter = function (stmt, getter, ctx) {
ctx.println(stmt, "Object.defineProperty(" + stmt.name + ".prototype, '" + getter.name + "', { get: function() {");
ctx.incIndent();
if (getter.body.length > 0) {
ctx.println(stmt, "var self = this;");
this.visitAllStatements(getter.body, ctx);
}
ctx.decIndent();
ctx.println(stmt, "}});");
};
AbstractJsEmitterVisitor.prototype._visitClassMethod = function (stmt, method, ctx) {
ctx.print(stmt, stmt.name + ".prototype." + method.name + " = function(");
this._visitParams(method.params, ctx);
ctx.println(stmt, ") {");
ctx.incIndent();
if (method.body.length > 0) {
ctx.println(stmt, "var self = this;");
this.visitAllStatements(method.body, ctx);
}
ctx.decIndent();
ctx.println(stmt, "};");
};
AbstractJsEmitterVisitor.prototype.visitReadVarExpr = function (ast, ctx) {
if (ast.builtin === BuiltinVar.This) {
ctx.print(ast, 'self');
}
else if (ast.builtin === BuiltinVar.Super) {
throw new Error("'super' needs to be handled at a parent ast node, not at the variable level!");
}
else {
_super.prototype.visitReadVarExpr.call(this, ast, ctx);
}
return null;
};
AbstractJsEmitterVisitor.prototype.visitDeclareVarStmt = function (stmt, ctx) {
ctx.print(stmt, "var " + stmt.name);
if (stmt.value) {
ctx.print(stmt, ' = ');
stmt.value.visitExpression(this, ctx);
}
ctx.println(stmt, ";");
return null;
};
AbstractJsEmitterVisitor.prototype.visitCastExpr = function (ast, ctx) {
ast.value.visitExpression(this, ctx);
return null;
};
AbstractJsEmitterVisitor.prototype.visitInvokeFunctionExpr = function (expr, ctx) {
var fnExpr = expr.fn;
if (fnExpr instanceof ReadVarExpr && fnExpr.builtin === BuiltinVar.Super) {
ctx.currentClass.parent.visitExpression(this, ctx);
ctx.print(expr, ".call(this");
if (expr.args.length > 0) {
ctx.print(expr, ", ");
this.visitAllExpressions(expr.args, ctx, ',');
}
ctx.print(expr, ")");
}
else {
_super.prototype.visitInvokeFunctionExpr.call(this, expr, ctx);
}
return null;
};
AbstractJsEmitterVisitor.prototype.visitFunctionExpr = function (ast, ctx) {
ctx.print(ast, "function" + (ast.name ? ' ' + ast.name : '') + "(");
this._visitParams(ast.params, ctx);
ctx.println(ast, ") {");
ctx.incIndent();
this.visitAllStatements(ast.statements, ctx);
ctx.decIndent();
ctx.print(ast, "}");
return null;
};
AbstractJsEmitterVisitor.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {
ctx.print(stmt, "function " + stmt.name + "(");
this._visitParams(stmt.params, ctx);
ctx.println(stmt, ") {");
ctx.incIndent();
this.visitAllStatements(stmt.statements, ctx);
ctx.decIndent();
ctx.println(stmt, "}");
return null;
};
AbstractJsEmitterVisitor.prototype.visitTryCatchStmt = function (stmt, ctx) {
ctx.println(stmt, "try {");
ctx.incIndent();
this.visitAllStatements(stmt.bodyStmts, ctx);
ctx.decIndent();
ctx.println(stmt, "} catch (" + CATCH_ERROR_VAR$1.name + ") {");
ctx.incIndent();
var catchStmts = [CATCH_STACK_VAR$1.set(CATCH_ERROR_VAR$1.prop('stack')).toDeclStmt(null, [
StmtModifier.Final
])].concat(stmt.catchStmts);
this.visitAllStatements(catchStmts, ctx);
ctx.decIndent();
ctx.println(stmt, "}");
return null;
};
AbstractJsEmitterVisitor.prototype._visitParams = function (params, ctx) {
this.visitAllObjects(function (param) { return ctx.print(null, param.name); }, params, ctx, ',');
};
AbstractJsEmitterVisitor.prototype.getBuiltinMethodName = function (method) {
var name;
switch (method) {
case BuiltinMethod.ConcatArray:
name = 'concat';
break;
case BuiltinMethod.SubscribeObservable:
name = 'subscribe';
break;
case BuiltinMethod.Bind:
name = 'bind';
break;
default:
throw new Error("Unknown builtin method: " + method);
}
return name;
};
return AbstractJsEmitterVisitor;
}(AbstractEmitterVisitor));
/**
* @license
* Copyright Google Inc. 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
*/
function evalExpression(sourceUrl, ctx, vars, createSourceMap) {
var fnBody = ctx.toSource() + "\n//# sourceURL=" + sourceUrl;
var fnArgNames = [];
var fnArgValues = [];
for (var argName in vars) {
fnArgNames.push(argName);
fnArgValues.push(vars[argName]);
}
if (createSourceMap) {
// using `new Function(...)` generates a header, 1 line of no arguments, 2 lines otherwise
// E.g. ```
// function anonymous(a,b,c
// /**/) { ... }```
// We don't want to hard code this fact, so we auto detect it via an empty function first.
var emptyFn = new (Function.bind.apply(Function, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], fnArgNames.concat('return null;'))))().toString();
var headerLines = emptyFn.slice(0, emptyFn.indexOf('return null;')).split('\n').length - 1;
fnBody += "\n" + ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment();
}
return new (Function.bind.apply(Function, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], fnArgNames.concat(fnBody))))().apply(void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(fnArgValues));
}
function jitStatements(sourceUrl, statements, reflector, createSourceMaps) {
var converter = new JitEmitterVisitor(reflector);
var ctx = EmitterVisitorContext.createRoot();
converter.visitAllStatements(statements, ctx);
converter.createReturnStmt(ctx);
return evalExpression(sourceUrl, ctx, converter.getArgs(), createSourceMaps);
}
var JitEmitterVisitor = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(JitEmitterVisitor, _super);
function JitEmitterVisitor(reflector) {
var _this = _super.call(this) || this;
_this.reflector = reflector;
_this._evalArgNames = [];
_this._evalArgValues = [];
_this._evalExportedVars = [];
return _this;
}
JitEmitterVisitor.prototype.createReturnStmt = function (ctx) {
var stmt = new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map(function (resultVar) { return new LiteralMapEntry(resultVar, variable(resultVar), false); })));
stmt.visitStatement(this, ctx);
};
JitEmitterVisitor.prototype.getArgs = function () {
var result = {};
for (var i = 0; i < this._evalArgNames.length; i++) {
result[this._evalArgNames[i]] = this._evalArgValues[i];
}
return result;
};
JitEmitterVisitor.prototype.visitExternalExpr = function (ast, ctx) {
var value = this.reflector.resolveExternalReference(ast.value);
var id = this._evalArgValues.indexOf(value);
if (id === -1) {
id = this._evalArgValues.length;
this._evalArgValues.push(value);
var name_1 = identifierName({ reference: value }) || 'val';
this._evalArgNames.push("jit_" + name_1 + "_" + id);
}
ctx.print(ast, this._evalArgNames[id]);
return null;
};
JitEmitterVisitor.prototype.visitDeclareVarStmt = function (stmt, ctx) {
if (stmt.hasModifier(StmtModifier.Exported)) {
this._evalExportedVars.push(stmt.name);
}
return _super.prototype.visitDeclareVarStmt.call(this, stmt, ctx);
};
JitEmitterVisitor.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {
if (stmt.hasModifier(StmtModifier.Exported)) {
this._evalExportedVars.push(stmt.name);
}
return _super.prototype.visitDeclareFunctionStmt.call(this, stmt, ctx);
};
JitEmitterVisitor.prototype.visitDeclareClassStmt = function (stmt, ctx) {
if (stmt.hasModifier(StmtModifier.Exported)) {
this._evalExportedVars.push(stmt.name);
}
return _super.prototype.visitDeclareClassStmt.call(this, stmt, ctx);
};
return JitEmitterVisitor;
}(AbstractJsEmitterVisitor));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* An internal module of the Angular compiler that begins with component types,
* extracts templates, and eventually produces a compiled version of the component
* ready for linking into an application.
*
* @security When compiling templates at runtime, you must ensure that the entire template comes
* from a trusted source. Attacker-controlled data introduced by a template could expose your
* application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).
*/
var JitCompiler = /** @class */ (function () {
function JitCompiler(_metadataResolver, _templateParser, _styleCompiler, _viewCompiler, _ngModuleCompiler, _summaryResolver, _reflector, _compilerConfig, _console, getExtraNgModuleProviders) {
this._metadataResolver = _metadataResolver;
this._templateParser = _templateParser;
this._styleCompiler = _styleCompiler;
this._viewCompiler = _viewCompiler;
this._ngModuleCompiler = _ngModuleCompiler;
this._summaryResolver = _summaryResolver;
this._reflector = _reflector;
this._compilerConfig = _compilerConfig;
this._console = _console;
this.getExtraNgModuleProviders = getExtraNgModuleProviders;
this._compiledTemplateCache = new Map();
this._compiledHostTemplateCache = new Map();
this._compiledDirectiveWrapperCache = new Map();
this._compiledNgModuleCache = new Map();
this._sharedStylesheetCount = 0;
this._addedAotSummaries = new Set();
}
JitCompiler.prototype.compileModuleSync = function (moduleType) {
return SyncAsync.assertSync(this._compileModuleAndComponents(moduleType, true));
};
JitCompiler.prototype.compileModuleAsync = function (moduleType) {
return Promise.resolve(this._compileModuleAndComponents(moduleType, false));
};
JitCompiler.prototype.compileModuleAndAllComponentsSync = function (moduleType) {
return SyncAsync.assertSync(this._compileModuleAndAllComponents(moduleType, true));
};
JitCompiler.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {
return Promise.resolve(this._compileModuleAndAllComponents(moduleType, false));
};
JitCompiler.prototype.getComponentFactory = function (component) {
var summary = this._metadataResolver.getDirectiveSummary(component);
return summary.componentFactory;
};
JitCompiler.prototype.loadAotSummaries = function (summaries) {
this.clearCache();
this._addAotSummaries(summaries);
};
JitCompiler.prototype._addAotSummaries = function (fn$$1) {
if (this._addedAotSummaries.has(fn$$1)) {
return;
}
this._addedAotSummaries.add(fn$$1);
var summaries = fn$$1();
for (var i = 0; i < summaries.length; i++) {
var entry = summaries[i];
if (typeof entry === 'function') {
this._addAotSummaries(entry);
}
else {
var summary = entry;
this._summaryResolver.addSummary({ symbol: summary.type.reference, metadata: null, type: summary });
}
}
};
JitCompiler.prototype.hasAotSummary = function (ref) { return !!this._summaryResolver.resolveSummary(ref); };
JitCompiler.prototype._filterJitIdentifiers = function (ids) {
var _this = this;
return ids.map(function (mod) { return mod.reference; }).filter(function (ref) { return !_this.hasAotSummary(ref); });
};
JitCompiler.prototype._compileModuleAndComponents = function (moduleType, isSync) {
var _this = this;
return SyncAsync.then(this._loadModules(moduleType, isSync), function () {
_this._compileComponents(moduleType, null);
return _this._compileModule(moduleType);
});
};
JitCompiler.prototype._compileModuleAndAllComponents = function (moduleType, isSync) {
var _this = this;
return SyncAsync.then(this._loadModules(moduleType, isSync), function () {
var componentFactories = [];
_this._compileComponents(moduleType, componentFactories);
return {
ngModuleFactory: _this._compileModule(moduleType),
componentFactories: componentFactories
};
});
};
JitCompiler.prototype._loadModules = function (mainModule, isSync) {
var _this = this;
var loading = [];
var mainNgModule = this._metadataResolver.getNgModuleMetadata(mainModule);
// Note: for runtime compilation, we want to transitively compile all modules,
// so we also need to load the declared directives / pipes for all nested modules.
this._filterJitIdentifiers(mainNgModule.transitiveModule.modules).forEach(function (nestedNgModule) {
// getNgModuleMetadata only returns null if the value passed in is not an NgModule
var moduleMeta = _this._metadataResolver.getNgModuleMetadata(nestedNgModule);
_this._filterJitIdentifiers(moduleMeta.declaredDirectives).forEach(function (ref) {
var promise = _this._metadataResolver.loadDirectiveMetadata(moduleMeta.type.reference, ref, isSync);
if (promise) {
loading.push(promise);
}
});
_this._filterJitIdentifiers(moduleMeta.declaredPipes)
.forEach(function (ref) { return _this._metadataResolver.getOrLoadPipeMetadata(ref); });
});
return SyncAsync.all(loading);
};
JitCompiler.prototype._compileModule = function (moduleType) {
var ngModuleFactory = this._compiledNgModuleCache.get(moduleType);
if (!ngModuleFactory) {
var moduleMeta = this._metadataResolver.getNgModuleMetadata(moduleType);
// Always provide a bound Compiler
var extraProviders = this.getExtraNgModuleProviders(moduleMeta.type.reference);
var outputCtx = createOutputContext();
var compileResult = this._ngModuleCompiler.compile(outputCtx, moduleMeta, extraProviders);
ngModuleFactory = this._interpretOrJit(ngModuleJitUrl(moduleMeta), outputCtx.statements)[compileResult.ngModuleFactoryVar];
this._compiledNgModuleCache.set(moduleMeta.type.reference, ngModuleFactory);
}
return ngModuleFactory;
};
/**
* @internal
*/
JitCompiler.prototype._compileComponents = function (mainModule, allComponentFactories) {
var _this = this;
var ngModule = this._metadataResolver.getNgModuleMetadata(mainModule);
var moduleByJitDirective = new Map();
var templates = new Set();
var transJitModules = this._filterJitIdentifiers(ngModule.transitiveModule.modules);
transJitModules.forEach(function (localMod) {
var localModuleMeta = _this._metadataResolver.getNgModuleMetadata(localMod);
_this._filterJitIdentifiers(localModuleMeta.declaredDirectives).forEach(function (dirRef) {
moduleByJitDirective.set(dirRef, localModuleMeta);
var dirMeta = _this._metadataResolver.getDirectiveMetadata(dirRef);
if (dirMeta.isComponent) {
templates.add(_this._createCompiledTemplate(dirMeta, localModuleMeta));
if (allComponentFactories) {
var template = _this._createCompiledHostTemplate(dirMeta.type.reference, localModuleMeta);
templates.add(template);
allComponentFactories.push(dirMeta.componentFactory);
}
}
});
});
transJitModules.forEach(function (localMod) {
var localModuleMeta = _this._metadataResolver.getNgModuleMetadata(localMod);
_this._filterJitIdentifiers(localModuleMeta.declaredDirectives).forEach(function (dirRef) {
var dirMeta = _this._metadataResolver.getDirectiveMetadata(dirRef);
if (dirMeta.isComponent) {
dirMeta.entryComponents.forEach(function (entryComponentType) {
var moduleMeta = moduleByJitDirective.get(entryComponentType.componentType);
templates.add(_this._createCompiledHostTemplate(entryComponentType.componentType, moduleMeta));
});
}
});
localModuleMeta.entryComponents.forEach(function (entryComponentType) {
if (!_this.hasAotSummary(entryComponentType.componentType.reference)) {
var moduleMeta = moduleByJitDirective.get(entryComponentType.componentType);
templates.add(_this._createCompiledHostTemplate(entryComponentType.componentType, moduleMeta));
}
});
});
templates.forEach(function (template) { return _this._compileTemplate(template); });
};
JitCompiler.prototype.clearCacheFor = function (type) {
this._compiledNgModuleCache.delete(type);
this._metadataResolver.clearCacheFor(type);
this._compiledHostTemplateCache.delete(type);
var compiledTemplate = this._compiledTemplateCache.get(type);
if (compiledTemplate) {
this._compiledTemplateCache.delete(type);
}
};
JitCompiler.prototype.clearCache = function () {
// Note: don't clear the _addedAotSummaries, as they don't change!
this._metadataResolver.clearCache();
this._compiledTemplateCache.clear();
this._compiledHostTemplateCache.clear();
this._compiledNgModuleCache.clear();
};
JitCompiler.prototype._createCompiledHostTemplate = function (compType, ngModule) {
if (!ngModule) {
throw new Error("Component " + stringify(compType) + " is not part of any NgModule or the module has not been imported into your module.");
}
var compiledTemplate = this._compiledHostTemplateCache.get(compType);
if (!compiledTemplate) {
var compMeta = this._metadataResolver.getDirectiveMetadata(compType);
assertComponent(compMeta);
var hostMeta = this._metadataResolver.getHostComponentMetadata(compMeta, compMeta.componentFactory.viewDefFactory);
compiledTemplate =
new CompiledTemplate(true, compMeta.type, hostMeta, ngModule, [compMeta.type]);
this._compiledHostTemplateCache.set(compType, compiledTemplate);
}
return compiledTemplate;
};
JitCompiler.prototype._createCompiledTemplate = function (compMeta, ngModule) {
var compiledTemplate = this._compiledTemplateCache.get(compMeta.type.reference);
if (!compiledTemplate) {
assertComponent(compMeta);
compiledTemplate = new CompiledTemplate(false, compMeta.type, compMeta, ngModule, ngModule.transitiveModule.directives);
this._compiledTemplateCache.set(compMeta.type.reference, compiledTemplate);
}
return compiledTemplate;
};
JitCompiler.prototype._compileTemplate = function (template) {
var _this = this;
if (template.isCompiled) {
return;
}
var compMeta = template.compMeta;
var externalStylesheetsByModuleUrl = new Map();
var outputContext = createOutputContext();
var componentStylesheet = this._styleCompiler.compileComponent(outputContext, compMeta);
compMeta.template.externalStylesheets.forEach(function (stylesheetMeta) {
var compiledStylesheet = _this._styleCompiler.compileStyles(createOutputContext(), compMeta, stylesheetMeta);
externalStylesheetsByModuleUrl.set(stylesheetMeta.moduleUrl, compiledStylesheet);
});
this._resolveStylesCompileResult(componentStylesheet, externalStylesheetsByModuleUrl);
var pipes = template.ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });
var _a = this._parseTemplate(compMeta, template.ngModule, template.directives), parsedTemplate = _a.template, usedPipes = _a.pipes;
var compileResult = this._viewCompiler.compileComponent(outputContext, compMeta, parsedTemplate, variable(componentStylesheet.stylesVar), usedPipes);
var evalResult = this._interpretOrJit(templateJitUrl(template.ngModule.type, template.compMeta), outputContext.statements);
var viewClass = evalResult[compileResult.viewClassVar];
var rendererType = evalResult[compileResult.rendererTypeVar];
template.compiled(viewClass, rendererType);
};
JitCompiler.prototype._parseTemplate = function (compMeta, ngModule, directiveIdentifiers) {
var _this = this;
// Note: ! is ok here as components always have a template.
var preserveWhitespaces = compMeta.template.preserveWhitespaces;
var directives = directiveIdentifiers.map(function (dir) { return _this._metadataResolver.getDirectiveSummary(dir.reference); });
var pipes = ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });
return this._templateParser.parse(compMeta, compMeta.template.htmlAst, directives, pipes, ngModule.schemas, templateSourceUrl(ngModule.type, compMeta, compMeta.template), preserveWhitespaces);
};
JitCompiler.prototype._resolveStylesCompileResult = function (result, externalStylesheetsByModuleUrl) {
var _this = this;
result.dependencies.forEach(function (dep, i) {
var nestedCompileResult = externalStylesheetsByModuleUrl.get(dep.moduleUrl);
var nestedStylesArr = _this._resolveAndEvalStylesCompileResult(nestedCompileResult, externalStylesheetsByModuleUrl);
dep.setValue(nestedStylesArr);
});
};
JitCompiler.prototype._resolveAndEvalStylesCompileResult = function (result, externalStylesheetsByModuleUrl) {
this._resolveStylesCompileResult(result, externalStylesheetsByModuleUrl);
return this._interpretOrJit(sharedStylesheetJitUrl(result.meta, this._sharedStylesheetCount++), result.outputCtx.statements)[result.stylesVar];
};
JitCompiler.prototype._interpretOrJit = function (sourceUrl, statements) {
if (!this._compilerConfig.useJit) {
return interpretStatements(statements, this._reflector);
}
else {
return jitStatements(sourceUrl, statements, this._reflector, this._compilerConfig.jitDevMode);
}
};
return JitCompiler;
}());
var CompiledTemplate = /** @class */ (function () {
function CompiledTemplate(isHost, compType, compMeta, ngModule, directives) {
this.isHost = isHost;
this.compType = compType;
this.compMeta = compMeta;
this.ngModule = ngModule;
this.directives = directives;
this._viewClass = null;
this.isCompiled = false;
}
CompiledTemplate.prototype.compiled = function (viewClass, rendererType) {
this._viewClass = viewClass;
this.compMeta.componentViewType.setDelegate(viewClass);
for (var prop in rendererType) {
this.compMeta.rendererType[prop] = rendererType[prop];
}
this.isCompiled = true;
};
return CompiledTemplate;
}());
function assertComponent(meta) {
if (!meta.isComponent) {
throw new Error("Could not compile '" + identifierName(meta.type) + "' because it is not a component.");
}
}
function createOutputContext() {
var importExpr$$1 = function (symbol) {
return importExpr({ name: identifierName(symbol), moduleName: null, runtime: symbol });
};
return { statements: [], genFilePath: '', importExpr: importExpr$$1, constantPool: new ConstantPool() };
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Provides access to reflection data about symbols that the compiler needs.
*/
var CompileReflector = /** @class */ (function () {
function CompileReflector() {
}
return CompileReflector;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Create a {@link UrlResolver} with no package prefix.
*/
function createUrlResolverWithoutPackagePrefix() {
return new UrlResolver();
}
function createOfflineCompileUrlResolver() {
return new UrlResolver('.');
}
var UrlResolver = /** @class */ (function () {
function UrlResolverImpl(_packagePrefix) {
if (_packagePrefix === void 0) { _packagePrefix = null; }
this._packagePrefix = _packagePrefix;
}
/**
* Resolves the `url` given the `baseUrl`:
* - when the `url` is null, the `baseUrl` is returned,
* - if `url` is relative ('path/to/here', './path/to/here'), the resolved url is a combination of
* `baseUrl` and `url`,
* - if `url` is absolute (it has a scheme: 'http://', 'https://' or start with '/'), the `url` is
* returned as is (ignoring the `baseUrl`)
*/
UrlResolverImpl.prototype.resolve = function (baseUrl, url) {
var resolvedUrl = url;
if (baseUrl != null && baseUrl.length > 0) {
resolvedUrl = _resolveUrl(baseUrl, resolvedUrl);
}
var resolvedParts = _split(resolvedUrl);
var prefix = this._packagePrefix;
if (prefix != null && resolvedParts != null &&
resolvedParts[_ComponentIndex.Scheme] == 'package') {
var path = resolvedParts[_ComponentIndex.Path];
prefix = prefix.replace(/\/+$/, '');
path = path.replace(/^\/+/, '');
return prefix + "/" + path;
}
return resolvedUrl;
};
return UrlResolverImpl;
}());
/**
* Extract the scheme of a URL.
*/
function getUrlScheme(url) {
var match = _split(url);
return (match && match[_ComponentIndex.Scheme]) || '';
}
// The code below is adapted from Traceur:
// https://github.com/google/traceur-compiler/blob/9511c1dafa972bf0de1202a8a863bad02f0f95a8/src/runtime/url.js
/**
* Builds a URI string from already-encoded parts.
*
* No encoding is performed. Any component may be omitted as either null or
* undefined.
*
* @param opt_scheme The scheme such as 'http'.
* @param opt_userInfo The user name before the '@'.
* @param opt_domain The domain such as 'www.google.com', already
* URI-encoded.
* @param opt_port The port number.
* @param opt_path The path, already URI-encoded. If it is not
* empty, it must begin with a slash.
* @param opt_queryData The URI-encoded query data.
* @param opt_fragment The URI-encoded fragment identifier.
* @return The fully combined URI.
*/
function _buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) {
var out = [];
if (opt_scheme != null) {
out.push(opt_scheme + ':');
}
if (opt_domain != null) {
out.push('//');
if (opt_userInfo != null) {
out.push(opt_userInfo + '@');
}
out.push(opt_domain);
if (opt_port != null) {
out.push(':' + opt_port);
}
}
if (opt_path != null) {
out.push(opt_path);
}
if (opt_queryData != null) {
out.push('?' + opt_queryData);
}
if (opt_fragment != null) {
out.push('#' + opt_fragment);
}
return out.join('');
}
/**
* A regular expression for breaking a URI into its component parts.
*
* {@link http://www.gbiv.com/protocols/uri/rfc/rfc3986.html#RFC2234} says
* As the "first-match-wins" algorithm is identical to the "greedy"
* disambiguation method used by POSIX regular expressions, it is natural and
* commonplace to use a regular expression for parsing the potential five
* components of a URI reference.
*
* The following line is the regular expression for breaking-down a
* well-formed URI reference into its components.
*
* <pre>
* ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
* 12 3 4 5 6 7 8 9
* </pre>
*
* The numbers in the second line above are only to assist readability; they
* indicate the reference points for each subexpression (i.e., each paired
* parenthesis). We refer to the value matched for subexpression <n> as $<n>.
* For example, matching the above expression to
* <pre>
* http://www.ics.uci.edu/pub/ietf/uri/#Related
* </pre>
* results in the following subexpression matches:
* <pre>
* $1 = http:
* $2 = http
* $3 = //www.ics.uci.edu
* $4 = www.ics.uci.edu
* $5 = /pub/ietf/uri/
* $6 = <undefined>
* $7 = <undefined>
* $8 = #Related
* $9 = Related
* </pre>
* where <undefined> indicates that the component is not present, as is the
* case for the query component in the above example. Therefore, we can
* determine the value of the five components as
* <pre>
* scheme = $2
* authority = $4
* path = $5
* query = $7
* fragment = $9
* </pre>
*
* The regular expression has been modified slightly to expose the
* userInfo, domain, and port separately from the authority.
* The modified version yields
* <pre>
* $1 = http scheme
* $2 = <undefined> userInfo -\
* $3 = www.ics.uci.edu domain | authority
* $4 = <undefined> port -/
* $5 = /pub/ietf/uri/ path
* $6 = <undefined> query without ?
* $7 = Related fragment without #
* </pre>
* @internal
*/
var _splitRe = new RegExp('^' +
'(?:' +
'([^:/?#.]+)' + // scheme - ignore special characters
// used by other URL parts such as :,
// ?, /, #, and .
':)?' +
'(?://' +
'(?:([^/?#]*)@)?' + // userInfo
'([\\w\\d\\-\\u0100-\\uffff.%]*)' + // domain - restrict to letters,
// digits, dashes, dots, percent
// escapes, and unicode characters.
'(?::([0-9]+))?' + // port
')?' +
'([^?#]+)?' + // path
'(?:\\?([^#]*))?' + // query
'(?:#(.*))?' + // fragment
'$');
/**
* The index of each URI component in the return value of goog.uri.utils.split.
* @enum {number}
*/
var _ComponentIndex;
(function (_ComponentIndex) {
_ComponentIndex[_ComponentIndex["Scheme"] = 1] = "Scheme";
_ComponentIndex[_ComponentIndex["UserInfo"] = 2] = "UserInfo";
_ComponentIndex[_ComponentIndex["Domain"] = 3] = "Domain";
_ComponentIndex[_ComponentIndex["Port"] = 4] = "Port";
_ComponentIndex[_ComponentIndex["Path"] = 5] = "Path";
_ComponentIndex[_ComponentIndex["QueryData"] = 6] = "QueryData";
_ComponentIndex[_ComponentIndex["Fragment"] = 7] = "Fragment";
})(_ComponentIndex || (_ComponentIndex = {}));
/**
* Splits a URI into its component parts.
*
* Each component can be accessed via the component indices; for example:
* <pre>
* goog.uri.utils.split(someStr)[goog.uri.utils.CompontentIndex.QUERY_DATA];
* </pre>
*
* @param uri The URI string to examine.
* @return Each component still URI-encoded.
* Each component that is present will contain the encoded value, whereas
* components that are not present will be undefined or empty, depending
* on the browser's regular expression implementation. Never null, since
* arbitrary strings may still look like path names.
*/
function _split(uri) {
return uri.match(_splitRe);
}
/**
* Removes dot segments in given path component, as described in
* RFC 3986, section 5.2.4.
*
* @param path A non-empty path component.
* @return Path component with removed dot segments.
*/
function _removeDotSegments(path) {
if (path == '/')
return '/';
var leadingSlash = path[0] == '/' ? '/' : '';
var trailingSlash = path[path.length - 1] === '/' ? '/' : '';
var segments = path.split('/');
var out = [];
var up = 0;
for (var pos = 0; pos < segments.length; pos++) {
var segment = segments[pos];
switch (segment) {
case '':
case '.':
break;
case '..':
if (out.length > 0) {
out.pop();
}
else {
up++;
}
break;
default:
out.push(segment);
}
}
if (leadingSlash == '') {
while (up-- > 0) {
out.unshift('..');
}
if (out.length === 0)
out.push('.');
}
return leadingSlash + out.join('/') + trailingSlash;
}
/**
* Takes an array of the parts from split and canonicalizes the path part
* and then joins all the parts.
*/
function _joinAndCanonicalizePath(parts) {
var path = parts[_ComponentIndex.Path];
path = path == null ? '' : _removeDotSegments(path);
parts[_ComponentIndex.Path] = path;
return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);
}
/**
* Resolves a URL.
* @param base The URL acting as the base URL.
* @param to The URL to resolve.
*/
function _resolveUrl(base, url) {
var parts = _split(encodeURI(url));
var baseParts = _split(base);
if (parts[_ComponentIndex.Scheme] != null) {
return _joinAndCanonicalizePath(parts);
}
else {
parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme];
}
for (var i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) {
if (parts[i] == null) {
parts[i] = baseParts[i];
}
}
if (parts[_ComponentIndex.Path][0] == '/') {
return _joinAndCanonicalizePath(parts);
}
var path = baseParts[_ComponentIndex.Path];
if (path == null)
path = '/';
var index = path.lastIndexOf('/');
path = path.substring(0, index + 1) + parts[_ComponentIndex.Path];
parts[_ComponentIndex.Path] = path;
return _joinAndCanonicalizePath(parts);
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* An interface for retrieving documents by URL that the compiler uses
* to load templates.
*/
var ResourceLoader = /** @class */ (function () {
function ResourceLoader() {
}
ResourceLoader.prototype.get = function (url) { return ''; };
return ResourceLoader;
}());
/**
* @license
* Copyright Google Inc. 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 Extractor = /** @class */ (function () {
function Extractor(host, staticSymbolResolver, messageBundle, metadataResolver) {
this.host = host;
this.staticSymbolResolver = staticSymbolResolver;
this.messageBundle = messageBundle;
this.metadataResolver = metadataResolver;
}
Extractor.prototype.extract = function (rootFiles) {
var _this = this;
var _a = analyzeAndValidateNgModules(rootFiles, this.host, this.staticSymbolResolver, this.metadataResolver), files = _a.files, ngModules = _a.ngModules;
return Promise
.all(ngModules.map(function (ngModule) { return _this.metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false); }))
.then(function () {
var errors = [];
files.forEach(function (file) {
var compMetas = [];
file.directives.forEach(function (directiveType) {
var dirMeta = _this.metadataResolver.getDirectiveMetadata(directiveType);
if (dirMeta && dirMeta.isComponent) {
compMetas.push(dirMeta);
}
});
compMetas.forEach(function (compMeta) {
var html = compMeta.template.template;
var interpolationConfig = InterpolationConfig.fromArray(compMeta.template.interpolation);
errors.push.apply(errors, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(_this.messageBundle.updateFromTemplate(html, file.fileName, interpolationConfig)));
});
});
if (errors.length) {
throw new Error(errors.map(function (e) { return e.toString(); }).join('\n'));
}
return _this.messageBundle;
});
};
Extractor.create = function (host, locale) {
var htmlParser = new HtmlParser();
var urlResolver = createAotUrlResolver(host);
var symbolCache = new StaticSymbolCache();
var summaryResolver = new AotSummaryResolver(host, symbolCache);
var staticSymbolResolver = new StaticSymbolResolver(host, symbolCache, summaryResolver);
var staticReflector = new StaticReflector(summaryResolver, staticSymbolResolver);
var config = new CompilerConfig({ defaultEncapsulation: ViewEncapsulation.Emulated, useJit: false });
var normalizer = new DirectiveNormalizer({ get: function (url) { return host.loadResource(url); } }, urlResolver, htmlParser, config);
var elementSchemaRegistry = new DomElementSchemaRegistry();
var resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector);
// TODO(vicb): implicit tags & attributes
var messageBundle = new MessageBundle(htmlParser, [], {}, locale);
var extractor = new Extractor(host, staticSymbolResolver, messageBundle, resolver);
return { extractor: extractor, staticReflector: staticReflector };
};
return Extractor;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
// This file only reexports content of the `src` folder. Keep it that way.
/**
* @license
* Copyright Google Inc. 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
*/
// This file only reexports content of the `src` folder. Keep it that way.
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
//# sourceMappingURL=compiler.js.map
/***/ }),
/***/ "./node_modules/@angular/core/fesm5/core.js":
/*!**************************************************!*\
!*** ./node_modules/@angular/core/fesm5/core.js ***!
\**************************************************/
/*! exports provided: ɵangular_packages_core_core_j, ɵangular_packages_core_core_k, ɵangular_packages_core_core_l, ɵangular_packages_core_core_f, ɵangular_packages_core_core_g, ɵangular_packages_core_core_h, ɵangular_packages_core_core_i, ɵangular_packages_core_core_c, ɵangular_packages_core_core_d, ɵangular_packages_core_core_e, ɵangular_packages_core_core_m, ɵangular_packages_core_core_o, ɵangular_packages_core_core_n, ɵangular_packages_core_core_r, ɵangular_packages_core_core_p, ɵangular_packages_core_core_q, ɵangular_packages_core_core_v, ɵangular_packages_core_core_x, ɵangular_packages_core_core_w, ɵangular_packages_core_core_u, ɵangular_packages_core_core_y, ɵangular_packages_core_core_bb, ɵangular_packages_core_core_bd, ɵangular_packages_core_core_be, ɵangular_packages_core_core_bc, ɵangular_packages_core_core_ba, ɵangular_packages_core_core_z, ɵangular_packages_core_core_a, ɵangular_packages_core_core_b, ɵangular_packages_core_core_s, ɵangular_packages_core_core_t, createPlatform, assertPlatform, destroyPlatform, getPlatform, PlatformRef, ApplicationRef, enableProdMode, isDevMode, createPlatformFactory, NgProbeToken, APP_ID, PACKAGE_ROOT_URL, PLATFORM_INITIALIZER, PLATFORM_ID, APP_BOOTSTRAP_LISTENER, APP_INITIALIZER, ApplicationInitStatus, DebugElement, DebugNode, asNativeElements, getDebugNode, Testability, TestabilityRegistry, setTestabilityGetter, TRANSLATIONS, TRANSLATIONS_FORMAT, LOCALE_ID, MissingTranslationStrategy, ApplicationModule, wtfCreateScope, wtfLeave, wtfStartTimeRange, wtfEndTimeRange, Type, EventEmitter, ErrorHandler, Sanitizer, SecurityContext, ANALYZE_FOR_ENTRY_COMPONENTS, Attribute, ContentChild, ContentChildren, Query, ViewChild, ViewChildren, Component, Directive, HostBinding, HostListener, Input, Output, Pipe, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, NgModule, ViewEncapsulation, Version, VERSION, defineInjectable, defineInjector, forwardRef, resolveForwardRef, Injectable, inject, INJECTOR, Injector, ReflectiveInjector, createInjector, ResolvedReflectiveFactory, ReflectiveKey, InjectionToken, Inject, Optional, Self, SkipSelf, Host, NgZone, RenderComponentType, Renderer, Renderer2, RendererFactory2, RendererStyleFlags2, RootRenderer, COMPILER_OPTIONS, Compiler, CompilerFactory, ModuleWithComponentFactories, ComponentFactory, ComponentRef, ComponentFactoryResolver, ElementRef, NgModuleFactory, NgModuleRef, NgModuleFactoryLoader, getModuleFactory, QueryList, SystemJsNgModuleLoader, SystemJsNgModuleLoaderConfig, TemplateRef, ViewContainerRef, EmbeddedViewRef, ViewRef, ChangeDetectionStrategy, ChangeDetectorRef, DefaultIterableDiffer, IterableDiffers, KeyValueDiffers, SimpleChange, WrappedValue, platformCore, ɵALLOW_MULTIPLE_PLATFORMS, ɵAPP_ID_RANDOM_PROVIDER, ɵdefaultIterableDiffers, ɵdevModeEqual, ɵisListLikeIterable, ɵChangeDetectorStatus, ɵisDefaultChangeDetectionStrategy, ɵConsole, ɵinject, ɵsetCurrentInjector, ɵAPP_ROOT, ɵComponentFactory, ɵCodegenComponentFactoryResolver, ɵReflectionCapabilities, ɵRenderDebugInfo, ɵ_sanitizeHtml, ɵ_sanitizeStyle, ɵ_sanitizeUrl, ɵglobal, ɵlooseIdentical, ɵstringify, ɵmakeDecorator, ɵisObservable, ɵisPromise, ɵclearOverrides, ɵoverrideComponentView, ɵoverrideProvider, ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, ɵdefineComponent, ɵdefineDirective, ɵdefinePipe, ɵdetectChanges, ɵrenderComponent, ɵdirectiveInject, ɵinjectTemplateRef, ɵinjectViewContainerRef, ɵinjectChangeDetectorRef, ɵinjectAttribute, ɵPublicFeature, ɵNgOnChangesFeature, ɵmarkDirty, ɵNC, ɵC, ɵE, ɵL, ɵT, ɵV, ɵQ, ɵd, ɵP, ɵb, ɵi1, ɵi2, ɵi3, ɵi4, ɵi5, ɵi6, ɵi7, ɵi8, ɵiV, ɵpb1, ɵpb2, ɵpb3, ɵpb4, ɵpbV, ɵf0, ɵf1, ɵf2, ɵf3, ɵf4, ɵf5, ɵf6, ɵf7, ɵf8, ɵfV, ɵcR, ɵcr, ɵqR, ɵe, ɵp, ɵpD, ɵa, ɵs, ɵsn, ɵk, ɵkn, ɵt, ɵv, ɵst, ɵld, ɵPp, ɵwhenRendered, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl, ɵsanitizeHtml, ɵsanitizeStyle, ɵsanitizeUrl, ɵsanitizeResourceUrl, ɵregisterModuleFactory, ɵEMPTY_ARRAY, ɵEMPTY_MAP, ɵand, ɵccf, ɵcmf, ɵcrt, ɵdid, ɵeld, ɵelementEventFullName, ɵgetComponentViewDefinitionFactory, ɵinlineInterpolate, ɵinterpolate, ɵmod, ɵmpd, ɵncd, ɵnov, ɵpid, ɵprd, ɵpad, ɵpod, ɵppd, ɵqud, ɵted, ɵunv, ɵvid */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_j", function() { return _iterableDiffersFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_k", function() { return _keyValueDiffersFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_l", function() { return _localeFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_f", function() { return _appIdRandomProviderFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_g", function() { return defaultKeyValueDiffers; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_h", function() { return DefaultIterableDifferFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_i", function() { return DefaultKeyValueDifferFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_c", function() { return ReflectiveInjector_; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_d", function() { return ReflectiveDependency; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_e", function() { return resolveReflectiveProviders; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_m", function() { return wtfEnabled; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_o", function() { return createScope; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_n", function() { return detectWTF; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_r", function() { return endTimeRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_p", function() { return leave; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_q", function() { return startTimeRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_v", function() { return getOrCreateChangeDetectorRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_x", function() { return getOrCreateContainerRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_w", function() { return getOrCreateInjectable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_u", function() { return getOrCreateNodeInjector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_y", function() { return getOrCreateTemplateRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bb", function() { return bindingUpdated; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bd", function() { return bindingUpdated2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_be", function() { return bindingUpdated4; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bc", function() { return checkAndUpdateBinding$1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_ba", function() { return consumeBinding; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_z", function() { return getCreationMode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_a", function() { return makeParamDecorator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_b", function() { return makePropDecorator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_s", function() { return _def; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_t", function() { return DebugContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPlatform", function() { return createPlatform; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assertPlatform", function() { return assertPlatform; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "destroyPlatform", function() { return destroyPlatform; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPlatform", function() { return getPlatform; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlatformRef", function() { return PlatformRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ApplicationRef", function() { return ApplicationRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableProdMode", function() { return enableProdMode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDevMode", function() { return isDevMode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPlatformFactory", function() { return createPlatformFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgProbeToken", function() { return NgProbeToken; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APP_ID", function() { return APP_ID; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PACKAGE_ROOT_URL", function() { return PACKAGE_ROOT_URL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLATFORM_INITIALIZER", function() { return PLATFORM_INITIALIZER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLATFORM_ID", function() { return PLATFORM_ID; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APP_BOOTSTRAP_LISTENER", function() { return APP_BOOTSTRAP_LISTENER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APP_INITIALIZER", function() { return APP_INITIALIZER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ApplicationInitStatus", function() { return ApplicationInitStatus; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DebugElement", function() { return DebugElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DebugNode", function() { return DebugNode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asNativeElements", function() { return asNativeElements; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDebugNode", function() { return getDebugNode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Testability", function() { return Testability; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestabilityRegistry", function() { return TestabilityRegistry; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTestabilityGetter", function() { return setTestabilityGetter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRANSLATIONS", function() { return TRANSLATIONS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRANSLATIONS_FORMAT", function() { return TRANSLATIONS_FORMAT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOCALE_ID", function() { return LOCALE_ID; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MissingTranslationStrategy", function() { return MissingTranslationStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ApplicationModule", function() { return ApplicationModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wtfCreateScope", function() { return wtfCreateScope; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wtfLeave", function() { return wtfLeave; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wtfStartTimeRange", function() { return wtfStartTimeRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wtfEndTimeRange", function() { return wtfEndTimeRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Type", function() { return Type; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventEmitter", function() { return EventEmitter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sanitizer", function() { return Sanitizer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SecurityContext", function() { return SecurityContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ANALYZE_FOR_ENTRY_COMPONENTS", function() { return ANALYZE_FOR_ENTRY_COMPONENTS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribute", function() { return Attribute; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentChild", function() { return ContentChild; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentChildren", function() { return ContentChildren; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Query", function() { return Query; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewChild", function() { return ViewChild; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewChildren", function() { return ViewChildren; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return Component; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Directive", function() { return Directive; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HostBinding", function() { return HostBinding; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HostListener", function() { return HostListener; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Output", function() { return Output; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Pipe", function() { return Pipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CUSTOM_ELEMENTS_SCHEMA", function() { return CUSTOM_ELEMENTS_SCHEMA; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NO_ERRORS_SCHEMA", function() { return NO_ERRORS_SCHEMA; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModule", function() { return NgModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewEncapsulation", function() { return ViewEncapsulation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Version", function() { return Version; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defineInjectable", function() { return defineInjectable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defineInjector", function() { return defineInjector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forwardRef", function() { return forwardRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolveForwardRef", function() { return resolveForwardRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Injectable", function() { return Injectable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return inject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INJECTOR", function() { return INJECTOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Injector", function() { return Injector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReflectiveInjector", function() { return ReflectiveInjector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInjector", function() { return createInjector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedReflectiveFactory", function() { return ResolvedReflectiveFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReflectiveKey", function() { return ReflectiveKey; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InjectionToken", function() { return InjectionToken; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Inject", function() { return Inject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Optional", function() { return Optional; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Self", function() { return Self; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkipSelf", function() { return SkipSelf; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Host", function() { return Host; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgZone", function() { return NgZone; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderComponentType", function() { return RenderComponentType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Renderer", function() { return Renderer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Renderer2", function() { return Renderer2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RendererFactory2", function() { return RendererFactory2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RendererStyleFlags2", function() { return RendererStyleFlags2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RootRenderer", function() { return RootRenderer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMPILER_OPTIONS", function() { return COMPILER_OPTIONS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Compiler", function() { return Compiler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompilerFactory", function() { return CompilerFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModuleWithComponentFactories", function() { return ModuleWithComponentFactories; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentFactory", function() { return ComponentFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentRef", function() { return ComponentRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentFactoryResolver", function() { return ComponentFactoryResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ElementRef", function() { return ElementRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModuleFactory", function() { return NgModuleFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModuleRef", function() { return NgModuleRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModuleFactoryLoader", function() { return NgModuleFactoryLoader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getModuleFactory", function() { return getModuleFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueryList", function() { return QueryList; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemJsNgModuleLoader", function() { return SystemJsNgModuleLoader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemJsNgModuleLoaderConfig", function() { return SystemJsNgModuleLoaderConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateRef", function() { return TemplateRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewContainerRef", function() { return ViewContainerRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmbeddedViewRef", function() { return EmbeddedViewRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewRef", function() { return ViewRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangeDetectionStrategy", function() { return ChangeDetectionStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangeDetectorRef", function() { return ChangeDetectorRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultIterableDiffer", function() { return DefaultIterableDiffer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IterableDiffers", function() { return IterableDiffers; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyValueDiffers", function() { return KeyValueDiffers; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleChange", function() { return SimpleChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrappedValue", function() { return WrappedValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "platformCore", function() { return platformCore; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵALLOW_MULTIPLE_PLATFORMS", function() { return ALLOW_MULTIPLE_PLATFORMS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵAPP_ID_RANDOM_PROVIDER", function() { return APP_ID_RANDOM_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdefaultIterableDiffers", function() { return defaultIterableDiffers; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdevModeEqual", function() { return devModeEqual; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisListLikeIterable", function() { return isListLikeIterable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵChangeDetectorStatus", function() { return ChangeDetectorStatus; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisDefaultChangeDetectionStrategy", function() { return isDefaultChangeDetectionStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵConsole", function() { return Console; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinject", function() { return inject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsetCurrentInjector", function() { return setCurrentInjector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵAPP_ROOT", function() { return APP_ROOT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵComponentFactory", function() { return ComponentFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCodegenComponentFactoryResolver", function() { return CodegenComponentFactoryResolver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵReflectionCapabilities", function() { return ReflectionCapabilities; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵRenderDebugInfo", function() { return RenderDebugInfo; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵ_sanitizeHtml", function() { return _sanitizeHtml; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵ_sanitizeStyle", function() { return _sanitizeStyle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵ_sanitizeUrl", function() { return _sanitizeUrl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵglobal", function() { return _global; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵlooseIdentical", function() { return looseIdentical; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵstringify", function() { return stringify; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmakeDecorator", function() { return makeDecorator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisObservable", function() { return isObservable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisPromise", function() { return isPromise; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵclearOverrides", function() { return clearOverrides; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵoverrideComponentView", function() { return overrideComponentView; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵoverrideProvider", function() { return overrideProvider; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR", function() { return NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdefineComponent", function() { return defineComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdefineDirective", function() { return defineDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdefinePipe", function() { return definePipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdetectChanges", function() { return detectChanges; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵrenderComponent", function() { return renderComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdirectiveInject", function() { return directiveInject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinjectTemplateRef", function() { return injectTemplateRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinjectViewContainerRef", function() { return injectViewContainerRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinjectChangeDetectorRef", function() { return injectChangeDetectorRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinjectAttribute", function() { return injectAttribute; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPublicFeature", function() { return PublicFeature; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNgOnChangesFeature", function() { return NgOnChangesFeature; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmarkDirty", function() { return markDirty; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNC", function() { return NO_CHANGE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵC", function() { return container; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵE", function() { return elementStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵL", function() { return listener; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵT", function() { return text; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵV", function() { return embeddedViewStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵQ", function() { return query; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵd", function() { return loadDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵP", function() { return projection; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵb", function() { return bind; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵi1", function() { return interpolation1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵi2", function() { return interpolation2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵi3", function() { return interpolation3; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵi4", function() { return interpolation4; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵi5", function() { return interpolation5; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵi6", function() { return interpolation6; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵi7", function() { return interpolation7; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵi8", function() { return interpolation8; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵiV", function() { return interpolationV; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpb1", function() { return pipeBind1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpb2", function() { return pipeBind2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpb3", function() { return pipeBind3; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpb4", function() { return pipeBind4; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpbV", function() { return pipeBindV; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵf0", function() { return pureFunction0; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵf1", function() { return pureFunction1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵf2", function() { return pureFunction2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵf3", function() { return pureFunction3; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵf4", function() { return pureFunction4; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵf5", function() { return pureFunction5; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵf6", function() { return pureFunction6; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵf7", function() { return pureFunction7; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵf8", function() { return pureFunction8; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵfV", function() { return pureFunctionV; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcR", function() { return containerRefreshStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcr", function() { return containerRefreshEnd; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵqR", function() { return queryRefresh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵe", function() { return elementEnd; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵp", function() { return elementProperty; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpD", function() { return projectionDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵa", function() { return elementAttribute; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵs", function() { return elementStyle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsn", function() { return elementStyleNamed; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵk", function() { return elementClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵkn", function() { return elementClassNamed; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵt", function() { return textBinding; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵv", function() { return embeddedViewEnd; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵst", function() { return store; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵld", function() { return load; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPp", function() { return pipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵwhenRendered", function() { return whenRendered; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustHtml", function() { return bypassSanitizationTrustHtml; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustStyle", function() { return bypassSanitizationTrustStyle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustScript", function() { return bypassSanitizationTrustScript; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustUrl", function() { return bypassSanitizationTrustUrl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustResourceUrl", function() { return bypassSanitizationTrustResourceUrl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsanitizeHtml", function() { return sanitizeHtml; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsanitizeStyle", function() { return sanitizeStyle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsanitizeUrl", function() { return sanitizeUrl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsanitizeResourceUrl", function() { return sanitizeResourceUrl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵregisterModuleFactory", function() { return registerModuleFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵEMPTY_ARRAY", function() { return EMPTY_ARRAY$2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵEMPTY_MAP", function() { return EMPTY_MAP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵand", function() { return anchorDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵccf", function() { return createComponentFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcmf", function() { return createNgModuleFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcrt", function() { return createRendererType2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdid", function() { return directiveDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵeld", function() { return elementDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵelementEventFullName", function() { return elementEventFullName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetComponentViewDefinitionFactory", function() { return getComponentViewDefinitionFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinlineInterpolate", function() { return inlineInterpolate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinterpolate", function() { return interpolate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmod", function() { return moduleDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmpd", function() { return moduleProvideDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵncd", function() { return ngContentDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵnov", function() { return nodeValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpid", function() { return pipeDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵprd", function() { return providerDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpad", function() { return pureArrayDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpod", function() { return pureObjectDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵppd", function() { return purePipeDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵqud", function() { return queryDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵted", function() { return textDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵunv", function() { return unwrapValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵvid", function() { return viewDef; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/**
* @license Angular v6.0.9
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Construct an `InjectableDef` which defines how a token will be constructed by the DI system, and
* in which injectors (if any) it will be available.
*
* This should be assigned to a static `ngInjectableDef` field on a type, which will then be an
* `InjectableType`.
*
* Options:
* * `providedIn` determines which injectors will include the injectable, by either associating it
* with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be
* provided in the `'root'` injector, which will be the application-level injector in most apps.
* * `factory` gives the zero argument function which will create an instance of the injectable.
* The factory can call `inject` to access the `Injector` and request injection of dependencies.
*
* @experimental
*/
function defineInjectable(opts) {
return {
providedIn: opts.providedIn || null, factory: opts.factory, value: undefined,
};
}
/**
* Construct an `InjectorDef` which configures an injector.
*
* This should be assigned to a static `ngInjectorDef` field on a type, which will then be an
* `InjectorType`.
*
* Options:
*
* * `factory`: an `InjectorType` is an instantiable type, so a zero argument `factory` function to
* create the type must be provided. If that factory function needs to inject arguments, it can
* use the `inject` function.
* * `providers`: an optional array of providers to add to the injector. Each provider must
* either have a factory or point to a type which has an `ngInjectableDef` static property (the
* type must be an `InjectableType`).
* * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s
* whose providers will also be added to the injector. Locally provided types will override
* providers from imports.
*
* @experimental
*/
function defineInjector(options) {
return {
factory: options.factory, providers: options.providers || [], imports: options.imports || [],
};
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Creates a token that can be used in a DI Provider.
*
* Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a
* runtime representation) such as when injecting an interface, callable type, array or
* parametrized type.
*
* `InjectionToken` is parameterized on `T` which is the type of object which will be returned by
* the `Injector`. This provides additional level of type safety.
*
* ```
* interface MyInterface {...}
* var myInterface = injector.get(new InjectionToken<MyInterface>('SomeToken'));
* // myInterface is inferred to be MyInterface.
* ```
*
* When creating an `InjectionToken`, you can optionally specify a factory function which returns
* (possibly by creating) a default value of the parameterized type `T`. This sets up the
* `InjectionToken` using this factory as a provider as if it was defined explicitly in the
* application's root injector. If the factory function, which takes zero arguments, needs to inject
* dependencies, it can do so using the `inject` function. See below for an example.
*
* Additionally, if a `factory` is specified you can also specify the `providedIn` option, which
* overrides the above behavior and marks the token as belonging to a particular `@NgModule`. As
* mentioned above, `'root'` is the default value for `providedIn`.
*
* @usageNotes
* ### Basic Example
*
* {@example core/di/ts/injector_spec.ts region='InjectionToken'}
*
* ### Tree-shakeable Example
*
* {@example core/di/ts/injector_spec.ts region='ShakeableInjectionToken'}
*
*/
var InjectionToken = /** @class */ (function () {
function InjectionToken(_desc, options) {
this._desc = _desc;
/** @internal */
this.ngMetadataName = 'InjectionToken';
if (options !== undefined) {
this.ngInjectableDef = defineInjectable({
providedIn: options.providedIn || 'root',
factory: options.factory,
});
}
else {
this.ngInjectableDef = undefined;
}
}
InjectionToken.prototype.toString = function () { return "InjectionToken " + this._desc; };
return InjectionToken;
}());
/**
* @license
* Copyright Google Inc. 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 ANNOTATIONS = '__annotations__';
var PARAMETERS = '__parameters__';
var PROP_METADATA = '__prop__metadata__';
/**
* @suppress {globalThis}
*/
function makeDecorator(name, props, parentClass, chainFn, typeFn) {
var metaCtor = makeMetadataCtor(props);
function DecoratorFactory() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (this instanceof DecoratorFactory) {
metaCtor.call.apply(metaCtor, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([this], args));
return this;
}
var annotationInstance = new ((_a = DecoratorFactory).bind.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], args)))();
var TypeDecorator = function TypeDecorator(cls) {
typeFn && typeFn.apply(void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([cls], args));
// Use of Object.defineProperty is important since it creates non-enumerable property which
// prevents the property is copied during subclassing.
var annotations = cls.hasOwnProperty(ANNOTATIONS) ?
cls[ANNOTATIONS] :
Object.defineProperty(cls, ANNOTATIONS, { value: [] })[ANNOTATIONS];
annotations.push(annotationInstance);
return cls;
};
if (chainFn)
chainFn(TypeDecorator);
return TypeDecorator;
var _a;
}
if (parentClass) {
DecoratorFactory.prototype = Object.create(parentClass.prototype);
}
DecoratorFactory.prototype.ngMetadataName = name;
DecoratorFactory.annotationCls = DecoratorFactory;
return DecoratorFactory;
}
function makeMetadataCtor(props) {
return function ctor() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (props) {
var values = props.apply(void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(args));
for (var propName in values) {
this[propName] = values[propName];
}
}
};
}
function makeParamDecorator(name, props, parentClass) {
var metaCtor = makeMetadataCtor(props);
function ParamDecoratorFactory() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (this instanceof ParamDecoratorFactory) {
metaCtor.apply(this, args);
return this;
}
var annotationInstance = new ((_a = ParamDecoratorFactory).bind.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], args)))();
ParamDecorator.annotation = annotationInstance;
return ParamDecorator;
function ParamDecorator(cls, unusedKey, index) {
// Use of Object.defineProperty is important since it creates non-enumerable property which
// prevents the property is copied during subclassing.
var parameters = cls.hasOwnProperty(PARAMETERS) ?
cls[PARAMETERS] :
Object.defineProperty(cls, PARAMETERS, { value: [] })[PARAMETERS];
// there might be gaps if some in between parameters do not have annotations.
// we pad with nulls.
while (parameters.length <= index) {
parameters.push(null);
}
(parameters[index] = parameters[index] || []).push(annotationInstance);
return cls;
}
var _a;
}
if (parentClass) {
ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);
}
ParamDecoratorFactory.prototype.ngMetadataName = name;
ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;
return ParamDecoratorFactory;
}
function makePropDecorator(name, props, parentClass) {
var metaCtor = makeMetadataCtor(props);
function PropDecoratorFactory() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (this instanceof PropDecoratorFactory) {
metaCtor.apply(this, args);
return this;
}
var decoratorInstance = new ((_a = PropDecoratorFactory).bind.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], args)))();
return function PropDecorator(target, name) {
var constructor = target.constructor;
// Use of Object.defineProperty is important since it creates non-enumerable property which
// prevents the property is copied during subclassing.
var meta = constructor.hasOwnProperty(PROP_METADATA) ?
constructor[PROP_METADATA] :
Object.defineProperty(constructor, PROP_METADATA, { value: {} })[PROP_METADATA];
meta[name] = meta.hasOwnProperty(name) && meta[name] || [];
meta[name].unshift(decoratorInstance);
};
var _a;
}
if (parentClass) {
PropDecoratorFactory.prototype = Object.create(parentClass.prototype);
}
PropDecoratorFactory.prototype.ngMetadataName = name;
PropDecoratorFactory.annotationCls = PropDecoratorFactory;
return PropDecoratorFactory;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* This token can be used to create a virtual provider that will populate the
* `entryComponents` fields of components and ng modules based on its `useValue`.
* All components that are referenced in the `useValue` value (either directly
* or in a nested array or map) will be added to the `entryComponents` property.
*
* @usageNotes
* ### Example
* The following example shows how the router can populate the `entryComponents`
* field of an NgModule based on the router configuration which refers
* to components.
*
* ```typescript
* // helper function inside the router
* function provideRoutes(routes) {
* return [
* {provide: ROUTES, useValue: routes},
* {provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: routes, multi: true}
* ];
* }
*
* // user code
* let routes = [
* {path: '/root', component: RootComp},
* {path: '/teams', component: TeamsComp}
* ];
*
* @NgModule({
* providers: [provideRoutes(routes)]
* })
* class ModuleWithRoutes {}
* ```
*
* @experimental
*/
var ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken('AnalyzeForEntryComponents');
/**
* Attribute decorator and metadata.
*
* @Annotation
*/
var Attribute = makeParamDecorator('Attribute', function (attributeName) { return ({ attributeName: attributeName }); });
/**
* Base class for query metadata.
*
* @see `ContentChildren`.
* @see `ContentChild`.
* @see `ViewChildren`.
* @see `ViewChild`.
*/
var Query = /** @class */ (function () {
function Query() {
}
return Query;
}());
/**
* ContentChildren decorator and metadata.
*
*
* @Annotation
*/
var ContentChildren = makePropDecorator('ContentChildren', function (selector, data) {
if (data === void 0) { data = {}; }
return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ selector: selector, first: false, isViewQuery: false, descendants: false }, data));
}, Query);
/**
* ContentChild decorator and metadata.
*
*
* @Annotation
*/
var ContentChild = makePropDecorator('ContentChild', function (selector, data) {
if (data === void 0) { data = {}; }
return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ selector: selector, first: true, isViewQuery: false, descendants: true }, data));
}, Query);
/**
* ViewChildren decorator and metadata.
*
* @Annotation
*/
var ViewChildren = makePropDecorator('ViewChildren', function (selector, data) {
if (data === void 0) { data = {}; }
return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ selector: selector, first: false, isViewQuery: true, descendants: true }, data));
}, Query);
/**
* ViewChild decorator and metadata.
*
* @Annotation
*/
var ViewChild = makePropDecorator('ViewChild', function (selector, data) {
return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ selector: selector, first: true, isViewQuery: true, descendants: true }, data));
}, Query);
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Describes within the change detector which strategy will be used the next time change
* detection is triggered.
*
*/
var ChangeDetectionStrategy;
(function (ChangeDetectionStrategy) {
/**
* `OnPush` means that the change detector's mode will be initially set to `CheckOnce`.
*/
ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
/**
* `Default` means that the change detector's mode will be initially set to `CheckAlways`.
*/
ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
/**
* Describes the status of the detector.
*/
var ChangeDetectorStatus;
(function (ChangeDetectorStatus) {
/**
* `CheckOnce` means that after calling detectChanges the mode of the change detector
* will become `Checked`.
*/
ChangeDetectorStatus[ChangeDetectorStatus["CheckOnce"] = 0] = "CheckOnce";
/**
* `Checked` means that the change detector should be skipped until its mode changes to
* `CheckOnce`.
*/
ChangeDetectorStatus[ChangeDetectorStatus["Checked"] = 1] = "Checked";
/**
* `CheckAlways` means that after calling detectChanges the mode of the change detector
* will remain `CheckAlways`.
*/
ChangeDetectorStatus[ChangeDetectorStatus["CheckAlways"] = 2] = "CheckAlways";
/**
* `Detached` means that the change detector sub tree is not a part of the main tree and
* should be skipped.
*/
ChangeDetectorStatus[ChangeDetectorStatus["Detached"] = 3] = "Detached";
/**
* `Errored` means that the change detector encountered an error checking a binding
* or calling a directive lifecycle method and is now in an inconsistent state. Change
* detectors in this state will no longer detect changes.
*/
ChangeDetectorStatus[ChangeDetectorStatus["Errored"] = 4] = "Errored";
/**
* `Destroyed` means that the change detector is destroyed.
*/
ChangeDetectorStatus[ChangeDetectorStatus["Destroyed"] = 5] = "Destroyed";
})(ChangeDetectorStatus || (ChangeDetectorStatus = {}));
function isDefaultChangeDetectionStrategy(changeDetectionStrategy) {
return changeDetectionStrategy == null ||
changeDetectionStrategy === ChangeDetectionStrategy.Default;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Type of the Component metadata.
*/
var Directive = makeDecorator('Directive', function (dir) {
if (dir === void 0) { dir = {}; }
return dir;
});
/**
* Component decorator and metadata.
*
* @usageNotes
*
* ### Using animations
*
* The following snippet shows an animation trigger in a component's
* metadata. The trigger is attached to an element in the component's
* template, using "@_trigger_name_", and a state expression that is evaluated
* at run time to determine whether the animation should start.
*
* ```typescript
* @Component({
* selector: 'animation-cmp',
* templateUrl: 'animation-cmp.html',
* animations: [
* trigger('myTriggerName', [
* state('on', style({ opacity: 1 }),
* state('off', style({ opacity: 0 }),
* transition('on => off', [
* animate("1s")
* ])
* ])
* ]
* })
* ```
*
* ```html
* <!-- animation-cmp.html -->
* <div @myTriggerName="expression">...</div>
* ```
*
* ### Preserving whitespace
*
* Removing whitespace can greatly reduce AOT-generated code size, and speed up view creation.
* As of Angular 6, default for `preserveWhitespaces` is false (whitespace is removed).
* To change the default setting for all components in your application, set
* the `preserveWhitespaces` option of the AOT compiler.
*
* Current implementation removes whitespace characters as follows:
* - Trims all whitespaces at the beginning and the end of a template.
* - Removes whitespace-only text nodes. For example,
* `<button>Action 1</button> <button>Action 2</button>` becomes
* `<button>Action 1</button><button>Action 2</button>`.
* - Replaces a series of whitespace characters in text nodes with a single space.
* For example, `<span>\n some text\n</span>` becomes `<span> some text </span>`.
* - Does NOT alter text nodes inside HTML tags such as `<pre>` or `<textarea>`,
* where whitespace characters are significant.
*
* Note that these transformations can influence DOM nodes layout, although impact
* should be minimal.
*
* You can override the default behavior to preserve whitespace characters
* in certain fragments of a template. For example, you can exclude an entire
* DOM sub-tree by using the `ngPreserveWhitespaces` attribute:
*
* ```html
* <div ngPreserveWhitespaces>
* whitespaces are preserved here
* <span> and here </span>
* </div>
* ```
*
* You can force a single space to be preserved in a text node by using `&ngsp;`,
* which is replaced with a space character by Angular's template
* compiler:
*
* ```html
* <a>Spaces</a>&ngsp;<a>between</a>&ngsp;<a>links.</a>
* <!-->compiled to be equivalent to:</>
* <a>Spaces</a> <a>between</a> <a>links.</a>
* ```
*
* Note that sequences of `&ngsp;` are still collapsed to just one space character when
* the `preserveWhitespaces` option is set to `false`.
*
* ```html
* <a>before</a>&ngsp;&ngsp;&ngsp;<a>after</a>
* <!-->compiled to be equivalent to:</>
* <a>Spaces</a> <a>between</a> <a>links.</a>
* ```
*
* To preserve sequences of whitespace characters, use the
* `ngPreserveWhitespaces` attribute.
*
* @Annotation
*/
var Component = makeDecorator('Component', function (c) {
if (c === void 0) { c = {}; }
return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ changeDetection: ChangeDetectionStrategy.Default }, c));
}, Directive);
/**
*
*
* @Annotation
*/
var Pipe = makeDecorator('Pipe', function (p) { return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ pure: true }, p)); });
/**
*
* @Annotation
*/
var Input = makePropDecorator('Input', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });
/**
*
* @Annotation
*/
var Output = makePropDecorator('Output', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });
/**
*
* @Annotation
*/
var HostBinding = makePropDecorator('HostBinding', function (hostPropertyName) { return ({ hostPropertyName: hostPropertyName }); });
/**
* Binds a CSS event to a host listener and supplies configuration metadata.
* Angular invokes the supplied handler method when the host element emits the specified event,
* and updates the bound element with the result.
* If the handler method returns false, applies `preventDefault` on the bound element.
*
* @usageNotes
*
* The following example declares a directive
* that attaches a click listener to a button and counts clicks.
*
* ```
* @Directive({selector: 'button[counting]'})
* class CountClicks {
* numberOfClicks = 0;
*
* @HostListener('click', ['$event.target'])
* onClick(btn) {
* console.log('button', btn, 'number of clicks:', this.numberOfClicks++);
* }
* }
*
* @Component({
* selector: 'app',
* template: '<button counting>Increment</button>',
* })
* class App {}
* ```
*
* @Annotation
*/
var HostListener = makePropDecorator('HostListener', function (eventName, args) { return ({ eventName: eventName, args: args }); });
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
*
* Represents a type that a Component or other object is instances of.
*
* An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by
* the `MyCustomComponent` constructor function.
*
*
*/
var Type = Function;
function isType(v) {
return typeof v === 'function';
}
/**
* @license
* Copyright Google Inc. 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 __window = typeof window !== 'undefined' && window;
var __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
self instanceof WorkerGlobalScope && self;
var __global = typeof global !== 'undefined' && global;
var _global = __window || __global || __self;
var promise = Promise.resolve(0);
var _symbolIterator = null;
function getSymbolIterator() {
if (!_symbolIterator) {
var Symbol_1 = _global['Symbol'];
if (Symbol_1 && Symbol_1.iterator) {
_symbolIterator = Symbol_1.iterator;
}
else {
// es6-shim specific logic
var keys = Object.getOwnPropertyNames(Map.prototype);
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (key !== 'entries' && key !== 'size' &&
Map.prototype[key] === Map.prototype['entries']) {
_symbolIterator = key;
}
}
}
}
return _symbolIterator;
}
function scheduleMicroTask(fn) {
if (typeof Zone === 'undefined') {
// use promise to schedule microTask instead of use Zone
promise.then(function () { fn && fn.apply(null, null); });
}
else {
Zone.current.scheduleMicroTask('scheduleMicrotask', fn);
}
}
// JS has NaN !== NaN
function looseIdentical(a, b) {
return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);
}
function stringify(token) {
if (typeof token === 'string') {
return token;
}
if (token instanceof Array) {
return '[' + token.map(stringify).join(', ') + ']';
}
if (token == null) {
return '' + token;
}
if (token.overriddenName) {
return "" + token.overriddenName;
}
if (token.name) {
return "" + token.name;
}
var res = token.toString();
if (res == null) {
return '' + res;
}
var newLineIndex = res.indexOf('\n');
return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Attention: These regex has to hold even if the code is minified!
*/
var DELEGATE_CTOR = /^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*arguments\)/;
var INHERITED_CLASS = /^class\s+[A-Za-z\d$_]*\s*extends\s+[A-Za-z\d$_]+\s*{/;
var INHERITED_CLASS_WITH_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[A-Za-z\d$_]+\s*{[\s\S]*constructor\s*\(/;
var ReflectionCapabilities = /** @class */ (function () {
function ReflectionCapabilities(reflect) {
this._reflect = reflect || _global['Reflect'];
}
ReflectionCapabilities.prototype.isReflectionEnabled = function () { return true; };
ReflectionCapabilities.prototype.factory = function (t) { return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new (t.bind.apply(t, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], args)))();
}; };
/** @internal */
ReflectionCapabilities.prototype._zipTypesAndAnnotations = function (paramTypes, paramAnnotations) {
var result;
if (typeof paramTypes === 'undefined') {
result = new Array(paramAnnotations.length);
}
else {
result = new Array(paramTypes.length);
}
for (var i = 0; i < result.length; i++) {
// TS outputs Object for parameters without types, while Traceur omits
// the annotations. For now we preserve the Traceur behavior to aid
// migration, but this can be revisited.
if (typeof paramTypes === 'undefined') {
result[i] = [];
}
else if (paramTypes[i] != Object) {
result[i] = [paramTypes[i]];
}
else {
result[i] = [];
}
if (paramAnnotations && paramAnnotations[i] != null) {
result[i] = result[i].concat(paramAnnotations[i]);
}
}
return result;
};
ReflectionCapabilities.prototype._ownParameters = function (type, parentCtor) {
var typeStr = type.toString();
// If we have no decorators, we only have function.length as metadata.
// In that case, to detect whether a child class declared an own constructor or not,
// we need to look inside of that constructor to check whether it is
// just calling the parent.
// This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439
// that sets 'design:paramtypes' to []
// if a class inherits from another class but has no ctor declared itself.
if (DELEGATE_CTOR.exec(typeStr) ||
(INHERITED_CLASS.exec(typeStr) && !INHERITED_CLASS_WITH_CTOR.exec(typeStr))) {
return null;
}
// Prefer the direct API.
if (type.parameters && type.parameters !== parentCtor.parameters) {
return type.parameters;
}
// API of tsickle for lowering decorators to properties on the class.
var tsickleCtorParams = type.ctorParameters;
if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {
// Newer tsickle uses a function closure
// Retain the non-function case for compatibility with older tsickle
var ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;
var paramTypes_1 = ctorParameters.map(function (ctorParam) { return ctorParam && ctorParam.type; });
var paramAnnotations_1 = ctorParameters.map(function (ctorParam) {
return ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators);
});
return this._zipTypesAndAnnotations(paramTypes_1, paramAnnotations_1);
}
// API for metadata created by invoking the decorators.
var paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS];
var paramTypes = this._reflect && this._reflect.getOwnMetadata &&
this._reflect.getOwnMetadata('design:paramtypes', type);
if (paramTypes || paramAnnotations) {
return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);
}
// If a class has no decorators, at least create metadata
// based on function.length.
// Note: We know that this is a real constructor as we checked
// the content of the constructor above.
return new Array(type.length).fill(undefined);
};
ReflectionCapabilities.prototype.parameters = function (type) {
// Note: only report metadata if we have at least one class decorator
// to stay in sync with the static reflector.
if (!isType(type)) {
return [];
}
var parentCtor = getParentCtor(type);
var parameters = this._ownParameters(type, parentCtor);
if (!parameters && parentCtor !== Object) {
parameters = this.parameters(parentCtor);
}
return parameters || [];
};
ReflectionCapabilities.prototype._ownAnnotations = function (typeOrFunc, parentCtor) {
// Prefer the direct API.
if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) {
var annotations = typeOrFunc.annotations;
if (typeof annotations === 'function' && annotations.annotations) {
annotations = annotations.annotations;
}
return annotations;
}
// API of tsickle for lowering decorators to properties on the class.
if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) {
return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators);
}
// API for metadata created by invoking the decorators.
if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {
return typeOrFunc[ANNOTATIONS];
}
return null;
};
ReflectionCapabilities.prototype.annotations = function (typeOrFunc) {
if (!isType(typeOrFunc)) {
return [];
}
var parentCtor = getParentCtor(typeOrFunc);
var ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];
var parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];
return parentAnnotations.concat(ownAnnotations);
};
ReflectionCapabilities.prototype._ownPropMetadata = function (typeOrFunc, parentCtor) {
// Prefer the direct API.
if (typeOrFunc.propMetadata &&
typeOrFunc.propMetadata !== parentCtor.propMetadata) {
var propMetadata = typeOrFunc.propMetadata;
if (typeof propMetadata === 'function' && propMetadata.propMetadata) {
propMetadata = propMetadata.propMetadata;
}
return propMetadata;
}
// API of tsickle for lowering decorators to properties on the class.
if (typeOrFunc.propDecorators &&
typeOrFunc.propDecorators !== parentCtor.propDecorators) {
var propDecorators_1 = typeOrFunc.propDecorators;
var propMetadata_1 = {};
Object.keys(propDecorators_1).forEach(function (prop) {
propMetadata_1[prop] = convertTsickleDecoratorIntoMetadata(propDecorators_1[prop]);
});
return propMetadata_1;
}
// API for metadata created by invoking the decorators.
if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {
return typeOrFunc[PROP_METADATA];
}
return null;
};
ReflectionCapabilities.prototype.propMetadata = function (typeOrFunc) {
if (!isType(typeOrFunc)) {
return {};
}
var parentCtor = getParentCtor(typeOrFunc);
var propMetadata = {};
if (parentCtor !== Object) {
var parentPropMetadata_1 = this.propMetadata(parentCtor);
Object.keys(parentPropMetadata_1).forEach(function (propName) {
propMetadata[propName] = parentPropMetadata_1[propName];
});
}
var ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);
if (ownPropMetadata) {
Object.keys(ownPropMetadata).forEach(function (propName) {
var decorators = [];
if (propMetadata.hasOwnProperty(propName)) {
decorators.push.apply(decorators, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(propMetadata[propName]));
}
decorators.push.apply(decorators, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(ownPropMetadata[propName]));
propMetadata[propName] = decorators;
});
}
return propMetadata;
};
ReflectionCapabilities.prototype.hasLifecycleHook = function (type, lcProperty) {
return type instanceof Type && lcProperty in type.prototype;
};
ReflectionCapabilities.prototype.guards = function (type) { return {}; };
ReflectionCapabilities.prototype.getter = function (name) { return new Function('o', 'return o.' + name + ';'); };
ReflectionCapabilities.prototype.setter = function (name) {
return new Function('o', 'v', 'return o.' + name + ' = v;');
};
ReflectionCapabilities.prototype.method = function (name) {
var functionBody = "if (!o." + name + ") throw new Error('\"" + name + "\" is undefined');\n return o." + name + ".apply(o, args);";
return new Function('o', 'args', functionBody);
};
// There is not a concept of import uri in Js, but this is useful in developing Dart applications.
ReflectionCapabilities.prototype.importUri = function (type) {
// StaticSymbol
if (typeof type === 'object' && type['filePath']) {
return type['filePath'];
}
// Runtime type
return "./" + stringify(type);
};
ReflectionCapabilities.prototype.resourceUri = function (type) { return "./" + stringify(type); };
ReflectionCapabilities.prototype.resolveIdentifier = function (name, moduleUrl, members, runtime) {
return runtime;
};
ReflectionCapabilities.prototype.resolveEnum = function (enumIdentifier, name) { return enumIdentifier[name]; };
return ReflectionCapabilities;
}());
function convertTsickleDecoratorIntoMetadata(decoratorInvocations) {
if (!decoratorInvocations) {
return [];
}
return decoratorInvocations.map(function (decoratorInvocation) {
var decoratorType = decoratorInvocation.type;
var annotationCls = decoratorType.annotationCls;
var annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];
return new (annotationCls.bind.apply(annotationCls, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], annotationArgs)))();
});
}
function getParentCtor(ctor) {
var parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;
var parentCtor = parentProto ? parentProto.constructor : null;
// Note: We always use `Object` as the null value
// to simplify checking later on.
return parentCtor || Object;
}
/**
* @license
* Copyright Google Inc. 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
*/
function getClosureSafeProperty(objWithPropertyToExtract, target) {
for (var key in objWithPropertyToExtract) {
if (objWithPropertyToExtract[key] === target) {
return key;
}
}
throw Error('Could not find renamed property on target object.');
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Allows to refer to references which are not yet defined.
*
* For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of
* DI is declared, but not yet defined. It is also used when the `token` which we use when creating
* a query is not yet defined.
*
* @usageNotes
* ### Example
* {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}
* @experimental
*/
function forwardRef(forwardRefFn) {
forwardRefFn.__forward_ref__ = forwardRef;
forwardRefFn.toString = function () { return stringify(this()); };
return forwardRefFn;
}
/**
* Lazily retrieves the reference value from a forwardRef.
*
* Acts as the identity function when given a non-forward-ref value.
*
* @usageNotes
* ### Example
*
* {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}
*
* @see `forwardRef`
* @experimental
*/
function resolveForwardRef(type) {
if (typeof type === 'function' && type.hasOwnProperty('__forward_ref__') &&
type.__forward_ref__ === forwardRef) {
return type();
}
else {
return type;
}
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Inject decorator and metadata.
*
* @Annotation
*/
var Inject = makeParamDecorator('Inject', function (token) { return ({ token: token }); });
/**
* Optional decorator and metadata.
*
* @Annotation
*/
var Optional = makeParamDecorator('Optional');
/**
* Self decorator and metadata.
*
* @Annotation
*/
var Self = makeParamDecorator('Self');
/**
* SkipSelf decorator and metadata.
*
* @Annotation
*/
var SkipSelf = makeParamDecorator('SkipSelf');
/**
* Host decorator and metadata.
*
* @Annotation
*/
var Host = makeParamDecorator('Host');
/**
* @license
* Copyright Google Inc. 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 SOURCE = '__source';
var _THROW_IF_NOT_FOUND = new Object();
var THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
/**
* An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.
*
* Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a
* project.
*
* @experimental
*/
var INJECTOR = new InjectionToken('INJECTOR');
var NullInjector = /** @class */ (function () {
function NullInjector() {
}
NullInjector.prototype.get = function (token, notFoundValue) {
if (notFoundValue === void 0) { notFoundValue = _THROW_IF_NOT_FOUND; }
if (notFoundValue === _THROW_IF_NOT_FOUND) {
throw new Error("NullInjectorError: No provider for " + stringify(token) + "!");
}
return notFoundValue;
};
return NullInjector;
}());
/**
* Concrete injectors implement this interface.
*
* For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
*
* @usageNotes
* ### Example
*
* {@example core/di/ts/injector_spec.ts region='Injector'}
*
* `Injector` returns itself when given `Injector` as a token:
*
* {@example core/di/ts/injector_spec.ts region='injectInjector'}
*
*
*/
var Injector = /** @class */ (function () {
function Injector() {
}
/**
* Create a new Injector which is configure using `StaticProvider`s.
*
* @usageNotes
* ### Example
*
* {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
*/
Injector.create = function (options, parent) {
if (Array.isArray(options)) {
return new StaticInjector(options, parent);
}
else {
return new StaticInjector(options.providers, options.parent, options.name || null);
}
};
Injector.THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
Injector.NULL = new NullInjector();
Injector.ngInjectableDef = defineInjectable({
providedIn: 'any',
factory: function () { return inject(INJECTOR); },
});
return Injector;
}());
var IDENT = function (value) {
return value;
};
var EMPTY = [];
var CIRCULAR = IDENT;
var MULTI_PROVIDER_FN = function () {
return Array.prototype.slice.call(arguments);
};
var GET_PROPERTY_NAME = {};
var USE_VALUE = getClosureSafeProperty$1({ provide: String, useValue: GET_PROPERTY_NAME });
var NG_TOKEN_PATH = 'ngTokenPath';
var NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';
var NULL_INJECTOR = Injector.NULL;
var NEW_LINE = /\n/gm;
var NO_NEW_LINE = 'ɵ';
var StaticInjector = /** @class */ (function () {
function StaticInjector(providers, parent, source) {
if (parent === void 0) { parent = NULL_INJECTOR; }
if (source === void 0) { source = null; }
this.parent = parent;
this.source = source;
var records = this._records = new Map();
records.set(Injector, { token: Injector, fn: IDENT, deps: EMPTY, value: this, useNew: false });
records.set(INJECTOR, { token: INJECTOR, fn: IDENT, deps: EMPTY, value: this, useNew: false });
recursivelyProcessProviders(records, providers);
}
StaticInjector.prototype.get = function (token, notFoundValue, flags) {
if (flags === void 0) { flags = 0 /* Default */; }
var record = this._records.get(token);
try {
return tryResolveToken(token, record, this._records, this.parent, notFoundValue, flags);
}
catch (e) {
var tokenPath = e[NG_TEMP_TOKEN_PATH];
if (token[SOURCE]) {
tokenPath.unshift(token[SOURCE]);
}
e.message = formatError('\n' + e.message, tokenPath, this.source);
e[NG_TOKEN_PATH] = tokenPath;
e[NG_TEMP_TOKEN_PATH] = null;
throw e;
}
};
StaticInjector.prototype.toString = function () {
var tokens = [], records = this._records;
records.forEach(function (v, token) { return tokens.push(stringify(token)); });
return "StaticInjector[" + tokens.join(', ') + "]";
};
return StaticInjector;
}());
function resolveProvider(provider) {
var deps = computeDeps(provider);
var fn = IDENT;
var value = EMPTY;
var useNew = false;
var provide = resolveForwardRef(provider.provide);
if (USE_VALUE in provider) {
// We need to use USE_VALUE in provider since provider.useValue could be defined as undefined.
value = provider.useValue;
}
else if (provider.useFactory) {
fn = provider.useFactory;
}
else if (provider.useExisting) ;
else if (provider.useClass) {
useNew = true;
fn = resolveForwardRef(provider.useClass);
}
else if (typeof provide == 'function') {
useNew = true;
fn = provide;
}
else {
throw staticError('StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable', provider);
}
return { deps: deps, fn: fn, useNew: useNew, value: value };
}
function multiProviderMixError(token) {
return staticError('Cannot mix multi providers and regular providers', token);
}
function recursivelyProcessProviders(records, provider) {
if (provider) {
provider = resolveForwardRef(provider);
if (provider instanceof Array) {
// if we have an array recurse into the array
for (var i = 0; i < provider.length; i++) {
recursivelyProcessProviders(records, provider[i]);
}
}
else if (typeof provider === 'function') {
// Functions were supported in ReflectiveInjector, but are not here. For safety give useful
// error messages
throw staticError('Function/Class not supported', provider);
}
else if (provider && typeof provider === 'object' && provider.provide) {
// At this point we have what looks like a provider: {provide: ?, ....}
var token = resolveForwardRef(provider.provide);
var resolvedProvider = resolveProvider(provider);
if (provider.multi === true) {
// This is a multi provider.
var multiProvider = records.get(token);
if (multiProvider) {
if (multiProvider.fn !== MULTI_PROVIDER_FN) {
throw multiProviderMixError(token);
}
}
else {
// Create a placeholder factory which will look up the constituents of the multi provider.
records.set(token, multiProvider = {
token: provider.provide,
deps: [],
useNew: false,
fn: MULTI_PROVIDER_FN,
value: EMPTY
});
}
// Treat the provider as the token.
token = provider;
multiProvider.deps.push({ token: token, options: 6 /* Default */ });
}
var record = records.get(token);
if (record && record.fn == MULTI_PROVIDER_FN) {
throw multiProviderMixError(token);
}
records.set(token, resolvedProvider);
}
else {
throw staticError('Unexpected provider', provider);
}
}
}
function tryResolveToken(token, record, records, parent, notFoundValue, flags) {
try {
return resolveToken(token, record, records, parent, notFoundValue, flags);
}
catch (e) {
// ensure that 'e' is of type Error.
if (!(e instanceof Error)) {
e = new Error(e);
}
var path = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];
path.unshift(token);
if (record && record.value == CIRCULAR) {
// Reset the Circular flag.
record.value = EMPTY;
}
throw e;
}
}
function resolveToken(token, record, records, parent, notFoundValue, flags) {
var value;
if (record && !(flags & 4 /* SkipSelf */)) {
// If we don't have a record, this implies that we don't own the provider hence don't know how
// to resolve it.
value = record.value;
if (value == CIRCULAR) {
throw Error(NO_NEW_LINE + 'Circular dependency');
}
else if (value === EMPTY) {
record.value = CIRCULAR;
var obj = undefined;
var useNew = record.useNew;
var fn = record.fn;
var depRecords = record.deps;
var deps = EMPTY;
if (depRecords.length) {
deps = [];
for (var i = 0; i < depRecords.length; i++) {
var depRecord = depRecords[i];
var options = depRecord.options;
var childRecord = options & 2 /* CheckSelf */ ? records.get(depRecord.token) : undefined;
deps.push(tryResolveToken(
// Current Token to resolve
depRecord.token,
// A record which describes how to resolve the token.
// If undefined, this means we don't have such a record
childRecord,
// Other records we know about.
records,
// If we don't know how to resolve dependency and we should not check parent for it,
// than pass in Null injector.
!childRecord && !(options & 4 /* CheckParent */) ? NULL_INJECTOR : parent, options & 1 /* Optional */ ? null : Injector.THROW_IF_NOT_FOUND, 0 /* Default */));
}
}
record.value = value = useNew ? new ((_a = fn).bind.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], deps)))() : fn.apply(obj, deps);
}
}
else if (!(flags & 2 /* Self */)) {
value = parent.get(token, notFoundValue, 0 /* Default */);
}
return value;
var _a;
}
function computeDeps(provider) {
var deps = EMPTY;
var providerDeps = provider.deps;
if (providerDeps && providerDeps.length) {
deps = [];
for (var i = 0; i < providerDeps.length; i++) {
var options = 6 /* Default */;
var token = resolveForwardRef(providerDeps[i]);
if (token instanceof Array) {
for (var j = 0, annotations = token; j < annotations.length; j++) {
var annotation = annotations[j];
if (annotation instanceof Optional || annotation == Optional) {
options = options | 1 /* Optional */;
}
else if (annotation instanceof SkipSelf || annotation == SkipSelf) {
options = options & ~2 /* CheckSelf */;
}
else if (annotation instanceof Self || annotation == Self) {
options = options & ~4 /* CheckParent */;
}
else if (annotation instanceof Inject) {
token = annotation.token;
}
else {
token = resolveForwardRef(annotation);
}
}
}
deps.push({ token: token, options: options });
}
}
else if (provider.useExisting) {
var token = resolveForwardRef(provider.useExisting);
deps = [{ token: token, options: 6 /* Default */ }];
}
else if (!providerDeps && !(USE_VALUE in provider)) {
// useValue & useExisting are the only ones which are exempt from deps all others need it.
throw staticError('\'deps\' required', provider);
}
return deps;
}
function formatError(text, obj, source) {
if (source === void 0) { source = null; }
text = text && text.charAt(0) === '\n' && text.charAt(1) == NO_NEW_LINE ? text.substr(2) : text;
var context = stringify(obj);
if (obj instanceof Array) {
context = obj.map(stringify).join(' -> ');
}
else if (typeof obj === 'object') {
var parts = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
var value = obj[key];
parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));
}
}
context = "{" + parts.join(', ') + "}";
}
return "StaticInjectorError" + (source ? '(' + source + ')' : '') + "[" + context + "]: " + text.replace(NEW_LINE, '\n ');
}
function staticError(text, obj) {
return new Error(formatError(text, obj));
}
function getClosureSafeProperty$1(objWithPropertyToExtract) {
for (var key in objWithPropertyToExtract) {
if (objWithPropertyToExtract[key] === GET_PROPERTY_NAME) {
return key;
}
}
throw Error('!prop');
}
/**
* Current injector value used by `inject`.
* - `undefined`: it is an error to call `inject`
* - `null`: `inject` can be called but there is no injector (limp-mode).
* - Injector instance: Use the injector for resolution.
*/
var _currentInjector = undefined;
function setCurrentInjector(injector) {
var former = _currentInjector;
_currentInjector = injector;
return former;
}
function inject(token, flags) {
if (flags === void 0) { flags = 0 /* Default */; }
if (_currentInjector === undefined) {
throw new Error("inject() must be called from an injection context");
}
else if (_currentInjector === null) {
var injectableDef = token.ngInjectableDef;
if (injectableDef && injectableDef.providedIn == 'root') {
return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() :
injectableDef.value;
}
throw new Error("Injector: NOT_FOUND [" + stringify(token) + "]");
}
else {
return _currentInjector.get(token, flags & 8 /* Optional */ ? null : undefined, flags);
}
}
function injectArgs(types) {
var args = [];
for (var i = 0; i < types.length; i++) {
var arg = types[i];
if (Array.isArray(arg)) {
if (arg.length === 0) {
throw new Error('Arguments array must have arguments.');
}
var type = undefined;
var flags = 0 /* Default */;
for (var j = 0; j < arg.length; j++) {
var meta = arg[j];
if (meta instanceof Optional || meta.__proto__.ngMetadataName === 'Optional') {
flags |= 8 /* Optional */;
}
else if (meta instanceof SkipSelf || meta.__proto__.ngMetadataName === 'SkipSelf') {
flags |= 4 /* SkipSelf */;
}
else if (meta instanceof Self || meta.__proto__.ngMetadataName === 'Self') {
flags |= 2 /* Self */;
}
else if (meta instanceof Inject) {
type = meta.token;
}
else {
type = meta;
}
}
args.push(inject(type, flags));
}
else {
args.push(inject(arg));
}
}
return args;
}
/**
* @license
* Copyright Google Inc. 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 GET_PROPERTY_NAME$1 = {};
var ɵ0$1 = GET_PROPERTY_NAME$1;
var USE_VALUE$1 = getClosureSafeProperty({ provide: String, useValue: ɵ0$1 }, GET_PROPERTY_NAME$1);
var EMPTY_ARRAY = [];
function convertInjectableProviderToFactory(type, provider) {
if (!provider) {
var reflectionCapabilities = new ReflectionCapabilities();
var deps_1 = reflectionCapabilities.parameters(type);
// TODO - convert to flags.
return function () { return new (type.bind.apply(type, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], injectArgs(deps_1))))(); };
}
if (USE_VALUE$1 in provider) {
var valueProvider_1 = provider;
return function () { return valueProvider_1.useValue; };
}
else if (provider.useExisting) {
var existingProvider_1 = provider;
return function () { return inject(existingProvider_1.useExisting); };
}
else if (provider.useFactory) {
var factoryProvider_1 = provider;
return function () { return factoryProvider_1.useFactory.apply(factoryProvider_1, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(injectArgs(factoryProvider_1.deps || EMPTY_ARRAY))); };
}
else if (provider.useClass) {
var classProvider_1 = provider;
var deps_2 = provider.deps;
if (!deps_2) {
var reflectionCapabilities = new ReflectionCapabilities();
deps_2 = reflectionCapabilities.parameters(type);
}
return function () {
return new ((_a = classProvider_1.useClass).bind.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], injectArgs(deps_2))))();
var _a;
};
}
else {
var deps_3 = provider.deps;
if (!deps_3) {
var reflectionCapabilities = new ReflectionCapabilities();
deps_3 = reflectionCapabilities.parameters(type);
}
return function () { return new (type.bind.apply(type, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], injectArgs(deps_3))))(); };
}
}
/**
* Injectable decorator and metadata.
*
* @Annotation
*/
var Injectable = makeDecorator('Injectable', undefined, undefined, undefined, function (injectableType, options) {
if (options && options.providedIn !== undefined &&
injectableType.ngInjectableDef === undefined) {
injectableType.ngInjectableDef = defineInjectable({
providedIn: options.providedIn,
factory: convertInjectableProviderToFactory(injectableType, options)
});
}
});
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Defines a schema that allows an NgModule to contain the following:
* - Non-Angular elements named with dash case (`-`).
* - Element properties named with dash case (`-`).
* Dash case is the naming convention for custom elements.
*
*
*/
var CUSTOM_ELEMENTS_SCHEMA = {
name: 'custom-elements'
};
/**
* Defines a schema that allows any property on any element.
*
* @experimental
*/
var NO_ERRORS_SCHEMA = {
name: 'no-errors-schema'
};
/**
* Decorator that marks the following class as an NgModule, and supplies
* configuration metadata for it.
*
* @Annotation
*/
var NgModule = makeDecorator('NgModule', function (ngModule) { return ngModule; }, undefined, undefined,
/**
* Decorator that marks the following class as an NgModule, and supplies
* configuration metadata for it.
*/
function (moduleType, metadata) {
var imports = (metadata && metadata.imports) || [];
if (metadata && metadata.exports) {
imports = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(imports, [metadata.exports]);
}
moduleType.ngInjectorDef = defineInjector({
factory: convertInjectableProviderToFactory(moduleType, { useClass: moduleType }),
providers: metadata && metadata.providers,
imports: imports,
});
});
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Defines template and style encapsulation options available for Component's {@link Component}.
*
* See {@link Component#encapsulation encapsulation}.
*
*/
var ViewEncapsulation;
(function (ViewEncapsulation) {
/**
* Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host
* Element and pre-processing the style rules provided via {@link Component#styles styles} or
* {@link Component#styleUrls styleUrls}, and adding the new Host Element attribute to all
* selectors.
*
* This is the default option.
*/
ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
/**
* @deprecated v6.1.0 - use {ViewEncapsulation.ShadowDom} instead.
* Use the native encapsulation mechanism of the renderer.
*
* For the DOM this means using the deprecated [Shadow DOM
* v0](https://w3c.github.io/webcomponents/spec/shadow/) and
* creating a ShadowRoot for Component's Host Element.
*/
ViewEncapsulation[ViewEncapsulation["Native"] = 1] = "Native";
/**
* Don't provide any template or style encapsulation.
*/
ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
/**
* Use Shadow DOM to encapsulate styles.
*
* For the DOM this means using modern [Shadow
* DOM](https://w3c.github.io/webcomponents/spec/shadow/) and
* creating a ShadowRoot for Component's Host Element.
*
* ### Example
* {@example core/ts/metadata/encapsulation.ts region='longform'}
*/
ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
})(ViewEncapsulation || (ViewEncapsulation = {}));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description Represents the version of Angular
*
*
*/
var Version = /** @class */ (function () {
function Version(full) {
this.full = full;
this.major = full.split('.')[0];
this.minor = full.split('.')[1];
this.patch = full.split('.').slice(2).join('.');
}
return Version;
}());
var VERSION = new Version('6.0.9');
/**
* @license
* Copyright Google Inc. 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 ERROR_DEBUG_CONTEXT = 'ngDebugContext';
var ERROR_ORIGINAL_ERROR = 'ngOriginalError';
var ERROR_LOGGER = 'ngErrorLogger';
function getDebugContext(error) {
return error[ERROR_DEBUG_CONTEXT];
}
function getOriginalError(error) {
return error[ERROR_ORIGINAL_ERROR];
}
function getErrorLogger(error) {
return error[ERROR_LOGGER] || defaultErrorLogger;
}
function defaultErrorLogger(console) {
var values = [];
for (var _i = 1; _i < arguments.length; _i++) {
values[_i - 1] = arguments[_i];
}
console.error.apply(console, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(values));
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Provides a hook for centralized exception handling.
*
* The default implementation of `ErrorHandler` prints error messages to the `console`. To
* intercept error handling, write a custom exception handler that replaces this default as
* appropriate for your app.
*
* @usageNotes
* ### Example
*
* ```
* class MyErrorHandler implements ErrorHandler {
* handleError(error) {
* // do something with the exception
* }
* }
*
* @NgModule({
* providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
* })
* class MyModule {}
* ```
*/
var ErrorHandler = /** @class */ (function () {
function ErrorHandler() {
/**
* @internal
*/
this._console = console;
}
ErrorHandler.prototype.handleError = function (error) {
var originalError = this._findOriginalError(error);
var context = this._findContext(error);
// Note: Browser consoles show the place from where console.error was called.
// We can use this to give users additional information about the error.
var errorLogger = getErrorLogger(error);
errorLogger(this._console, "ERROR", error);
if (originalError) {
errorLogger(this._console, "ORIGINAL ERROR", originalError);
}
if (context) {
errorLogger(this._console, 'ERROR CONTEXT', context);
}
};
/** @internal */
ErrorHandler.prototype._findContext = function (error) {
if (error) {
return getDebugContext(error) ? getDebugContext(error) :
this._findContext(getOriginalError(error));
}
return null;
};
/** @internal */
ErrorHandler.prototype._findOriginalError = function (error) {
var e = getOriginalError(error);
while (e && getOriginalError(e)) {
e = getOriginalError(e);
}
return e;
};
return ErrorHandler;
}());
function wrappedError(message, originalError) {
var msg = message + " caused by: " + (originalError instanceof Error ? originalError.message : originalError);
var error = Error(msg);
error[ERROR_ORIGINAL_ERROR] = originalError;
return error;
}
/**
* @license
* Copyright Google Inc. 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
*/
function findFirstClosedCycle(keys) {
var res = [];
for (var i = 0; i < keys.length; ++i) {
if (res.indexOf(keys[i]) > -1) {
res.push(keys[i]);
return res;
}
res.push(keys[i]);
}
return res;
}
function constructResolvingPath(keys) {
if (keys.length > 1) {
var reversed = findFirstClosedCycle(keys.slice().reverse());
var tokenStrs = reversed.map(function (k) { return stringify(k.token); });
return ' (' + tokenStrs.join(' -> ') + ')';
}
return '';
}
function injectionError(injector, key, constructResolvingMessage, originalError) {
var keys = [key];
var errMsg = constructResolvingMessage(keys);
var error = (originalError ? wrappedError(errMsg, originalError) : Error(errMsg));
error.addKey = addKey;
error.keys = keys;
error.injectors = [injector];
error.constructResolvingMessage = constructResolvingMessage;
error[ERROR_ORIGINAL_ERROR] = originalError;
return error;
}
function addKey(injector, key) {
this.injectors.push(injector);
this.keys.push(key);
// Note: This updated message won't be reflected in the `.stack` property
this.message = this.constructResolvingMessage(this.keys);
}
/**
* Thrown when trying to retrieve a dependency by key from {@link Injector}, but the
* {@link Injector} does not have a {@link Provider} for the given key.
*
* @usageNotes
* ### Example
*
* ```typescript
* class A {
* constructor(b:B) {}
* }
*
* expect(() => Injector.resolveAndCreate([A])).toThrowError();
* ```
*/
function noProviderError(injector, key) {
return injectionError(injector, key, function (keys) {
var first = stringify(keys[0].token);
return "No provider for " + first + "!" + constructResolvingPath(keys);
});
}
/**
* Thrown when dependencies form a cycle.
*
* @usageNotes
* ### Example
*
* ```typescript
* var injector = Injector.resolveAndCreate([
* {provide: "one", useFactory: (two) => "two", deps: [[new Inject("two")]]},
* {provide: "two", useFactory: (one) => "one", deps: [[new Inject("one")]]}
* ]);
*
* expect(() => injector.get("one")).toThrowError();
* ```
*
* Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.
*/
function cyclicDependencyError(injector, key) {
return injectionError(injector, key, function (keys) {
return "Cannot instantiate cyclic dependency!" + constructResolvingPath(keys);
});
}
/**
* Thrown when a constructing type returns with an Error.
*
* The `InstantiationError` class contains the original error plus the dependency graph which caused
* this object to be instantiated.
*
* @usageNotes
* ### Example
*
* ```typescript
* class A {
* constructor() {
* throw new Error('message');
* }
* }
*
* var injector = Injector.resolveAndCreate([A]);
* try {
* injector.get(A);
* } catch (e) {
* expect(e instanceof InstantiationError).toBe(true);
* expect(e.originalException.message).toEqual("message");
* expect(e.originalStack).toBeDefined();
* }
* ```
*/
function instantiationError(injector, originalException, originalStack, key) {
return injectionError(injector, key, function (keys) {
var first = stringify(keys[0].token);
return originalException.message + ": Error during instantiation of " + first + "!" + constructResolvingPath(keys) + ".";
}, originalException);
}
/**
* Thrown when an object other then {@link Provider} (or `Type`) is passed to {@link Injector}
* creation.
*
* @usageNotes
* ### Example
*
* ```typescript
* expect(() => Injector.resolveAndCreate(["not a type"])).toThrowError();
* ```
*/
function invalidProviderError(provider) {
return Error("Invalid provider - only instances of Provider and Type are allowed, got: " + provider);
}
/**
* Thrown when the class has no annotation information.
*
* Lack of annotation information prevents the {@link Injector} from determining which dependencies
* need to be injected into the constructor.
*
* @usageNotes
* ### Example
*
* ```typescript
* class A {
* constructor(b) {}
* }
*
* expect(() => Injector.resolveAndCreate([A])).toThrowError();
* ```
*
* This error is also thrown when the class not marked with {@link Injectable} has parameter types.
*
* ```typescript
* class B {}
*
* class A {
* constructor(b:B) {} // no information about the parameter types of A is available at runtime.
* }
*
* expect(() => Injector.resolveAndCreate([A,B])).toThrowError();
* ```
*
*/
function noAnnotationError(typeOrFunc, params) {
var signature = [];
for (var i = 0, ii = params.length; i < ii; i++) {
var parameter = params[i];
if (!parameter || parameter.length == 0) {
signature.push('?');
}
else {
signature.push(parameter.map(stringify).join(' '));
}
}
return Error('Cannot resolve all parameters for \'' + stringify(typeOrFunc) + '\'(' +
signature.join(', ') + '). ' +
'Make sure that all the parameters are decorated with Inject or have valid type annotations and that \'' +
stringify(typeOrFunc) + '\' is decorated with Injectable.');
}
/**
* Thrown when getting an object by index.
*
* @usageNotes
* ### Example
*
* ```typescript
* class A {}
*
* var injector = Injector.resolveAndCreate([A]);
*
* expect(() => injector.getAt(100)).toThrowError();
* ```
*
*/
function outOfBoundsError(index) {
return Error("Index " + index + " is out-of-bounds.");
}
// TODO: add a working example after alpha38 is released
/**
* Thrown when a multi provider and a regular provider are bound to the same token.
*
* @usageNotes
* ### Example
*
* ```typescript
* expect(() => Injector.resolveAndCreate([
* { provide: "Strings", useValue: "string1", multi: true},
* { provide: "Strings", useValue: "string2", multi: false}
* ])).toThrowError();
* ```
*/
function mixingMultiProvidersWithRegularProvidersError(provider1, provider2) {
return Error("Cannot mix multi providers and regular providers, got: " + provider1 + " " + provider2);
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A unique object used for retrieving items from the {@link ReflectiveInjector}.
*
* Keys have:
* - a system-wide unique `id`.
* - a `token`.
*
* `Key` is used internally by {@link ReflectiveInjector} because its system-wide unique `id` allows
* the
* injector to store created objects in a more efficient way.
*
* `Key` should not be created directly. {@link ReflectiveInjector} creates keys automatically when
* resolving
* providers.
* @deprecated No replacement
*/
var ReflectiveKey = /** @class */ (function () {
/**
* Private
*/
function ReflectiveKey(token, id) {
this.token = token;
this.id = id;
if (!token) {
throw new Error('Token must be defined!');
}
this.displayName = stringify(this.token);
}
/**
* Retrieves a `Key` for a token.
*/
ReflectiveKey.get = function (token) {
return _globalKeyRegistry.get(resolveForwardRef(token));
};
Object.defineProperty(ReflectiveKey, "numberOfKeys", {
/**
* @returns the number of keys registered in the system.
*/
get: function () { return _globalKeyRegistry.numberOfKeys; },
enumerable: true,
configurable: true
});
return ReflectiveKey;
}());
var KeyRegistry = /** @class */ (function () {
function KeyRegistry() {
this._allKeys = new Map();
}
KeyRegistry.prototype.get = function (token) {
if (token instanceof ReflectiveKey)
return token;
if (this._allKeys.has(token)) {
return this._allKeys.get(token);
}
var newKey = new ReflectiveKey(token, ReflectiveKey.numberOfKeys);
this._allKeys.set(token, newKey);
return newKey;
};
Object.defineProperty(KeyRegistry.prototype, "numberOfKeys", {
get: function () { return this._allKeys.size; },
enumerable: true,
configurable: true
});
return KeyRegistry;
}());
var _globalKeyRegistry = new KeyRegistry();
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Provides access to reflection data about symbols. Used internally by Angular
* to power dependency injection and compilation.
*/
var Reflector = /** @class */ (function () {
function Reflector(reflectionCapabilities) {
this.reflectionCapabilities = reflectionCapabilities;
}
Reflector.prototype.updateCapabilities = function (caps) { this.reflectionCapabilities = caps; };
Reflector.prototype.factory = function (type) { return this.reflectionCapabilities.factory(type); };
Reflector.prototype.parameters = function (typeOrFunc) {
return this.reflectionCapabilities.parameters(typeOrFunc);
};
Reflector.prototype.annotations = function (typeOrFunc) {
return this.reflectionCapabilities.annotations(typeOrFunc);
};
Reflector.prototype.propMetadata = function (typeOrFunc) {
return this.reflectionCapabilities.propMetadata(typeOrFunc);
};
Reflector.prototype.hasLifecycleHook = function (type, lcProperty) {
return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);
};
Reflector.prototype.getter = function (name) { return this.reflectionCapabilities.getter(name); };
Reflector.prototype.setter = function (name) { return this.reflectionCapabilities.setter(name); };
Reflector.prototype.method = function (name) { return this.reflectionCapabilities.method(name); };
Reflector.prototype.importUri = function (type) { return this.reflectionCapabilities.importUri(type); };
Reflector.prototype.resourceUri = function (type) { return this.reflectionCapabilities.resourceUri(type); };
Reflector.prototype.resolveIdentifier = function (name, moduleUrl, members, runtime) {
return this.reflectionCapabilities.resolveIdentifier(name, moduleUrl, members, runtime);
};
Reflector.prototype.resolveEnum = function (identifier, name) {
return this.reflectionCapabilities.resolveEnum(identifier, name);
};
return Reflector;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* The {@link Reflector} used internally in Angular to access metadata
* about symbols.
*/
var reflector = new Reflector(new ReflectionCapabilities());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* `Dependency` is used by the framework to extend DI.
* This is internal to Angular and should not be used directly.
*/
var ReflectiveDependency = /** @class */ (function () {
function ReflectiveDependency(key, optional, visibility) {
this.key = key;
this.optional = optional;
this.visibility = visibility;
}
ReflectiveDependency.fromKey = function (key) {
return new ReflectiveDependency(key, false, null);
};
return ReflectiveDependency;
}());
var _EMPTY_LIST = [];
var ResolvedReflectiveProvider_ = /** @class */ (function () {
function ResolvedReflectiveProvider_(key, resolvedFactories, multiProvider) {
this.key = key;
this.resolvedFactories = resolvedFactories;
this.multiProvider = multiProvider;
this.resolvedFactory = this.resolvedFactories[0];
}
return ResolvedReflectiveProvider_;
}());
/**
* An internal resolved representation of a factory function created by resolving `Provider`.
* @experimental
*/
var ResolvedReflectiveFactory = /** @class */ (function () {
function ResolvedReflectiveFactory(
/**
* Factory function which can return an instance of an object represented by a key.
*/
factory,
/**
* Arguments (dependencies) to the `factory` function.
*/
dependencies) {
this.factory = factory;
this.dependencies = dependencies;
}
return ResolvedReflectiveFactory;
}());
/**
* Resolve a single provider.
*/
function resolveReflectiveFactory(provider) {
var factoryFn;
var resolvedDeps;
if (provider.useClass) {
var useClass = resolveForwardRef(provider.useClass);
factoryFn = reflector.factory(useClass);
resolvedDeps = _dependenciesFor(useClass);
}
else if (provider.useExisting) {
factoryFn = function (aliasInstance) { return aliasInstance; };
resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];
}
else if (provider.useFactory) {
factoryFn = provider.useFactory;
resolvedDeps = constructDependencies(provider.useFactory, provider.deps);
}
else {
factoryFn = function () { return provider.useValue; };
resolvedDeps = _EMPTY_LIST;
}
return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);
}
/**
* Converts the `Provider` into `ResolvedProvider`.
*
* `Injector` internally only uses `ResolvedProvider`, `Provider` contains convenience provider
* syntax.
*/
function resolveReflectiveProvider(provider) {
return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);
}
/**
* Resolve a list of Providers.
*/
function resolveReflectiveProviders(providers) {
var normalized = _normalizeProviders(providers, []);
var resolved = normalized.map(resolveReflectiveProvider);
var resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());
return Array.from(resolvedProviderMap.values());
}
/**
* Merges a list of ResolvedProviders into a list where each key is contained exactly once and
* multi providers have been merged.
*/
function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {
for (var i = 0; i < providers.length; i++) {
var provider = providers[i];
var existing = normalizedProvidersMap.get(provider.key.id);
if (existing) {
if (provider.multiProvider !== existing.multiProvider) {
throw mixingMultiProvidersWithRegularProvidersError(existing, provider);
}
if (provider.multiProvider) {
for (var j = 0; j < provider.resolvedFactories.length; j++) {
existing.resolvedFactories.push(provider.resolvedFactories[j]);
}
}
else {
normalizedProvidersMap.set(provider.key.id, provider);
}
}
else {
var resolvedProvider = void 0;
if (provider.multiProvider) {
resolvedProvider = new ResolvedReflectiveProvider_(provider.key, provider.resolvedFactories.slice(), provider.multiProvider);
}
else {
resolvedProvider = provider;
}
normalizedProvidersMap.set(provider.key.id, resolvedProvider);
}
}
return normalizedProvidersMap;
}
function _normalizeProviders(providers, res) {
providers.forEach(function (b) {
if (b instanceof Type) {
res.push({ provide: b, useClass: b });
}
else if (b && typeof b == 'object' && b.provide !== undefined) {
res.push(b);
}
else if (b instanceof Array) {
_normalizeProviders(b, res);
}
else {
throw invalidProviderError(b);
}
});
return res;
}
function constructDependencies(typeOrFunc, dependencies) {
if (!dependencies) {
return _dependenciesFor(typeOrFunc);
}
else {
var params_1 = dependencies.map(function (t) { return [t]; });
return dependencies.map(function (t) { return _extractToken(typeOrFunc, t, params_1); });
}
}
function _dependenciesFor(typeOrFunc) {
var params = reflector.parameters(typeOrFunc);
if (!params)
return [];
if (params.some(function (p) { return p == null; })) {
throw noAnnotationError(typeOrFunc, params);
}
return params.map(function (p) { return _extractToken(typeOrFunc, p, params); });
}
function _extractToken(typeOrFunc, metadata, params) {
var token = null;
var optional = false;
if (!Array.isArray(metadata)) {
if (metadata instanceof Inject) {
return _createDependency(metadata.token, optional, null);
}
else {
return _createDependency(metadata, optional, null);
}
}
var visibility = null;
for (var i = 0; i < metadata.length; ++i) {
var paramMetadata = metadata[i];
if (paramMetadata instanceof Type) {
token = paramMetadata;
}
else if (paramMetadata instanceof Inject) {
token = paramMetadata.token;
}
else if (paramMetadata instanceof Optional) {
optional = true;
}
else if (paramMetadata instanceof Self || paramMetadata instanceof SkipSelf) {
visibility = paramMetadata;
}
else if (paramMetadata instanceof InjectionToken) {
token = paramMetadata;
}
}
token = resolveForwardRef(token);
if (token != null) {
return _createDependency(token, optional, visibility);
}
else {
throw noAnnotationError(typeOrFunc, params);
}
}
function _createDependency(token, optional, visibility) {
return new ReflectiveDependency(ReflectiveKey.get(token), optional, visibility);
}
/**
* @license
* Copyright Google Inc. 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
*/
// Threshold for the dynamic version
var UNDEFINED = new Object();
/**
* A ReflectiveDependency injection container used for instantiating objects and resolving
* dependencies.
*
* An `Injector` is a replacement for a `new` operator, which can automatically resolve the
* constructor dependencies.
*
* In typical use, application code asks for the dependencies in the constructor and they are
* resolved by the `Injector`.
*
* @usageNotes
* ### Example
*
* The following example creates an `Injector` configured to create `Engine` and `Car`.
*
* ```typescript
* @Injectable()
* class Engine {
* }
*
* @Injectable()
* class Car {
* constructor(public engine:Engine) {}
* }
*
* var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);
* var car = injector.get(Car);
* expect(car instanceof Car).toBe(true);
* expect(car.engine instanceof Engine).toBe(true);
* ```
*
* Notice, we don't use the `new` operator because we explicitly want to have the `Injector`
* resolve all of the object's dependencies automatically.
*
* @deprecated from v5 - slow and brings in a lot of code, Use `Injector.create` instead.
*/
var ReflectiveInjector = /** @class */ (function () {
function ReflectiveInjector() {
}
/**
* Turns an array of provider definitions into an array of resolved providers.
*
* A resolution is a process of flattening multiple nested arrays and converting individual
* providers into an array of `ResolvedReflectiveProvider`s.
*
* @usageNotes
* ### Example
*
* ```typescript
* @Injectable()
* class Engine {
* }
*
* @Injectable()
* class Car {
* constructor(public engine:Engine) {}
* }
*
* var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);
*
* expect(providers.length).toEqual(2);
*
* expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);
* expect(providers[0].key.displayName).toBe("Car");
* expect(providers[0].dependencies.length).toEqual(1);
* expect(providers[0].factory).toBeDefined();
*
* expect(providers[1].key.displayName).toBe("Engine");
* });
* ```
*
*/
ReflectiveInjector.resolve = function (providers) {
return resolveReflectiveProviders(providers);
};
/**
* Resolves an array of providers and creates an injector from those providers.
*
* The passed-in providers can be an array of `Type`, `Provider`,
* or a recursive array of more providers.
*
* @usageNotes
* ### Example
*
* ```typescript
* @Injectable()
* class Engine {
* }
*
* @Injectable()
* class Car {
* constructor(public engine:Engine) {}
* }
*
* var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);
* expect(injector.get(Car) instanceof Car).toBe(true);
* ```
*/
ReflectiveInjector.resolveAndCreate = function (providers, parent) {
var ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);
return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders, parent);
};
/**
* Creates an injector from previously resolved providers.
*
* This API is the recommended way to construct injectors in performance-sensitive parts.
*
* @usageNotes
* ### Example
*
* ```typescript
* @Injectable()
* class Engine {
* }
*
* @Injectable()
* class Car {
* constructor(public engine:Engine) {}
* }
*
* var providers = ReflectiveInjector.resolve([Car, Engine]);
* var injector = ReflectiveInjector.fromResolvedProviders(providers);
* expect(injector.get(Car) instanceof Car).toBe(true);
* ```
* @experimental
*/
ReflectiveInjector.fromResolvedProviders = function (providers, parent) {
return new ReflectiveInjector_(providers, parent);
};
return ReflectiveInjector;
}());
var ReflectiveInjector_ = /** @class */ (function () {
/**
* Private
*/
function ReflectiveInjector_(_providers, _parent) {
/** @internal */
this._constructionCounter = 0;
this._providers = _providers;
this.parent = _parent || null;
var len = _providers.length;
this.keyIds = new Array(len);
this.objs = new Array(len);
for (var i = 0; i < len; i++) {
this.keyIds[i] = _providers[i].key.id;
this.objs[i] = UNDEFINED;
}
}
ReflectiveInjector_.prototype.get = function (token, notFoundValue) {
if (notFoundValue === void 0) { notFoundValue = THROW_IF_NOT_FOUND; }
return this._getByKey(ReflectiveKey.get(token), null, notFoundValue);
};
ReflectiveInjector_.prototype.resolveAndCreateChild = function (providers) {
var ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);
return this.createChildFromResolved(ResolvedReflectiveProviders);
};
ReflectiveInjector_.prototype.createChildFromResolved = function (providers) {
var inj = new ReflectiveInjector_(providers);
inj.parent = this;
return inj;
};
ReflectiveInjector_.prototype.resolveAndInstantiate = function (provider) {
return this.instantiateResolved(ReflectiveInjector.resolve([provider])[0]);
};
ReflectiveInjector_.prototype.instantiateResolved = function (provider) {
return this._instantiateProvider(provider);
};
ReflectiveInjector_.prototype.getProviderAtIndex = function (index) {
if (index < 0 || index >= this._providers.length) {
throw outOfBoundsError(index);
}
return this._providers[index];
};
/** @internal */
ReflectiveInjector_.prototype._new = function (provider) {
if (this._constructionCounter++ > this._getMaxNumberOfObjects()) {
throw cyclicDependencyError(this, provider.key);
}
return this._instantiateProvider(provider);
};
ReflectiveInjector_.prototype._getMaxNumberOfObjects = function () { return this.objs.length; };
ReflectiveInjector_.prototype._instantiateProvider = function (provider) {
if (provider.multiProvider) {
var res = new Array(provider.resolvedFactories.length);
for (var i = 0; i < provider.resolvedFactories.length; ++i) {
res[i] = this._instantiate(provider, provider.resolvedFactories[i]);
}
return res;
}
else {
return this._instantiate(provider, provider.resolvedFactories[0]);
}
};
ReflectiveInjector_.prototype._instantiate = function (provider, ResolvedReflectiveFactory$$1) {
var _this = this;
var factory = ResolvedReflectiveFactory$$1.factory;
var deps;
try {
deps =
ResolvedReflectiveFactory$$1.dependencies.map(function (dep) { return _this._getByReflectiveDependency(dep); });
}
catch (e) {
if (e.addKey) {
e.addKey(this, provider.key);
}
throw e;
}
var obj;
try {
obj = factory.apply(void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(deps));
}
catch (e) {
throw instantiationError(this, e, e.stack, provider.key);
}
return obj;
};
ReflectiveInjector_.prototype._getByReflectiveDependency = function (dep) {
return this._getByKey(dep.key, dep.visibility, dep.optional ? null : THROW_IF_NOT_FOUND);
};
ReflectiveInjector_.prototype._getByKey = function (key, visibility, notFoundValue) {
if (key === ReflectiveInjector_.INJECTOR_KEY) {
return this;
}
if (visibility instanceof Self) {
return this._getByKeySelf(key, notFoundValue);
}
else {
return this._getByKeyDefault(key, notFoundValue, visibility);
}
};
ReflectiveInjector_.prototype._getObjByKeyId = function (keyId) {
for (var i = 0; i < this.keyIds.length; i++) {
if (this.keyIds[i] === keyId) {
if (this.objs[i] === UNDEFINED) {
this.objs[i] = this._new(this._providers[i]);
}
return this.objs[i];
}
}
return UNDEFINED;
};
/** @internal */
ReflectiveInjector_.prototype._throwOrNull = function (key, notFoundValue) {
if (notFoundValue !== THROW_IF_NOT_FOUND) {
return notFoundValue;
}
else {
throw noProviderError(this, key);
}
};
/** @internal */
ReflectiveInjector_.prototype._getByKeySelf = function (key, notFoundValue) {
var obj = this._getObjByKeyId(key.id);
return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);
};
/** @internal */
ReflectiveInjector_.prototype._getByKeyDefault = function (key, notFoundValue, visibility) {
var inj;
if (visibility instanceof SkipSelf) {
inj = this.parent;
}
else {
inj = this;
}
while (inj instanceof ReflectiveInjector_) {
var inj_ = inj;
var obj = inj_._getObjByKeyId(key.id);
if (obj !== UNDEFINED)
return obj;
inj = inj_.parent;
}
if (inj !== null) {
return inj.get(key.token, notFoundValue);
}
else {
return this._throwOrNull(key, notFoundValue);
}
};
Object.defineProperty(ReflectiveInjector_.prototype, "displayName", {
get: function () {
var providers = _mapProviders(this, function (b) { return ' "' + b.key.displayName + '" '; })
.join(', ');
return "ReflectiveInjector(providers: [" + providers + "])";
},
enumerable: true,
configurable: true
});
ReflectiveInjector_.prototype.toString = function () { return this.displayName; };
ReflectiveInjector_.INJECTOR_KEY = ReflectiveKey.get(Injector);
return ReflectiveInjector_;
}());
function _mapProviders(injector, fn) {
var res = new Array(injector._providers.length);
for (var i = 0; i < injector._providers.length; ++i) {
res[i] = fn(injector.getProviderAtIndex(i));
}
return res;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* An internal token whose presence in an injector indicates that the injector should treat itself
* as a root scoped injector when processing requests for unknown tokens which may indicate
* they are provided in the root scope.
*/
var APP_ROOT = new InjectionToken('The presence of this token marks an injector as being the root injector.');
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Marker which indicates that a value has not yet been created from the factory function.
*/
var NOT_YET = {};
/**
* Marker which indicates that the factory function for a token is in the process of being called.
*
* If the injector is asked to inject a token with its value set to CIRCULAR, that indicates
* injection of a dependency has recursively attempted to inject the original token, and there is
* a circular dependency among the providers.
*/
var CIRCULAR$1 = {};
var EMPTY_ARRAY$1 = [];
/**
* A lazily initialized NullInjector.
*/
var NULL_INJECTOR$1 = undefined;
function getNullInjector() {
if (NULL_INJECTOR$1 === undefined) {
NULL_INJECTOR$1 = new NullInjector();
}
return NULL_INJECTOR$1;
}
/**
* Create a new `Injector` which is configured using `InjectorType`s.
*
* @experimental
*/
function createInjector(defType, parent) {
if (parent === void 0) { parent = null; }
parent = parent || getNullInjector();
return new R3Injector(defType, parent);
}
var R3Injector = /** @class */ (function () {
function R3Injector(def, parent) {
var _this = this;
this.parent = parent;
/**
* Map of tokens to records which contain the instances of those tokens.
*/
this.records = new Map();
/**
* The transitive set of `InjectorType`s which define this injector.
*/
this.injectorDefTypes = new Set();
/**
* Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.
*/
this.onDestroy = new Set();
/**
* Flag indicating that this injector was previously destroyed.
*/
this.destroyed = false;
// Start off by creating Records for every provider declared in every InjectorType
// included transitively in `def`.
deepForEach([def], function (injectorDef) { return _this.processInjectorType(injectorDef, new Set()); });
// Make sure the INJECTOR token provides this injector.
this.records.set(INJECTOR, makeRecord(undefined, this));
// Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide
// any injectable scoped to APP_ROOT_SCOPE.
this.isRootInjector = this.records.has(APP_ROOT);
// Eagerly instantiate the InjectorType classes themselves.
this.injectorDefTypes.forEach(function (defType) { return _this.get(defType); });
}
/**
* Destroy the injector and release references to every instance or provider associated with it.
*
* Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a
* hook was found.
*/
R3Injector.prototype.destroy = function () {
this.assertNotDestroyed();
// Set destroyed = true first, in case lifecycle hooks re-enter destroy().
this.destroyed = true;
try {
// Call all the lifecycle hooks.
this.onDestroy.forEach(function (service) { return service.ngOnDestroy(); });
}
finally {
// Release all references.
this.records.clear();
this.onDestroy.clear();
this.injectorDefTypes.clear();
}
};
R3Injector.prototype.get = function (token, notFoundValue, flags) {
if (notFoundValue === void 0) { notFoundValue = THROW_IF_NOT_FOUND; }
if (flags === void 0) { flags = 0 /* Default */; }
this.assertNotDestroyed();
// Set the injection context.
var previousInjector = setCurrentInjector(this);
try {
// Check for the SkipSelf flag.
if (!(flags & 4 /* SkipSelf */)) {
// SkipSelf isn't set, check if the record belongs to this injector.
var record = this.records.get(token);
if (record === undefined) {
// No record, but maybe the token is scoped to this injector. Look for an ngInjectableDef
// with a scope matching this injector.
var def = couldBeInjectableType(token) &&
token.ngInjectableDef ||
undefined;
if (def !== undefined && this.injectableDefInScope(def)) {
// Found an ngInjectableDef and it's scoped to this injector. Pretend as if it was here
// all along.
record = injectableDefRecord(token);
this.records.set(token, record);
}
}
// If a record was found, get the instance for it and return it.
if (record !== undefined) {
return this.hydrate(token, record);
}
}
// Select the next injector based on the Self flag - if self is set, the next injector is
// the NullInjector, otherwise it's the parent.
var next = !(flags & 2 /* Self */) ? this.parent : getNullInjector();
return this.parent.get(token, notFoundValue);
}
finally {
// Lastly, clean up the state by restoring the previous injector.
setCurrentInjector(previousInjector);
}
};
R3Injector.prototype.assertNotDestroyed = function () {
if (this.destroyed) {
throw new Error('Injector has already been destroyed.');
}
};
/**
* Add an `InjectorType` or `InjectorDefTypeWithProviders` and all of its transitive providers
* to this injector.
*/
R3Injector.prototype.processInjectorType = function (defOrWrappedDef, parents) {
var _this = this;
defOrWrappedDef = resolveForwardRef(defOrWrappedDef);
// Either the defOrWrappedDef is an InjectorType (with ngInjectorDef) or an
// InjectorDefTypeWithProviders (aka ModuleWithProviders). Detecting either is a megamorphic
// read, so care is taken to only do the read once.
// First attempt to read the ngInjectorDef.
var def = defOrWrappedDef.ngInjectorDef;
// If that's not present, then attempt to read ngModule from the InjectorDefTypeWithProviders.
var ngModule = (def == null) && defOrWrappedDef.ngModule || undefined;
// Determine the InjectorType. In the case where `defOrWrappedDef` is an `InjectorType`,
// then this is easy. In the case of an InjectorDefTypeWithProviders, then the definition type
// is the `ngModule`.
var defType = (ngModule === undefined) ? defOrWrappedDef : ngModule;
// If defOrWrappedType was an InjectorDefTypeWithProviders, then .providers may hold some
// extra providers.
var providers = (ngModule !== undefined) && defOrWrappedDef.providers ||
EMPTY_ARRAY$1;
// Finally, if defOrWrappedType was an `InjectorDefTypeWithProviders`, then the actual
// `InjectorDef` is on its `ngModule`.
if (ngModule !== undefined) {
def = ngModule.ngInjectorDef;
}
// If no definition was found, throw.
if (def == null) {
throw new Error("Type " + stringify(defType) + " is missing an ngInjectorDef definition.");
}
// Check for circular dependencies.
if (parents.has(defType)) {
throw new Error("Circular dependency: type " + stringify(defType) + " ends up importing itself.");
}
// Track the InjectorType and add a provider for it.
this.injectorDefTypes.add(defType);
this.records.set(defType, makeRecord(def.factory));
// Add providers in the same way that @NgModule resolution did:
// First, include providers from any imports.
if (def.imports != null) {
// Before processing defType's imports, add it to the set of parents. This way, if it ends
// up deeply importing itself, this can be detected.
parents.add(defType);
try {
deepForEach(def.imports, function (imported) { return _this.processInjectorType(imported, parents); });
}
finally {
// Remove it from the parents set when finished.
parents.delete(defType);
}
}
// Next, include providers listed on the definition itself.
if (def.providers != null) {
deepForEach(def.providers, function (provider) { return _this.processProvider(provider); });
}
// Finally, include providers from an InjectorDefTypeWithProviders if there was one.
deepForEach(providers, function (provider) { return _this.processProvider(provider); });
};
/**
* Process a `SingleProvider` and add it.
*/
R3Injector.prototype.processProvider = function (provider) {
// Determine the token from the provider. Either it's its own token, or has a {provide: ...}
// property.
provider = resolveForwardRef(provider);
var token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);
// Construct a `Record` for the provider.
var record = providerToRecord(provider);
if (!isTypeProvider(provider) && provider.multi === true) {
// If the provider indicates that it's a multi-provider, process it specially.
// First check whether it's been defined already.
var multiRecord_1 = this.records.get(token);
if (multiRecord_1) {
// It has. Throw a nice error if
if (multiRecord_1.multi === undefined) {
throw new Error("Mixed multi-provider for " + token + ".");
}
}
else {
token = provider;
multiRecord_1 = makeRecord(undefined, NOT_YET, true);
multiRecord_1.factory = function () { return injectArgs(multiRecord_1.multi); };
this.records.set(token, multiRecord_1);
}
token = provider;
multiRecord_1.multi.push(provider);
}
var existing = this.records.get(token);
if (existing && existing.multi !== undefined) {
throw new Error("Mixed multi-provider for " + token);
}
this.records.set(token, record);
};
R3Injector.prototype.hydrate = function (token, record) {
if (record.value === CIRCULAR$1) {
throw new Error("Circular dep for " + stringify(token));
}
else if (record.value === NOT_YET) {
record.value = CIRCULAR$1;
record.value = record.factory();
}
if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {
this.onDestroy.add(record.value);
}
return record.value;
};
R3Injector.prototype.injectableDefInScope = function (def) {
if (!def.providedIn) {
return false;
}
else if (typeof def.providedIn === 'string') {
return def.providedIn === 'any' || (def.providedIn === 'root' && this.isRootInjector);
}
else {
return this.injectorDefTypes.has(def.providedIn);
}
};
return R3Injector;
}());
function injectableDefRecord(token) {
var def = token.ngInjectableDef;
if (def === undefined) {
throw new Error("Type " + stringify(token) + " is missing an ngInjectableDef definition.");
}
return makeRecord(def.factory);
}
function providerToRecord(provider) {
var token = resolveForwardRef(provider);
var value = NOT_YET;
var factory = undefined;
if (isTypeProvider(provider)) {
return injectableDefRecord(provider);
}
else {
token = resolveForwardRef(provider.provide);
if (isValueProvider(provider)) {
value = provider.useValue;
}
else if (isExistingProvider(provider)) {
factory = function () { return inject(provider.useExisting); };
}
else if (isFactoryProvider(provider)) {
factory = function () { return provider.useFactory.apply(provider, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(injectArgs(provider.deps || []))); };
}
else {
var classRef_1 = provider.useClass || token;
if (hasDeps(provider)) {
factory = function () { return new ((classRef_1).bind.apply((classRef_1), Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], injectArgs(provider.deps))))(); };
}
else {
return injectableDefRecord(classRef_1);
}
}
}
return makeRecord(factory, value);
}
function makeRecord(factory, value, multi) {
if (value === void 0) { value = NOT_YET; }
if (multi === void 0) { multi = false; }
return {
factory: factory,
value: value,
multi: multi ? [] : undefined,
};
}
function deepForEach(input, fn) {
input.forEach(function (value) { return Array.isArray(value) ? deepForEach(value, fn) : fn(value); });
}
function isValueProvider(value) {
return USE_VALUE in value;
}
function isExistingProvider(value) {
return !!value.useExisting;
}
function isFactoryProvider(value) {
return !!value.useFactory;
}
function isTypeProvider(value) {
return typeof value === 'function';
}
function hasDeps(value) {
return !!value.deps;
}
function hasOnDestroy(value) {
return typeof value === 'object' && value != null && value.ngOnDestroy &&
typeof value.ngOnDestroy === 'function';
}
function couldBeInjectableType(value) {
return (typeof value === 'function') ||
(typeof value === 'object' && value instanceof InjectionToken);
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Determine if the argument is shaped like a Promise
*/
function isPromise(obj) {
// allow any Promise/A+ compliant thenable.
// It's up to the caller to ensure that obj.then conforms to the spec
return !!obj && typeof obj.then === 'function';
}
/**
* Determine if the argument is an Observable
*/
function isObservable(obj) {
// TODO: use Symbol.observable when https://github.com/ReactiveX/rxjs/issues/2415 will be resolved
return !!obj && typeof obj.subscribe === 'function';
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A function that will be executed when an application is initialized.
* @experimental
*/
var APP_INITIALIZER = new InjectionToken('Application Initializer');
/**
* A class that reflects the state of running {@link APP_INITIALIZER}s.
*
* @experimental
*/
var ApplicationInitStatus = /** @class */ (function () {
function ApplicationInitStatus(appInits) {
var _this = this;
this.appInits = appInits;
this.initialized = false;
this.done = false;
this.donePromise = new Promise(function (res, rej) {
_this.resolve = res;
_this.reject = rej;
});
}
/** @internal */
ApplicationInitStatus.prototype.runInitializers = function () {
var _this = this;
if (this.initialized) {
return;
}
var asyncInitPromises = [];
var complete = function () {
_this.done = true;
_this.resolve();
};
if (this.appInits) {
for (var i = 0; i < this.appInits.length; i++) {
var initResult = this.appInits[i]();
if (isPromise(initResult)) {
asyncInitPromises.push(initResult);
}
}
}
Promise.all(asyncInitPromises).then(function () { complete(); }).catch(function (e) { _this.reject(e); });
if (asyncInitPromises.length === 0) {
complete();
}
this.initialized = true;
};
ApplicationInitStatus.decorators = [
{ type: Injectable }
];
/** @nocollapse */
ApplicationInitStatus.ctorParameters = function () { return [
{ type: Array, decorators: [{ type: Inject, args: [APP_INITIALIZER,] }, { type: Optional }] }
]; };
return ApplicationInitStatus;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A DI Token representing a unique string id assigned to the application by Angular and used
* primarily for prefixing application attributes and CSS styles when
* {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.
*
* If you need to avoid randomly generated value to be used as an application id, you can provide
* a custom value via a DI provider <!-- TODO: provider --> configuring the root {@link Injector}
* using this token.
* @experimental
*/
var APP_ID = new InjectionToken('AppId');
function _appIdRandomProviderFactory() {
return "" + _randomChar() + _randomChar() + _randomChar();
}
/**
* Providers that will generate a random APP_ID_TOKEN.
* @experimental
*/
var APP_ID_RANDOM_PROVIDER = {
provide: APP_ID,
useFactory: _appIdRandomProviderFactory,
deps: [],
};
function _randomChar() {
return String.fromCharCode(97 + Math.floor(Math.random() * 25));
}
/**
* A function that will be executed when a platform is initialized.
* @experimental
*/
var PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');
/**
* A token that indicates an opaque platform id.
* @experimental
*/
var PLATFORM_ID = new InjectionToken('Platform ID');
/**
* All callbacks provided via this token will be called for every component that is bootstrapped.
* Signature of the callback:
*
* `(componentRef: ComponentRef) => void`.
*
* @experimental
*/
var APP_BOOTSTRAP_LISTENER = new InjectionToken('appBootstrapListener');
/**
* A token which indicates the root directory of the application
* @experimental
*/
var PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL');
/**
* @license
* Copyright Google Inc. 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 Console = /** @class */ (function () {
function Console() {
}
Console.prototype.log = function (message) {
// tslint:disable-next-line:no-console
console.log(message);
};
// Note: for reporting errors use `DOM.logError()` as it is platform specific
Console.prototype.warn = function (message) {
// tslint:disable-next-line:no-console
console.warn(message);
};
Console.decorators = [
{ type: Injectable }
];
return Console;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Combination of NgModuleFactory and ComponentFactorys.
*
* @experimental
*/
var ModuleWithComponentFactories = /** @class */ (function () {
function ModuleWithComponentFactories(ngModuleFactory, componentFactories) {
this.ngModuleFactory = ngModuleFactory;
this.componentFactories = componentFactories;
}
return ModuleWithComponentFactories;
}());
function _throwError() {
throw new Error("Runtime compiler is not loaded");
}
/**
* Low-level service for running the angular compiler during runtime
* to create {@link ComponentFactory}s, which
* can later be used to create and render a Component instance.
*
* Each `@NgModule` provides an own `Compiler` to its injector,
* that will use the directives/pipes of the ng module for compilation
* of components.
*
*/
var Compiler = /** @class */ (function () {
function Compiler() {
}
/**
* Compiles the given NgModule and all of its components. All templates of the components listed
* in `entryComponents` have to be inlined.
*/
Compiler.prototype.compileModuleSync = function (moduleType) { throw _throwError(); };
/**
* Compiles the given NgModule and all of its components
*/
Compiler.prototype.compileModuleAsync = function (moduleType) { throw _throwError(); };
/**
* Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
*/
Compiler.prototype.compileModuleAndAllComponentsSync = function (moduleType) {
throw _throwError();
};
/**
* Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
*/
Compiler.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {
throw _throwError();
};
/**
* Clears all caches.
*/
Compiler.prototype.clearCache = function () { };
/**
* Clears the cache for the given component/ngModule.
*/
Compiler.prototype.clearCacheFor = function (type) { };
Compiler.decorators = [
{ type: Injectable }
];
return Compiler;
}());
/**
* Token to provide CompilerOptions in the platform injector.
*
* @experimental
*/
var COMPILER_OPTIONS = new InjectionToken('compilerOptions');
/**
* A factory for creating a Compiler
*
* @experimental
*/
var CompilerFactory = /** @class */ (function () {
function CompilerFactory() {
}
return CompilerFactory;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Represents an instance of a Component created via a {@link ComponentFactory}.
*
* `ComponentRef` provides access to the Component Instance as well other objects related to this
* Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
* method.
*
*/
var ComponentRef = /** @class */ (function () {
function ComponentRef() {
}
return ComponentRef;
}());
var ComponentFactory = /** @class */ (function () {
function ComponentFactory() {
}
return ComponentFactory;
}());
/**
* @license
* Copyright Google Inc. 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
*/
function noComponentFactoryError(component) {
var error = Error("No component factory found for " + stringify(component) + ". Did you add it to @NgModule.entryComponents?");
error[ERROR_COMPONENT] = component;
return error;
}
var ERROR_COMPONENT = 'ngComponent';
var _NullComponentFactoryResolver = /** @class */ (function () {
function _NullComponentFactoryResolver() {
}
_NullComponentFactoryResolver.prototype.resolveComponentFactory = function (component) {
throw noComponentFactoryError(component);
};
return _NullComponentFactoryResolver;
}());
var ComponentFactoryResolver = /** @class */ (function () {
function ComponentFactoryResolver() {
}
ComponentFactoryResolver.NULL = new _NullComponentFactoryResolver();
return ComponentFactoryResolver;
}());
var CodegenComponentFactoryResolver = /** @class */ (function () {
function CodegenComponentFactoryResolver(factories, _parent, _ngModule) {
this._parent = _parent;
this._ngModule = _ngModule;
this._factories = new Map();
for (var i = 0; i < factories.length; i++) {
var factory = factories[i];
this._factories.set(factory.componentType, factory);
}
}
CodegenComponentFactoryResolver.prototype.resolveComponentFactory = function (component) {
var factory = this._factories.get(component);
if (!factory && this._parent) {
factory = this._parent.resolveComponentFactory(component);
}
if (!factory) {
throw noComponentFactoryError(component);
}
return new ComponentFactoryBoundToModule(factory, this._ngModule);
};
return CodegenComponentFactoryResolver;
}());
var ComponentFactoryBoundToModule = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ComponentFactoryBoundToModule, _super);
function ComponentFactoryBoundToModule(factory, ngModule) {
var _this = _super.call(this) || this;
_this.factory = factory;
_this.ngModule = ngModule;
_this.selector = factory.selector;
_this.componentType = factory.componentType;
_this.ngContentSelectors = factory.ngContentSelectors;
_this.inputs = factory.inputs;
_this.outputs = factory.outputs;
return _this;
}
ComponentFactoryBoundToModule.prototype.create = function (injector, projectableNodes, rootSelectorOrNode, ngModule) {
return this.factory.create(injector, projectableNodes, rootSelectorOrNode, ngModule || this.ngModule);
};
return ComponentFactoryBoundToModule;
}(ComponentFactory));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Represents an instance of an NgModule created via a {@link NgModuleFactory}.
*
* `NgModuleRef` provides access to the NgModule Instance as well other objects related to this
* NgModule Instance.
*
*
*/
var NgModuleRef = /** @class */ (function () {
function NgModuleRef() {
}
return NgModuleRef;
}());
/**
* @experimental
*/
var NgModuleFactory = /** @class */ (function () {
function NgModuleFactory() {
}
return NgModuleFactory;
}());
/**
* @license
* Copyright Google Inc. 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 trace;
var events;
function detectWTF() {
var wtf = _global /** TODO #9100 */['wtf'];
if (wtf) {
trace = wtf['trace'];
if (trace) {
events = trace['events'];
return true;
}
}
return false;
}
function createScope(signature, flags) {
if (flags === void 0) { flags = null; }
return events.createScope(signature, flags);
}
function leave(scope, returnValue) {
trace.leaveScope(scope, returnValue);
return returnValue;
}
function startTimeRange(rangeType, action) {
return trace.beginTimeRange(rangeType, action);
}
function endTimeRange(range) {
trace.endTimeRange(range);
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* True if WTF is enabled.
*/
var wtfEnabled = detectWTF();
function noopScope(arg0, arg1) {
return null;
}
/**
* Create trace scope.
*
* Scopes must be strictly nested and are analogous to stack frames, but
* do not have to follow the stack frames. Instead it is recommended that they follow logical
* nesting. You may want to use
* [Event
* Signatures](http://google.github.io/tracing-framework/instrumenting-code.html#custom-events)
* as they are defined in WTF.
*
* Used to mark scope entry. The return value is used to leave the scope.
*
* var myScope = wtfCreateScope('MyClass#myMethod(ascii someVal)');
*
* someMethod() {
* var s = myScope('Foo'); // 'Foo' gets stored in tracing UI
* // DO SOME WORK HERE
* return wtfLeave(s, 123); // Return value 123
* }
*
* Note, adding try-finally block around the work to ensure that `wtfLeave` gets called can
* negatively impact the performance of your application. For this reason we recommend that
* you don't add them to ensure that `wtfLeave` gets called. In production `wtfLeave` is a noop and
* so try-finally block has no value. When debugging perf issues, skipping `wtfLeave`, do to
* exception, will produce incorrect trace, but presence of exception signifies logic error which
* needs to be fixed before the app should be profiled. Add try-finally only when you expect that
* an exception is expected during normal execution while profiling.
*
* @experimental
*/
var wtfCreateScope = wtfEnabled ? createScope : function (signature, flags) { return noopScope; };
/**
* Used to mark end of Scope.
*
* - `scope` to end.
* - `returnValue` (optional) to be passed to the WTF.
*
* Returns the `returnValue for easy chaining.
* @experimental
*/
var wtfLeave = wtfEnabled ? leave : function (s, r) { return r; };
/**
* Used to mark Async start. Async are similar to scope but they don't have to be strictly nested.
* The return value is used in the call to [endAsync]. Async ranges only work if WTF has been
* enabled.
*
* someMethod() {
* var s = wtfStartTimeRange('HTTP:GET', 'some.url');
* var future = new Future.delay(5).then((_) {
* wtfEndTimeRange(s);
* });
* }
* @experimental
*/
var wtfStartTimeRange = wtfEnabled ? startTimeRange : function (rangeType, action) { return null; };
/**
* Ends a async time range operation.
* [range] is the return value from [wtfStartTimeRange] Async ranges only work if WTF has been
* enabled.
* @experimental
*/
var wtfEndTimeRange = wtfEnabled ? endTimeRange : function (r) { return null; };
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Use by directives and components to emit custom Events.
*
* @usageNotes
* ### Examples
*
* In the following example, `Zippy` alternatively emits `open` and `close` events when its
* title gets clicked:
*
* ```
* @Component({
* selector: 'zippy',
* template: `
* <div class="zippy">
* <div (click)="toggle()">Toggle</div>
* <div [hidden]="!visible">
* <ng-content></ng-content>
* </div>
* </div>`})
* export class Zippy {
* visible: boolean = true;
* @Output() open: EventEmitter<any> = new EventEmitter();
* @Output() close: EventEmitter<any> = new EventEmitter();
*
* toggle() {
* this.visible = !this.visible;
* if (this.visible) {
* this.open.emit(null);
* } else {
* this.close.emit(null);
* }
* }
* }
* ```
*
* The events payload can be accessed by the parameter `$event` on the components output event
* handler:
*
* ```
* <zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
* ```
*
* ### Notes
*
* Uses Rx.Observable but provides an adapter to make it work as specified here:
* https://github.com/jhusain/observable-spec
*
* Once a reference implementation of the spec is available, switch to it.
*
*/
var EventEmitter = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(EventEmitter, _super);
/**
* Creates an instance of {@link EventEmitter}, which depending on `isAsync`,
* delivers events synchronously or asynchronously.
*
* @param isAsync By default, events are delivered synchronously (default value: `false`).
* Set to `true` for asynchronous event delivery.
*/
function EventEmitter(isAsync) {
if (isAsync === void 0) { isAsync = false; }
var _this = _super.call(this) || this;
_this.__isAsync = isAsync;
return _this;
}
EventEmitter.prototype.emit = function (value) { _super.prototype.next.call(this, value); };
EventEmitter.prototype.subscribe = function (generatorOrNext, error, complete) {
var schedulerFn;
var errorFn = function (err) { return null; };
var completeFn = function () { return null; };
if (generatorOrNext && typeof generatorOrNext === 'object') {
schedulerFn = this.__isAsync ? function (value) {
setTimeout(function () { return generatorOrNext.next(value); });
} : function (value) { generatorOrNext.next(value); };
if (generatorOrNext.error) {
errorFn = this.__isAsync ? function (err) { setTimeout(function () { return generatorOrNext.error(err); }); } :
function (err) { generatorOrNext.error(err); };
}
if (generatorOrNext.complete) {
completeFn = this.__isAsync ? function () { setTimeout(function () { return generatorOrNext.complete(); }); } :
function () { generatorOrNext.complete(); };
}
}
else {
schedulerFn = this.__isAsync ? function (value) { setTimeout(function () { return generatorOrNext(value); }); } :
function (value) { generatorOrNext(value); };
if (error) {
errorFn =
this.__isAsync ? function (err) { setTimeout(function () { return error(err); }); } : function (err) { error(err); };
}
if (complete) {
completeFn =
this.__isAsync ? function () { setTimeout(function () { return complete(); }); } : function () { complete(); };
}
}
var sink = _super.prototype.subscribe.call(this, schedulerFn, errorFn, completeFn);
if (generatorOrNext instanceof rxjs__WEBPACK_IMPORTED_MODULE_1__["Subscription"]) {
generatorOrNext.add(sink);
}
return sink;
};
return EventEmitter;
}(rxjs__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* An injectable service for executing work inside or outside of the Angular zone.
*
* The most common use of this service is to optimize performance when starting a work consisting of
* one or more asynchronous tasks that don't require UI updates or error handling to be handled by
* Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks
* can reenter the Angular zone via {@link #run}.
*
* <!-- TODO: add/fix links to:
* - docs explaining zones and the use of zones in Angular and change-detection
* - link to runOutsideAngular/run (throughout this file!)
* -->
*
* @usageNotes
* ### Example
*
* ```
* import {Component, NgZone} from '@angular/core';
* import {NgIf} from '@angular/common';
*
* @Component({
* selector: 'ng-zone-demo',
* template: `
* <h2>Demo: NgZone</h2>
*
* <p>Progress: {{progress}}%</p>
* <p *ngIf="progress >= 100">Done processing {{label}} of Angular zone!</p>
*
* <button (click)="processWithinAngularZone()">Process within Angular zone</button>
* <button (click)="processOutsideOfAngularZone()">Process outside of Angular zone</button>
* `,
* })
* export class NgZoneDemo {
* progress: number = 0;
* label: string;
*
* constructor(private _ngZone: NgZone) {}
*
* // Loop inside the Angular zone
* // so the UI DOES refresh after each setTimeout cycle
* processWithinAngularZone() {
* this.label = 'inside';
* this.progress = 0;
* this._increaseProgress(() => console.log('Inside Done!'));
* }
*
* // Loop outside of the Angular zone
* // so the UI DOES NOT refresh after each setTimeout cycle
* processOutsideOfAngularZone() {
* this.label = 'outside';
* this.progress = 0;
* this._ngZone.runOutsideAngular(() => {
* this._increaseProgress(() => {
* // reenter the Angular zone and display done
* this._ngZone.run(() => { console.log('Outside Done!'); });
* });
* });
* }
*
* _increaseProgress(doneCallback: () => void) {
* this.progress += 1;
* console.log(`Current progress: ${this.progress}%`);
*
* if (this.progress < 100) {
* window.setTimeout(() => this._increaseProgress(doneCallback), 10);
* } else {
* doneCallback();
* }
* }
* }
* ```
*
* @experimental
*/
var NgZone = /** @class */ (function () {
function NgZone(_a) {
var _b = _a.enableLongStackTrace, enableLongStackTrace = _b === void 0 ? false : _b;
this.hasPendingMicrotasks = false;
this.hasPendingMacrotasks = false;
/**
* Whether there are no outstanding microtasks or macrotasks.
*/
this.isStable = true;
/**
* Notifies when code enters Angular Zone. This gets fired first on VM Turn.
*/
this.onUnstable = new EventEmitter(false);
/**
* Notifies when there is no more microtasks enqueued in the current VM Turn.
* This is a hint for Angular to do change detection, which may enqueue more microtasks.
* For this reason this event can fire multiple times per VM Turn.
*/
this.onMicrotaskEmpty = new EventEmitter(false);
/**
* Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which
* implies we are about to relinquish VM turn.
* This event gets called just once.
*/
this.onStable = new EventEmitter(false);
/**
* Notifies that an error has been delivered.
*/
this.onError = new EventEmitter(false);
if (typeof Zone == 'undefined') {
throw new Error("In this configuration Angular requires Zone.js");
}
Zone.assertZonePatched();
var self = this;
self._nesting = 0;
self._outer = self._inner = Zone.current;
if (Zone['wtfZoneSpec']) {
self._inner = self._inner.fork(Zone['wtfZoneSpec']);
}
if (Zone['TaskTrackingZoneSpec']) {
self._inner = self._inner.fork(new Zone['TaskTrackingZoneSpec']);
}
if (enableLongStackTrace && Zone['longStackTraceZoneSpec']) {
self._inner = self._inner.fork(Zone['longStackTraceZoneSpec']);
}
forkInnerZoneWithAngularBehavior(self);
}
NgZone.isInAngularZone = function () { return Zone.current.get('isAngularZone') === true; };
NgZone.assertInAngularZone = function () {
if (!NgZone.isInAngularZone()) {
throw new Error('Expected to be in Angular Zone, but it is not!');
}
};
NgZone.assertNotInAngularZone = function () {
if (NgZone.isInAngularZone()) {
throw new Error('Expected to not be in Angular Zone, but it is!');
}
};
/**
* Executes the `fn` function synchronously within the Angular zone and returns value returned by
* the function.
*
* Running functions via `run` allows you to reenter Angular zone from a task that was executed
* outside of the Angular zone (typically started via {@link #runOutsideAngular}).
*
* Any future tasks or microtasks scheduled from within this function will continue executing from
* within the Angular zone.
*
* If a synchronous error happens it will be rethrown and not reported via `onError`.
*/
NgZone.prototype.run = function (fn, applyThis, applyArgs) {
return this._inner.run(fn, applyThis, applyArgs);
};
/**
* Executes the `fn` function synchronously within the Angular zone as a task and returns value
* returned by the function.
*
* Running functions via `run` allows you to reenter Angular zone from a task that was executed
* outside of the Angular zone (typically started via {@link #runOutsideAngular}).
*
* Any future tasks or microtasks scheduled from within this function will continue executing from
* within the Angular zone.
*
* If a synchronous error happens it will be rethrown and not reported via `onError`.
*/
NgZone.prototype.runTask = function (fn, applyThis, applyArgs, name) {
var zone = this._inner;
var task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);
try {
return zone.runTask(task, applyThis, applyArgs);
}
finally {
zone.cancelTask(task);
}
};
/**
* Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not
* rethrown.
*/
NgZone.prototype.runGuarded = function (fn, applyThis, applyArgs) {
return this._inner.runGuarded(fn, applyThis, applyArgs);
};
/**
* Executes the `fn` function synchronously in Angular's parent zone and returns value returned by
* the function.
*
* Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do
* work that
* doesn't trigger Angular change-detection or is subject to Angular's error handling.
*
* Any future tasks or microtasks scheduled from within this function will continue executing from
* outside of the Angular zone.
*
* Use {@link #run} to reenter the Angular zone and do work that updates the application model.
*/
NgZone.prototype.runOutsideAngular = function (fn) {
return this._outer.run(fn);
};
return NgZone;
}());
function noop() { }
var EMPTY_PAYLOAD = {};
function checkStable(zone) {
if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {
try {
zone._nesting++;
zone.onMicrotaskEmpty.emit(null);
}
finally {
zone._nesting--;
if (!zone.hasPendingMicrotasks) {
try {
zone.runOutsideAngular(function () { return zone.onStable.emit(null); });
}
finally {
zone.isStable = true;
}
}
}
}
}
function forkInnerZoneWithAngularBehavior(zone) {
zone._inner = zone._inner.fork({
name: 'angular',
properties: { 'isAngularZone': true },
onInvokeTask: function (delegate, current, target, task, applyThis, applyArgs) {
try {
onEnter(zone);
return delegate.invokeTask(target, task, applyThis, applyArgs);
}
finally {
onLeave(zone);
}
},
onInvoke: function (delegate, current, target, callback, applyThis, applyArgs, source) {
try {
onEnter(zone);
return delegate.invoke(target, callback, applyThis, applyArgs, source);
}
finally {
onLeave(zone);
}
},
onHasTask: function (delegate, current, target, hasTaskState) {
delegate.hasTask(target, hasTaskState);
if (current === target) {
// We are only interested in hasTask events which originate from our zone
// (A child hasTask event is not interesting to us)
if (hasTaskState.change == 'microTask') {
zone.hasPendingMicrotasks = hasTaskState.microTask;
checkStable(zone);
}
else if (hasTaskState.change == 'macroTask') {
zone.hasPendingMacrotasks = hasTaskState.macroTask;
}
}
},
onHandleError: function (delegate, current, target, error) {
delegate.handleError(target, error);
zone.runOutsideAngular(function () { return zone.onError.emit(error); });
return false;
}
});
}
function onEnter(zone) {
zone._nesting++;
if (zone.isStable) {
zone.isStable = false;
zone.onUnstable.emit(null);
}
}
function onLeave(zone) {
zone._nesting--;
checkStable(zone);
}
/**
* Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls
* to framework to perform rendering.
*/
var NoopNgZone = /** @class */ (function () {
function NoopNgZone() {
this.hasPendingMicrotasks = false;
this.hasPendingMacrotasks = false;
this.isStable = true;
this.onUnstable = new EventEmitter();
this.onMicrotaskEmpty = new EventEmitter();
this.onStable = new EventEmitter();
this.onError = new EventEmitter();
}
NoopNgZone.prototype.run = function (fn) { return fn(); };
NoopNgZone.prototype.runGuarded = function (fn) { return fn(); };
NoopNgZone.prototype.runOutsideAngular = function (fn) { return fn(); };
NoopNgZone.prototype.runTask = function (fn) { return fn(); };
return NoopNgZone;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* The Testability service provides testing hooks that can be accessed from
* the browser and by services such as Protractor. Each bootstrapped Angular
* application on the page will have an instance of Testability.
* @experimental
*/
var Testability = /** @class */ (function () {
function Testability(_ngZone) {
var _this = this;
this._ngZone = _ngZone;
this._pendingCount = 0;
this._isZoneStable = true;
/**
* Whether any work was done since the last 'whenStable' callback. This is
* useful to detect if this could have potentially destabilized another
* component while it is stabilizing.
* @internal
*/
this._didWork = false;
this._callbacks = [];
this._watchAngularEvents();
_ngZone.run(function () { _this.taskTrackingZone = Zone.current.get('TaskTrackingZone'); });
}
Testability.prototype._watchAngularEvents = function () {
var _this = this;
this._ngZone.onUnstable.subscribe({
next: function () {
_this._didWork = true;
_this._isZoneStable = false;
}
});
this._ngZone.runOutsideAngular(function () {
_this._ngZone.onStable.subscribe({
next: function () {
NgZone.assertNotInAngularZone();
scheduleMicroTask(function () {
_this._isZoneStable = true;
_this._runCallbacksIfReady();
});
}
});
});
};
/**
* Increases the number of pending request
* @deprecated pending requests are now tracked with zones.
*/
Testability.prototype.increasePendingRequestCount = function () {
this._pendingCount += 1;
this._didWork = true;
return this._pendingCount;
};
/**
* Decreases the number of pending request
* @deprecated pending requests are now tracked with zones
*/
Testability.prototype.decreasePendingRequestCount = function () {
this._pendingCount -= 1;
if (this._pendingCount < 0) {
throw new Error('pending async requests below zero');
}
this._runCallbacksIfReady();
return this._pendingCount;
};
/**
* Whether an associated application is stable
*/
Testability.prototype.isStable = function () {
return this._isZoneStable && this._pendingCount === 0 && !this._ngZone.hasPendingMacrotasks;
};
Testability.prototype._runCallbacksIfReady = function () {
var _this = this;
if (this.isStable()) {
// Schedules the call backs in a new frame so that it is always async.
scheduleMicroTask(function () {
while (_this._callbacks.length !== 0) {
var cb = _this._callbacks.pop();
clearTimeout(cb.timeoutId);
cb.doneCb(_this._didWork);
}
_this._didWork = false;
});
}
else {
// Still not stable, send updates.
var pending_1 = this.getPendingTasks();
this._callbacks = this._callbacks.filter(function (cb) {
if (cb.updateCb && cb.updateCb(pending_1)) {
clearTimeout(cb.timeoutId);
return false;
}
return true;
});
this._didWork = true;
}
};
Testability.prototype.getPendingTasks = function () {
if (!this.taskTrackingZone) {
return [];
}
return this.taskTrackingZone.macroTasks.map(function (t) {
return {
source: t.source,
isPeriodic: t.data.isPeriodic,
delay: t.data.delay,
// From TaskTrackingZone:
// https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40
creationLocation: t.creationLocation,
// Added by Zones for XHRs
// https://github.com/angular/zone.js/blob/master/lib/browser/browser.ts#L133
xhr: t.data.target
};
});
};
Testability.prototype.addCallback = function (cb, timeout, updateCb) {
var _this = this;
var timeoutId = -1;
if (timeout && timeout > 0) {
timeoutId = setTimeout(function () {
_this._callbacks = _this._callbacks.filter(function (cb) { return cb.timeoutId !== timeoutId; });
cb(_this._didWork, _this.getPendingTasks());
}, timeout);
}
this._callbacks.push({ doneCb: cb, timeoutId: timeoutId, updateCb: updateCb });
};
/**
* Wait for the application to be stable with a timeout. If the timeout is reached before that
* happens, the callback receives a list of the macro tasks that were pending, otherwise null.
*
* @param doneCb The callback to invoke when Angular is stable or the timeout expires
* whichever comes first.
* @param timeout Optional. The maximum time to wait for Angular to become stable. If not
* specified, whenStable() will wait forever.
* @param updateCb Optional. If specified, this callback will be invoked whenever the set of
* pending macrotasks changes. If this callback returns true doneCb will not be invoked
* and no further updates will be issued.
*/
Testability.prototype.whenStable = function (doneCb, timeout, updateCb) {
if (updateCb && !this.taskTrackingZone) {
throw new Error('Task tracking zone is required when passing an update callback to ' +
'whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');
}
// These arguments are 'Function' above to keep the public API simple.
this.addCallback(doneCb, timeout, updateCb);
this._runCallbacksIfReady();
};
/**
* Get the number of pending requests
* @deprecated pending requests are now tracked with zones
*/
Testability.prototype.getPendingRequestCount = function () { return this._pendingCount; };
/**
* Find providers by name
* @param using The root element to search from
* @param provider The name of binding variable
* @param exactMatch Whether using exactMatch
*/
Testability.prototype.findProviders = function (using, provider, exactMatch) {
// TODO(juliemr): implement.
return [];
};
Testability.decorators = [
{ type: Injectable }
];
/** @nocollapse */
Testability.ctorParameters = function () { return [
{ type: NgZone }
]; };
return Testability;
}());
/**
* A global registry of {@link Testability} instances for specific elements.
* @experimental
*/
var TestabilityRegistry = /** @class */ (function () {
function TestabilityRegistry() {
/** @internal */
this._applications = new Map();
_testabilityGetter.addToWindow(this);
}
/**
* Registers an application with a testability hook so that it can be tracked
* @param token token of application, root element
* @param testability Testability hook
*/
TestabilityRegistry.prototype.registerApplication = function (token, testability) {
this._applications.set(token, testability);
};
/**
* Unregisters an application.
* @param token token of application, root element
*/
TestabilityRegistry.prototype.unregisterApplication = function (token) { this._applications.delete(token); };
/**
* Unregisters all applications
*/
TestabilityRegistry.prototype.unregisterAllApplications = function () { this._applications.clear(); };
/**
* Get a testability hook associated with the application
* @param elem root element
*/
TestabilityRegistry.prototype.getTestability = function (elem) { return this._applications.get(elem) || null; };
/**
* Get all registered testabilities
*/
TestabilityRegistry.prototype.getAllTestabilities = function () { return Array.from(this._applications.values()); };
/**
* Get all registered applications(root elements)
*/
TestabilityRegistry.prototype.getAllRootElements = function () { return Array.from(this._applications.keys()); };
/**
* Find testability of a node in the Tree
* @param elem node
* @param findInAncestors whether finding testability in ancestors if testability was not found in
* current node
*/
TestabilityRegistry.prototype.findTestabilityInTree = function (elem, findInAncestors) {
if (findInAncestors === void 0) { findInAncestors = true; }
return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors);
};
TestabilityRegistry.decorators = [
{ type: Injectable }
];
/** @nocollapse */
TestabilityRegistry.ctorParameters = function () { return []; };
return TestabilityRegistry;
}());
var _NoopGetTestability = /** @class */ (function () {
function _NoopGetTestability() {
}
_NoopGetTestability.prototype.addToWindow = function (registry) { };
_NoopGetTestability.prototype.findTestabilityInTree = function (registry, elem, findInAncestors) {
return null;
};
return _NoopGetTestability;
}());
/**
* Set the {@link GetTestability} implementation used by the Angular testing framework.
* @experimental
*/
function setTestabilityGetter(getter) {
_testabilityGetter = getter;
}
var _testabilityGetter = new _NoopGetTestability();
/**
* @license
* Copyright Google Inc. 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 _devMode = true;
var _runModeLocked = false;
var _platform;
var ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
/**
* Disable Angular's development mode, which turns off assertions and other
* checks within the framework.
*
* One important assertion this disables verifies that a change detection pass
* does not result in additional changes to any bindings (also known as
* unidirectional data flow).
*
*
*/
function enableProdMode() {
if (_runModeLocked) {
throw new Error('Cannot enable prod mode after platform setup.');
}
_devMode = false;
}
/**
* Returns whether Angular is in development mode. After called once,
* the value is locked and won't change any more.
*
* By default, this is true, unless a user calls `enableProdMode` before calling this.
*
* @experimental APIs related to application bootstrap are currently under review.
*/
function isDevMode() {
_runModeLocked = true;
return _devMode;
}
/**
* A token for third-party components that can register themselves with NgProbe.
*
* @experimental
*/
var NgProbeToken = /** @class */ (function () {
function NgProbeToken(name, token) {
this.name = name;
this.token = token;
}
return NgProbeToken;
}());
/**
* Creates a platform.
* Platforms have to be eagerly created via this function.
*
* @experimental APIs related to application bootstrap are currently under review.
*/
function createPlatform(injector) {
if (_platform && !_platform.destroyed &&
!_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
throw new Error('There can be only one platform. Destroy the previous one to create a new one.');
}
_platform = injector.get(PlatformRef);
var inits = injector.get(PLATFORM_INITIALIZER, null);
if (inits)
inits.forEach(function (init) { return init(); });
return _platform;
}
/**
* Creates a factory for a platform
*
* @experimental APIs related to application bootstrap are currently under review.
*/
function createPlatformFactory(parentPlatformFactory, name, providers) {
if (providers === void 0) { providers = []; }
var desc = "Platform: " + name;
var marker = new InjectionToken(desc);
return function (extraProviders) {
if (extraProviders === void 0) { extraProviders = []; }
var platform = getPlatform();
if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
if (parentPlatformFactory) {
parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));
}
else {
var injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true });
createPlatform(Injector.create({ providers: injectedProviders, name: desc }));
}
}
return assertPlatform(marker);
};
}
/**
* Checks that there currently is a platform which contains the given token as a provider.
*
* @experimental APIs related to application bootstrap are currently under review.
*/
function assertPlatform(requiredToken) {
var platform = getPlatform();
if (!platform) {
throw new Error('No platform exists!');
}
if (!platform.injector.get(requiredToken, null)) {
throw new Error('A platform with a different configuration has been created. Please destroy it first.');
}
return platform;
}
/**
* Destroy the existing platform.
*
* @experimental APIs related to application bootstrap are currently under review.
*/
function destroyPlatform() {
if (_platform && !_platform.destroyed) {
_platform.destroy();
}
}
/**
* Returns the current platform.
*
* @experimental APIs related to application bootstrap are currently under review.
*/
function getPlatform() {
return _platform && !_platform.destroyed ? _platform : null;
}
/**
* The Angular platform is the entry point for Angular on a web page. Each page
* has exactly one platform, and services (such as reflection) which are common
* to every Angular application running on the page are bound in its scope.
*
* A page's platform is initialized implicitly when a platform is created via a platform factory
* (e.g. {@link platformBrowser}), or explicitly by calling the {@link createPlatform} function.
*/
var PlatformRef = /** @class */ (function () {
/** @internal */
function PlatformRef(_injector) {
this._injector = _injector;
this._modules = [];
this._destroyListeners = [];
this._destroyed = false;
}
/**
* Creates an instance of an `@NgModule` for the given platform
* for offline compilation.
*
* @usageNotes
* ### Simple Example
*
* ```typescript
* my_module.ts:
*
* @NgModule({
* imports: [BrowserModule]
* })
* class MyModule {}
*
* main.ts:
* import {MyModuleNgFactory} from './my_module.ngfactory';
* import {platformBrowser} from '@angular/platform-browser';
*
* let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);
* ```
*
* @experimental APIs related to application bootstrap are currently under review.
*/
PlatformRef.prototype.bootstrapModuleFactory = function (moduleFactory, options) {
var _this = this;
// Note: We need to create the NgZone _before_ we instantiate the module,
// as instantiating the module creates some providers eagerly.
// So we create a mini parent injector that just contains the new NgZone and
// pass that as parent to the NgModuleFactory.
var ngZoneOption = options ? options.ngZone : undefined;
var ngZone = getNgZone(ngZoneOption);
var providers = [{ provide: NgZone, useValue: ngZone }];
// Attention: Don't use ApplicationRef.run here,
// as we want to be sure that all possible constructor calls are inside `ngZone.run`!
return ngZone.run(function () {
var ngZoneInjector = Injector.create({ providers: providers, parent: _this.injector, name: moduleFactory.moduleType.name });
var moduleRef = moduleFactory.create(ngZoneInjector);
var exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
if (!exceptionHandler) {
throw new Error('No ErrorHandler. Is platform module (BrowserModule) included?');
}
moduleRef.onDestroy(function () { return remove(_this._modules, moduleRef); });
ngZone.runOutsideAngular(function () { return ngZone.onError.subscribe({ next: function (error) { exceptionHandler.handleError(error); } }); });
return _callAndReportToErrorHandler(exceptionHandler, ngZone, function () {
var initStatus = moduleRef.injector.get(ApplicationInitStatus);
initStatus.runInitializers();
return initStatus.donePromise.then(function () {
_this._moduleDoBootstrap(moduleRef);
return moduleRef;
});
});
});
};
/**
* Creates an instance of an `@NgModule` for a given platform using the given runtime compiler.
*
* @usageNotes
* ### Simple Example
*
* ```typescript
* @NgModule({
* imports: [BrowserModule]
* })
* class MyModule {}
*
* let moduleRef = platformBrowser().bootstrapModule(MyModule);
* ```
*
*/
PlatformRef.prototype.bootstrapModule = function (moduleType, compilerOptions) {
var _this = this;
if (compilerOptions === void 0) { compilerOptions = []; }
var compilerFactory = this.injector.get(CompilerFactory);
var options = optionsReducer({}, compilerOptions);
var compiler = compilerFactory.createCompiler([options]);
return compiler.compileModuleAsync(moduleType)
.then(function (moduleFactory) { return _this.bootstrapModuleFactory(moduleFactory, options); });
};
PlatformRef.prototype._moduleDoBootstrap = function (moduleRef) {
var appRef = moduleRef.injector.get(ApplicationRef);
if (moduleRef._bootstrapComponents.length > 0) {
moduleRef._bootstrapComponents.forEach(function (f) { return appRef.bootstrap(f); });
}
else if (moduleRef.instance.ngDoBootstrap) {
moduleRef.instance.ngDoBootstrap(appRef);
}
else {
throw new Error("The module " + stringify(moduleRef.instance.constructor) + " was bootstrapped, but it does not declare \"@NgModule.bootstrap\" components nor a \"ngDoBootstrap\" method. " +
"Please define one of these.");
}
this._modules.push(moduleRef);
};
/**
* Register a listener to be called when the platform is disposed.
*/
PlatformRef.prototype.onDestroy = function (callback) { this._destroyListeners.push(callback); };
Object.defineProperty(PlatformRef.prototype, "injector", {
/**
* Retrieve the platform {@link Injector}, which is the parent injector for
* every Angular application on the page and provides singleton providers.
*/
get: function () { return this._injector; },
enumerable: true,
configurable: true
});
/**
* Destroy the Angular platform and all Angular applications on the page.
*/
PlatformRef.prototype.destroy = function () {
if (this._destroyed) {
throw new Error('The platform has already been destroyed!');
}
this._modules.slice().forEach(function (module) { return module.destroy(); });
this._destroyListeners.forEach(function (listener) { return listener(); });
this._destroyed = true;
};
Object.defineProperty(PlatformRef.prototype, "destroyed", {
get: function () { return this._destroyed; },
enumerable: true,
configurable: true
});
PlatformRef.decorators = [
{ type: Injectable }
];
/** @nocollapse */
PlatformRef.ctorParameters = function () { return [
{ type: Injector }
]; };
return PlatformRef;
}());
function getNgZone(ngZoneOption) {
var ngZone;
if (ngZoneOption === 'noop') {
ngZone = new NoopNgZone();
}
else {
ngZone = (ngZoneOption === 'zone.js' ? undefined : ngZoneOption) ||
new NgZone({ enableLongStackTrace: isDevMode() });
}
return ngZone;
}
function _callAndReportToErrorHandler(errorHandler, ngZone, callback) {
try {
var result = callback();
if (isPromise(result)) {
return result.catch(function (e) {
ngZone.runOutsideAngular(function () { return errorHandler.handleError(e); });
// rethrow as the exception handler might not do it
throw e;
});
}
return result;
}
catch (e) {
ngZone.runOutsideAngular(function () { return errorHandler.handleError(e); });
// rethrow as the exception handler might not do it
throw e;
}
}
function optionsReducer(dst, objs) {
if (Array.isArray(objs)) {
dst = objs.reduce(optionsReducer, dst);
}
else {
dst = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, dst, objs);
}
return dst;
}
/**
* A reference to an Angular application running on a page.
*/
var ApplicationRef = /** @class */ (function () {
/** @internal */
function ApplicationRef(_zone, _console, _injector, _exceptionHandler, _componentFactoryResolver, _initStatus) {
var _this = this;
this._zone = _zone;
this._console = _console;
this._injector = _injector;
this._exceptionHandler = _exceptionHandler;
this._componentFactoryResolver = _componentFactoryResolver;
this._initStatus = _initStatus;
this._bootstrapListeners = [];
this._views = [];
this._runningTick = false;
this._enforceNoNewChanges = false;
this._stable = true;
/**
* Get a list of component types registered to this application.
* This list is populated even before the component is created.
*/
this.componentTypes = [];
/**
* Get a list of components registered to this application.
*/
this.components = [];
this._enforceNoNewChanges = isDevMode();
this._zone.onMicrotaskEmpty.subscribe({ next: function () { _this._zone.run(function () { _this.tick(); }); } });
var isCurrentlyStable = new rxjs__WEBPACK_IMPORTED_MODULE_1__["Observable"](function (observer) {
_this._stable = _this._zone.isStable && !_this._zone.hasPendingMacrotasks &&
!_this._zone.hasPendingMicrotasks;
_this._zone.runOutsideAngular(function () {
observer.next(_this._stable);
observer.complete();
});
});
var isStable = new rxjs__WEBPACK_IMPORTED_MODULE_1__["Observable"](function (observer) {
// Create the subscription to onStable outside the Angular Zone so that
// the callback is run outside the Angular Zone.
var stableSub;
_this._zone.runOutsideAngular(function () {
stableSub = _this._zone.onStable.subscribe(function () {
NgZone.assertNotInAngularZone();
// Check whether there are no pending macro/micro tasks in the next tick
// to allow for NgZone to update the state.
scheduleMicroTask(function () {
if (!_this._stable && !_this._zone.hasPendingMacrotasks &&
!_this._zone.hasPendingMicrotasks) {
_this._stable = true;
observer.next(true);
}
});
});
});
var unstableSub = _this._zone.onUnstable.subscribe(function () {
NgZone.assertInAngularZone();
if (_this._stable) {
_this._stable = false;
_this._zone.runOutsideAngular(function () { observer.next(false); });
}
});
return function () {
stableSub.unsubscribe();
unstableSub.unsubscribe();
};
});
this.isStable =
Object(rxjs__WEBPACK_IMPORTED_MODULE_1__["merge"])(isCurrentlyStable, isStable.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["share"])()));
}
/**
* Bootstrap a new component at the root level of the application.
*
* @usageNotes
* ### Bootstrap process
*
* When bootstrapping a new root component into an application, Angular mounts the
* specified application component onto DOM elements identified by the componentType's
* selector and kicks off automatic change detection to finish initializing the component.
*
* Optionally, a component can be mounted onto a DOM element that does not match the
* componentType's selector.
*
* ### Example
* {@example core/ts/platform/platform.ts region='longform'}
*/
ApplicationRef.prototype.bootstrap = function (componentOrFactory, rootSelectorOrNode) {
var _this = this;
if (!this._initStatus.done) {
throw new Error('Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.');
}
var componentFactory;
if (componentOrFactory instanceof ComponentFactory) {
componentFactory = componentOrFactory;
}
else {
componentFactory =
this._componentFactoryResolver.resolveComponentFactory(componentOrFactory);
}
this.componentTypes.push(componentFactory.componentType);
// Create a factory associated with the current module if it's not bound to some other
var ngModule = componentFactory instanceof ComponentFactoryBoundToModule ?
null :
this._injector.get(NgModuleRef);
var selectorOrNode = rootSelectorOrNode || componentFactory.selector;
var compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule);
compRef.onDestroy(function () { _this._unloadComponent(compRef); });
var testability = compRef.injector.get(Testability, null);
if (testability) {
compRef.injector.get(TestabilityRegistry)
.registerApplication(compRef.location.nativeElement, testability);
}
this._loadComponent(compRef);
if (isDevMode()) {
this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode.");
}
return compRef;
};
/**
* Invoke this method to explicitly process change detection and its side-effects.
*
* In development mode, `tick()` also performs a second change detection cycle to ensure that no
* further changes are detected. If additional changes are picked up during this second cycle,
* bindings in the app have side-effects that cannot be resolved in a single change detection
* pass.
* In this case, Angular throws an error, since an Angular application can only have one change
* detection pass during which all change detection must complete.
*/
ApplicationRef.prototype.tick = function () {
var _this = this;
if (this._runningTick) {
throw new Error('ApplicationRef.tick is called recursively');
}
var scope = ApplicationRef._tickScope();
try {
this._runningTick = true;
this._views.forEach(function (view) { return view.detectChanges(); });
if (this._enforceNoNewChanges) {
this._views.forEach(function (view) { return view.checkNoChanges(); });
}
}
catch (e) {
// Attention: Don't rethrow as it could cancel subscriptions to Observables!
this._zone.runOutsideAngular(function () { return _this._exceptionHandler.handleError(e); });
}
finally {
this._runningTick = false;
wtfLeave(scope);
}
};
/**
* Attaches a view so that it will be dirty checked.
* The view will be automatically detached when it is destroyed.
* This will throw if the view is already attached to a ViewContainer.
*/
ApplicationRef.prototype.attachView = function (viewRef) {
var view = viewRef;
this._views.push(view);
view.attachToAppRef(this);
};
/**
* Detaches a view from dirty checking again.
*/
ApplicationRef.prototype.detachView = function (viewRef) {
var view = viewRef;
remove(this._views, view);
view.detachFromAppRef();
};
ApplicationRef.prototype._loadComponent = function (componentRef) {
this.attachView(componentRef.hostView);
this.tick();
this.components.push(componentRef);
// Get the listeners lazily to prevent DI cycles.
var listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []).concat(this._bootstrapListeners);
listeners.forEach(function (listener) { return listener(componentRef); });
};
ApplicationRef.prototype._unloadComponent = function (componentRef) {
this.detachView(componentRef.hostView);
remove(this.components, componentRef);
};
/** @internal */
ApplicationRef.prototype.ngOnDestroy = function () {
// TODO(alxhub): Dispose of the NgZone.
this._views.slice().forEach(function (view) { return view.destroy(); });
};
Object.defineProperty(ApplicationRef.prototype, "viewCount", {
/**
* Returns the number of attached views.
*/
get: function () { return this._views.length; },
enumerable: true,
configurable: true
});
/** @internal */
ApplicationRef._tickScope = wtfCreateScope('ApplicationRef#tick()');
ApplicationRef.decorators = [
{ type: Injectable }
];
/** @nocollapse */
ApplicationRef.ctorParameters = function () { return [
{ type: NgZone },
{ type: Console },
{ type: Injector },
{ type: ErrorHandler },
{ type: ComponentFactoryResolver },
{ type: ApplicationInitStatus }
]; };
return ApplicationRef;
}());
function remove(list, el) {
var index = list.indexOf(el);
if (index > -1) {
list.splice(index, 1);
}
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @deprecated Use `RendererType2` (and `Renderer2`) instead.
*/
var RenderComponentType = /** @class */ (function () {
function RenderComponentType(id, templateUrl, slotCount, encapsulation, styles, animations) {
this.id = id;
this.templateUrl = templateUrl;
this.slotCount = slotCount;
this.encapsulation = encapsulation;
this.styles = styles;
this.animations = animations;
}
return RenderComponentType;
}());
/**
* @deprecated Debug info is handeled internally in the view engine now.
*/
var RenderDebugInfo = /** @class */ (function () {
function RenderDebugInfo() {
}
return RenderDebugInfo;
}());
/**
* @deprecated Use the `Renderer2` instead.
*/
var Renderer = /** @class */ (function () {
function Renderer() {
}
return Renderer;
}());
var Renderer2Interceptor = new InjectionToken('Renderer2Interceptor');
/**
* Injectable service that provides a low-level interface for modifying the UI.
*
* Use this service to bypass Angular's templating and make custom UI changes that can't be
* expressed declaratively. For example if you need to set a property or an attribute whose name is
* not statically known, use {@link Renderer#setElementProperty setElementProperty} or
* {@link Renderer#setElementAttribute setElementAttribute} respectively.
*
* If you are implementing a custom renderer, you must implement this interface.
*
* The default Renderer implementation is `DomRenderer`. Also available is `WebWorkerRenderer`.
*
* @deprecated Use `RendererFactory2` instead.
*/
var RootRenderer = /** @class */ (function () {
function RootRenderer() {
}
return RootRenderer;
}());
/**
* @experimental
*/
var RendererFactory2 = /** @class */ (function () {
function RendererFactory2() {
}
return RendererFactory2;
}());
/**
* @experimental
*/
var RendererStyleFlags2;
(function (RendererStyleFlags2) {
RendererStyleFlags2[RendererStyleFlags2["Important"] = 1] = "Important";
RendererStyleFlags2[RendererStyleFlags2["DashCase"] = 2] = "DashCase";
})(RendererStyleFlags2 || (RendererStyleFlags2 = {}));
/**
* @experimental
*/
var Renderer2 = /** @class */ (function () {
function Renderer2() {
}
return Renderer2;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A wrapper around a native element inside of a View.
*
* An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM
* element.
*
* @security Permitting direct access to the DOM can make your application more vulnerable to
* XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the
* [Security Guide](http://g.co/ng/security).
*
*
*/
// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,
// i.e. users have to ask for what they need. With that, we can build better analysis tools
// and could do better codegen in the future.
var ElementRef = /** @class */ (function () {
function ElementRef(nativeElement) {
this.nativeElement = nativeElement;
}
return ElementRef;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Used to load ng module factories.
*
*/
var NgModuleFactoryLoader = /** @class */ (function () {
function NgModuleFactoryLoader() {
}
return NgModuleFactoryLoader;
}());
var moduleFactories = new Map();
/**
* Registers a loaded module. Should only be called from generated NgModuleFactory code.
* @experimental
*/
function registerModuleFactory(id, factory) {
var existing = moduleFactories.get(id);
if (existing) {
throw new Error("Duplicate module registered for " + id + " - " + existing.moduleType.name + " vs " + factory.moduleType.name);
}
moduleFactories.set(id, factory);
}
/**
* Returns the NgModuleFactory with the given id, if it exists and has been loaded.
* Factories for modules that do not specify an `id` cannot be retrieved. Throws if the module
* cannot be found.
* @experimental
*/
function getModuleFactory(id) {
var factory = moduleFactories.get(id);
if (!factory)
throw new Error("No module with ID " + id + " loaded");
return factory;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* An unmodifiable list of items that Angular keeps up to date when the state
* of the application changes.
*
* The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}
* provide.
*
* Implements an iterable interface, therefore it can be used in both ES6
* javascript `for (var i of items)` loops as well as in Angular templates with
* `*ngFor="let i of myList"`.
*
* Changes can be observed by subscribing to the changes `Observable`.
*
* NOTE: In the future this class will implement an `Observable` interface.
*
* @usageNotes
* ### Example
* ```typescript
* @Component({...})
* class Container {
* @ViewChildren(Item) items:QueryList<Item>;
* }
* ```
*/
var QueryList = /** @class */ (function () {
function QueryList() {
this.dirty = true;
this._results = [];
this.changes = new EventEmitter();
this.length = 0;
}
/**
* See
* [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
*/
QueryList.prototype.map = function (fn) { return this._results.map(fn); };
/**
* See
* [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
*/
QueryList.prototype.filter = function (fn) {
return this._results.filter(fn);
};
/**
* See
* [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
*/
QueryList.prototype.find = function (fn) {
return this._results.find(fn);
};
/**
* See
* [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
*/
QueryList.prototype.reduce = function (fn, init) {
return this._results.reduce(fn, init);
};
/**
* See
* [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
*/
QueryList.prototype.forEach = function (fn) { this._results.forEach(fn); };
/**
* See
* [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
*/
QueryList.prototype.some = function (fn) {
return this._results.some(fn);
};
QueryList.prototype.toArray = function () { return this._results.slice(); };
QueryList.prototype[getSymbolIterator()] = function () { return this._results[getSymbolIterator()](); };
QueryList.prototype.toString = function () { return this._results.toString(); };
QueryList.prototype.reset = function (res) {
this._results = flatten(res);
this.dirty = false;
this.length = this._results.length;
this.last = this._results[this.length - 1];
this.first = this._results[0];
};
QueryList.prototype.notifyOnChanges = function () { this.changes.emit(this); };
/** internal */
QueryList.prototype.setDirty = function () { this.dirty = true; };
/** internal */
QueryList.prototype.destroy = function () {
this.changes.complete();
this.changes.unsubscribe();
};
return QueryList;
}());
function flatten(list) {
return list.reduce(function (flat, item) {
var flatItem = Array.isArray(item) ? flatten(item) : item;
return flat.concat(flatItem);
}, []);
}
/**
* @license
* Copyright Google Inc. 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 _SEPARATOR = '#';
var FACTORY_CLASS_SUFFIX = 'NgFactory';
/**
* Configuration for SystemJsNgModuleLoader.
* token.
*
* @experimental
*/
var SystemJsNgModuleLoaderConfig = /** @class */ (function () {
function SystemJsNgModuleLoaderConfig() {
}
return SystemJsNgModuleLoaderConfig;
}());
var DEFAULT_CONFIG = {
factoryPathPrefix: '',
factoryPathSuffix: '.ngfactory',
};
/**
* NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory
* @experimental
*/
var SystemJsNgModuleLoader = /** @class */ (function () {
function SystemJsNgModuleLoader(_compiler, config) {
this._compiler = _compiler;
this._config = config || DEFAULT_CONFIG;
}
SystemJsNgModuleLoader.prototype.load = function (path) {
var offlineMode = this._compiler instanceof Compiler;
return offlineMode ? this.loadFactory(path) : this.loadAndCompile(path);
};
SystemJsNgModuleLoader.prototype.loadAndCompile = function (path) {
var _this = this;
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(path.split(_SEPARATOR), 2), module = _a[0], exportName = _a[1];
if (exportName === undefined) {
exportName = 'default';
}
return __webpack_require__("./src/$$_lazy_route_resource lazy recursive")(module)
.then(function (module) { return module[exportName]; })
.then(function (type) { return checkNotEmpty(type, module, exportName); })
.then(function (type) { return _this._compiler.compileModuleAsync(type); });
};
SystemJsNgModuleLoader.prototype.loadFactory = function (path) {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(path.split(_SEPARATOR), 2), module = _a[0], exportName = _a[1];
var factoryClassSuffix = FACTORY_CLASS_SUFFIX;
if (exportName === undefined) {
exportName = 'default';
factoryClassSuffix = '';
}
return __webpack_require__("./src/$$_lazy_route_resource lazy recursive")(this._config.factoryPathPrefix + module + this._config.factoryPathSuffix)
.then(function (module) { return module[exportName + factoryClassSuffix]; })
.then(function (factory) { return checkNotEmpty(factory, module, exportName); });
};
SystemJsNgModuleLoader.decorators = [
{ type: Injectable }
];
/** @nocollapse */
SystemJsNgModuleLoader.ctorParameters = function () { return [
{ type: Compiler },
{ type: SystemJsNgModuleLoaderConfig, decorators: [{ type: Optional }] }
]; };
return SystemJsNgModuleLoader;
}());
function checkNotEmpty(value, modulePath, exportName) {
if (!value) {
throw new Error("Cannot find '" + exportName + "' in '" + modulePath + "'");
}
return value;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Represents an Embedded Template that can be used to instantiate Embedded Views.
*
* You can access a `TemplateRef`, in two ways. Via a directive placed on a `<ng-template>` element
* (or directive prefixed with `*`) and have the `TemplateRef` for this Embedded View injected into
* the constructor of the directive using the `TemplateRef` Token. Alternatively you can query for
* the `TemplateRef` from a Component or a Directive via {@link Query}.
*
* To instantiate Embedded Views based on a Template, use {@link ViewContainerRef#
* createEmbeddedView}, which will create the View and attach it to the View Container.
*
*/
var TemplateRef = /** @class */ (function () {
function TemplateRef() {
}
return TemplateRef;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Represents a container where one or more Views can be attached.
*
* The container can contain two kinds of Views. Host Views, created by instantiating a
* {@link Component} via {@link #createComponent}, and Embedded Views, created by instantiating an
* {@link TemplateRef Embedded Template} via {@link #createEmbeddedView}.
*
* The location of the View Container within the containing View is specified by the Anchor
* `element`. Each View Container can have only one Anchor Element and each Anchor Element can only
* have a single View Container.
*
* Root elements of Views attached to this container become siblings of the Anchor Element in
* the Rendered View.
*
* To access a `ViewContainerRef` of an Element, you can either place a {@link Directive} injected
* with `ViewContainerRef` on the Element, or you obtain it via a {@link ViewChild} query.
*
*/
var ViewContainerRef = /** @class */ (function () {
function ViewContainerRef() {
}
return ViewContainerRef;
}());
/**
* @license
* Copyright Google Inc. 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 ChangeDetectorRef = /** @class */ (function () {
function ChangeDetectorRef() {
}
return ChangeDetectorRef;
}());
/**
* @license
* Copyright Google Inc. 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 ViewRef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ViewRef, _super);
function ViewRef() {
return _super !== null && _super.apply(this, arguments) || this;
}
return ViewRef;
}(ChangeDetectorRef));
/**
* Represents an Angular View.
*
* <!-- TODO: move the next two paragraphs to the dev guide -->
* A View is a fundamental building block of the application UI. It is the smallest grouping of
* Elements which are created and destroyed together.
*
* Properties of elements in a View can change, but the structure (number and order) of elements in
* a View cannot. Changing the structure of Elements can only be done by inserting, moving or
* removing nested Views via a `ViewContainerRef`. Each View can contain many View Containers.
* <!-- /TODO -->
*
* @usageNotes
* ### Example
*
* Given this template...
*
* ```
* Count: {{items.length}}
* <ul>
* <li *ngFor="let item of items">{{item}}</li>
* </ul>
* ```
*
* We have two `TemplateRef`s:
*
* Outer `TemplateRef`:
*
* ```
* Count: {{items.length}}
* <ul>
* <ng-template ngFor let-item [ngForOf]="items"></ng-template>
* </ul>
* ```
*
* Inner `TemplateRef`:
*
* ```
* <li>{{item}}</li>
* ```
*
* Notice that the original template is broken down into two separate `TemplateRef`s.
*
* The outer/inner `TemplateRef`s are then assembled into views like so:
*
* ```
* <!-- ViewRef: outer-0 -->
* Count: 2
* <ul>
* <ng-template view-container-ref></ng-template>
* <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->
* <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->
* </ul>
* <!-- /ViewRef: outer-0 -->
* ```
* @experimental
*/
var EmbeddedViewRef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(EmbeddedViewRef, _super);
function EmbeddedViewRef() {
return _super !== null && _super.apply(this, arguments) || this;
}
return EmbeddedViewRef;
}(ViewRef));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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 EventListener = /** @class */ (function () {
function EventListener(name, callback) {
this.name = name;
this.callback = callback;
}
return EventListener;
}());
/**
* @experimental All debugging apis are currently experimental.
*/
var DebugNode = /** @class */ (function () {
function DebugNode(nativeNode, parent, _debugContext) {
this._debugContext = _debugContext;
this.nativeNode = nativeNode;
if (parent && parent instanceof DebugElement) {
parent.addChild(this);
}
else {
this.parent = null;
}
this.listeners = [];
}
Object.defineProperty(DebugNode.prototype, "injector", {
get: function () { return this._debugContext.injector; },
enumerable: true,
configurable: true
});
Object.defineProperty(DebugNode.prototype, "componentInstance", {
get: function () { return this._debugContext.component; },
enumerable: true,
configurable: true
});
Object.defineProperty(DebugNode.prototype, "context", {
get: function () { return this._debugContext.context; },
enumerable: true,
configurable: true
});
Object.defineProperty(DebugNode.prototype, "references", {
get: function () { return this._debugContext.references; },
enumerable: true,
configurable: true
});
Object.defineProperty(DebugNode.prototype, "providerTokens", {
get: function () { return this._debugContext.providerTokens; },
enumerable: true,
configurable: true
});
return DebugNode;
}());
/**
* @experimental All debugging apis are currently experimental.
*/
var DebugElement = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(DebugElement, _super);
function DebugElement(nativeNode, parent, _debugContext) {
var _this = _super.call(this, nativeNode, parent, _debugContext) || this;
_this.properties = {};
_this.attributes = {};
_this.classes = {};
_this.styles = {};
_this.childNodes = [];
_this.nativeElement = nativeNode;
return _this;
}
DebugElement.prototype.addChild = function (child) {
if (child) {
this.childNodes.push(child);
child.parent = this;
}
};
DebugElement.prototype.removeChild = function (child) {
var childIndex = this.childNodes.indexOf(child);
if (childIndex !== -1) {
child.parent = null;
this.childNodes.splice(childIndex, 1);
}
};
DebugElement.prototype.insertChildrenAfter = function (child, newChildren) {
var _this = this;
var siblingIndex = this.childNodes.indexOf(child);
if (siblingIndex !== -1) {
(_a = this.childNodes).splice.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([siblingIndex + 1, 0], newChildren));
newChildren.forEach(function (c) {
if (c.parent) {
c.parent.removeChild(c);
}
c.parent = _this;
});
}
var _a;
};
DebugElement.prototype.insertBefore = function (refChild, newChild) {
var refIndex = this.childNodes.indexOf(refChild);
if (refIndex === -1) {
this.addChild(newChild);
}
else {
if (newChild.parent) {
newChild.parent.removeChild(newChild);
}
newChild.parent = this;
this.childNodes.splice(refIndex, 0, newChild);
}
};
DebugElement.prototype.query = function (predicate) {
var results = this.queryAll(predicate);
return results[0] || null;
};
DebugElement.prototype.queryAll = function (predicate) {
var matches = [];
_queryElementChildren(this, predicate, matches);
return matches;
};
DebugElement.prototype.queryAllNodes = function (predicate) {
var matches = [];
_queryNodeChildren(this, predicate, matches);
return matches;
};
Object.defineProperty(DebugElement.prototype, "children", {
get: function () {
return this.childNodes.filter(function (node) { return node instanceof DebugElement; });
},
enumerable: true,
configurable: true
});
DebugElement.prototype.triggerEventHandler = function (eventName, eventObj) {
this.listeners.forEach(function (listener) {
if (listener.name == eventName) {
listener.callback(eventObj);
}
});
};
return DebugElement;
}(DebugNode));
/**
* @experimental
*/
function asNativeElements(debugEls) {
return debugEls.map(function (el) { return el.nativeElement; });
}
function _queryElementChildren(element, predicate, matches) {
element.childNodes.forEach(function (node) {
if (node instanceof DebugElement) {
if (predicate(node)) {
matches.push(node);
}
_queryElementChildren(node, predicate, matches);
}
});
}
function _queryNodeChildren(parentNode, predicate, matches) {
if (parentNode instanceof DebugElement) {
parentNode.childNodes.forEach(function (node) {
if (predicate(node)) {
matches.push(node);
}
if (node instanceof DebugElement) {
_queryNodeChildren(node, predicate, matches);
}
});
}
}
// Need to keep the nodes in a global Map so that multiple angular apps are supported.
var _nativeNodeToDebugNode = new Map();
/**
* @experimental
*/
function getDebugNode(nativeNode) {
return _nativeNodeToDebugNode.get(nativeNode) || null;
}
function indexDebugNode(node) {
_nativeNodeToDebugNode.set(node.nativeNode, node);
}
function removeDebugNodeFromIndex(node) {
_nativeNodeToDebugNode.delete(node.nativeNode);
}
/**
* @license
* Copyright Google Inc. 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
*/
function devModeEqual(a, b) {
var isListLikeIterableA = isListLikeIterable(a);
var isListLikeIterableB = isListLikeIterable(b);
if (isListLikeIterableA && isListLikeIterableB) {
return areIterablesEqual(a, b, devModeEqual);
}
else {
var isAObject = a && (typeof a === 'object' || typeof a === 'function');
var isBObject = b && (typeof b === 'object' || typeof b === 'function');
if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
return true;
}
else {
return looseIdentical(a, b);
}
}
}
/**
* Indicates that the result of a {@link Pipe} transformation has changed even though the
* reference has not changed.
*
* Wrapped values are unwrapped automatically during the change detection, and the unwrapped value
* is stored.
*
* Example:
*
* ```
* if (this._latestValue === this._latestReturnedValue) {
* return this._latestReturnedValue;
* } else {
* this._latestReturnedValue = this._latestValue;
* return WrappedValue.wrap(this._latestValue); // this will force update
* }
* ```
*
*/
var WrappedValue = /** @class */ (function () {
function WrappedValue(value) {
this.wrapped = value;
}
/** Creates a wrapped value. */
WrappedValue.wrap = function (value) { return new WrappedValue(value); };
/**
* Returns the underlying value of a wrapped value.
* Returns the given `value` when it is not wrapped.
**/
WrappedValue.unwrap = function (value) { return WrappedValue.isWrapped(value) ? value.wrapped : value; };
/** Returns true if `value` is a wrapped value. */
WrappedValue.isWrapped = function (value) { return value instanceof WrappedValue; };
return WrappedValue;
}());
/**
* Represents a basic change from a previous to a new value.
*
*/
var SimpleChange = /** @class */ (function () {
function SimpleChange(previousValue, currentValue, firstChange) {
this.previousValue = previousValue;
this.currentValue = currentValue;
this.firstChange = firstChange;
}
/**
* Check whether the new value is the first value assigned.
*/
SimpleChange.prototype.isFirstChange = function () { return this.firstChange; };
return SimpleChange;
}());
function isListLikeIterable(obj) {
if (!isJsObject(obj))
return false;
return Array.isArray(obj) ||
(!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
}
function areIterablesEqual(a, b, comparator) {
var iterator1 = a[getSymbolIterator()]();
var iterator2 = b[getSymbolIterator()]();
while (true) {
var item1 = iterator1.next();
var item2 = iterator2.next();
if (item1.done && item2.done)
return true;
if (item1.done || item2.done)
return false;
if (!comparator(item1.value, item2.value))
return false;
}
}
function iterateListLike(obj, fn) {
if (Array.isArray(obj)) {
for (var i = 0; i < obj.length; i++) {
fn(obj[i]);
}
}
else {
var iterator = obj[getSymbolIterator()]();
var item = void 0;
while (!((item = iterator.next()).done)) {
fn(item.value);
}
}
}
function isJsObject(o) {
return o !== null && (typeof o === 'function' || typeof o === 'object');
}
/**
* @license
* Copyright Google Inc. 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 DefaultIterableDifferFactory = /** @class */ (function () {
function DefaultIterableDifferFactory() {
}
DefaultIterableDifferFactory.prototype.supports = function (obj) { return isListLikeIterable(obj); };
DefaultIterableDifferFactory.prototype.create = function (trackByFn) {
return new DefaultIterableDiffer(trackByFn);
};
return DefaultIterableDifferFactory;
}());
var trackByIdentity = function (index, item) { return item; };
/**
* @deprecated v4.0.0 - Should not be part of public API.
*/
var DefaultIterableDiffer = /** @class */ (function () {
function DefaultIterableDiffer(trackByFn) {
this.length = 0;
// Keeps track of the used records at any point in time (during & across `_check()` calls)
this._linkedRecords = null;
// Keeps track of the removed records at any point in time during `_check()` calls.
this._unlinkedRecords = null;
this._previousItHead = null;
this._itHead = null;
this._itTail = null;
this._additionsHead = null;
this._additionsTail = null;
this._movesHead = null;
this._movesTail = null;
this._removalsHead = null;
this._removalsTail = null;
// Keeps track of records where custom track by is the same, but item identity has changed
this._identityChangesHead = null;
this._identityChangesTail = null;
this._trackByFn = trackByFn || trackByIdentity;
}
DefaultIterableDiffer.prototype.forEachItem = function (fn) {
var record;
for (record = this._itHead; record !== null; record = record._next) {
fn(record);
}
};
DefaultIterableDiffer.prototype.forEachOperation = function (fn) {
var nextIt = this._itHead;
var nextRemove = this._removalsHead;
var addRemoveOffset = 0;
var moveOffsets = null;
while (nextIt || nextRemove) {
// Figure out which is the next record to process
// Order: remove, add, move
var record = !nextRemove ||
nextIt &&
nextIt.currentIndex <
getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ?
nextIt :
nextRemove;
var adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);
var currentIndex = record.currentIndex;
// consume the item, and adjust the addRemoveOffset and update moveDistance if necessary
if (record === nextRemove) {
addRemoveOffset--;
nextRemove = nextRemove._nextRemoved;
}
else {
nextIt = nextIt._next;
if (record.previousIndex == null) {
addRemoveOffset++;
}
else {
// INVARIANT: currentIndex < previousIndex
if (!moveOffsets)
moveOffsets = [];
var localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;
var localCurrentIndex = currentIndex - addRemoveOffset;
if (localMovePreviousIndex != localCurrentIndex) {
for (var i = 0; i < localMovePreviousIndex; i++) {
var offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);
var index = offset + i;
if (localCurrentIndex <= index && index < localMovePreviousIndex) {
moveOffsets[i] = offset + 1;
}
}
var previousIndex = record.previousIndex;
moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;
}
}
}
if (adjPreviousIndex !== currentIndex) {
fn(record, adjPreviousIndex, currentIndex);
}
}
};
DefaultIterableDiffer.prototype.forEachPreviousItem = function (fn) {
var record;
for (record = this._previousItHead; record !== null; record = record._nextPrevious) {
fn(record);
}
};
DefaultIterableDiffer.prototype.forEachAddedItem = function (fn) {
var record;
for (record = this._additionsHead; record !== null; record = record._nextAdded) {
fn(record);
}
};
DefaultIterableDiffer.prototype.forEachMovedItem = function (fn) {
var record;
for (record = this._movesHead; record !== null; record = record._nextMoved) {
fn(record);
}
};
DefaultIterableDiffer.prototype.forEachRemovedItem = function (fn) {
var record;
for (record = this._removalsHead; record !== null; record = record._nextRemoved) {
fn(record);
}
};
DefaultIterableDiffer.prototype.forEachIdentityChange = function (fn) {
var record;
for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {
fn(record);
}
};
DefaultIterableDiffer.prototype.diff = function (collection) {
if (collection == null)
collection = [];
if (!isListLikeIterable(collection)) {
throw new Error("Error trying to diff '" + stringify(collection) + "'. Only arrays and iterables are allowed");
}
if (this.check(collection)) {
return this;
}
else {
return null;
}
};
DefaultIterableDiffer.prototype.onDestroy = function () { };
DefaultIterableDiffer.prototype.check = function (collection) {
var _this = this;
this._reset();
var record = this._itHead;
var mayBeDirty = false;
var index;
var item;
var itemTrackBy;
if (Array.isArray(collection)) {
this.length = collection.length;
for (var index_1 = 0; index_1 < this.length; index_1++) {
item = collection[index_1];
itemTrackBy = this._trackByFn(index_1, item);
if (record === null || !looseIdentical(record.trackById, itemTrackBy)) {
record = this._mismatch(record, item, itemTrackBy, index_1);
mayBeDirty = true;
}
else {
if (mayBeDirty) {
// TODO(misko): can we limit this to duplicates only?
record = this._verifyReinsertion(record, item, itemTrackBy, index_1);
}
if (!looseIdentical(record.item, item))
this._addIdentityChange(record, item);
}
record = record._next;
}
}
else {
index = 0;
iterateListLike(collection, function (item) {
itemTrackBy = _this._trackByFn(index, item);
if (record === null || !looseIdentical(record.trackById, itemTrackBy)) {
record = _this._mismatch(record, item, itemTrackBy, index);
mayBeDirty = true;
}
else {
if (mayBeDirty) {
// TODO(misko): can we limit this to duplicates only?
record = _this._verifyReinsertion(record, item, itemTrackBy, index);
}
if (!looseIdentical(record.item, item))
_this._addIdentityChange(record, item);
}
record = record._next;
index++;
});
this.length = index;
}
this._truncate(record);
this.collection = collection;
return this.isDirty;
};
Object.defineProperty(DefaultIterableDiffer.prototype, "isDirty", {
/* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity
* changes.
*/
get: function () {
return this._additionsHead !== null || this._movesHead !== null ||
this._removalsHead !== null || this._identityChangesHead !== null;
},
enumerable: true,
configurable: true
});
/**
* Reset the state of the change objects to show no changes. This means set previousKey to
* currentKey, and clear all of the queues (additions, moves, removals).
* Set the previousIndexes of moved and added items to their currentIndexes
* Reset the list of additions, moves and removals
*
* @internal
*/
DefaultIterableDiffer.prototype._reset = function () {
if (this.isDirty) {
var record = void 0;
var nextRecord = void 0;
for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {
record._nextPrevious = record._next;
}
for (record = this._additionsHead; record !== null; record = record._nextAdded) {
record.previousIndex = record.currentIndex;
}
this._additionsHead = this._additionsTail = null;
for (record = this._movesHead; record !== null; record = nextRecord) {
record.previousIndex = record.currentIndex;
nextRecord = record._nextMoved;
}
this._movesHead = this._movesTail = null;
this._removalsHead = this._removalsTail = null;
this._identityChangesHead = this._identityChangesTail = null;
// TODO(vicb): when assert gets supported
// assert(!this.isDirty);
}
};
/**
* This is the core function which handles differences between collections.
*
* - `record` is the record which we saw at this position last time. If null then it is a new
* item.
* - `item` is the current item in the collection
* - `index` is the position of the item in the collection
*
* @internal
*/
DefaultIterableDiffer.prototype._mismatch = function (record, item, itemTrackBy, index) {
// The previous record after which we will append the current one.
var previousRecord;
if (record === null) {
previousRecord = this._itTail;
}
else {
previousRecord = record._prev;
// Remove the record from the collection since we know it does not match the item.
this._remove(record);
}
// Attempt to see if we have seen the item before.
record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);
if (record !== null) {
// We have seen this before, we need to move it forward in the collection.
// But first we need to check if identity changed, so we can update in view if necessary
if (!looseIdentical(record.item, item))
this._addIdentityChange(record, item);
this._moveAfter(record, previousRecord, index);
}
else {
// Never seen it, check evicted list.
record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);
if (record !== null) {
// It is an item which we have evicted earlier: reinsert it back into the list.
// But first we need to check if identity changed, so we can update in view if necessary
if (!looseIdentical(record.item, item))
this._addIdentityChange(record, item);
this._reinsertAfter(record, previousRecord, index);
}
else {
// It is a new item: add it.
record =
this._addAfter(new IterableChangeRecord_(item, itemTrackBy), previousRecord, index);
}
}
return record;
};
/**
* This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)
*
* Use case: `[a, a]` => `[b, a, a]`
*
* If we did not have this check then the insertion of `b` would:
* 1) evict first `a`
* 2) insert `b` at `0` index.
* 3) leave `a` at index `1` as is. <-- this is wrong!
* 3) reinsert `a` at index 2. <-- this is wrong!
*
* The correct behavior is:
* 1) evict first `a`
* 2) insert `b` at `0` index.
* 3) reinsert `a` at index 1.
* 3) move `a` at from `1` to `2`.
*
*
* Double check that we have not evicted a duplicate item. We need to check if the item type may
* have already been removed:
* The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted
* at the end. Which will show up as the two 'a's switching position. This is incorrect, since a
* better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'
* at the end.
*
* @internal
*/
DefaultIterableDiffer.prototype._verifyReinsertion = function (record, item, itemTrackBy, index) {
var reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);
if (reinsertRecord !== null) {
record = this._reinsertAfter(reinsertRecord, record._prev, index);
}
else if (record.currentIndex != index) {
record.currentIndex = index;
this._addToMoves(record, index);
}
return record;
};
/**
* Get rid of any excess {@link IterableChangeRecord_}s from the previous collection
*
* - `record` The first excess {@link IterableChangeRecord_}.
*
* @internal
*/
DefaultIterableDiffer.prototype._truncate = function (record) {
// Anything after that needs to be removed;
while (record !== null) {
var nextRecord = record._next;
this._addToRemovals(this._unlink(record));
record = nextRecord;
}
if (this._unlinkedRecords !== null) {
this._unlinkedRecords.clear();
}
if (this._additionsTail !== null) {
this._additionsTail._nextAdded = null;
}
if (this._movesTail !== null) {
this._movesTail._nextMoved = null;
}
if (this._itTail !== null) {
this._itTail._next = null;
}
if (this._removalsTail !== null) {
this._removalsTail._nextRemoved = null;
}
if (this._identityChangesTail !== null) {
this._identityChangesTail._nextIdentityChange = null;
}
};
/** @internal */
DefaultIterableDiffer.prototype._reinsertAfter = function (record, prevRecord, index) {
if (this._unlinkedRecords !== null) {
this._unlinkedRecords.remove(record);
}
var prev = record._prevRemoved;
var next = record._nextRemoved;
if (prev === null) {
this._removalsHead = next;
}
else {
prev._nextRemoved = next;
}
if (next === null) {
this._removalsTail = prev;
}
else {
next._prevRemoved = prev;
}
this._insertAfter(record, prevRecord, index);
this._addToMoves(record, index);
return record;
};
/** @internal */
DefaultIterableDiffer.prototype._moveAfter = function (record, prevRecord, index) {
this._unlink(record);
this._insertAfter(record, prevRecord, index);
this._addToMoves(record, index);
return record;
};
/** @internal */
DefaultIterableDiffer.prototype._addAfter = function (record, prevRecord, index) {
this._insertAfter(record, prevRecord, index);
if (this._additionsTail === null) {
// TODO(vicb):
// assert(this._additionsHead === null);
this._additionsTail = this._additionsHead = record;
}
else {
// TODO(vicb):
// assert(_additionsTail._nextAdded === null);
// assert(record._nextAdded === null);
this._additionsTail = this._additionsTail._nextAdded = record;
}
return record;
};
/** @internal */
DefaultIterableDiffer.prototype._insertAfter = function (record, prevRecord, index) {
// TODO(vicb):
// assert(record != prevRecord);
// assert(record._next === null);
// assert(record._prev === null);
var next = prevRecord === null ? this._itHead : prevRecord._next;
// TODO(vicb):
// assert(next != record);
// assert(prevRecord != record);
record._next = next;
record._prev = prevRecord;
if (next === null) {
this._itTail = record;
}
else {
next._prev = record;
}
if (prevRecord === null) {
this._itHead = record;
}
else {
prevRecord._next = record;
}
if (this._linkedRecords === null) {
this._linkedRecords = new _DuplicateMap();
}
this._linkedRecords.put(record);
record.currentIndex = index;
return record;
};
/** @internal */
DefaultIterableDiffer.prototype._remove = function (record) {
return this._addToRemovals(this._unlink(record));
};
/** @internal */
DefaultIterableDiffer.prototype._unlink = function (record) {
if (this._linkedRecords !== null) {
this._linkedRecords.remove(record);
}
var prev = record._prev;
var next = record._next;
// TODO(vicb):
// assert((record._prev = null) === null);
// assert((record._next = null) === null);
if (prev === null) {
this._itHead = next;
}
else {
prev._next = next;
}
if (next === null) {
this._itTail = prev;
}
else {
next._prev = prev;
}
return record;
};
/** @internal */
DefaultIterableDiffer.prototype._addToMoves = function (record, toIndex) {
// TODO(vicb):
// assert(record._nextMoved === null);
if (record.previousIndex === toIndex) {
return record;
}
if (this._movesTail === null) {
// TODO(vicb):
// assert(_movesHead === null);
this._movesTail = this._movesHead = record;
}
else {
// TODO(vicb):
// assert(_movesTail._nextMoved === null);
this._movesTail = this._movesTail._nextMoved = record;
}
return record;
};
DefaultIterableDiffer.prototype._addToRemovals = function (record) {
if (this._unlinkedRecords === null) {
this._unlinkedRecords = new _DuplicateMap();
}
this._unlinkedRecords.put(record);
record.currentIndex = null;
record._nextRemoved = null;
if (this._removalsTail === null) {
// TODO(vicb):
// assert(_removalsHead === null);
this._removalsTail = this._removalsHead = record;
record._prevRemoved = null;
}
else {
// TODO(vicb):
// assert(_removalsTail._nextRemoved === null);
// assert(record._nextRemoved === null);
record._prevRemoved = this._removalsTail;
this._removalsTail = this._removalsTail._nextRemoved = record;
}
return record;
};
/** @internal */
DefaultIterableDiffer.prototype._addIdentityChange = function (record, item) {
record.item = item;
if (this._identityChangesTail === null) {
this._identityChangesTail = this._identityChangesHead = record;
}
else {
this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;
}
return record;
};
return DefaultIterableDiffer;
}());
var IterableChangeRecord_ = /** @class */ (function () {
function IterableChangeRecord_(item, trackById) {
this.item = item;
this.trackById = trackById;
this.currentIndex = null;
this.previousIndex = null;
/** @internal */
this._nextPrevious = null;
/** @internal */
this._prev = null;
/** @internal */
this._next = null;
/** @internal */
this._prevDup = null;
/** @internal */
this._nextDup = null;
/** @internal */
this._prevRemoved = null;
/** @internal */
this._nextRemoved = null;
/** @internal */
this._nextAdded = null;
/** @internal */
this._nextMoved = null;
/** @internal */
this._nextIdentityChange = null;
}
return IterableChangeRecord_;
}());
// A linked list of CollectionChangeRecords with the same IterableChangeRecord_.item
var _DuplicateItemRecordList = /** @class */ (function () {
function _DuplicateItemRecordList() {
/** @internal */
this._head = null;
/** @internal */
this._tail = null;
}
/**
* Append the record to the list of duplicates.
*
* Note: by design all records in the list of duplicates hold the same value in record.item.
*/
_DuplicateItemRecordList.prototype.add = function (record) {
if (this._head === null) {
this._head = this._tail = record;
record._nextDup = null;
record._prevDup = null;
}
else {
// TODO(vicb):
// assert(record.item == _head.item ||
// record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);
this._tail._nextDup = record;
record._prevDup = this._tail;
record._nextDup = null;
this._tail = record;
}
};
// Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and
// IterableChangeRecord_.currentIndex >= atOrAfterIndex
_DuplicateItemRecordList.prototype.get = function (trackById, atOrAfterIndex) {
var record;
for (record = this._head; record !== null; record = record._nextDup) {
if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex) &&
looseIdentical(record.trackById, trackById)) {
return record;
}
}
return null;
};
/**
* Remove one {@link IterableChangeRecord_} from the list of duplicates.
*
* Returns whether the list of duplicates is empty.
*/
_DuplicateItemRecordList.prototype.remove = function (record) {
// TODO(vicb):
// assert(() {
// // verify that the record being removed is in the list.
// for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) {
// if (identical(cursor, record)) return true;
// }
// return false;
//});
var prev = record._prevDup;
var next = record._nextDup;
if (prev === null) {
this._head = next;
}
else {
prev._nextDup = next;
}
if (next === null) {
this._tail = prev;
}
else {
next._prevDup = prev;
}
return this._head === null;
};
return _DuplicateItemRecordList;
}());
var _DuplicateMap = /** @class */ (function () {
function _DuplicateMap() {
this.map = new Map();
}
_DuplicateMap.prototype.put = function (record) {
var key = record.trackById;
var duplicates = this.map.get(key);
if (!duplicates) {
duplicates = new _DuplicateItemRecordList();
this.map.set(key, duplicates);
}
duplicates.add(record);
};
/**
* Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we
* have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.
*
* Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we
* have any more `a`s needs to return the second `a`.
*/
_DuplicateMap.prototype.get = function (trackById, atOrAfterIndex) {
var key = trackById;
var recordList = this.map.get(key);
return recordList ? recordList.get(trackById, atOrAfterIndex) : null;
};
/**
* Removes a {@link IterableChangeRecord_} from the list of duplicates.
*
* The list of duplicates also is removed from the map if it gets empty.
*/
_DuplicateMap.prototype.remove = function (record) {
var key = record.trackById;
var recordList = this.map.get(key);
// Remove the list of duplicates when it gets empty
if (recordList.remove(record)) {
this.map.delete(key);
}
return record;
};
Object.defineProperty(_DuplicateMap.prototype, "isEmpty", {
get: function () { return this.map.size === 0; },
enumerable: true,
configurable: true
});
_DuplicateMap.prototype.clear = function () { this.map.clear(); };
return _DuplicateMap;
}());
function getPreviousIndex(item, addRemoveOffset, moveOffsets) {
var previousIndex = item.previousIndex;
if (previousIndex === null)
return previousIndex;
var moveOffset = 0;
if (moveOffsets && previousIndex < moveOffsets.length) {
moveOffset = moveOffsets[previousIndex];
}
return previousIndex + addRemoveOffset + moveOffset;
}
/**
* @license
* Copyright Google Inc. 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 DefaultKeyValueDifferFactory = /** @class */ (function () {
function DefaultKeyValueDifferFactory() {
}
DefaultKeyValueDifferFactory.prototype.supports = function (obj) { return obj instanceof Map || isJsObject(obj); };
DefaultKeyValueDifferFactory.prototype.create = function () { return new DefaultKeyValueDiffer(); };
return DefaultKeyValueDifferFactory;
}());
var DefaultKeyValueDiffer = /** @class */ (function () {
function DefaultKeyValueDiffer() {
this._records = new Map();
this._mapHead = null;
// _appendAfter is used in the check loop
this._appendAfter = null;
this._previousMapHead = null;
this._changesHead = null;
this._changesTail = null;
this._additionsHead = null;
this._additionsTail = null;
this._removalsHead = null;
this._removalsTail = null;
}
Object.defineProperty(DefaultKeyValueDiffer.prototype, "isDirty", {
get: function () {
return this._additionsHead !== null || this._changesHead !== null ||
this._removalsHead !== null;
},
enumerable: true,
configurable: true
});
DefaultKeyValueDiffer.prototype.forEachItem = function (fn) {
var record;
for (record = this._mapHead; record !== null; record = record._next) {
fn(record);
}
};
DefaultKeyValueDiffer.prototype.forEachPreviousItem = function (fn) {
var record;
for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {
fn(record);
}
};
DefaultKeyValueDiffer.prototype.forEachChangedItem = function (fn) {
var record;
for (record = this._changesHead; record !== null; record = record._nextChanged) {
fn(record);
}
};
DefaultKeyValueDiffer.prototype.forEachAddedItem = function (fn) {
var record;
for (record = this._additionsHead; record !== null; record = record._nextAdded) {
fn(record);
}
};
DefaultKeyValueDiffer.prototype.forEachRemovedItem = function (fn) {
var record;
for (record = this._removalsHead; record !== null; record = record._nextRemoved) {
fn(record);
}
};
DefaultKeyValueDiffer.prototype.diff = function (map) {
if (!map) {
map = new Map();
}
else if (!(map instanceof Map || isJsObject(map))) {
throw new Error("Error trying to diff '" + stringify(map) + "'. Only maps and objects are allowed");
}
return this.check(map) ? this : null;
};
DefaultKeyValueDiffer.prototype.onDestroy = function () { };
/**
* Check the current state of the map vs the previous.
* The algorithm is optimised for when the keys do no change.
*/
DefaultKeyValueDiffer.prototype.check = function (map) {
var _this = this;
this._reset();
var insertBefore = this._mapHead;
this._appendAfter = null;
this._forEach(map, function (value, key) {
if (insertBefore && insertBefore.key === key) {
_this._maybeAddToChanges(insertBefore, value);
_this._appendAfter = insertBefore;
insertBefore = insertBefore._next;
}
else {
var record = _this._getOrCreateRecordForKey(key, value);
insertBefore = _this._insertBeforeOrAppend(insertBefore, record);
}
});
// Items remaining at the end of the list have been deleted
if (insertBefore) {
if (insertBefore._prev) {
insertBefore._prev._next = null;
}
this._removalsHead = insertBefore;
for (var record = insertBefore; record !== null; record = record._nextRemoved) {
if (record === this._mapHead) {
this._mapHead = null;
}
this._records.delete(record.key);
record._nextRemoved = record._next;
record.previousValue = record.currentValue;
record.currentValue = null;
record._prev = null;
record._next = null;
}
}
// Make sure tails have no next records from previous runs
if (this._changesTail)
this._changesTail._nextChanged = null;
if (this._additionsTail)
this._additionsTail._nextAdded = null;
return this.isDirty;
};
/**
* Inserts a record before `before` or append at the end of the list when `before` is null.
*
* Notes:
* - This method appends at `this._appendAfter`,
* - This method updates `this._appendAfter`,
* - The return value is the new value for the insertion pointer.
*/
DefaultKeyValueDiffer.prototype._insertBeforeOrAppend = function (before, record) {
if (before) {
var prev = before._prev;
record._next = before;
record._prev = prev;
before._prev = record;
if (prev) {
prev._next = record;
}
if (before === this._mapHead) {
this._mapHead = record;
}
this._appendAfter = before;
return before;
}
if (this._appendAfter) {
this._appendAfter._next = record;
record._prev = this._appendAfter;
}
else {
this._mapHead = record;
}
this._appendAfter = record;
return null;
};
DefaultKeyValueDiffer.prototype._getOrCreateRecordForKey = function (key, value) {
if (this._records.has(key)) {
var record_1 = this._records.get(key);
this._maybeAddToChanges(record_1, value);
var prev = record_1._prev;
var next = record_1._next;
if (prev) {
prev._next = next;
}
if (next) {
next._prev = prev;
}
record_1._next = null;
record_1._prev = null;
return record_1;
}
var record = new KeyValueChangeRecord_(key);
this._records.set(key, record);
record.currentValue = value;
this._addToAdditions(record);
return record;
};
/** @internal */
DefaultKeyValueDiffer.prototype._reset = function () {
if (this.isDirty) {
var record = void 0;
// let `_previousMapHead` contain the state of the map before the changes
this._previousMapHead = this._mapHead;
for (record = this._previousMapHead; record !== null; record = record._next) {
record._nextPrevious = record._next;
}
// Update `record.previousValue` with the value of the item before the changes
// We need to update all changed items (that's those which have been added and changed)
for (record = this._changesHead; record !== null; record = record._nextChanged) {
record.previousValue = record.currentValue;
}
for (record = this._additionsHead; record != null; record = record._nextAdded) {
record.previousValue = record.currentValue;
}
this._changesHead = this._changesTail = null;
this._additionsHead = this._additionsTail = null;
this._removalsHead = null;
}
};
// Add the record or a given key to the list of changes only when the value has actually changed
DefaultKeyValueDiffer.prototype._maybeAddToChanges = function (record, newValue) {
if (!looseIdentical(newValue, record.currentValue)) {
record.previousValue = record.currentValue;
record.currentValue = newValue;
this._addToChanges(record);
}
};
DefaultKeyValueDiffer.prototype._addToAdditions = function (record) {
if (this._additionsHead === null) {
this._additionsHead = this._additionsTail = record;
}
else {
this._additionsTail._nextAdded = record;
this._additionsTail = record;
}
};
DefaultKeyValueDiffer.prototype._addToChanges = function (record) {
if (this._changesHead === null) {
this._changesHead = this._changesTail = record;
}
else {
this._changesTail._nextChanged = record;
this._changesTail = record;
}
};
/** @internal */
DefaultKeyValueDiffer.prototype._forEach = function (obj, fn) {
if (obj instanceof Map) {
obj.forEach(fn);
}
else {
Object.keys(obj).forEach(function (k) { return fn(obj[k], k); });
}
};
return DefaultKeyValueDiffer;
}());
var KeyValueChangeRecord_ = /** @class */ (function () {
function KeyValueChangeRecord_(key) {
this.key = key;
this.previousValue = null;
this.currentValue = null;
/** @internal */
this._nextPrevious = null;
/** @internal */
this._next = null;
/** @internal */
this._prev = null;
/** @internal */
this._nextAdded = null;
/** @internal */
this._nextRemoved = null;
/** @internal */
this._nextChanged = null;
}
return KeyValueChangeRecord_;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A repository of different iterable diffing strategies used by NgFor, NgClass, and others.
*
*/
var IterableDiffers = /** @class */ (function () {
function IterableDiffers(factories) {
this.factories = factories;
}
IterableDiffers.create = function (factories, parent) {
if (parent != null) {
var copied = parent.factories.slice();
factories = factories.concat(copied);
}
return new IterableDiffers(factories);
};
/**
* Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the
* inherited {@link IterableDiffers} instance with the provided factories and return a new
* {@link IterableDiffers} instance.
*
* @usageNotes
* ### Example
*
* The following example shows how to extend an existing list of factories,
* which will only be applied to the injector for this component and its children.
* This step is all that's required to make a new {@link IterableDiffer} available.
*
* ```
* @Component({
* viewProviders: [
* IterableDiffers.extend([new ImmutableListDiffer()])
* ]
* })
* ```
*/
IterableDiffers.extend = function (factories) {
return {
provide: IterableDiffers,
useFactory: function (parent) {
if (!parent) {
// Typically would occur when calling IterableDiffers.extend inside of dependencies passed
// to
// bootstrap(), which would override default pipes instead of extending them.
throw new Error('Cannot extend IterableDiffers without a parent injector');
}
return IterableDiffers.create(factories, parent);
},
// Dependency technically isn't optional, but we can provide a better error message this way.
deps: [[IterableDiffers, new SkipSelf(), new Optional()]]
};
};
IterableDiffers.prototype.find = function (iterable) {
var factory = this.factories.find(function (f) { return f.supports(iterable); });
if (factory != null) {
return factory;
}
else {
throw new Error("Cannot find a differ supporting object '" + iterable + "' of type '" + getTypeNameForDebugging(iterable) + "'");
}
};
IterableDiffers.ngInjectableDef = defineInjectable({
providedIn: 'root',
factory: function () { return new IterableDiffers([new DefaultIterableDifferFactory()]); }
});
return IterableDiffers;
}());
function getTypeNameForDebugging(type) {
return type['name'] || typeof type;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
*
*/
var KeyValueDiffers = /** @class */ (function () {
function KeyValueDiffers(factories) {
this.factories = factories;
}
KeyValueDiffers.create = function (factories, parent) {
if (parent) {
var copied = parent.factories.slice();
factories = factories.concat(copied);
}
return new KeyValueDiffers(factories);
};
/**
* Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the
* inherited {@link KeyValueDiffers} instance with the provided factories and return a new
* {@link KeyValueDiffers} instance.
*
* @usageNotes
* ### Example
*
* The following example shows how to extend an existing list of factories,
* which will only be applied to the injector for this component and its children.
* This step is all that's required to make a new {@link KeyValueDiffer} available.
*
* ```
* @Component({
* viewProviders: [
* KeyValueDiffers.extend([new ImmutableMapDiffer()])
* ]
* })
* ```
*/
KeyValueDiffers.extend = function (factories) {
return {
provide: KeyValueDiffers,
useFactory: function (parent) {
if (!parent) {
// Typically would occur when calling KeyValueDiffers.extend inside of dependencies passed
// to bootstrap(), which would override default pipes instead of extending them.
throw new Error('Cannot extend KeyValueDiffers without a parent injector');
}
return KeyValueDiffers.create(factories, parent);
},
// Dependency technically isn't optional, but we can provide a better error message this way.
deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]
};
};
KeyValueDiffers.prototype.find = function (kv) {
var factory = this.factories.find(function (f) { return f.supports(kv); });
if (factory) {
return factory;
}
throw new Error("Cannot find a differ supporting object '" + kv + "'");
};
return KeyValueDiffers;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Structural diffing for `Object`s and `Map`s.
*/
var keyValDiff = [new DefaultKeyValueDifferFactory()];
/**
* Structural diffing for `Iterable` types such as `Array`s.
*/
var iterableDiff = [new DefaultIterableDifferFactory()];
var defaultIterableDiffers = new IterableDiffers(iterableDiff);
var defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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 _CORE_PLATFORM_PROVIDERS = [
// Set a default platform name for platforms that don't set it explicitly.
{ provide: PLATFORM_ID, useValue: 'unknown' },
{ provide: PlatformRef, deps: [Injector] },
{ provide: TestabilityRegistry, deps: [] },
{ provide: Console, deps: [] },
];
/**
* This platform has to be included in any other platform
*
* @experimental
*/
var platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS);
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Provide this token to set the locale of your application.
* It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
* DecimalPipe and PercentPipe) and by ICU expressions.
*
* See the [i18n guide](guide/i18n#setting-up-locale) for more information.
*
* @usageNotes
* ### Example
*
* ```typescript
* import { LOCALE_ID } from '@angular/core';
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
* import { AppModule } from './app/app.module';
*
* platformBrowserDynamic().bootstrapModule(AppModule, {
* providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
* });
* ```
*
* @experimental i18n support is experimental.
*/
var LOCALE_ID = new InjectionToken('LocaleId');
/**
* Use this token at bootstrap to provide the content of your translation file (`xtb`,
* `xlf` or `xlf2`) when you want to translate your application in another language.
*
* See the [i18n guide](guide/i18n#merge) for more information.
*
* @usageNotes
* ### Example
*
* ```typescript
* import { TRANSLATIONS } from '@angular/core';
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
* import { AppModule } from './app/app.module';
*
* // content of your translation file
* const translations = '....';
*
* platformBrowserDynamic().bootstrapModule(AppModule, {
* providers: [{provide: TRANSLATIONS, useValue: translations }]
* });
* ```
*
* @experimental i18n support is experimental.
*/
var TRANSLATIONS = new InjectionToken('Translations');
/**
* Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
* `xlf` or `xlf2`.
*
* See the [i18n guide](guide/i18n#merge) for more information.
*
* @usageNotes
* ### Example
*
* ```typescript
* import { TRANSLATIONS_FORMAT } from '@angular/core';
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
* import { AppModule } from './app/app.module';
*
* platformBrowserDynamic().bootstrapModule(AppModule, {
* providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
* });
* ```
*
* @experimental i18n support is experimental.
*/
var TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
/**
* Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
* that the compiler should use in case of missing translations:
* - Error: throw if you have missing translations.
* - Warning (default): show a warning in the console and/or shell.
* - Ignore: do nothing.
*
* See the [i18n guide](guide/i18n#missing-translation) for more information.
*
* @usageNotes
* ### Example
* ```typescript
* import { MissingTranslationStrategy } from '@angular/core';
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
* import { AppModule } from './app/app.module';
*
* platformBrowserDynamic().bootstrapModule(AppModule, {
* missingTranslation: MissingTranslationStrategy.Error
* });
* ```
*
* @experimental i18n support is experimental.
*/
var MissingTranslationStrategy;
(function (MissingTranslationStrategy) {
MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error";
MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning";
MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore";
})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
/**
* @license
* Copyright Google Inc. 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
*/
function _iterableDiffersFactory() {
return defaultIterableDiffers;
}
function _keyValueDiffersFactory() {
return defaultKeyValueDiffers;
}
function _localeFactory(locale) {
return locale || 'en-US';
}
/**
* This module includes the providers of @angular/core that are needed
* to bootstrap components via `ApplicationRef`.
*
* @experimental
*/
var ApplicationModule = /** @class */ (function () {
// Inject ApplicationRef to make it eager...
function ApplicationModule(appRef) {
}
ApplicationModule.decorators = [
{ type: NgModule, args: [{
providers: [
ApplicationRef,
ApplicationInitStatus,
Compiler,
APP_ID_RANDOM_PROVIDER,
{ provide: IterableDiffers, useFactory: _iterableDiffersFactory },
{ provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory },
{
provide: LOCALE_ID,
useFactory: _localeFactory,
deps: [[new Inject(LOCALE_ID), new Optional(), new SkipSelf()]]
},
]
},] }
];
/** @nocollapse */
ApplicationModule.ctorParameters = function () { return [
{ type: ApplicationRef }
]; };
return ApplicationModule;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* This helper class is used to get hold of an inert tree of DOM elements containing dirty HTML
* that needs sanitizing.
* Depending upon browser support we must use one of three strategies for doing this.
* Support: Safari 10.x -> XHR strategy
* Support: Firefox -> DomParser strategy
* Default: InertDocument strategy
*/
var InertBodyHelper = /** @class */ (function () {
function InertBodyHelper(defaultDoc) {
this.defaultDoc = defaultDoc;
this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');
this.inertBodyElement = this.inertDocument.body;
if (this.inertBodyElement == null) {
// usually there should be only one body element in the document, but IE doesn't have any, so
// we need to create one.
var inertHtml = this.inertDocument.createElement('html');
this.inertDocument.appendChild(inertHtml);
this.inertBodyElement = this.inertDocument.createElement('body');
inertHtml.appendChild(this.inertBodyElement);
}
this.inertBodyElement.innerHTML = '<svg><g onload="this.parentNode.remove()"></g></svg>';
if (this.inertBodyElement.querySelector && !this.inertBodyElement.querySelector('svg')) {
// We just hit the Safari 10.1 bug - which allows JS to run inside the SVG G element
// so use the XHR strategy.
this.getInertBodyElement = this.getInertBodyElement_XHR;
return;
}
this.inertBodyElement.innerHTML =
'<svg><p><style><img src="</style><img src=x onerror=alert(1)//">';
if (this.inertBodyElement.querySelector && this.inertBodyElement.querySelector('svg img')) {
// We just hit the Firefox bug - which prevents the inner img JS from being sanitized
// so use the DOMParser strategy, if it is available.
// If the DOMParser is not available then we are not in Firefox (Server/WebWorker?) so we
// fall through to the default strategy below.
if (isDOMParserAvailable()) {
this.getInertBodyElement = this.getInertBodyElement_DOMParser;
return;
}
}
// None of the bugs were hit so it is safe for us to use the default InertDocument strategy
this.getInertBodyElement = this.getInertBodyElement_InertDocument;
}
/**
* Use XHR to create and fill an inert body element (on Safari 10.1)
* See
* https://github.com/cure53/DOMPurify/blob/a992d3a75031cb8bb032e5ea8399ba972bdf9a65/src/purify.js#L439-L449
*/
InertBodyHelper.prototype.getInertBodyElement_XHR = function (html) {
// We add these extra elements to ensure that the rest of the content is parsed as expected
// e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the
// `<head>` tag.
html = '<body><remove></remove>' + html + '</body>';
try {
html = encodeURI(html);
}
catch (e) {
return null;
}
var xhr = new XMLHttpRequest();
xhr.responseType = 'document';
xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false);
xhr.send(null);
var body = xhr.response.body;
body.removeChild(body.firstChild);
return body;
};
/**
* Use DOMParser to create and fill an inert body element (on Firefox)
* See https://github.com/cure53/DOMPurify/releases/tag/0.6.7
*
*/
InertBodyHelper.prototype.getInertBodyElement_DOMParser = function (html) {
// We add these extra elements to ensure that the rest of the content is parsed as expected
// e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the
// `<head>` tag.
html = '<body><remove></remove>' + html + '</body>';
try {
var body = new window
.DOMParser()
.parseFromString(html, 'text/html')
.body;
body.removeChild(body.firstChild);
return body;
}
catch (e) {
return null;
}
};
/**
* Use an HTML5 `template` element, if supported, or an inert body element created via
* `createHtmlDocument` to create and fill an inert DOM element.
* This is the default sane strategy to use if the browser does not require one of the specialised
* strategies above.
*/
InertBodyHelper.prototype.getInertBodyElement_InertDocument = function (html) {
// Prefer using <template> element if supported.
var templateEl = this.inertDocument.createElement('template');
if ('content' in templateEl) {
templateEl.innerHTML = html;
return templateEl;
}
this.inertBodyElement.innerHTML = html;
// Support: IE 9-11 only
// strip custom-namespaced attributes on IE<=11
if (this.defaultDoc.documentMode) {
this.stripCustomNsAttrs(this.inertBodyElement);
}
return this.inertBodyElement;
};
/**
* When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'
* attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g.
* 'ns1:xlink:foo').
*
* This is undesirable since we don't want to allow any of these custom attributes. This method
* strips them all.
*/
InertBodyHelper.prototype.stripCustomNsAttrs = function (el) {
var elAttrs = el.attributes;
// loop backwards so that we can support removals.
for (var i = elAttrs.length - 1; 0 < i; i--) {
var attrib = elAttrs.item(i);
var attrName = attrib.name;
if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {
el.removeAttribute(attrName);
}
}
var childNode = el.firstChild;
while (childNode) {
if (childNode.nodeType === Node.ELEMENT_NODE)
this.stripCustomNsAttrs(childNode);
childNode = childNode.nextSibling;
}
};
return InertBodyHelper;
}());
/**
* We need to determine whether the DOMParser exists in the global context.
* The try-catch is because, on some browsers, trying to access this property
* on window can actually throw an error.
*
* @suppress {uselessCode}
*/
function isDOMParserAvailable() {
try {
return !!window.DOMParser;
}
catch (e) {
return false;
}
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A pattern that recognizes a commonly useful subset of URLs that are safe.
*
* This regular expression matches a subset of URLs that will not cause script
* execution if used in URL context within a HTML document. Specifically, this
* regular expression matches if (comment from here on and regex copied from
* Soy's EscapingConventions):
* (1) Either a protocol in a whitelist (http, https, mailto or ftp).
* (2) or no protocol. A protocol must be followed by a colon. The below
* allows that by allowing colons only after one of the characters [/?#].
* A colon after a hash (#) must be in the fragment.
* Otherwise, a colon after a (?) must be in a query.
* Otherwise, a colon after a single solidus (/) must be in a path.
* Otherwise, a colon after a double solidus (//) must be in the authority
* (before port).
*
* The pattern disallows &, used in HTML entity declarations before
* one of the characters in [/?#]. This disallows HTML entities used in the
* protocol name, which should never happen, e.g. "h&#116;tp" for "http".
* It also disallows HTML entities in the first path part of a relative path,
* e.g. "foo&lt;bar/baz". Our existing escaping functions should not produce
* that. More importantly, it disallows masking of a colon,
* e.g. "javascript&#58;...".
*
* This regular expression was taken from the Closure sanitization library.
*/
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
/** A pattern that matches safe data URLs. Only matches image, video and audio types. */
var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;
function _sanitizeUrl(url) {
url = String(url);
if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN))
return url;
if (isDevMode()) {
console.warn("WARNING: sanitizing unsafe URL value " + url + " (see http://g.co/ng/security#xss)");
}
return 'unsafe:' + url;
}
function sanitizeSrcset(srcset) {
srcset = String(srcset);
return srcset.split(',').map(function (srcset) { return _sanitizeUrl(srcset.trim()); }).join(', ');
}
/**
* @license
* Copyright Google Inc. 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
*/
function tagSet(tags) {
var res = {};
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(tags.split(',')), _b = _a.next(); !_b.done; _b = _a.next()) {
var t = _b.value;
res[t] = true;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_1) throw e_1.error; }
}
return res;
var e_1, _c;
}
function merge$1() {
var sets = [];
for (var _i = 0; _i < arguments.length; _i++) {
sets[_i] = arguments[_i];
}
var res = {};
try {
for (var sets_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(sets), sets_1_1 = sets_1.next(); !sets_1_1.done; sets_1_1 = sets_1.next()) {
var s = sets_1_1.value;
for (var v in s) {
if (s.hasOwnProperty(v))
res[v] = true;
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (sets_1_1 && !sets_1_1.done && (_a = sets_1.return)) _a.call(sets_1);
}
finally { if (e_2) throw e_2.error; }
}
return res;
var e_2, _a;
}
// Good source of info about elements and attributes
// http://dev.w3.org/html5/spec/Overview.html#semantics
// http://simon.html5.org/html-elements
// Safe Void Elements - HTML5
// http://dev.w3.org/html5/spec/Overview.html#void-elements
var VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');
// Elements that you can, intentionally, leave open (and which close themselves)
// http://dev.w3.org/html5/spec/Overview.html#optional-tags
var OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');
var OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');
var OPTIONAL_END_TAG_ELEMENTS = merge$1(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);
// Safe Block Elements - HTML5
var BLOCK_ELEMENTS = merge$1(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' +
'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +
'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));
// Inline Elements - HTML5
var INLINE_ELEMENTS = merge$1(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' +
'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +
'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));
var VALID_ELEMENTS = merge$1(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);
// Attributes that have href and hence need to be sanitized
var URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');
// Attributes that have special href set hence need to be sanitized
var SRCSET_ATTRS = tagSet('srcset');
var HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +
'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +
'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +
'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' +
'valign,value,vspace,width');
// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security
// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via
// innerHTML is required, SVG attributes should be added here.
// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those
// can be sanitized, but they increase security surface area without a legitimate use case, so they
// are left out here.
var VALID_ATTRS = merge$1(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS);
/**
* SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe
* attributes.
*/
var SanitizingHtmlSerializer = /** @class */ (function () {
function SanitizingHtmlSerializer() {
// Explicitly track if something was stripped, to avoid accidentally warning of sanitization just
// because characters were re-encoded.
this.sanitizedSomething = false;
this.buf = [];
}
SanitizingHtmlSerializer.prototype.sanitizeChildren = function (el) {
// This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.
// However this code never accesses properties off of `document` before deleting its contents
// again, so it shouldn't be vulnerable to DOM clobbering.
var current = el.firstChild;
while (current) {
if (current.nodeType === Node.ELEMENT_NODE) {
this.startElement(current);
}
else if (current.nodeType === Node.TEXT_NODE) {
this.chars(current.nodeValue);
}
else {
// Strip non-element, non-text nodes.
this.sanitizedSomething = true;
}
if (current.firstChild) {
current = current.firstChild;
continue;
}
while (current) {
// Leaving the element. Walk up and to the right, closing tags as we go.
if (current.nodeType === Node.ELEMENT_NODE) {
this.endElement(current);
}
var next = this.checkClobberedElement(current, current.nextSibling);
if (next) {
current = next;
break;
}
current = this.checkClobberedElement(current, current.parentNode);
}
}
return this.buf.join('');
};
SanitizingHtmlSerializer.prototype.startElement = function (element) {
var tagName = element.nodeName.toLowerCase();
if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {
this.sanitizedSomething = true;
return;
}
this.buf.push('<');
this.buf.push(tagName);
var elAttrs = element.attributes;
for (var i = 0; i < elAttrs.length; i++) {
var elAttr = elAttrs.item(i);
var attrName = elAttr.name;
var lower = attrName.toLowerCase();
if (!VALID_ATTRS.hasOwnProperty(lower)) {
this.sanitizedSomething = true;
continue;
}
var value = elAttr.value;
// TODO(martinprobst): Special case image URIs for data:image/...
if (URI_ATTRS[lower])
value = _sanitizeUrl(value);
if (SRCSET_ATTRS[lower])
value = sanitizeSrcset(value);
this.buf.push(' ', attrName, '="', encodeEntities(value), '"');
}
this.buf.push('>');
};
SanitizingHtmlSerializer.prototype.endElement = function (current) {
var tagName = current.nodeName.toLowerCase();
if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {
this.buf.push('</');
this.buf.push(tagName);
this.buf.push('>');
}
};
SanitizingHtmlSerializer.prototype.chars = function (chars) { this.buf.push(encodeEntities(chars)); };
SanitizingHtmlSerializer.prototype.checkClobberedElement = function (node, nextNode) {
if (nextNode &&
(node.compareDocumentPosition(nextNode) &
Node.DOCUMENT_POSITION_CONTAINED_BY) === Node.DOCUMENT_POSITION_CONTAINED_BY) {
throw new Error("Failed to sanitize html because the element is clobbered: " + node.outerHTML);
}
return nextNode;
};
return SanitizingHtmlSerializer;
}());
// Regular Expressions for parsing tags and attributes
var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
// ! to ~ is the ASCII range.
var NON_ALPHANUMERIC_REGEXP = /([^\#-~ |!])/g;
/**
* Escapes all potentially dangerous characters, so that the
* resulting string can be safely inserted into attribute or
* element text.
* @param value
*/
function encodeEntities(value) {
return value.replace(/&/g, '&amp;')
.replace(SURROGATE_PAIR_REGEXP, function (match) {
var hi = match.charCodeAt(0);
var low = match.charCodeAt(1);
return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
})
.replace(NON_ALPHANUMERIC_REGEXP, function (match) { return '&#' + match.charCodeAt(0) + ';'; })
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}
var inertBodyHelper;
/**
* Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to
* the DOM in a browser environment.
*/
function _sanitizeHtml(defaultDoc, unsafeHtmlInput) {
var inertBodyElement = null;
try {
inertBodyHelper = inertBodyHelper || new InertBodyHelper(defaultDoc);
// Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).
var unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';
inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
// mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser
// trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.
var mXSSAttempts = 5;
var parsedHtml = unsafeHtml;
do {
if (mXSSAttempts === 0) {
throw new Error('Failed to sanitize html because the input is unstable');
}
mXSSAttempts--;
unsafeHtml = parsedHtml;
parsedHtml = inertBodyElement.innerHTML;
inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
} while (unsafeHtml !== parsedHtml);
var sanitizer = new SanitizingHtmlSerializer();
var safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);
if (isDevMode() && sanitizer.sanitizedSomething) {
console.warn('WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).');
}
return safeHtml;
}
finally {
// In case anything goes wrong, clear out inertElement to reset the entire DOM structure.
if (inertBodyElement) {
var parent_1 = getTemplateContent(inertBodyElement) || inertBodyElement;
while (parent_1.firstChild) {
parent_1.removeChild(parent_1.firstChild);
}
}
}
}
function getTemplateContent(el) {
return 'content' in el /** Microsoft/TypeScript#21517 */ && isTemplateElement(el) ?
el.content :
null;
}
function isTemplateElement(el) {
return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Regular expression for safe style values.
*
* Quotes (" and ') are allowed, but a check must be done elsewhere to ensure they're balanced.
*
* ',' allows multiple values to be assigned to the same property (e.g. background-attachment or
* font-family) and hence could allow multiple values to get injected, but that should pose no risk
* of XSS.
*
* The function expression checks only for XSS safety, not for CSS validity.
*
* This regular expression was taken from the Closure sanitization library, and augmented for
* transformation values.
*/
var VALUES = '[-,."\'%_!# a-zA-Z0-9]+';
var TRANSFORMATION_FNS = '(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?';
var COLOR_FNS = '(?:rgb|hsl)a?';
var GRADIENTS = '(?:repeating-)?(?:linear|radial)-gradient';
var CSS3_FNS = '(?:calc|attr)';
var FN_ARGS = '\\([-0-9.%, #a-zA-Z]+\\)';
var SAFE_STYLE_VALUE = new RegExp("^(" + VALUES + "|" +
("(?:" + TRANSFORMATION_FNS + "|" + COLOR_FNS + "|" + GRADIENTS + "|" + CSS3_FNS + ")") +
(FN_ARGS + ")$"), 'g');
/**
* Matches a `url(...)` value with an arbitrary argument as long as it does
* not contain parentheses.
*
* The URL value still needs to be sanitized separately.
*
* `url(...)` values are a very common use case, e.g. for `background-image`. With carefully crafted
* CSS style rules, it is possible to construct an information leak with `url` values in CSS, e.g.
* by observing whether scroll bars are displayed, or character ranges used by a font face
* definition.
*
* Angular only allows binding CSS values (as opposed to entire CSS rules), so it is unlikely that
* binding a URL value without further cooperation from the page will cause an information leak, and
* if so, it is just a leak, not a full blown XSS vulnerability.
*
* Given the common use case, low likelihood of attack vector, and low impact of an attack, this
* code is permissive and allows URLs that sanitize otherwise.
*/
var URL_RE = /^url\(([^)]+)\)$/;
/**
* Checks that quotes (" and ') are properly balanced inside a string. Assumes
* that neither escape (\) nor any other character that could result in
* breaking out of a string parsing context are allowed;
* see http://www.w3.org/TR/css3-syntax/#string-token-diagram.
*
* This code was taken from the Closure sanitization library.
*/
function hasBalancedQuotes(value) {
var outsideSingle = true;
var outsideDouble = true;
for (var i = 0; i < value.length; i++) {
var c = value.charAt(i);
if (c === '\'' && outsideDouble) {
outsideSingle = !outsideSingle;
}
else if (c === '"' && outsideSingle) {
outsideDouble = !outsideDouble;
}
}
return outsideSingle && outsideDouble;
}
/**
* Sanitizes the given untrusted CSS style property value (i.e. not an entire object, just a single
* value) and returns a value that is safe to use in a browser environment.
*/
function _sanitizeStyle(value) {
value = String(value).trim(); // Make sure it's actually a string.
if (!value)
return '';
// Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for
// reasoning behind this.
var urlMatch = value.match(URL_RE);
if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||
value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {
return value; // Safe style values.
}
if (isDevMode()) {
console.warn("WARNING: sanitizing unsafe style value " + value + " (see http://g.co/ng/security#xss).");
}
return 'unsafe';
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property
* like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly
* handled.
*
* See DomSanitizer for more details on security in Angular applications.
*
*
*/
var SecurityContext;
(function (SecurityContext) {
SecurityContext[SecurityContext["NONE"] = 0] = "NONE";
SecurityContext[SecurityContext["HTML"] = 1] = "HTML";
SecurityContext[SecurityContext["STYLE"] = 2] = "STYLE";
SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT";
SecurityContext[SecurityContext["URL"] = 4] = "URL";
SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL";
})(SecurityContext || (SecurityContext = {}));
/**
* Sanitizer is used by the views to sanitize potentially dangerous values.
*
*
*/
var Sanitizer = /** @class */ (function () {
function Sanitizer() {
}
return Sanitizer;
}());
/**
* @license
* Copyright Google Inc. 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
*/
// Called before each cycle of a view's check to detect whether this is in the
// initState for which we need to call ngOnInit, ngAfterContentInit or ngAfterViewInit
// lifecycle methods. Returns true if this check cycle should call lifecycle
// methods.
function shiftInitState(view, priorInitState, newInitState) {
// Only update the InitState if we are currently in the prior state.
// For example, only move into CallingInit if we are in BeforeInit. Only
// move into CallingContentInit if we are in CallingInit. Normally this will
// always be true because of how checkCycle is called in checkAndUpdateView.
// However, if checkAndUpdateView is called recursively or if an exception is
// thrown while checkAndUpdateView is running, checkAndUpdateView starts over
// from the beginning. This ensures the state is monotonically increasing,
// terminating in the AfterInit state, which ensures the Init methods are called
// at least once and only once.
var state = view.state;
var initState = state & 1792 /* InitState_Mask */;
if (initState === priorInitState) {
view.state = (state & ~1792 /* InitState_Mask */) | newInitState;
view.initIndex = -1;
return true;
}
return initState === newInitState;
}
// Returns true if the lifecycle init method should be called for the node with
// the given init index.
function shouldCallLifecycleInitHook(view, initState, index) {
if ((view.state & 1792 /* InitState_Mask */) === initState && view.initIndex <= index) {
view.initIndex = index + 1;
return true;
}
return false;
}
/**
* Accessor for view.nodes, enforcing that every usage site stays monomorphic.
*/
function asTextData(view, index) {
return view.nodes[index];
}
/**
* Accessor for view.nodes, enforcing that every usage site stays monomorphic.
*/
function asElementData(view, index) {
return view.nodes[index];
}
/**
* Accessor for view.nodes, enforcing that every usage site stays monomorphic.
*/
function asProviderData(view, index) {
return view.nodes[index];
}
/**
* Accessor for view.nodes, enforcing that every usage site stays monomorphic.
*/
function asPureExpressionData(view, index) {
return view.nodes[index];
}
/**
* Accessor for view.nodes, enforcing that every usage site stays monomorphic.
*/
function asQueryList(view, index) {
return view.nodes[index];
}
var DebugContext = /** @class */ (function () {
function DebugContext() {
}
return DebugContext;
}());
/**
* This object is used to prevent cycles in the source files and to have a place where
* debug mode can hook it. It is lazily filled when `isDevMode` is known.
*/
var Services = {
setCurrentNode: undefined,
createRootView: undefined,
createEmbeddedView: undefined,
createComponentView: undefined,
createNgModuleRef: undefined,
overrideProvider: undefined,
overrideComponentView: undefined,
clearOverrides: undefined,
checkAndUpdateView: undefined,
checkNoChangesView: undefined,
destroyView: undefined,
resolveDep: undefined,
createDebugContext: undefined,
handleEvent: undefined,
updateDirectives: undefined,
updateRenderer: undefined,
dirtyParentQueries: undefined,
};
/**
* @license
* Copyright Google Inc. 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
*/
function expressionChangedAfterItHasBeenCheckedError(context, oldValue, currValue, isFirstCheck) {
var msg = "ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '" + oldValue + "'. Current value: '" + currValue + "'.";
if (isFirstCheck) {
msg +=
" It seems like the view has been created after its parent and its children have been dirty checked." +
" Has it been created in a change detection hook ?";
}
return viewDebugError(msg, context);
}
function viewWrappedDebugError(err, context) {
if (!(err instanceof Error)) {
// errors that are not Error instances don't have a stack,
// so it is ok to wrap them into a new Error object...
err = new Error(err.toString());
}
_addDebugContext(err, context);
return err;
}
function viewDebugError(msg, context) {
var err = new Error(msg);
_addDebugContext(err, context);
return err;
}
function _addDebugContext(err, context) {
err[ERROR_DEBUG_CONTEXT] = context;
err[ERROR_LOGGER] = context.logError.bind(context);
}
function isViewDebugError(err) {
return !!getDebugContext(err);
}
function viewDestroyedError(action) {
return new Error("ViewDestroyedError: Attempt to use a destroyed view: " + action);
}
/**
* @license
* Copyright Google Inc. 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 NOOP = function () { };
var _tokenKeyCache = new Map();
function tokenKey(token) {
var key = _tokenKeyCache.get(token);
if (!key) {
key = stringify(token) + '_' + _tokenKeyCache.size;
_tokenKeyCache.set(token, key);
}
return key;
}
function unwrapValue(view, nodeIdx, bindingIdx, value) {
if (WrappedValue.isWrapped(value)) {
value = WrappedValue.unwrap(value);
var globalBindingIdx = view.def.nodes[nodeIdx].bindingIndex + bindingIdx;
var oldValue = WrappedValue.unwrap(view.oldValues[globalBindingIdx]);
view.oldValues[globalBindingIdx] = new WrappedValue(oldValue);
}
return value;
}
var UNDEFINED_RENDERER_TYPE_ID = '$$undefined';
var EMPTY_RENDERER_TYPE_ID = '$$empty';
// Attention: this function is called as top level function.
// Putting any logic in here will destroy closure tree shaking!
function createRendererType2(values) {
return {
id: UNDEFINED_RENDERER_TYPE_ID,
styles: values.styles,
encapsulation: values.encapsulation,
data: values.data
};
}
var _renderCompCount = 0;
function resolveRendererType2(type) {
if (type && type.id === UNDEFINED_RENDERER_TYPE_ID) {
// first time we see this RendererType2. Initialize it...
var isFilled = ((type.encapsulation != null && type.encapsulation !== ViewEncapsulation.None) ||
type.styles.length || Object.keys(type.data).length);
if (isFilled) {
type.id = "c" + _renderCompCount++;
}
else {
type.id = EMPTY_RENDERER_TYPE_ID;
}
}
if (type && type.id === EMPTY_RENDERER_TYPE_ID) {
type = null;
}
return type || null;
}
function checkBinding(view, def, bindingIdx, value) {
var oldValues = view.oldValues;
if ((view.state & 2 /* FirstCheck */) ||
!looseIdentical(oldValues[def.bindingIndex + bindingIdx], value)) {
return true;
}
return false;
}
function checkAndUpdateBinding(view, def, bindingIdx, value) {
if (checkBinding(view, def, bindingIdx, value)) {
view.oldValues[def.bindingIndex + bindingIdx] = value;
return true;
}
return false;
}
function checkBindingNoChanges(view, def, bindingIdx, value) {
var oldValue = view.oldValues[def.bindingIndex + bindingIdx];
if ((view.state & 1 /* BeforeFirstCheck */) || !devModeEqual(oldValue, value)) {
var bindingName = def.bindings[bindingIdx].name;
throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, def.nodeIndex), bindingName + ": " + oldValue, bindingName + ": " + value, (view.state & 1 /* BeforeFirstCheck */) !== 0);
}
}
function markParentViewsForCheck(view) {
var currView = view;
while (currView) {
if (currView.def.flags & 2 /* OnPush */) {
currView.state |= 8 /* ChecksEnabled */;
}
currView = currView.viewContainerParent || currView.parent;
}
}
function markParentViewsForCheckProjectedViews(view, endView) {
var currView = view;
while (currView && currView !== endView) {
currView.state |= 64 /* CheckProjectedViews */;
currView = currView.viewContainerParent || currView.parent;
}
}
function dispatchEvent(view, nodeIndex, eventName, event) {
try {
var nodeDef = view.def.nodes[nodeIndex];
var startView = nodeDef.flags & 33554432 /* ComponentView */ ?
asElementData(view, nodeIndex).componentView :
view;
markParentViewsForCheck(startView);
return Services.handleEvent(view, nodeIndex, eventName, event);
}
catch (e) {
// Attention: Don't rethrow, as it would cancel Observable subscriptions!
view.root.errorHandler.handleError(e);
}
}
function declaredViewContainer(view) {
if (view.parent) {
var parentView = view.parent;
return asElementData(parentView, view.parentNodeDef.nodeIndex);
}
return null;
}
/**
* for component views, this is the host element.
* for embedded views, this is the index of the parent node
* that contains the view container.
*/
function viewParentEl(view) {
var parentView = view.parent;
if (parentView) {
return view.parentNodeDef.parent;
}
else {
return null;
}
}
function renderNode(view, def) {
switch (def.flags & 201347067 /* Types */) {
case 1 /* TypeElement */:
return asElementData(view, def.nodeIndex).renderElement;
case 2 /* TypeText */:
return asTextData(view, def.nodeIndex).renderText;
}
}
function elementEventFullName(target, name) {
return target ? target + ":" + name : name;
}
function isComponentView(view) {
return !!view.parent && !!(view.parentNodeDef.flags & 32768 /* Component */);
}
function isEmbeddedView(view) {
return !!view.parent && !(view.parentNodeDef.flags & 32768 /* Component */);
}
function filterQueryId(queryId) {
return 1 << (queryId % 32);
}
function splitMatchedQueriesDsl(matchedQueriesDsl) {
var matchedQueries = {};
var matchedQueryIds = 0;
var references = {};
if (matchedQueriesDsl) {
matchedQueriesDsl.forEach(function (_a) {
var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_a, 2), queryId = _b[0], valueType = _b[1];
if (typeof queryId === 'number') {
matchedQueries[queryId] = valueType;
matchedQueryIds |= filterQueryId(queryId);
}
else {
references[queryId] = valueType;
}
});
}
return { matchedQueries: matchedQueries, references: references, matchedQueryIds: matchedQueryIds };
}
function splitDepsDsl(deps, sourceName) {
return deps.map(function (value) {
var token;
var flags;
if (Array.isArray(value)) {
_a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(value, 2), flags = _a[0], token = _a[1];
}
else {
flags = 0 /* None */;
token = value;
}
if (token && (typeof token === 'function' || typeof token === 'object') && sourceName) {
Object.defineProperty(token, SOURCE, { value: sourceName, configurable: true });
}
return { flags: flags, token: token, tokenKey: tokenKey(token) };
var _a;
});
}
function getParentRenderElement(view, renderHost, def) {
var renderParent = def.renderParent;
if (renderParent) {
if ((renderParent.flags & 1 /* TypeElement */) === 0 ||
(renderParent.flags & 33554432 /* ComponentView */) === 0 ||
(renderParent.element.componentRendererType &&
renderParent.element.componentRendererType.encapsulation ===
ViewEncapsulation.Native)) {
// only children of non components, or children of components with native encapsulation should
// be attached.
return asElementData(view, def.renderParent.nodeIndex).renderElement;
}
}
else {
return renderHost;
}
}
var DEFINITION_CACHE = new WeakMap();
function resolveDefinition(factory) {
var value = DEFINITION_CACHE.get(factory);
if (!value) {
value = factory(function () { return NOOP; });
value.factory = factory;
DEFINITION_CACHE.set(factory, value);
}
return value;
}
function rootRenderNodes(view) {
var renderNodes = [];
visitRootRenderNodes(view, 0 /* Collect */, undefined, undefined, renderNodes);
return renderNodes;
}
function visitRootRenderNodes(view, action, parentNode, nextSibling, target) {
// We need to re-compute the parent node in case the nodes have been moved around manually
if (action === 3 /* RemoveChild */) {
parentNode = view.renderer.parentNode(renderNode(view, view.def.lastRenderRootNode));
}
visitSiblingRenderNodes(view, action, 0, view.def.nodes.length - 1, parentNode, nextSibling, target);
}
function visitSiblingRenderNodes(view, action, startIndex, endIndex, parentNode, nextSibling, target) {
for (var i = startIndex; i <= endIndex; i++) {
var nodeDef = view.def.nodes[i];
if (nodeDef.flags & (1 /* TypeElement */ | 2 /* TypeText */ | 8 /* TypeNgContent */)) {
visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target);
}
// jump to next sibling
i += nodeDef.childCount;
}
}
function visitProjectedRenderNodes(view, ngContentIndex, action, parentNode, nextSibling, target) {
var compView = view;
while (compView && !isComponentView(compView)) {
compView = compView.parent;
}
var hostView = compView.parent;
var hostElDef = viewParentEl(compView);
var startIndex = hostElDef.nodeIndex + 1;
var endIndex = hostElDef.nodeIndex + hostElDef.childCount;
for (var i = startIndex; i <= endIndex; i++) {
var nodeDef = hostView.def.nodes[i];
if (nodeDef.ngContentIndex === ngContentIndex) {
visitRenderNode(hostView, nodeDef, action, parentNode, nextSibling, target);
}
// jump to next sibling
i += nodeDef.childCount;
}
if (!hostView.parent) {
// a root view
var projectedNodes = view.root.projectableNodes[ngContentIndex];
if (projectedNodes) {
for (var i = 0; i < projectedNodes.length; i++) {
execRenderNodeAction(view, projectedNodes[i], action, parentNode, nextSibling, target);
}
}
}
}
function visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target) {
if (nodeDef.flags & 8 /* TypeNgContent */) {
visitProjectedRenderNodes(view, nodeDef.ngContent.index, action, parentNode, nextSibling, target);
}
else {
var rn = renderNode(view, nodeDef);
if (action === 3 /* RemoveChild */ && (nodeDef.flags & 33554432 /* ComponentView */) &&
(nodeDef.bindingFlags & 48 /* CatSyntheticProperty */)) {
// Note: we might need to do both actions.
if (nodeDef.bindingFlags & (16 /* SyntheticProperty */)) {
execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);
}
if (nodeDef.bindingFlags & (32 /* SyntheticHostProperty */)) {
var compView = asElementData(view, nodeDef.nodeIndex).componentView;
execRenderNodeAction(compView, rn, action, parentNode, nextSibling, target);
}
}
else {
execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);
}
if (nodeDef.flags & 16777216 /* EmbeddedViews */) {
var embeddedViews = asElementData(view, nodeDef.nodeIndex).viewContainer._embeddedViews;
for (var k = 0; k < embeddedViews.length; k++) {
visitRootRenderNodes(embeddedViews[k], action, parentNode, nextSibling, target);
}
}
if (nodeDef.flags & 1 /* TypeElement */ && !nodeDef.element.name) {
visitSiblingRenderNodes(view, action, nodeDef.nodeIndex + 1, nodeDef.nodeIndex + nodeDef.childCount, parentNode, nextSibling, target);
}
}
}
function execRenderNodeAction(view, renderNode, action, parentNode, nextSibling, target) {
var renderer = view.renderer;
switch (action) {
case 1 /* AppendChild */:
renderer.appendChild(parentNode, renderNode);
break;
case 2 /* InsertBefore */:
renderer.insertBefore(parentNode, renderNode, nextSibling);
break;
case 3 /* RemoveChild */:
renderer.removeChild(parentNode, renderNode);
break;
case 0 /* Collect */:
target.push(renderNode);
break;
}
}
var NS_PREFIX_RE = /^:([^:]+):(.+)$/;
function splitNamespace(name) {
if (name[0] === ':') {
var match = name.match(NS_PREFIX_RE);
return [match[1], match[2]];
}
return ['', name];
}
function calcBindingFlags(bindings) {
var flags = 0;
for (var i = 0; i < bindings.length; i++) {
flags |= bindings[i].flags;
}
return flags;
}
function interpolate(valueCount, constAndInterp) {
var result = '';
for (var i = 0; i < valueCount * 2; i = i + 2) {
result = result + constAndInterp[i] + _toStringWithNull(constAndInterp[i + 1]);
}
return result + constAndInterp[valueCount * 2];
}
function inlineInterpolate(valueCount, c0, a1, c1, a2, c2, a3, c3, a4, c4, a5, c5, a6, c6, a7, c7, a8, c8, a9, c9) {
switch (valueCount) {
case 1:
return c0 + _toStringWithNull(a1) + c1;
case 2:
return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2;
case 3:
return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
c3;
case 4:
return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
c3 + _toStringWithNull(a4) + c4;
case 5:
return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5;
case 6:
return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) + c6;
case 7:
return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +
c6 + _toStringWithNull(a7) + c7;
case 8:
return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +
c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8;
case 9:
return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +
c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8 + _toStringWithNull(a9) + c9;
default:
throw new Error("Does not support more than 9 expressions");
}
}
function _toStringWithNull(v) {
return v != null ? v.toString() : '';
}
var EMPTY_ARRAY$2 = [];
var EMPTY_MAP = {};
/**
* @license
* Copyright Google Inc. 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
*/
function anchorDef(flags, matchedQueriesDsl, ngContentIndex, childCount, handleEvent, templateFactory) {
flags |= 1 /* TypeElement */;
var _a = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _a.matchedQueries, references = _a.references, matchedQueryIds = _a.matchedQueryIds;
var template = templateFactory ? resolveDefinition(templateFactory) : null;
return {
// will bet set by the view definition
nodeIndex: -1,
parent: null,
renderParent: null,
bindingIndex: -1,
outputIndex: -1,
// regular values
flags: flags,
checkIndex: -1,
childFlags: 0,
directChildFlags: 0,
childMatchedQueries: 0, matchedQueries: matchedQueries, matchedQueryIds: matchedQueryIds, references: references, ngContentIndex: ngContentIndex, childCount: childCount,
bindings: [],
bindingFlags: 0,
outputs: [],
element: {
ns: null,
name: null,
attrs: null, template: template,
componentProvider: null,
componentView: null,
componentRendererType: null,
publicProviders: null,
allProviders: null,
handleEvent: handleEvent || NOOP
},
provider: null,
text: null,
query: null,
ngContent: null
};
}
function elementDef(checkIndex, flags, matchedQueriesDsl, ngContentIndex, childCount, namespaceAndName, fixedAttrs, bindings, outputs, handleEvent, componentView, componentRendererType) {
if (fixedAttrs === void 0) { fixedAttrs = []; }
if (!handleEvent) {
handleEvent = NOOP;
}
var _a = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _a.matchedQueries, references = _a.references, matchedQueryIds = _a.matchedQueryIds;
var ns = null;
var name = null;
if (namespaceAndName) {
_b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(splitNamespace(namespaceAndName), 2), ns = _b[0], name = _b[1];
}
bindings = bindings || [];
var bindingDefs = new Array(bindings.length);
for (var i = 0; i < bindings.length; i++) {
var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(bindings[i], 3), bindingFlags = _c[0], namespaceAndName_1 = _c[1], suffixOrSecurityContext = _c[2];
var _d = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(splitNamespace(namespaceAndName_1), 2), ns_1 = _d[0], name_1 = _d[1];
var securityContext = undefined;
var suffix = undefined;
switch (bindingFlags & 15 /* Types */) {
case 4 /* TypeElementStyle */:
suffix = suffixOrSecurityContext;
break;
case 1 /* TypeElementAttribute */:
case 8 /* TypeProperty */:
securityContext = suffixOrSecurityContext;
break;
}
bindingDefs[i] =
{ flags: bindingFlags, ns: ns_1, name: name_1, nonMinifiedName: name_1, securityContext: securityContext, suffix: suffix };
}
outputs = outputs || [];
var outputDefs = new Array(outputs.length);
for (var i = 0; i < outputs.length; i++) {
var _e = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(outputs[i], 2), target = _e[0], eventName = _e[1];
outputDefs[i] = {
type: 0 /* ElementOutput */,
target: target, eventName: eventName,
propName: null
};
}
fixedAttrs = fixedAttrs || [];
var attrs = fixedAttrs.map(function (_a) {
var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_a, 2), namespaceAndName = _b[0], value = _b[1];
var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(splitNamespace(namespaceAndName), 2), ns = _c[0], name = _c[1];
return [ns, name, value];
});
componentRendererType = resolveRendererType2(componentRendererType);
if (componentView) {
flags |= 33554432 /* ComponentView */;
}
flags |= 1 /* TypeElement */;
return {
// will bet set by the view definition
nodeIndex: -1,
parent: null,
renderParent: null,
bindingIndex: -1,
outputIndex: -1,
// regular values
checkIndex: checkIndex,
flags: flags,
childFlags: 0,
directChildFlags: 0,
childMatchedQueries: 0, matchedQueries: matchedQueries, matchedQueryIds: matchedQueryIds, references: references, ngContentIndex: ngContentIndex, childCount: childCount,
bindings: bindingDefs,
bindingFlags: calcBindingFlags(bindingDefs),
outputs: outputDefs,
element: {
ns: ns,
name: name,
attrs: attrs,
template: null,
// will bet set by the view definition
componentProvider: null,
componentView: componentView || null,
componentRendererType: componentRendererType,
publicProviders: null,
allProviders: null,
handleEvent: handleEvent || NOOP,
},
provider: null,
text: null,
query: null,
ngContent: null
};
var _b;
}
function createElement(view, renderHost, def) {
var elDef = def.element;
var rootSelectorOrNode = view.root.selectorOrNode;
var renderer = view.renderer;
var el;
if (view.parent || !rootSelectorOrNode) {
if (elDef.name) {
el = renderer.createElement(elDef.name, elDef.ns);
}
else {
el = renderer.createComment('');
}
var parentEl = getParentRenderElement(view, renderHost, def);
if (parentEl) {
renderer.appendChild(parentEl, el);
}
}
else {
el = renderer.selectRootElement(rootSelectorOrNode);
}
if (elDef.attrs) {
for (var i = 0; i < elDef.attrs.length; i++) {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(elDef.attrs[i], 3), ns = _a[0], name_2 = _a[1], value = _a[2];
renderer.setAttribute(el, name_2, value, ns);
}
}
return el;
}
function listenToElementOutputs(view, compView, def, el) {
for (var i = 0; i < def.outputs.length; i++) {
var output = def.outputs[i];
var handleEventClosure = renderEventHandlerClosure(view, def.nodeIndex, elementEventFullName(output.target, output.eventName));
var listenTarget = output.target;
var listenerView = view;
if (output.target === 'component') {
listenTarget = null;
listenerView = compView;
}
var disposable = listenerView.renderer.listen(listenTarget || el, output.eventName, handleEventClosure);
view.disposables[def.outputIndex + i] = disposable;
}
}
function renderEventHandlerClosure(view, index, eventName) {
return function (event) { return dispatchEvent(view, index, eventName, event); };
}
function checkAndUpdateElementInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
var bindLen = def.bindings.length;
var changed = false;
if (bindLen > 0 && checkAndUpdateElementValue(view, def, 0, v0))
changed = true;
if (bindLen > 1 && checkAndUpdateElementValue(view, def, 1, v1))
changed = true;
if (bindLen > 2 && checkAndUpdateElementValue(view, def, 2, v2))
changed = true;
if (bindLen > 3 && checkAndUpdateElementValue(view, def, 3, v3))
changed = true;
if (bindLen > 4 && checkAndUpdateElementValue(view, def, 4, v4))
changed = true;
if (bindLen > 5 && checkAndUpdateElementValue(view, def, 5, v5))
changed = true;
if (bindLen > 6 && checkAndUpdateElementValue(view, def, 6, v6))
changed = true;
if (bindLen > 7 && checkAndUpdateElementValue(view, def, 7, v7))
changed = true;
if (bindLen > 8 && checkAndUpdateElementValue(view, def, 8, v8))
changed = true;
if (bindLen > 9 && checkAndUpdateElementValue(view, def, 9, v9))
changed = true;
return changed;
}
function checkAndUpdateElementDynamic(view, def, values) {
var changed = false;
for (var i = 0; i < values.length; i++) {
if (checkAndUpdateElementValue(view, def, i, values[i]))
changed = true;
}
return changed;
}
function checkAndUpdateElementValue(view, def, bindingIdx, value) {
if (!checkAndUpdateBinding(view, def, bindingIdx, value)) {
return false;
}
var binding = def.bindings[bindingIdx];
var elData = asElementData(view, def.nodeIndex);
var renderNode$$1 = elData.renderElement;
var name = binding.name;
switch (binding.flags & 15 /* Types */) {
case 1 /* TypeElementAttribute */:
setElementAttribute(view, binding, renderNode$$1, binding.ns, name, value);
break;
case 2 /* TypeElementClass */:
setElementClass(view, renderNode$$1, name, value);
break;
case 4 /* TypeElementStyle */:
setElementStyle(view, binding, renderNode$$1, name, value);
break;
case 8 /* TypeProperty */:
var bindView = (def.flags & 33554432 /* ComponentView */ &&
binding.flags & 32 /* SyntheticHostProperty */) ?
elData.componentView :
view;
setElementProperty(bindView, binding, renderNode$$1, name, value);
break;
}
return true;
}
function setElementAttribute(view, binding, renderNode$$1, ns, name, value) {
var securityContext = binding.securityContext;
var renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;
renderValue = renderValue != null ? renderValue.toString() : null;
var renderer = view.renderer;
if (value != null) {
renderer.setAttribute(renderNode$$1, name, renderValue, ns);
}
else {
renderer.removeAttribute(renderNode$$1, name, ns);
}
}
function setElementClass(view, renderNode$$1, name, value) {
var renderer = view.renderer;
if (value) {
renderer.addClass(renderNode$$1, name);
}
else {
renderer.removeClass(renderNode$$1, name);
}
}
function setElementStyle(view, binding, renderNode$$1, name, value) {
var renderValue = view.root.sanitizer.sanitize(SecurityContext.STYLE, value);
if (renderValue != null) {
renderValue = renderValue.toString();
var unit = binding.suffix;
if (unit != null) {
renderValue = renderValue + unit;
}
}
else {
renderValue = null;
}
var renderer = view.renderer;
if (renderValue != null) {
renderer.setStyle(renderNode$$1, name, renderValue);
}
else {
renderer.removeStyle(renderNode$$1, name);
}
}
function setElementProperty(view, binding, renderNode$$1, name, value) {
var securityContext = binding.securityContext;
var renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;
view.renderer.setProperty(renderNode$$1, name, renderValue);
}
/**
* @license
* Copyright Google Inc. 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 UNDEFINED_VALUE = new Object();
var InjectorRefTokenKey = tokenKey(Injector);
var INJECTORRefTokenKey = tokenKey(INJECTOR);
var NgModuleRefTokenKey = tokenKey(NgModuleRef);
function moduleProvideDef(flags, token, value, deps) {
// Need to resolve forwardRefs as e.g. for `useValue` we
// lowered the expression and then stopped evaluating it,
// i.e. also didn't unwrap it.
value = resolveForwardRef(value);
var depDefs = splitDepsDsl(deps, stringify(token));
return {
// will bet set by the module definition
index: -1,
deps: depDefs, flags: flags, token: token, value: value
};
}
function moduleDef(providers) {
var providersByKey = {};
var modules = [];
var isRoot = false;
for (var i = 0; i < providers.length; i++) {
var provider = providers[i];
if (provider.token === APP_ROOT) {
isRoot = true;
}
if (provider.flags & 1073741824 /* TypeNgModule */) {
modules.push(provider.token);
}
provider.index = i;
providersByKey[tokenKey(provider.token)] = provider;
}
return {
// Will be filled later...
factory: null,
providersByKey: providersByKey,
providers: providers,
modules: modules,
isRoot: isRoot,
};
}
function initNgModule(data) {
var def = data._def;
var providers = data._providers = new Array(def.providers.length);
for (var i = 0; i < def.providers.length; i++) {
var provDef = def.providers[i];
if (!(provDef.flags & 4096 /* LazyProvider */)) {
// Make sure the provider has not been already initialized outside this loop.
if (providers[i] === undefined) {
providers[i] = _createProviderInstance(data, provDef);
}
}
}
}
function resolveNgModuleDep(data, depDef, notFoundValue) {
if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }
var former = setCurrentInjector(data);
try {
if (depDef.flags & 8 /* Value */) {
return depDef.token;
}
if (depDef.flags & 2 /* Optional */) {
notFoundValue = null;
}
if (depDef.flags & 1 /* SkipSelf */) {
return data._parent.get(depDef.token, notFoundValue);
}
var tokenKey_1 = depDef.tokenKey;
switch (tokenKey_1) {
case InjectorRefTokenKey:
case INJECTORRefTokenKey:
case NgModuleRefTokenKey:
return data;
}
var providerDef = data._def.providersByKey[tokenKey_1];
if (providerDef) {
var providerInstance = data._providers[providerDef.index];
if (providerInstance === undefined) {
providerInstance = data._providers[providerDef.index] =
_createProviderInstance(data, providerDef);
}
return providerInstance === UNDEFINED_VALUE ? undefined : providerInstance;
}
else if (depDef.token.ngInjectableDef && targetsModule(data, depDef.token.ngInjectableDef)) {
var injectableDef = depDef.token.ngInjectableDef;
var index = data._providers.length;
data._def.providersByKey[depDef.tokenKey] = {
flags: 1024 /* TypeFactoryProvider */ | 4096 /* LazyProvider */,
value: injectableDef.factory,
deps: [], index: index,
token: depDef.token,
};
data._providers[index] = UNDEFINED_VALUE;
return (data._providers[index] =
_createProviderInstance(data, data._def.providersByKey[depDef.tokenKey]));
}
else if (depDef.flags & 4 /* Self */) {
return notFoundValue;
}
return data._parent.get(depDef.token, notFoundValue);
}
finally {
setCurrentInjector(former);
}
}
function moduleTransitivelyPresent(ngModule, scope) {
return ngModule._def.modules.indexOf(scope) > -1;
}
function targetsModule(ngModule, def) {
return def.providedIn != null && (moduleTransitivelyPresent(ngModule, def.providedIn) ||
def.providedIn === 'root' && ngModule._def.isRoot);
}
function _createProviderInstance(ngModule, providerDef) {
var injectable;
switch (providerDef.flags & 201347067 /* Types */) {
case 512 /* TypeClassProvider */:
injectable = _createClass(ngModule, providerDef.value, providerDef.deps);
break;
case 1024 /* TypeFactoryProvider */:
injectable = _callFactory(ngModule, providerDef.value, providerDef.deps);
break;
case 2048 /* TypeUseExistingProvider */:
injectable = resolveNgModuleDep(ngModule, providerDef.deps[0]);
break;
case 256 /* TypeValueProvider */:
injectable = providerDef.value;
break;
}
// The read of `ngOnDestroy` here is slightly expensive as it's megamorphic, so it should be
// avoided if possible. The sequence of checks here determines whether ngOnDestroy needs to be
// checked. It might not if the `injectable` isn't an object or if NodeFlags.OnDestroy is already
// set (ngOnDestroy was detected statically).
if (injectable !== UNDEFINED_VALUE && injectable != null && typeof injectable === 'object' &&
!(providerDef.flags & 131072 /* OnDestroy */) && typeof injectable.ngOnDestroy === 'function') {
providerDef.flags |= 131072 /* OnDestroy */;
}
return injectable === undefined ? UNDEFINED_VALUE : injectable;
}
function _createClass(ngModule, ctor, deps) {
var len = deps.length;
switch (len) {
case 0:
return new ctor();
case 1:
return new ctor(resolveNgModuleDep(ngModule, deps[0]));
case 2:
return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));
case 3:
return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]), resolveNgModuleDep(ngModule, deps[2]));
default:
var depValues = new Array(len);
for (var i = 0; i < len; i++) {
depValues[i] = resolveNgModuleDep(ngModule, deps[i]);
}
return new (ctor.bind.apply(ctor, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], depValues)))();
}
}
function _callFactory(ngModule, factory, deps) {
var len = deps.length;
switch (len) {
case 0:
return factory();
case 1:
return factory(resolveNgModuleDep(ngModule, deps[0]));
case 2:
return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));
case 3:
return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]), resolveNgModuleDep(ngModule, deps[2]));
default:
var depValues = Array(len);
for (var i = 0; i < len; i++) {
depValues[i] = resolveNgModuleDep(ngModule, deps[i]);
}
return factory.apply(void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(depValues));
}
}
function callNgModuleLifecycle(ngModule, lifecycles) {
var def = ngModule._def;
var destroyed = new Set();
for (var i = 0; i < def.providers.length; i++) {
var provDef = def.providers[i];
if (provDef.flags & 131072 /* OnDestroy */) {
var instance = ngModule._providers[i];
if (instance && instance !== UNDEFINED_VALUE) {
var onDestroy = instance.ngOnDestroy;
if (typeof onDestroy === 'function' && !destroyed.has(instance)) {
onDestroy.apply(instance);
destroyed.add(instance);
}
}
}
}
}
/**
* @license
* Copyright Google Inc. 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
*/
function attachEmbeddedView(parentView, elementData, viewIndex, view) {
var embeddedViews = elementData.viewContainer._embeddedViews;
if (viewIndex === null || viewIndex === undefined) {
viewIndex = embeddedViews.length;
}
view.viewContainerParent = parentView;
addToArray(embeddedViews, viewIndex, view);
attachProjectedView(elementData, view);
Services.dirtyParentQueries(view);
var prevView = viewIndex > 0 ? embeddedViews[viewIndex - 1] : null;
renderAttachEmbeddedView(elementData, prevView, view);
}
function attachProjectedView(vcElementData, view) {
var dvcElementData = declaredViewContainer(view);
if (!dvcElementData || dvcElementData === vcElementData ||
view.state & 16 /* IsProjectedView */) {
return;
}
// Note: For performance reasons, we
// - add a view to template._projectedViews only 1x throughout its lifetime,
// and remove it not until the view is destroyed.
// (hard, as when a parent view is attached/detached we would need to attach/detach all
// nested projected views as well, even across component boundaries).
// - don't track the insertion order of views in the projected views array
// (hard, as when the views of the same template are inserted different view containers)
view.state |= 16 /* IsProjectedView */;
var projectedViews = dvcElementData.template._projectedViews;
if (!projectedViews) {
projectedViews = dvcElementData.template._projectedViews = [];
}
projectedViews.push(view);
// Note: we are changing the NodeDef here as we cannot calculate
// the fact whether a template is used for projection during compilation.
markNodeAsProjectedTemplate(view.parent.def, view.parentNodeDef);
}
function markNodeAsProjectedTemplate(viewDef, nodeDef) {
if (nodeDef.flags & 4 /* ProjectedTemplate */) {
return;
}
viewDef.nodeFlags |= 4 /* ProjectedTemplate */;
nodeDef.flags |= 4 /* ProjectedTemplate */;
var parentNodeDef = nodeDef.parent;
while (parentNodeDef) {
parentNodeDef.childFlags |= 4 /* ProjectedTemplate */;
parentNodeDef = parentNodeDef.parent;
}
}
function detachEmbeddedView(elementData, viewIndex) {
var embeddedViews = elementData.viewContainer._embeddedViews;
if (viewIndex == null || viewIndex >= embeddedViews.length) {
viewIndex = embeddedViews.length - 1;
}
if (viewIndex < 0) {
return null;
}
var view = embeddedViews[viewIndex];
view.viewContainerParent = null;
removeFromArray(embeddedViews, viewIndex);
// See attachProjectedView for why we don't update projectedViews here.
Services.dirtyParentQueries(view);
renderDetachView(view);
return view;
}
function detachProjectedView(view) {
if (!(view.state & 16 /* IsProjectedView */)) {
return;
}
var dvcElementData = declaredViewContainer(view);
if (dvcElementData) {
var projectedViews = dvcElementData.template._projectedViews;
if (projectedViews) {
removeFromArray(projectedViews, projectedViews.indexOf(view));
Services.dirtyParentQueries(view);
}
}
}
function moveEmbeddedView(elementData, oldViewIndex, newViewIndex) {
var embeddedViews = elementData.viewContainer._embeddedViews;
var view = embeddedViews[oldViewIndex];
removeFromArray(embeddedViews, oldViewIndex);
if (newViewIndex == null) {
newViewIndex = embeddedViews.length;
}
addToArray(embeddedViews, newViewIndex, view);
// Note: Don't need to change projectedViews as the order in there
// as always invalid...
Services.dirtyParentQueries(view);
renderDetachView(view);
var prevView = newViewIndex > 0 ? embeddedViews[newViewIndex - 1] : null;
renderAttachEmbeddedView(elementData, prevView, view);
return view;
}
function renderAttachEmbeddedView(elementData, prevView, view) {
var prevRenderNode = prevView ? renderNode(prevView, prevView.def.lastRenderRootNode) :
elementData.renderElement;
var parentNode = view.renderer.parentNode(prevRenderNode);
var nextSibling = view.renderer.nextSibling(prevRenderNode);
// Note: We can't check if `nextSibling` is present, as on WebWorkers it will always be!
// However, browsers automatically do `appendChild` when there is no `nextSibling`.
visitRootRenderNodes(view, 2 /* InsertBefore */, parentNode, nextSibling, undefined);
}
function renderDetachView(view) {
visitRootRenderNodes(view, 3 /* RemoveChild */, null, null, undefined);
}
function addToArray(arr, index, value) {
// perf: array.push is faster than array.splice!
if (index >= arr.length) {
arr.push(value);
}
else {
arr.splice(index, 0, value);
}
}
function removeFromArray(arr, index) {
// perf: array.pop is faster than array.splice!
if (index >= arr.length - 1) {
arr.pop();
}
else {
arr.splice(index, 1);
}
}
/**
* @license
* Copyright Google Inc. 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 EMPTY_CONTEXT = new Object();
// Attention: this function is called as top level function.
// Putting any logic in here will destroy closure tree shaking!
function createComponentFactory(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors) {
return new ComponentFactory_(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors);
}
function getComponentViewDefinitionFactory(componentFactory) {
return componentFactory.viewDefFactory;
}
var ComponentFactory_ = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ComponentFactory_, _super);
function ComponentFactory_(selector, componentType, viewDefFactory, _inputs, _outputs, ngContentSelectors) {
var _this =
// Attention: this ctor is called as top level function.
// Putting any logic in here will destroy closure tree shaking!
_super.call(this) || this;
_this.selector = selector;
_this.componentType = componentType;
_this._inputs = _inputs;
_this._outputs = _outputs;
_this.ngContentSelectors = ngContentSelectors;
_this.viewDefFactory = viewDefFactory;
return _this;
}
Object.defineProperty(ComponentFactory_.prototype, "inputs", {
get: function () {
var inputsArr = [];
var inputs = this._inputs;
for (var propName in inputs) {
var templateName = inputs[propName];
inputsArr.push({ propName: propName, templateName: templateName });
}
return inputsArr;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ComponentFactory_.prototype, "outputs", {
get: function () {
var outputsArr = [];
for (var propName in this._outputs) {
var templateName = this._outputs[propName];
outputsArr.push({ propName: propName, templateName: templateName });
}
return outputsArr;
},
enumerable: true,
configurable: true
});
/**
* Creates a new component.
*/
ComponentFactory_.prototype.create = function (injector, projectableNodes, rootSelectorOrNode, ngModule) {
if (!ngModule) {
throw new Error('ngModule should be provided');
}
var viewDef = resolveDefinition(this.viewDefFactory);
var componentNodeIndex = viewDef.nodes[0].element.componentProvider.nodeIndex;
var view = Services.createRootView(injector, projectableNodes || [], rootSelectorOrNode, viewDef, ngModule, EMPTY_CONTEXT);
var component = asProviderData(view, componentNodeIndex).instance;
if (rootSelectorOrNode) {
view.renderer.setAttribute(asElementData(view, 0).renderElement, 'ng-version', VERSION.full);
}
return new ComponentRef_(view, new ViewRef_(view), component);
};
return ComponentFactory_;
}(ComponentFactory));
var ComponentRef_ = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ComponentRef_, _super);
function ComponentRef_(_view, _viewRef, _component) {
var _this = _super.call(this) || this;
_this._view = _view;
_this._viewRef = _viewRef;
_this._component = _component;
_this._elDef = _this._view.def.nodes[0];
_this.hostView = _viewRef;
_this.changeDetectorRef = _viewRef;
_this.instance = _component;
return _this;
}
Object.defineProperty(ComponentRef_.prototype, "location", {
get: function () {
return new ElementRef(asElementData(this._view, this._elDef.nodeIndex).renderElement);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ComponentRef_.prototype, "injector", {
get: function () { return new Injector_(this._view, this._elDef); },
enumerable: true,
configurable: true
});
Object.defineProperty(ComponentRef_.prototype, "componentType", {
get: function () { return this._component.constructor; },
enumerable: true,
configurable: true
});
ComponentRef_.prototype.destroy = function () { this._viewRef.destroy(); };
ComponentRef_.prototype.onDestroy = function (callback) { this._viewRef.onDestroy(callback); };
return ComponentRef_;
}(ComponentRef));
function createViewContainerData(view, elDef, elData) {
return new ViewContainerRef_(view, elDef, elData);
}
var ViewContainerRef_ = /** @class */ (function () {
function ViewContainerRef_(_view, _elDef, _data) {
this._view = _view;
this._elDef = _elDef;
this._data = _data;
/**
* @internal
*/
this._embeddedViews = [];
}
Object.defineProperty(ViewContainerRef_.prototype, "element", {
get: function () { return new ElementRef(this._data.renderElement); },
enumerable: true,
configurable: true
});
Object.defineProperty(ViewContainerRef_.prototype, "injector", {
get: function () { return new Injector_(this._view, this._elDef); },
enumerable: true,
configurable: true
});
Object.defineProperty(ViewContainerRef_.prototype, "parentInjector", {
get: function () {
var view = this._view;
var elDef = this._elDef.parent;
while (!elDef && view) {
elDef = viewParentEl(view);
view = view.parent;
}
return view ? new Injector_(view, elDef) : new Injector_(this._view, null);
},
enumerable: true,
configurable: true
});
ViewContainerRef_.prototype.clear = function () {
var len = this._embeddedViews.length;
for (var i = len - 1; i >= 0; i--) {
var view = detachEmbeddedView(this._data, i);
Services.destroyView(view);
}
};
ViewContainerRef_.prototype.get = function (index) {
var view = this._embeddedViews[index];
if (view) {
var ref = new ViewRef_(view);
ref.attachToViewContainerRef(this);
return ref;
}
return null;
};
Object.defineProperty(ViewContainerRef_.prototype, "length", {
get: function () { return this._embeddedViews.length; },
enumerable: true,
configurable: true
});
ViewContainerRef_.prototype.createEmbeddedView = function (templateRef, context, index) {
var viewRef = templateRef.createEmbeddedView(context || {});
this.insert(viewRef, index);
return viewRef;
};
ViewContainerRef_.prototype.createComponent = function (componentFactory, index, injector, projectableNodes, ngModuleRef) {
var contextInjector = injector || this.parentInjector;
if (!ngModuleRef && !(componentFactory instanceof ComponentFactoryBoundToModule)) {
ngModuleRef = contextInjector.get(NgModuleRef);
}
var componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);
this.insert(componentRef.hostView, index);
return componentRef;
};
ViewContainerRef_.prototype.insert = function (viewRef, index) {
if (viewRef.destroyed) {
throw new Error('Cannot insert a destroyed View in a ViewContainer!');
}
var viewRef_ = viewRef;
var viewData = viewRef_._view;
attachEmbeddedView(this._view, this._data, index, viewData);
viewRef_.attachToViewContainerRef(this);
return viewRef;
};
ViewContainerRef_.prototype.move = function (viewRef, currentIndex) {
if (viewRef.destroyed) {
throw new Error('Cannot move a destroyed View in a ViewContainer!');
}
var previousIndex = this._embeddedViews.indexOf(viewRef._view);
moveEmbeddedView(this._data, previousIndex, currentIndex);
return viewRef;
};
ViewContainerRef_.prototype.indexOf = function (viewRef) {
return this._embeddedViews.indexOf(viewRef._view);
};
ViewContainerRef_.prototype.remove = function (index) {
var viewData = detachEmbeddedView(this._data, index);
if (viewData) {
Services.destroyView(viewData);
}
};
ViewContainerRef_.prototype.detach = function (index) {
var view = detachEmbeddedView(this._data, index);
return view ? new ViewRef_(view) : null;
};
return ViewContainerRef_;
}());
function createChangeDetectorRef(view) {
return new ViewRef_(view);
}
var ViewRef_ = /** @class */ (function () {
function ViewRef_(_view) {
this._view = _view;
this._viewContainerRef = null;
this._appRef = null;
}
Object.defineProperty(ViewRef_.prototype, "rootNodes", {
get: function () { return rootRenderNodes(this._view); },
enumerable: true,
configurable: true
});
Object.defineProperty(ViewRef_.prototype, "context", {
get: function () { return this._view.context; },
enumerable: true,
configurable: true
});
Object.defineProperty(ViewRef_.prototype, "destroyed", {
get: function () { return (this._view.state & 128 /* Destroyed */) !== 0; },
enumerable: true,
configurable: true
});
ViewRef_.prototype.markForCheck = function () { markParentViewsForCheck(this._view); };
ViewRef_.prototype.detach = function () { this._view.state &= ~4 /* Attached */; };
ViewRef_.prototype.detectChanges = function () {
var fs = this._view.root.rendererFactory;
if (fs.begin) {
fs.begin();
}
try {
Services.checkAndUpdateView(this._view);
}
finally {
if (fs.end) {
fs.end();
}
}
};
ViewRef_.prototype.checkNoChanges = function () { Services.checkNoChangesView(this._view); };
ViewRef_.prototype.reattach = function () { this._view.state |= 4 /* Attached */; };
ViewRef_.prototype.onDestroy = function (callback) {
if (!this._view.disposables) {
this._view.disposables = [];
}
this._view.disposables.push(callback);
};
ViewRef_.prototype.destroy = function () {
if (this._appRef) {
this._appRef.detachView(this);
}
else if (this._viewContainerRef) {
this._viewContainerRef.detach(this._viewContainerRef.indexOf(this));
}
Services.destroyView(this._view);
};
ViewRef_.prototype.detachFromAppRef = function () {
this._appRef = null;
renderDetachView(this._view);
Services.dirtyParentQueries(this._view);
};
ViewRef_.prototype.attachToAppRef = function (appRef) {
if (this._viewContainerRef) {
throw new Error('This view is already attached to a ViewContainer!');
}
this._appRef = appRef;
};
ViewRef_.prototype.attachToViewContainerRef = function (vcRef) {
if (this._appRef) {
throw new Error('This view is already attached directly to the ApplicationRef!');
}
this._viewContainerRef = vcRef;
};
return ViewRef_;
}());
function createTemplateData(view, def) {
return new TemplateRef_(view, def);
}
var TemplateRef_ = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TemplateRef_, _super);
function TemplateRef_(_parentView, _def) {
var _this = _super.call(this) || this;
_this._parentView = _parentView;
_this._def = _def;
return _this;
}
TemplateRef_.prototype.createEmbeddedView = function (context) {
return new ViewRef_(Services.createEmbeddedView(this._parentView, this._def, this._def.element.template, context));
};
Object.defineProperty(TemplateRef_.prototype, "elementRef", {
get: function () {
return new ElementRef(asElementData(this._parentView, this._def.nodeIndex).renderElement);
},
enumerable: true,
configurable: true
});
return TemplateRef_;
}(TemplateRef));
function createInjector$1(view, elDef) {
return new Injector_(view, elDef);
}
var Injector_ = /** @class */ (function () {
function Injector_(view, elDef) {
this.view = view;
this.elDef = elDef;
}
Injector_.prototype.get = function (token, notFoundValue) {
if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }
var allowPrivateServices = this.elDef ? (this.elDef.flags & 33554432 /* ComponentView */) !== 0 : false;
return Services.resolveDep(this.view, this.elDef, allowPrivateServices, { flags: 0 /* None */, token: token, tokenKey: tokenKey(token) }, notFoundValue);
};
return Injector_;
}());
function nodeValue(view, index) {
var def = view.def.nodes[index];
if (def.flags & 1 /* TypeElement */) {
var elData = asElementData(view, def.nodeIndex);
return def.element.template ? elData.template : elData.renderElement;
}
else if (def.flags & 2 /* TypeText */) {
return asTextData(view, def.nodeIndex).renderText;
}
else if (def.flags & (20224 /* CatProvider */ | 16 /* TypePipe */)) {
return asProviderData(view, def.nodeIndex).instance;
}
throw new Error("Illegal state: read nodeValue for node index " + index);
}
function createRendererV1(view) {
return new RendererAdapter(view.renderer);
}
var RendererAdapter = /** @class */ (function () {
function RendererAdapter(delegate) {
this.delegate = delegate;
}
RendererAdapter.prototype.selectRootElement = function (selectorOrNode) {
return this.delegate.selectRootElement(selectorOrNode);
};
RendererAdapter.prototype.createElement = function (parent, namespaceAndName) {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(splitNamespace(namespaceAndName), 2), ns = _a[0], name = _a[1];
var el = this.delegate.createElement(name, ns);
if (parent) {
this.delegate.appendChild(parent, el);
}
return el;
};
RendererAdapter.prototype.createViewRoot = function (hostElement) { return hostElement; };
RendererAdapter.prototype.createTemplateAnchor = function (parentElement) {
var comment = this.delegate.createComment('');
if (parentElement) {
this.delegate.appendChild(parentElement, comment);
}
return comment;
};
RendererAdapter.prototype.createText = function (parentElement, value) {
var node = this.delegate.createText(value);
if (parentElement) {
this.delegate.appendChild(parentElement, node);
}
return node;
};
RendererAdapter.prototype.projectNodes = function (parentElement, nodes) {
for (var i = 0; i < nodes.length; i++) {
this.delegate.appendChild(parentElement, nodes[i]);
}
};
RendererAdapter.prototype.attachViewAfter = function (node, viewRootNodes) {
var parentElement = this.delegate.parentNode(node);
var nextSibling = this.delegate.nextSibling(node);
for (var i = 0; i < viewRootNodes.length; i++) {
this.delegate.insertBefore(parentElement, viewRootNodes[i], nextSibling);
}
};
RendererAdapter.prototype.detachView = function (viewRootNodes) {
for (var i = 0; i < viewRootNodes.length; i++) {
var node = viewRootNodes[i];
var parentElement = this.delegate.parentNode(node);
this.delegate.removeChild(parentElement, node);
}
};
RendererAdapter.prototype.destroyView = function (hostElement, viewAllNodes) {
for (var i = 0; i < viewAllNodes.length; i++) {
this.delegate.destroyNode(viewAllNodes[i]);
}
};
RendererAdapter.prototype.listen = function (renderElement, name, callback) {
return this.delegate.listen(renderElement, name, callback);
};
RendererAdapter.prototype.listenGlobal = function (target, name, callback) {
return this.delegate.listen(target, name, callback);
};
RendererAdapter.prototype.setElementProperty = function (renderElement, propertyName, propertyValue) {
this.delegate.setProperty(renderElement, propertyName, propertyValue);
};
RendererAdapter.prototype.setElementAttribute = function (renderElement, namespaceAndName, attributeValue) {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(splitNamespace(namespaceAndName), 2), ns = _a[0], name = _a[1];
if (attributeValue != null) {
this.delegate.setAttribute(renderElement, name, attributeValue, ns);
}
else {
this.delegate.removeAttribute(renderElement, name, ns);
}
};
RendererAdapter.prototype.setBindingDebugInfo = function (renderElement, propertyName, propertyValue) { };
RendererAdapter.prototype.setElementClass = function (renderElement, className, isAdd) {
if (isAdd) {
this.delegate.addClass(renderElement, className);
}
else {
this.delegate.removeClass(renderElement, className);
}
};
RendererAdapter.prototype.setElementStyle = function (renderElement, styleName, styleValue) {
if (styleValue != null) {
this.delegate.setStyle(renderElement, styleName, styleValue);
}
else {
this.delegate.removeStyle(renderElement, styleName);
}
};
RendererAdapter.prototype.invokeElementMethod = function (renderElement, methodName, args) {
renderElement[methodName].apply(renderElement, args);
};
RendererAdapter.prototype.setText = function (renderNode$$1, text) { this.delegate.setValue(renderNode$$1, text); };
RendererAdapter.prototype.animate = function () { throw new Error('Renderer.animate is no longer supported!'); };
return RendererAdapter;
}());
function createNgModuleRef(moduleType, parent, bootstrapComponents, def) {
return new NgModuleRef_(moduleType, parent, bootstrapComponents, def);
}
var NgModuleRef_ = /** @class */ (function () {
function NgModuleRef_(_moduleType, _parent, _bootstrapComponents, _def) {
this._moduleType = _moduleType;
this._parent = _parent;
this._bootstrapComponents = _bootstrapComponents;
this._def = _def;
this._destroyListeners = [];
this._destroyed = false;
this.injector = this;
initNgModule(this);
}
NgModuleRef_.prototype.get = function (token, notFoundValue, injectFlags) {
if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }
if (injectFlags === void 0) { injectFlags = 0 /* Default */; }
var flags = 0 /* None */;
if (injectFlags & 4 /* SkipSelf */) {
flags |= 1 /* SkipSelf */;
}
else if (injectFlags & 2 /* Self */) {
flags |= 4 /* Self */;
}
return resolveNgModuleDep(this, { token: token, tokenKey: tokenKey(token), flags: flags }, notFoundValue);
};
Object.defineProperty(NgModuleRef_.prototype, "instance", {
get: function () { return this.get(this._moduleType); },
enumerable: true,
configurable: true
});
Object.defineProperty(NgModuleRef_.prototype, "componentFactoryResolver", {
get: function () { return this.get(ComponentFactoryResolver); },
enumerable: true,
configurable: true
});
NgModuleRef_.prototype.destroy = function () {
if (this._destroyed) {
throw new Error("The ng module " + stringify(this.instance.constructor) + " has already been destroyed.");
}
this._destroyed = true;
callNgModuleLifecycle(this, 131072 /* OnDestroy */);
this._destroyListeners.forEach(function (listener) { return listener(); });
};
NgModuleRef_.prototype.onDestroy = function (callback) { this._destroyListeners.push(callback); };
return NgModuleRef_;
}());
/**
* @license
* Copyright Google Inc. 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 RendererV1TokenKey = tokenKey(Renderer);
var Renderer2TokenKey = tokenKey(Renderer2);
var ElementRefTokenKey = tokenKey(ElementRef);
var ViewContainerRefTokenKey = tokenKey(ViewContainerRef);
var TemplateRefTokenKey = tokenKey(TemplateRef);
var ChangeDetectorRefTokenKey = tokenKey(ChangeDetectorRef);
var InjectorRefTokenKey$1 = tokenKey(Injector);
var INJECTORRefTokenKey$1 = tokenKey(INJECTOR);
function directiveDef(checkIndex, flags, matchedQueries, childCount, ctor, deps, props, outputs) {
var bindings = [];
if (props) {
for (var prop in props) {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(props[prop], 2), bindingIndex = _a[0], nonMinifiedName = _a[1];
bindings[bindingIndex] = {
flags: 8 /* TypeProperty */,
name: prop, nonMinifiedName: nonMinifiedName,
ns: null,
securityContext: null,
suffix: null
};
}
}
var outputDefs = [];
if (outputs) {
for (var propName in outputs) {
outputDefs.push({ type: 1 /* DirectiveOutput */, propName: propName, target: null, eventName: outputs[propName] });
}
}
flags |= 16384 /* TypeDirective */;
return _def(checkIndex, flags, matchedQueries, childCount, ctor, ctor, deps, bindings, outputDefs);
}
function pipeDef(flags, ctor, deps) {
flags |= 16 /* TypePipe */;
return _def(-1, flags, null, 0, ctor, ctor, deps);
}
function providerDef(flags, matchedQueries, token, value, deps) {
return _def(-1, flags, matchedQueries, 0, token, value, deps);
}
function _def(checkIndex, flags, matchedQueriesDsl, childCount, token, value, deps, bindings, outputs) {
var _a = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _a.matchedQueries, references = _a.references, matchedQueryIds = _a.matchedQueryIds;
if (!outputs) {
outputs = [];
}
if (!bindings) {
bindings = [];
}
// Need to resolve forwardRefs as e.g. for `useValue` we
// lowered the expression and then stopped evaluating it,
// i.e. also didn't unwrap it.
value = resolveForwardRef(value);
var depDefs = splitDepsDsl(deps, stringify(token));
return {
// will bet set by the view definition
nodeIndex: -1,
parent: null,
renderParent: null,
bindingIndex: -1,
outputIndex: -1,
// regular values
checkIndex: checkIndex,
flags: flags,
childFlags: 0,
directChildFlags: 0,
childMatchedQueries: 0, matchedQueries: matchedQueries, matchedQueryIds: matchedQueryIds, references: references,
ngContentIndex: -1, childCount: childCount, bindings: bindings,
bindingFlags: calcBindingFlags(bindings), outputs: outputs,
element: null,
provider: { token: token, value: value, deps: depDefs },
text: null,
query: null,
ngContent: null
};
}
function createProviderInstance(view, def) {
return _createProviderInstance$1(view, def);
}
function createPipeInstance(view, def) {
// deps are looked up from component.
var compView = view;
while (compView.parent && !isComponentView(compView)) {
compView = compView.parent;
}
// pipes can see the private services of the component
var allowPrivateServices = true;
// pipes are always eager and classes!
return createClass(compView.parent, viewParentEl(compView), allowPrivateServices, def.provider.value, def.provider.deps);
}
function createDirectiveInstance(view, def) {
// components can see other private services, other directives can't.
var allowPrivateServices = (def.flags & 32768 /* Component */) > 0;
// directives are always eager and classes!
var instance = createClass(view, def.parent, allowPrivateServices, def.provider.value, def.provider.deps);
if (def.outputs.length) {
for (var i = 0; i < def.outputs.length; i++) {
var output = def.outputs[i];
var subscription = instance[output.propName].subscribe(eventHandlerClosure(view, def.parent.nodeIndex, output.eventName));
view.disposables[def.outputIndex + i] = subscription.unsubscribe.bind(subscription);
}
}
return instance;
}
function eventHandlerClosure(view, index, eventName) {
return function (event) { return dispatchEvent(view, index, eventName, event); };
}
function checkAndUpdateDirectiveInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
var providerData = asProviderData(view, def.nodeIndex);
var directive = providerData.instance;
var changed = false;
var changes = undefined;
var bindLen = def.bindings.length;
if (bindLen > 0 && checkBinding(view, def, 0, v0)) {
changed = true;
changes = updateProp(view, providerData, def, 0, v0, changes);
}
if (bindLen > 1 && checkBinding(view, def, 1, v1)) {
changed = true;
changes = updateProp(view, providerData, def, 1, v1, changes);
}
if (bindLen > 2 && checkBinding(view, def, 2, v2)) {
changed = true;
changes = updateProp(view, providerData, def, 2, v2, changes);
}
if (bindLen > 3 && checkBinding(view, def, 3, v3)) {
changed = true;
changes = updateProp(view, providerData, def, 3, v3, changes);
}
if (bindLen > 4 && checkBinding(view, def, 4, v4)) {
changed = true;
changes = updateProp(view, providerData, def, 4, v4, changes);
}
if (bindLen > 5 && checkBinding(view, def, 5, v5)) {
changed = true;
changes = updateProp(view, providerData, def, 5, v5, changes);
}
if (bindLen > 6 && checkBinding(view, def, 6, v6)) {
changed = true;
changes = updateProp(view, providerData, def, 6, v6, changes);
}
if (bindLen > 7 && checkBinding(view, def, 7, v7)) {
changed = true;
changes = updateProp(view, providerData, def, 7, v7, changes);
}
if (bindLen > 8 && checkBinding(view, def, 8, v8)) {
changed = true;
changes = updateProp(view, providerData, def, 8, v8, changes);
}
if (bindLen > 9 && checkBinding(view, def, 9, v9)) {
changed = true;
changes = updateProp(view, providerData, def, 9, v9, changes);
}
if (changes) {
directive.ngOnChanges(changes);
}
if ((def.flags & 65536 /* OnInit */) &&
shouldCallLifecycleInitHook(view, 256 /* InitState_CallingOnInit */, def.nodeIndex)) {
directive.ngOnInit();
}
if (def.flags & 262144 /* DoCheck */) {
directive.ngDoCheck();
}
return changed;
}
function checkAndUpdateDirectiveDynamic(view, def, values) {
var providerData = asProviderData(view, def.nodeIndex);
var directive = providerData.instance;
var changed = false;
var changes = undefined;
for (var i = 0; i < values.length; i++) {
if (checkBinding(view, def, i, values[i])) {
changed = true;
changes = updateProp(view, providerData, def, i, values[i], changes);
}
}
if (changes) {
directive.ngOnChanges(changes);
}
if ((def.flags & 65536 /* OnInit */) &&
shouldCallLifecycleInitHook(view, 256 /* InitState_CallingOnInit */, def.nodeIndex)) {
directive.ngOnInit();
}
if (def.flags & 262144 /* DoCheck */) {
directive.ngDoCheck();
}
return changed;
}
function _createProviderInstance$1(view, def) {
// private services can see other private services
var allowPrivateServices = (def.flags & 8192 /* PrivateProvider */) > 0;
var providerDef = def.provider;
switch (def.flags & 201347067 /* Types */) {
case 512 /* TypeClassProvider */:
return createClass(view, def.parent, allowPrivateServices, providerDef.value, providerDef.deps);
case 1024 /* TypeFactoryProvider */:
return callFactory(view, def.parent, allowPrivateServices, providerDef.value, providerDef.deps);
case 2048 /* TypeUseExistingProvider */:
return resolveDep(view, def.parent, allowPrivateServices, providerDef.deps[0]);
case 256 /* TypeValueProvider */:
return providerDef.value;
}
}
function createClass(view, elDef, allowPrivateServices, ctor, deps) {
var len = deps.length;
switch (len) {
case 0:
return new ctor();
case 1:
return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]));
case 2:
return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]));
case 3:
return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]), resolveDep(view, elDef, allowPrivateServices, deps[2]));
default:
var depValues = new Array(len);
for (var i = 0; i < len; i++) {
depValues[i] = resolveDep(view, elDef, allowPrivateServices, deps[i]);
}
return new (ctor.bind.apply(ctor, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([void 0], depValues)))();
}
}
function callFactory(view, elDef, allowPrivateServices, factory, deps) {
var len = deps.length;
switch (len) {
case 0:
return factory();
case 1:
return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]));
case 2:
return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]));
case 3:
return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]), resolveDep(view, elDef, allowPrivateServices, deps[2]));
default:
var depValues = Array(len);
for (var i = 0; i < len; i++) {
depValues[i] = resolveDep(view, elDef, allowPrivateServices, deps[i]);
}
return factory.apply(void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(depValues));
}
}
// This default value is when checking the hierarchy for a token.
//
// It means both:
// - the token is not provided by the current injector,
// - only the element injectors should be checked (ie do not check module injectors
//
// mod1
// /
// el1 mod2
// \ /
// el2
//
// When requesting el2.injector.get(token), we should check in the following order and return the
// first found value:
// - el2.injector.get(token, default)
// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module
// - mod2.injector.get(token, default)
var NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
function resolveDep(view, elDef, allowPrivateServices, depDef, notFoundValue) {
if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }
if (depDef.flags & 8 /* Value */) {
return depDef.token;
}
var startView = view;
if (depDef.flags & 2 /* Optional */) {
notFoundValue = null;
}
var tokenKey$$1 = depDef.tokenKey;
if (tokenKey$$1 === ChangeDetectorRefTokenKey) {
// directives on the same element as a component should be able to control the change detector
// of that component as well.
allowPrivateServices = !!(elDef && elDef.element.componentView);
}
if (elDef && (depDef.flags & 1 /* SkipSelf */)) {
allowPrivateServices = false;
elDef = elDef.parent;
}
var searchView = view;
while (searchView) {
if (elDef) {
switch (tokenKey$$1) {
case RendererV1TokenKey: {
var compView = findCompView(searchView, elDef, allowPrivateServices);
return createRendererV1(compView);
}
case Renderer2TokenKey: {
var compView = findCompView(searchView, elDef, allowPrivateServices);
return compView.renderer;
}
case ElementRefTokenKey:
return new ElementRef(asElementData(searchView, elDef.nodeIndex).renderElement);
case ViewContainerRefTokenKey:
return asElementData(searchView, elDef.nodeIndex).viewContainer;
case TemplateRefTokenKey: {
if (elDef.element.template) {
return asElementData(searchView, elDef.nodeIndex).template;
}
break;
}
case ChangeDetectorRefTokenKey: {
var cdView = findCompView(searchView, elDef, allowPrivateServices);
return createChangeDetectorRef(cdView);
}
case InjectorRefTokenKey$1:
case INJECTORRefTokenKey$1:
return createInjector$1(searchView, elDef);
default:
var providerDef_1 = (allowPrivateServices ? elDef.element.allProviders :
elDef.element.publicProviders)[tokenKey$$1];
if (providerDef_1) {
var providerData = asProviderData(searchView, providerDef_1.nodeIndex);
if (!providerData) {
providerData = { instance: _createProviderInstance$1(searchView, providerDef_1) };
searchView.nodes[providerDef_1.nodeIndex] = providerData;
}
return providerData.instance;
}
}
}
allowPrivateServices = isComponentView(searchView);
elDef = viewParentEl(searchView);
searchView = searchView.parent;
if (depDef.flags & 4 /* Self */) {
searchView = null;
}
}
var value = startView.root.injector.get(depDef.token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR);
if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
// Return the value from the root element injector when
// - it provides it
// (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
// - the module injector should not be checked
// (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
return value;
}
return startView.root.ngModule.injector.get(depDef.token, notFoundValue);
}
function findCompView(view, elDef, allowPrivateServices) {
var compView;
if (allowPrivateServices) {
compView = asElementData(view, elDef.nodeIndex).componentView;
}
else {
compView = view;
while (compView.parent && !isComponentView(compView)) {
compView = compView.parent;
}
}
return compView;
}
function updateProp(view, providerData, def, bindingIdx, value, changes) {
if (def.flags & 32768 /* Component */) {
var compView = asElementData(view, def.parent.nodeIndex).componentView;
if (compView.def.flags & 2 /* OnPush */) {
compView.state |= 8 /* ChecksEnabled */;
}
}
var binding = def.bindings[bindingIdx];
var propName = binding.name;
// Note: This is still safe with Closure Compiler as
// the user passed in the property name as an object has to `providerDef`,
// so Closure Compiler will have renamed the property correctly already.
providerData.instance[propName] = value;
if (def.flags & 524288 /* OnChanges */) {
changes = changes || {};
var oldValue = WrappedValue.unwrap(view.oldValues[def.bindingIndex + bindingIdx]);
var binding_1 = def.bindings[bindingIdx];
changes[binding_1.nonMinifiedName] =
new SimpleChange(oldValue, value, (view.state & 2 /* FirstCheck */) !== 0);
}
view.oldValues[def.bindingIndex + bindingIdx] = value;
return changes;
}
// This function calls the ngAfterContentCheck, ngAfterContentInit,
// ngAfterViewCheck, and ngAfterViewInit lifecycle hooks (depending on the node
// flags in lifecycle). Unlike ngDoCheck, ngOnChanges and ngOnInit, which are
// called during a pre-order traversal of the view tree (that is calling the
// parent hooks before the child hooks) these events are sent in using a
// post-order traversal of the tree (children before parents). This changes the
// meaning of initIndex in the view state. For ngOnInit, initIndex tracks the
// expected nodeIndex which a ngOnInit should be called. When sending
// ngAfterContentInit and ngAfterViewInit it is the expected count of
// ngAfterContentInit or ngAfterViewInit methods that have been called. This
// ensure that despite being called recursively or after picking up after an
// exception, the ngAfterContentInit or ngAfterViewInit will be called on the
// correct nodes. Consider for example, the following (where E is an element
// and D is a directive)
// Tree: pre-order index post-order index
// E1 0 6
// E2 1 1
// D3 2 0
// E4 3 5
// E5 4 4
// E6 5 2
// E7 6 3
// As can be seen, the post-order index has an unclear relationship to the
// pre-order index (postOrderIndex === preOrderIndex - parentCount +
// childCount). Since number of calls to ngAfterContentInit and ngAfterViewInit
// are stable (will be the same for the same view regardless of exceptions or
// recursion) we just need to count them which will roughly correspond to the
// post-order index (it skips elements and directives that do not have
// lifecycle hooks).
//
// For example, if an exception is raised in the E6.onAfterViewInit() the
// initIndex is left at 3 (by shouldCallLifecycleInitHook() which set it to
// initIndex + 1). When checkAndUpdateView() is called again D3, E2 and E6 will
// not have their ngAfterViewInit() called but, starting with E7, the rest of
// the view will begin getting ngAfterViewInit() called until a check and
// pass is complete.
//
// This algorthim also handles recursion. Consider if E4's ngAfterViewInit()
// indirectly calls E1's ChangeDetectorRef.detectChanges(). The expected
// initIndex is set to 6, the recusive checkAndUpdateView() starts walk again.
// D3, E2, E6, E7, E5 and E4 are skipped, ngAfterViewInit() is called on E1.
// When the recursion returns the initIndex will be 7 so E1 is skipped as it
// has already been called in the recursively called checkAnUpdateView().
function callLifecycleHooksChildrenFirst(view, lifecycles) {
if (!(view.def.nodeFlags & lifecycles)) {
return;
}
var nodes = view.def.nodes;
var initIndex = 0;
for (var i = 0; i < nodes.length; i++) {
var nodeDef = nodes[i];
var parent_1 = nodeDef.parent;
if (!parent_1 && nodeDef.flags & lifecycles) {
// matching root node (e.g. a pipe)
callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);
}
if ((nodeDef.childFlags & lifecycles) === 0) {
// no child matches one of the lifecycles
i += nodeDef.childCount;
}
while (parent_1 && (parent_1.flags & 1 /* TypeElement */) &&
i === parent_1.nodeIndex + parent_1.childCount) {
// last child of an element
if (parent_1.directChildFlags & lifecycles) {
initIndex = callElementProvidersLifecycles(view, parent_1, lifecycles, initIndex);
}
parent_1 = parent_1.parent;
}
}
}
function callElementProvidersLifecycles(view, elDef, lifecycles, initIndex) {
for (var i = elDef.nodeIndex + 1; i <= elDef.nodeIndex + elDef.childCount; i++) {
var nodeDef = view.def.nodes[i];
if (nodeDef.flags & lifecycles) {
callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);
}
// only visit direct children
i += nodeDef.childCount;
}
return initIndex;
}
function callProviderLifecycles(view, index, lifecycles, initIndex) {
var providerData = asProviderData(view, index);
if (!providerData) {
return;
}
var provider = providerData.instance;
if (!provider) {
return;
}
Services.setCurrentNode(view, index);
if (lifecycles & 1048576 /* AfterContentInit */ &&
shouldCallLifecycleInitHook(view, 512 /* InitState_CallingAfterContentInit */, initIndex)) {
provider.ngAfterContentInit();
}
if (lifecycles & 2097152 /* AfterContentChecked */) {
provider.ngAfterContentChecked();
}
if (lifecycles & 4194304 /* AfterViewInit */ &&
shouldCallLifecycleInitHook(view, 768 /* InitState_CallingAfterViewInit */, initIndex)) {
provider.ngAfterViewInit();
}
if (lifecycles & 8388608 /* AfterViewChecked */) {
provider.ngAfterViewChecked();
}
if (lifecycles & 131072 /* OnDestroy */) {
provider.ngOnDestroy();
}
}
/**
* @license
* Copyright Google Inc. 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
*/
function queryDef(flags, id, bindings) {
var bindingDefs = [];
for (var propName in bindings) {
var bindingType = bindings[propName];
bindingDefs.push({ propName: propName, bindingType: bindingType });
}
return {
// will bet set by the view definition
nodeIndex: -1,
parent: null,
renderParent: null,
bindingIndex: -1,
outputIndex: -1,
// regular values
// TODO(vicb): check
checkIndex: -1, flags: flags,
childFlags: 0,
directChildFlags: 0,
childMatchedQueries: 0,
ngContentIndex: -1,
matchedQueries: {},
matchedQueryIds: 0,
references: {},
childCount: 0,
bindings: [],
bindingFlags: 0,
outputs: [],
element: null,
provider: null,
text: null,
query: { id: id, filterId: filterQueryId(id), bindings: bindingDefs },
ngContent: null
};
}
function createQuery() {
return new QueryList();
}
function dirtyParentQueries(view) {
var queryIds = view.def.nodeMatchedQueries;
while (view.parent && isEmbeddedView(view)) {
var tplDef = view.parentNodeDef;
view = view.parent;
// content queries
var end = tplDef.nodeIndex + tplDef.childCount;
for (var i = 0; i <= end; i++) {
var nodeDef = view.def.nodes[i];
if ((nodeDef.flags & 67108864 /* TypeContentQuery */) &&
(nodeDef.flags & 536870912 /* DynamicQuery */) &&
(nodeDef.query.filterId & queryIds) === nodeDef.query.filterId) {
asQueryList(view, i).setDirty();
}
if ((nodeDef.flags & 1 /* TypeElement */ && i + nodeDef.childCount < tplDef.nodeIndex) ||
!(nodeDef.childFlags & 67108864 /* TypeContentQuery */) ||
!(nodeDef.childFlags & 536870912 /* DynamicQuery */)) {
// skip elements that don't contain the template element or no query.
i += nodeDef.childCount;
}
}
}
// view queries
if (view.def.nodeFlags & 134217728 /* TypeViewQuery */) {
for (var i = 0; i < view.def.nodes.length; i++) {
var nodeDef = view.def.nodes[i];
if ((nodeDef.flags & 134217728 /* TypeViewQuery */) && (nodeDef.flags & 536870912 /* DynamicQuery */)) {
asQueryList(view, i).setDirty();
}
// only visit the root nodes
i += nodeDef.childCount;
}
}
}
function checkAndUpdateQuery(view, nodeDef) {
var queryList = asQueryList(view, nodeDef.nodeIndex);
if (!queryList.dirty) {
return;
}
var directiveInstance;
var newValues = undefined;
if (nodeDef.flags & 67108864 /* TypeContentQuery */) {
var elementDef = nodeDef.parent.parent;
newValues = calcQueryValues(view, elementDef.nodeIndex, elementDef.nodeIndex + elementDef.childCount, nodeDef.query, []);
directiveInstance = asProviderData(view, nodeDef.parent.nodeIndex).instance;
}
else if (nodeDef.flags & 134217728 /* TypeViewQuery */) {
newValues = calcQueryValues(view, 0, view.def.nodes.length - 1, nodeDef.query, []);
directiveInstance = view.component;
}
queryList.reset(newValues);
var bindings = nodeDef.query.bindings;
var notify = false;
for (var i = 0; i < bindings.length; i++) {
var binding = bindings[i];
var boundValue = void 0;
switch (binding.bindingType) {
case 0 /* First */:
boundValue = queryList.first;
break;
case 1 /* All */:
boundValue = queryList;
notify = true;
break;
}
directiveInstance[binding.propName] = boundValue;
}
if (notify) {
queryList.notifyOnChanges();
}
}
function calcQueryValues(view, startIndex, endIndex, queryDef, values) {
for (var i = startIndex; i <= endIndex; i++) {
var nodeDef = view.def.nodes[i];
var valueType = nodeDef.matchedQueries[queryDef.id];
if (valueType != null) {
values.push(getQueryValue(view, nodeDef, valueType));
}
if (nodeDef.flags & 1 /* TypeElement */ && nodeDef.element.template &&
(nodeDef.element.template.nodeMatchedQueries & queryDef.filterId) ===
queryDef.filterId) {
var elementData = asElementData(view, i);
// check embedded views that were attached at the place of their template,
// but process child nodes first if some match the query (see issue #16568)
if ((nodeDef.childMatchedQueries & queryDef.filterId) === queryDef.filterId) {
calcQueryValues(view, i + 1, i + nodeDef.childCount, queryDef, values);
i += nodeDef.childCount;
}
if (nodeDef.flags & 16777216 /* EmbeddedViews */) {
var embeddedViews = elementData.viewContainer._embeddedViews;
for (var k = 0; k < embeddedViews.length; k++) {
var embeddedView = embeddedViews[k];
var dvc = declaredViewContainer(embeddedView);
if (dvc && dvc === elementData) {
calcQueryValues(embeddedView, 0, embeddedView.def.nodes.length - 1, queryDef, values);
}
}
}
var projectedViews = elementData.template._projectedViews;
if (projectedViews) {
for (var k = 0; k < projectedViews.length; k++) {
var projectedView = projectedViews[k];
calcQueryValues(projectedView, 0, projectedView.def.nodes.length - 1, queryDef, values);
}
}
}
if ((nodeDef.childMatchedQueries & queryDef.filterId) !== queryDef.filterId) {
// if no child matches the query, skip the children.
i += nodeDef.childCount;
}
}
return values;
}
function getQueryValue(view, nodeDef, queryValueType) {
if (queryValueType != null) {
// a match
switch (queryValueType) {
case 1 /* RenderElement */:
return asElementData(view, nodeDef.nodeIndex).renderElement;
case 0 /* ElementRef */:
return new ElementRef(asElementData(view, nodeDef.nodeIndex).renderElement);
case 2 /* TemplateRef */:
return asElementData(view, nodeDef.nodeIndex).template;
case 3 /* ViewContainerRef */:
return asElementData(view, nodeDef.nodeIndex).viewContainer;
case 4 /* Provider */:
return asProviderData(view, nodeDef.nodeIndex).instance;
}
}
}
/**
* @license
* Copyright Google Inc. 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
*/
function ngContentDef(ngContentIndex, index) {
return {
// will bet set by the view definition
nodeIndex: -1,
parent: null,
renderParent: null,
bindingIndex: -1,
outputIndex: -1,
// regular values
checkIndex: -1,
flags: 8 /* TypeNgContent */,
childFlags: 0,
directChildFlags: 0,
childMatchedQueries: 0,
matchedQueries: {},
matchedQueryIds: 0,
references: {}, ngContentIndex: ngContentIndex,
childCount: 0,
bindings: [],
bindingFlags: 0,
outputs: [],
element: null,
provider: null,
text: null,
query: null,
ngContent: { index: index }
};
}
function appendNgContent(view, renderHost, def) {
var parentEl = getParentRenderElement(view, renderHost, def);
if (!parentEl) {
// Nothing to do if there is no parent element.
return;
}
var ngContentIndex = def.ngContent.index;
visitProjectedRenderNodes(view, ngContentIndex, 1 /* AppendChild */, parentEl, null, undefined);
}
/**
* @license
* Copyright Google Inc. 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
*/
function purePipeDef(checkIndex, argCount) {
// argCount + 1 to include the pipe as first arg
return _pureExpressionDef(128 /* TypePurePipe */, checkIndex, new Array(argCount + 1));
}
function pureArrayDef(checkIndex, argCount) {
return _pureExpressionDef(32 /* TypePureArray */, checkIndex, new Array(argCount));
}
function pureObjectDef(checkIndex, propToIndex) {
var keys = Object.keys(propToIndex);
var nbKeys = keys.length;
var propertyNames = new Array(nbKeys);
for (var i = 0; i < nbKeys; i++) {
var key = keys[i];
var index = propToIndex[key];
propertyNames[index] = key;
}
return _pureExpressionDef(64 /* TypePureObject */, checkIndex, propertyNames);
}
function _pureExpressionDef(flags, checkIndex, propertyNames) {
var bindings = new Array(propertyNames.length);
for (var i = 0; i < propertyNames.length; i++) {
var prop = propertyNames[i];
bindings[i] = {
flags: 8 /* TypeProperty */,
name: prop,
ns: null,
nonMinifiedName: prop,
securityContext: null,
suffix: null
};
}
return {
// will bet set by the view definition
nodeIndex: -1,
parent: null,
renderParent: null,
bindingIndex: -1,
outputIndex: -1,
// regular values
checkIndex: checkIndex,
flags: flags,
childFlags: 0,
directChildFlags: 0,
childMatchedQueries: 0,
matchedQueries: {},
matchedQueryIds: 0,
references: {},
ngContentIndex: -1,
childCount: 0, bindings: bindings,
bindingFlags: calcBindingFlags(bindings),
outputs: [],
element: null,
provider: null,
text: null,
query: null,
ngContent: null
};
}
function createPureExpression(view, def) {
return { value: undefined };
}
function checkAndUpdatePureExpressionInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
var bindings = def.bindings;
var changed = false;
var bindLen = bindings.length;
if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0))
changed = true;
if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1))
changed = true;
if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2))
changed = true;
if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3))
changed = true;
if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4))
changed = true;
if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5))
changed = true;
if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6))
changed = true;
if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7))
changed = true;
if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8))
changed = true;
if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9))
changed = true;
if (changed) {
var data = asPureExpressionData(view, def.nodeIndex);
var value = void 0;
switch (def.flags & 201347067 /* Types */) {
case 32 /* TypePureArray */:
value = new Array(bindings.length);
if (bindLen > 0)
value[0] = v0;
if (bindLen > 1)
value[1] = v1;
if (bindLen > 2)
value[2] = v2;
if (bindLen > 3)
value[3] = v3;
if (bindLen > 4)
value[4] = v4;
if (bindLen > 5)
value[5] = v5;
if (bindLen > 6)
value[6] = v6;
if (bindLen > 7)
value[7] = v7;
if (bindLen > 8)
value[8] = v8;
if (bindLen > 9)
value[9] = v9;
break;
case 64 /* TypePureObject */:
value = {};
if (bindLen > 0)
value[bindings[0].name] = v0;
if (bindLen > 1)
value[bindings[1].name] = v1;
if (bindLen > 2)
value[bindings[2].name] = v2;
if (bindLen > 3)
value[bindings[3].name] = v3;
if (bindLen > 4)
value[bindings[4].name] = v4;
if (bindLen > 5)
value[bindings[5].name] = v5;
if (bindLen > 6)
value[bindings[6].name] = v6;
if (bindLen > 7)
value[bindings[7].name] = v7;
if (bindLen > 8)
value[bindings[8].name] = v8;
if (bindLen > 9)
value[bindings[9].name] = v9;
break;
case 128 /* TypePurePipe */:
var pipe = v0;
switch (bindLen) {
case 1:
value = pipe.transform(v0);
break;
case 2:
value = pipe.transform(v1);
break;
case 3:
value = pipe.transform(v1, v2);
break;
case 4:
value = pipe.transform(v1, v2, v3);
break;
case 5:
value = pipe.transform(v1, v2, v3, v4);
break;
case 6:
value = pipe.transform(v1, v2, v3, v4, v5);
break;
case 7:
value = pipe.transform(v1, v2, v3, v4, v5, v6);
break;
case 8:
value = pipe.transform(v1, v2, v3, v4, v5, v6, v7);
break;
case 9:
value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8);
break;
case 10:
value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8, v9);
break;
}
break;
}
data.value = value;
}
return changed;
}
function checkAndUpdatePureExpressionDynamic(view, def, values) {
var bindings = def.bindings;
var changed = false;
for (var i = 0; i < values.length; i++) {
// Note: We need to loop over all values, so that
// the old values are updates as well!
if (checkAndUpdateBinding(view, def, i, values[i])) {
changed = true;
}
}
if (changed) {
var data = asPureExpressionData(view, def.nodeIndex);
var value = void 0;
switch (def.flags & 201347067 /* Types */) {
case 32 /* TypePureArray */:
value = values;
break;
case 64 /* TypePureObject */:
value = {};
for (var i = 0; i < values.length; i++) {
value[bindings[i].name] = values[i];
}
break;
case 128 /* TypePurePipe */:
var pipe = values[0];
var params = values.slice(1);
value = pipe.transform.apply(pipe, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(params));
break;
}
data.value = value;
}
return changed;
}
/**
* @license
* Copyright Google Inc. 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
*/
function textDef(checkIndex, ngContentIndex, staticText) {
var bindings = new Array(staticText.length - 1);
for (var i = 1; i < staticText.length; i++) {
bindings[i - 1] = {
flags: 8 /* TypeProperty */,
name: null,
ns: null,
nonMinifiedName: null,
securityContext: null,
suffix: staticText[i],
};
}
return {
// will bet set by the view definition
nodeIndex: -1,
parent: null,
renderParent: null,
bindingIndex: -1,
outputIndex: -1,
// regular values
checkIndex: checkIndex,
flags: 2 /* TypeText */,
childFlags: 0,
directChildFlags: 0,
childMatchedQueries: 0,
matchedQueries: {},
matchedQueryIds: 0,
references: {}, ngContentIndex: ngContentIndex,
childCount: 0, bindings: bindings,
bindingFlags: 8 /* TypeProperty */,
outputs: [],
element: null,
provider: null,
text: { prefix: staticText[0] },
query: null,
ngContent: null,
};
}
function createText(view, renderHost, def) {
var renderNode$$1;
var renderer = view.renderer;
renderNode$$1 = renderer.createText(def.text.prefix);
var parentEl = getParentRenderElement(view, renderHost, def);
if (parentEl) {
renderer.appendChild(parentEl, renderNode$$1);
}
return { renderText: renderNode$$1 };
}
function checkAndUpdateTextInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
var changed = false;
var bindings = def.bindings;
var bindLen = bindings.length;
if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0))
changed = true;
if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1))
changed = true;
if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2))
changed = true;
if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3))
changed = true;
if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4))
changed = true;
if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5))
changed = true;
if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6))
changed = true;
if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7))
changed = true;
if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8))
changed = true;
if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9))
changed = true;
if (changed) {
var value = def.text.prefix;
if (bindLen > 0)
value += _addInterpolationPart(v0, bindings[0]);
if (bindLen > 1)
value += _addInterpolationPart(v1, bindings[1]);
if (bindLen > 2)
value += _addInterpolationPart(v2, bindings[2]);
if (bindLen > 3)
value += _addInterpolationPart(v3, bindings[3]);
if (bindLen > 4)
value += _addInterpolationPart(v4, bindings[4]);
if (bindLen > 5)
value += _addInterpolationPart(v5, bindings[5]);
if (bindLen > 6)
value += _addInterpolationPart(v6, bindings[6]);
if (bindLen > 7)
value += _addInterpolationPart(v7, bindings[7]);
if (bindLen > 8)
value += _addInterpolationPart(v8, bindings[8]);
if (bindLen > 9)
value += _addInterpolationPart(v9, bindings[9]);
var renderNode$$1 = asTextData(view, def.nodeIndex).renderText;
view.renderer.setValue(renderNode$$1, value);
}
return changed;
}
function checkAndUpdateTextDynamic(view, def, values) {
var bindings = def.bindings;
var changed = false;
for (var i = 0; i < values.length; i++) {
// Note: We need to loop over all values, so that
// the old values are updates as well!
if (checkAndUpdateBinding(view, def, i, values[i])) {
changed = true;
}
}
if (changed) {
var value = '';
for (var i = 0; i < values.length; i++) {
value = value + _addInterpolationPart(values[i], bindings[i]);
}
value = def.text.prefix + value;
var renderNode$$1 = asTextData(view, def.nodeIndex).renderText;
view.renderer.setValue(renderNode$$1, value);
}
return changed;
}
function _addInterpolationPart(value, binding) {
var valueStr = value != null ? value.toString() : '';
return valueStr + binding.suffix;
}
/**
* @license
* Copyright Google Inc. 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
*/
function viewDef(flags, nodes, updateDirectives, updateRenderer) {
// clone nodes and set auto calculated values
var viewBindingCount = 0;
var viewDisposableCount = 0;
var viewNodeFlags = 0;
var viewRootNodeFlags = 0;
var viewMatchedQueries = 0;
var currentParent = null;
var currentRenderParent = null;
var currentElementHasPublicProviders = false;
var currentElementHasPrivateProviders = false;
var lastRenderRootNode = null;
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
node.nodeIndex = i;
node.parent = currentParent;
node.bindingIndex = viewBindingCount;
node.outputIndex = viewDisposableCount;
node.renderParent = currentRenderParent;
viewNodeFlags |= node.flags;
viewMatchedQueries |= node.matchedQueryIds;
if (node.element) {
var elDef = node.element;
elDef.publicProviders =
currentParent ? currentParent.element.publicProviders : Object.create(null);
elDef.allProviders = elDef.publicProviders;
// Note: We assume that all providers of an element are before any child element!
currentElementHasPublicProviders = false;
currentElementHasPrivateProviders = false;
if (node.element.template) {
viewMatchedQueries |= node.element.template.nodeMatchedQueries;
}
}
validateNode(currentParent, node, nodes.length);
viewBindingCount += node.bindings.length;
viewDisposableCount += node.outputs.length;
if (!currentRenderParent && (node.flags & 3 /* CatRenderNode */)) {
lastRenderRootNode = node;
}
if (node.flags & 20224 /* CatProvider */) {
if (!currentElementHasPublicProviders) {
currentElementHasPublicProviders = true;
// Use prototypical inheritance to not get O(n^2) complexity...
currentParent.element.publicProviders =
Object.create(currentParent.element.publicProviders);
currentParent.element.allProviders = currentParent.element.publicProviders;
}
var isPrivateService = (node.flags & 8192 /* PrivateProvider */) !== 0;
var isComponent = (node.flags & 32768 /* Component */) !== 0;
if (!isPrivateService || isComponent) {
currentParent.element.publicProviders[tokenKey(node.provider.token)] = node;
}
else {
if (!currentElementHasPrivateProviders) {
currentElementHasPrivateProviders = true;
// Use prototypical inheritance to not get O(n^2) complexity...
currentParent.element.allProviders =
Object.create(currentParent.element.publicProviders);
}
currentParent.element.allProviders[tokenKey(node.provider.token)] = node;
}
if (isComponent) {
currentParent.element.componentProvider = node;
}
}
if (currentParent) {
currentParent.childFlags |= node.flags;
currentParent.directChildFlags |= node.flags;
currentParent.childMatchedQueries |= node.matchedQueryIds;
if (node.element && node.element.template) {
currentParent.childMatchedQueries |= node.element.template.nodeMatchedQueries;
}
}
else {
viewRootNodeFlags |= node.flags;
}
if (node.childCount > 0) {
currentParent = node;
if (!isNgContainer(node)) {
currentRenderParent = node;
}
}
else {
// When the current node has no children, check if it is the last children of its parent.
// When it is, propagate the flags up.
// The loop is required because an element could be the last transitive children of several
// elements. We loop to either the root or the highest opened element (= with remaining
// children)
while (currentParent && i === currentParent.nodeIndex + currentParent.childCount) {
var newParent = currentParent.parent;
if (newParent) {
newParent.childFlags |= currentParent.childFlags;
newParent.childMatchedQueries |= currentParent.childMatchedQueries;
}
currentParent = newParent;
// We also need to update the render parent & account for ng-container
if (currentParent && isNgContainer(currentParent)) {
currentRenderParent = currentParent.renderParent;
}
else {
currentRenderParent = currentParent;
}
}
}
}
var handleEvent = function (view, nodeIndex, eventName, event) {
return nodes[nodeIndex].element.handleEvent(view, eventName, event);
};
return {
// Will be filled later...
factory: null,
nodeFlags: viewNodeFlags,
rootNodeFlags: viewRootNodeFlags,
nodeMatchedQueries: viewMatchedQueries, flags: flags,
nodes: nodes,
updateDirectives: updateDirectives || NOOP,
updateRenderer: updateRenderer || NOOP, handleEvent: handleEvent,
bindingCount: viewBindingCount,
outputCount: viewDisposableCount, lastRenderRootNode: lastRenderRootNode
};
}
function isNgContainer(node) {
return (node.flags & 1 /* TypeElement */) !== 0 && node.element.name === null;
}
function validateNode(parent, node, nodeCount) {
var template = node.element && node.element.template;
if (template) {
if (!template.lastRenderRootNode) {
throw new Error("Illegal State: Embedded templates without nodes are not allowed!");
}
if (template.lastRenderRootNode &&
template.lastRenderRootNode.flags & 16777216 /* EmbeddedViews */) {
throw new Error("Illegal State: Last root node of a template can't have embedded views, at index " + node.nodeIndex + "!");
}
}
if (node.flags & 20224 /* CatProvider */) {
var parentFlags = parent ? parent.flags : 0;
if ((parentFlags & 1 /* TypeElement */) === 0) {
throw new Error("Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index " + node.nodeIndex + "!");
}
}
if (node.query) {
if (node.flags & 67108864 /* TypeContentQuery */ &&
(!parent || (parent.flags & 16384 /* TypeDirective */) === 0)) {
throw new Error("Illegal State: Content Query nodes need to be children of directives, at index " + node.nodeIndex + "!");
}
if (node.flags & 134217728 /* TypeViewQuery */ && parent) {
throw new Error("Illegal State: View Query nodes have to be top level nodes, at index " + node.nodeIndex + "!");
}
}
if (node.childCount) {
var parentEnd = parent ? parent.nodeIndex + parent.childCount : nodeCount - 1;
if (node.nodeIndex <= parentEnd && node.nodeIndex + node.childCount > parentEnd) {
throw new Error("Illegal State: childCount of node leads outside of parent, at index " + node.nodeIndex + "!");
}
}
}
function createEmbeddedView(parent, anchorDef$$1, viewDef, context) {
// embedded views are seen as siblings to the anchor, so we need
// to get the parent of the anchor and use it as parentIndex.
var view = createView(parent.root, parent.renderer, parent, anchorDef$$1, viewDef);
initView(view, parent.component, context);
createViewNodes(view);
return view;
}
function createRootView(root, def, context) {
var view = createView(root, root.renderer, null, null, def);
initView(view, context, context);
createViewNodes(view);
return view;
}
function createComponentView(parentView, nodeDef, viewDef, hostElement) {
var rendererType = nodeDef.element.componentRendererType;
var compRenderer;
if (!rendererType) {
compRenderer = parentView.root.renderer;
}
else {
compRenderer = parentView.root.rendererFactory.createRenderer(hostElement, rendererType);
}
return createView(parentView.root, compRenderer, parentView, nodeDef.element.componentProvider, viewDef);
}
function createView(root, renderer, parent, parentNodeDef, def) {
var nodes = new Array(def.nodes.length);
var disposables = def.outputCount ? new Array(def.outputCount) : null;
var view = {
def: def,
parent: parent,
viewContainerParent: null, parentNodeDef: parentNodeDef,
context: null,
component: null, nodes: nodes,
state: 13 /* CatInit */, root: root, renderer: renderer,
oldValues: new Array(def.bindingCount), disposables: disposables,
initIndex: -1
};
return view;
}
function initView(view, component, context) {
view.component = component;
view.context = context;
}
function createViewNodes(view) {
var renderHost;
if (isComponentView(view)) {
var hostDef = view.parentNodeDef;
renderHost = asElementData(view.parent, hostDef.parent.nodeIndex).renderElement;
}
var def = view.def;
var nodes = view.nodes;
for (var i = 0; i < def.nodes.length; i++) {
var nodeDef = def.nodes[i];
Services.setCurrentNode(view, i);
var nodeData = void 0;
switch (nodeDef.flags & 201347067 /* Types */) {
case 1 /* TypeElement */:
var el = createElement(view, renderHost, nodeDef);
var componentView = undefined;
if (nodeDef.flags & 33554432 /* ComponentView */) {
var compViewDef = resolveDefinition(nodeDef.element.componentView);
componentView = Services.createComponentView(view, nodeDef, compViewDef, el);
}
listenToElementOutputs(view, componentView, nodeDef, el);
nodeData = {
renderElement: el,
componentView: componentView,
viewContainer: null,
template: nodeDef.element.template ? createTemplateData(view, nodeDef) : undefined
};
if (nodeDef.flags & 16777216 /* EmbeddedViews */) {
nodeData.viewContainer = createViewContainerData(view, nodeDef, nodeData);
}
break;
case 2 /* TypeText */:
nodeData = createText(view, renderHost, nodeDef);
break;
case 512 /* TypeClassProvider */:
case 1024 /* TypeFactoryProvider */:
case 2048 /* TypeUseExistingProvider */:
case 256 /* TypeValueProvider */: {
nodeData = nodes[i];
if (!nodeData && !(nodeDef.flags & 4096 /* LazyProvider */)) {
var instance = createProviderInstance(view, nodeDef);
nodeData = { instance: instance };
}
break;
}
case 16 /* TypePipe */: {
var instance = createPipeInstance(view, nodeDef);
nodeData = { instance: instance };
break;
}
case 16384 /* TypeDirective */: {
nodeData = nodes[i];
if (!nodeData) {
var instance = createDirectiveInstance(view, nodeDef);
nodeData = { instance: instance };
}
if (nodeDef.flags & 32768 /* Component */) {
var compView = asElementData(view, nodeDef.parent.nodeIndex).componentView;
initView(compView, nodeData.instance, nodeData.instance);
}
break;
}
case 32 /* TypePureArray */:
case 64 /* TypePureObject */:
case 128 /* TypePurePipe */:
nodeData = createPureExpression(view, nodeDef);
break;
case 67108864 /* TypeContentQuery */:
case 134217728 /* TypeViewQuery */:
nodeData = createQuery();
break;
case 8 /* TypeNgContent */:
appendNgContent(view, renderHost, nodeDef);
// no runtime data needed for NgContent...
nodeData = undefined;
break;
}
nodes[i] = nodeData;
}
// Create the ViewData.nodes of component views after we created everything else,
// so that e.g. ng-content works
execComponentViewsAction(view, ViewAction.CreateViewNodes);
// fill static content and view queries
execQueriesAction(view, 67108864 /* TypeContentQuery */ | 134217728 /* TypeViewQuery */, 268435456 /* StaticQuery */, 0 /* CheckAndUpdate */);
}
function checkNoChangesView(view) {
markProjectedViewsForCheck(view);
Services.updateDirectives(view, 1 /* CheckNoChanges */);
execEmbeddedViewsAction(view, ViewAction.CheckNoChanges);
Services.updateRenderer(view, 1 /* CheckNoChanges */);
execComponentViewsAction(view, ViewAction.CheckNoChanges);
// Note: We don't check queries for changes as we didn't do this in v2.x.
// TODO(tbosch): investigate if we can enable the check again in v5.x with a nicer error message.
view.state &= ~(64 /* CheckProjectedViews */ | 32 /* CheckProjectedView */);
}
function checkAndUpdateView(view) {
if (view.state & 1 /* BeforeFirstCheck */) {
view.state &= ~1 /* BeforeFirstCheck */;
view.state |= 2 /* FirstCheck */;
}
else {
view.state &= ~2 /* FirstCheck */;
}
shiftInitState(view, 0 /* InitState_BeforeInit */, 256 /* InitState_CallingOnInit */);
markProjectedViewsForCheck(view);
Services.updateDirectives(view, 0 /* CheckAndUpdate */);
execEmbeddedViewsAction(view, ViewAction.CheckAndUpdate);
execQueriesAction(view, 67108864 /* TypeContentQuery */, 536870912 /* DynamicQuery */, 0 /* CheckAndUpdate */);
var callInit = shiftInitState(view, 256 /* InitState_CallingOnInit */, 512 /* InitState_CallingAfterContentInit */);
callLifecycleHooksChildrenFirst(view, 2097152 /* AfterContentChecked */ | (callInit ? 1048576 /* AfterContentInit */ : 0));
Services.updateRenderer(view, 0 /* CheckAndUpdate */);
execComponentViewsAction(view, ViewAction.CheckAndUpdate);
execQueriesAction(view, 134217728 /* TypeViewQuery */, 536870912 /* DynamicQuery */, 0 /* CheckAndUpdate */);
callInit = shiftInitState(view, 512 /* InitState_CallingAfterContentInit */, 768 /* InitState_CallingAfterViewInit */);
callLifecycleHooksChildrenFirst(view, 8388608 /* AfterViewChecked */ | (callInit ? 4194304 /* AfterViewInit */ : 0));
if (view.def.flags & 2 /* OnPush */) {
view.state &= ~8 /* ChecksEnabled */;
}
view.state &= ~(64 /* CheckProjectedViews */ | 32 /* CheckProjectedView */);
shiftInitState(view, 768 /* InitState_CallingAfterViewInit */, 1024 /* InitState_AfterInit */);
}
function checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
if (argStyle === 0 /* Inline */) {
return checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
}
else {
return checkAndUpdateNodeDynamic(view, nodeDef, v0);
}
}
function markProjectedViewsForCheck(view) {
var def = view.def;
if (!(def.nodeFlags & 4 /* ProjectedTemplate */)) {
return;
}
for (var i = 0; i < def.nodes.length; i++) {
var nodeDef = def.nodes[i];
if (nodeDef.flags & 4 /* ProjectedTemplate */) {
var projectedViews = asElementData(view, i).template._projectedViews;
if (projectedViews) {
for (var i_1 = 0; i_1 < projectedViews.length; i_1++) {
var projectedView = projectedViews[i_1];
projectedView.state |= 32 /* CheckProjectedView */;
markParentViewsForCheckProjectedViews(projectedView, view);
}
}
}
else if ((nodeDef.childFlags & 4 /* ProjectedTemplate */) === 0) {
// a parent with leafs
// no child is a component,
// then skip the children
i += nodeDef.childCount;
}
}
}
function checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
switch (nodeDef.flags & 201347067 /* Types */) {
case 1 /* TypeElement */:
return checkAndUpdateElementInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
case 2 /* TypeText */:
return checkAndUpdateTextInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
case 16384 /* TypeDirective */:
return checkAndUpdateDirectiveInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
case 32 /* TypePureArray */:
case 64 /* TypePureObject */:
case 128 /* TypePurePipe */:
return checkAndUpdatePureExpressionInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
default:
throw 'unreachable';
}
}
function checkAndUpdateNodeDynamic(view, nodeDef, values) {
switch (nodeDef.flags & 201347067 /* Types */) {
case 1 /* TypeElement */:
return checkAndUpdateElementDynamic(view, nodeDef, values);
case 2 /* TypeText */:
return checkAndUpdateTextDynamic(view, nodeDef, values);
case 16384 /* TypeDirective */:
return checkAndUpdateDirectiveDynamic(view, nodeDef, values);
case 32 /* TypePureArray */:
case 64 /* TypePureObject */:
case 128 /* TypePurePipe */:
return checkAndUpdatePureExpressionDynamic(view, nodeDef, values);
default:
throw 'unreachable';
}
}
function checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
if (argStyle === 0 /* Inline */) {
checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
}
else {
checkNoChangesNodeDynamic(view, nodeDef, v0);
}
// Returning false is ok here as we would have thrown in case of a change.
return false;
}
function checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
var bindLen = nodeDef.bindings.length;
if (bindLen > 0)
checkBindingNoChanges(view, nodeDef, 0, v0);
if (bindLen > 1)
checkBindingNoChanges(view, nodeDef, 1, v1);
if (bindLen > 2)
checkBindingNoChanges(view, nodeDef, 2, v2);
if (bindLen > 3)
checkBindingNoChanges(view, nodeDef, 3, v3);
if (bindLen > 4)
checkBindingNoChanges(view, nodeDef, 4, v4);
if (bindLen > 5)
checkBindingNoChanges(view, nodeDef, 5, v5);
if (bindLen > 6)
checkBindingNoChanges(view, nodeDef, 6, v6);
if (bindLen > 7)
checkBindingNoChanges(view, nodeDef, 7, v7);
if (bindLen > 8)
checkBindingNoChanges(view, nodeDef, 8, v8);
if (bindLen > 9)
checkBindingNoChanges(view, nodeDef, 9, v9);
}
function checkNoChangesNodeDynamic(view, nodeDef, values) {
for (var i = 0; i < values.length; i++) {
checkBindingNoChanges(view, nodeDef, i, values[i]);
}
}
/**
* Workaround https://github.com/angular/tsickle/issues/497
* @suppress {misplacedTypeAnnotation}
*/
function checkNoChangesQuery(view, nodeDef) {
var queryList = asQueryList(view, nodeDef.nodeIndex);
if (queryList.dirty) {
throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, nodeDef.nodeIndex), "Query " + nodeDef.query.id + " not dirty", "Query " + nodeDef.query.id + " dirty", (view.state & 1 /* BeforeFirstCheck */) !== 0);
}
}
function destroyView(view) {
if (view.state & 128 /* Destroyed */) {
return;
}
execEmbeddedViewsAction(view, ViewAction.Destroy);
execComponentViewsAction(view, ViewAction.Destroy);
callLifecycleHooksChildrenFirst(view, 131072 /* OnDestroy */);
if (view.disposables) {
for (var i = 0; i < view.disposables.length; i++) {
view.disposables[i]();
}
}
detachProjectedView(view);
if (view.renderer.destroyNode) {
destroyViewNodes(view);
}
if (isComponentView(view)) {
view.renderer.destroy();
}
view.state |= 128 /* Destroyed */;
}
function destroyViewNodes(view) {
var len = view.def.nodes.length;
for (var i = 0; i < len; i++) {
var def = view.def.nodes[i];
if (def.flags & 1 /* TypeElement */) {
view.renderer.destroyNode(asElementData(view, i).renderElement);
}
else if (def.flags & 2 /* TypeText */) {
view.renderer.destroyNode(asTextData(view, i).renderText);
}
else if (def.flags & 67108864 /* TypeContentQuery */ || def.flags & 134217728 /* TypeViewQuery */) {
asQueryList(view, i).destroy();
}
}
}
var ViewAction;
(function (ViewAction) {
ViewAction[ViewAction["CreateViewNodes"] = 0] = "CreateViewNodes";
ViewAction[ViewAction["CheckNoChanges"] = 1] = "CheckNoChanges";
ViewAction[ViewAction["CheckNoChangesProjectedViews"] = 2] = "CheckNoChangesProjectedViews";
ViewAction[ViewAction["CheckAndUpdate"] = 3] = "CheckAndUpdate";
ViewAction[ViewAction["CheckAndUpdateProjectedViews"] = 4] = "CheckAndUpdateProjectedViews";
ViewAction[ViewAction["Destroy"] = 5] = "Destroy";
})(ViewAction || (ViewAction = {}));
function execComponentViewsAction(view, action) {
var def = view.def;
if (!(def.nodeFlags & 33554432 /* ComponentView */)) {
return;
}
for (var i = 0; i < def.nodes.length; i++) {
var nodeDef = def.nodes[i];
if (nodeDef.flags & 33554432 /* ComponentView */) {
// a leaf
callViewAction(asElementData(view, i).componentView, action);
}
else if ((nodeDef.childFlags & 33554432 /* ComponentView */) === 0) {
// a parent with leafs
// no child is a component,
// then skip the children
i += nodeDef.childCount;
}
}
}
function execEmbeddedViewsAction(view, action) {
var def = view.def;
if (!(def.nodeFlags & 16777216 /* EmbeddedViews */)) {
return;
}
for (var i = 0; i < def.nodes.length; i++) {
var nodeDef = def.nodes[i];
if (nodeDef.flags & 16777216 /* EmbeddedViews */) {
// a leaf
var embeddedViews = asElementData(view, i).viewContainer._embeddedViews;
for (var k = 0; k < embeddedViews.length; k++) {
callViewAction(embeddedViews[k], action);
}
}
else if ((nodeDef.childFlags & 16777216 /* EmbeddedViews */) === 0) {
// a parent with leafs
// no child is a component,
// then skip the children
i += nodeDef.childCount;
}
}
}
function callViewAction(view, action) {
var viewState = view.state;
switch (action) {
case ViewAction.CheckNoChanges:
if ((viewState & 128 /* Destroyed */) === 0) {
if ((viewState & 12 /* CatDetectChanges */) === 12 /* CatDetectChanges */) {
checkNoChangesView(view);
}
else if (viewState & 64 /* CheckProjectedViews */) {
execProjectedViewsAction(view, ViewAction.CheckNoChangesProjectedViews);
}
}
break;
case ViewAction.CheckNoChangesProjectedViews:
if ((viewState & 128 /* Destroyed */) === 0) {
if (viewState & 32 /* CheckProjectedView */) {
checkNoChangesView(view);
}
else if (viewState & 64 /* CheckProjectedViews */) {
execProjectedViewsAction(view, action);
}
}
break;
case ViewAction.CheckAndUpdate:
if ((viewState & 128 /* Destroyed */) === 0) {
if ((viewState & 12 /* CatDetectChanges */) === 12 /* CatDetectChanges */) {
checkAndUpdateView(view);
}
else if (viewState & 64 /* CheckProjectedViews */) {
execProjectedViewsAction(view, ViewAction.CheckAndUpdateProjectedViews);
}
}
break;
case ViewAction.CheckAndUpdateProjectedViews:
if ((viewState & 128 /* Destroyed */) === 0) {
if (viewState & 32 /* CheckProjectedView */) {
checkAndUpdateView(view);
}
else if (viewState & 64 /* CheckProjectedViews */) {
execProjectedViewsAction(view, action);
}
}
break;
case ViewAction.Destroy:
// Note: destroyView recurses over all views,
// so we don't need to special case projected views here.
destroyView(view);
break;
case ViewAction.CreateViewNodes:
createViewNodes(view);
break;
}
}
function execProjectedViewsAction(view, action) {
execEmbeddedViewsAction(view, action);
execComponentViewsAction(view, action);
}
function execQueriesAction(view, queryFlags, staticDynamicQueryFlag, checkType) {
if (!(view.def.nodeFlags & queryFlags) || !(view.def.nodeFlags & staticDynamicQueryFlag)) {
return;
}
var nodeCount = view.def.nodes.length;
for (var i = 0; i < nodeCount; i++) {
var nodeDef = view.def.nodes[i];
if ((nodeDef.flags & queryFlags) && (nodeDef.flags & staticDynamicQueryFlag)) {
Services.setCurrentNode(view, nodeDef.nodeIndex);
switch (checkType) {
case 0 /* CheckAndUpdate */:
checkAndUpdateQuery(view, nodeDef);
break;
case 1 /* CheckNoChanges */:
checkNoChangesQuery(view, nodeDef);
break;
}
}
if (!(nodeDef.childFlags & queryFlags) || !(nodeDef.childFlags & staticDynamicQueryFlag)) {
// no child has a matching query
// then skip the children
i += nodeDef.childCount;
}
}
}
/**
* @license
* Copyright Google Inc. 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 initialized = false;
function initServicesIfNeeded() {
if (initialized) {
return;
}
initialized = true;
var services = isDevMode() ? createDebugServices() : createProdServices();
Services.setCurrentNode = services.setCurrentNode;
Services.createRootView = services.createRootView;
Services.createEmbeddedView = services.createEmbeddedView;
Services.createComponentView = services.createComponentView;
Services.createNgModuleRef = services.createNgModuleRef;
Services.overrideProvider = services.overrideProvider;
Services.overrideComponentView = services.overrideComponentView;
Services.clearOverrides = services.clearOverrides;
Services.checkAndUpdateView = services.checkAndUpdateView;
Services.checkNoChangesView = services.checkNoChangesView;
Services.destroyView = services.destroyView;
Services.resolveDep = resolveDep;
Services.createDebugContext = services.createDebugContext;
Services.handleEvent = services.handleEvent;
Services.updateDirectives = services.updateDirectives;
Services.updateRenderer = services.updateRenderer;
Services.dirtyParentQueries = dirtyParentQueries;
}
function createProdServices() {
return {
setCurrentNode: function () { },
createRootView: createProdRootView,
createEmbeddedView: createEmbeddedView,
createComponentView: createComponentView,
createNgModuleRef: createNgModuleRef,
overrideProvider: NOOP,
overrideComponentView: NOOP,
clearOverrides: NOOP,
checkAndUpdateView: checkAndUpdateView,
checkNoChangesView: checkNoChangesView,
destroyView: destroyView,
createDebugContext: function (view, nodeIndex) { return new DebugContext_(view, nodeIndex); },
handleEvent: function (view, nodeIndex, eventName, event) {
return view.def.handleEvent(view, nodeIndex, eventName, event);
},
updateDirectives: function (view, checkType) { return view.def.updateDirectives(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode :
prodCheckNoChangesNode, view); },
updateRenderer: function (view, checkType) { return view.def.updateRenderer(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode :
prodCheckNoChangesNode, view); },
};
}
function createDebugServices() {
return {
setCurrentNode: debugSetCurrentNode,
createRootView: debugCreateRootView,
createEmbeddedView: debugCreateEmbeddedView,
createComponentView: debugCreateComponentView,
createNgModuleRef: debugCreateNgModuleRef,
overrideProvider: debugOverrideProvider,
overrideComponentView: debugOverrideComponentView,
clearOverrides: debugClearOverrides,
checkAndUpdateView: debugCheckAndUpdateView,
checkNoChangesView: debugCheckNoChangesView,
destroyView: debugDestroyView,
createDebugContext: function (view, nodeIndex) { return new DebugContext_(view, nodeIndex); },
handleEvent: debugHandleEvent,
updateDirectives: debugUpdateDirectives,
updateRenderer: debugUpdateRenderer,
};
}
function createProdRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) {
var rendererFactory = ngModule.injector.get(RendererFactory2);
return createRootView(createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode), def, context);
}
function debugCreateRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) {
var rendererFactory = ngModule.injector.get(RendererFactory2);
var root = createRootData(elInjector, ngModule, new DebugRendererFactory2(rendererFactory), projectableNodes, rootSelectorOrNode);
var defWithOverride = applyProviderOverridesToView(def);
return callWithDebugContext(DebugAction.create, createRootView, null, [root, defWithOverride, context]);
}
function createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode) {
var sanitizer = ngModule.injector.get(Sanitizer);
var errorHandler = ngModule.injector.get(ErrorHandler);
var renderer = rendererFactory.createRenderer(null, null);
return {
ngModule: ngModule,
injector: elInjector, projectableNodes: projectableNodes,
selectorOrNode: rootSelectorOrNode, sanitizer: sanitizer, rendererFactory: rendererFactory, renderer: renderer, errorHandler: errorHandler
};
}
function debugCreateEmbeddedView(parentView, anchorDef, viewDef$$1, context) {
var defWithOverride = applyProviderOverridesToView(viewDef$$1);
return callWithDebugContext(DebugAction.create, createEmbeddedView, null, [parentView, anchorDef, defWithOverride, context]);
}
function debugCreateComponentView(parentView, nodeDef, viewDef$$1, hostElement) {
var overrideComponentView = viewDefOverrides.get(nodeDef.element.componentProvider.provider.token);
if (overrideComponentView) {
viewDef$$1 = overrideComponentView;
}
else {
viewDef$$1 = applyProviderOverridesToView(viewDef$$1);
}
return callWithDebugContext(DebugAction.create, createComponentView, null, [parentView, nodeDef, viewDef$$1, hostElement]);
}
function debugCreateNgModuleRef(moduleType, parentInjector, bootstrapComponents, def) {
var defWithOverride = applyProviderOverridesToNgModule(def);
return createNgModuleRef(moduleType, parentInjector, bootstrapComponents, defWithOverride);
}
var providerOverrides = new Map();
var providerOverridesWithScope = new Map();
var viewDefOverrides = new Map();
function debugOverrideProvider(override) {
providerOverrides.set(override.token, override);
if (typeof override.token === 'function' && override.token.ngInjectableDef &&
typeof override.token.ngInjectableDef.providedIn === 'function') {
providerOverridesWithScope.set(override.token, override);
}
}
function debugOverrideComponentView(comp, compFactory) {
var hostViewDef = resolveDefinition(getComponentViewDefinitionFactory(compFactory));
var compViewDef = resolveDefinition(hostViewDef.nodes[0].element.componentView);
viewDefOverrides.set(comp, compViewDef);
}
function debugClearOverrides() {
providerOverrides.clear();
providerOverridesWithScope.clear();
viewDefOverrides.clear();
}
// Notes about the algorithm:
// 1) Locate the providers of an element and check if one of them was overwritten
// 2) Change the providers of that element
//
// We only create new datastructures if we need to, to keep perf impact
// reasonable.
function applyProviderOverridesToView(def) {
if (providerOverrides.size === 0) {
return def;
}
var elementIndicesWithOverwrittenProviders = findElementIndicesWithOverwrittenProviders(def);
if (elementIndicesWithOverwrittenProviders.length === 0) {
return def;
}
// clone the whole view definition,
// as it maintains references between the nodes that are hard to update.
def = def.factory(function () { return NOOP; });
for (var i = 0; i < elementIndicesWithOverwrittenProviders.length; i++) {
applyProviderOverridesToElement(def, elementIndicesWithOverwrittenProviders[i]);
}
return def;
function findElementIndicesWithOverwrittenProviders(def) {
var elIndicesWithOverwrittenProviders = [];
var lastElementDef = null;
for (var i = 0; i < def.nodes.length; i++) {
var nodeDef = def.nodes[i];
if (nodeDef.flags & 1 /* TypeElement */) {
lastElementDef = nodeDef;
}
if (lastElementDef && nodeDef.flags & 3840 /* CatProviderNoDirective */ &&
providerOverrides.has(nodeDef.provider.token)) {
elIndicesWithOverwrittenProviders.push(lastElementDef.nodeIndex);
lastElementDef = null;
}
}
return elIndicesWithOverwrittenProviders;
}
function applyProviderOverridesToElement(viewDef$$1, elIndex) {
for (var i = elIndex + 1; i < viewDef$$1.nodes.length; i++) {
var nodeDef = viewDef$$1.nodes[i];
if (nodeDef.flags & 1 /* TypeElement */) {
// stop at the next element
return;
}
if (nodeDef.flags & 3840 /* CatProviderNoDirective */) {
var provider = nodeDef.provider;
var override = providerOverrides.get(provider.token);
if (override) {
nodeDef.flags = (nodeDef.flags & ~3840 /* CatProviderNoDirective */) | override.flags;
provider.deps = splitDepsDsl(override.deps);
provider.value = override.value;
}
}
}
}
}
// Notes about the algorithm:
// We only create new datastructures if we need to, to keep perf impact
// reasonable.
function applyProviderOverridesToNgModule(def) {
var _a = calcHasOverrides(def), hasOverrides = _a.hasOverrides, hasDeprecatedOverrides = _a.hasDeprecatedOverrides;
if (!hasOverrides) {
return def;
}
// clone the whole view definition,
// as it maintains references between the nodes that are hard to update.
def = def.factory(function () { return NOOP; });
applyProviderOverrides(def);
return def;
function calcHasOverrides(def) {
var hasOverrides = false;
var hasDeprecatedOverrides = false;
if (providerOverrides.size === 0) {
return { hasOverrides: hasOverrides, hasDeprecatedOverrides: hasDeprecatedOverrides };
}
def.providers.forEach(function (node) {
var override = providerOverrides.get(node.token);
if ((node.flags & 3840 /* CatProviderNoDirective */) && override) {
hasOverrides = true;
hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;
}
});
def.modules.forEach(function (module) {
providerOverridesWithScope.forEach(function (override, token) {
if (token.ngInjectableDef.providedIn === module) {
hasOverrides = true;
hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;
}
});
});
return { hasOverrides: hasOverrides, hasDeprecatedOverrides: hasDeprecatedOverrides };
}
function applyProviderOverrides(def) {
for (var i = 0; i < def.providers.length; i++) {
var provider = def.providers[i];
if (hasDeprecatedOverrides) {
// We had a bug where me made
// all providers lazy. Keep this logic behind a flag
// for migrating existing users.
provider.flags |= 4096 /* LazyProvider */;
}
var override = providerOverrides.get(provider.token);
if (override) {
provider.flags = (provider.flags & ~3840 /* CatProviderNoDirective */) | override.flags;
provider.deps = splitDepsDsl(override.deps);
provider.value = override.value;
}
}
if (providerOverridesWithScope.size > 0) {
var moduleSet_1 = new Set(def.modules);
providerOverridesWithScope.forEach(function (override, token) {
if (moduleSet_1.has(token.ngInjectableDef.providedIn)) {
var provider = {
token: token,
flags: override.flags | (hasDeprecatedOverrides ? 4096 /* LazyProvider */ : 0 /* None */),
deps: splitDepsDsl(override.deps),
value: override.value,
index: def.providers.length,
};
def.providers.push(provider);
def.providersByKey[tokenKey(token)] = provider;
}
});
}
}
}
function prodCheckAndUpdateNode(view, checkIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
var nodeDef = view.def.nodes[checkIndex];
checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
return (nodeDef.flags & 224 /* CatPureExpression */) ?
asPureExpressionData(view, checkIndex).value :
undefined;
}
function prodCheckNoChangesNode(view, checkIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
var nodeDef = view.def.nodes[checkIndex];
checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
return (nodeDef.flags & 224 /* CatPureExpression */) ?
asPureExpressionData(view, checkIndex).value :
undefined;
}
function debugCheckAndUpdateView(view) {
return callWithDebugContext(DebugAction.detectChanges, checkAndUpdateView, null, [view]);
}
function debugCheckNoChangesView(view) {
return callWithDebugContext(DebugAction.checkNoChanges, checkNoChangesView, null, [view]);
}
function debugDestroyView(view) {
return callWithDebugContext(DebugAction.destroy, destroyView, null, [view]);
}
var DebugAction;
(function (DebugAction) {
DebugAction[DebugAction["create"] = 0] = "create";
DebugAction[DebugAction["detectChanges"] = 1] = "detectChanges";
DebugAction[DebugAction["checkNoChanges"] = 2] = "checkNoChanges";
DebugAction[DebugAction["destroy"] = 3] = "destroy";
DebugAction[DebugAction["handleEvent"] = 4] = "handleEvent";
})(DebugAction || (DebugAction = {}));
var _currentAction;
var _currentView;
var _currentNodeIndex;
function debugSetCurrentNode(view, nodeIndex) {
_currentView = view;
_currentNodeIndex = nodeIndex;
}
function debugHandleEvent(view, nodeIndex, eventName, event) {
debugSetCurrentNode(view, nodeIndex);
return callWithDebugContext(DebugAction.handleEvent, view.def.handleEvent, null, [view, nodeIndex, eventName, event]);
}
function debugUpdateDirectives(view, checkType) {
if (view.state & 128 /* Destroyed */) {
throw viewDestroyedError(DebugAction[_currentAction]);
}
debugSetCurrentNode(view, nextDirectiveWithBinding(view, 0));
return view.def.updateDirectives(debugCheckDirectivesFn, view);
function debugCheckDirectivesFn(view, nodeIndex, argStyle) {
var values = [];
for (var _i = 3; _i < arguments.length; _i++) {
values[_i - 3] = arguments[_i];
}
var nodeDef = view.def.nodes[nodeIndex];
if (checkType === 0 /* CheckAndUpdate */) {
debugCheckAndUpdateNode(view, nodeDef, argStyle, values);
}
else {
debugCheckNoChangesNode(view, nodeDef, argStyle, values);
}
if (nodeDef.flags & 16384 /* TypeDirective */) {
debugSetCurrentNode(view, nextDirectiveWithBinding(view, nodeIndex));
}
return (nodeDef.flags & 224 /* CatPureExpression */) ?
asPureExpressionData(view, nodeDef.nodeIndex).value :
undefined;
}
}
function debugUpdateRenderer(view, checkType) {
if (view.state & 128 /* Destroyed */) {
throw viewDestroyedError(DebugAction[_currentAction]);
}
debugSetCurrentNode(view, nextRenderNodeWithBinding(view, 0));
return view.def.updateRenderer(debugCheckRenderNodeFn, view);
function debugCheckRenderNodeFn(view, nodeIndex, argStyle) {
var values = [];
for (var _i = 3; _i < arguments.length; _i++) {
values[_i - 3] = arguments[_i];
}
var nodeDef = view.def.nodes[nodeIndex];
if (checkType === 0 /* CheckAndUpdate */) {
debugCheckAndUpdateNode(view, nodeDef, argStyle, values);
}
else {
debugCheckNoChangesNode(view, nodeDef, argStyle, values);
}
if (nodeDef.flags & 3 /* CatRenderNode */) {
debugSetCurrentNode(view, nextRenderNodeWithBinding(view, nodeIndex));
}
return (nodeDef.flags & 224 /* CatPureExpression */) ?
asPureExpressionData(view, nodeDef.nodeIndex).value :
undefined;
}
}
function debugCheckAndUpdateNode(view, nodeDef, argStyle, givenValues) {
var changed = checkAndUpdateNode.apply(void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([view, nodeDef, argStyle], givenValues));
if (changed) {
var values = argStyle === 1 /* Dynamic */ ? givenValues[0] : givenValues;
if (nodeDef.flags & 16384 /* TypeDirective */) {
var bindingValues = {};
for (var i = 0; i < nodeDef.bindings.length; i++) {
var binding = nodeDef.bindings[i];
var value = values[i];
if (binding.flags & 8 /* TypeProperty */) {
bindingValues[normalizeDebugBindingName(binding.nonMinifiedName)] =
normalizeDebugBindingValue(value);
}
}
var elDef = nodeDef.parent;
var el = asElementData(view, elDef.nodeIndex).renderElement;
if (!elDef.element.name) {
// a comment.
view.renderer.setValue(el, "bindings=" + JSON.stringify(bindingValues, null, 2));
}
else {
// a regular element.
for (var attr in bindingValues) {
var value = bindingValues[attr];
if (value != null) {
view.renderer.setAttribute(el, attr, value);
}
else {
view.renderer.removeAttribute(el, attr);
}
}
}
}
}
}
function debugCheckNoChangesNode(view, nodeDef, argStyle, values) {
checkNoChangesNode.apply(void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([view, nodeDef, argStyle], values));
}
function normalizeDebugBindingName(name) {
// Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers
name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));
return "ng-reflect-" + name;
}
var CAMEL_CASE_REGEXP = /([A-Z])/g;
function camelCaseToDashCase(input) {
return input.replace(CAMEL_CASE_REGEXP, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i] = arguments[_i];
}
return '-' + m[1].toLowerCase();
});
}
function normalizeDebugBindingValue(value) {
try {
// Limit the size of the value as otherwise the DOM just gets polluted.
return value != null ? value.toString().slice(0, 30) : value;
}
catch (e) {
return '[ERROR] Exception while trying to serialize the value';
}
}
function nextDirectiveWithBinding(view, nodeIndex) {
for (var i = nodeIndex; i < view.def.nodes.length; i++) {
var nodeDef = view.def.nodes[i];
if (nodeDef.flags & 16384 /* TypeDirective */ && nodeDef.bindings && nodeDef.bindings.length) {
return i;
}
}
return null;
}
function nextRenderNodeWithBinding(view, nodeIndex) {
for (var i = nodeIndex; i < view.def.nodes.length; i++) {
var nodeDef = view.def.nodes[i];
if ((nodeDef.flags & 3 /* CatRenderNode */) && nodeDef.bindings && nodeDef.bindings.length) {
return i;
}
}
return null;
}
var DebugContext_ = /** @class */ (function () {
function DebugContext_(view, nodeIndex) {
this.view = view;
this.nodeIndex = nodeIndex;
if (nodeIndex == null) {
this.nodeIndex = nodeIndex = 0;
}
this.nodeDef = view.def.nodes[nodeIndex];
var elDef = this.nodeDef;
var elView = view;
while (elDef && (elDef.flags & 1 /* TypeElement */) === 0) {
elDef = elDef.parent;
}
if (!elDef) {
while (!elDef && elView) {
elDef = viewParentEl(elView);
elView = elView.parent;
}
}
this.elDef = elDef;
this.elView = elView;
}
Object.defineProperty(DebugContext_.prototype, "elOrCompView", {
get: function () {
// Has to be done lazily as we use the DebugContext also during creation of elements...
return asElementData(this.elView, this.elDef.nodeIndex).componentView || this.view;
},
enumerable: true,
configurable: true
});
Object.defineProperty(DebugContext_.prototype, "injector", {
get: function () { return createInjector$1(this.elView, this.elDef); },
enumerable: true,
configurable: true
});
Object.defineProperty(DebugContext_.prototype, "component", {
get: function () { return this.elOrCompView.component; },
enumerable: true,
configurable: true
});
Object.defineProperty(DebugContext_.prototype, "context", {
get: function () { return this.elOrCompView.context; },
enumerable: true,
configurable: true
});
Object.defineProperty(DebugContext_.prototype, "providerTokens", {
get: function () {
var tokens = [];
if (this.elDef) {
for (var i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount; i++) {
var childDef = this.elView.def.nodes[i];
if (childDef.flags & 20224 /* CatProvider */) {
tokens.push(childDef.provider.token);
}
i += childDef.childCount;
}
}
return tokens;
},
enumerable: true,
configurable: true
});
Object.defineProperty(DebugContext_.prototype, "references", {
get: function () {
var references = {};
if (this.elDef) {
collectReferences(this.elView, this.elDef, references);
for (var i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount; i++) {
var childDef = this.elView.def.nodes[i];
if (childDef.flags & 20224 /* CatProvider */) {
collectReferences(this.elView, childDef, references);
}
i += childDef.childCount;
}
}
return references;
},
enumerable: true,
configurable: true
});
Object.defineProperty(DebugContext_.prototype, "componentRenderElement", {
get: function () {
var elData = findHostElement(this.elOrCompView);
return elData ? elData.renderElement : undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(DebugContext_.prototype, "renderNode", {
get: function () {
return this.nodeDef.flags & 2 /* TypeText */ ? renderNode(this.view, this.nodeDef) :
renderNode(this.elView, this.elDef);
},
enumerable: true,
configurable: true
});
DebugContext_.prototype.logError = function (console) {
var values = [];
for (var _i = 1; _i < arguments.length; _i++) {
values[_i - 1] = arguments[_i];
}
var logViewDef;
var logNodeIndex;
if (this.nodeDef.flags & 2 /* TypeText */) {
logViewDef = this.view.def;
logNodeIndex = this.nodeDef.nodeIndex;
}
else {
logViewDef = this.elView.def;
logNodeIndex = this.elDef.nodeIndex;
}
// Note: we only generate a log function for text and element nodes
// to make the generated code as small as possible.
var renderNodeIndex = getRenderNodeIndex(logViewDef, logNodeIndex);
var currRenderNodeIndex = -1;
var nodeLogger = function () {
currRenderNodeIndex++;
if (currRenderNodeIndex === renderNodeIndex) {
return (_a = console.error).bind.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([console], values));
}
else {
return NOOP;
}
var _a;
};
logViewDef.factory(nodeLogger);
if (currRenderNodeIndex < renderNodeIndex) {
console.error('Illegal state: the ViewDefinitionFactory did not call the logger!');
console.error.apply(console, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(values));
}
};
return DebugContext_;
}());
function getRenderNodeIndex(viewDef$$1, nodeIndex) {
var renderNodeIndex = -1;
for (var i = 0; i <= nodeIndex; i++) {
var nodeDef = viewDef$$1.nodes[i];
if (nodeDef.flags & 3 /* CatRenderNode */) {
renderNodeIndex++;
}
}
return renderNodeIndex;
}
function findHostElement(view) {
while (view && !isComponentView(view)) {
view = view.parent;
}
if (view.parent) {
return asElementData(view.parent, viewParentEl(view).nodeIndex);
}
return null;
}
function collectReferences(view, nodeDef, references) {
for (var refName in nodeDef.references) {
references[refName] = getQueryValue(view, nodeDef, nodeDef.references[refName]);
}
}
function callWithDebugContext(action, fn, self, args) {
var oldAction = _currentAction;
var oldView = _currentView;
var oldNodeIndex = _currentNodeIndex;
try {
_currentAction = action;
var result = fn.apply(self, args);
_currentView = oldView;
_currentNodeIndex = oldNodeIndex;
_currentAction = oldAction;
return result;
}
catch (e) {
if (isViewDebugError(e) || !_currentView) {
throw e;
}
throw viewWrappedDebugError(e, getCurrentDebugContext());
}
}
function getCurrentDebugContext() {
return _currentView ? new DebugContext_(_currentView, _currentNodeIndex) : null;
}
var DebugRendererFactory2 = /** @class */ (function () {
function DebugRendererFactory2(delegate) {
this.delegate = delegate;
}
DebugRendererFactory2.prototype.createRenderer = function (element, renderData) {
return new DebugRenderer2(this.delegate.createRenderer(element, renderData));
};
DebugRendererFactory2.prototype.begin = function () {
if (this.delegate.begin) {
this.delegate.begin();
}
};
DebugRendererFactory2.prototype.end = function () {
if (this.delegate.end) {
this.delegate.end();
}
};
DebugRendererFactory2.prototype.whenRenderingDone = function () {
if (this.delegate.whenRenderingDone) {
return this.delegate.whenRenderingDone();
}
return Promise.resolve(null);
};
return DebugRendererFactory2;
}());
var DebugRenderer2 = /** @class */ (function () {
function DebugRenderer2(delegate) {
this.delegate = delegate;
this.data = this.delegate.data;
}
DebugRenderer2.prototype.destroyNode = function (node) {
removeDebugNodeFromIndex(getDebugNode(node));
if (this.delegate.destroyNode) {
this.delegate.destroyNode(node);
}
};
DebugRenderer2.prototype.destroy = function () { this.delegate.destroy(); };
DebugRenderer2.prototype.createElement = function (name, namespace) {
var el = this.delegate.createElement(name, namespace);
var debugCtx = getCurrentDebugContext();
if (debugCtx) {
var debugEl = new DebugElement(el, null, debugCtx);
debugEl.name = name;
indexDebugNode(debugEl);
}
return el;
};
DebugRenderer2.prototype.createComment = function (value) {
var comment = this.delegate.createComment(value);
var debugCtx = getCurrentDebugContext();
if (debugCtx) {
indexDebugNode(new DebugNode(comment, null, debugCtx));
}
return comment;
};
DebugRenderer2.prototype.createText = function (value) {
var text = this.delegate.createText(value);
var debugCtx = getCurrentDebugContext();
if (debugCtx) {
indexDebugNode(new DebugNode(text, null, debugCtx));
}
return text;
};
DebugRenderer2.prototype.appendChild = function (parent, newChild) {
var debugEl = getDebugNode(parent);
var debugChildEl = getDebugNode(newChild);
if (debugEl && debugChildEl && debugEl instanceof DebugElement) {
debugEl.addChild(debugChildEl);
}
this.delegate.appendChild(parent, newChild);
};
DebugRenderer2.prototype.insertBefore = function (parent, newChild, refChild) {
var debugEl = getDebugNode(parent);
var debugChildEl = getDebugNode(newChild);
var debugRefEl = getDebugNode(refChild);
if (debugEl && debugChildEl && debugEl instanceof DebugElement) {
debugEl.insertBefore(debugRefEl, debugChildEl);
}
this.delegate.insertBefore(parent, newChild, refChild);
};
DebugRenderer2.prototype.removeChild = function (parent, oldChild) {
var debugEl = getDebugNode(parent);
var debugChildEl = getDebugNode(oldChild);
if (debugEl && debugChildEl && debugEl instanceof DebugElement) {
debugEl.removeChild(debugChildEl);
}
this.delegate.removeChild(parent, oldChild);
};
DebugRenderer2.prototype.selectRootElement = function (selectorOrNode) {
var el = this.delegate.selectRootElement(selectorOrNode);
var debugCtx = getCurrentDebugContext();
if (debugCtx) {
indexDebugNode(new DebugElement(el, null, debugCtx));
}
return el;
};
DebugRenderer2.prototype.setAttribute = function (el, name, value, namespace) {
var debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement) {
var fullName = namespace ? namespace + ':' + name : name;
debugEl.attributes[fullName] = value;
}
this.delegate.setAttribute(el, name, value, namespace);
};
DebugRenderer2.prototype.removeAttribute = function (el, name, namespace) {
var debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement) {
var fullName = namespace ? namespace + ':' + name : name;
debugEl.attributes[fullName] = null;
}
this.delegate.removeAttribute(el, name, namespace);
};
DebugRenderer2.prototype.addClass = function (el, name) {
var debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement) {
debugEl.classes[name] = true;
}
this.delegate.addClass(el, name);
};
DebugRenderer2.prototype.removeClass = function (el, name) {
var debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement) {
debugEl.classes[name] = false;
}
this.delegate.removeClass(el, name);
};
DebugRenderer2.prototype.setStyle = function (el, style, value, flags) {
var debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement) {
debugEl.styles[style] = value;
}
this.delegate.setStyle(el, style, value, flags);
};
DebugRenderer2.prototype.removeStyle = function (el, style, flags) {
var debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement) {
debugEl.styles[style] = null;
}
this.delegate.removeStyle(el, style, flags);
};
DebugRenderer2.prototype.setProperty = function (el, name, value) {
var debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement) {
debugEl.properties[name] = value;
}
this.delegate.setProperty(el, name, value);
};
DebugRenderer2.prototype.listen = function (target, eventName, callback) {
if (typeof target !== 'string') {
var debugEl = getDebugNode(target);
if (debugEl) {
debugEl.listeners.push(new EventListener(eventName, callback));
}
}
return this.delegate.listen(target, eventName, callback);
};
DebugRenderer2.prototype.parentNode = function (node) { return this.delegate.parentNode(node); };
DebugRenderer2.prototype.nextSibling = function (node) { return this.delegate.nextSibling(node); };
DebugRenderer2.prototype.setValue = function (node, value) { return this.delegate.setValue(node, value); };
return DebugRenderer2;
}());
/**
* @license
* Copyright Google Inc. 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
*/
function overrideProvider(override) {
initServicesIfNeeded();
return Services.overrideProvider(override);
}
function overrideComponentView(comp, componentFactory) {
initServicesIfNeeded();
return Services.overrideComponentView(comp, componentFactory);
}
function clearOverrides() {
initServicesIfNeeded();
return Services.clearOverrides();
}
// Attention: this function is called as top level function.
// Putting any logic in here will destroy closure tree shaking!
function createNgModuleFactory(ngModuleType, bootstrapComponents, defFactory) {
return new NgModuleFactory_(ngModuleType, bootstrapComponents, defFactory);
}
var NgModuleFactory_ = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NgModuleFactory_, _super);
function NgModuleFactory_(moduleType, _bootstrapComponents, _ngModuleDefFactory) {
var _this =
// Attention: this ctor is called as top level function.
// Putting any logic in here will destroy closure tree shaking!
_super.call(this) || this;
_this.moduleType = moduleType;
_this._bootstrapComponents = _bootstrapComponents;
_this._ngModuleDefFactory = _ngModuleDefFactory;
return _this;
}
NgModuleFactory_.prototype.create = function (parentInjector) {
initServicesIfNeeded();
var def = resolveDefinition(this._ngModuleDefFactory);
return Services.createNgModuleRef(this.moduleType, parentInjector || Injector.NULL, this._bootstrapComponents, def);
};
return NgModuleFactory_;
}(NgModuleFactory));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
function assertEqual(actual, expected, msg) {
if (actual != expected) {
throwError(msg);
}
}
function assertNotEqual(actual, expected, msg) {
if (actual == expected) {
throwError(msg);
}
}
function assertSame(actual, expected, msg) {
if (actual !== expected) {
throwError(msg);
}
}
function assertLessThan(actual, expected, msg) {
if (actual >= expected) {
throwError(msg);
}
}
function assertGreaterThan(actual, expected, msg) {
if (actual <= expected) {
throwError(msg);
}
}
function assertNull(actual, msg) {
if (actual != null) {
throwError(msg);
}
}
function assertNotNull(actual, msg) {
if (actual == null) {
throwError(msg);
}
}
function assertComponentType(actual, msg) {
if (msg === void 0) { msg = 'Type passed in is not ComponentType, it does not have \'ngComponentDef\' property.'; }
if (!actual.ngComponentDef) {
throwError(msg);
}
}
function throwError(msg) {
debugger; // Left intentionally for better debugger experience.
throw new Error("ASSERTION ERROR: " + msg);
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* If this is the first template pass, any ngOnInit or ngDoCheck hooks will be queued into
* TView.initHooks during directiveCreate.
*
* The directive index and hook type are encoded into one number (1st bit: type, remaining bits:
* directive index), then saved in the even indices of the initHooks array. The odd indices
* hold the hook functions themselves.
*
* @param index The index of the directive in LView.data
* @param hooks The static hooks map on the directive def
* @param tView The current TView
*/
function queueInitHooks(index, onInit, doCheck, tView) {
ngDevMode &&
assertEqual(tView.firstTemplatePass, true, 'Should only be called on first template pass');
if (onInit) {
(tView.initHooks || (tView.initHooks = [])).push(index, onInit);
}
if (doCheck) {
(tView.initHooks || (tView.initHooks = [])).push(index, doCheck);
(tView.checkHooks || (tView.checkHooks = [])).push(index, doCheck);
}
}
/**
* Loops through the directives on a node and queues all their hooks except ngOnInit
* and ngDoCheck, which are queued separately in directiveCreate.
*/
function queueLifecycleHooks(flags, currentView) {
var tView = currentView.tView;
if (tView.firstTemplatePass === true) {
var start = flags >> 13 /* DirectiveStartingIndexShift */;
var count = flags & 4095 /* DirectiveCountMask */;
var end = start + count;
// It's necessary to loop through the directives at elementEnd() (rather than processing in
// directiveCreate) so we can preserve the current hook order. Content, view, and destroy
// hooks for projected components and directives must be called *before* their hosts.
for (var i = start; i < end; i++) {
var def = tView.directives[i];
queueContentHooks(def, tView, i);
queueViewHooks(def, tView, i);
queueDestroyHooks(def, tView, i);
}
}
}
/** Queues afterContentInit and afterContentChecked hooks on TView */
function queueContentHooks(def, tView, i) {
if (def.afterContentInit) {
(tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentInit);
}
if (def.afterContentChecked) {
(tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentChecked);
(tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, def.afterContentChecked);
}
}
/** Queues afterViewInit and afterViewChecked hooks on TView */
function queueViewHooks(def, tView, i) {
if (def.afterViewInit) {
(tView.viewHooks || (tView.viewHooks = [])).push(i, def.afterViewInit);
}
if (def.afterViewChecked) {
(tView.viewHooks || (tView.viewHooks = [])).push(i, def.afterViewChecked);
(tView.viewCheckHooks || (tView.viewCheckHooks = [])).push(i, def.afterViewChecked);
}
}
/** Queues onDestroy hooks on TView */
function queueDestroyHooks(def, tView, i) {
if (def.onDestroy != null) {
(tView.destroyHooks || (tView.destroyHooks = [])).push(i, def.onDestroy);
}
}
/**
* Calls onInit and doCheck calls if they haven't already been called.
*
* @param currentView The current view
*/
function executeInitHooks(currentView, tView, creationMode) {
if (currentView.lifecycleStage === 1 /* Init */) {
executeHooks(currentView.directives, tView.initHooks, tView.checkHooks, creationMode);
currentView.lifecycleStage = 2 /* AfterInit */;
}
}
/**
* Iterates over afterViewInit and afterViewChecked functions and calls them.
*
* @param currentView The current view
*/
function executeHooks(data, allHooks, checkHooks, creationMode) {
var hooksToCall = creationMode ? allHooks : checkHooks;
if (hooksToCall) {
callHooks(data, hooksToCall);
}
}
/**
* Calls lifecycle hooks with their contexts, skipping init hooks if it's not
* creation mode.
*
* @param currentView The current view
* @param arr The array in which the hooks are found
*/
function callHooks(data, arr) {
for (var i = 0; i < arr.length; i += 2) {
arr[i + 1].call(data[arr[i]]);
}
}
/**
* @license
* Copyright Google Inc. 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
*/
if (typeof ngDevMode == 'undefined') {
if (typeof window != 'undefined')
window.ngDevMode = true;
if (typeof self != 'undefined')
self.ngDevMode = true;
if (typeof global != 'undefined')
global.ngDevMode = true;
}
/**
* @license
* Copyright Google Inc. 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 NG_PROJECT_AS_ATTR_NAME = 'ngProjectAs';
/**
* @license
* Copyright Google Inc. 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
*/
function assertNodeType(node, type) {
assertNotNull(node, 'should be called with a node');
assertEqual(node.type, type, "should be a " + typeName(type));
}
function assertNodeOfPossibleTypes(node) {
var types = [];
for (var _i = 1; _i < arguments.length; _i++) {
types[_i - 1] = arguments[_i];
}
assertNotNull(node, 'should be called with a node');
var found = types.some(function (type) { return node.type === type; });
assertEqual(found, true, "Should be one of " + types.map(typeName).join(', '));
}
function typeName(type) {
if (type == 1 /* Projection */)
return 'Projection';
if (type == 0 /* Container */)
return 'Container';
if (type == 2 /* View */)
return 'View';
if (type == 3 /* Element */)
return 'Element';
return '<unknown>';
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
// TODO: cleanup once the code is merged in angular/angular
var RendererStyleFlags3;
(function (RendererStyleFlags3) {
RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important";
RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase";
})(RendererStyleFlags3 || (RendererStyleFlags3 = {}));
/** Returns whether the `renderer` is a `ProceduralRenderer3` */
function isProceduralRenderer(renderer) {
return !!(renderer.listen);
}
var domRendererFactory3 = {
createRenderer: function (hostElement, rendererType) { return document; }
};
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Must use this method for CD (instead of === ) since NaN !== NaN
*/
function isDifferent(a, b) {
// NaN is the only value that is not equal to itself so the first
// test checks if both a and b are not NaN
return !(a !== a && b !== b) && a !== b;
}
function stringify$1(value) {
if (typeof value == 'function')
return value.name || value;
if (typeof value == 'string')
return value;
if (value == null)
return '';
return '' + value;
}
/**
* Function that throws a "not implemented" error so it's clear certain
* behaviors/methods aren't yet ready.
*
* @returns Not implemented error
*/
function notImplemented() {
return new Error('NotImplemented');
}
/**
* Flattens an array in non-recursive way. Input arrays are not modified.
*/
function flatten$1(list) {
var result = [];
var i = 0;
while (i < list.length) {
var item = list[i];
if (Array.isArray(item)) {
if (item.length > 0) {
list = item.concat(list.slice(i + 1));
i = 0;
}
else {
i++;
}
}
else {
result.push(item);
i++;
}
}
return result;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Returns the first RNode following the given LNode in the same parent DOM element.
*
* This is needed in order to insert the given node with insertBefore.
*
* @param node The node whose following DOM node must be found.
* @param stopNode A parent node at which the lookup in the tree should be stopped, or null if the
* lookup should not be stopped until the result is found.
* @returns RNode before which the provided node should be inserted or null if the lookup was
* stopped
* or if there is no native node after the given logical node in the same native parent.
*/
function findNextRNodeSibling(node, stopNode) {
var currentNode = node;
while (currentNode && currentNode !== stopNode) {
var pNextOrParent = currentNode.pNextOrParent;
if (pNextOrParent) {
while (pNextOrParent.type !== 1 /* Projection */) {
var nativeNode = findFirstRNode(pNextOrParent);
if (nativeNode) {
return nativeNode;
}
pNextOrParent = pNextOrParent.pNextOrParent;
}
currentNode = pNextOrParent;
}
else {
var currentSibling = currentNode.next;
while (currentSibling) {
var nativeNode = findFirstRNode(currentSibling);
if (nativeNode) {
return nativeNode;
}
currentSibling = currentSibling.next;
}
var parentNode = currentNode.parent;
currentNode = null;
if (parentNode) {
var parentType = parentNode.type;
if (parentType === 0 /* Container */ || parentType === 2 /* View */) {
currentNode = parentNode;
}
}
}
}
return null;
}
/**
* Get the next node in the LNode tree, taking into account the place where a node is
* projected (in the shadow DOM) rather than where it comes from (in the light DOM).
*
* @param node The node whose next node in the LNode tree must be found.
* @return LNode|null The next sibling in the LNode tree.
*/
function getNextLNodeWithProjection(node) {
var pNextOrParent = node.pNextOrParent;
if (pNextOrParent) {
// The node is projected
var isLastProjectedNode = pNextOrParent.type === 1 /* Projection */;
// returns pNextOrParent if we are not at the end of the list, null otherwise
return isLastProjectedNode ? null : pNextOrParent;
}
// returns node.next because the the node is not projected
return node.next;
}
/**
* Find the next node in the LNode tree, taking into account the place where a node is
* projected (in the shadow DOM) rather than where it comes from (in the light DOM).
*
* If there is no sibling node, this function goes to the next sibling of the parent node...
* until it reaches rootNode (at which point null is returned).
*
* @param initialNode The node whose following node in the LNode tree must be found.
* @param rootNode The root node at which the lookup should stop.
* @return LNode|null The following node in the LNode tree.
*/
function getNextOrParentSiblingNode(initialNode, rootNode) {
var node = initialNode;
var nextNode = getNextLNodeWithProjection(node);
while (node && !nextNode) {
// if node.pNextOrParent is not null here, it is not the next node
// (because, at this point, nextNode is null, so it is the parent)
node = node.pNextOrParent || node.parent;
if (node === rootNode) {
return null;
}
nextNode = node && getNextLNodeWithProjection(node);
}
return nextNode;
}
/**
* Returns the first RNode inside the given LNode.
*
* @param node The node whose first DOM node must be found
* @returns RNode The first RNode of the given LNode or null if there is none.
*/
function findFirstRNode(rootNode) {
var node = rootNode;
while (node) {
var nextNode = null;
if (node.type === 3 /* Element */) {
// A LElementNode has a matching RNode in LElementNode.native
return node.native;
}
else if (node.type === 0 /* Container */) {
var lContainerNode = node;
var childContainerData = lContainerNode.dynamicLContainerNode ?
lContainerNode.dynamicLContainerNode.data :
lContainerNode.data;
nextNode = childContainerData.views.length ? childContainerData.views[0].child : null;
}
else if (node.type === 1 /* Projection */) {
// For Projection look at the first projected node
nextNode = node.data.head;
}
else {
// Otherwise look at the first child
nextNode = node.child;
}
node = nextNode === null ? getNextOrParentSiblingNode(node, rootNode) : nextNode;
}
return null;
}
function createTextNode(value, renderer) {
return isProceduralRenderer(renderer) ? renderer.createText(stringify$1(value)) :
renderer.createTextNode(stringify$1(value));
}
function addRemoveViewFromContainer(container, rootNode, insertMode, beforeNode) {
ngDevMode && assertNodeType(container, 0 /* Container */);
ngDevMode && assertNodeType(rootNode, 2 /* View */);
var parentNode = container.data.renderParent;
var parent = parentNode ? parentNode.native : null;
var node = rootNode.child;
if (parent) {
while (node) {
var nextNode = null;
var renderer = container.view.renderer;
if (node.type === 3 /* Element */) {
if (insertMode) {
if (!node.native) {
// If the native element doesn't exist, this is a bound text node that hasn't yet been
// created because update mode has not run (occurs when a bound text node is a root
// node of a dynamically created view). See textBinding() in instructions for ctx.
node.native = createTextNode('', renderer);
}
isProceduralRenderer(renderer) ?
renderer.insertBefore(parent, node.native, beforeNode) :
parent.insertBefore(node.native, beforeNode, true);
}
else {
isProceduralRenderer(renderer) ? renderer.removeChild(parent, node.native) :
parent.removeChild(node.native);
}
nextNode = node.next;
}
else if (node.type === 0 /* Container */) {
// if we get to a container, it must be a root node of a view because we are only
// propagating down into child views / containers and not child elements
var childContainerData = node.data;
childContainerData.renderParent = parentNode;
nextNode = childContainerData.views.length ? childContainerData.views[0].child : null;
}
else if (node.type === 1 /* Projection */) {
nextNode = node.data.head;
}
else {
nextNode = node.child;
}
if (nextNode === null) {
node = getNextOrParentSiblingNode(node, rootNode);
}
else {
node = nextNode;
}
}
}
}
/**
* Traverses the tree of component views and containers to remove listeners and
* call onDestroy callbacks.
*
* Notes:
* - Because it's used for onDestroy calls, it needs to be bottom-up.
* - Must process containers instead of their views to avoid splicing
* when views are destroyed and re-added.
* - Using a while loop because it's faster than recursion
* - Destroy only called on movement to sibling or movement to parent (laterally or up)
*
* @param rootView The view to destroy
*/
function destroyViewTree(rootView) {
var viewOrContainer = rootView;
while (viewOrContainer) {
var next = null;
if (viewOrContainer.views && viewOrContainer.views.length) {
next = viewOrContainer.views[0].data;
}
else if (viewOrContainer.child) {
next = viewOrContainer.child;
}
else if (viewOrContainer.next) {
cleanUpView(viewOrContainer);
next = viewOrContainer.next;
}
if (next == null) {
// If the viewOrContainer is the rootView, then the cleanup is done twice.
// Without this check, ngOnDestroy would be called twice for a directive on an element.
while (viewOrContainer && !viewOrContainer.next && viewOrContainer !== rootView) {
cleanUpView(viewOrContainer);
viewOrContainer = getParentState(viewOrContainer, rootView);
}
cleanUpView(viewOrContainer || rootView);
next = viewOrContainer && viewOrContainer.next;
}
viewOrContainer = next;
}
}
/**
* Inserts a view into a container.
*
* This adds the view to the container's array of active views in the correct
* position. It also adds the view's elements to the DOM if the container isn't a
* root node of another view (in that case, the view's elements will be added when
* the container's parent view is added later).
*
* @param container The container into which the view should be inserted
* @param newView The view to insert
* @param index The index at which to insert the view
* @returns The inserted view
*/
function insertView(container, newView, index) {
var state = container.data;
var views = state.views;
if (index > 0) {
// This is a new view, we need to add it to the children.
setViewNext(views[index - 1], newView);
}
if (index < views.length) {
setViewNext(newView, views[index]);
views.splice(index, 0, newView);
}
else {
views.push(newView);
}
// If the container's renderParent is null, we know that it is a root node of its own parent view
// and we should wait until that parent processes its nodes (otherwise, we will insert this view's
// nodes twice - once now and once when its parent inserts its views).
if (container.data.renderParent !== null) {
var beforeNode = findNextRNodeSibling(newView, container);
if (!beforeNode) {
var containerNextNativeNode = container.native;
if (containerNextNativeNode === undefined) {
containerNextNativeNode = container.native = findNextRNodeSibling(container, null);
}
beforeNode = containerNextNativeNode;
}
addRemoveViewFromContainer(container, newView, true, beforeNode);
}
return newView;
}
/**
* Removes a view from a container.
*
* This method splices the view from the container's array of active views. It also
* removes the view's elements from the DOM and conducts cleanup (e.g. removing
* listeners, calling onDestroys).
*
* @param container The container from which to remove a view
* @param removeIndex The index of the view to remove
* @returns The removed view
*/
function removeView(container, removeIndex) {
var views = container.data.views;
var viewNode = views[removeIndex];
if (removeIndex > 0) {
setViewNext(views[removeIndex - 1], viewNode.next);
}
views.splice(removeIndex, 1);
viewNode.next = null;
destroyViewTree(viewNode.data);
addRemoveViewFromContainer(container, viewNode, false);
// Notify query that view has been removed
container.data.queries && container.data.queries.removeView(removeIndex);
return viewNode;
}
/**
* Sets a next on the view node, so views in for loops can easily jump from
* one view to the next to add/remove elements. Also adds the LView (view.data)
* to the view tree for easy traversal when cleaning up the view.
*
* @param view The view to set up
* @param next The view's new next
*/
function setViewNext(view, next) {
view.next = next;
view.data.next = next ? next.data : null;
}
/**
* Determines which LViewOrLContainer to jump to when traversing back up the
* tree in destroyViewTree.
*
* Normally, the view's parent LView should be checked, but in the case of
* embedded views, the container (which is the view node's parent, but not the
* LView's parent) needs to be checked for a possible next property.
*
* @param state The LViewOrLContainer for which we need a parent state
* @param rootView The rootView, so we don't propagate too far up the view tree
* @returns The correct parent LViewOrLContainer
*/
function getParentState(state, rootView) {
var node;
if ((node = state.node) && node.type === 2 /* View */) {
// if it's an embedded view, the state needs to go up to the container, in case the
// container has a next
return node.parent.data;
}
else {
// otherwise, use parent view for containers or component views
return state.parent === rootView ? null : state.parent;
}
}
/**
* Removes all listeners and call all onDestroys in a given view.
*
* @param view The LView to clean up
*/
function cleanUpView(view) {
removeListeners(view);
executeOnDestroys(view);
executePipeOnDestroys(view);
}
/** Removes listeners and unsubscribes from output subscriptions */
function removeListeners(view) {
var cleanup = view.cleanup;
if (cleanup != null) {
for (var i = 0; i < cleanup.length - 1; i += 2) {
if (typeof cleanup[i] === 'string') {
cleanup[i + 1].removeEventListener(cleanup[i], cleanup[i + 2], cleanup[i + 3]);
i += 2;
}
else {
cleanup[i].call(cleanup[i + 1]);
}
}
view.cleanup = null;
}
}
/** Calls onDestroy hooks for this view */
function executeOnDestroys(view) {
var tView = view.tView;
var destroyHooks;
if (tView != null && (destroyHooks = tView.destroyHooks) != null) {
callHooks(view.directives, destroyHooks);
}
}
/** Calls pipe destroy hooks for this view */
function executePipeOnDestroys(view) {
var pipeDestroyHooks = view.tView && view.tView.pipeDestroyHooks;
if (pipeDestroyHooks) {
callHooks(view.data, pipeDestroyHooks);
}
}
/**
* Returns whether a native element should be inserted in the given parent.
*
* The native node can be inserted when its parent is:
* - A regular element => Yes
* - A component host element =>
* - if the `currentView` === the parent `view`: The element is in the content (vs the
* template)
* => don't add as the parent component will project if needed.
* - `currentView` !== the parent `view` => The element is in the template (vs the content),
* add it
* - View element => delay insertion, will be done on `viewEnd()`
*
* @param parent The parent in which to insert the child
* @param currentView The LView being processed
* @return boolean Whether the child element should be inserted.
*/
function canInsertNativeNode(parent, currentView) {
var parentIsElement = parent.type === 3 /* Element */;
return parentIsElement &&
(parent.view !== currentView || parent.data === null /* Regular Element. */);
}
/**
* Appends the `child` element to the `parent`.
*
* The element insertion might be delayed {@link canInsertNativeNode}
*
* @param parent The parent to which to append the child
* @param child The child that should be appended
* @param currentView The current LView
* @returns Whether or not the child was appended
*/
function appendChild(parent, child, currentView) {
if (child !== null && canInsertNativeNode(parent, currentView)) {
// We only add element if not in View or not projected.
var renderer = currentView.renderer;
isProceduralRenderer(renderer) ? renderer.appendChild(parent.native, child) :
parent.native.appendChild(child);
return true;
}
return false;
}
/**
* Inserts the provided node before the correct element in the DOM.
*
* The element insertion might be delayed {@link canInsertNativeNode}
*
* @param node Node to insert
* @param currentView Current LView
*/
function insertChild(node, currentView) {
var parent = node.parent;
if (canInsertNativeNode(parent, currentView)) {
var nativeSibling = findNextRNodeSibling(node, null);
var renderer = currentView.renderer;
isProceduralRenderer(renderer) ?
renderer.insertBefore(parent.native, node.native, nativeSibling) :
parent.native.insertBefore(node.native, nativeSibling, false);
}
}
/**
* Appends a projected node to the DOM, or in the case of a projected container,
* appends the nodes from all of the container's active views to the DOM.
*
* @param node The node to process
* @param currentParent The last parent element to be processed
* @param currentView Current LView
*/
function appendProjectedNode(node, currentParent, currentView) {
if (node.type !== 0 /* Container */) {
appendChild(currentParent, node.native, currentView);
}
else {
// The node we are adding is a Container and we are adding it to Element which
// is not a component (no more re-projection).
// Alternatively a container is projected at the root of a component's template
// and can't be re-projected (as not content of any component).
// Assignee the final projection location in those cases.
var lContainer = node.data;
lContainer.renderParent = currentParent;
var views = lContainer.views;
for (var i = 0; i < views.length; i++) {
addRemoveViewFromContainer(node, views[i], true, null);
}
}
if (node.dynamicLContainerNode) {
node.dynamicLContainerNode.data.renderParent = currentParent;
}
}
/**
* @license
* Copyright Google Inc. 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
*/
function isCssClassMatching(nodeClassAttrVal, cssClassToMatch) {
var nodeClassesLen = nodeClassAttrVal.length;
var matchIndex = nodeClassAttrVal.indexOf(cssClassToMatch);
var matchEndIdx = matchIndex + cssClassToMatch.length;
if (matchIndex === -1 // no match
|| (matchIndex > 0 && nodeClassAttrVal[matchIndex - 1] !== ' ') // no space before
||
(matchEndIdx < nodeClassesLen && nodeClassAttrVal[matchEndIdx] !== ' ')) {
return false;
}
return true;
}
/**
* A utility function to match an Ivy node static data against a simple CSS selector
*
* @param node static data to match
* @param selector
* @returns true if node matches the selector.
*/
function isNodeMatchingSelector(tNode, selector) {
ngDevMode && assertNotNull(selector[0], 'Selector should have a tag name');
var mode = 4 /* ELEMENT */;
var nodeAttrs = tNode.attrs;
// When processing ":not" selectors, we skip to the next ":not" if the
// current one doesn't match
var skipToNextSelector = false;
for (var i = 0; i < selector.length; i++) {
var current = selector[i];
if (typeof current === 'number') {
// If we finish processing a :not selector and it hasn't failed, return false
if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {
return false;
}
// If we are skipping to the next :not() and this mode flag is positive,
// it's a part of the current :not() selector, and we should keep skipping
if (skipToNextSelector && isPositive(current))
continue;
skipToNextSelector = false;
mode = current | (mode & 1 /* NOT */);
continue;
}
if (skipToNextSelector)
continue;
if (mode & 4 /* ELEMENT */) {
mode = 2 /* ATTRIBUTE */ | mode & 1 /* NOT */;
if (current !== '' && current !== tNode.tagName) {
if (isPositive(mode))
return false;
skipToNextSelector = true;
}
}
else {
var attrName = mode & 8 /* CLASS */ ? 'class' : current;
var attrIndexInNode = findAttrIndexInNode(attrName, nodeAttrs);
if (attrIndexInNode === -1) {
if (isPositive(mode))
return false;
skipToNextSelector = true;
continue;
}
var selectorAttrValue = mode & 8 /* CLASS */ ? current : selector[++i];
if (selectorAttrValue !== '') {
var nodeAttrValue = nodeAttrs[attrIndexInNode + 1];
if (mode & 8 /* CLASS */ &&
!isCssClassMatching(nodeAttrValue, selectorAttrValue) ||
mode & 2 /* ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) {
if (isPositive(mode))
return false;
skipToNextSelector = true;
}
}
}
}
return isPositive(mode) || skipToNextSelector;
}
function isPositive(mode) {
return (mode & 1 /* NOT */) === 0;
}
function findAttrIndexInNode(name, attrs) {
if (attrs === null)
return -1;
for (var i = 0; i < attrs.length; i += 2) {
if (attrs[i] === name)
return i;
}
return -1;
}
function isNodeMatchingSelectorList(tNode, selector) {
for (var i = 0; i < selector.length; i++) {
if (isNodeMatchingSelector(tNode, selector[i])) {
return true;
}
}
return false;
}
function getProjectAsAttrValue(tNode) {
var nodeAttrs = tNode.attrs;
if (nodeAttrs != null) {
var ngProjectAsAttrIdx = nodeAttrs.indexOf(NG_PROJECT_AS_ATTR_NAME);
// only check for ngProjectAs in attribute names, don't accidentally match attribute's value
// (attribute names are stored at even indexes)
if ((ngProjectAsAttrIdx & 1) === 0) {
return nodeAttrs[ngProjectAsAttrIdx + 1];
}
}
return null;
}
/**
* Checks a given node against matching selectors and returns
* selector index (or 0 if none matched).
*
* This function takes into account the ngProjectAs attribute: if present its value will be compared
* to the raw (un-parsed) CSS selector instead of using standard selector matching logic.
*/
function matchingSelectorIndex(tNode, selectors, textSelectors) {
var ngProjectAsAttrVal = getProjectAsAttrValue(tNode);
for (var i = 0; i < selectors.length; i++) {
// if a node has the ngProjectAs attribute match it against unparsed selector
// match a node against a parsed selector only if ngProjectAs attribute is not present
if (ngProjectAsAttrVal === textSelectors[i] ||
ngProjectAsAttrVal === null && isNodeMatchingSelectorList(tNode, selectors[i])) {
return i + 1; // first matching selector "captures" a given node
}
}
return 0;
}
/** Called when directives inject each other (creating a circular dependency) */
function throwCyclicDependencyError(token) {
throw new Error("Cannot instantiate cyclic dependency! " + token);
}
/** Called when there are multiple component selectors that match a given node */
function throwMultipleComponentError(tNode) {
throw new Error("Multiple components match node with tagname " + tNode.tagName);
}
/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */
function throwErrorIfNoChangesMode(creationMode, checkNoChangesMode, oldValue, currValue) {
if (checkNoChangesMode) {
var msg = "ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '" + oldValue + "'. Current value: '" + currValue + "'.";
if (creationMode) {
msg +=
" It seems like the view has been created after its parent and its children have been dirty checked." +
" Has it been created in a change detection hook ?";
}
// TODO: include debug context
throw new Error(msg);
}
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Directive (D) sets a property on all component instances using this constant as a key and the
* component's host node (LElement) as the value. This is used in methods like detectChanges to
* facilitate jumping from an instance to the host node.
*/
var NG_HOST_SYMBOL = '__ngHostLNode__';
/**
* A permanent marker promise which signifies that the current CD tree is
* clean.
*/
var _CLEAN_PROMISE = Promise.resolve(null);
/**
* Directive and element indices for top-level directive.
*
* Saved here to avoid re-instantiating an array on every change detection run.
*/
var _ROOT_DIRECTIVE_INDICES = [0, 0];
/**
* Token set in currentMatches while dependencies are being resolved.
*
* If we visit a directive that has a value set to CIRCULAR, we know we've
* already seen it, and thus have a circular dependency.
*/
var CIRCULAR$2 = '__CIRCULAR__';
/**
* This property gets set before entering a template.
*
* This renderer can be one of two varieties of Renderer3:
*
* - ObjectedOrientedRenderer3
*
* This is the native browser API style, e.g. operations are methods on individual objects
* like HTMLElement. With this style, no additional code is needed as a facade (reducing payload
* size).
*
* - ProceduralRenderer3
*
* In non-native browser environments (e.g. platforms such as web-workers), this is the facade
* that enables element manipulation. This also facilitates backwards compatibility with
* Renderer2.
*/
var renderer;
var rendererFactory;
function getRenderer() {
// top level variables should not be exported for performance reason (PERF_NOTES.md)
return renderer;
}
/** Used to set the parent property when nodes are created. */
var previousOrParentNode;
function getPreviousOrParentNode() {
// top level variables should not be exported for performance reason (PERF_NOTES.md)
return previousOrParentNode;
}
/**
* If `isParent` is:
* - `true`: then `previousOrParentNode` points to a parent node.
* - `false`: then `previousOrParentNode` points to previous node (sibling).
*/
var isParent;
/**
* Static data that corresponds to the instance-specific data array on an LView.
*
* Each node's static data is stored in tData at the same index that it's stored
* in the data array. Any nodes that do not have static data store a null value in
* tData to avoid a sparse array.
*/
var tData;
/**
* State of the current view being processed.
*
* NOTE: we cheat here and initialize it to `null` even thought the type does not
* contain `null`. This is because we expect this value to be not `null` as soon
* as we enter the view. Declaring the type as `null` would require us to place `!`
* in most instructions since they all assume that `currentView` is defined.
*/
var currentView = null;
var currentQueries;
function getCurrentQueries(QueryType) {
// top level variables should not be exported for performance reason (PERF_NOTES.md)
return currentQueries || (currentQueries = new QueryType());
}
/**
* This property gets set before entering a template.
*/
var creationMode;
function getCreationMode() {
// top level variables should not be exported for performance reason (PERF_NOTES.md)
return creationMode;
}
/**
* An array of nodes (text, element, container, etc), pipes, their bindings, and
* any local variables that need to be stored between invocations.
*/
var data;
/**
* An array of directive instances in the current view.
*
* These must be stored separately from LNodes because their presence is
* unknown at compile-time and thus space cannot be reserved in data[].
*/
var directives;
/**
* When a view is destroyed, listeners need to be released and outputs need to be
* unsubscribed. This cleanup array stores both listener data (in chunks of 4)
* and output data (in chunks of 2) for a particular view. Combining the arrays
* saves on memory (70 bytes per array) and on a few bytes of code size (for two
* separate for loops).
*
* If it's a listener being stored:
* 1st index is: event name to remove
* 2nd index is: native element
* 3rd index is: listener function
* 4th index is: useCapture boolean
*
* If it's an output subscription:
* 1st index is: unsubscribe function
* 2nd index is: context for function
*/
var cleanup;
/**
* In this mode, any changes in bindings will throw an ExpressionChangedAfterChecked error.
*
* Necessary to support ChangeDetectorRef.checkNoChanges().
*/
var checkNoChangesMode = false;
/** Whether or not this is the first time the current view has been processed. */
var firstTemplatePass = true;
/**
* Swap the current state with a new state.
*
* For performance reasons we store the state in the top level of the module.
* This way we minimize the number of properties to read. Whenever a new view
* is entered we have to store the state for later, and when the view is
* exited the state has to be restored
*
* @param newView New state to become active
* @param host Element to which the View is a child of
* @returns the previous state;
*/
function enterView(newView, host) {
var oldView = currentView;
data = newView && newView.data;
directives = newView && newView.directives;
tData = newView && newView.tView.data;
creationMode = newView && (newView.flags & 1 /* CreationMode */) === 1 /* CreationMode */;
firstTemplatePass = newView && newView.tView.firstTemplatePass;
cleanup = newView && newView.cleanup;
renderer = newView && newView.renderer;
if (newView && newView.bindingIndex < 0) {
newView.bindingIndex = newView.bindingStartIndex;
}
if (host != null) {
previousOrParentNode = host;
isParent = true;
}
currentView = newView;
currentQueries = newView && newView.queries;
return oldView;
}
/**
* Used in lieu of enterView to make it clear when we are exiting a child view. This makes
* the direction of traversal (up or down the view tree) a bit clearer.
*/
function leaveView(newView) {
if (!checkNoChangesMode) {
executeHooks(directives, currentView.tView.viewHooks, currentView.tView.viewCheckHooks, creationMode);
}
// Views should be clean and in update mode after being checked, so these bits are cleared
currentView.flags &= ~(1 /* CreationMode */ | 4 /* Dirty */);
currentView.lifecycleStage = 1 /* Init */;
currentView.bindingIndex = -1;
enterView(newView, null);
}
/** Refreshes directives in this view and triggers any init/content hooks. */
function refreshDirectives() {
executeInitAndContentHooks();
var tView = currentView.tView;
// This needs to be set before children are processed to support recursive components
tView.firstTemplatePass = firstTemplatePass = false;
setHostBindings(tView.hostBindings);
refreshChildComponents(tView.components);
}
/** Sets the host bindings for the current view. */
function setHostBindings(bindings) {
if (bindings != null) {
var defs = currentView.tView.directives;
for (var i = 0; i < bindings.length; i += 2) {
var dirIndex = bindings[i];
var def = defs[dirIndex];
def.hostBindings && def.hostBindings(dirIndex, bindings[i + 1]);
}
}
}
/** Refreshes child components in the current view. */
function refreshChildComponents(components) {
if (components != null) {
for (var i = 0; i < components.length; i += 2) {
componentRefresh(components[i], components[i + 1]);
}
}
}
function executeInitAndContentHooks() {
if (!checkNoChangesMode) {
var tView = currentView.tView;
executeInitHooks(currentView, tView, creationMode);
executeHooks(directives, tView.contentHooks, tView.contentCheckHooks, creationMode);
}
}
function createLView(viewId, renderer, tView, template, context, flags) {
var newView = {
parent: currentView,
id: viewId,
flags: flags | 1 /* CreationMode */ | 8 /* Attached */,
node: null,
data: [],
directives: null,
tView: tView,
cleanup: null,
renderer: renderer,
child: null,
tail: null,
next: null,
bindingStartIndex: -1,
bindingIndex: -1,
template: template,
context: context,
dynamicViewCount: 0,
lifecycleStage: 1 /* Init */,
queries: null,
injector: currentView && currentView.injector,
};
return newView;
}
/**
* Creation of LNode object is extracted to a separate function so we always create LNode object
* with the same shape
* (same properties assigned in the same order).
*/
function createLNodeObject(type, currentView, parent, native, state, queries) {
return {
type: type,
native: native,
view: currentView,
parent: parent,
child: null,
next: null,
nodeInjector: parent ? parent.nodeInjector : null,
data: state,
queries: queries,
tNode: null,
pNextOrParent: null,
dynamicLContainerNode: null
};
}
function createLNode(index, type, native, state) {
var parent = isParent ? previousOrParentNode :
previousOrParentNode && previousOrParentNode.parent;
var queries = (isParent ? currentQueries : previousOrParentNode && previousOrParentNode.queries) ||
parent && parent.queries && parent.queries.child();
var isState = state != null;
var node = createLNodeObject(type, currentView, parent, native, isState ? state : null, queries);
if ((type & 2 /* ViewOrElement */) === 2 /* ViewOrElement */ && isState) {
// Bit of a hack to bust through the readonly because there is a circular dep between
// LView and LNode.
ngDevMode && assertNull(state.node, 'LView.node should not have been initialized');
state.node = node;
}
if (index != null) {
// We are Element or Container
ngDevMode && assertDataNext(index);
data[index] = node;
// Every node adds a value to the static data array to avoid a sparse array
if (index >= tData.length) {
tData[index] = null;
}
else {
node.tNode = tData[index];
}
// Now link ourselves into the tree.
if (isParent) {
currentQueries = null;
if (previousOrParentNode.view === currentView ||
previousOrParentNode.type === 2 /* View */) {
// We are in the same view, which means we are adding content node to the parent View.
ngDevMode && assertNull(previousOrParentNode.child, "previousOrParentNode's child should not have been set.");
previousOrParentNode.child = node;
}
}
else if (previousOrParentNode) {
ngDevMode && assertNull(previousOrParentNode.next, "previousOrParentNode's next property should not have been set " + index + ".");
previousOrParentNode.next = node;
if (previousOrParentNode.dynamicLContainerNode) {
previousOrParentNode.dynamicLContainerNode.next = node;
}
}
}
previousOrParentNode = node;
isParent = true;
return node;
}
//////////////////////////
//// Render
//////////////////////////
/**
* Resets the application state.
*/
function resetApplicationState() {
isParent = false;
previousOrParentNode = null;
}
function renderEmbeddedTemplate(viewNode, template, context, renderer, directives, pipes) {
var _isParent = isParent;
var _previousOrParentNode = previousOrParentNode;
var oldView;
try {
isParent = true;
previousOrParentNode = null;
var rf = 2 /* Update */;
if (viewNode == null) {
var tView = getOrCreateTView(template, directives || null, pipes || null);
var lView = createLView(-1, renderer, tView, template, context, 2 /* CheckAlways */);
viewNode = createLNode(null, 2 /* View */, null, lView);
rf = 1 /* Create */;
}
oldView = enterView(viewNode.data, viewNode);
template(rf, context);
refreshDirectives();
refreshDynamicChildren();
}
finally {
leaveView(oldView);
isParent = _isParent;
previousOrParentNode = _previousOrParentNode;
}
return viewNode;
}
function renderComponentOrTemplate(node, hostView, componentOrContext, template) {
var oldView = enterView(hostView, node);
try {
if (rendererFactory.begin) {
rendererFactory.begin();
}
if (template) {
template(getRenderFlags(hostView), componentOrContext);
refreshDynamicChildren();
refreshDirectives();
}
else {
executeInitAndContentHooks();
// Element was stored at 0 in data and directive was stored at 0 in directives
// in renderComponent()
setHostBindings(_ROOT_DIRECTIVE_INDICES);
componentRefresh(0, 0);
}
}
finally {
if (rendererFactory.end) {
rendererFactory.end();
}
leaveView(oldView);
}
}
/**
* This function returns the default configuration of rendering flags depending on when the
* template is in creation mode or update mode. By default, the update block is run with the
* creation block when the view is in creation mode. Otherwise, the update block is run
* alone.
*
* Dynamically created views do NOT use this configuration (update block and create block are
* always run separately).
*/
function getRenderFlags(view) {
return view.flags & 1 /* CreationMode */ ? 1 /* Create */ | 2 /* Update */ :
2 /* Update */;
}
//////////////////////////
//// Element
//////////////////////////
/**
* Create DOM element. The instruction must later be followed by `elementEnd()` call.
*
* @param index Index of the element in the data array
* @param name Name of the DOM Node
* @param attrs Statically bound set of attributes to be written into the DOM element on creation.
* @param localRefs A set of local reference bindings on the element.
*
* Attributes and localRefs are passed as an array of strings where elements with an even index
* hold an attribute name and elements with an odd index hold an attribute value, ex.:
* ['id', 'warning5', 'class', 'alert']
*/
function elementStart(index, name, attrs, localRefs) {
ngDevMode &&
assertEqual(currentView.bindingStartIndex, -1, 'elements should be created before any bindings');
var native = renderer.createElement(name);
var node = createLNode(index, 3 /* Element */, native, null);
if (attrs)
setUpAttributes(native, attrs);
appendChild(node.parent, native, currentView);
createDirectivesAndLocals(index, name, attrs, localRefs, null);
return native;
}
function createDirectivesAndLocals(index, name, attrs, localRefs, containerData) {
var node = previousOrParentNode;
if (firstTemplatePass) {
ngDevMode && assertDataInRange(index - 1);
node.tNode = tData[index] = createTNode(name, attrs || null, containerData);
cacheMatchingDirectivesForNode(node.tNode, currentView.tView, localRefs || null);
}
else {
instantiateDirectivesDirectly();
}
saveResolvedLocalsInData();
}
/**
* On first template pass, we match each node against available directive selectors and save
* the resulting defs in the correct instantiation order for subsequent change detection runs
* (so dependencies are always created before the directives that inject them).
*/
function cacheMatchingDirectivesForNode(tNode, tView, localRefs) {
// Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.
var exportsMap = localRefs ? { '': -1 } : null;
var matches = tView.currentMatches = findDirectiveMatches(tNode);
if (matches) {
for (var i = 0; i < matches.length; i += 2) {
var def = matches[i];
var valueIndex = i + 1;
resolveDirective(def, valueIndex, matches, tView);
saveNameToExportMap(matches[valueIndex], def, exportsMap);
}
}
if (exportsMap)
cacheMatchingLocalNames(tNode, localRefs, exportsMap);
}
/** Matches the current node against all available selectors. */
function findDirectiveMatches(tNode) {
var registry = currentView.tView.directiveRegistry;
var matches = null;
if (registry) {
for (var i = 0; i < registry.length; i++) {
var def = registry[i];
if (isNodeMatchingSelectorList(tNode, def.selectors)) {
if (def.template) {
if (tNode.flags & 4096 /* isComponent */)
throwMultipleComponentError(tNode);
tNode.flags = 4096 /* isComponent */;
}
if (def.diPublic)
def.diPublic(def);
(matches || (matches = [])).push(def, null);
}
}
}
return matches;
}
function resolveDirective(def, valueIndex, matches, tView) {
if (matches[valueIndex] === null) {
matches[valueIndex] = CIRCULAR$2;
var instance = def.factory();
(tView.directives || (tView.directives = [])).push(def);
return directiveCreate(matches[valueIndex] = tView.directives.length - 1, instance, def);
}
else if (matches[valueIndex] === CIRCULAR$2) {
// If we revisit this directive before it's resolved, we know it's circular
throwCyclicDependencyError(def.type);
}
return null;
}
/** Stores index of component's host element so it will be queued for view refresh during CD. */
function queueComponentIndexForCheck(dirIndex) {
if (firstTemplatePass) {
(currentView.tView.components || (currentView.tView.components = [])).push(dirIndex, data.length - 1);
}
}
/** Stores index of directive and host element so it will be queued for binding refresh during CD.
*/
function queueHostBindingForCheck(dirIndex) {
ngDevMode &&
assertEqual(firstTemplatePass, true, 'Should only be called in first template pass.');
(currentView.tView.hostBindings || (currentView.tView.hostBindings = [])).push(dirIndex, data.length - 1);
}
/** Sets the context for a ChangeDetectorRef to the given instance. */
function initChangeDetectorIfExisting(injector, instance, view) {
if (injector && injector.changeDetectorRef != null) {
injector.changeDetectorRef._setComponentContext(view, instance);
}
}
function isComponent(tNode) {
return (tNode.flags & 4096 /* isComponent */) === 4096 /* isComponent */;
}
/**
* This function instantiates the given directives.
*/
function instantiateDirectivesDirectly() {
var tNode = previousOrParentNode.tNode;
var count = tNode.flags & 4095 /* DirectiveCountMask */;
if (count > 0) {
var start = tNode.flags >> 13 /* DirectiveStartingIndexShift */;
var end = start + count;
var tDirectives = currentView.tView.directives;
for (var i = start; i < end; i++) {
var def = tDirectives[i];
directiveCreate(i, def.factory(), def);
}
}
}
/** Caches local names and their matching directive indices for query and template lookups. */
function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
if (localRefs) {
var localNames = tNode.localNames = [];
// Local names must be stored in tNode in the same order that localRefs are defined
// in the template to ensure the data is loaded in the same slots as their refs
// in the template (for template queries).
for (var i = 0; i < localRefs.length; i += 2) {
var index = exportsMap[localRefs[i + 1]];
if (index == null)
throw new Error("Export of name '" + localRefs[i + 1] + "' not found!");
localNames.push(localRefs[i], index);
}
}
}
/**
* Builds up an export map as directives are created, so local refs can be quickly mapped
* to their directive instances.
*/
function saveNameToExportMap(index, def, exportsMap) {
if (exportsMap) {
if (def.exportAs)
exportsMap[def.exportAs] = index;
if (def.template)
exportsMap[''] = index;
}
}
/**
* Takes a list of local names and indices and pushes the resolved local variable values
* to data[] in the same order as they are loaded in the template with load().
*/
function saveResolvedLocalsInData() {
var localNames = previousOrParentNode.tNode.localNames;
if (localNames) {
for (var i = 0; i < localNames.length; i += 2) {
var index = localNames[i + 1];
var value = index === -1 ? previousOrParentNode.native : directives[index];
data.push(value);
}
}
}
/**
* Gets TView from a template function or creates a new TView
* if it doesn't already exist.
*
* @param template The template from which to get static data
* @param directives Directive defs that should be saved on TView
* @param pipes Pipe defs that should be saved on TView
* @returns TView
*/
function getOrCreateTView(template, directives, pipes) {
return template.ngPrivateData ||
(template.ngPrivateData = createTView(directives, pipes));
}
/** Creates a TView instance */
function createTView(defs, pipes) {
return {
data: [],
directives: null,
firstTemplatePass: true,
initHooks: null,
checkHooks: null,
contentHooks: null,
contentCheckHooks: null,
viewHooks: null,
viewCheckHooks: null,
destroyHooks: null,
pipeDestroyHooks: null,
hostBindings: null,
components: null,
directiveRegistry: typeof defs === 'function' ? defs() : defs,
pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,
currentMatches: null
};
}
function setUpAttributes(native, attrs) {
ngDevMode && assertEqual(attrs.length % 2, 0, 'each attribute should have a key and a value');
var isProc = isProceduralRenderer(renderer);
for (var i = 0; i < attrs.length; i += 2) {
var attrName = attrs[i];
if (attrName !== NG_PROJECT_AS_ATTR_NAME) {
var attrVal = attrs[i + 1];
isProc ? renderer.setAttribute(native, attrName, attrVal) :
native.setAttribute(attrName, attrVal);
}
}
}
function createError(text, token) {
return new Error("Renderer: " + text + " [" + stringify$1(token) + "]");
}
/**
* Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.
*
* @param elementOrSelector Render element or CSS selector to locate the element.
*/
function locateHostElement(factory, elementOrSelector) {
ngDevMode && assertDataInRange(-1);
rendererFactory = factory;
var defaultRenderer = factory.createRenderer(null, null);
var rNode = typeof elementOrSelector === 'string' ?
(isProceduralRenderer(defaultRenderer) ?
defaultRenderer.selectRootElement(elementOrSelector) :
defaultRenderer.querySelector(elementOrSelector)) :
elementOrSelector;
if (ngDevMode && !rNode) {
if (typeof elementOrSelector === 'string') {
throw createError('Host node with selector not found:', elementOrSelector);
}
else {
throw createError('Host node is required:', elementOrSelector);
}
}
return rNode;
}
/**
* Creates the host LNode.
*
* @param rNode Render host element.
* @param def ComponentDef
*
* @returns LElementNode created
*/
function hostElement(tag, rNode, def) {
resetApplicationState();
var node = createLNode(0, 3 /* Element */, rNode, createLView(-1, renderer, getOrCreateTView(def.template, def.directiveDefs, def.pipeDefs), null, null, def.onPush ? 4 /* Dirty */ : 2 /* CheckAlways */));
if (firstTemplatePass) {
node.tNode = createTNode(tag, null, null);
node.tNode.flags = 4096 /* isComponent */;
if (def.diPublic)
def.diPublic(def);
currentView.tView.directives = [def];
}
return node;
}
/**
* Adds an event listener to the current node.
*
* If an output exists on one of the node's directives, it also subscribes to the output
* and saves the subscription for later cleanup.
*
* @param eventName Name of the event
* @param listenerFn The function to be called when event emits
* @param useCapture Whether or not to use capture in event listener.
*/
function listener(eventName, listenerFn, useCapture) {
if (useCapture === void 0) { useCapture = false; }
ngDevMode && assertPreviousIsParent();
var node = previousOrParentNode;
var native = node.native;
// In order to match current behavior, native DOM event listeners must be added for all
// events (including outputs).
var cleanupFns = cleanup || (cleanup = currentView.cleanup = []);
if (isProceduralRenderer(renderer)) {
var wrappedListener = wrapListenerWithDirtyLogic(currentView, listenerFn);
var cleanupFn = renderer.listen(native, eventName, wrappedListener);
cleanupFns.push(cleanupFn, null);
}
else {
var wrappedListener = wrapListenerWithDirtyAndDefault(currentView, listenerFn);
native.addEventListener(eventName, wrappedListener, useCapture);
cleanupFns.push(eventName, native, wrappedListener, useCapture);
}
var tNode = node.tNode;
if (tNode.outputs === undefined) {
// if we create TNode here, inputs must be undefined so we know they still need to be
// checked
tNode.outputs = generatePropertyAliases(node.tNode.flags, 1 /* Output */);
}
var outputs = tNode.outputs;
var outputData;
if (outputs && (outputData = outputs[eventName])) {
createOutput(outputData, listenerFn);
}
}
/**
* Iterates through the outputs associated with a particular event name and subscribes to
* each output.
*/
function createOutput(outputs, listener) {
for (var i = 0; i < outputs.length; i += 2) {
ngDevMode && assertDataInRange(outputs[i], directives);
var subscription = directives[outputs[i]][outputs[i + 1]].subscribe(listener);
cleanup.push(subscription.unsubscribe, subscription);
}
}
/** Mark the end of the element. */
function elementEnd() {
if (isParent) {
isParent = false;
}
else {
ngDevMode && assertHasParent();
previousOrParentNode = previousOrParentNode.parent;
}
ngDevMode && assertNodeType(previousOrParentNode, 3 /* Element */);
var queries = previousOrParentNode.queries;
queries && queries.addNode(previousOrParentNode);
queueLifecycleHooks(previousOrParentNode.tNode.flags, currentView);
}
/**
* Updates the value of removes an attribute on an Element.
*
* @param number index The index of the element in the data array
* @param name name The name of the attribute.
* @param value value The attribute is removed when value is `null` or `undefined`.
* Otherwise the attribute value is set to the stringified value.
* @param sanitizer An optional function used to sanitize the value.
*/
function elementAttribute(index, name, value, sanitizer) {
if (value !== NO_CHANGE) {
var element = data[index];
if (value == null) {
isProceduralRenderer(renderer) ? renderer.removeAttribute(element.native, name) :
element.native.removeAttribute(name);
}
else {
var strValue = sanitizer == null ? stringify$1(value) : sanitizer(value);
isProceduralRenderer(renderer) ? renderer.setAttribute(element.native, name, strValue) :
element.native.setAttribute(name, strValue);
}
}
}
/**
* Update a property on an Element.
*
* If the property name also exists as an input property on one of the element's directives,
* the component property will be set instead of the element property. This check must
* be conducted at runtime so child components that add new @Inputs don't have to be re-compiled.
*
* @param index The index of the element to update in the data array
* @param propName Name of property. Because it is going to DOM, this is not subject to
* renaming as part of minification.
* @param value New value to write.
* @param sanitizer An optional function used to sanitize the value.
*/
function elementProperty(index, propName, value, sanitizer) {
if (value === NO_CHANGE)
return;
var node = data[index];
var tNode = node.tNode;
// if tNode.inputs is undefined, a listener has created outputs, but inputs haven't
// yet been checked
if (tNode && tNode.inputs === undefined) {
// mark inputs as checked
tNode.inputs = generatePropertyAliases(node.tNode.flags, 0 /* Input */);
}
var inputData = tNode && tNode.inputs;
var dataValue;
if (inputData && (dataValue = inputData[propName])) {
setInputsForProperty(dataValue, value);
markDirtyIfOnPush(node);
}
else {
// It is assumed that the sanitizer is only added when the compiler determines that the property
// is risky, so sanitization can be done without further checks.
value = sanitizer != null ? sanitizer(value) : value;
var native = node.native;
isProceduralRenderer(renderer) ? renderer.setProperty(native, propName, value) :
(native.setProperty ? native.setProperty(propName, value) :
native[propName] = value);
}
}
/**
* Constructs a TNode object from the arguments.
*
* @param tagName
* @param attrs
* @param data
* @param localNames A list of local names and their matching indices
* @returns the TNode object
*/
function createTNode(tagName, attrs, data) {
return {
flags: 0,
tagName: tagName,
attrs: attrs,
localNames: null,
initialInputs: undefined,
inputs: undefined,
outputs: undefined,
data: data
};
}
/**
* Given a list of directive indices and minified input names, sets the
* input properties on the corresponding directives.
*/
function setInputsForProperty(inputs, value) {
for (var i = 0; i < inputs.length; i += 2) {
ngDevMode && assertDataInRange(inputs[i], directives);
directives[inputs[i]][inputs[i + 1]] = value;
}
}
/**
* Consolidates all inputs or outputs of all directives on this logical node.
*
* @param number lNodeFlags logical node flags
* @param Direction direction whether to consider inputs or outputs
* @returns PropertyAliases|null aggregate of all properties if any, `null` otherwise
*/
function generatePropertyAliases(tNodeFlags, direction) {
var count = tNodeFlags & 4095 /* DirectiveCountMask */;
var propStore = null;
if (count > 0) {
var start = tNodeFlags >> 13 /* DirectiveStartingIndexShift */;
var end = start + count;
var isInput = direction === 0 /* Input */;
var defs = currentView.tView.directives;
for (var i = start; i < end; i++) {
var directiveDef = defs[i];
var propertyAliasMap = isInput ? directiveDef.inputs : directiveDef.outputs;
for (var publicName in propertyAliasMap) {
if (propertyAliasMap.hasOwnProperty(publicName)) {
propStore = propStore || {};
var internalName = propertyAliasMap[publicName];
var hasProperty = propStore.hasOwnProperty(publicName);
hasProperty ? propStore[publicName].push(i, internalName) :
(propStore[publicName] = [i, internalName]);
}
}
}
}
return propStore;
}
/**
* Add or remove a class in a `classList` on a DOM element.
*
* This instruction is meant to handle the [class.foo]="exp" case
*
* @param index The index of the element to update in the data array
* @param className Name of class to toggle. Because it is going to DOM, this is not subject to
* renaming as part of minification.
* @param value A value indicating if a given class should be added or removed.
*/
function elementClassNamed(index, className, value) {
if (value !== NO_CHANGE) {
var lElement = data[index];
if (value) {
isProceduralRenderer(renderer) ? renderer.addClass(lElement.native, className) :
lElement.native.classList.add(className);
}
else {
isProceduralRenderer(renderer) ? renderer.removeClass(lElement.native, className) :
lElement.native.classList.remove(className);
}
}
}
/**
* Set the `className` property on a DOM element.
*
* This instruction is meant to handle the `[class]="exp"` usage.
*
* `elementClass` instruction writes the value to the "element's" `className` property.
*
* @param index The index of the element to update in the data array
* @param value A value indicating a set of classes which should be applied. The method overrides
* any existing classes. The value is stringified (`toString`) before it is applied to the
* element.
*/
function elementClass(index, value) {
if (value !== NO_CHANGE) {
// TODO: This is a naive implementation which simply writes value to the `className`. In the
// future
// we will add logic here which would work with the animation code.
var lElement = data[index];
isProceduralRenderer(renderer) ? renderer.setProperty(lElement.native, 'className', value) :
lElement.native['className'] = stringify$1(value);
}
}
function elementStyleNamed(index, styleName, value, suffixOrSanitizer) {
if (value !== NO_CHANGE) {
var lElement = data[index];
if (value == null) {
isProceduralRenderer(renderer) ?
renderer.removeStyle(lElement.native, styleName, RendererStyleFlags3.DashCase) :
lElement.native['style'].removeProperty(styleName);
}
else {
var strValue = typeof suffixOrSanitizer == 'function' ? suffixOrSanitizer(value) : stringify$1(value);
if (typeof suffixOrSanitizer == 'string')
strValue = strValue + suffixOrSanitizer;
isProceduralRenderer(renderer) ?
renderer.setStyle(lElement.native, styleName, strValue, RendererStyleFlags3.DashCase) :
lElement.native['style'].setProperty(styleName, strValue);
}
}
}
/**
* Set the `style` property on a DOM element.
*
* This instruction is meant to handle the `[style]="exp"` usage.
*
*
* @param index The index of the element to update in the data array
* @param value A value indicating if a given style should be added or removed.
* The expected shape of `value` is an object where keys are style names and the values
* are their corresponding values to set. If value is falsy than the style is remove. An absence
* of style does not cause that style to be removed. `NO_CHANGE` implies that no update should be
* performed.
*/
function elementStyle(index, value) {
if (value !== NO_CHANGE) {
// TODO: This is a naive implementation which simply writes value to the `style`. In the future
// we will add logic here which would work with the animation code.
var lElement = data[index];
if (isProceduralRenderer(renderer)) {
renderer.setProperty(lElement.native, 'style', value);
}
else {
var style = lElement.native['style'];
for (var i = 0, keys = Object.keys(value); i < keys.length; i++) {
var styleName = keys[i];
var styleValue = value[styleName];
styleValue == null ? style.removeProperty(styleName) :
style.setProperty(styleName, styleValue);
}
}
}
}
//////////////////////////
//// Text
//////////////////////////
/**
* Create static text node
*
* @param index Index of the node in the data array.
* @param value Value to write. This value will be stringified.
* If value is not provided than the actual creation of the text node is delayed.
*/
function text(index, value) {
ngDevMode &&
assertEqual(currentView.bindingStartIndex, -1, 'text nodes should be created before bindings');
var textNode = value != null ? createTextNode(value, renderer) : null;
var node = createLNode(index, 3 /* Element */, textNode);
// Text nodes are self closing.
isParent = false;
appendChild(node.parent, textNode, currentView);
}
/**
* Create text node with binding
* Bindings should be handled externally with the proper bind(1-8) method
*
* @param index Index of the node in the data array.
* @param value Stringified value to write.
*/
function textBinding(index, value) {
ngDevMode && assertDataInRange(index);
var existingNode = data[index];
ngDevMode && assertNotNull(existingNode, 'existing node');
if (existingNode.native) {
// If DOM node exists and value changed, update textContent
value !== NO_CHANGE &&
(isProceduralRenderer(renderer) ? renderer.setValue(existingNode.native, stringify$1(value)) :
existingNode.native.textContent = stringify$1(value));
}
else {
// Node was created but DOM node creation was delayed. Create and append now.
existingNode.native = createTextNode(value, renderer);
insertChild(existingNode, currentView);
}
}
//////////////////////////
//// Directive
//////////////////////////
/**
* Create a directive.
*
* NOTE: directives can be created in order other than the index order. They can also
* be retrieved before they are created in which case the value will be null.
*
* @param directive The directive instance.
* @param directiveDef DirectiveDef object which contains information about the template.
*/
function directiveCreate(index, directive, directiveDef) {
var instance = baseDirectiveCreate(index, directive, directiveDef);
ngDevMode && assertNotNull(previousOrParentNode.tNode, 'previousOrParentNode.tNode');
var tNode = previousOrParentNode.tNode;
var isComponent = directiveDef.template;
if (isComponent) {
addComponentLogic(index, directive, directiveDef);
}
if (firstTemplatePass) {
// Init hooks are queued now so ngOnInit is called in host components before
// any projected components.
queueInitHooks(index, directiveDef.onInit, directiveDef.doCheck, currentView.tView);
if (directiveDef.hostBindings)
queueHostBindingForCheck(index);
}
if (tNode && tNode.attrs) {
setInputsFromAttrs(index, instance, directiveDef.inputs, tNode);
}
return instance;
}
function addComponentLogic(index, instance, def) {
var tView = getOrCreateTView(def.template, def.directiveDefs, def.pipeDefs);
// Only component views should be added to the view tree directly. Embedded views are
// accessed through their containers because they may be removed / re-added later.
var hostView = addToViewTree(currentView, createLView(-1, rendererFactory.createRenderer(previousOrParentNode.native, def.rendererType), tView, null, null, def.onPush ? 4 /* Dirty */ : 2 /* CheckAlways */));
previousOrParentNode.data = hostView;
hostView.node = previousOrParentNode;
initChangeDetectorIfExisting(previousOrParentNode.nodeInjector, instance, hostView);
if (firstTemplatePass)
queueComponentIndexForCheck(index);
}
/**
* A lighter version of directiveCreate() that is used for the root component
*
* This version does not contain features that we don't already support at root in
* current Angular. Example: local refs and inputs on root component.
*/
function baseDirectiveCreate(index, directive, directiveDef) {
ngDevMode &&
assertEqual(currentView.bindingStartIndex, -1, 'directives should be created before any bindings');
ngDevMode && assertPreviousIsParent();
Object.defineProperty(directive, NG_HOST_SYMBOL, { enumerable: false, value: previousOrParentNode });
if (directives == null)
currentView.directives = directives = [];
ngDevMode && assertDataNext(index, directives);
directives[index] = directive;
if (firstTemplatePass) {
var flags = previousOrParentNode.tNode.flags;
if ((flags & 4095 /* DirectiveCountMask */) === 0) {
// When the first directive is created:
// - save the index,
// - set the number of directives to 1
previousOrParentNode.tNode.flags =
index << 13 /* DirectiveStartingIndexShift */ | flags & 4096 /* isComponent */ | 1;
}
else {
// Only need to bump the size when subsequent directives are created
ngDevMode && assertNotEqual(flags & 4095 /* DirectiveCountMask */, 4095 /* DirectiveCountMask */, 'Reached the max number of directives');
previousOrParentNode.tNode.flags++;
}
}
else {
var diPublic = directiveDef.diPublic;
if (diPublic)
diPublic(directiveDef);
}
if (directiveDef.attributes != null && previousOrParentNode.type == 3 /* Element */) {
setUpAttributes(previousOrParentNode.native, directiveDef.attributes);
}
return directive;
}
/**
* Sets initial input properties on directive instances from attribute data
*
* @param directiveIndex Index of the directive in directives array
* @param instance Instance of the directive on which to set the initial inputs
* @param inputs The list of inputs from the directive def
* @param tNode The static data for this node
*/
function setInputsFromAttrs(directiveIndex, instance, inputs, tNode) {
var initialInputData = tNode.initialInputs;
if (initialInputData === undefined || directiveIndex >= initialInputData.length) {
initialInputData = generateInitialInputs(directiveIndex, inputs, tNode);
}
var initialInputs = initialInputData[directiveIndex];
if (initialInputs) {
for (var i = 0; i < initialInputs.length; i += 2) {
instance[initialInputs[i]] = initialInputs[i + 1];
}
}
}
/**
* Generates initialInputData for a node and stores it in the template's static storage
* so subsequent template invocations don't have to recalculate it.
*
* initialInputData is an array containing values that need to be set as input properties
* for directives on this node, but only once on creation. We need this array to support
* the case where you set an @Input property of a directive using attribute-like syntax.
* e.g. if you have a `name` @Input, you can set it once like this:
*
* <my-component name="Bess"></my-component>
*
* @param directiveIndex Index to store the initial input data
* @param inputs The list of inputs from the directive def
* @param tNode The static data on this node
*/
function generateInitialInputs(directiveIndex, inputs, tNode) {
var initialInputData = tNode.initialInputs || (tNode.initialInputs = []);
initialInputData[directiveIndex] = null;
var attrs = tNode.attrs;
for (var i = 0; i < attrs.length; i += 2) {
var attrName = attrs[i];
var minifiedInputName = inputs[attrName];
if (minifiedInputName !== undefined) {
var inputsToStore = initialInputData[directiveIndex] || (initialInputData[directiveIndex] = []);
inputsToStore.push(minifiedInputName, attrs[i + 1]);
}
}
return initialInputData;
}
//////////////////////////
//// ViewContainer & View
//////////////////////////
function createLContainer(parentLNode, currentView, template) {
ngDevMode && assertNotNull(parentLNode, 'containers should have a parent');
return {
views: [],
nextIndex: 0,
// If the direct parent of the container is a view, its views will need to be added
// through insertView() when its parent view is being inserted:
renderParent: canInsertNativeNode(parentLNode, currentView) ? parentLNode : null,
template: template == null ? null : template,
next: null,
parent: currentView,
dynamicViewCount: 0,
queries: null
};
}
/**
* Creates an LContainerNode.
*
* Only `LViewNodes` can go into `LContainerNodes`.
*
* @param index The index of the container in the data array
* @param template Optional inline template
* @param tagName The name of the container element, if applicable
* @param attrs The attrs attached to the container, if applicable
* @param localRefs A set of local reference bindings on the element.
*/
function container(index, template, tagName, attrs, localRefs) {
ngDevMode && assertEqual(currentView.bindingStartIndex, -1, 'container nodes should be created before any bindings');
var currentParent = isParent ? previousOrParentNode : previousOrParentNode.parent;
var lContainer = createLContainer(currentParent, currentView, template);
var node = createLNode(index, 0 /* Container */, undefined, lContainer);
// Containers are added to the current view tree instead of their embedded views
// because views can be removed and re-inserted.
addToViewTree(currentView, node.data);
createDirectivesAndLocals(index, tagName || null, attrs, localRefs, []);
isParent = false;
ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */);
var queries = node.queries;
if (queries) {
// check if a given container node matches
queries.addNode(node);
// prepare place for matching nodes from views inserted into a given container
lContainer.queries = queries.container();
}
}
/**
* Sets a container up to receive views.
*
* @param index The index of the container in the data array
*/
function containerRefreshStart(index) {
ngDevMode && assertDataInRange(index);
previousOrParentNode = data[index];
ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */);
isParent = true;
previousOrParentNode.data.nextIndex = 0;
ngDevMode && assertSame(previousOrParentNode.native, undefined, "the container's native element should not have been set yet.");
if (!checkNoChangesMode) {
// We need to execute init hooks here so ngOnInit hooks are called in top level views
// before they are called in embedded views (for backwards compatibility).
executeInitHooks(currentView, currentView.tView, creationMode);
}
}
/**
* Marks the end of the LContainerNode.
*
* Marking the end of LContainerNode is the time when to child Views get inserted or removed.
*/
function containerRefreshEnd() {
if (isParent) {
isParent = false;
}
else {
ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);
ngDevMode && assertHasParent();
previousOrParentNode = previousOrParentNode.parent;
}
ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */);
var container = previousOrParentNode;
container.native = undefined;
ngDevMode && assertNodeType(container, 0 /* Container */);
var nextIndex = container.data.nextIndex;
// remove extra views at the end of the container
while (nextIndex < container.data.views.length) {
removeView(container, nextIndex);
}
}
function refreshDynamicChildren() {
for (var current = currentView.child; current !== null; current = current.next) {
if (current.dynamicViewCount !== 0 && current.views) {
var container_1 = current;
for (var i = 0; i < container_1.views.length; i++) {
var view = container_1.views[i];
// The directives and pipes are not needed here as an existing view is only being refreshed.
renderEmbeddedTemplate(view, view.data.template, view.data.context, renderer);
}
}
}
}
/**
* Looks for a view with a given view block id inside a provided LContainer.
* Removes views that need to be deleted in the process.
*
* @param containerNode where to search for views
* @param startIdx starting index in the views array to search from
* @param viewBlockId exact view block id to look for
* @returns index of a found view or -1 if not found
*/
function scanForView(containerNode, startIdx, viewBlockId) {
var views = containerNode.data.views;
for (var i = startIdx; i < views.length; i++) {
var viewAtPositionId = views[i].data.id;
if (viewAtPositionId === viewBlockId) {
return views[i];
}
else if (viewAtPositionId < viewBlockId) {
// found a view that should not be at this position - remove
removeView(containerNode, i);
}
else {
// found a view with id grater than the one we are searching for
// which means that required view doesn't exist and can't be found at
// later positions in the views array - stop the search here
break;
}
}
return null;
}
/**
* Marks the start of an embedded view.
*
* @param viewBlockId The ID of this view
* @return boolean Whether or not this view is in creation mode
*/
function embeddedViewStart(viewBlockId) {
var container = (isParent ? previousOrParentNode : previousOrParentNode.parent);
ngDevMode && assertNodeType(container, 0 /* Container */);
var lContainer = container.data;
var viewNode = scanForView(container, lContainer.nextIndex, viewBlockId);
if (viewNode) {
previousOrParentNode = viewNode;
ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);
isParent = true;
enterView(viewNode.data, viewNode);
}
else {
// When we create a new LView, we always reset the state of the instructions.
var newView = createLView(viewBlockId, renderer, getOrCreateEmbeddedTView(viewBlockId, container), null, null, 2 /* CheckAlways */);
if (lContainer.queries) {
newView.queries = lContainer.queries.enterView(lContainer.nextIndex);
}
enterView(newView, viewNode = createLNode(null, 2 /* View */, null, newView));
}
return getRenderFlags(viewNode.data);
}
/**
* Initialize the TView (e.g. static data) for the active embedded view.
*
* Each embedded view needs to set the global tData variable to the static data for
* that view. Otherwise, the view's static data for a particular node would overwrite
* the static data for a node in the view above it with the same index (since it's in the
* same template).
*
* @param viewIndex The index of the TView in TContainer
* @param parent The parent container in which to look for the view's static data
* @returns TView
*/
function getOrCreateEmbeddedTView(viewIndex, parent) {
ngDevMode && assertNodeType(parent, 0 /* Container */);
var tContainer = parent.tNode.data;
if (viewIndex >= tContainer.length || tContainer[viewIndex] == null) {
var tView = currentView.tView;
tContainer[viewIndex] = createTView(tView.directiveRegistry, tView.pipeRegistry);
}
return tContainer[viewIndex];
}
/** Marks the end of an embedded view. */
function embeddedViewEnd() {
refreshDirectives();
isParent = false;
var viewNode = previousOrParentNode = currentView.node;
var containerNode = previousOrParentNode.parent;
if (containerNode) {
ngDevMode && assertNodeType(viewNode, 2 /* View */);
ngDevMode && assertNodeType(containerNode, 0 /* Container */);
var lContainer = containerNode.data;
if (creationMode) {
// When projected nodes are going to be inserted, the renderParent of the dynamic container
// used by the ViewContainerRef must be set.
setRenderParentInProjectedNodes(lContainer.renderParent, viewNode);
// it is a new view, insert it into collection of views for a given container
insertView(containerNode, viewNode, lContainer.nextIndex);
}
lContainer.nextIndex++;
}
leaveView(currentView.parent);
ngDevMode && assertEqual(isParent, false, 'isParent');
ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);
}
/**
* For nodes which are projected inside an embedded view, this function sets the renderParent
* of their dynamic LContainerNode.
* @param renderParent the renderParent of the LContainer which contains the embedded view.
* @param viewNode the embedded view.
*/
function setRenderParentInProjectedNodes(renderParent, viewNode) {
if (renderParent != null) {
var node = viewNode.child;
while (node) {
if (node.type === 1 /* Projection */) {
var nodeToProject = node.data.head;
var lastNodeToProject = node.data.tail;
while (nodeToProject) {
if (nodeToProject.dynamicLContainerNode) {
nodeToProject.dynamicLContainerNode.data.renderParent = renderParent;
}
nodeToProject = nodeToProject === lastNodeToProject ? null : nodeToProject.pNextOrParent;
}
}
node = node.next;
}
}
}
/////////////
/**
* Refreshes components by entering the component view and processing its bindings, queries, etc.
*
* @param directiveIndex
* @param elementIndex
*/
function componentRefresh(directiveIndex, elementIndex) {
ngDevMode && assertDataInRange(elementIndex);
var element = data[elementIndex];
ngDevMode && assertNodeType(element, 3 /* Element */);
ngDevMode && assertNotNull(element.data, "Component's host node should have an LView attached.");
var hostView = element.data;
// Only attached CheckAlways components or attached, dirty OnPush components should be checked
if (viewAttached(hostView) && hostView.flags & (2 /* CheckAlways */ | 4 /* Dirty */)) {
ngDevMode && assertDataInRange(directiveIndex, directives);
var def = currentView.tView.directives[directiveIndex];
detectChangesInternal(hostView, element, def, getDirectiveInstance(directives[directiveIndex]));
}
}
/** Returns a boolean for whether the view is attached */
function viewAttached(view) {
return (view.flags & 8 /* Attached */) === 8 /* Attached */;
}
/**
* Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.
* It takes all the selectors from the entire component's template and decides where
* each projected node belongs (it re-distributes nodes among "buckets" where each "bucket" is
* backed by a selector).
*
* This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,
* un-parsed form.
*
* The parsed form is needed for efficient matching of a node against a given CSS selector.
* The un-parsed, textual form is needed for support of the ngProjectAs attribute.
*
* Having a CSS selector in 2 different formats is not ideal, but alternatives have even more
* drawbacks:
* - having only a textual form would require runtime parsing of CSS selectors;
* - we can't have only a parsed as we can't re-construct textual form from it (as entered by a
* template author).
*
* @param selectors A collection of parsed CSS selectors
* @param rawSelectors A collection of CSS selectors in the raw, un-parsed form
*/
function projectionDef(index, selectors, textSelectors) {
var noOfNodeBuckets = selectors ? selectors.length + 1 : 1;
var distributedNodes = new Array(noOfNodeBuckets);
for (var i = 0; i < noOfNodeBuckets; i++) {
distributedNodes[i] = [];
}
var componentNode = findComponentHost(currentView);
var componentChild = componentNode.child;
while (componentChild !== null) {
// execute selector matching logic if and only if:
// - there are selectors defined
// - a node has a tag name / attributes that can be matched
if (selectors && componentChild.tNode) {
var matchedIdx = matchingSelectorIndex(componentChild.tNode, selectors, textSelectors);
distributedNodes[matchedIdx].push(componentChild);
}
else {
distributedNodes[0].push(componentChild);
}
componentChild = componentChild.next;
}
ngDevMode && assertDataNext(index);
data[index] = distributedNodes;
}
/**
* Updates the linked list of a projection node, by appending another linked list.
*
* @param projectionNode Projection node whose projected nodes linked list has to be updated
* @param appendedFirst First node of the linked list to append.
* @param appendedLast Last node of the linked list to append.
*/
function appendToProjectionNode(projectionNode, appendedFirst, appendedLast) {
ngDevMode && assertEqual(!!appendedFirst, !!appendedLast, 'appendedFirst can be null if and only if appendedLast is also null');
if (!appendedLast) {
// nothing to append
return;
}
var projectionNodeData = projectionNode.data;
if (projectionNodeData.tail) {
projectionNodeData.tail.pNextOrParent = appendedFirst;
}
else {
projectionNodeData.head = appendedFirst;
}
projectionNodeData.tail = appendedLast;
appendedLast.pNextOrParent = projectionNode;
}
/**
* Inserts previously re-distributed projected nodes. This instruction must be preceded by a call
* to the projectionDef instruction.
*
* @param nodeIndex
* @param localIndex - index under which distribution of projected nodes was memorized
* @param selectorIndex - 0 means <ng-content> without any selector
* @param attrs - attributes attached to the ng-content node, if present
*/
function projection(nodeIndex, localIndex, selectorIndex, attrs) {
if (selectorIndex === void 0) { selectorIndex = 0; }
var node = createLNode(nodeIndex, 1 /* Projection */, null, { head: null, tail: null });
if (node.tNode == null) {
node.tNode = createTNode(null, attrs || null, null);
}
isParent = false; // self closing
var currentParent = node.parent;
// re-distribution of projectable nodes is memorized on a component's view level
var componentNode = findComponentHost(currentView);
// make sure that nodes to project were memorized
var nodesForSelector = componentNode.data.data[localIndex][selectorIndex];
// build the linked list of projected nodes:
for (var i = 0; i < nodesForSelector.length; i++) {
var nodeToProject = nodesForSelector[i];
if (nodeToProject.type === 1 /* Projection */) {
var previouslyProjected = nodeToProject.data;
appendToProjectionNode(node, previouslyProjected.head, previouslyProjected.tail);
}
else {
appendToProjectionNode(node, nodeToProject, nodeToProject);
}
}
if (canInsertNativeNode(currentParent, currentView)) {
ngDevMode && assertNodeType(currentParent, 3 /* Element */);
// process each node in the list of projected nodes:
var nodeToProject = node.data.head;
var lastNodeToProject = node.data.tail;
while (nodeToProject) {
appendProjectedNode(nodeToProject, currentParent, currentView);
nodeToProject = nodeToProject === lastNodeToProject ? null : nodeToProject.pNextOrParent;
}
}
}
/**
* Given a current view, finds the nearest component's host (LElement).
*
* @param lView LView for which we want a host element node
* @returns The host node
*/
function findComponentHost(lView) {
var viewRootLNode = lView.node;
while (viewRootLNode.type === 2 /* View */) {
ngDevMode && assertNotNull(lView.parent, 'lView.parent');
lView = lView.parent;
viewRootLNode = lView.node;
}
ngDevMode && assertNodeType(viewRootLNode, 3 /* Element */);
ngDevMode && assertNotNull(viewRootLNode.data, 'node.data');
return viewRootLNode;
}
/**
* Adds a LView or a LContainer to the end of the current view tree.
*
* This structure will be used to traverse through nested views to remove listeners
* and call onDestroy callbacks.
*
* @param currentView The view where LView or LContainer should be added
* @param state The LView or LContainer to add to the view tree
* @returns The state passed in
*/
function addToViewTree(currentView, state) {
currentView.tail ? (currentView.tail.next = state) : (currentView.child = state);
currentView.tail = state;
return state;
}
///////////////////////////////
//// Change detection
///////////////////////////////
/** If node is an OnPush component, marks its LView dirty. */
function markDirtyIfOnPush(node) {
// Because data flows down the component tree, ancestors do not need to be marked dirty
if (node.data && !(node.data.flags & 2 /* CheckAlways */)) {
node.data.flags |= 4 /* Dirty */;
}
}
/**
* Wraps an event listener so its host view and its ancestor views will be marked dirty
* whenever the event fires. Necessary to support OnPush components.
*/
function wrapListenerWithDirtyLogic(view, listenerFn) {
return function (e) {
markViewDirty(view);
return listenerFn(e);
};
}
/**
* Wraps an event listener so its host view and its ancestor views will be marked dirty
* whenever the event fires. Also wraps with preventDefault behavior.
*/
function wrapListenerWithDirtyAndDefault(view, listenerFn) {
return function wrapListenerIn_markViewDirty(e) {
markViewDirty(view);
if (listenerFn(e) === false) {
e.preventDefault();
// Necessary for legacy browsers that don't support preventDefault (e.g. IE)
e.returnValue = false;
}
};
}
/** Marks current view and all ancestors dirty */
function markViewDirty(view) {
var currentView = view;
while (currentView.parent != null) {
currentView.flags |= 4 /* Dirty */;
currentView = currentView.parent;
}
currentView.flags |= 4 /* Dirty */;
ngDevMode && assertNotNull(currentView.context, 'rootContext');
scheduleTick(currentView.context);
}
/**
* Used to schedule change detection on the whole application.
*
* Unlike `tick`, `scheduleTick` coalesces multiple calls into one change detection run.
* It is usually called indirectly by calling `markDirty` when the view needs to be
* re-rendered.
*
* Typically `scheduleTick` uses `requestAnimationFrame` to coalesce multiple
* `scheduleTick` requests. The scheduling function can be overridden in
* `renderComponent`'s `scheduler` option.
*/
function scheduleTick(rootContext) {
if (rootContext.clean == _CLEAN_PROMISE) {
var res_1;
rootContext.clean = new Promise(function (r) { return res_1 = r; });
rootContext.scheduler(function () {
tick(rootContext.component);
res_1(null);
rootContext.clean = _CLEAN_PROMISE;
});
}
}
/**
* Used to perform change detection on the whole application.
*
* This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`
* executes lifecycle hooks and conditionally checks components based on their
* `ChangeDetectionStrategy` and dirtiness.
*
* The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally
* schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a
* single change detection run. By default, the scheduler is `requestAnimationFrame`, but can
* be changed when calling `renderComponent` and providing the `scheduler` option.
*/
function tick(component) {
var rootView = getRootView(component);
var rootComponent = rootView.context.component;
var hostNode = _getComponentHostLElementNode(rootComponent);
ngDevMode && assertNotNull(hostNode.data, 'Component host node should be attached to an LView');
renderComponentOrTemplate(hostNode, rootView, rootComponent);
}
/**
* Retrieve the root view from any component by walking the parent `LView` until
* reaching the root `LView`.
*
* @param component any component
*/
function getRootView(component) {
ngDevMode && assertNotNull(component, 'component');
var lElementNode = _getComponentHostLElementNode(component);
var lView = lElementNode.view;
while (lView.parent) {
lView = lView.parent;
}
return lView;
}
/**
* Synchronously perform change detection on a component (and possibly its sub-components).
*
* This function triggers change detection in a synchronous way on a component. There should
* be very little reason to call this function directly since a preferred way to do change
* detection is to {@link markDirty} the component and wait for the scheduler to call this method
* at some future point in time. This is because a single user action often results in many
* components being invalidated and calling change detection on each component synchronously
* would be inefficient. It is better to wait until all components are marked as dirty and
* then perform single change detection across all of the components
*
* @param component The component which the change detection should be performed on.
*/
function detectChanges(component) {
var hostNode = _getComponentHostLElementNode(component);
ngDevMode && assertNotNull(hostNode.data, 'Component host node should be attached to an LView');
var componentIndex = hostNode.tNode.flags >> 13 /* DirectiveStartingIndexShift */;
var def = hostNode.view.tView.directives[componentIndex];
detectChangesInternal(hostNode.data, hostNode, def, component);
}
/**
* Checks the change detector and its children, and throws if any changes are detected.
*
* This is used in development mode to verify that running change detection doesn't
* introduce other changes.
*/
function checkNoChanges(component) {
checkNoChangesMode = true;
try {
detectChanges(component);
}
finally {
checkNoChangesMode = false;
}
}
/** Checks the view of the component provided. Does not gate on dirty checks or execute doCheck. */
function detectChangesInternal(hostView, hostNode, def, component) {
var oldView = enterView(hostView, hostNode);
var template = def.template;
try {
template(getRenderFlags(hostView), component);
refreshDirectives();
refreshDynamicChildren();
}
finally {
leaveView(oldView);
}
}
/**
* Mark the component as dirty (needing change detection).
*
* Marking a component dirty will schedule a change detection on this
* component at some point in the future. Marking an already dirty
* component as dirty is a noop. Only one outstanding change detection
* can be scheduled per component tree. (Two components bootstrapped with
* separate `renderComponent` will have separate schedulers)
*
* When the root component is bootstrapped with `renderComponent`, a scheduler
* can be provided.
*
* @param component Component to mark as dirty.
*/
function markDirty(component) {
ngDevMode && assertNotNull(component, 'component');
var lElementNode = _getComponentHostLElementNode(component);
markViewDirty(lElementNode.view);
}
/** A special value which designates that a value has not changed. */
var NO_CHANGE = {};
/**
* Initializes the binding start index. Will get inlined.
*
* This function must be called before any binding related function is called
* (ie `bind()`, `interpolationX()`, `pureFunctionX()`)
*/
function initBindings() {
ngDevMode && assertEqual(currentView.bindingStartIndex, -1, 'Binding start index should only be set once, when null');
ngDevMode && assertEqual(currentView.bindingIndex, -1, 'Binding index should not yet be set ' + currentView.bindingIndex);
currentView.bindingIndex = currentView.bindingStartIndex = data.length;
}
/**
* Creates a single value binding.
*
* @param value Value to diff
*/
function bind(value) {
if (currentView.bindingStartIndex < 0) {
initBindings();
return data[currentView.bindingIndex++] = value;
}
var changed = value !== NO_CHANGE && isDifferent(data[currentView.bindingIndex], value);
if (changed) {
throwErrorIfNoChangesMode(creationMode, checkNoChangesMode, data[currentView.bindingIndex], value);
data[currentView.bindingIndex] = value;
}
currentView.bindingIndex++;
return changed ? value : NO_CHANGE;
}
/**
* Create interpolation bindings with a variable number of expressions.
*
* If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
* Those are faster because there is no need to create an array of expressions and iterate over it.
*
* `values`:
* - has static text at even indexes,
* - has evaluated expressions at odd indexes.
*
* Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
*/
function interpolationV(values) {
ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
var different = false;
for (var i = 1; i < values.length; i += 2) {
// Check if bindings (odd indexes) have changed
bindingUpdated(values[i]) && (different = true);
}
if (!different) {
return NO_CHANGE;
}
// Build the updated content
var content = values[0];
for (var i = 1; i < values.length; i += 2) {
content += stringify$1(values[i]) + values[i + 1];
}
return content;
}
/**
* Creates an interpolation binding with 1 expression.
*
* @param prefix static value used for concatenation only.
* @param v0 value checked for change.
* @param suffix static value used for concatenation only.
*/
function interpolation1(prefix, v0, suffix) {
var different = bindingUpdated(v0);
return different ? prefix + stringify$1(v0) + suffix : NO_CHANGE;
}
/** Creates an interpolation binding with 2 expressions. */
function interpolation2(prefix, v0, i0, v1, suffix) {
var different = bindingUpdated2(v0, v1);
return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + suffix : NO_CHANGE;
}
/** Creates an interpolation bindings with 3 expressions. */
function interpolation3(prefix, v0, i0, v1, i1, v2, suffix) {
var different = bindingUpdated2(v0, v1);
different = bindingUpdated(v2) || different;
return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + suffix :
NO_CHANGE;
}
/** Create an interpolation binding with 4 expressions. */
function interpolation4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
var different = bindingUpdated4(v0, v1, v2, v3);
return different ?
prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) +
suffix :
NO_CHANGE;
}
/** Creates an interpolation binding with 5 expressions. */
function interpolation5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
var different = bindingUpdated4(v0, v1, v2, v3);
different = bindingUpdated(v4) || different;
return different ?
prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 +
stringify$1(v4) + suffix :
NO_CHANGE;
}
/** Creates an interpolation binding with 6 expressions. */
function interpolation6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
var different = bindingUpdated4(v0, v1, v2, v3);
different = bindingUpdated2(v4, v5) || different;
return different ?
prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 +
stringify$1(v4) + i4 + stringify$1(v5) + suffix :
NO_CHANGE;
}
/** Creates an interpolation binding with 7 expressions. */
function interpolation7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
var different = bindingUpdated4(v0, v1, v2, v3);
different = bindingUpdated2(v4, v5) || different;
different = bindingUpdated(v6) || different;
return different ?
prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 +
stringify$1(v4) + i4 + stringify$1(v5) + i5 + stringify$1(v6) + suffix :
NO_CHANGE;
}
/** Creates an interpolation binding with 8 expressions. */
function interpolation8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
var different = bindingUpdated4(v0, v1, v2, v3);
different = bindingUpdated4(v4, v5, v6, v7) || different;
return different ?
prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 +
stringify$1(v4) + i4 + stringify$1(v5) + i5 + stringify$1(v6) + i6 + stringify$1(v7) + suffix :
NO_CHANGE;
}
/** Store a value in the `data` at a given `index`. */
function store(index, value) {
// We don't store any static data for local variables, so the first time
// we see the template, we should store as null to avoid a sparse array
if (index >= tData.length) {
tData[index] = null;
}
data[index] = value;
}
/** Retrieves a value from the `data`. */
function load(index) {
ngDevMode && assertDataInRange(index);
return data[index];
}
/** Retrieves a value from the `directives` array. */
function loadDirective(index) {
ngDevMode && assertNotNull(directives, 'Directives array should be defined if reading a dir.');
ngDevMode && assertDataInRange(index, directives);
return directives[index];
}
/** Gets the current binding value and increments the binding index. */
function consumeBinding() {
ngDevMode && assertDataInRange(currentView.bindingIndex);
ngDevMode &&
assertNotEqual(data[currentView.bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
return data[currentView.bindingIndex++];
}
/** Updates binding if changed, then returns whether it was updated. */
function bindingUpdated(value) {
ngDevMode && assertNotEqual(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
if (currentView.bindingStartIndex < 0) {
initBindings();
}
else if (isDifferent(data[currentView.bindingIndex], value)) {
throwErrorIfNoChangesMode(creationMode, checkNoChangesMode, data[currentView.bindingIndex], value);
}
else {
currentView.bindingIndex++;
return false;
}
data[currentView.bindingIndex++] = value;
return true;
}
/** Updates binding if changed, then returns the latest value. */
function checkAndUpdateBinding$1(value) {
bindingUpdated(value);
return value;
}
/** Updates 2 bindings if changed, then returns whether either was updated. */
function bindingUpdated2(exp1, exp2) {
var different = bindingUpdated(exp1);
return bindingUpdated(exp2) || different;
}
/** Updates 4 bindings if changed, then returns whether any was updated. */
function bindingUpdated4(exp1, exp2, exp3, exp4) {
var different = bindingUpdated2(exp1, exp2);
return bindingUpdated2(exp3, exp4) || different;
}
function getTView() {
return currentView.tView;
}
function getDirectiveInstance(instanceOrArray) {
// Directives with content queries store an array in directives[directiveIndex]
// with the instance as the first index
return Array.isArray(instanceOrArray) ? instanceOrArray[0] : instanceOrArray;
}
function assertPreviousIsParent() {
assertEqual(isParent, true, 'previousOrParentNode should be a parent');
}
function assertHasParent() {
assertNotNull(previousOrParentNode.parent, 'previousOrParentNode should have a parent');
}
function assertDataInRange(index, arr) {
if (arr == null)
arr = data;
assertLessThan(index, arr ? arr.length : 0, 'index expected to be a valid data index');
}
function assertDataNext(index, arr) {
if (arr == null)
arr = data;
assertEqual(arr.length, index, "index " + index + " expected to be at the end of arr (length " + arr.length + ")");
}
function _getComponentHostLElementNode(component) {
ngDevMode && assertNotNull(component, 'expecting component got null');
var lElementNode = component[NG_HOST_SYMBOL];
ngDevMode && assertNotNull(component, 'object is not a component');
return lElementNode;
}
var CLEAN_PROMISE = _CLEAN_PROMISE;
var ROOT_DIRECTIVE_INDICES = _ROOT_DIRECTIVE_INDICES;
/**
* @license
* Copyright Google Inc. 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 ViewRef$1 = /** @class */ (function () {
function ViewRef(_view, context) {
this._view = _view;
this.context = context;
}
/** @internal */
ViewRef.prototype._setComponentContext = function (view, context) {
this._view = view;
this.context = context;
};
ViewRef.prototype.destroy = function () { };
ViewRef.prototype.onDestroy = function (callback) { };
/**
* Marks a view and all of its ancestors dirty.
*
* It also triggers change detection by calling `scheduleTick` internally, which coalesces
* multiple `markForCheck` calls to into one change detection run.
*
* This can be used to ensure an {@link ChangeDetectionStrategy#OnPush OnPush} component is
* checked when it needs to be re-rendered but the two normal triggers haven't marked it
* dirty (i.e. inputs haven't changed and events haven't fired in the view).
*
* <!-- TODO: Add a link to a chapter on OnPush components -->
*
* @usageNotes
* ### Example
*
* ```typescript
* @Component({
* selector: 'my-app',
* template: `Number of ticks: {{numberOfTicks}}`
* changeDetection: ChangeDetectionStrategy.OnPush,
* })
* class AppComponent {
* numberOfTicks = 0;
*
* constructor(private ref: ChangeDetectorRef) {
* setInterval(() => {
* this.numberOfTicks++;
* // the following is required, otherwise the view will not be updated
* this.ref.markForCheck();
* }, 1000);
* }
* }
* ```
*/
ViewRef.prototype.markForCheck = function () { markViewDirty(this._view); };
/**
* Detaches the view from the change detection tree.
*
* Detached views will not be checked during change detection runs until they are
* re-attached, even if they are dirty. `detach` can be used in combination with
* {@link ChangeDetectorRef#detectChanges detectChanges} to implement local change
* detection checks.
*
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
* <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
*
* @usageNotes
* ### Example
*
* The following example defines a component with a large list of readonly data.
* Imagine the data changes constantly, many times per second. For performance reasons,
* we want to check and update the list every five seconds. We can do that by detaching
* the component's change detector and doing a local check every five seconds.
*
* ```typescript
* class DataProvider {
* // in a real application the returned data will be different every time
* get data() {
* return [1,2,3,4,5];
* }
* }
*
* @Component({
* selector: 'giant-list',
* template: `
* <li *ngFor="let d of dataProvider.data">Data {{d}}</li>
* `,
* })
* class GiantList {
* constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {
* ref.detach();
* setInterval(() => {
* this.ref.detectChanges();
* }, 5000);
* }
* }
*
* @Component({
* selector: 'app',
* providers: [DataProvider],
* template: `
* <giant-list><giant-list>
* `,
* })
* class App {
* }
* ```
*/
ViewRef.prototype.detach = function () { this._view.flags &= ~8 /* Attached */; };
/**
* Re-attaches a view to the change detection tree.
*
* This can be used to re-attach views that were previously detached from the tree
* using {@link ChangeDetectorRef#detach detach}. Views are attached to the tree by default.
*
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
*
* @usageNotes
* ### Example
*
* The following example creates a component displaying `live` data. The component will detach
* its change detector from the main change detector tree when the component's live property
* is set to false.
*
* ```typescript
* class DataProvider {
* data = 1;
*
* constructor() {
* setInterval(() => {
* this.data = this.data * 2;
* }, 500);
* }
* }
*
* @Component({
* selector: 'live-data',
* inputs: ['live'],
* template: 'Data: {{dataProvider.data}}'
* })
* class LiveData {
* constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}
*
* set live(value) {
* if (value) {
* this.ref.reattach();
* } else {
* this.ref.detach();
* }
* }
* }
*
* @Component({
* selector: 'my-app',
* providers: [DataProvider],
* template: `
* Live Update: <input type="checkbox" [(ngModel)]="live">
* <live-data [live]="live"><live-data>
* `,
* })
* class AppComponent {
* live = true;
* }
* ```
*/
ViewRef.prototype.reattach = function () { this._view.flags |= 8 /* Attached */; };
/**
* Checks the view and its children.
*
* This can also be used in combination with {@link ChangeDetectorRef#detach detach} to implement
* local change detection checks.
*
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
* <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
*
* @usageNotes
* ### Example
*
* The following example defines a component with a large list of readonly data.
* Imagine, the data changes constantly, many times per second. For performance reasons,
* we want to check and update the list every five seconds.
*
* We can do that by detaching the component's change detector and doing a local change detection
* check every five seconds.
*
* See {@link ChangeDetectorRef#detach detach} for more information.
*/
ViewRef.prototype.detectChanges = function () { detectChanges(this.context); };
/**
* Checks the change detector and its children, and throws if any changes are detected.
*
* This is used in development mode to verify that running change detection doesn't
* introduce other changes.
*/
ViewRef.prototype.checkNoChanges = function () { checkNoChanges(this.context); };
return ViewRef;
}());
var EmbeddedViewRef$1 = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(EmbeddedViewRef, _super);
function EmbeddedViewRef(viewNode, template, context) {
var _this = _super.call(this, viewNode.data, context) || this;
_this._lViewNode = viewNode;
return _this;
}
return EmbeddedViewRef;
}(ViewRef$1));
/**
* Creates a ViewRef bundled with destroy functionality.
*
* @param context The context for this view
* @returns The ViewRef
*/
function createViewRef(view, context) {
// TODO: add detectChanges back in when implementing ChangeDetectorRef.detectChanges
return addDestroyable(new ViewRef$1(view, context));
}
/**
* Decorates an object with destroy logic (implementing the DestroyRef interface)
* and returns the enhanced object.
*
* @param obj The object to decorate
* @returns The object with destroy logic
*/
function addDestroyable(obj) {
var destroyFn = null;
obj.destroyed = false;
obj.destroy = function () {
destroyFn && destroyFn.forEach(function (fn) { return fn(); });
this.destroyed = true;
};
obj.onDestroy = function (fn) { return (destroyFn || (destroyFn = [])).push(fn); };
return obj;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Bootstraps a Component into an existing host element and returns an instance
* of the component.
*
* Use this function to bootstrap a component into the DOM tree. Each invocation
* of this function will create a separate tree of components, injectors and
* change detection cycles and lifetimes. To dynamically insert a new component
* into an existing tree such that it shares the same injection, change detection
* and object lifetime, use {@link ViewContainer#createComponent}.
*
* @param componentType Component to bootstrap
* @param options Optional parameters which control bootstrapping
*/
function renderComponent(componentType /* Type as workaround for: Microsoft/TypeScript/issues/4881 */, opts) {
if (opts === void 0) { opts = {}; }
ngDevMode && assertComponentType(componentType);
var rendererFactory = opts.rendererFactory || domRendererFactory3;
var componentDef = componentType.ngComponentDef;
if (componentDef.type != componentType)
componentDef.type = componentType;
var component;
// The first index of the first selector is the tag name.
var componentTag = componentDef.selectors[0][0];
var hostNode = locateHostElement(rendererFactory, opts.host || componentTag);
var rootContext = {
// Incomplete initialization due to circular reference.
component: null,
scheduler: opts.scheduler || requestAnimationFrame.bind(window),
clean: CLEAN_PROMISE,
};
var rootView = createLView(-1, rendererFactory.createRenderer(hostNode, componentDef.rendererType), createTView(null, null), null, rootContext, componentDef.onPush ? 4 /* Dirty */ : 2 /* CheckAlways */);
rootView.injector = opts.injector || null;
var oldView = enterView(rootView, null);
var elementNode;
try {
if (rendererFactory.begin)
rendererFactory.begin();
// Create element node at index 0 in data array
elementNode = hostElement(componentTag, hostNode, componentDef);
// Create directive instance with factory() and store at index 0 in directives array
component = rootContext.component =
baseDirectiveCreate(0, componentDef.factory(), componentDef);
initChangeDetectorIfExisting(elementNode.nodeInjector, component, elementNode.data);
opts.hostFeatures && opts.hostFeatures.forEach(function (feature) { return feature(component, componentDef); });
executeInitAndContentHooks();
setHostBindings(ROOT_DIRECTIVE_INDICES);
detectChangesInternal(elementNode.data, elementNode, componentDef, component);
}
finally {
leaveView(oldView);
if (rendererFactory.end)
rendererFactory.end();
}
return component;
}
/**
* Retrieve the root context for any component by walking the parent `LView` until
* reaching the root `LView`.
*
* @param component any component
*/
function getRootContext(component) {
var rootContext = getRootView(component).context;
ngDevMode && assertNotNull(rootContext, 'rootContext');
return rootContext;
}
/**
* Wait on component until it is rendered.
*
* This function returns a `Promise` which is resolved when the component's
* change detection is executed. This is determined by finding the scheduler
* associated with the `component`'s render tree and waiting until the scheduler
* flushes. If nothing is scheduled, the function returns a resolved promise.
*
* Example:
* ```
* await whenRendered(myComponent);
* ```
*
* @param component Component to wait upon
* @returns Promise which resolves when the component is rendered.
*/
function whenRendered(component) {
return getRootContext(component).clean;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* If a directive is diPublic, bloomAdd sets a property on the instance with this constant as
* the key and the directive's unique ID as the value. This allows us to map directives to their
* bloom filter bit for DI.
*/
var NG_ELEMENT_ID = '__NG_ELEMENT_ID__';
/**
* The number of slots in each bloom filter (used by DI). The larger this number, the fewer
* directives that will share slots, and thus, the fewer false positives when checking for
* the existence of a directive.
*/
var BLOOM_SIZE = 256;
/** Counter used to generate unique IDs for directives. */
var nextNgElementId = 0;
/**
* Registers this directive as present in its node's injector by flipping the directive's
* corresponding bit in the injector's bloom filter.
*
* @param injector The node injector in which the directive should be registered
* @param type The directive to register
*/
function bloomAdd(injector, type) {
var id = type[NG_ELEMENT_ID];
// Set a unique ID on the directive type, so if something tries to inject the directive,
// we can easily retrieve the ID and hash it into the bloom bit that should be checked.
if (id == null) {
id = type[NG_ELEMENT_ID] = nextNgElementId++;
}
// We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),
// so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.
// This means that after 255, some directives will share slots, leading to some false positives
// when checking for a directive's presence.
var bloomBit = id % BLOOM_SIZE;
// Create a mask that targets the specific bit associated with the directive.
// JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding
// to bit positions 0 - 31 in a 32 bit integer.
var mask = 1 << bloomBit;
// Use the raw bloomBit number to determine which bloom filter bucket we should check
// e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc
if (bloomBit < 128) {
// Then use the mask to flip on the bit (0-31) associated with the directive in that bucket
bloomBit < 64 ? (bloomBit < 32 ? (injector.bf0 |= mask) : (injector.bf1 |= mask)) :
(bloomBit < 96 ? (injector.bf2 |= mask) : (injector.bf3 |= mask));
}
else {
bloomBit < 192 ? (bloomBit < 160 ? (injector.bf4 |= mask) : (injector.bf5 |= mask)) :
(bloomBit < 224 ? (injector.bf6 |= mask) : (injector.bf7 |= mask));
}
}
function getOrCreateNodeInjector() {
ngDevMode && assertPreviousIsParent();
return getOrCreateNodeInjectorForNode(getPreviousOrParentNode());
}
/**
* Creates (or gets an existing) injector for a given element or container.
*
* @param node for which an injector should be retrieved / created.
* @returns Node injector
*/
function getOrCreateNodeInjectorForNode(node) {
var nodeInjector = node.nodeInjector;
var parentInjector = node.parent && node.parent.nodeInjector;
if (nodeInjector != parentInjector) {
return nodeInjector;
}
return node.nodeInjector = {
parent: parentInjector,
node: node,
bf0: 0,
bf1: 0,
bf2: 0,
bf3: 0,
bf4: 0,
bf5: 0,
bf6: 0,
bf7: 0,
cbf0: parentInjector == null ? 0 : parentInjector.cbf0 | parentInjector.bf0,
cbf1: parentInjector == null ? 0 : parentInjector.cbf1 | parentInjector.bf1,
cbf2: parentInjector == null ? 0 : parentInjector.cbf2 | parentInjector.bf2,
cbf3: parentInjector == null ? 0 : parentInjector.cbf3 | parentInjector.bf3,
cbf4: parentInjector == null ? 0 : parentInjector.cbf4 | parentInjector.bf4,
cbf5: parentInjector == null ? 0 : parentInjector.cbf5 | parentInjector.bf5,
cbf6: parentInjector == null ? 0 : parentInjector.cbf6 | parentInjector.bf6,
cbf7: parentInjector == null ? 0 : parentInjector.cbf7 | parentInjector.bf7,
templateRef: null,
viewContainerRef: null,
elementRef: null,
changeDetectorRef: null
};
}
/**
* Makes a directive public to the DI system by adding it to an injector's bloom filter.
*
* @param di The node injector in which a directive will be added
* @param def The definition of the directive to be made public
*/
function diPublicInInjector(di, def) {
bloomAdd(di, def.type);
}
/**
* Makes a directive public to the DI system by adding it to an injector's bloom filter.
*
* @param def The definition of the directive to be made public
*/
function diPublic(def) {
diPublicInInjector(getOrCreateNodeInjector(), def);
}
function directiveInject(token, flags) {
if (flags === void 0) { flags = 0 /* Default */; }
return getOrCreateInjectable(getOrCreateNodeInjector(), token, flags);
}
/**
* Creates a TemplateRef and stores it on the injector. Or, if the TemplateRef already
* exists, retrieves the existing TemplateRef.
*
* @returns The TemplateRef instance to use
*/
function injectTemplateRef() {
return getOrCreateTemplateRef(getOrCreateNodeInjector());
}
/**
* Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef
* already exists, retrieves the existing ViewContainerRef.
*
* @returns The ViewContainerRef instance to use
*/
function injectViewContainerRef() {
return getOrCreateContainerRef(getOrCreateNodeInjector());
}
/** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */
function injectChangeDetectorRef() {
return getOrCreateChangeDetectorRef(getOrCreateNodeInjector(), null);
}
/**
* Inject static attribute value into directive constructor.
*
* This method is used with `factory` functions which are generated as part of
* `defineDirective` or `defineComponent`. The method retrieves the static value
* of an attribute. (Dynamic attributes are not supported since they are not resolved
* at the time of injection and can change over time.)
*
* # Example
* Given:
* ```
* @Component(...)
* class MyComponent {
* constructor(@Attribute('title') title: string) { ... }
* }
* ```
* When instantiated with
* ```
* <my-component title="Hello"></my-component>
* ```
*
* Then factory method generated is:
* ```
* MyComponent.ngComponentDef = defineComponent({
* factory: () => new MyComponent(injectAttribute('title'))
* ...
* })
* ```
*
* @experimental
*/
function injectAttribute(attrName) {
ngDevMode && assertPreviousIsParent();
var lElement = getPreviousOrParentNode();
ngDevMode && assertNodeType(lElement, 3 /* Element */);
var tElement = lElement.tNode;
ngDevMode && assertNotNull(tElement, 'expecting tNode');
var attrs = tElement.attrs;
if (attrs) {
for (var i = 0; i < attrs.length; i = i + 2) {
if (attrs[i] == attrName) {
return attrs[i + 1];
}
}
}
return undefined;
}
/**
* Creates a ViewRef and stores it on the injector as ChangeDetectorRef (public alias).
* Or, if it already exists, retrieves the existing instance.
*
* @returns The ChangeDetectorRef to use
*/
function getOrCreateChangeDetectorRef(di, context) {
if (di.changeDetectorRef)
return di.changeDetectorRef;
var currentNode = di.node;
if (isComponent(currentNode.tNode)) {
return di.changeDetectorRef = createViewRef(currentNode.data, context);
}
else if (currentNode.type === 3 /* Element */) {
return di.changeDetectorRef = getOrCreateHostChangeDetector(currentNode.view.node);
}
return null;
}
/** Gets or creates ChangeDetectorRef for the closest host component */
function getOrCreateHostChangeDetector(currentNode) {
var hostNode = getClosestComponentAncestor(currentNode);
var hostInjector = hostNode.nodeInjector;
var existingRef = hostInjector && hostInjector.changeDetectorRef;
return existingRef ?
existingRef :
createViewRef(hostNode.data, hostNode.view
.directives[hostNode.tNode.flags >> 13 /* DirectiveStartingIndexShift */]);
}
/**
* If the node is an embedded view, traverses up the view tree to return the closest
* ancestor view that is attached to a component. If it's already a component node,
* returns itself.
*/
function getClosestComponentAncestor(node) {
while (node.type === 2 /* View */) {
node = node.view.node;
}
return node;
}
/**
* Searches for an instance of the given directive type up the injector tree and returns
* that instance if found.
*
* Specifically, it gets the bloom filter bit associated with the directive (see bloomHashBit),
* checks that bit against the bloom filter structure to identify an injector that might have
* the directive (see bloomFindPossibleInjector), then searches the directives on that injector
* for a match.
*
* If not found, it will propagate up to the next parent injector until the token
* is found or the top is reached.
*
* @param di Node injector where the search should start
* @param token The directive type to search for
* @param flags Injection flags (e.g. CheckParent)
* @returns The instance found
*/
function getOrCreateInjectable(di, token, flags) {
var bloomHash = bloomHashBit(token);
// If the token has a bloom hash, then it is a directive that is public to the injection system
// (diPublic). If there is no hash, fall back to the module injector.
if (bloomHash === null) {
var moduleInjector = getPreviousOrParentNode().view.injector;
var formerInjector = setCurrentInjector(moduleInjector);
try {
return inject(token, flags);
}
finally {
setCurrentInjector(formerInjector);
}
}
else {
var injector = di;
while (injector) {
// Get the closest potential matching injector (upwards in the injector tree) that
// *potentially* has the token.
injector = bloomFindPossibleInjector(injector, bloomHash);
// If no injector is found, we *know* that there is no ancestor injector that contains the
// token, so we abort.
if (!injector) {
break;
}
// At this point, we have an injector which *may* contain the token, so we step through the
// directives associated with the injector's corresponding node to get the directive instance.
var node = injector.node;
var flags_1 = node.tNode.flags;
var count = flags_1 & 4095 /* DirectiveCountMask */;
if (count !== 0) {
var start = flags_1 >> 13 /* DirectiveStartingIndexShift */;
var end = start + count;
var defs = node.view.tView.directives;
for (var i = start; i < end; i++) {
// Get the definition for the directive at this index and, if it is injectable (diPublic),
// and matches the given token, return the directive instance.
var directiveDef = defs[i];
if (directiveDef.type === token && directiveDef.diPublic) {
return getDirectiveInstance(node.view.directives[i]);
}
}
}
// If we *didn't* find the directive for the token and we are searching the current node's
// injector, it's possible the directive is on this node and hasn't been created yet.
var instance = void 0;
if (injector === di && (instance = searchMatchesQueuedForCreation(node, token))) {
return instance;
}
// The def wasn't found anywhere on this node, so it might be a false positive.
// Traverse up the tree and continue searching.
injector = injector.parent;
}
}
// No directive was found for the given token.
// TODO: implement optional, check-self, and check-parent.
throw new Error('Implement');
}
function searchMatchesQueuedForCreation(node, token) {
var matches = node.view.tView.currentMatches;
if (matches) {
for (var i = 0; i < matches.length; i += 2) {
var def = matches[i];
if (def.type === token) {
return resolveDirective(def, i + 1, matches, node.view.tView);
}
}
}
return null;
}
/**
* Given a directive type, this function returns the bit in an injector's bloom filter
* that should be used to determine whether or not the directive is present.
*
* When the directive was added to the bloom filter, it was given a unique ID that can be
* retrieved on the class. Since there are only BLOOM_SIZE slots per bloom filter, the directive's
* ID must be modulo-ed by BLOOM_SIZE to get the correct bloom bit (directives share slots after
* BLOOM_SIZE is reached).
*
* @param type The directive type
* @returns The bloom bit to check for the directive
*/
function bloomHashBit(type) {
var id = type[NG_ELEMENT_ID];
return typeof id === 'number' ? id % BLOOM_SIZE : null;
}
/**
* Finds the closest injector that might have a certain directive.
*
* Each directive corresponds to a bit in an injector's bloom filter. Given the bloom bit to
* check and a starting injector, this function traverses up injectors until it finds an
* injector that contains a 1 for that bit in its bloom filter. A 1 indicates that the
* injector may have that directive. It only *may* have the directive because directives begin
* to share bloom filter bits after the BLOOM_SIZE is reached, and it could correspond to a
* different directive sharing the bit.
*
* Note: We can skip checking further injectors up the tree if an injector's cbf structure
* has a 0 for that bloom bit. Since cbf contains the merged value of all the parent
* injectors, a 0 in the bloom bit indicates that the parents definitely do not contain
* the directive and do not need to be checked.
*
* @param injector The starting node injector to check
* @param bloomBit The bit to check in each injector's bloom filter
* @returns An injector that might have the directive
*/
function bloomFindPossibleInjector(startInjector, bloomBit) {
// Create a mask that targets the specific bit associated with the directive we're looking for.
// JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding
// to bit positions 0 - 31 in a 32 bit integer.
var mask = 1 << bloomBit;
// Traverse up the injector tree until we find a potential match or until we know there *isn't* a
// match.
var injector = startInjector;
while (injector) {
// Our bloom filter size is 256 bits, which is eight 32-bit bloom filter buckets:
// bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc.
// Get the bloom filter value from the appropriate bucket based on the directive's bloomBit.
var value = void 0;
if (bloomBit < 128) {
value = bloomBit < 64 ? (bloomBit < 32 ? injector.bf0 : injector.bf1) :
(bloomBit < 96 ? injector.bf2 : injector.bf3);
}
else {
value = bloomBit < 192 ? (bloomBit < 160 ? injector.bf4 : injector.bf5) :
(bloomBit < 224 ? injector.bf6 : injector.bf7);
}
// If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,
// this injector is a potential match.
if ((value & mask) === mask) {
return injector;
}
// If the current injector does not have the directive, check the bloom filters for the ancestor
// injectors (cbf0 - cbf7). These filters capture *all* ancestor injectors.
if (bloomBit < 128) {
value = bloomBit < 64 ? (bloomBit < 32 ? injector.cbf0 : injector.cbf1) :
(bloomBit < 96 ? injector.cbf2 : injector.cbf3);
}
else {
value = bloomBit < 192 ? (bloomBit < 160 ? injector.cbf4 : injector.cbf5) :
(bloomBit < 224 ? injector.cbf6 : injector.cbf7);
}
// If the ancestor bloom filter value has the bit corresponding to the directive, traverse up to
// find the specific injector. If the ancestor bloom filter does not have the bit, we can abort.
injector = (value & mask) ? injector.parent : null;
}
return null;
}
var ReadFromInjectorFn = /** @class */ (function () {
function ReadFromInjectorFn(read) {
this.read = read;
}
return ReadFromInjectorFn;
}());
/**
* Creates an ElementRef for a given node injector and stores it on the injector.
* Or, if the ElementRef already exists, retrieves the existing ElementRef.
*
* @param di The node injector where we should store a created ElementRef
* @returns The ElementRef instance to use
*/
function getOrCreateElementRef(di) {
return di.elementRef || (di.elementRef = new ElementRef$1(di.node.type === 0 /* Container */ ? null : di.node.native));
}
/** A ref to a node's native element. */
var ElementRef$1 = /** @class */ (function () {
function ElementRef(nativeElement) {
this.nativeElement = nativeElement;
}
return ElementRef;
}());
/**
* Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef
* already exists, retrieves the existing ViewContainerRef.
*
* @returns The ViewContainerRef instance to use
*/
function getOrCreateContainerRef(di) {
if (!di.viewContainerRef) {
var vcRefHost = di.node;
ngDevMode && assertNodeOfPossibleTypes(vcRefHost, 0 /* Container */, 3 /* Element */);
var lContainer = createLContainer(vcRefHost.parent, vcRefHost.view);
var lContainerNode = createLNodeObject(0 /* Container */, vcRefHost.view, vcRefHost.parent, undefined, lContainer, null);
vcRefHost.dynamicLContainerNode = lContainerNode;
addToViewTree(vcRefHost.view, lContainer);
di.viewContainerRef = new ViewContainerRef$1(lContainerNode);
}
return di.viewContainerRef;
}
/**
* A ref to a container that enables adding and removing views from that container
* imperatively.
*/
var ViewContainerRef$1 = /** @class */ (function () {
function ViewContainerRef(_lContainerNode) {
this._lContainerNode = _lContainerNode;
this._viewRefs = [];
}
ViewContainerRef.prototype.clear = function () {
var lContainer = this._lContainerNode.data;
while (lContainer.views.length) {
this.remove(0);
}
};
ViewContainerRef.prototype.get = function (index) { return this._viewRefs[index] || null; };
Object.defineProperty(ViewContainerRef.prototype, "length", {
get: function () {
var lContainer = this._lContainerNode.data;
return lContainer.views.length;
},
enumerable: true,
configurable: true
});
ViewContainerRef.prototype.createEmbeddedView = function (templateRef, context, index) {
var viewRef = templateRef.createEmbeddedView(context || {});
this.insert(viewRef, index);
return viewRef;
};
ViewContainerRef.prototype.createComponent = function (componentFactory, index, injector, projectableNodes, ngModule) {
throw notImplemented();
};
ViewContainerRef.prototype.insert = function (viewRef, index) {
var lViewNode = viewRef._lViewNode;
var adjustedIdx = this._adjustIndex(index);
insertView(this._lContainerNode, lViewNode, adjustedIdx);
// invalidate cache of next sibling RNode (we do similar operation in the containerRefreshEnd
// instruction)
this._lContainerNode.native = undefined;
this._viewRefs.splice(adjustedIdx, 0, viewRef);
lViewNode.parent = this._lContainerNode;
// If the view is dynamic (has a template), it needs to be counted both at the container
// level and at the node above the container.
if (lViewNode.data.template !== null) {
// Increment the container view count.
this._lContainerNode.data.dynamicViewCount++;
// Look for the parent node and increment its dynamic view count.
if (this._lContainerNode.parent !== null && this._lContainerNode.parent.data !== null) {
ngDevMode && assertNodeOfPossibleTypes(this._lContainerNode.parent, 2 /* View */, 3 /* Element */);
this._lContainerNode.parent.data.dynamicViewCount++;
}
}
return viewRef;
};
ViewContainerRef.prototype.move = function (viewRef, newIndex) {
var index = this.indexOf(viewRef);
this.detach(index);
this.insert(viewRef, this._adjustIndex(newIndex));
return viewRef;
};
ViewContainerRef.prototype.indexOf = function (viewRef) { return this._viewRefs.indexOf(viewRef); };
ViewContainerRef.prototype.remove = function (index) {
this.detach(index);
// TODO(ml): proper destroy of the ViewRef, i.e. recursively destroy the LviewNode and its
// children, delete DOM nodes and QueryList, trigger hooks (onDestroy), destroy the renderer,
// detach projected nodes
};
ViewContainerRef.prototype.detach = function (index) {
var adjustedIdx = this._adjustIndex(index, -1);
removeView(this._lContainerNode, adjustedIdx);
return this._viewRefs.splice(adjustedIdx, 1)[0] || null;
};
ViewContainerRef.prototype._adjustIndex = function (index, shift) {
if (shift === void 0) { shift = 0; }
if (index == null) {
return this._lContainerNode.data.views.length + shift;
}
if (ngDevMode) {
assertGreaterThan(index, -1, 'index must be positive');
// +1 because it's legal to insert at the end.
assertLessThan(index, this._lContainerNode.data.views.length + 1 + shift, 'index');
}
return index;
};
return ViewContainerRef;
}());
/**
* Creates a TemplateRef and stores it on the injector. Or, if the TemplateRef already
* exists, retrieves the existing TemplateRef.
*
* @param di The node injector where we should store a created TemplateRef
* @returns The TemplateRef instance to use
*/
function getOrCreateTemplateRef(di) {
ngDevMode && assertNodeType(di.node, 0 /* Container */);
var data = di.node.data;
var tView = di.node.view.tView;
return di.templateRef || (di.templateRef = new TemplateRef$1(getOrCreateElementRef(di), data.template, getRenderer(), tView.directiveRegistry, tView.pipeRegistry));
}
var TemplateRef$1 = /** @class */ (function () {
function TemplateRef(elementRef, template, _renderer, _directives, _pipes) {
this._renderer = _renderer;
this._directives = _directives;
this._pipes = _pipes;
this.elementRef = elementRef;
this._template = template;
}
TemplateRef.prototype.createEmbeddedView = function (context) {
var viewNode = renderEmbeddedTemplate(null, this._template, context, this._renderer, this._directives, this._pipes);
return addDestroyable(new EmbeddedViewRef$1(viewNode, this._template, context));
};
return TemplateRef;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Create a component definition object.
*
*
* # Example
* ```
* class MyDirective {
* // Generated by Angular Template Compiler
* // [Symbol] syntax will not be supported by TypeScript until v2.7
* static ngComponentDef = defineComponent({
* ...
* });
* }
* ```
*/
function defineComponent(componentDefinition) {
var type = componentDefinition.type;
var pipeTypes = componentDefinition.pipes;
var directiveTypes = componentDefinition.directives;
var def = {
type: type,
diPublic: null,
factory: componentDefinition.factory,
template: componentDefinition.template || null,
hostBindings: componentDefinition.hostBindings || null,
attributes: componentDefinition.attributes || null,
inputs: invertObject(componentDefinition.inputs),
outputs: invertObject(componentDefinition.outputs),
rendererType: resolveRendererType2(componentDefinition.rendererType) || null,
exportAs: componentDefinition.exportAs,
onInit: type.prototype.ngOnInit || null,
doCheck: type.prototype.ngDoCheck || null,
afterContentInit: type.prototype.ngAfterContentInit || null,
afterContentChecked: type.prototype.ngAfterContentChecked || null,
afterViewInit: type.prototype.ngAfterViewInit || null,
afterViewChecked: type.prototype.ngAfterViewChecked || null,
onDestroy: type.prototype.ngOnDestroy || null,
onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,
directiveDefs: directiveTypes ?
function () { return (typeof directiveTypes === 'function' ? directiveTypes() : directiveTypes)
.map(extractDirectiveDef); } :
null,
pipeDefs: pipeTypes ?
function () { return (typeof pipeTypes === 'function' ? pipeTypes() : pipeTypes).map(extractPipeDef); } :
null,
selectors: componentDefinition.selectors
};
var feature = componentDefinition.features;
feature && feature.forEach(function (fn) { return fn(def); });
return def;
}
function extractDirectiveDef(type) {
var def = type.ngComponentDef || type.ngDirectiveDef;
if (ngDevMode && !def) {
throw new Error("'" + type.name + "' is neither 'ComponentType' or 'DirectiveType'.");
}
return def;
}
function extractPipeDef(type) {
var def = type.ngPipeDef;
if (ngDevMode && !def) {
throw new Error("'" + type.name + "' is not a 'PipeType'.");
}
return def;
}
var PRIVATE_PREFIX = '__ngOnChanges_';
/**
* Creates an NgOnChangesFeature function for a component's features list.
*
* It accepts an optional map of minified input property names to original property names,
* if any input properties have a public alias.
*
* The NgOnChangesFeature function that is returned decorates a component with support for
* the ngOnChanges lifecycle hook, so it should be included in any component that implements
* that hook.
*
* Example usage:
*
* ```
* static ngComponentDef = defineComponent({
* ...
* inputs: {name: 'publicName'},
* features: [NgOnChangesFeature({name: 'name'})]
* });
* ```
*
* @param inputPropertyNames Map of input property names, if they are aliased
* @returns DirectiveDefFeature
*/
function NgOnChangesFeature(inputPropertyNames) {
return function (definition) {
var inputs = definition.inputs;
var proto = definition.type.prototype;
// Place where we will store SimpleChanges if there is a change
Object.defineProperty(proto, PRIVATE_PREFIX, { value: undefined, writable: true });
var _loop_1 = function (pubKey) {
var minKey = inputs[pubKey];
var propertyName = inputPropertyNames && inputPropertyNames[minKey] || pubKey;
var privateMinKey = PRIVATE_PREFIX + minKey;
// Create a place where the actual value will be stored and make it non-enumerable
Object.defineProperty(proto, privateMinKey, { value: undefined, writable: true });
var existingDesc = Object.getOwnPropertyDescriptor(proto, minKey);
// create a getter and setter for property
Object.defineProperty(proto, minKey, {
get: function () {
return (existingDesc && existingDesc.get) ? existingDesc.get.call(this) :
this[privateMinKey];
},
set: function (value) {
var simpleChanges = this[PRIVATE_PREFIX];
var isFirstChange = simpleChanges === undefined;
if (simpleChanges == null) {
simpleChanges = this[PRIVATE_PREFIX] = {};
}
simpleChanges[propertyName] = new SimpleChange(this[privateMinKey], value, isFirstChange);
(existingDesc && existingDesc.set) ? existingDesc.set.call(this, value) :
this[privateMinKey] = value;
}
});
};
for (var pubKey in inputs) {
_loop_1(pubKey);
}
// If an onInit hook is defined, it will need to wrap the ngOnChanges call
// so the call order is changes-init-check in creation mode. In subsequent
// change detection runs, only the check wrapper will be called.
if (definition.onInit != null) {
definition.onInit = onChangesWrapper(definition.onInit);
}
definition.doCheck = onChangesWrapper(definition.doCheck);
};
function onChangesWrapper(delegateHook) {
return function () {
var simpleChanges = this[PRIVATE_PREFIX];
if (simpleChanges != null) {
this.ngOnChanges(simpleChanges);
this[PRIVATE_PREFIX] = null;
}
delegateHook && delegateHook.apply(this);
};
}
}
function PublicFeature(definition) {
definition.diPublic = diPublic;
}
var EMPTY$1 = {};
/** Swaps the keys and values of an object. */
function invertObject(obj) {
if (obj == null)
return EMPTY$1;
var newObj = {};
for (var minifiedKey in obj) {
newObj[obj[minifiedKey]] = minifiedKey;
}
return newObj;
}
/**
* Create a directive definition object.
*
* # Example
* ```
* class MyDirective {
* // Generated by Angular Template Compiler
* // [Symbol] syntax will not be supported by TypeScript until v2.7
* static ngDirectiveDef = defineDirective({
* ...
* });
* }
* ```
*/
var defineDirective = defineComponent;
/**
* Create a pipe definition object.
*
* # Example
* ```
* class MyPipe implements PipeTransform {
* // Generated by Angular Template Compiler
* static ngPipeDef = definePipe({
* ...
* });
* }
* ```
* @param pipeDef Pipe definition generated by the compiler
*/
function definePipe(pipeDef) {
return {
name: pipeDef.name,
n: pipeDef.factory,
pure: pipeDef.pure !== false,
onDestroy: pipeDef.type.prototype.ngOnDestroy || null
};
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* If the value hasn't been saved, calls the pure function to store and return the
* value. If it has been saved, returns the saved value.
*
* @param pureFn Function that returns a value
* @returns value
*/
function pureFunction0(pureFn, thisArg) {
return getCreationMode() ? checkAndUpdateBinding$1(thisArg ? pureFn.call(thisArg) : pureFn()) :
consumeBinding();
}
/**
* If the value of the provided exp has changed, calls the pure function to return
* an updated value. Or if the value has not changed, returns cached value.
*
* @param pureFn Function that returns an updated value
* @param exp Updated expression value
* @returns Updated value
*/
function pureFunction1(pureFn, exp, thisArg) {
return bindingUpdated(exp) ?
checkAndUpdateBinding$1(thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) :
consumeBinding();
}
/**
* If the value of any provided exp has changed, calls the pure function to return
* an updated value. Or if no values have changed, returns cached value.
*
* @param pureFn
* @param exp1
* @param exp2
* @returns Updated value
*/
function pureFunction2(pureFn, exp1, exp2, thisArg) {
return bindingUpdated2(exp1, exp2) ?
checkAndUpdateBinding$1(thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) :
consumeBinding();
}
/**
* If the value of any provided exp has changed, calls the pure function to return
* an updated value. Or if no values have changed, returns cached value.
*
* @param pureFn
* @param exp1
* @param exp2
* @param exp3
* @returns Updated value
*/
function pureFunction3(pureFn, exp1, exp2, exp3, thisArg) {
var different = bindingUpdated2(exp1, exp2);
return bindingUpdated(exp3) || different ?
checkAndUpdateBinding$1(thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :
consumeBinding();
}
/**
* If the value of any provided exp has changed, calls the pure function to return
* an updated value. Or if no values have changed, returns cached value.
*
* @param pureFn
* @param exp1
* @param exp2
* @param exp3
* @param exp4
* @returns Updated value
*/
function pureFunction4(pureFn, exp1, exp2, exp3, exp4, thisArg) {
return bindingUpdated4(exp1, exp2, exp3, exp4) ?
checkAndUpdateBinding$1(thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) :
consumeBinding();
}
/**
* If the value of any provided exp has changed, calls the pure function to return
* an updated value. Or if no values have changed, returns cached value.
*
* @param pureFn
* @param exp1
* @param exp2
* @param exp3
* @param exp4
* @param exp5
* @returns Updated value
*/
function pureFunction5(pureFn, exp1, exp2, exp3, exp4, exp5, thisArg) {
var different = bindingUpdated4(exp1, exp2, exp3, exp4);
return bindingUpdated(exp5) || different ?
checkAndUpdateBinding$1(thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5) :
pureFn(exp1, exp2, exp3, exp4, exp5)) :
consumeBinding();
}
/**
* If the value of any provided exp has changed, calls the pure function to return
* an updated value. Or if no values have changed, returns cached value.
*
* @param pureFn
* @param exp1
* @param exp2
* @param exp3
* @param exp4
* @param exp5
* @param exp6
* @returns Updated value
*/
function pureFunction6(pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {
var different = bindingUpdated4(exp1, exp2, exp3, exp4);
return bindingUpdated2(exp5, exp6) || different ?
checkAndUpdateBinding$1(thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) :
pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) :
consumeBinding();
}
/**
* If the value of any provided exp has changed, calls the pure function to return
* an updated value. Or if no values have changed, returns cached value.
*
* @param pureFn
* @param exp1
* @param exp2
* @param exp3
* @param exp4
* @param exp5
* @param exp6
* @param exp7
* @returns Updated value
*/
function pureFunction7(pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, thisArg) {
var different = bindingUpdated4(exp1, exp2, exp3, exp4);
different = bindingUpdated2(exp5, exp6) || different;
return bindingUpdated(exp7) || different ?
checkAndUpdateBinding$1(thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7) :
pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7)) :
consumeBinding();
}
/**
* If the value of any provided exp has changed, calls the pure function to return
* an updated value. Or if no values have changed, returns cached value.
*
* @param pureFn
* @param exp1
* @param exp2
* @param exp3
* @param exp4
* @param exp5
* @param exp6
* @param exp7
* @param exp8
* @returns Updated value
*/
function pureFunction8(pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8, thisArg) {
var different = bindingUpdated4(exp1, exp2, exp3, exp4);
return bindingUpdated4(exp5, exp6, exp7, exp8) || different ?
checkAndUpdateBinding$1(thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8) :
pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)) :
consumeBinding();
}
/**
* pureFunction instruction that can support any number of bindings.
*
* If the value of any provided exp has changed, calls the pure function to return
* an updated value. Or if no values have changed, returns cached value.
*
* @param pureFn A pure function that takes binding values and builds an object or array
* containing those values.
* @param exp An array of binding values
* @returns Updated value
*/
function pureFunctionV(pureFn, exps, thisArg) {
var different = false;
for (var i = 0; i < exps.length; i++) {
bindingUpdated(exps[i]) && (different = true);
}
return different ? checkAndUpdateBinding$1(pureFn.apply(thisArg, exps)) : consumeBinding();
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Create a pipe.
*
* @param index Pipe index where the pipe will be stored.
* @param pipeName The name of the pipe
* @returns T the instance of the pipe.
*/
function pipe(index, pipeName) {
var tView = getTView();
var pipeDef;
if (tView.firstTemplatePass) {
pipeDef = getPipeDef(pipeName, tView.pipeRegistry);
tView.data[index] = pipeDef;
if (pipeDef.onDestroy) {
(tView.pipeDestroyHooks || (tView.pipeDestroyHooks = [])).push(index, pipeDef.onDestroy);
}
}
else {
pipeDef = tView.data[index];
}
var pipeInstance = pipeDef.n();
store(index, pipeInstance);
return pipeInstance;
}
/**
* Searches the pipe registry for a pipe with the given name. If one is found,
* returns the pipe. Otherwise, an error is thrown because the pipe cannot be resolved.
*
* @param name Name of pipe to resolve
* @param registry Full list of available pipes
* @returns Matching PipeDef
*/
function getPipeDef(name, registry) {
if (registry) {
for (var i = 0; i < registry.length; i++) {
var pipeDef = registry[i];
if (name === pipeDef.name) {
return pipeDef;
}
}
}
throw new Error("Pipe with name '" + name + "' not found!");
}
/**
* Invokes a pipe with 1 arguments.
*
* This instruction acts as a guard to {@link PipeTransform#transform} invoking
* the pipe only when an input to the pipe changes.
*
* @param index Pipe index where the pipe was stored on creation.
* @param v1 1st argument to {@link PipeTransform#transform}.
*/
function pipeBind1(index, v1) {
var pipeInstance = load(index);
return isPure(index) ? pureFunction1(pipeInstance.transform, v1, pipeInstance) :
pipeInstance.transform(v1);
}
/**
* Invokes a pipe with 2 arguments.
*
* This instruction acts as a guard to {@link PipeTransform#transform} invoking
* the pipe only when an input to the pipe changes.
*
* @param index Pipe index where the pipe was stored on creation.
* @param v1 1st argument to {@link PipeTransform#transform}.
* @param v2 2nd argument to {@link PipeTransform#transform}.
*/
function pipeBind2(index, v1, v2) {
var pipeInstance = load(index);
return isPure(index) ? pureFunction2(pipeInstance.transform, v1, v2, pipeInstance) :
pipeInstance.transform(v1, v2);
}
/**
* Invokes a pipe with 3 arguments.
*
* This instruction acts as a guard to {@link PipeTransform#transform} invoking
* the pipe only when an input to the pipe changes.
*
* @param index Pipe index where the pipe was stored on creation.
* @param v1 1st argument to {@link PipeTransform#transform}.
* @param v2 2nd argument to {@link PipeTransform#transform}.
* @param v3 4rd argument to {@link PipeTransform#transform}.
*/
function pipeBind3(index, v1, v2, v3) {
var pipeInstance = load(index);
return isPure(index) ? pureFunction3(pipeInstance.transform.bind(pipeInstance), v1, v2, v3) :
pipeInstance.transform(v1, v2, v3);
}
/**
* Invokes a pipe with 4 arguments.
*
* This instruction acts as a guard to {@link PipeTransform#transform} invoking
* the pipe only when an input to the pipe changes.
*
* @param index Pipe index where the pipe was stored on creation.
* @param v1 1st argument to {@link PipeTransform#transform}.
* @param v2 2nd argument to {@link PipeTransform#transform}.
* @param v3 3rd argument to {@link PipeTransform#transform}.
* @param v4 4th argument to {@link PipeTransform#transform}.
*/
function pipeBind4(index, v1, v2, v3, v4) {
var pipeInstance = load(index);
return isPure(index) ? pureFunction4(pipeInstance.transform, v1, v2, v3, v4, pipeInstance) :
pipeInstance.transform(v1, v2, v3, v4);
}
/**
* Invokes a pipe with variable number of arguments.
*
* This instruction acts as a guard to {@link PipeTransform#transform} invoking
* the pipe only when an input to the pipe changes.
*
* @param index Pipe index where the pipe was stored on creation.
* @param values Array of arguments to pass to {@link PipeTransform#transform} method.
*/
function pipeBindV(index, values) {
var pipeInstance = load(index);
return isPure(index) ? pureFunctionV(pipeInstance.transform, values, pipeInstance) :
pipeInstance.transform.apply(pipeInstance, values);
}
function isPure(index) {
return getTView().data[index].pure;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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 LQueries_ = /** @class */ (function () {
function LQueries_(deep) {
this.shallow = null;
this.deep = null;
this.deep = deep == null ? null : deep;
}
LQueries_.prototype.track = function (queryList, predicate, descend, read) {
// TODO(misko): This is not right. In case of inherited state, a calling track will incorrectly
// mutate parent.
if (descend) {
this.deep = createQuery$1(this.deep, queryList, predicate, read != null ? read : null);
}
else {
this.shallow = createQuery$1(this.shallow, queryList, predicate, read != null ? read : null);
}
};
LQueries_.prototype.child = function () {
if (this.deep === null) {
// if we don't have any deep queries then no need to track anything more.
return null;
}
if (this.shallow === null) {
// DeepQuery: We can reuse the current state if the child state would be same as current
// state.
return this;
}
else {
// We need to create new state
return new LQueries_(this.deep);
}
};
LQueries_.prototype.container = function () {
var result = null;
var query = this.deep;
while (query) {
var containerValues = []; // prepare room for views
query.values.push(containerValues);
var clonedQuery = { next: null, list: query.list, predicate: query.predicate, values: containerValues };
clonedQuery.next = result;
result = clonedQuery;
query = query.next;
}
return result ? new LQueries_(result) : null;
};
LQueries_.prototype.enterView = function (index) {
var result = null;
var query = this.deep;
while (query) {
var viewValues = []; // prepare room for view nodes
query.values.splice(index, 0, viewValues);
var clonedQuery = { next: null, list: query.list, predicate: query.predicate, values: viewValues };
clonedQuery.next = result;
result = clonedQuery;
query = query.next;
}
return result ? new LQueries_(result) : null;
};
LQueries_.prototype.addNode = function (node) {
add(this.shallow, node);
add(this.deep, node);
};
LQueries_.prototype.removeView = function (index) {
var query = this.deep;
while (query) {
var removed = query.values.splice(index, 1);
// mark a query as dirty only when removed view had matching modes
ngDevMode && assertEqual(removed.length, 1, 'removed.length');
if (removed[0].length) {
query.list.setDirty();
}
query = query.next;
}
};
return LQueries_;
}());
/**
* Iterates over local names for a given node and returns directive index
* (or -1 if a local name points to an element).
*
* @param tNode static data of a node to check
* @param selector selector to match
* @returns directive index, -1 or null if a selector didn't match any of the local names
*/
function getIdxOfMatchingSelector(tNode, selector) {
var localNames = tNode.localNames;
if (localNames) {
for (var i = 0; i < localNames.length; i += 2) {
if (localNames[i] === selector) {
return localNames[i + 1];
}
}
}
return null;
}
/**
* Iterates over all the directives for a node and returns index of a directive for a given type.
*
* @param node Node on which directives are present.
* @param type Type of a directive to look for.
* @returns Index of a found directive or null when none found.
*/
function getIdxOfMatchingDirective(node, type) {
var defs = node.view.tView.directives;
var flags = node.tNode.flags;
var count = flags & 4095 /* DirectiveCountMask */;
var start = flags >> 13 /* DirectiveStartingIndexShift */;
var end = start + count;
for (var i = start; i < end; i++) {
var def = defs[i];
if (def.type === type && def.diPublic) {
return i;
}
}
return null;
}
function readFromNodeInjector(nodeInjector, node, read, directiveIdx) {
if (read instanceof ReadFromInjectorFn) {
return read.read(nodeInjector, node, directiveIdx);
}
else {
var matchingIdx = getIdxOfMatchingDirective(node, read);
if (matchingIdx !== null) {
return node.view.directives[matchingIdx];
}
}
return null;
}
function add(query, node) {
var nodeInjector = getOrCreateNodeInjectorForNode(node);
while (query) {
var predicate = query.predicate;
var type = predicate.type;
if (type) {
var directiveIdx = getIdxOfMatchingDirective(node, type);
if (directiveIdx !== null) {
// a node is matching a predicate - determine what to read
// if read token and / or strategy is not specified, use type as read token
var result = readFromNodeInjector(nodeInjector, node, predicate.read || type, directiveIdx);
if (result !== null) {
addMatch(query, result);
}
}
}
else {
var selector = predicate.selector;
for (var i = 0; i < selector.length; i++) {
ngDevMode && assertNotNull(node.tNode, 'node.tNode');
var directiveIdx = getIdxOfMatchingSelector(node.tNode, selector[i]);
if (directiveIdx !== null) {
// a node is matching a predicate - determine what to read
// note that queries using name selector must specify read strategy
ngDevMode && assertNotNull(predicate.read, 'the node should have a predicate');
var result = readFromNodeInjector(nodeInjector, node, predicate.read, directiveIdx);
if (result !== null) {
addMatch(query, result);
}
}
}
}
query = query.next;
}
}
function addMatch(query, matchingValue) {
query.values.push(matchingValue);
query.list.setDirty();
}
function createPredicate(predicate, read) {
var isArray = Array.isArray(predicate);
return {
type: isArray ? null : predicate,
selector: isArray ? predicate : null,
read: read
};
}
function createQuery$1(previous, queryList, predicate, read) {
return {
next: previous,
list: queryList,
predicate: createPredicate(predicate, read),
values: queryList._valuesTree
};
}
var QueryList_ = /** @class */ (function () {
function QueryList_() {
this.dirty = true;
this.changes = new EventEmitter();
this._values = [];
/** @internal */
this._valuesTree = [];
}
Object.defineProperty(QueryList_.prototype, "length", {
get: function () { return this._values.length; },
enumerable: true,
configurable: true
});
Object.defineProperty(QueryList_.prototype, "first", {
get: function () {
var values = this._values;
return values.length ? values[0] : null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(QueryList_.prototype, "last", {
get: function () {
var values = this._values;
return values.length ? values[values.length - 1] : null;
},
enumerable: true,
configurable: true
});
/**
* See
* [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
*/
QueryList_.prototype.map = function (fn) { return this._values.map(fn); };
/**
* See
* [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
*/
QueryList_.prototype.filter = function (fn) {
return this._values.filter(fn);
};
/**
* See
* [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
*/
QueryList_.prototype.find = function (fn) {
return this._values.find(fn);
};
/**
* See
* [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
*/
QueryList_.prototype.reduce = function (fn, init) {
return this._values.reduce(fn, init);
};
/**
* See
* [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
*/
QueryList_.prototype.forEach = function (fn) { this._values.forEach(fn); };
/**
* See
* [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
*/
QueryList_.prototype.some = function (fn) {
return this._values.some(fn);
};
QueryList_.prototype.toArray = function () { return this._values.slice(0); };
QueryList_.prototype[getSymbolIterator()] = function () { return this._values[getSymbolIterator()](); };
QueryList_.prototype.toString = function () { return this._values.toString(); };
QueryList_.prototype.reset = function (res) {
this._values = flatten$1(res);
this.dirty = false;
};
QueryList_.prototype.notifyOnChanges = function () { this.changes.emit(this); };
QueryList_.prototype.setDirty = function () { this.dirty = true; };
QueryList_.prototype.destroy = function () {
this.changes.complete();
this.changes.unsubscribe();
};
return QueryList_;
}());
var QueryList$1 = QueryList_;
/**
* Creates and returns a QueryList.
*
* @param memoryIndex The index in memory where the QueryList should be saved. If null,
* this is is a content query and the QueryList will be saved later through directiveCreate.
* @param predicate The type for which the query will search
* @param descend Whether or not to descend into children
* @param read What to save in the query
* @returns QueryList<T>
*/
function query(memoryIndex, predicate, descend, read) {
ngDevMode && assertPreviousIsParent();
var queryList = new QueryList$1();
var queries = getCurrentQueries(LQueries_);
queries.track(queryList, predicate, descend, read);
if (memoryIndex != null) {
store(memoryIndex, queryList);
}
return queryList;
}
/**
* Refreshes a query by combining matches from all active views and removing matches from deleted
* views.
* Returns true if a query got dirty during change detection, false otherwise.
*/
function queryRefresh(queryList) {
var queryListImpl = queryList;
if (queryList.dirty) {
queryList.reset(queryListImpl._valuesTree);
queryList.notifyOnChanges();
return true;
}
return false;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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 BRAND = '__SANITIZER_TRUSTED_BRAND__';
/**
* An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing
* dangerous content.
*
* This method parses the `html` and locates potentially dangerous content (such as urls and
* javascript) and removes it.
*
* It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.
*
* @param unsafeHtml untrusted `html`, typically from the user.
* @returns `html` string which is safe to display to user, because all of the dangerous javascript
* and urls have been removed.
*/
function sanitizeHtml(unsafeHtml) {
if (unsafeHtml instanceof String && unsafeHtml[BRAND] === 'Html') {
return unsafeHtml.toString();
}
return _sanitizeHtml(document, stringify$1(unsafeHtml));
}
/**
* A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing
* dangerous content.
*
* This method parses the `style` and locates potentially dangerous content (such as urls and
* javascript) and removes it.
*
* It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.
*
* @param unsafeStyle untrusted `style`, typically from the user.
* @returns `style` string which is safe to bind to the `style` properties, because all of the
* dangerous javascript and urls have been removed.
*/
function sanitizeStyle(unsafeStyle) {
if (unsafeStyle instanceof String && unsafeStyle[BRAND] === 'Style') {
return unsafeStyle.toString();
}
return _sanitizeStyle(stringify$1(unsafeStyle));
}
/**
* A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing
* dangerous
* content.
*
* This method parses the `url` and locates potentially dangerous content (such as javascript) and
* removes it.
*
* It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.
*
* @param unsafeUrl untrusted `url`, typically from the user.
* @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
* all of the dangerous javascript has been removed.
*/
function sanitizeUrl(unsafeUrl) {
if (unsafeUrl instanceof String && unsafeUrl[BRAND] === 'Url') {
return unsafeUrl.toString();
}
return _sanitizeUrl(stringify$1(unsafeUrl));
}
/**
* A `url` sanitizer which only lets trusted `url`s through.
*
* This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.
*
* @param unsafeResourceUrl untrusted `url`, typically from the user.
* @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
* only trusted `url`s have been allowed to pass.
*/
function sanitizeResourceUrl(unsafeResourceUrl) {
if (unsafeResourceUrl instanceof String &&
unsafeResourceUrl[BRAND] === 'ResourceUrl') {
return unsafeResourceUrl.toString();
}
throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)');
}
/**
* Mark `html` string as trusted.
*
* This function wraps the trusted string in `String` and brands it in a way which makes it
* recognizable to {@link htmlSanitizer} to be trusted implicitly.
*
* @param trustedHtml `html` string which needs to be implicitly trusted.
* @returns a `html` `String` which has been branded to be implicitly trusted.
*/
function bypassSanitizationTrustHtml(trustedHtml) {
return bypassSanitizationTrustString(trustedHtml, 'Html');
}
/**
* Mark `style` string as trusted.
*
* This function wraps the trusted string in `String` and brands it in a way which makes it
* recognizable to {@link styleSanitizer} to be trusted implicitly.
*
* @param trustedStyle `style` string which needs to be implicitly trusted.
* @returns a `style` `String` which has been branded to be implicitly trusted.
*/
function bypassSanitizationTrustStyle(trustedStyle) {
return bypassSanitizationTrustString(trustedStyle, 'Style');
}
/**
* Mark `script` string as trusted.
*
* This function wraps the trusted string in `String` and brands it in a way which makes it
* recognizable to {@link scriptSanitizer} to be trusted implicitly.
*
* @param trustedScript `script` string which needs to be implicitly trusted.
* @returns a `script` `String` which has been branded to be implicitly trusted.
*/
function bypassSanitizationTrustScript(trustedScript) {
return bypassSanitizationTrustString(trustedScript, 'Script');
}
/**
* Mark `url` string as trusted.
*
* This function wraps the trusted string in `String` and brands it in a way which makes it
* recognizable to {@link urlSanitizer} to be trusted implicitly.
*
* @param trustedUrl `url` string which needs to be implicitly trusted.
* @returns a `url` `String` which has been branded to be implicitly trusted.
*/
function bypassSanitizationTrustUrl(trustedUrl) {
return bypassSanitizationTrustString(trustedUrl, 'Url');
}
/**
* Mark `url` string as trusted.
*
* This function wraps the trusted string in `String` and brands it in a way which makes it
* recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.
*
* @param trustedResourceUrl `url` string which needs to be implicitly trusted.
* @returns a `url` `String` which has been branded to be implicitly trusted.
*/
function bypassSanitizationTrustResourceUrl(trustedResourceUrl) {
return bypassSanitizationTrustString(trustedResourceUrl, 'ResourceUrl');
}
function bypassSanitizationTrustString(trustedString, mode) {
var trusted = new String(trustedString);
trusted[BRAND] = mode;
return trusted;
}
/**
* @license
* Copyright Google Inc. 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
*/
// clang-format on
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
// This file only reexports content of the `src` folder. Keep it that way.
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Generated bundle index. Do not edit.
*/
//# sourceMappingURL=core.js.map
/***/ }),
/***/ "./node_modules/@angular/flex-layout/esm5/core.es5.js":
/*!************************************************************!*\
!*** ./node_modules/@angular/flex-layout/esm5/core.es5.js ***!
\************************************************************/
/*! exports provided: removeStyles, BROWSER_PROVIDER, CLASS_NAME, CoreModule, MediaQueriesModule, MediaChange, StylesheetMap, STYLESHEET_MAP_PROVIDER_FACTORY, STYLESHEET_MAP_PROVIDER, ADD_FLEX_STYLES, SERVER_TOKEN, DISABLE_DEFAULT_BREAKPOINTS, ADD_ORIENTATION_BREAKPOINTS, BREAKPOINT, DISABLE_VENDOR_PREFIXES, BaseFxDirective, BaseFxDirectiveAdapter, RESPONSIVE_ALIASES, DEFAULT_BREAKPOINTS, ScreenTypes, ORIENTATION_BREAKPOINTS, BreakPointRegistry, buildMergedBreakPoints, DEFAULT_BREAKPOINTS_PROVIDER_FACTORY, DEFAULT_BREAKPOINTS_PROVIDER, BREAKPOINTS_PROVIDER_FACTORY, BREAKPOINTS_PROVIDER, CUSTOM_BREAKPOINTS_PROVIDER_FACTORY, BREAKPOINTS, MatchMedia, MockMatchMedia, MockMediaQueryList, MockMatchMediaProvider, ServerMediaQueryList, ServerMatchMedia, MediaMonitor, MEDIA_MONITOR_PROVIDER_FACTORY, MEDIA_MONITOR_PROVIDER, ObservableMedia, MediaService, OBSERVABLE_MEDIA_PROVIDER_FACTORY, OBSERVABLE_MEDIA_PROVIDER, KeyOptions, ResponsiveActivation, StyleUtils, ɵb, ɵa, ɵe, ɵd, ɵc */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeStyles", function() { return removeStyles; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BROWSER_PROVIDER", function() { return BROWSER_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CLASS_NAME", function() { return CLASS_NAME; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CoreModule", function() { return CoreModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MediaQueriesModule", function() { return MediaQueriesModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MediaChange", function() { return MediaChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StylesheetMap", function() { return StylesheetMap; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "STYLESHEET_MAP_PROVIDER_FACTORY", function() { return STYLESHEET_MAP_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "STYLESHEET_MAP_PROVIDER", function() { return STYLESHEET_MAP_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ADD_FLEX_STYLES", function() { return ADD_FLEX_STYLES; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SERVER_TOKEN", function() { return SERVER_TOKEN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DISABLE_DEFAULT_BREAKPOINTS", function() { return DISABLE_DEFAULT_BREAKPOINTS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ADD_ORIENTATION_BREAKPOINTS", function() { return ADD_ORIENTATION_BREAKPOINTS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BREAKPOINT", function() { return BREAKPOINT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DISABLE_VENDOR_PREFIXES", function() { return DISABLE_VENDOR_PREFIXES; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseFxDirective", function() { return BaseFxDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseFxDirectiveAdapter", function() { return BaseFxDirectiveAdapter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESPONSIVE_ALIASES", function() { return RESPONSIVE_ALIASES; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_BREAKPOINTS", function() { return DEFAULT_BREAKPOINTS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScreenTypes", function() { return ScreenTypes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ORIENTATION_BREAKPOINTS", function() { return ORIENTATION_BREAKPOINTS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BreakPointRegistry", function() { return BreakPointRegistry; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildMergedBreakPoints", function() { return buildMergedBreakPoints; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_BREAKPOINTS_PROVIDER_FACTORY", function() { return DEFAULT_BREAKPOINTS_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_BREAKPOINTS_PROVIDER", function() { return DEFAULT_BREAKPOINTS_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BREAKPOINTS_PROVIDER_FACTORY", function() { return BREAKPOINTS_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BREAKPOINTS_PROVIDER", function() { return BREAKPOINTS_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CUSTOM_BREAKPOINTS_PROVIDER_FACTORY", function() { return CUSTOM_BREAKPOINTS_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BREAKPOINTS", function() { return BREAKPOINTS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatchMedia", function() { return MatchMedia; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MockMatchMedia", function() { return MockMatchMedia; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MockMediaQueryList", function() { return MockMediaQueryList; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MockMatchMediaProvider", function() { return MockMatchMediaProvider; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ServerMediaQueryList", function() { return ServerMediaQueryList; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ServerMatchMedia", function() { return ServerMatchMedia; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MediaMonitor", function() { return MediaMonitor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MEDIA_MONITOR_PROVIDER_FACTORY", function() { return MEDIA_MONITOR_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MEDIA_MONITOR_PROVIDER", function() { return MEDIA_MONITOR_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObservableMedia", function() { return ObservableMedia; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MediaService", function() { return MediaService; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OBSERVABLE_MEDIA_PROVIDER_FACTORY", function() { return OBSERVABLE_MEDIA_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OBSERVABLE_MEDIA_PROVIDER", function() { return OBSERVABLE_MEDIA_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyOptions", function() { return KeyOptions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveActivation", function() { return ResponsiveActivation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StyleUtils", function() { return StyleUtils; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵb", function() { return BREAKPOINT_REGISTRY_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵa", function() { return BREAKPOINT_REGISTRY_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵe", function() { return validateSuffixes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵd", function() { return MATCH_MEDIA_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵc", function() { return MATCH_MEDIA_PROVIDER_FACTORY; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var rxjs_BehaviorSubject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/BehaviorSubject */ "./node_modules/rxjs-compat/_esm5/BehaviorSubject.js");
/* harmony import */ var rxjs_operators_filter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators/filter */ "./node_modules/rxjs-compat/_esm5/operators/filter.js");
/* harmony import */ var rxjs_operators_map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators/map */ "./node_modules/rxjs-compat/_esm5/operators/map.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Find all of the server-generated stylings, if any, and remove them
* This will be in the form of inline classes and the style block in the
* head of the DOM
* @param {?} _document
* @param {?} platformId
* @return {?}
*/
function removeStyles(_document, platformId) {
return function () {
if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_1__["isPlatformBrowser"])(platformId)) {
var /** @type {?} */ elements = Array.from(_document.querySelectorAll("[class*=" + CLASS_NAME + "]"));
// RegExp constructor should only be used if passing a variable to the constructor.
// When using static regular expression it is more performant to use reg exp literal.
// This is also needed to provide Safari 9 compatibility, please see
// https://stackoverflow.com/questions/37919802 for more discussion.
var /** @type {?} */ classRegex_1 = /\bflex-layout-.+?\b/g;
elements.forEach(function (el) {
el.classList.contains(CLASS_NAME + "ssr") && el.parentNode ?
el.parentNode.removeChild(el) : el.className.replace(classRegex_1, '');
});
}
};
}
/**
* Provider to remove SSR styles on the browser
*/
var /** @type {?} */ BROWSER_PROVIDER = {
provide: /** @type {?} */ (_angular_core__WEBPACK_IMPORTED_MODULE_0__["APP_BOOTSTRAP_LISTENER"]),
useFactory: removeStyles,
deps: [_angular_common__WEBPACK_IMPORTED_MODULE_1__["DOCUMENT"], _angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"]],
multi: true
};
var /** @type {?} */ CLASS_NAME = 'flex-layout-';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token unique to the flex-layout library.
* Use this token when build a custom provider (see below).
*/
var /** @type {?} */ BREAKPOINTS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('Token (@angular/flex-layout) Breakpoints');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Registry of 1..n MediaQuery breakpoint ranges
* This is published as a provider and may be overridden from custom, application-specific ranges
*
*/
var BreakPointRegistry = /** @class */ (function () {
function BreakPointRegistry(_registry) {
this._registry = _registry;
}
Object.defineProperty(BreakPointRegistry.prototype, "items", {
/**
* Accessor to raw list
*/
get: /**
* Accessor to raw list
* @return {?}
*/
function () {
return this._registry.slice();
},
enumerable: true,
configurable: true
});
Object.defineProperty(BreakPointRegistry.prototype, "sortedItems", {
/**
* Accessor to sorted list used for registration with matchMedia API
*
* NOTE: During breakpoint registration, we want to register the overlaps FIRST
* so the non-overlaps will trigger the MatchMedia:BehaviorSubject last!
* And the largest, non-overlap, matching breakpoint should be the lastReplay value
*/
get: /**
* Accessor to sorted list used for registration with matchMedia API
*
* NOTE: During breakpoint registration, we want to register the overlaps FIRST
* so the non-overlaps will trigger the MatchMedia:BehaviorSubject last!
* And the largest, non-overlap, matching breakpoint should be the lastReplay value
* @return {?}
*/
function () {
var /** @type {?} */ overlaps = this._registry.filter(function (it) { return it.overlapping === true; });
var /** @type {?} */ nonOverlaps = this._registry.filter(function (it) { return it.overlapping !== true; });
return overlaps.concat(nonOverlaps);
},
enumerable: true,
configurable: true
});
/**
* Search breakpoints by alias (e.g. gt-xs)
*/
/**
* Search breakpoints by alias (e.g. gt-xs)
* @param {?} alias
* @return {?}
*/
BreakPointRegistry.prototype.findByAlias = /**
* Search breakpoints by alias (e.g. gt-xs)
* @param {?} alias
* @return {?}
*/
function (alias) {
return this._registry.find(function (bp) { return bp.alias == alias; }) || null;
};
/**
* @param {?} query
* @return {?}
*/
BreakPointRegistry.prototype.findByQuery = /**
* @param {?} query
* @return {?}
*/
function (query) {
return this._registry.find(function (bp) { return bp.mediaQuery == query; }) || null;
};
Object.defineProperty(BreakPointRegistry.prototype, "overlappings", {
/**
* Get all the breakpoints whose ranges could overlapping `normal` ranges;
* e.g. gt-sm overlaps md, lg, and xl
*/
get: /**
* Get all the breakpoints whose ranges could overlapping `normal` ranges;
* e.g. gt-sm overlaps md, lg, and xl
* @return {?}
*/
function () {
return this._registry.filter(function (it) { return it.overlapping == true; });
},
enumerable: true,
configurable: true
});
Object.defineProperty(BreakPointRegistry.prototype, "aliases", {
/**
* Get list of all registered (non-empty) breakpoint aliases
*/
get: /**
* Get list of all registered (non-empty) breakpoint aliases
* @return {?}
*/
function () {
return this._registry.map(function (it) { return it.alias; });
},
enumerable: true,
configurable: true
});
Object.defineProperty(BreakPointRegistry.prototype, "suffixes", {
/**
* Aliases are mapped to properties using suffixes
* e.g. 'gt-sm' for property 'layout' uses suffix 'GtSm'
* for property layoutGtSM.
*/
get: /**
* Aliases are mapped to properties using suffixes
* e.g. 'gt-sm' for property 'layout' uses suffix 'GtSm'
* for property layoutGtSM.
* @return {?}
*/
function () {
return this._registry.map(function (it) { return !!it.suffix ? it.suffix : ''; });
},
enumerable: true,
configurable: true
});
BreakPointRegistry.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
BreakPointRegistry.ctorParameters = function () { return [
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [BREAKPOINTS,] },] },
]; };
return BreakPointRegistry;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Class instances emitted [to observers] for each mql notification
*/
var /**
* Class instances emitted [to observers] for each mql notification
*/
MediaChange = /** @class */ (function () {
function MediaChange(matches, mediaQuery, mqAlias, suffix // e.g. GtSM, Md, GtLg
) {
if (matches === void 0) { matches = false; }
if (mediaQuery === void 0) { mediaQuery = 'all'; }
if (mqAlias === void 0) { mqAlias = ''; }
if (suffix === void 0) { suffix = ''; }
this.matches = matches;
this.mediaQuery = mediaQuery;
this.mqAlias = mqAlias;
this.suffix = suffix;
}
/**
* @return {?}
*/
MediaChange.prototype.clone = /**
* @return {?}
*/
function () {
return new MediaChange(this.matches, this.mediaQuery, this.mqAlias, this.suffix);
};
return MediaChange;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* MediaMonitor configures listeners to mediaQuery changes and publishes an Observable facade to
* convert mediaQuery change callbacks to subscriber notifications. These notifications will be
* performed within the ng Zone to trigger change detections and component updates.
*
* NOTE: both mediaQuery activations and de-activations are announced in notifications
*/
var MatchMedia = /** @class */ (function () {
function MatchMedia(_zone, _platformId, _document) {
this._zone = _zone;
this._platformId = _platformId;
this._document = _document;
this._registry = new Map();
this._source = new rxjs_BehaviorSubject__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](new MediaChange(true));
this._observable$ = this._source.asObservable();
}
/**
* For the specified mediaQuery?
*/
/**
* For the specified mediaQuery?
* @param {?} mediaQuery
* @return {?}
*/
MatchMedia.prototype.isActive = /**
* For the specified mediaQuery?
* @param {?} mediaQuery
* @return {?}
*/
function (mediaQuery) {
var /** @type {?} */ mql = this._registry.get(mediaQuery);
return !!mql ? mql.matches : false;
};
/**
* External observers can watch for all (or a specific) mql changes.
* Typically used by the MediaQueryAdaptor; optionally available to components
* who wish to use the MediaMonitor as mediaMonitor$ observable service.
*
* NOTE: if a mediaQuery is not specified, then ALL mediaQuery activations will
* be announced.
*/
/**
* External observers can watch for all (or a specific) mql changes.
* Typically used by the MediaQueryAdaptor; optionally available to components
* who wish to use the MediaMonitor as mediaMonitor$ observable service.
*
* NOTE: if a mediaQuery is not specified, then ALL mediaQuery activations will
* be announced.
* @param {?=} mediaQuery
* @return {?}
*/
MatchMedia.prototype.observe = /**
* External observers can watch for all (or a specific) mql changes.
* Typically used by the MediaQueryAdaptor; optionally available to components
* who wish to use the MediaMonitor as mediaMonitor$ observable service.
*
* NOTE: if a mediaQuery is not specified, then ALL mediaQuery activations will
* be announced.
* @param {?=} mediaQuery
* @return {?}
*/
function (mediaQuery) {
if (mediaQuery) {
this.registerQuery(mediaQuery);
}
return this._observable$.pipe(Object(rxjs_operators_filter__WEBPACK_IMPORTED_MODULE_3__["filter"])(function (change) {
return mediaQuery ? (change.mediaQuery === mediaQuery) : true;
}));
};
/**
* Based on the BreakPointRegistry provider, register internal listeners for each unique
* mediaQuery. Each listener emits specific MediaChange data to observers
*/
/**
* Based on the BreakPointRegistry provider, register internal listeners for each unique
* mediaQuery. Each listener emits specific MediaChange data to observers
* @param {?} mediaQuery
* @return {?}
*/
MatchMedia.prototype.registerQuery = /**
* Based on the BreakPointRegistry provider, register internal listeners for each unique
* mediaQuery. Each listener emits specific MediaChange data to observers
* @param {?} mediaQuery
* @return {?}
*/
function (mediaQuery) {
var _this = this;
var /** @type {?} */ list = normalizeQuery(mediaQuery);
if (list.length > 0) {
this._prepareQueryCSS(list, this._document);
list.forEach(function (query) {
var /** @type {?} */ mql = _this._registry.get(query);
var /** @type {?} */ onMQLEvent = function (e) {
_this._zone.run(function () {
var /** @type {?} */ change = new MediaChange(e.matches, query);
_this._source.next(change);
});
};
if (!mql) {
mql = _this._buildMQL(query);
mql.addListener(onMQLEvent);
_this._registry.set(query, mql);
}
if (mql.matches) {
onMQLEvent(mql); // Announce activate range for initial subscribers
}
});
}
};
/**
* Call window.matchMedia() to build a MediaQueryList; which
* supports 0..n listeners for activation/deactivation
*/
/**
* Call window.matchMedia() to build a MediaQueryList; which
* supports 0..n listeners for activation/deactivation
* @param {?} query
* @return {?}
*/
MatchMedia.prototype._buildMQL = /**
* Call window.matchMedia() to build a MediaQueryList; which
* supports 0..n listeners for activation/deactivation
* @param {?} query
* @return {?}
*/
function (query) {
var /** @type {?} */ canListen = Object(_angular_common__WEBPACK_IMPORTED_MODULE_1__["isPlatformBrowser"])(this._platformId) &&
!!(/** @type {?} */ (window)).matchMedia('all').addListener;
return canListen ? (/** @type {?} */ (window)).matchMedia(query) : /** @type {?} */ ({
matches: query === 'all' || query === '',
media: query,
addListener: function () {
},
removeListener: function () {
}
});
};
/**
* For Webkit engines that only trigger the MediaQueryList Listener
* when there is at least one CSS selector for the respective media query.
*
* @param query string The mediaQuery used to create a faux CSS selector
*
*/
/**
* For Webkit engines that only trigger the MediaQueryList Listener
* when there is at least one CSS selector for the respective media query.
*
* @param {?} mediaQueries
* @param {?} _document
* @return {?}
*/
MatchMedia.prototype._prepareQueryCSS = /**
* For Webkit engines that only trigger the MediaQueryList Listener
* when there is at least one CSS selector for the respective media query.
*
* @param {?} mediaQueries
* @param {?} _document
* @return {?}
*/
function (mediaQueries, _document) {
var /** @type {?} */ list = mediaQueries.filter(function (it) { return !ALL_STYLES[it]; });
if (list.length > 0) {
var /** @type {?} */ query = list.join(', ');
try {
var /** @type {?} */ styleEl_1 = _document.createElement('style');
styleEl_1.setAttribute('type', 'text/css');
if (!styleEl_1['styleSheet']) {
var /** @type {?} */ cssText = "\n/*\n @angular/flex-layout - workaround for possible browser quirk with mediaQuery listeners\n see http://bit.ly/2sd4HMP\n*/\n@media " + query + " {.fx-query-test{ }}\n";
styleEl_1.appendChild(_document.createTextNode(cssText));
}
_document.head.appendChild(styleEl_1);
// Store in private global registry
list.forEach(function (mq) { return ALL_STYLES[mq] = styleEl_1; });
}
catch (/** @type {?} */ e) {
console.error(e);
}
}
};
MatchMedia.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
MatchMedia.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: Object, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"],] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_1__["DOCUMENT"],] },] },
]; };
return MatchMedia;
}());
/**
* Private global registry for all dynamically-created, injected style tags
* @see prepare(query)
*/
var /** @type {?} */ ALL_STYLES = {};
/**
* Always convert to unique list of queries; for iteration in ::registerQuery()
* @param {?} mediaQuery
* @return {?}
*/
function normalizeQuery(mediaQuery) {
return (typeof mediaQuery === 'undefined') ? [] :
(typeof mediaQuery === 'string') ? [mediaQuery] : unique(/** @type {?} */ (mediaQuery));
}
/**
* Filter duplicate mediaQueries in the list
* @param {?} list
* @return {?}
*/
function unique(list) {
var /** @type {?} */ seen = {};
return list.filter(function (item) {
return seen.hasOwnProperty(item) ? false : (seen[item] = true);
});
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Extends an object with the *enumerable* and *own* properties of one or more source objects,
* similar to Object.assign.
*
* @param {?} dest The object which will have properties copied to it.
* @param {...?} sources The source objects from which properties will be copied.
* @return {?}
*/
function extendObject(dest) {
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
if (dest == null) {
throw TypeError('Cannot convert undefined or null to object');
}
for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) {
var source = sources_1[_a];
if (source != null) {
for (var /** @type {?} */ key in source) {
if (source.hasOwnProperty(key)) {
dest[key] = source[key];
}
}
}
}
return dest;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* For the specified MediaChange, make sure it contains the breakpoint alias
* and suffix (if available).
* @param {?} dest
* @param {?} source
* @return {?}
*/
function mergeAlias(dest, source) {
return extendObject(dest, source ? {
mqAlias: source.alias,
suffix: source.suffix
} : {});
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* MediaMonitor uses the MatchMedia service to observe mediaQuery changes (both activations and
* deactivations). These changes are are published as MediaChange notifications.
*
* Note: all notifications will be performed within the
* ng Zone to trigger change detections and component updates.
*
* It is the MediaMonitor that:
* - auto registers all known breakpoints
* - injects alias information into each raw MediaChange event
* - provides accessor to the currently active BreakPoint
* - publish list of overlapping BreakPoint(s); used by ResponsiveActivation
*/
var MediaMonitor = /** @class */ (function () {
function MediaMonitor(_breakpoints, _matchMedia) {
this._breakpoints = _breakpoints;
this._matchMedia = _matchMedia;
this._registerBreakpoints();
}
Object.defineProperty(MediaMonitor.prototype, "breakpoints", {
/**
* Read-only accessor to the list of breakpoints configured in the BreakPointRegistry provider
*/
get: /**
* Read-only accessor to the list of breakpoints configured in the BreakPointRegistry provider
* @return {?}
*/
function () {
return this._breakpoints.items.slice();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MediaMonitor.prototype, "activeOverlaps", {
get: /**
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ items = this._breakpoints.overlappings.reverse();
return items.filter(function (bp) {
return _this._matchMedia.isActive(bp.mediaQuery);
});
},
enumerable: true,
configurable: true
});
Object.defineProperty(MediaMonitor.prototype, "active", {
get: /**
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ found = null, /** @type {?} */ items = this.breakpoints.reverse();
items.forEach(function (bp) {
if (bp.alias !== '') {
if (!found && _this._matchMedia.isActive(bp.mediaQuery)) {
found = bp;
}
}
});
var /** @type {?} */ first = this.breakpoints[0];
return found || (this._matchMedia.isActive(first.mediaQuery) ? first : null);
},
enumerable: true,
configurable: true
});
/**
* For the specified mediaQuery alias, is the mediaQuery range active?
*/
/**
* For the specified mediaQuery alias, is the mediaQuery range active?
* @param {?} alias
* @return {?}
*/
MediaMonitor.prototype.isActive = /**
* For the specified mediaQuery alias, is the mediaQuery range active?
* @param {?} alias
* @return {?}
*/
function (alias) {
var /** @type {?} */ bp = this._breakpoints.findByAlias(alias) || this._breakpoints.findByQuery(alias);
return this._matchMedia.isActive(bp ? bp.mediaQuery : alias);
};
/**
* External observers can watch for all (or a specific) mql changes.
* If specific breakpoint is observed, only return *activated* events
* otherwise return all events for BOTH activated + deactivated changes.
*/
/**
* External observers can watch for all (or a specific) mql changes.
* If specific breakpoint is observed, only return *activated* events
* otherwise return all events for BOTH activated + deactivated changes.
* @param {?=} alias
* @return {?}
*/
MediaMonitor.prototype.observe = /**
* External observers can watch for all (or a specific) mql changes.
* If specific breakpoint is observed, only return *activated* events
* otherwise return all events for BOTH activated + deactivated changes.
* @param {?=} alias
* @return {?}
*/
function (alias) {
var /** @type {?} */ bp = this._breakpoints.findByAlias(alias || '') ||
this._breakpoints.findByQuery(alias || '');
var /** @type {?} */ hasAlias = function (change) { return (bp ? change.mqAlias !== '' : true); };
// Note: the raw MediaChange events [from MatchMedia] do not contain important alias information
var /** @type {?} */ media$ = this._matchMedia.observe(bp ? bp.mediaQuery : alias);
return media$.pipe(Object(rxjs_operators_map__WEBPACK_IMPORTED_MODULE_4__["map"])(function (change) { return mergeAlias(change, bp); }), Object(rxjs_operators_filter__WEBPACK_IMPORTED_MODULE_3__["filter"])(hasAlias));
};
/**
* Immediate calls to matchMedia() to establish listeners
* and prepare for immediate subscription notifications
* @return {?}
*/
MediaMonitor.prototype._registerBreakpoints = /**
* Immediate calls to matchMedia() to establish listeners
* and prepare for immediate subscription notifications
* @return {?}
*/
function () {
var /** @type {?} */ queries = this._breakpoints.sortedItems.map(function (bp) { return bp.mediaQuery; });
this._matchMedia.registerQuery(queries);
};
MediaMonitor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
MediaMonitor.ctorParameters = function () { return [
{ type: BreakPointRegistry, },
{ type: MatchMedia, },
]; };
return MediaMonitor;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Ensure a single global service provider
* @param {?} parentRegistry
* @param {?} breakpoints
* @return {?}
*/
function BREAKPOINT_REGISTRY_PROVIDER_FACTORY(parentRegistry, breakpoints) {
return parentRegistry || new BreakPointRegistry(breakpoints);
}
/**
* Export provider that uses a global service factory (above)
*/
var /** @type {?} */ BREAKPOINT_REGISTRY_PROVIDER = {
provide: BreakPointRegistry,
deps: [
[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"](), BreakPointRegistry],
/** @type {?} */ (BREAKPOINTS),
],
useFactory: BREAKPOINT_REGISTRY_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Base class for MediaService and pseudo-token for
* @abstract
*/
var /**
* Base class for MediaService and pseudo-token for
* @abstract
*/
ObservableMedia = /** @class */ (function () {
function ObservableMedia() {
}
return ObservableMedia;
}());
/**
* Class internalizes a MatchMedia service and exposes an Subscribable and Observable interface.
* This an Observable with that exposes a feature to subscribe to mediaQuery
* changes and a validator method (`isActive(<alias>)`) to test if a mediaQuery (or alias) is
* currently active.
*
* !! Only mediaChange activations (not de-activations) are announced by the ObservableMedia
*
* This class uses the BreakPoint Registry to inject alias information into the raw MediaChange
* notification. For custom mediaQuery notifications, alias information will not be injected and
* those fields will be ''.
*
* !! This is not an actual Observable. It is a wrapper of an Observable used to publish additional
* methods like `isActive(<alias>). To access the Observable and use RxJS operators, use
* `.asObservable()` with syntax like media.asObservable().map(....).
*
* \@usage
*
* // RxJS
* import {filter} from 'rxjs/operators/filter';
* import { ObservableMedia } from '\@angular/flex-layout';
*
* \@Component({ ... })
* export class AppComponent {
* status : string = '';
*
* constructor( media:ObservableMedia ) {
* let onChange = (change:MediaChange) => {
* this.status = change ? `'${change.mqAlias}' = (${change.mediaQuery})` : '';
* };
*
* // Subscribe directly or access observable to use filter/map operators
* // e.g.
* // media.subscribe(onChange);
*
* media.asObservable()
* .pipe(
* filter((change:MediaChange) => true) // silly noop filter
* ).subscribe(onChange);
* }
* }
*/
var MediaService = /** @class */ (function () {
function MediaService(breakpoints, mediaWatcher) {
this.breakpoints = breakpoints;
this.mediaWatcher = mediaWatcher;
/**
* Should we announce gt-<xxx> breakpoint activations ?
*/
this.filterOverlaps = true;
this._registerBreakPoints();
this.observable$ = this._buildObservable();
}
/**
* Test if specified query/alias is active.
*/
/**
* Test if specified query/alias is active.
* @param {?} alias
* @return {?}
*/
MediaService.prototype.isActive = /**
* Test if specified query/alias is active.
* @param {?} alias
* @return {?}
*/
function (alias) {
var /** @type {?} */ query = this._toMediaQuery(alias);
return this.mediaWatcher.isActive(query);
};
/**
* Proxy to the Observable subscribe method
*/
/**
* Proxy to the Observable subscribe method
* @param {?=} next
* @param {?=} error
* @param {?=} complete
* @return {?}
*/
MediaService.prototype.subscribe = /**
* Proxy to the Observable subscribe method
* @param {?=} next
* @param {?=} error
* @param {?=} complete
* @return {?}
*/
function (next, error, complete) {
return this.observable$.subscribe(next, error, complete);
};
/**
* Access to observable for use with operators like
* .filter(), .map(), etc.
*/
/**
* Access to observable for use with operators like
* .filter(), .map(), etc.
* @return {?}
*/
MediaService.prototype.asObservable = /**
* Access to observable for use with operators like
* .filter(), .map(), etc.
* @return {?}
*/
function () {
return this.observable$;
};
/**
* Register all the mediaQueries registered in the BreakPointRegistry
* This is needed so subscribers can be auto-notified of all standard, registered
* mediaQuery activations
* @return {?}
*/
MediaService.prototype._registerBreakPoints = /**
* Register all the mediaQueries registered in the BreakPointRegistry
* This is needed so subscribers can be auto-notified of all standard, registered
* mediaQuery activations
* @return {?}
*/
function () {
var /** @type {?} */ queries = this.breakpoints.sortedItems.map(function (bp) { return bp.mediaQuery; });
this.mediaWatcher.registerQuery(queries);
};
/**
* Prepare internal observable
*
* NOTE: the raw MediaChange events [from MatchMedia] do not
* contain important alias information; as such this info
* must be injected into the MediaChange
* @return {?}
*/
MediaService.prototype._buildObservable = /**
* Prepare internal observable
*
* NOTE: the raw MediaChange events [from MatchMedia] do not
* contain important alias information; as such this info
* must be injected into the MediaChange
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ self = this;
var /** @type {?} */ media$ = this.mediaWatcher.observe();
var /** @type {?} */ activationsOnly = function (change) {
return change.matches === true;
};
var /** @type {?} */ addAliasInformation = function (change) {
return mergeAlias(change, _this._findByQuery(change.mediaQuery));
};
var /** @type {?} */ excludeOverlaps = function (change) {
var /** @type {?} */ bp = _this.breakpoints.findByQuery(change.mediaQuery);
return !bp ? true : !(self.filterOverlaps && bp.overlapping);
};
/**
* Only pass/announce activations (not de-activations)
* Inject associated (if any) alias information into the MediaChange event
* Exclude mediaQuery activations for overlapping mQs. List bounded mQ ranges only
*/
return media$.pipe(Object(rxjs_operators_filter__WEBPACK_IMPORTED_MODULE_3__["filter"])(activationsOnly), Object(rxjs_operators_filter__WEBPACK_IMPORTED_MODULE_3__["filter"])(excludeOverlaps), Object(rxjs_operators_map__WEBPACK_IMPORTED_MODULE_4__["map"])(addAliasInformation));
};
/**
* Breakpoint locator by alias
* @param {?} alias
* @return {?}
*/
MediaService.prototype._findByAlias = /**
* Breakpoint locator by alias
* @param {?} alias
* @return {?}
*/
function (alias) {
return this.breakpoints.findByAlias(alias);
};
/**
* Breakpoint locator by mediaQuery
* @param {?} query
* @return {?}
*/
MediaService.prototype._findByQuery = /**
* Breakpoint locator by mediaQuery
* @param {?} query
* @return {?}
*/
function (query) {
return this.breakpoints.findByQuery(query);
};
/**
* Find associated breakpoint (if any)
* @param {?} query
* @return {?}
*/
MediaService.prototype._toMediaQuery = /**
* Find associated breakpoint (if any)
* @param {?} query
* @return {?}
*/
function (query) {
var /** @type {?} */ bp = this._findByAlias(query) || this._findByQuery(query);
return bp ? bp.mediaQuery : query;
};
MediaService.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
MediaService.ctorParameters = function () { return [
{ type: BreakPointRegistry, },
{ type: MatchMedia, },
]; };
return MediaService;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Ensure a single global ObservableMedia service provider
* @param {?} parentService
* @param {?} matchMedia
* @param {?} breakpoints
* @return {?}
*/
function OBSERVABLE_MEDIA_PROVIDER_FACTORY(parentService, matchMedia, breakpoints) {
return parentService || new MediaService(breakpoints, matchMedia);
}
/**
* Provider to return global service for observable service for all MediaQuery activations
*/
var /** @type {?} */ OBSERVABLE_MEDIA_PROVIDER = {
// tslint:disable-line:variable-name
provide: ObservableMedia,
deps: [
[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"](), ObservableMedia],
MatchMedia,
BreakPointRegistry
],
useFactory: OBSERVABLE_MEDIA_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ RESPONSIVE_ALIASES = [
'xs', 'gt-xs', 'sm', 'gt-sm', 'md', 'gt-md', 'lg', 'gt-lg', 'xl'
];
var /** @type {?} */ DEFAULT_BREAKPOINTS = [
{
alias: 'xs',
mediaQuery: '(min-width: 0px) and (max-width: 599px)'
},
{
alias: 'gt-xs',
overlapping: true,
mediaQuery: '(min-width: 600px)'
},
{
alias: 'lt-sm',
overlapping: true,
mediaQuery: '(max-width: 599px)'
},
{
alias: 'sm',
mediaQuery: '(min-width: 600px) and (max-width: 959px)'
},
{
alias: 'gt-sm',
overlapping: true,
mediaQuery: '(min-width: 960px)'
},
{
alias: 'lt-md',
overlapping: true,
mediaQuery: '(max-width: 959px)'
},
{
alias: 'md',
mediaQuery: '(min-width: 960px) and (max-width: 1279px)'
},
{
alias: 'gt-md',
overlapping: true,
mediaQuery: '(min-width: 1280px)'
},
{
alias: 'lt-lg',
overlapping: true,
mediaQuery: '(max-width: 1279px)'
},
{
alias: 'lg',
mediaQuery: '(min-width: 1280px) and (max-width: 1919px)'
},
{
alias: 'gt-lg',
overlapping: true,
mediaQuery: '(min-width: 1920px)'
},
{
alias: 'lt-xl',
overlapping: true,
mediaQuery: '(max-width: 1920px)'
},
{
alias: 'xl',
mediaQuery: '(min-width: 1920px) and (max-width: 5000px)'
}
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/* tslint:disable */
var /** @type {?} */ HANDSET_PORTRAIT = '(orientations: portrait) and (max-width: 599px)';
var /** @type {?} */ HANDSET_LANDSCAPE = '(orientations: landscape) and (max-width: 959px)';
var /** @type {?} */ TABLET_LANDSCAPE = '(orientations: landscape) and (min-width: 960px) and (max-width: 1279px)';
var /** @type {?} */ TABLET_PORTRAIT = '(orientations: portrait) and (min-width: 600px) and (max-width: 839px)';
var /** @type {?} */ WEB_PORTRAIT = '(orientations: portrait) and (min-width: 840px)';
var /** @type {?} */ WEB_LANDSCAPE = '(orientations: landscape) and (min-width: 1280px)';
var /** @type {?} */ ScreenTypes = {
'HANDSET': HANDSET_PORTRAIT + ", " + HANDSET_LANDSCAPE,
'TABLET': TABLET_PORTRAIT + " , " + TABLET_LANDSCAPE,
'WEB': WEB_PORTRAIT + ", " + WEB_LANDSCAPE + " ",
'HANDSET_PORTRAIT': "" + HANDSET_PORTRAIT,
'TABLET_PORTRAIT': TABLET_PORTRAIT + " ",
'WEB_PORTRAIT': "" + WEB_PORTRAIT,
'HANDSET_LANDSCAPE': HANDSET_LANDSCAPE + "]",
'TABLET_LANDSCAPE': "" + TABLET_LANDSCAPE,
'WEB_LANDSCAPE': "" + WEB_LANDSCAPE
};
/**
* Extended Breakpoints for handset/tablets with landscape or portrait orientations
*/
var /** @type {?} */ ORIENTATION_BREAKPOINTS = [
{ 'alias': 'handset', 'mediaQuery': ScreenTypes.HANDSET },
{ 'alias': 'handset.landscape', 'mediaQuery': ScreenTypes.HANDSET_LANDSCAPE },
{ 'alias': 'handset.portrait', 'mediaQuery': ScreenTypes.HANDSET_PORTRAIT },
{ 'alias': 'tablet', 'mediaQuery': ScreenTypes.TABLET },
{ 'alias': 'tablet.landscape', 'mediaQuery': ScreenTypes.TABLET },
{ 'alias': 'tablet.portrait', 'mediaQuery': ScreenTypes.TABLET_PORTRAIT },
{ 'alias': 'web', 'mediaQuery': ScreenTypes.WEB, overlapping: true },
{ 'alias': 'web.landscape', 'mediaQuery': ScreenTypes.WEB_LANDSCAPE, overlapping: true },
{ 'alias': 'web.portrait', 'mediaQuery': ScreenTypes.WEB_PORTRAIT, overlapping: true }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ ALIAS_DELIMITERS = /(\.|-|_)/g;
/**
* @param {?} part
* @return {?}
*/
function firstUpperCase(part) {
var /** @type {?} */ first = part.length > 0 ? part.charAt(0) : '';
var /** @type {?} */ remainder = (part.length > 1) ? part.slice(1) : '';
return first.toUpperCase() + remainder;
}
/**
* Converts snake-case to SnakeCase.
* @param {?} name Text to UpperCamelCase
* @return {?}
*/
function camelCase(name) {
return name
.replace(ALIAS_DELIMITERS, '|')
.split('|')
.map(firstUpperCase)
.join('');
}
/**
* For each breakpoint, ensure that a Suffix is defined;
* fallback to UpperCamelCase the unique Alias value
* @param {?} list
* @return {?}
*/
function validateSuffixes(list) {
list.forEach(function (bp) {
if (!bp.suffix) {
bp.suffix = camelCase(bp.alias); // create Suffix value based on alias
bp.overlapping = !!bp.overlapping; // ensure default value
}
});
return list;
}
/**
* Merge a custom breakpoint list with the default list based on unique alias values
* - Items are added if the alias is not in the default list
* - Items are merged with the custom override if the alias exists in the default list
* @param {?} defaults
* @param {?=} custom
* @return {?}
*/
function mergeByAlias(defaults, custom) {
if (custom === void 0) { custom = []; }
var /** @type {?} */ dict = {};
defaults.forEach(function (bp) {
dict[bp.alias] = bp;
});
// Merge custom breakpoints
custom.forEach(function (bp) {
if (dict[bp.alias]) {
extendObject(dict[bp.alias], bp);
}
else {
dict[bp.alias] = bp;
}
});
return validateSuffixes(Object.keys(dict).map(function (k) { return dict[k]; }));
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ DISABLE_DEFAULT_BREAKPOINTS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('Flex Layout token, disable the default breakpoints');
var /** @type {?} */ ADD_ORIENTATION_BREAKPOINTS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('Flex Layout token, add the orientation breakpoints');
var /** @type {?} */ BREAKPOINT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('Flex Layout token, collect all breakpoints into one provider');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Add new custom items to the default list or override existing default with custom overrides
* @deprecated
* \@deletion-target v6.0.0-beta.15
* @param {?=} _custom
* @param {?=} options
* @return {?}
*/
function buildMergedBreakPoints(_custom, options) {
options = extendObject({}, {
defaults: true,
// exclude pre-configured, internal default breakpoints
orientation: false // exclude pre-configured, internal orientations breakpoints
}, options || {});
return function () {
// Order so the defaults are loaded last; so ObservableMedia will report these last!
var /** @type {?} */ defaults = (options && options.orientations) ?
ORIENTATION_BREAKPOINTS.concat(DEFAULT_BREAKPOINTS) : DEFAULT_BREAKPOINTS;
return (options && options.defaults) ?
mergeByAlias(defaults, _custom || []) : mergeByAlias(_custom || []);
};
}
/**
* Ensure that only a single global BreakPoint list is instantiated...
* \@deprecated
* \@deletion-target v6.0.0-beta.15
* @return {?}
*/
function DEFAULT_BREAKPOINTS_PROVIDER_FACTORY() {
return validateSuffixes(DEFAULT_BREAKPOINTS);
}
/**
* Default Provider that does not support external customization nor provide
* the extra extended breakpoints: "handset", "tablet", and "web"
*
* NOTE: !! breakpoints are considered to have unique 'alias' properties,
* custom breakpoints matching existing breakpoints will override the properties
* of the existing (and not be added as an extra breakpoint entry).
* [xs, gt-xs, sm, gt-sm, md, gt-md, lg, gt-lg, xl]
* @deprecated
* \@deletion-target v6.0.0-beta.15
*/
var /** @type {?} */ DEFAULT_BREAKPOINTS_PROVIDER = {
provide: BREAKPOINTS,
useFactory: DEFAULT_BREAKPOINTS_PROVIDER_FACTORY
};
/**
* Factory that combines the configured breakpoints into one array and then merges
* them using a utility function
* @param {?} parentBreakpoints
* @param {?} breakpoints
* @param {?} disableDefaults
* @param {?} addOrientation
* @return {?}
*/
function BREAKPOINTS_PROVIDER_FACTORY(parentBreakpoints, breakpoints, disableDefaults, addOrientation) {
var /** @type {?} */ bpFlattenArray = [].concat.apply([], (breakpoints || [])
.map(function (v) { return Array.isArray(v) ? v : [v]; }));
var /** @type {?} */ builtIns = DEFAULT_BREAKPOINTS.concat(addOrientation ? ORIENTATION_BREAKPOINTS : []);
return parentBreakpoints || disableDefaults ?
mergeByAlias(bpFlattenArray) : mergeByAlias(builtIns, bpFlattenArray);
}
/**
* Provider that combines the provided extra breakpoints with the default and
* orientation breakpoints based on configuration
*/
var /** @type {?} */ BREAKPOINTS_PROVIDER = {
provide: BREAKPOINTS,
useFactory: BREAKPOINTS_PROVIDER_FACTORY,
deps: [
[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"](), BREAKPOINTS],
[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), BREAKPOINT],
[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), DISABLE_DEFAULT_BREAKPOINTS],
[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), ADD_ORIENTATION_BREAKPOINTS],
]
};
/**
* Use with FlexLayoutModule.CUSTOM_BREAKPOINTS_PROVIDER_FACTORY!
* @deprecated
* \@deletion-target v6.0.0-beta.15
* @param {?=} custom
* @param {?=} options
* @return {?}
*/
function CUSTOM_BREAKPOINTS_PROVIDER_FACTORY(custom, options) {
return {
provide: /** @type {?} */ (BREAKPOINTS),
useFactory: buildMergedBreakPoints(custom, options)
};
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Ensure a single global service provider
* @param {?} parentMedia
* @param {?} ngZone
* @param {?} platformId
* @param {?} _document
* @return {?}
*/
function MATCH_MEDIA_PROVIDER_FACTORY(parentMedia, ngZone, platformId, _document) {
return parentMedia || new MatchMedia(ngZone, platformId, _document);
}
/**
* Export provider that uses a global service factory (above)
*/
var /** @type {?} */ MATCH_MEDIA_PROVIDER = {
provide: MatchMedia,
deps: [
[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"](), MatchMedia],
_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"],
/** @type {?} */ (_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"]),
/** @type {?} */ (_angular_common__WEBPACK_IMPORTED_MODULE_1__["DOCUMENT"]),
],
useFactory: MATCH_MEDIA_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Applies CSS prefixes to appropriate style keys.
*
* Note: `-ms-`, `-moz` and `-webkit-box` are no longer supported. e.g.
* {
* display: -webkit-flex; NEW - Safari 6.1+. iOS 7.1+, BB10
* display: flex; NEW, Spec - Firefox, Chrome, Opera
* // display: -webkit-box; OLD - iOS 6-, Safari 3.1-6, BB7
* // display: -ms-flexbox; TWEENER - IE 10
* // display: -moz-flexbox; OLD - Firefox
* }
* @param {?} target
* @return {?}
*/
function applyCssPrefixes(target) {
for (var /** @type {?} */ key in target) {
var /** @type {?} */ value = target[key] || '';
switch (key) {
case 'display':
if (value === 'flex') {
target['display'] = [
'-webkit-flex',
'flex'
];
}
else if (value === 'inline-flex') {
target['display'] = [
'-webkit-inline-flex',
'inline-flex'
];
}
else {
target['display'] = value;
}
break;
case 'align-items':
case 'align-self':
case 'align-content':
case 'flex':
case 'flex-basis':
case 'flex-flow':
case 'flex-grow':
case 'flex-shrink':
case 'flex-wrap':
case 'justify-content':
target['-webkit-' + key] = value;
break;
case 'flex-direction':
value = value || 'row';
target['-webkit-flex-direction'] = value;
target['flex-direction'] = value;
break;
case 'order':
target['order'] = target['-webkit-' + key] = isNaN(value) ? '0' : value;
break;
}
}
return target;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Utility to emulate a CSS stylesheet
*
* This utility class stores all of the styles for a given HTML element
* as a readonly `stylesheet` map.
*/
var StylesheetMap = /** @class */ (function () {
function StylesheetMap() {
this.stylesheet = new Map();
}
/**
* Add an individual style to an HTML element
*/
/**
* Add an individual style to an HTML element
* @param {?} element
* @param {?} style
* @param {?} value
* @return {?}
*/
StylesheetMap.prototype.addStyleToElement = /**
* Add an individual style to an HTML element
* @param {?} element
* @param {?} style
* @param {?} value
* @return {?}
*/
function (element, style, value) {
var /** @type {?} */ stylesheet = this.stylesheet.get(element);
if (stylesheet) {
stylesheet.set(style, value);
}
else {
this.stylesheet.set(element, new Map([[style, value]]));
}
};
/**
* Clear the virtual stylesheet
*/
/**
* Clear the virtual stylesheet
* @return {?}
*/
StylesheetMap.prototype.clearStyles = /**
* Clear the virtual stylesheet
* @return {?}
*/
function () {
this.stylesheet.clear();
};
/**
* Retrieve a given style for an HTML element
*/
/**
* Retrieve a given style for an HTML element
* @param {?} el
* @param {?} styleName
* @return {?}
*/
StylesheetMap.prototype.getStyleForElement = /**
* Retrieve a given style for an HTML element
* @param {?} el
* @param {?} styleName
* @return {?}
*/
function (el, styleName) {
var /** @type {?} */ styles = this.stylesheet.get(el);
var /** @type {?} */ value = '';
if (styles) {
var /** @type {?} */ style = styles.get(styleName);
if (typeof style === 'number' || typeof style === 'string') {
value = style + '';
}
}
return value;
};
StylesheetMap.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
StylesheetMap.ctorParameters = function () { return []; };
return StylesheetMap;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Token that is provided to tell whether the FlexLayoutServerModule
* has been included in the bundle
*
* NOTE: This can be manually provided to disable styles when using SSR
*/
var /** @type {?} */ SERVER_TOKEN = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('FlexLayoutServerLoaded');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ DISABLE_VENDOR_PREFIXES = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('Flex Layout token, whether to add vendor prefix styles inline for elements');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var StyleUtils = /** @class */ (function () {
function StyleUtils(_serverStylesheet, _serverModuleLoaded, _platformId, noVendorPrefixes) {
this._serverStylesheet = _serverStylesheet;
this._serverModuleLoaded = _serverModuleLoaded;
this._platformId = _platformId;
this.noVendorPrefixes = noVendorPrefixes;
}
/**
* Applies styles given via string pair or object map to the directive element
*/
/**
* Applies styles given via string pair or object map to the directive element
* @param {?} element
* @param {?} style
* @param {?=} value
* @return {?}
*/
StyleUtils.prototype.applyStyleToElement = /**
* Applies styles given via string pair or object map to the directive element
* @param {?} element
* @param {?} style
* @param {?=} value
* @return {?}
*/
function (element, style, value) {
var /** @type {?} */ styles = {};
if (typeof style === 'string') {
styles[style] = value;
style = styles;
}
styles = this.noVendorPrefixes ? style : applyCssPrefixes(style);
this._applyMultiValueStyleToElement(styles, element);
};
/**
* Applies styles given via string pair or object map to the directive's element
*/
/**
* Applies styles given via string pair or object map to the directive's element
* @param {?} style
* @param {?=} elements
* @return {?}
*/
StyleUtils.prototype.applyStyleToElements = /**
* Applies styles given via string pair or object map to the directive's element
* @param {?} style
* @param {?=} elements
* @return {?}
*/
function (style, elements) {
var _this = this;
if (elements === void 0) { elements = []; }
var /** @type {?} */ styles = this.noVendorPrefixes ? style : applyCssPrefixes(style);
elements.forEach(function (el) {
_this._applyMultiValueStyleToElement(styles, el);
});
};
/**
* Determine the DOM element's Flexbox flow (flex-direction)
*
* Check inline style first then check computed (stylesheet) style
*/
/**
* Determine the DOM element's Flexbox flow (flex-direction)
*
* Check inline style first then check computed (stylesheet) style
* @param {?} target
* @return {?}
*/
StyleUtils.prototype.getFlowDirection = /**
* Determine the DOM element's Flexbox flow (flex-direction)
*
* Check inline style first then check computed (stylesheet) style
* @param {?} target
* @return {?}
*/
function (target) {
var /** @type {?} */ query = 'flex-direction';
var /** @type {?} */ value = this.lookupStyle(target, query);
if (value === FALLBACK_STYLE) {
value = '';
}
var /** @type {?} */ hasInlineValue = this.lookupInlineStyle(target, query) ||
(Object(_angular_common__WEBPACK_IMPORTED_MODULE_1__["isPlatformServer"])(this._platformId) && this._serverModuleLoaded) ? value : '';
return [value || 'row', hasInlineValue];
};
/**
* Find the DOM element's raw attribute value (if any)
*/
/**
* Find the DOM element's raw attribute value (if any)
* @param {?} element
* @param {?} attribute
* @return {?}
*/
StyleUtils.prototype.lookupAttributeValue = /**
* Find the DOM element's raw attribute value (if any)
* @param {?} element
* @param {?} attribute
* @return {?}
*/
function (element, attribute) {
return element.getAttribute(attribute) || '';
};
/**
* Find the DOM element's inline style value (if any)
*/
/**
* Find the DOM element's inline style value (if any)
* @param {?} element
* @param {?} styleName
* @return {?}
*/
StyleUtils.prototype.lookupInlineStyle = /**
* Find the DOM element's inline style value (if any)
* @param {?} element
* @param {?} styleName
* @return {?}
*/
function (element, styleName) {
return element.style[styleName] || element.style.getPropertyValue(styleName) || '';
};
/**
* Determine the inline or inherited CSS style
* NOTE: platform-server has no implementation for getComputedStyle
*/
/**
* Determine the inline or inherited CSS style
* NOTE: platform-server has no implementation for getComputedStyle
* @param {?} element
* @param {?} styleName
* @param {?=} inlineOnly
* @return {?}
*/
StyleUtils.prototype.lookupStyle = /**
* Determine the inline or inherited CSS style
* NOTE: platform-server has no implementation for getComputedStyle
* @param {?} element
* @param {?} styleName
* @param {?=} inlineOnly
* @return {?}
*/
function (element, styleName, inlineOnly) {
if (inlineOnly === void 0) { inlineOnly = false; }
var /** @type {?} */ value = '';
if (element) {
var /** @type {?} */ immediateValue = value = this.lookupInlineStyle(element, styleName);
if (!immediateValue) {
if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_1__["isPlatformBrowser"])(this._platformId)) {
if (!inlineOnly) {
value = getComputedStyle(element).getPropertyValue(styleName);
}
}
else {
if (this._serverModuleLoaded) {
value = this._serverStylesheet.getStyleForElement(element, styleName);
}
}
}
}
// Note: 'inline' is the default of all elements, unless UA stylesheet overrides;
// in which case getComputedStyle() should determine a valid value.
return value ? value.trim() : FALLBACK_STYLE;
};
/**
* Applies the styles to the element. The styles object map may contain an array of values
* Each value will be added as element style
* Keys are sorted to add prefixed styles (like -webkit-x) first, before the standard ones
* @param {?} styles
* @param {?} element
* @return {?}
*/
StyleUtils.prototype._applyMultiValueStyleToElement = /**
* Applies the styles to the element. The styles object map may contain an array of values
* Each value will be added as element style
* Keys are sorted to add prefixed styles (like -webkit-x) first, before the standard ones
* @param {?} styles
* @param {?} element
* @return {?}
*/
function (styles, element) {
var _this = this;
Object.keys(styles).sort().forEach(function (key) {
var /** @type {?} */ values = Array.isArray(styles[key]) ? styles[key] : [styles[key]];
values.sort();
for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {
var value = values_1[_i];
if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_1__["isPlatformBrowser"])(_this._platformId) || !_this._serverModuleLoaded) {
element.style.setProperty(key, value);
}
else {
_this._serverStylesheet.addStyleToElement(element, key, value);
}
}
});
};
StyleUtils.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
StyleUtils.ctorParameters = function () { return [
{ type: StylesheetMap, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [SERVER_TOKEN,] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"],] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [DISABLE_VENDOR_PREFIXES,] },] },
]; };
return StyleUtils;
}());
var /** @type {?} */ FALLBACK_STYLE = 'block';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Ensure a single global service provider
* @param {?} parentSheet
* @return {?}
*/
function STYLESHEET_MAP_PROVIDER_FACTORY(parentSheet) {
return parentSheet || new StylesheetMap();
}
/**
* Export provider that uses a global service factory (above)
*/
var /** @type {?} */ STYLESHEET_MAP_PROVIDER = {
provide: StylesheetMap,
deps: [
[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"](), StylesheetMap],
],
useFactory: STYLESHEET_MAP_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* *****************************************************************
* Define module for the MediaQuery API
* *****************************************************************
*/
var CoreModule = /** @class */ (function () {
function CoreModule() {
}
CoreModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
providers: [
BREAKPOINTS_PROVIDER,
BREAKPOINT_REGISTRY_PROVIDER,
MATCH_MEDIA_PROVIDER,
MediaMonitor,
OBSERVABLE_MEDIA_PROVIDER,
STYLESHEET_MAP_PROVIDER,
StyleUtils,
BROWSER_PROVIDER,
]
},] },
];
/** @nocollapse */
CoreModule.ctorParameters = function () { return []; };
return CoreModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @deprecated use Core Module instead
* \@deletion-target 5.0.0-beta.15
* *****************************************************************
* Define module for the MediaQuery API
* *****************************************************************
*/
var MediaQueriesModule = /** @class */ (function () {
function MediaQueriesModule() {
}
MediaQueriesModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [CoreModule],
exports: [CoreModule],
},] },
];
/** @nocollapse */
MediaQueriesModule.ctorParameters = function () { return []; };
return MediaQueriesModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ ADD_FLEX_STYLES = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('Flex Layout token, should flex stylings be applied to parents automatically');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ INLINE = 'inline';
var /** @type {?} */ LAYOUT_VALUES = ['row', 'column', 'row-reverse', 'column-reverse'];
/**
* Validate the direction|'direction wrap' value and then update the host's inline flexbox styles
* @param {?} value
* @return {?}
*/
function buildLayoutCSS(value) {
var _a = validateValue(value), direction = _a[0], wrap = _a[1], isInline = _a[2];
return buildCSS(direction, wrap, isInline);
}
/**
* Validate the value to be one of the acceptable value options
* Use default fallback of 'row'
* @param {?} value
* @return {?}
*/
function validateValue(value) {
value = value ? value.toLowerCase() : '';
var _a = value.split(' '), direction = _a[0], wrap = _a[1], inline = _a[2];
// First value must be the `flex-direction`
if (!LAYOUT_VALUES.find(function (x) { return x === direction; })) {
direction = LAYOUT_VALUES[0];
}
if (wrap === INLINE) {
wrap = (inline !== INLINE) ? inline : '';
inline = INLINE;
}
return [direction, validateWrapValue(wrap), !!inline];
}
/**
* Convert layout-wrap='<value>' to expected flex-wrap style
* @param {?} value
* @return {?}
*/
function validateWrapValue(value) {
if (!!value) {
switch (value.toLowerCase()) {
case 'reverse':
case 'wrap-reverse':
case 'reverse-wrap':
value = 'wrap-reverse';
break;
case 'no':
case 'none':
case 'nowrap':
value = 'nowrap';
break;
// All other values fallback to 'wrap'
default:
value = 'wrap';
break;
}
}
return value;
}
/**
* Build the CSS that should be assigned to the element instance
* BUG:
* 1) min-height on a column flex container wont apply to its flex item children in IE 10-11.
* Use height instead if possible; height : <xxx>vh;
*
* This way any padding or border specified on the child elements are
* laid out and drawn inside that element's specified width and height.
* @param {?} direction
* @param {?=} wrap
* @param {?=} inline
* @return {?}
*/
function buildCSS(direction, wrap, inline) {
if (wrap === void 0) { wrap = null; }
if (inline === void 0) { inline = false; }
return {
'display': inline ? 'inline-flex' : 'flex',
'box-sizing': 'border-box',
'flex-direction': direction,
'flex-wrap': !!wrap ? wrap : null
};
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var KeyOptions = /** @class */ (function () {
function KeyOptions(baseKey, defaultValue, inputKeys) {
this.baseKey = baseKey;
this.defaultValue = defaultValue;
this.inputKeys = inputKeys;
}
return KeyOptions;
}());
/**
* ResponsiveActivation acts as a proxy between the MonitorMedia service (which emits mediaQuery
* changes) and the fx API directives. The MQA proxies mediaQuery change events and notifies the
* directive via the specified callback.
*
* - The MQA also determines which directive property should be used to determine the
* current change 'value'... BEFORE the original `onMediaQueryChanges()` method is called.
* - The `ngOnDestroy()` method is also head-hooked to enable auto-unsubscribe from the
* MediaQueryServices.
*
* NOTE: these interceptions enables the logic in the fx API directives to remain terse and clean.
*/
var /**
* ResponsiveActivation acts as a proxy between the MonitorMedia service (which emits mediaQuery
* changes) and the fx API directives. The MQA proxies mediaQuery change events and notifies the
* directive via the specified callback.
*
* - The MQA also determines which directive property should be used to determine the
* current change 'value'... BEFORE the original `onMediaQueryChanges()` method is called.
* - The `ngOnDestroy()` method is also head-hooked to enable auto-unsubscribe from the
* MediaQueryServices.
*
* NOTE: these interceptions enables the logic in the fx API directives to remain terse and clean.
*/
ResponsiveActivation = /** @class */ (function () {
/**
* Constructor
*/
function ResponsiveActivation(_options, _mediaMonitor, _onMediaChanges) {
this._options = _options;
this._mediaMonitor = _mediaMonitor;
this._onMediaChanges = _onMediaChanges;
this._subscribers = [];
this._registryMap = this._buildRegistryMap();
this._subscribers = this._configureChangeObservers();
}
Object.defineProperty(ResponsiveActivation.prototype, "registryFromLargest", {
/**
* Get a readonly sorted list of the breakpoints corresponding to the directive properties
* defined in the HTML markup: the sorting is done from largest to smallest. The order is
* important when several media queries are 'registered' and from which, the browser uses the
* first matching media query.
*/
get: /**
* Get a readonly sorted list of the breakpoints corresponding to the directive properties
* defined in the HTML markup: the sorting is done from largest to smallest. The order is
* important when several media queries are 'registered' and from which, the browser uses the
* first matching media query.
* @return {?}
*/
function () {
return this._registryMap.slice().reverse();
},
enumerable: true,
configurable: true
});
Object.defineProperty(ResponsiveActivation.prototype, "mediaMonitor", {
/**
* Accessor to the DI'ed directive property
* Each directive instance has a reference to the MediaMonitor which is
* used HERE to subscribe to mediaQuery change notifications.
*/
get: /**
* Accessor to the DI'ed directive property
* Each directive instance has a reference to the MediaMonitor which is
* used HERE to subscribe to mediaQuery change notifications.
* @return {?}
*/
function () {
return this._mediaMonitor;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ResponsiveActivation.prototype, "activatedInputKey", {
/**
* Determine which directive @Input() property is currently active (for the viewport size):
* The key must be defined (in use) or fallback to the 'closest' overlapping property key
* that is defined; otherwise the default property key will be used.
* e.g.
* if `<div fxHide fxHide.gt-sm="false">` is used but the current activated mediaQuery alias
* key is `.md` then `.gt-sm` should be used instead
*/
get: /**
* Determine which directive \@Input() property is currently active (for the viewport size):
* The key must be defined (in use) or fallback to the 'closest' overlapping property key
* that is defined; otherwise the default property key will be used.
* e.g.
* if `<div fxHide fxHide.gt-sm="false">` is used but the current activated mediaQuery alias
* key is `.md` then `.gt-sm` should be used instead
* @return {?}
*/
function () {
return this._activatedInputKey || this._options.baseKey;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ResponsiveActivation.prototype, "activatedInput", {
/**
* Get the currently activated @Input value or the fallback default @Input value
*/
get: /**
* Get the currently activated \@Input value or the fallback default \@Input value
* @return {?}
*/
function () {
var /** @type {?} */ key = this.activatedInputKey;
return this.hasKeyValue(key) ? this._lookupKeyValue(key) : this._options.defaultValue;
},
enumerable: true,
configurable: true
});
/**
* Fast validator for presence of attribute on the host element
*/
/**
* Fast validator for presence of attribute on the host element
* @param {?} key
* @return {?}
*/
ResponsiveActivation.prototype.hasKeyValue = /**
* Fast validator for presence of attribute on the host element
* @param {?} key
* @return {?}
*/
function (key) {
var /** @type {?} */ value = this._options.inputKeys[key];
return typeof value !== 'undefined';
};
/**
* Remove interceptors, restore original functions, and forward the onDestroy() call
*/
/**
* Remove interceptors, restore original functions, and forward the onDestroy() call
* @return {?}
*/
ResponsiveActivation.prototype.destroy = /**
* Remove interceptors, restore original functions, and forward the onDestroy() call
* @return {?}
*/
function () {
this._subscribers.forEach(function (link) {
link.unsubscribe();
});
this._subscribers = [];
};
/**
* For each *defined* API property, register a callback to `_onMonitorEvents( )`
* Cache 1..n subscriptions for internal auto-unsubscribes when the the directive destructs
* @return {?}
*/
ResponsiveActivation.prototype._configureChangeObservers = /**
* For each *defined* API property, register a callback to `_onMonitorEvents( )`
* Cache 1..n subscriptions for internal auto-unsubscribes when the the directive destructs
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ subscriptions = [];
this._registryMap.forEach(function (bp) {
if (_this._keyInUse(bp.key)) {
// Inject directive default property key name: to let onMediaChange() calls
// know which property is being triggered...
var /** @type {?} */ buildChanges = function (change) {
change = change.clone();
change.property = _this._options.baseKey;
return change;
};
subscriptions.push(_this.mediaMonitor
.observe(bp.alias)
.pipe(Object(rxjs_operators_map__WEBPACK_IMPORTED_MODULE_4__["map"])(buildChanges))
.subscribe(function (change) {
_this._onMonitorEvents(change);
}));
}
});
return subscriptions;
};
/**
* Build mediaQuery key-hashmap; only for the directive properties that are actually defined/used
* in the HTML markup
* @return {?}
*/
ResponsiveActivation.prototype._buildRegistryMap = /**
* Build mediaQuery key-hashmap; only for the directive properties that are actually defined/used
* in the HTML markup
* @return {?}
*/
function () {
var _this = this;
return this.mediaMonitor.breakpoints
.map(function (bp) {
return /** @type {?} */ (extendObject({}, bp, {
baseKey: _this._options.baseKey,
// e.g. layout, hide, self-align, flex-wrap
key: _this._options.baseKey + bp.suffix // e.g. layoutGtSm, layoutMd, layoutGtLg
}));
})
.filter(function (bp) { return _this._keyInUse(bp.key); });
};
/**
* Synchronizes change notifications with the current mq-activated @Input and calculates the
* mq-activated input value or the default value
*/
/**
* Synchronizes change notifications with the current mq-activated \@Input and calculates the
* mq-activated input value or the default value
* @param {?} change
* @return {?}
*/
ResponsiveActivation.prototype._onMonitorEvents = /**
* Synchronizes change notifications with the current mq-activated \@Input and calculates the
* mq-activated input value or the default value
* @param {?} change
* @return {?}
*/
function (change) {
if (change.property == this._options.baseKey) {
change.value = this._calculateActivatedValue(change);
this._onMediaChanges(change);
}
};
/**
* Has the key been specified in the HTML markup and thus is intended
* to participate in activation processes.
* @param {?} key
* @return {?}
*/
ResponsiveActivation.prototype._keyInUse = /**
* Has the key been specified in the HTML markup and thus is intended
* to participate in activation processes.
* @param {?} key
* @return {?}
*/
function (key) {
return this._lookupKeyValue(key) !== undefined;
};
/**
* Map input key associated with mediaQuery activation to closest defined input key
* then return the values associated with the targeted input property
*
* !! change events may arrive out-of-order (activate before deactivate)
* so make sure the deactivate is used ONLY when the keys match
* (since a different activate may be in use)
* @param {?} current
* @return {?}
*/
ResponsiveActivation.prototype._calculateActivatedValue = /**
* Map input key associated with mediaQuery activation to closest defined input key
* then return the values associated with the targeted input property
*
* !! change events may arrive out-of-order (activate before deactivate)
* so make sure the deactivate is used ONLY when the keys match
* (since a different activate may be in use)
* @param {?} current
* @return {?}
*/
function (current) {
var /** @type {?} */ currentKey = this._options.baseKey + current.suffix; // e.g. suffix == 'GtSm',
var /** @type {?} */ newKey = this._activatedInputKey; // e.g. newKey == hideGtSm
newKey = current.matches ? currentKey : ((newKey == currentKey) ? '' : newKey);
this._activatedInputKey = this._validateInputKey(newKey);
return this.activatedInput;
};
/**
* For the specified input property key, validate it is defined (used in the markup)
* If not see if a overlapping mediaQuery-related input key fallback has been defined
*
* NOTE: scans in the order defined by activeOverLaps (largest viewport ranges -> smallest ranges)
* @param {?} inputKey
* @return {?}
*/
ResponsiveActivation.prototype._validateInputKey = /**
* For the specified input property key, validate it is defined (used in the markup)
* If not see if a overlapping mediaQuery-related input key fallback has been defined
*
* NOTE: scans in the order defined by activeOverLaps (largest viewport ranges -> smallest ranges)
* @param {?} inputKey
* @return {?}
*/
function (inputKey) {
var _this = this;
var /** @type {?} */ isMissingKey = function (key) { return !_this._keyInUse(key); };
if (isMissingKey(inputKey)) {
this.mediaMonitor.activeOverlaps.some(function (bp) {
var /** @type {?} */ key = _this._options.baseKey + bp.suffix;
if (!isMissingKey(key)) {
inputKey = key;
return true; // exit .some()
}
return false;
});
}
return inputKey;
};
/**
* Get the value (if any) for the directive instances \@Input property (aka key)
* @param {?} key
* @return {?}
*/
ResponsiveActivation.prototype._lookupKeyValue = /**
* Get the value (if any) for the directive instances \@Input property (aka key)
* @param {?} key
* @return {?}
*/
function (key) {
return this._options.inputKeys[key];
};
return ResponsiveActivation;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Abstract base class for the Layout API styling directives.
* @abstract
*/
var /**
* Abstract base class for the Layout API styling directives.
* @abstract
*/
BaseFxDirective = /** @class */ (function () {
/**
* Constructor
*/
function BaseFxDirective(_mediaMonitor, _elementRef, _styler) {
this._mediaMonitor = _mediaMonitor;
this._elementRef = _elementRef;
this._styler = _styler;
/**
* Dictionary of input keys with associated values
*/
this._inputMap = {};
/**
* Has the `ngOnInit()` method fired
*
* Used to allow *ngFor tasks to finish and support queries like
* getComputedStyle() during ngOnInit().
*/
this._hasInitialized = false;
}
Object.defineProperty(BaseFxDirective.prototype, "hasMediaQueryListener", {
get: /**
* @return {?}
*/
function () {
return !!this._mqActivation;
},
enumerable: true,
configurable: true
});
Object.defineProperty(BaseFxDirective.prototype, "activatedValue", {
/**
* Imperatively determine the current activated [input] value;
* if called before ngOnInit() this will return `undefined`
*/
get: /**
* Imperatively determine the current activated [input] value;
* if called before ngOnInit() this will return `undefined`
* @return {?}
*/
function () {
return this._mqActivation ? this._mqActivation.activatedInput : undefined;
},
/**
* Change the currently activated input value and force-update
* the injected CSS (by-passing change detection).
*
* NOTE: Only the currently activated input value will be modified;
* other input values will NOT be affected.
*/
set: /**
* Change the currently activated input value and force-update
* the injected CSS (by-passing change detection).
*
* NOTE: Only the currently activated input value will be modified;
* other input values will NOT be affected.
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ key = 'baseKey', /** @type {?} */ previousVal;
if (this._mqActivation) {
key = this._mqActivation.activatedInputKey;
previousVal = this._inputMap[key];
this._inputMap[key] = value;
}
var /** @type {?} */ change = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["SimpleChange"](previousVal, value, false);
this.ngOnChanges(/** @type {?} */ (_a = {}, _a[key] = change, _a));
var _a;
},
enumerable: true,
configurable: true
});
Object.defineProperty(BaseFxDirective.prototype, "parentElement", {
// *********************************************
// Accessor Methods
// *********************************************
/**
* Access to host element's parent DOM node
*/
get: /**
* Access to host element's parent DOM node
* @return {?}
*/
function () {
return this._elementRef.nativeElement.parentNode;
},
enumerable: true,
configurable: true
});
Object.defineProperty(BaseFxDirective.prototype, "nativeElement", {
get: /**
* @return {?}
*/
function () {
return this._elementRef.nativeElement;
},
enumerable: true,
configurable: true
});
/**
* Access the current value (if any) of the @Input property.
*/
/**
* Access the current value (if any) of the \@Input property.
* @param {?} key
* @return {?}
*/
BaseFxDirective.prototype._queryInput = /**
* Access the current value (if any) of the \@Input property.
* @param {?} key
* @return {?}
*/
function (key) {
return this._inputMap[key];
};
// *********************************************
// Lifecycle Methods
// *********************************************
/**
* Use post-component-initialization event to perform extra
* querying such as computed Display style
*/
/**
* Use post-component-initialization event to perform extra
* querying such as computed Display style
* @return {?}
*/
BaseFxDirective.prototype.ngOnInit = /**
* Use post-component-initialization event to perform extra
* querying such as computed Display style
* @return {?}
*/
function () {
this._display = this._getDisplayStyle();
this._hasInitialized = true;
};
/**
* @param {?} change
* @return {?}
*/
BaseFxDirective.prototype.ngOnChanges = /**
* @param {?} change
* @return {?}
*/
function (change) {
throw new Error("BaseFxDirective::ngOnChanges should be overridden in subclass: " + change);
};
/**
* @return {?}
*/
BaseFxDirective.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this._mqActivation) {
this._mqActivation.destroy();
}
delete this._mediaMonitor;
};
// *********************************************
// Protected Methods
// *********************************************
/**
* Was the directive's default selector used ?
* If not, use the fallback value!
*/
/**
* Was the directive's default selector used ?
* If not, use the fallback value!
* @param {?} key
* @param {?} fallbackVal
* @return {?}
*/
BaseFxDirective.prototype._getDefaultVal = /**
* Was the directive's default selector used ?
* If not, use the fallback value!
* @param {?} key
* @param {?} fallbackVal
* @return {?}
*/
function (key, fallbackVal) {
var /** @type {?} */ val = this._queryInput(key);
var /** @type {?} */ hasDefaultVal = (val !== undefined && val !== null);
return (hasDefaultVal && val !== '') ? val : fallbackVal;
};
/**
* Quick accessor to the current HTMLElement's `display` style
* Note: this allows us to preserve the original style
* and optional restore it when the mediaQueries deactivate
*/
/**
* Quick accessor to the current HTMLElement's `display` style
* Note: this allows us to preserve the original style
* and optional restore it when the mediaQueries deactivate
* @param {?=} source
* @return {?}
*/
BaseFxDirective.prototype._getDisplayStyle = /**
* Quick accessor to the current HTMLElement's `display` style
* Note: this allows us to preserve the original style
* and optional restore it when the mediaQueries deactivate
* @param {?=} source
* @return {?}
*/
function (source) {
if (source === void 0) { source = this.nativeElement; }
var /** @type {?} */ query = 'display';
return this._styler.lookupStyle(source, query);
};
/**
* Quick accessor to raw attribute value on the target DOM element
*/
/**
* Quick accessor to raw attribute value on the target DOM element
* @param {?} attribute
* @param {?=} source
* @return {?}
*/
BaseFxDirective.prototype._getAttributeValue = /**
* Quick accessor to raw attribute value on the target DOM element
* @param {?} attribute
* @param {?=} source
* @return {?}
*/
function (attribute, source) {
if (source === void 0) { source = this.nativeElement; }
return this._styler.lookupAttributeValue(source, attribute);
};
/**
* Determine the DOM element's Flexbox flow (flex-direction).
*
* Check inline style first then check computed (stylesheet) style.
* And optionally add the flow value to element's inline style.
*/
/**
* Determine the DOM element's Flexbox flow (flex-direction).
*
* Check inline style first then check computed (stylesheet) style.
* And optionally add the flow value to element's inline style.
* @param {?} target
* @param {?=} addIfMissing
* @return {?}
*/
BaseFxDirective.prototype._getFlowDirection = /**
* Determine the DOM element's Flexbox flow (flex-direction).
*
* Check inline style first then check computed (stylesheet) style.
* And optionally add the flow value to element's inline style.
* @param {?} target
* @param {?=} addIfMissing
* @return {?}
*/
function (target, addIfMissing) {
if (addIfMissing === void 0) { addIfMissing = false; }
var /** @type {?} */ value = 'row';
var /** @type {?} */ hasInlineValue = '';
if (target) {
_a = this._styler.getFlowDirection(target), value = _a[0], hasInlineValue = _a[1];
if (!hasInlineValue && addIfMissing) {
var /** @type {?} */ style = buildLayoutCSS(value);
var /** @type {?} */ elements = [target];
this._styler.applyStyleToElements(style, elements);
}
}
return value.trim() || 'row';
var _a;
};
/**
* Applies styles given via string pair or object map to the directive element.
*/
/**
* Applies styles given via string pair or object map to the directive element.
* @param {?} style
* @param {?=} value
* @param {?=} element
* @return {?}
*/
BaseFxDirective.prototype._applyStyleToElement = /**
* Applies styles given via string pair or object map to the directive element.
* @param {?} style
* @param {?=} value
* @param {?=} element
* @return {?}
*/
function (style, value, element) {
if (element === void 0) { element = this.nativeElement; }
this._styler.applyStyleToElement(element, style, value);
};
/**
* Applies styles given via string pair or object map to the directive's element.
*/
/**
* Applies styles given via string pair or object map to the directive's element.
* @param {?} style
* @param {?} elements
* @return {?}
*/
BaseFxDirective.prototype._applyStyleToElements = /**
* Applies styles given via string pair or object map to the directive's element.
* @param {?} style
* @param {?} elements
* @return {?}
*/
function (style, elements) {
this._styler.applyStyleToElements(style, elements);
};
/**
* Save the property value; which may be a complex object.
* Complex objects support property chains
*/
/**
* Save the property value; which may be a complex object.
* Complex objects support property chains
* @param {?=} key
* @param {?=} source
* @return {?}
*/
BaseFxDirective.prototype._cacheInput = /**
* Save the property value; which may be a complex object.
* Complex objects support property chains
* @param {?=} key
* @param {?=} source
* @return {?}
*/
function (key, source) {
if (typeof source === 'object') {
for (var /** @type {?} */ prop in source) {
this._inputMap[prop] = source[prop];
}
}
else {
if (!!key) {
this._inputMap[key] = source;
}
}
};
/**
* Build a ResponsiveActivation object used to manage subscriptions to mediaChange notifications
* and intelligent lookup of the directive's property value that corresponds to that mediaQuery
* (or closest match).
*/
/**
* Build a ResponsiveActivation object used to manage subscriptions to mediaChange notifications
* and intelligent lookup of the directive's property value that corresponds to that mediaQuery
* (or closest match).
* @param {?} key
* @param {?} defaultValue
* @param {?} onMediaQueryChange
* @return {?}
*/
BaseFxDirective.prototype._listenForMediaQueryChanges = /**
* Build a ResponsiveActivation object used to manage subscriptions to mediaChange notifications
* and intelligent lookup of the directive's property value that corresponds to that mediaQuery
* (or closest match).
* @param {?} key
* @param {?} defaultValue
* @param {?} onMediaQueryChange
* @return {?}
*/
function (key, defaultValue, onMediaQueryChange) {
// tslint:disable-line:max-line-length
if (!this._mqActivation) {
var /** @type {?} */ keyOptions = new KeyOptions(key, defaultValue, this._inputMap);
this._mqActivation = new ResponsiveActivation(keyOptions, this._mediaMonitor, function (change) { return onMediaQueryChange(change); });
}
return this._mqActivation;
};
Object.defineProperty(BaseFxDirective.prototype, "childrenNodes", {
/**
* Special accessor to query for all child 'element' nodes regardless of type, class, etc.
*/
get: /**
* Special accessor to query for all child 'element' nodes regardless of type, class, etc.
* @return {?}
*/
function () {
var /** @type {?} */ obj = this.nativeElement.children;
var /** @type {?} */ buffer = [];
// iterate backwards ensuring that length is an UInt32
for (var /** @type {?} */ i = obj.length; i--;) {
buffer[i] = obj[i];
}
return buffer;
},
enumerable: true,
configurable: true
});
/**
* Does this directive have 1 or more responsive keys defined
* Note: we exclude the 'baseKey' key (which is NOT considered responsive)
*/
/**
* Does this directive have 1 or more responsive keys defined
* Note: we exclude the 'baseKey' key (which is NOT considered responsive)
* @param {?} baseKey
* @return {?}
*/
BaseFxDirective.prototype.hasResponsiveAPI = /**
* Does this directive have 1 or more responsive keys defined
* Note: we exclude the 'baseKey' key (which is NOT considered responsive)
* @param {?} baseKey
* @return {?}
*/
function (baseKey) {
var /** @type {?} */ totalKeys = Object.keys(this._inputMap).length;
var /** @type {?} */ baseValue = this._inputMap[baseKey];
return (totalKeys - (!!baseValue ? 1 : 0)) > 0;
};
/**
* Fast validator for presence of attribute on the host element
*/
/**
* Fast validator for presence of attribute on the host element
* @param {?} key
* @return {?}
*/
BaseFxDirective.prototype.hasKeyValue = /**
* Fast validator for presence of attribute on the host element
* @param {?} key
* @return {?}
*/
function (key) {
return this._mqActivation.hasKeyValue(key);
};
Object.defineProperty(BaseFxDirective.prototype, "hasInitialized", {
get: /**
* @return {?}
*/
function () {
return this._hasInitialized;
},
enumerable: true,
configurable: true
});
return BaseFxDirective;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Adapter to the BaseFxDirective abstract class so it can be used via composition.
* @see BaseFxDirective
*/
var /**
* Adapter to the BaseFxDirective abstract class so it can be used via composition.
* @see BaseFxDirective
*/
BaseFxDirectiveAdapter = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_5__["__extends"])(BaseFxDirectiveAdapter, _super);
/**
* BaseFxDirectiveAdapter constructor
*/
function BaseFxDirectiveAdapter(_baseKey, // non-responsive @Input property name
// non-responsive @Input property name
_mediaMonitor, _elementRef, _styler) {
var _this = _super.call(this, _mediaMonitor, _elementRef, _styler) || this;
_this._baseKey = _baseKey;
_this._mediaMonitor = _mediaMonitor;
_this._elementRef = _elementRef;
_this._styler = _styler;
return _this;
}
Object.defineProperty(BaseFxDirectiveAdapter.prototype, "activeKey", {
/**
* Accessor to determine which @Input property is "active"
* e.g. which property value will be used.
*/
get: /**
* Accessor to determine which \@Input property is "active"
* e.g. which property value will be used.
* @return {?}
*/
function () {
var /** @type {?} */ mqa = this._mqActivation;
var /** @type {?} */ key = mqa ? mqa.activatedInputKey : this._baseKey;
// Note: ClassDirective::SimpleChanges uses 'klazz' instead of 'class' as a key
return (key === 'class') ? 'klazz' : key;
},
enumerable: true,
configurable: true
});
Object.defineProperty(BaseFxDirectiveAdapter.prototype, "inputMap", {
/** Hash map of all @Input keys/values defined/used */
get: /**
* Hash map of all \@Input keys/values defined/used
* @return {?}
*/
function () {
return this._inputMap;
},
enumerable: true,
configurable: true
});
Object.defineProperty(BaseFxDirectiveAdapter.prototype, "mqActivation", {
/**
* @see BaseFxDirective._mqActivation
*/
get: /**
* @see BaseFxDirective._mqActivation
* @return {?}
*/
function () {
return this._mqActivation;
},
enumerable: true,
configurable: true
});
/**
* Does this directive have 1 or more responsive keys defined
* Note: we exclude the 'baseKey' key (which is NOT considered responsive)
*/
/**
* Does this directive have 1 or more responsive keys defined
* Note: we exclude the 'baseKey' key (which is NOT considered responsive)
* @return {?}
*/
BaseFxDirectiveAdapter.prototype.hasResponsiveAPI = /**
* Does this directive have 1 or more responsive keys defined
* Note: we exclude the 'baseKey' key (which is NOT considered responsive)
* @return {?}
*/
function () {
return _super.prototype.hasResponsiveAPI.call(this, this._baseKey);
};
/**
* @see BaseFxDirective._queryInput
*/
/**
* @see BaseFxDirective._queryInput
* @param {?} key
* @return {?}
*/
BaseFxDirectiveAdapter.prototype.queryInput = /**
* @see BaseFxDirective._queryInput
* @param {?} key
* @return {?}
*/
function (key) {
return key ? this._queryInput(key) : undefined;
};
/**
* Save the property value.
*/
/**
* Save the property value.
* @param {?=} key
* @param {?=} source
* @param {?=} cacheRaw
* @return {?}
*/
BaseFxDirectiveAdapter.prototype.cacheInput = /**
* Save the property value.
* @param {?=} key
* @param {?=} source
* @param {?=} cacheRaw
* @return {?}
*/
function (key, source, cacheRaw) {
if (cacheRaw === void 0) { cacheRaw = false; }
if (cacheRaw) {
this._cacheInputRaw(key, source);
}
else if (Array.isArray(source)) {
this._cacheInputArray(key, source);
}
else if (typeof source === 'object') {
this._cacheInputObject(key, source);
}
else if (typeof source === 'string') {
this._cacheInputString(key, source);
}
else {
throw new Error("Invalid class value '" + key + "' provided. Did you want to cache the raw value?");
}
};
/**
* @see BaseFxDirective._listenForMediaQueryChanges
*/
/**
* @see BaseFxDirective._listenForMediaQueryChanges
* @param {?} key
* @param {?} defaultValue
* @param {?} onMediaQueryChange
* @return {?}
*/
BaseFxDirectiveAdapter.prototype.listenForMediaQueryChanges = /**
* @see BaseFxDirective._listenForMediaQueryChanges
* @param {?} key
* @param {?} defaultValue
* @param {?} onMediaQueryChange
* @return {?}
*/
function (key, defaultValue, onMediaQueryChange) {
return this._listenForMediaQueryChanges(key, defaultValue, onMediaQueryChange);
};
// ************************************************************
// Protected Methods
// ************************************************************
/**
* No implicit transforms of the source.
* Required when caching values expected later for KeyValueDiffers
*/
/**
* No implicit transforms of the source.
* Required when caching values expected later for KeyValueDiffers
* @param {?=} key
* @param {?=} source
* @return {?}
*/
BaseFxDirectiveAdapter.prototype._cacheInputRaw = /**
* No implicit transforms of the source.
* Required when caching values expected later for KeyValueDiffers
* @param {?=} key
* @param {?=} source
* @return {?}
*/
function (key, source) {
if (key) {
this._inputMap[key] = source;
}
};
/**
* Save the property value for Array values.
*/
/**
* Save the property value for Array values.
* @param {?=} key
* @param {?=} source
* @return {?}
*/
BaseFxDirectiveAdapter.prototype._cacheInputArray = /**
* Save the property value for Array values.
* @param {?=} key
* @param {?=} source
* @return {?}
*/
function (key, source) {
if (key === void 0) { key = ''; }
this._inputMap[key] = source ? source.join(' ') : '';
};
/**
* Save the property value for key/value pair values.
*/
/**
* Save the property value for key/value pair values.
* @param {?=} key
* @param {?=} source
* @return {?}
*/
BaseFxDirectiveAdapter.prototype._cacheInputObject = /**
* Save the property value for key/value pair values.
* @param {?=} key
* @param {?=} source
* @return {?}
*/
function (key, source) {
if (key === void 0) { key = ''; }
var /** @type {?} */ classes = [];
if (source) {
for (var /** @type {?} */ prop in source) {
if (!!source[prop]) {
classes.push(prop);
}
}
}
this._inputMap[key] = classes.join(' ');
};
/**
* Save the property value for string values.
*/
/**
* Save the property value for string values.
* @param {?=} key
* @param {?=} source
* @return {?}
*/
BaseFxDirectiveAdapter.prototype._cacheInputString = /**
* Save the property value for string values.
* @param {?=} key
* @param {?=} source
* @return {?}
*/
function (key, source) {
if (key === void 0) { key = ''; }
this._inputMap[key] = source;
};
return BaseFxDirectiveAdapter;
}(BaseFxDirective));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* MockMatchMedia mocks calls to the Window API matchMedia with a build of a simulated
* MockMediaQueryListener. Methods are available to simulate an activation of a mediaQuery
* range and to clearAll mediaQuery listeners.
*/
var MockMatchMedia = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_5__["__extends"])(MockMatchMedia, _super);
function MockMatchMedia(_zone, _platformId, _document, _breakpoints) {
var _this = _super.call(this, _zone, _platformId, _document) || this;
_this._breakpoints = _breakpoints;
/**
* Special flag used to test BreakPoint registrations with MatchMedia
*/
_this.autoRegisterQueries = true;
/**
* Allow fallback to overlapping mediaQueries to determine
* activatedInput(s).
*/
_this.useOverlaps = false;
_this._actives = [];
_this._actives = [];
return _this;
}
/** Easy method to clear all listeners for all mediaQueries */
/**
* Easy method to clear all listeners for all mediaQueries
* @return {?}
*/
MockMatchMedia.prototype.clearAll = /**
* Easy method to clear all listeners for all mediaQueries
* @return {?}
*/
function () {
this._registry.forEach(function (mql, _) {
mql.destroy();
});
this._registry.clear();
this.useOverlaps = false;
};
/** Feature to support manual, simulated activation of a mediaQuery. */
/**
* Feature to support manual, simulated activation of a mediaQuery.
* @param {?} mediaQuery
* @param {?=} useOverlaps
* @return {?}
*/
MockMatchMedia.prototype.activate = /**
* Feature to support manual, simulated activation of a mediaQuery.
* @param {?} mediaQuery
* @param {?=} useOverlaps
* @return {?}
*/
function (mediaQuery, useOverlaps) {
if (useOverlaps === void 0) { useOverlaps = false; }
useOverlaps = useOverlaps || this.useOverlaps;
mediaQuery = this._validateQuery(mediaQuery);
if (useOverlaps || !this.isActive(mediaQuery)) {
this._deactivateAll();
this._registerMediaQuery(mediaQuery);
this._activateWithOverlaps(mediaQuery, useOverlaps);
}
return this.hasActivated;
};
/** Converts an optional mediaQuery alias to a specific, valid mediaQuery */
/**
* Converts an optional mediaQuery alias to a specific, valid mediaQuery
* @param {?} queryOrAlias
* @return {?}
*/
MockMatchMedia.prototype._validateQuery = /**
* Converts an optional mediaQuery alias to a specific, valid mediaQuery
* @param {?} queryOrAlias
* @return {?}
*/
function (queryOrAlias) {
var /** @type {?} */ bp = this._breakpoints.findByAlias(queryOrAlias);
if (bp) {
queryOrAlias = bp.mediaQuery;
}
return queryOrAlias;
};
/**
* Manually activate any overlapping mediaQueries to simulate
* similar functionality in the window.matchMedia()
* @param {?} mediaQuery
* @param {?} useOverlaps
* @return {?}
*/
MockMatchMedia.prototype._activateWithOverlaps = /**
* Manually activate any overlapping mediaQueries to simulate
* similar functionality in the window.matchMedia()
* @param {?} mediaQuery
* @param {?} useOverlaps
* @return {?}
*/
function (mediaQuery, useOverlaps) {
if (useOverlaps) {
var /** @type {?} */ bp = this._breakpoints.findByQuery(mediaQuery);
var /** @type {?} */ alias = bp ? bp.alias : 'unknown';
// Simulate activation of overlapping lt-<XXX> ranges
switch (alias) {
case 'lg':
this._activateByAlias('lt-xl');
break;
case 'md':
this._activateByAlias('lt-xl, lt-lg');
break;
case 'sm':
this._activateByAlias('lt-xl, lt-lg, lt-md');
break;
case 'xs':
this._activateByAlias('lt-xl, lt-lg, lt-md, lt-sm');
break;
}
// Simulate activate of overlapping gt-<xxxx> mediaQuery ranges
switch (alias) {
case 'xl':
this._activateByAlias('gt-lg, gt-md, gt-sm, gt-xs');
break;
case 'lg':
this._activateByAlias('gt-md, gt-sm, gt-xs');
break;
case 'md':
this._activateByAlias('gt-sm, gt-xs');
break;
case 'sm':
this._activateByAlias('gt-xs');
break;
}
}
// Activate last since the responsiveActivation is watching *this* mediaQuery
return this._activateByQuery(mediaQuery);
};
/**
*
* @param {?} aliases
* @return {?}
*/
MockMatchMedia.prototype._activateByAlias = /**
*
* @param {?} aliases
* @return {?}
*/
function (aliases) {
var _this = this;
var /** @type {?} */ activate = function (alias) {
var /** @type {?} */ bp = _this._breakpoints.findByAlias(alias);
_this._activateByQuery(bp ? bp.mediaQuery : alias);
};
aliases.split(',').forEach(function (alias) { return activate(alias.trim()); });
};
/**
*
* @param {?} mediaQuery
* @return {?}
*/
MockMatchMedia.prototype._activateByQuery = /**
*
* @param {?} mediaQuery
* @return {?}
*/
function (mediaQuery) {
var /** @type {?} */ mql = /** @type {?} */ (this._registry.get(mediaQuery));
var /** @type {?} */ alreadyAdded = this._actives.reduce(function (found, it) {
return found || (mql && (it.media === mql.media));
}, false);
if (mql && !alreadyAdded) {
this._actives.push(mql.activate());
}
return this.hasActivated;
};
/**
* Deactivate all current Mock MQLs
* @return {?}
*/
MockMatchMedia.prototype._deactivateAll = /**
* Deactivate all current Mock MQLs
* @return {?}
*/
function () {
if (this._actives.length) {
// Deactivate all current MQLs and reset the buffer
for (var _i = 0, _a = this._actives; _i < _a.length; _i++) {
var it = _a[_i];
it.deactivate();
}
this._actives = [];
}
return this;
};
/**
* Insure the mediaQuery is registered with MatchMedia
* @param {?} mediaQuery
* @return {?}
*/
MockMatchMedia.prototype._registerMediaQuery = /**
* Insure the mediaQuery is registered with MatchMedia
* @param {?} mediaQuery
* @return {?}
*/
function (mediaQuery) {
if (!this._registry.has(mediaQuery) && this.autoRegisterQueries) {
this.registerQuery(mediaQuery);
}
};
/**
* Call window.matchMedia() to build a MediaQueryList; which
* supports 0..n listeners for activation/deactivation
*/
/**
* Call window.matchMedia() to build a MediaQueryList; which
* supports 0..n listeners for activation/deactivation
* @param {?} query
* @return {?}
*/
MockMatchMedia.prototype._buildMQL = /**
* Call window.matchMedia() to build a MediaQueryList; which
* supports 0..n listeners for activation/deactivation
* @param {?} query
* @return {?}
*/
function (query) {
return new MockMediaQueryList(query);
};
Object.defineProperty(MockMatchMedia.prototype, "hasActivated", {
get: /**
* @return {?}
*/
function () {
return (this._actives.length > 0);
},
enumerable: true,
configurable: true
});
MockMatchMedia.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
MockMatchMedia.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: Object, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"],] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_1__["DOCUMENT"],] },] },
{ type: BreakPointRegistry, },
]; };
return MockMatchMedia;
}(MatchMedia));
/**
* Special internal class to simulate a MediaQueryList and
* - supports manual activation to simulate mediaQuery matching
* - manages listeners
*/
var /**
* Special internal class to simulate a MediaQueryList and
* - supports manual activation to simulate mediaQuery matching
* - manages listeners
*/
MockMediaQueryList = /** @class */ (function () {
function MockMediaQueryList(_mediaQuery) {
this._mediaQuery = _mediaQuery;
this._isActive = false;
this._listeners = [];
}
Object.defineProperty(MockMediaQueryList.prototype, "matches", {
get: /**
* @return {?}
*/
function () {
return this._isActive;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MockMediaQueryList.prototype, "media", {
get: /**
* @return {?}
*/
function () {
return this._mediaQuery;
},
enumerable: true,
configurable: true
});
/**
* Destroy the current list by deactivating the
* listeners and clearing the internal list
*/
/**
* Destroy the current list by deactivating the
* listeners and clearing the internal list
* @return {?}
*/
MockMediaQueryList.prototype.destroy = /**
* Destroy the current list by deactivating the
* listeners and clearing the internal list
* @return {?}
*/
function () {
this.deactivate();
this._listeners = [];
};
/** Notify all listeners that 'matches === TRUE' */
/**
* Notify all listeners that 'matches === TRUE'
* @return {?}
*/
MockMediaQueryList.prototype.activate = /**
* Notify all listeners that 'matches === TRUE'
* @return {?}
*/
function () {
var _this = this;
if (!this._isActive) {
this._isActive = true;
this._listeners.forEach(function (callback) {
callback(_this);
});
}
return this;
};
/** Notify all listeners that 'matches === false' */
/**
* Notify all listeners that 'matches === false'
* @return {?}
*/
MockMediaQueryList.prototype.deactivate = /**
* Notify all listeners that 'matches === false'
* @return {?}
*/
function () {
var _this = this;
if (this._isActive) {
this._isActive = false;
this._listeners.forEach(function (callback) {
callback(_this);
});
}
return this;
};
/** Add a listener to our internal list to activate later */
/**
* Add a listener to our internal list to activate later
* @param {?} listener
* @return {?}
*/
MockMediaQueryList.prototype.addListener = /**
* Add a listener to our internal list to activate later
* @param {?} listener
* @return {?}
*/
function (listener) {
if (this._listeners.indexOf(listener) === -1) {
this._listeners.push(listener);
}
if (this._isActive) {
listener(this);
}
};
/** Don't need to remove listeners in the testing environment */
/**
* Don't need to remove listeners in the testing environment
* @param {?} _
* @return {?}
*/
MockMediaQueryList.prototype.removeListener = /**
* Don't need to remove listeners in the testing environment
* @param {?} _
* @return {?}
*/
function (_) {
};
return MockMediaQueryList;
}());
/**
* Pre-configured provider for MockMatchMedia
*/
var /** @type {?} */ MockMatchMediaProvider = {
// tslint:disable-line:variable-name
provide: MatchMedia,
useClass: MockMatchMedia
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Special server-only class to simulate a MediaQueryList and
* - supports manual activation to simulate mediaQuery matching
* - manages listeners
*/
var /**
* Special server-only class to simulate a MediaQueryList and
* - supports manual activation to simulate mediaQuery matching
* - manages listeners
*/
ServerMediaQueryList = /** @class */ (function () {
function ServerMediaQueryList(_mediaQuery) {
this._mediaQuery = _mediaQuery;
this._isActive = false;
this._listeners = [];
}
Object.defineProperty(ServerMediaQueryList.prototype, "matches", {
get: /**
* @return {?}
*/
function () {
return this._isActive;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ServerMediaQueryList.prototype, "media", {
get: /**
* @return {?}
*/
function () {
return this._mediaQuery;
},
enumerable: true,
configurable: true
});
/**
* Destroy the current list by deactivating the
* listeners and clearing the internal list
*/
/**
* Destroy the current list by deactivating the
* listeners and clearing the internal list
* @return {?}
*/
ServerMediaQueryList.prototype.destroy = /**
* Destroy the current list by deactivating the
* listeners and clearing the internal list
* @return {?}
*/
function () {
this.deactivate();
this._listeners = [];
};
/** Notify all listeners that 'matches === TRUE' */
/**
* Notify all listeners that 'matches === TRUE'
* @return {?}
*/
ServerMediaQueryList.prototype.activate = /**
* Notify all listeners that 'matches === TRUE'
* @return {?}
*/
function () {
var _this = this;
if (!this._isActive) {
this._isActive = true;
this._listeners.forEach(function (callback) {
callback(_this);
});
}
return this;
};
/** Notify all listeners that 'matches === false' */
/**
* Notify all listeners that 'matches === false'
* @return {?}
*/
ServerMediaQueryList.prototype.deactivate = /**
* Notify all listeners that 'matches === false'
* @return {?}
*/
function () {
var _this = this;
if (this._isActive) {
this._isActive = false;
this._listeners.forEach(function (callback) {
callback(_this);
});
}
return this;
};
/** Add a listener to our internal list to activate later */
/**
* Add a listener to our internal list to activate later
* @param {?} listener
* @return {?}
*/
ServerMediaQueryList.prototype.addListener = /**
* Add a listener to our internal list to activate later
* @param {?} listener
* @return {?}
*/
function (listener) {
if (this._listeners.indexOf(listener) === -1) {
this._listeners.push(listener);
}
if (this._isActive) {
listener(this);
}
};
/** Don't need to remove listeners in the server environment */
/**
* Don't need to remove listeners in the server environment
* @param {?} _
* @return {?}
*/
ServerMediaQueryList.prototype.removeListener = /**
* Don't need to remove listeners in the server environment
* @param {?} _
* @return {?}
*/
function (_) {
};
return ServerMediaQueryList;
}());
/**
* Special server-only implementation of MatchMedia that uses the above
* ServerMediaQueryList as its internal representation
*
* Also contains methods to activate and deactivate breakpoints
*/
var ServerMatchMedia = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_5__["__extends"])(ServerMatchMedia, _super);
function ServerMatchMedia(_zone, _platformId, _document) {
var _this = _super.call(this, _zone, _platformId, _document) || this;
_this._zone = _zone;
_this._platformId = _platformId;
_this._document = _document;
_this._registry = new Map();
_this._source = new rxjs_BehaviorSubject__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](new MediaChange(true));
_this._observable$ = _this._source.asObservable();
return _this;
}
/** Activate the specified breakpoint if we're on the server, no-op otherwise */
/**
* Activate the specified breakpoint if we're on the server, no-op otherwise
* @param {?} bp
* @return {?}
*/
ServerMatchMedia.prototype.activateBreakpoint = /**
* Activate the specified breakpoint if we're on the server, no-op otherwise
* @param {?} bp
* @return {?}
*/
function (bp) {
var /** @type {?} */ lookupBreakpoint = this._registry.get(bp.mediaQuery);
if (lookupBreakpoint) {
lookupBreakpoint.activate();
}
};
/** Deactivate the specified breakpoint if we're on the server, no-op otherwise */
/**
* Deactivate the specified breakpoint if we're on the server, no-op otherwise
* @param {?} bp
* @return {?}
*/
ServerMatchMedia.prototype.deactivateBreakpoint = /**
* Deactivate the specified breakpoint if we're on the server, no-op otherwise
* @param {?} bp
* @return {?}
*/
function (bp) {
var /** @type {?} */ lookupBreakpoint = this._registry.get(bp.mediaQuery);
if (lookupBreakpoint) {
lookupBreakpoint.deactivate();
}
};
/**
* Call window.matchMedia() to build a MediaQueryList; which
* supports 0..n listeners for activation/deactivation
*/
/**
* Call window.matchMedia() to build a MediaQueryList; which
* supports 0..n listeners for activation/deactivation
* @param {?} query
* @return {?}
*/
ServerMatchMedia.prototype._buildMQL = /**
* Call window.matchMedia() to build a MediaQueryList; which
* supports 0..n listeners for activation/deactivation
* @param {?} query
* @return {?}
*/
function (query) {
return new ServerMediaQueryList(query);
};
ServerMatchMedia.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
ServerMatchMedia.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: Object, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"],] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_1__["DOCUMENT"],] },] },
]; };
return ServerMatchMedia;
}(MatchMedia));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Ensure a single global service provider
* @param {?} parentMonitor
* @param {?} breakpoints
* @param {?} matchMedia
* @return {?}
*/
function MEDIA_MONITOR_PROVIDER_FACTORY(parentMonitor, breakpoints, matchMedia) {
return parentMonitor || new MediaMonitor(breakpoints, matchMedia);
}
/**
* Export provider that uses a global service factory (above)
*/
var /** @type {?} */ MEDIA_MONITOR_PROVIDER = {
provide: MediaMonitor,
deps: [
[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"](), MediaMonitor],
BreakPointRegistry,
MatchMedia,
],
useFactory: MEDIA_MONITOR_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=core.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/flex-layout/esm5/extended.es5.js":
/*!****************************************************************!*\
!*** ./node_modules/@angular/flex-layout/esm5/extended.es5.js ***!
\****************************************************************/
/*! exports provided: ExtendedModule, ClassDirective, ImgSrcDirective, negativeOf, ShowHideDirective, StyleDirective */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExtendedModule", function() { return ExtendedModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClassDirective", function() { return ClassDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImgSrcDirective", function() { return ImgSrcDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "negativeOf", function() { return negativeOf; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShowHideDirective", function() { return ShowHideDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StyleDirective", function() { return StyleDirective; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/flex-layout/core */ "./node_modules/@angular/flex-layout/esm5/core.es5.js");
/* harmony import */ var _angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/flex-layout/flex */ "./node_modules/@angular/flex-layout/esm5/flex.es5.js");
/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/fesm5/platform-browser.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* This directive provides a responsive API for the HTML <img> 'src' attribute
* and will update the img.src property upon each responsive activation.
*
* e.g.
* <img src="defaultScene.jpg" src.xs="mobileScene.jpg"></img>
*
* @see https://css-tricks.com/responsive-images-youre-just-changing-resolutions-use-src/
*/
var ImgSrcDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ImgSrcDirective, _super);
/* tslint:enable */
function ImgSrcDirective(_elRef, _monitor, _styler, _platformId, _serverModuleLoaded) {
var _this = _super.call(this, _monitor, _elRef, _styler) || this;
_this._elRef = _elRef;
_this._monitor = _monitor;
_this._styler = _styler;
_this._platformId = _platformId;
_this._serverModuleLoaded = _serverModuleLoaded;
_this._cacheInput('src', _elRef.nativeElement.getAttribute('src') || '');
if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_2__["isPlatformServer"])(_this._platformId) && _this._serverModuleLoaded) {
_this.nativeElement.setAttribute('src', '');
}
return _this;
}
Object.defineProperty(ImgSrcDirective.prototype, "srcBase", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this.cacheDefaultSrc(val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcLtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcLtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcLtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcLtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcLtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcLtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcLtXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcLtXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcGtXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcGtXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcGtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcGtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcGtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcGtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "srcGtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('srcGtLg', val); },
enumerable: true,
configurable: true
});
/**
* Listen for responsive changes to update the img.src attribute
*/
/**
* Listen for responsive changes to update the img.src attribute
* @return {?}
*/
ImgSrcDirective.prototype.ngOnInit = /**
* Listen for responsive changes to update the img.src attribute
* @return {?}
*/
function () {
var _this = this;
_super.prototype.ngOnInit.call(this);
if (this.hasResponsiveKeys) {
// Listen for responsive changes
this._listenForMediaQueryChanges('src', this.defaultSrc, function () {
_this._updateSrcFor();
});
}
this._updateSrcFor();
};
/**
* Update the 'src' property of the host <img> element
*/
/**
* Update the 'src' property of the host <img> element
* @return {?}
*/
ImgSrcDirective.prototype.ngOnChanges = /**
* Update the 'src' property of the host <img> element
* @return {?}
*/
function () {
if (this.hasInitialized) {
this._updateSrcFor();
}
};
/**
* Use the [responsively] activated input value to update
* the host img src attribute or assign a default `img.src=''`
* if the src has not been defined.
*
* Do nothing to standard `<img src="">` usages, only when responsive
* keys are present do we actually call `setAttribute()`
*/
/**
* Use the [responsively] activated input value to update
* the host img src attribute or assign a default `img.src=''`
* if the src has not been defined.
*
* Do nothing to standard `<img src="">` usages, only when responsive
* keys are present do we actually call `setAttribute()`
* @return {?}
*/
ImgSrcDirective.prototype._updateSrcFor = /**
* Use the [responsively] activated input value to update
* the host img src attribute or assign a default `img.src=''`
* if the src has not been defined.
*
* Do nothing to standard `<img src="">` usages, only when responsive
* keys are present do we actually call `setAttribute()`
* @return {?}
*/
function () {
if (this.hasResponsiveKeys) {
var /** @type {?} */ url = this.activatedValue || this.defaultSrc;
if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_2__["isPlatformServer"])(this._platformId) && this._serverModuleLoaded) {
this._styler.applyStyleToElement(this.nativeElement, { 'content': url ? "url(" + url + ")" : '' });
}
else {
this.nativeElement.setAttribute('src', String(url));
}
}
};
/**
* Cache initial value of 'src', this will be used as fallback when breakpoint
* activations change.
* NOTE: The default 'src' property is not bound using @Input(), so perform
* a post-ngOnInit() lookup of the default src value (if any).
*/
/**
* Cache initial value of 'src', this will be used as fallback when breakpoint
* activations change.
* NOTE: The default 'src' property is not bound using \@Input(), so perform
* a post-ngOnInit() lookup of the default src value (if any).
* @param {?=} value
* @return {?}
*/
ImgSrcDirective.prototype.cacheDefaultSrc = /**
* Cache initial value of 'src', this will be used as fallback when breakpoint
* activations change.
* NOTE: The default 'src' property is not bound using \@Input(), so perform
* a post-ngOnInit() lookup of the default src value (if any).
* @param {?=} value
* @return {?}
*/
function (value) {
this._cacheInput('src', value || '');
};
Object.defineProperty(ImgSrcDirective.prototype, "defaultSrc", {
/**
* Empty values are maintained, undefined values are exposed as ''
*/
get: /**
* Empty values are maintained, undefined values are exposed as ''
* @return {?}
*/
function () {
return this._queryInput('src') || '';
},
enumerable: true,
configurable: true
});
Object.defineProperty(ImgSrcDirective.prototype, "hasResponsiveKeys", {
/**
* Does the <img> have 1 or more src.<xxx> responsive inputs
* defined... these will be mapped to activated breakpoints.
*/
get: /**
* Does the <img> have 1 or more src.<xxx> responsive inputs
* defined... these will be mapped to activated breakpoints.
* @return {?}
*/
function () {
return Object.keys(this._inputMap).length > 1;
},
enumerable: true,
configurable: true
});
ImgSrcDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: "\n img[src.xs], img[src.sm], img[src.md], img[src.lg], img[src.xl],\n img[src.lt-sm], img[src.lt-md], img[src.lt-lg], img[src.lt-xl],\n img[src.gt-xs], img[src.gt-sm], img[src.gt-md], img[src.gt-lg]\n"
},] },
];
/** @nocollapse */
ImgSrcDirective.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["MediaMonitor"], },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["StyleUtils"], },
{ type: Object, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"],] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["SERVER_TOKEN"],] },] },
]; };
ImgSrcDirective.propDecorators = {
"srcBase": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src',] },],
"srcXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.xs',] },],
"srcSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.sm',] },],
"srcMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.md',] },],
"srcLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.lg',] },],
"srcXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.xl',] },],
"srcLtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.lt-sm',] },],
"srcLtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.lt-md',] },],
"srcLtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.lt-lg',] },],
"srcLtXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.lt-xl',] },],
"srcGtXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.gt-xs',] },],
"srcGtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.gt-sm',] },],
"srcGtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.gt-md',] },],
"srcGtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['src.gt-lg',] },],
};
return ImgSrcDirective;
}(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["BaseFxDirective"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Directive to add responsive support for ngClass.
* This maintains the core functionality of 'ngClass' and adds responsive API
* Note: this class is a no-op when rendered on the server
*/
var ClassDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ClassDirective, _super);
/* tslint:enable */
function ClassDirective(monitor, _iterableDiffers, _keyValueDiffers, _ngEl, _renderer, _ngClassInstance, _styler) {
var _this = _super.call(this, monitor, _ngEl, _styler) || this;
_this.monitor = monitor;
_this._iterableDiffers = _iterableDiffers;
_this._keyValueDiffers = _keyValueDiffers;
_this._ngEl = _ngEl;
_this._renderer = _renderer;
_this._ngClassInstance = _ngClassInstance;
_this._styler = _styler;
_this._configureAdapters();
return _this;
}
Object.defineProperty(ClassDirective.prototype, "ngClassBase", {
set: /**
* Intercept ngClass assignments so we cache the default classes
* which are merged with activated styles or used as fallbacks.
* Note: Base ngClass values are applied during ngDoCheck()
* @param {?} val
* @return {?}
*/
function (val) {
var /** @type {?} */ key = 'ngClass';
this._base.cacheInput(key, val, true);
this._ngClassInstance.ngClass = this._base.queryInput(key);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "klazz", {
set: /**
* Capture class assignments so we cache the default classes
* which are merged with activated styles and used as fallbacks.
* @param {?} val
* @return {?}
*/
function (val) {
var /** @type {?} */ key = 'class';
this._base.cacheInput(key, val);
this._ngClassInstance.klass = val;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassXs', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassSm', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassMd', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassLg', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassXl', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassLtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassLtSm', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassLtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassLtMd', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassLtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassLtLg', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassLtXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassLtXl', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassGtXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassGtXs', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassGtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassGtSm', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassGtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassGtMd', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(ClassDirective.prototype, "ngClassGtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngClassGtLg', val, true); },
enumerable: true,
configurable: true
});
// ******************************************************************
// Lifecycle Hooks
// ******************************************************************
/**
* For @Input changes on the current mq activation property
*/
/**
* For \@Input changes on the current mq activation property
* @param {?} changes
* @return {?}
*/
ClassDirective.prototype.ngOnChanges = /**
* For \@Input changes on the current mq activation property
* @param {?} changes
* @return {?}
*/
function (changes) {
if (this._base.activeKey in changes) {
this._ngClassInstance.ngClass = this._base.mqActivation.activatedInput || '';
}
};
/**
* @return {?}
*/
ClassDirective.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._configureMQListener();
};
/**
* For ChangeDetectionStrategy.onPush and ngOnChanges() updates
*/
/**
* For ChangeDetectionStrategy.onPush and ngOnChanges() updates
* @return {?}
*/
ClassDirective.prototype.ngDoCheck = /**
* For ChangeDetectionStrategy.onPush and ngOnChanges() updates
* @return {?}
*/
function () {
this._ngClassInstance.ngDoCheck();
};
/**
* @return {?}
*/
ClassDirective.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._base.ngOnDestroy();
delete this._ngClassInstance;
};
// ******************************************************************
// Internal Methods
// ******************************************************************
/**
* Configure adapters (that delegate to an internal ngClass instance) if responsive
* keys have been defined.
*/
/**
* Configure adapters (that delegate to an internal ngClass instance) if responsive
* keys have been defined.
* @return {?}
*/
ClassDirective.prototype._configureAdapters = /**
* Configure adapters (that delegate to an internal ngClass instance) if responsive
* keys have been defined.
* @return {?}
*/
function () {
this._base = new _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["BaseFxDirectiveAdapter"]('ngClass', this.monitor, this._ngEl, this._styler);
if (!this._ngClassInstance) {
// Create an instance NgClass Directive instance only if `ngClass=""` has NOT been defined on
// the same host element; since the responsive variations may be defined...
this._ngClassInstance = new _angular_common__WEBPACK_IMPORTED_MODULE_2__["NgClass"](this._iterableDiffers, this._keyValueDiffers, this._ngEl, this._renderer);
}
};
/**
* Build an mqActivation object that bridges mql change events to onMediaQueryChange handlers
* NOTE: We delegate subsequent activity to the NgClass logic
* Identify the activated input value and update the ngClass iterables...
* Use ngDoCheck() to actually apply the values to the element
*/
/**
* Build an mqActivation object that bridges mql change events to onMediaQueryChange handlers
* NOTE: We delegate subsequent activity to the NgClass logic
* Identify the activated input value and update the ngClass iterables...
* Use ngDoCheck() to actually apply the values to the element
* @param {?=} baseKey
* @return {?}
*/
ClassDirective.prototype._configureMQListener = /**
* Build an mqActivation object that bridges mql change events to onMediaQueryChange handlers
* NOTE: We delegate subsequent activity to the NgClass logic
* Identify the activated input value and update the ngClass iterables...
* Use ngDoCheck() to actually apply the values to the element
* @param {?=} baseKey
* @return {?}
*/
function (baseKey) {
var _this = this;
if (baseKey === void 0) { baseKey = 'ngClass'; }
var /** @type {?} */ fallbackValue = this._base.queryInput(baseKey);
this._base.listenForMediaQueryChanges(baseKey, fallbackValue, function (changes) {
_this._ngClassInstance.ngClass = changes.value || '';
_this._ngClassInstance.ngDoCheck();
});
};
ClassDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: "\n [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl],\n [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl],\n [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]\n "
},] },
];
/** @nocollapse */
ClassDirective.ctorParameters = function () { return [
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["MediaMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["KeyValueDiffers"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"], },
{ type: _angular_common__WEBPACK_IMPORTED_MODULE_2__["NgClass"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] },] },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["StyleUtils"], },
]; };
ClassDirective.propDecorators = {
"ngClassBase": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass',] },],
"klazz": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['class',] },],
"ngClassXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.xs',] },],
"ngClassSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.sm',] },],
"ngClassMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.md',] },],
"ngClassLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.lg',] },],
"ngClassXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.xl',] },],
"ngClassLtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.lt-sm',] },],
"ngClassLtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.lt-md',] },],
"ngClassLtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.lt-lg',] },],
"ngClassLtXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.lt-xl',] },],
"ngClassGtXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.gt-xs',] },],
"ngClassGtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.gt-sm',] },],
"ngClassGtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.gt-md',] },],
"ngClassGtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngClass.gt-lg',] },],
};
return ClassDirective;
}(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["BaseFxDirective"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ FALSY = ['false', false, 0];
/**
* For fxHide selectors, we invert the 'value'
* and assign to the equivalent fxShow selector cache
* - When 'hide' === '' === true, do NOT show the element
* - When 'hide' === false or 0... we WILL show the element
* @param {?} hide
* @return {?}
*/
function negativeOf(hide) {
return (hide === '') ? false :
((hide === 'false') || (hide === 0)) ? true : !hide;
}
/**
* 'show' Layout API directive
*
*/
var ShowHideDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ShowHideDirective, _super);
/* tslint:enable */
/**
*
*/
function ShowHideDirective(monitor, layout, elRef, styleUtils, platformId, serverModuleLoaded) {
var _this = _super.call(this, monitor, elRef, styleUtils) || this;
_this.layout = layout;
_this.elRef = elRef;
_this.styleUtils = styleUtils;
_this.platformId = platformId;
_this.serverModuleLoaded = serverModuleLoaded;
if (layout) {
/**
* The Layout can set the display:flex (and incorrectly affect the Hide/Show directives.
* Whenever Layout [on the same element] resets its CSS, then update the Hide/Show CSS
*/
/**
* The Layout can set the display:flex (and incorrectly affect the Hide/Show directives.
* Whenever Layout [on the same element] resets its CSS, then update the Hide/Show CSS
*/
_this._layoutWatcher = layout.layout$.subscribe(function () { return _this._updateWithValue(); });
}
return _this;
}
Object.defineProperty(ShowHideDirective.prototype, "show", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('show', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showLtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showLtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showLtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showLtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showLtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showLtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showLtXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showLtXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showGtXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showGtXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showGtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showGtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showGtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showGtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "showGtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showGtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hide", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('show', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showXs', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showSm', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showMd', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showLg', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showXl', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideLtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showLtSm', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideLtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showLtMd', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideLtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showLtLg', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideLtXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showLtXl', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideGtXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showGtXs', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideGtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showGtSm', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideGtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showGtMd', negativeOf(val)); },
enumerable: true,
configurable: true
});
Object.defineProperty(ShowHideDirective.prototype, "hideGtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('showGtLg', negativeOf(val)); },
enumerable: true,
configurable: true
});
// *********************************************
// Lifecycle Methods
// *********************************************
/**
* Override accessor to the current HTMLElement's `display` style
* Note: Show/Hide will not change the display to 'flex' but will set it to 'block'
* unless it was already explicitly specified inline or in a CSS stylesheet.
*/
/**
* Override accessor to the current HTMLElement's `display` style
* Note: Show/Hide will not change the display to 'flex' but will set it to 'block'
* unless it was already explicitly specified inline or in a CSS stylesheet.
* @return {?}
*/
ShowHideDirective.prototype._getDisplayStyle = /**
* Override accessor to the current HTMLElement's `display` style
* Note: Show/Hide will not change the display to 'flex' but will set it to 'block'
* unless it was already explicitly specified inline or in a CSS stylesheet.
* @return {?}
*/
function () {
return this.layout ? 'flex' : _super.prototype._getDisplayStyle.call(this);
};
/**
* On changes to any @Input properties...
* Default to use the non-responsive Input value ('fxShow')
* Then conditionally override with the mq-activated Input's current value
*/
/**
* On changes to any \@Input properties...
* Default to use the non-responsive Input value ('fxShow')
* Then conditionally override with the mq-activated Input's current value
* @param {?} changes
* @return {?}
*/
ShowHideDirective.prototype.ngOnChanges = /**
* On changes to any \@Input properties...
* Default to use the non-responsive Input value ('fxShow')
* Then conditionally override with the mq-activated Input's current value
* @param {?} changes
* @return {?}
*/
function (changes) {
if (this.hasInitialized && (changes['show'] != null || this._mqActivation)) {
this._updateWithValue();
}
};
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
*/
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
ShowHideDirective.prototype.ngOnInit = /**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
function () {
var _this = this;
_super.prototype.ngOnInit.call(this);
var /** @type {?} */ value = this._getDefaultVal('show', true);
// Build _mqActivation controller
this._listenForMediaQueryChanges('show', value, function (changes) {
_this._updateWithValue(changes.value);
});
this._updateWithValue();
};
/**
* @return {?}
*/
ShowHideDirective.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
_super.prototype.ngOnDestroy.call(this);
if (this._layoutWatcher) {
this._layoutWatcher.unsubscribe();
}
};
// *********************************************
// Protected methods
// *********************************************
/** Validate the visibility value and then update the host's inline display style */
/**
* Validate the visibility value and then update the host's inline display style
* @param {?=} value
* @return {?}
*/
ShowHideDirective.prototype._updateWithValue = /**
* Validate the visibility value and then update the host's inline display style
* @param {?=} value
* @return {?}
*/
function (value) {
value = value || this._getDefaultVal('show', true);
if (this._mqActivation) {
value = this._mqActivation.activatedInput;
}
var /** @type {?} */ shouldShow = this._validateTruthy(value);
this._applyStyleToElement(this._buildCSS(shouldShow));
if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_2__["isPlatformServer"])(this.platformId) && this.serverModuleLoaded) {
this.nativeElement.style.setProperty('display', '');
}
};
/** Build the CSS that should be assigned to the element instance */
/**
* Build the CSS that should be assigned to the element instance
* @param {?} show
* @return {?}
*/
ShowHideDirective.prototype._buildCSS = /**
* Build the CSS that should be assigned to the element instance
* @param {?} show
* @return {?}
*/
function (show) {
return { 'display': show ? this._display : 'none' };
};
/** Validate the to be not FALSY */
/**
* Validate the to be not FALSY
* @param {?} show
* @return {?}
*/
ShowHideDirective.prototype._validateTruthy = /**
* Validate the to be not FALSY
* @param {?} show
* @return {?}
*/
function (show) {
return (FALSY.indexOf(show) == -1);
};
ShowHideDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: "\n [fxShow],\n [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl],\n [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl],\n [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg],\n [fxHide],\n [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl],\n [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl],\n [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]\n"
},] },
];
/** @nocollapse */
ShowHideDirective.ctorParameters = function () { return [
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["MediaMonitor"], },
{ type: _angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__["LayoutDirective"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["StyleUtils"], },
{ type: Object, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"],] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["SERVER_TOKEN"],] },] },
]; };
ShowHideDirective.propDecorators = {
"show": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow',] },],
"showXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.xs',] },],
"showSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.sm',] },],
"showMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.md',] },],
"showLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.lg',] },],
"showXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.xl',] },],
"showLtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.lt-sm',] },],
"showLtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.lt-md',] },],
"showLtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.lt-lg',] },],
"showLtXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.lt-xl',] },],
"showGtXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.gt-xs',] },],
"showGtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.gt-sm',] },],
"showGtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.gt-md',] },],
"showGtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShow.gt-lg',] },],
"hide": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide',] },],
"hideXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.xs',] },],
"hideSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.sm',] },],
"hideMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.md',] },],
"hideLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.lg',] },],
"hideXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.xl',] },],
"hideLtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.lt-sm',] },],
"hideLtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.lt-md',] },],
"hideLtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.lt-lg',] },],
"hideLtXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.lt-xl',] },],
"hideGtXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.gt-xs',] },],
"hideGtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.gt-sm',] },],
"hideGtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.gt-md',] },],
"hideGtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxHide.gt-lg',] },],
};
return ShowHideDirective;
}(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["BaseFxDirective"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Extends an object with the *enumerable* and *own* properties of one or more source objects,
* similar to Object.assign.
*
* @param {?} dest The object which will have properties copied to it.
* @param {...?} sources The source objects from which properties will be copied.
* @return {?}
*/
function extendObject(dest) {
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
if (dest == null) {
throw TypeError('Cannot convert undefined or null to object');
}
for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) {
var source = sources_1[_a];
if (source != null) {
for (var /** @type {?} */ key in source) {
if (source.hasOwnProperty(key)) {
dest[key] = source[key];
}
}
}
}
return dest;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* NgStyle allowed inputs
*/
var /**
* NgStyle allowed inputs
*/
NgStyleKeyValue = /** @class */ (function () {
function NgStyleKeyValue(key, value, noQuotes) {
if (noQuotes === void 0) { noQuotes = true; }
this.key = key;
this.value = value;
this.key = noQuotes ? key.replace(/['"]/g, '').trim() : key.trim();
this.value = noQuotes ? value.replace(/['"]/g, '').trim() : value.trim();
this.value = this.value.replace(/;/, '');
}
return NgStyleKeyValue;
}());
/**
* Transform Operators for \@angular/flex-layout NgStyle Directive
*/
var /** @type {?} */ ngStyleUtils = {
getType: getType,
buildRawList: buildRawList,
buildMapFromList: buildMapFromList,
buildMapFromSet: buildMapFromSet
};
/**
* @param {?} target
* @return {?}
*/
function getType(target) {
var /** @type {?} */ what = typeof target;
if (what === 'object') {
return (target.constructor === Array) ? 'array' :
(target.constructor === Set) ? 'set' : 'object';
}
return what;
}
/**
* Split string of key:value pairs into Array of k-v pairs
* e.g. 'key:value; key:value; key:value;' -> ['key:value',...]
* @param {?} source
* @param {?=} delimiter
* @return {?}
*/
function buildRawList(source, delimiter) {
if (delimiter === void 0) { delimiter = ';'; }
return String(source)
.trim()
.split(delimiter)
.map(function (val) { return val.trim(); })
.filter(function (val) { return val !== ''; });
}
/**
* Convert array of key:value strings to a iterable map object
* @param {?} styles
* @param {?=} sanitize
* @return {?}
*/
function buildMapFromList(styles, sanitize) {
var /** @type {?} */ sanitizeValue = function (it) {
if (sanitize) {
it.value = sanitize(it.value);
}
return it;
};
return styles
.map(stringToKeyValue)
.filter(function (entry) { return !!entry; })
.map(sanitizeValue)
.reduce(keyValuesToMap, {});
}
/**
* Convert Set<string> or raw Object to an iterable NgStyleMap
* @param {?} source
* @param {?=} sanitize
* @return {?}
*/
function buildMapFromSet(source, sanitize) {
var /** @type {?} */ list = new Array();
if (getType(source) == 'set') {
source.forEach(function (entry) { return list.push(entry); });
}
else {
// simple hashmap
Object.keys(source).forEach(function (key) {
list.push(key + ":" + source[key]);
});
}
return buildMapFromList(list, sanitize);
}
/**
* Convert 'key:value' -> [key, value]
* @param {?} it
* @return {?}
*/
function stringToKeyValue(it) {
var _a = it.split(':'), key = _a[0], val = _a[1];
return val ? new NgStyleKeyValue(key, val) : null;
}
/**
* Convert [ [key,value] ] -> { key : value }
* @param {?} map
* @param {?} entry
* @return {?}
*/
function keyValuesToMap(map, entry) {
if (!!entry.key) {
map[entry.key] = entry.value;
}
return map;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Directive to add responsive support for ngStyle.
*
*/
var StyleDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(StyleDirective, _super);
/* tslint:enable */
/**
* Constructor for the ngStyle subclass; which adds selectors and
* a MediaQuery Activation Adapter
*/
function StyleDirective(monitor, _sanitizer, _ngEl, _renderer, _differs, _ngStyleInstance, _styler) {
var _this = _super.call(this, monitor, _ngEl, _styler) || this;
_this.monitor = monitor;
_this._sanitizer = _sanitizer;
_this._ngEl = _ngEl;
_this._renderer = _renderer;
_this._differs = _differs;
_this._ngStyleInstance = _ngStyleInstance;
_this._styler = _styler;
_this._configureAdapters();
return _this;
}
Object.defineProperty(StyleDirective.prototype, "ngStyleBase", {
set: /**
* Intercept ngStyle assignments so we cache the default styles
* which are merged with activated styles or used as fallbacks.
* @param {?} val
* @return {?}
*/
function (val) {
var /** @type {?} */ key = 'ngStyle';
this._base.cacheInput(key, val, true); // convert val to hashmap
this._ngStyleInstance.ngStyle = this._base.queryInput(key);
},
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleXs', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleSm', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleMd', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleLg', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleXl', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleLtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleLtSm', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleLtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleLtMd', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleLtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleLtLg', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleLtXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleLtXl', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleGtXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleGtXs', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleGtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleGtSm', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleGtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleGtMd', val, true); },
enumerable: true,
configurable: true
});
Object.defineProperty(StyleDirective.prototype, "ngStyleGtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._base.cacheInput('ngStyleGtLg', val, true); },
enumerable: true,
configurable: true
});
// ******************************************************************
// Lifecycle Hooks
// ******************************************************************
/**
* For @Input changes on the current mq activation property
*/
/**
* For \@Input changes on the current mq activation property
* @param {?} changes
* @return {?}
*/
StyleDirective.prototype.ngOnChanges = /**
* For \@Input changes on the current mq activation property
* @param {?} changes
* @return {?}
*/
function (changes) {
if (this._base.activeKey in changes) {
this._ngStyleInstance.ngStyle = this._base.mqActivation.activatedInput || '';
}
};
/**
* @return {?}
*/
StyleDirective.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._configureMQListener();
};
/**
* For ChangeDetectionStrategy.onPush and ngOnChanges() updates
*/
/**
* For ChangeDetectionStrategy.onPush and ngOnChanges() updates
* @return {?}
*/
StyleDirective.prototype.ngDoCheck = /**
* For ChangeDetectionStrategy.onPush and ngOnChanges() updates
* @return {?}
*/
function () {
this._ngStyleInstance.ngDoCheck();
};
/**
* @return {?}
*/
StyleDirective.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._base.ngOnDestroy();
delete this._ngStyleInstance;
};
// ******************************************************************
// Internal Methods
// ******************************************************************
/**
* Configure adapters (that delegate to an internal ngClass instance) if responsive
* keys have been defined.
*/
/**
* Configure adapters (that delegate to an internal ngClass instance) if responsive
* keys have been defined.
* @return {?}
*/
StyleDirective.prototype._configureAdapters = /**
* Configure adapters (that delegate to an internal ngClass instance) if responsive
* keys have been defined.
* @return {?}
*/
function () {
this._base = new _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["BaseFxDirectiveAdapter"]('ngStyle', this.monitor, this._ngEl, this._styler);
if (!this._ngStyleInstance) {
// Create an instance NgClass Directive instance only if `ngClass=""` has NOT been
// defined on the same host element; since the responsive variations may be defined...
this._ngStyleInstance = new _angular_common__WEBPACK_IMPORTED_MODULE_2__["NgStyle"](this._differs, this._ngEl, this._renderer);
}
this._buildCacheInterceptor();
this._fallbackToStyle();
};
/**
* Build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
*/
/**
* Build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @param {?=} baseKey
* @return {?}
*/
StyleDirective.prototype._configureMQListener = /**
* Build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @param {?=} baseKey
* @return {?}
*/
function (baseKey) {
var _this = this;
if (baseKey === void 0) { baseKey = 'ngStyle'; }
var /** @type {?} */ fallbackValue = this._base.queryInput(baseKey);
this._base.listenForMediaQueryChanges(baseKey, fallbackValue, function (changes) {
_this._ngStyleInstance.ngStyle = changes.value || '';
_this._ngStyleInstance.ngDoCheck();
});
};
// ************************************************************************
// Private Internal Methods
// ************************************************************************
/**
* Build intercept to convert raw strings to ngStyleMap
*/
/**
* Build intercept to convert raw strings to ngStyleMap
* @return {?}
*/
StyleDirective.prototype._buildCacheInterceptor = /**
* Build intercept to convert raw strings to ngStyleMap
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ cacheInput = this._base.cacheInput.bind(this._base);
this._base.cacheInput = function (key, source, cacheRaw, merge) {
if (cacheRaw === void 0) { cacheRaw = false; }
if (merge === void 0) { merge = true; }
var /** @type {?} */ styles = _this._buildStyleMap(source);
if (merge) {
styles = extendObject({}, _this._base.inputMap['ngStyle'], styles);
}
cacheInput(key, styles, cacheRaw);
};
};
/**
* Convert raw strings to ngStyleMap; which is required by ngStyle
* NOTE: Raw string key-value pairs MUST be delimited by `;`
* Comma-delimiters are not supported due to complexities of
* possible style values such as `rgba(x,x,x,x)` and others
*/
/**
* Convert raw strings to ngStyleMap; which is required by ngStyle
* NOTE: Raw string key-value pairs MUST be delimited by `;`
* Comma-delimiters are not supported due to complexities of
* possible style values such as `rgba(x,x,x,x)` and others
* @param {?} styles
* @return {?}
*/
StyleDirective.prototype._buildStyleMap = /**
* Convert raw strings to ngStyleMap; which is required by ngStyle
* NOTE: Raw string key-value pairs MUST be delimited by `;`
* Comma-delimiters are not supported due to complexities of
* possible style values such as `rgba(x,x,x,x)` and others
* @param {?} styles
* @return {?}
*/
function (styles) {
var _this = this;
var /** @type {?} */ sanitizer = function (val) {
// Always safe-guard (aka sanitize) style property values
return _this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].STYLE, val) || '';
};
if (styles) {
switch (ngStyleUtils.getType(styles)) {
case 'string': return ngStyleUtils.buildMapFromList(ngStyleUtils.buildRawList(styles), sanitizer);
case 'array': return ngStyleUtils.buildMapFromList(/** @type {?} */ (styles), sanitizer);
case 'set': return ngStyleUtils.buildMapFromSet(styles, sanitizer);
default: return ngStyleUtils.buildMapFromSet(styles, sanitizer);
}
}
return styles;
};
/**
* Initial lookup of raw 'class' value (if any)
*/
/**
* Initial lookup of raw 'class' value (if any)
* @return {?}
*/
StyleDirective.prototype._fallbackToStyle = /**
* Initial lookup of raw 'class' value (if any)
* @return {?}
*/
function () {
if (!this._base.queryInput('ngStyle')) {
this.ngStyleBase = this._getAttributeValue('style') || '';
}
};
StyleDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: "\n [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl],\n [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl],\n [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]\n "
},] },
];
/** @nocollapse */
StyleDirective.ctorParameters = function () { return [
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["MediaMonitor"], },
{ type: _angular_platform_browser__WEBPACK_IMPORTED_MODULE_5__["DomSanitizer"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["KeyValueDiffers"], },
{ type: _angular_common__WEBPACK_IMPORTED_MODULE_2__["NgStyle"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] },] },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["StyleUtils"], },
]; };
StyleDirective.propDecorators = {
"ngStyleBase": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle',] },],
"ngStyleXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.xs',] },],
"ngStyleSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.sm',] },],
"ngStyleMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.md',] },],
"ngStyleLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.lg',] },],
"ngStyleXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.xl',] },],
"ngStyleLtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.lt-sm',] },],
"ngStyleLtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.lt-md',] },],
"ngStyleLtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.lt-lg',] },],
"ngStyleLtXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.lt-xl',] },],
"ngStyleGtXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.gt-xs',] },],
"ngStyleGtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.gt-sm',] },],
"ngStyleGtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.gt-md',] },],
"ngStyleGtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngStyle.gt-lg',] },],
};
return StyleDirective;
}(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["BaseFxDirective"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ ALL_DIRECTIVES = [
ShowHideDirective,
ClassDirective,
StyleDirective,
ImgSrcDirective
];
/**
* *****************************************************************
* Define module for the Extended API
* *****************************************************************
*/
var ExtendedModule = /** @class */ (function () {
function ExtendedModule() {
}
ExtendedModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_3__["CoreModule"]],
declarations: ALL_DIRECTIVES.slice(),
exports: ALL_DIRECTIVES.slice()
},] },
];
/** @nocollapse */
ExtendedModule.ctorParameters = function () { return []; };
return ExtendedModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=extended.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/flex-layout/esm5/flex-layout.es5.js":
/*!*******************************************************************!*\
!*** ./node_modules/@angular/flex-layout/esm5/flex-layout.es5.js ***!
\*******************************************************************/
/*! exports provided: ɵb, ɵa, ɵe, ɵd, ɵc, removeStyles, BROWSER_PROVIDER, CLASS_NAME, CoreModule, MediaQueriesModule, MediaChange, StylesheetMap, STYLESHEET_MAP_PROVIDER_FACTORY, STYLESHEET_MAP_PROVIDER, ADD_FLEX_STYLES, SERVER_TOKEN, DISABLE_DEFAULT_BREAKPOINTS, ADD_ORIENTATION_BREAKPOINTS, BREAKPOINT, DISABLE_VENDOR_PREFIXES, BaseFxDirective, BaseFxDirectiveAdapter, RESPONSIVE_ALIASES, DEFAULT_BREAKPOINTS, ScreenTypes, ORIENTATION_BREAKPOINTS, BreakPointRegistry, buildMergedBreakPoints, DEFAULT_BREAKPOINTS_PROVIDER_FACTORY, DEFAULT_BREAKPOINTS_PROVIDER, BREAKPOINTS_PROVIDER_FACTORY, BREAKPOINTS_PROVIDER, CUSTOM_BREAKPOINTS_PROVIDER_FACTORY, BREAKPOINTS, MatchMedia, MockMatchMedia, MockMediaQueryList, MockMatchMediaProvider, ServerMediaQueryList, ServerMatchMedia, MediaMonitor, MEDIA_MONITOR_PROVIDER_FACTORY, MEDIA_MONITOR_PROVIDER, ObservableMedia, MediaService, OBSERVABLE_MEDIA_PROVIDER_FACTORY, OBSERVABLE_MEDIA_PROVIDER, KeyOptions, ResponsiveActivation, StyleUtils, ExtendedModule, ClassDirective, ImgSrcDirective, negativeOf, ShowHideDirective, StyleDirective, FlexModule, FlexDirective, FlexAlignDirective, FlexFillDirective, FlexOffsetDirective, FlexOrderDirective, LayoutDirective, LayoutAlignDirective, LayoutGapDirective, VERSION, FlexLayoutModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FlexLayoutModule", function() { return FlexLayoutModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/flex-layout/core */ "./node_modules/@angular/flex-layout/esm5/core.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵb", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ɵb"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵa", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ɵa"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵe", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ɵe"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵd", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ɵd"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵc", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ɵc"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeStyles", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["removeStyles"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BROWSER_PROVIDER", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BROWSER_PROVIDER"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CLASS_NAME", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["CLASS_NAME"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CoreModule", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["CoreModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaQueriesModule", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MediaQueriesModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaChange", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MediaChange"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StylesheetMap", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["StylesheetMap"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "STYLESHEET_MAP_PROVIDER_FACTORY", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["STYLESHEET_MAP_PROVIDER_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "STYLESHEET_MAP_PROVIDER", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["STYLESHEET_MAP_PROVIDER"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ADD_FLEX_STYLES", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ADD_FLEX_STYLES"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SERVER_TOKEN", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["SERVER_TOKEN"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DISABLE_DEFAULT_BREAKPOINTS", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["DISABLE_DEFAULT_BREAKPOINTS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ADD_ORIENTATION_BREAKPOINTS", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ADD_ORIENTATION_BREAKPOINTS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BREAKPOINT", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BREAKPOINT"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DISABLE_VENDOR_PREFIXES", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["DISABLE_VENDOR_PREFIXES"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseFxDirective", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BaseFxDirective"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseFxDirectiveAdapter", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BaseFxDirectiveAdapter"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RESPONSIVE_ALIASES", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["RESPONSIVE_ALIASES"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_BREAKPOINTS", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["DEFAULT_BREAKPOINTS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ScreenTypes", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ScreenTypes"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ORIENTATION_BREAKPOINTS", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ORIENTATION_BREAKPOINTS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BreakPointRegistry", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BreakPointRegistry"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildMergedBreakPoints", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["buildMergedBreakPoints"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_BREAKPOINTS_PROVIDER_FACTORY", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["DEFAULT_BREAKPOINTS_PROVIDER_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_BREAKPOINTS_PROVIDER", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["DEFAULT_BREAKPOINTS_PROVIDER"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BREAKPOINTS_PROVIDER_FACTORY", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BREAKPOINTS_PROVIDER_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BREAKPOINTS_PROVIDER", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BREAKPOINTS_PROVIDER"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CUSTOM_BREAKPOINTS_PROVIDER_FACTORY", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["CUSTOM_BREAKPOINTS_PROVIDER_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BREAKPOINTS", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BREAKPOINTS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatchMedia", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MatchMedia"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MockMatchMedia", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MockMatchMedia"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MockMediaQueryList", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MockMediaQueryList"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MockMatchMediaProvider", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MockMatchMediaProvider"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ServerMediaQueryList", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ServerMediaQueryList"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ServerMatchMedia", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ServerMatchMedia"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaMonitor", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MediaMonitor"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MEDIA_MONITOR_PROVIDER_FACTORY", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MEDIA_MONITOR_PROVIDER_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MEDIA_MONITOR_PROVIDER", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MEDIA_MONITOR_PROVIDER"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObservableMedia", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ObservableMedia"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaService", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MediaService"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OBSERVABLE_MEDIA_PROVIDER_FACTORY", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["OBSERVABLE_MEDIA_PROVIDER_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OBSERVABLE_MEDIA_PROVIDER", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["OBSERVABLE_MEDIA_PROVIDER"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KeyOptions", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["KeyOptions"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveActivation", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ResponsiveActivation"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StyleUtils", function() { return _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["StyleUtils"]; });
/* harmony import */ var _angular_flex_layout_extended__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/flex-layout/extended */ "./node_modules/@angular/flex-layout/esm5/extended.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ExtendedModule", function() { return _angular_flex_layout_extended__WEBPACK_IMPORTED_MODULE_3__["ExtendedModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClassDirective", function() { return _angular_flex_layout_extended__WEBPACK_IMPORTED_MODULE_3__["ClassDirective"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ImgSrcDirective", function() { return _angular_flex_layout_extended__WEBPACK_IMPORTED_MODULE_3__["ImgSrcDirective"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "negativeOf", function() { return _angular_flex_layout_extended__WEBPACK_IMPORTED_MODULE_3__["negativeOf"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShowHideDirective", function() { return _angular_flex_layout_extended__WEBPACK_IMPORTED_MODULE_3__["ShowHideDirective"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StyleDirective", function() { return _angular_flex_layout_extended__WEBPACK_IMPORTED_MODULE_3__["StyleDirective"]; });
/* harmony import */ var _angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/flex-layout/flex */ "./node_modules/@angular/flex-layout/esm5/flex.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FlexModule", function() { return _angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__["FlexModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FlexDirective", function() { return _angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__["FlexDirective"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FlexAlignDirective", function() { return _angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__["FlexAlignDirective"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FlexFillDirective", function() { return _angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__["FlexFillDirective"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FlexOffsetDirective", function() { return _angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__["FlexOffsetDirective"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FlexOrderDirective", function() { return _angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__["FlexOrderDirective"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LayoutDirective", function() { return _angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__["LayoutDirective"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LayoutAlignDirective", function() { return _angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__["LayoutAlignDirective"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LayoutGapDirective", function() { return _angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__["LayoutGapDirective"]; });
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Current version of Angular Flex-Layout.
*/
var /** @type {?} */ VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Version"]('5.0.0-beta.13-3e5820d');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
*
*/
var FlexLayoutModule = /** @class */ (function () {
function FlexLayoutModule(serverModuleLoaded, platformId) {
if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_1__["isPlatformServer"])(platformId) && !serverModuleLoaded) {
console.warn('Warning: Flex Layout loaded on the server without FlexLayoutServerModule');
}
}
/**
* External uses can easily add custom breakpoints AND include internal orientations
* breakpoints; which are not available by default.
*
* !! Selector aliases are not auto-configured. Developers must subclass
* the API directives to support extra selectors for the orientations breakpoints !!
* @deprecated use BREAKPOINT multi-provider instead
* @deletion-target v6.0.0-beta.15
*/
/**
* External uses can easily add custom breakpoints AND include internal orientations
* breakpoints; which are not available by default.
*
* !! Selector aliases are not auto-configured. Developers must subclass
* the API directives to support extra selectors for the orientations breakpoints !!
* @deprecated use BREAKPOINT multi-provider instead
* \@deletion-target v6.0.0-beta.15
* @param {?} breakpoints
* @param {?=} options
* @return {?}
*/
FlexLayoutModule.provideBreakPoints = /**
* External uses can easily add custom breakpoints AND include internal orientations
* breakpoints; which are not available by default.
*
* !! Selector aliases are not auto-configured. Developers must subclass
* the API directives to support extra selectors for the orientations breakpoints !!
* @deprecated use BREAKPOINT multi-provider instead
* \@deletion-target v6.0.0-beta.15
* @param {?} breakpoints
* @param {?=} options
* @return {?}
*/
function (breakpoints, options) {
return {
ngModule: FlexLayoutModule,
providers: [
Object(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["CUSTOM_BREAKPOINTS_PROVIDER_FACTORY"])(breakpoints, options || { orientations: false })
]
};
};
FlexLayoutModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [_angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__["FlexModule"], _angular_flex_layout_extended__WEBPACK_IMPORTED_MODULE_3__["ExtendedModule"], _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["CoreModule"]],
exports: [_angular_flex_layout_flex__WEBPACK_IMPORTED_MODULE_4__["FlexModule"], _angular_flex_layout_extended__WEBPACK_IMPORTED_MODULE_3__["ExtendedModule"], _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["CoreModule"]]
},] },
];
/** @nocollapse */
FlexLayoutModule.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["SERVER_TOKEN"],] },] },
{ type: Object, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"],] },] },
]; };
return FlexLayoutModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=flex-layout.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/flex-layout/esm5/flex.es5.js":
/*!************************************************************!*\
!*** ./node_modules/@angular/flex-layout/esm5/flex.es5.js ***!
\************************************************************/
/*! exports provided: FlexModule, FlexDirective, FlexAlignDirective, FlexFillDirective, FlexOffsetDirective, FlexOrderDirective, LayoutDirective, LayoutAlignDirective, LayoutGapDirective */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FlexModule", function() { return FlexModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FlexDirective", function() { return FlexDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FlexAlignDirective", function() { return FlexAlignDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FlexFillDirective", function() { return FlexFillDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FlexOffsetDirective", function() { return FlexOffsetDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FlexOrderDirective", function() { return FlexOrderDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LayoutDirective", function() { return LayoutDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LayoutAlignDirective", function() { return LayoutAlignDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LayoutGapDirective", function() { return LayoutGapDirective; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/flex-layout/core */ "./node_modules/@angular/flex-layout/esm5/core.es5.js");
/* harmony import */ var rxjs_ReplaySubject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/ReplaySubject */ "./node_modules/rxjs-compat/_esm5/ReplaySubject.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ INLINE = 'inline';
var /** @type {?} */ LAYOUT_VALUES = ['row', 'column', 'row-reverse', 'column-reverse'];
/**
* Validate the direction|'direction wrap' value and then update the host's inline flexbox styles
* @param {?} value
* @return {?}
*/
function buildLayoutCSS(value) {
var _a = validateValue(value), direction = _a[0], wrap = _a[1], isInline = _a[2];
return buildCSS(direction, wrap, isInline);
}
/**
* Validate the value to be one of the acceptable value options
* Use default fallback of 'row'
* @param {?} value
* @return {?}
*/
function validateValue(value) {
value = value ? value.toLowerCase() : '';
var _a = value.split(' '), direction = _a[0], wrap = _a[1], inline = _a[2];
// First value must be the `flex-direction`
if (!LAYOUT_VALUES.find(function (x) { return x === direction; })) {
direction = LAYOUT_VALUES[0];
}
if (wrap === INLINE) {
wrap = (inline !== INLINE) ? inline : '';
inline = INLINE;
}
return [direction, validateWrapValue(wrap), !!inline];
}
/**
* Determine if the validated, flex-direction value specifies
* a horizontal/row flow.
* @param {?} value
* @return {?}
*/
function isFlowHorizontal(value) {
var flow = validateValue(value)[0];
return flow.indexOf('row') > -1;
}
/**
* Convert layout-wrap='<value>' to expected flex-wrap style
* @param {?} value
* @return {?}
*/
function validateWrapValue(value) {
if (!!value) {
switch (value.toLowerCase()) {
case 'reverse':
case 'wrap-reverse':
case 'reverse-wrap':
value = 'wrap-reverse';
break;
case 'no':
case 'none':
case 'nowrap':
value = 'nowrap';
break;
// All other values fallback to 'wrap'
default:
value = 'wrap';
break;
}
}
return value;
}
/**
* Build the CSS that should be assigned to the element instance
* BUG:
* 1) min-height on a column flex container wont apply to its flex item children in IE 10-11.
* Use height instead if possible; height : <xxx>vh;
*
* This way any padding or border specified on the child elements are
* laid out and drawn inside that element's specified width and height.
* @param {?} direction
* @param {?=} wrap
* @param {?=} inline
* @return {?}
*/
function buildCSS(direction, wrap, inline) {
if (wrap === void 0) { wrap = null; }
if (inline === void 0) { inline = false; }
return {
'display': inline ? 'inline-flex' : 'flex',
'box-sizing': 'border-box',
'flex-direction': direction,
'flex-wrap': !!wrap ? wrap : null
};
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* 'layout' flexbox styling directive
* Defines the positioning flow direction for the child elements: row or column
* Optional values: column or row (default)
* @see https://css-tricks.com/almanac/properties/f/flex-direction/
*
*/
var LayoutDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LayoutDirective, _super);
/* tslint:enable */
/**
*
*/
function LayoutDirective(monitor, elRef, styleUtils) {
var _this = _super.call(this, monitor, elRef, styleUtils) || this;
_this._announcer = new rxjs_ReplaySubject__WEBPACK_IMPORTED_MODULE_3__["ReplaySubject"](1);
_this.layout$ = _this._announcer.asObservable();
return _this;
}
Object.defineProperty(LayoutDirective.prototype, "layout", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layout', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutGtXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutGtXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutGtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutGtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutGtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutGtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutGtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutGtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutLtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutLtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutLtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutLtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutLtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutLtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutDirective.prototype, "layoutLtXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('layoutLtXl', val); },
enumerable: true,
configurable: true
});
// *********************************************
// Lifecycle Methods
// *********************************************
/**
* On changes to any @Input properties...
* Default to use the non-responsive Input value ('fxLayout')
* Then conditionally override with the mq-activated Input's current value
*/
/**
* On changes to any \@Input properties...
* Default to use the non-responsive Input value ('fxLayout')
* Then conditionally override with the mq-activated Input's current value
* @param {?} changes
* @return {?}
*/
LayoutDirective.prototype.ngOnChanges = /**
* On changes to any \@Input properties...
* Default to use the non-responsive Input value ('fxLayout')
* Then conditionally override with the mq-activated Input's current value
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes['layout'] != null || this._mqActivation) {
this._updateWithDirection();
}
};
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
*/
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
LayoutDirective.prototype.ngOnInit = /**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
function () {
var _this = this;
_super.prototype.ngOnInit.call(this);
this._listenForMediaQueryChanges('layout', 'row', function (changes) {
_this._updateWithDirection(changes.value);
});
this._updateWithDirection();
};
// *********************************************
// Protected methods
// *********************************************
/**
* Validate the direction value and then update the host's inline flexbox styles
*/
/**
* Validate the direction value and then update the host's inline flexbox styles
* @param {?=} value
* @return {?}
*/
LayoutDirective.prototype._updateWithDirection = /**
* Validate the direction value and then update the host's inline flexbox styles
* @param {?=} value
* @return {?}
*/
function (value) {
value = value || this._queryInput('layout') || 'row';
if (this._mqActivation) {
value = this._mqActivation.activatedInput;
}
// Update styles and announce to subscribers the *new* direction
var /** @type {?} */ css = buildLayoutCSS(!!value ? value : '');
this._applyStyleToElement(css);
this._announcer.next({
direction: css['flex-direction'],
wrap: !!css['flex-wrap'] && css['flex-wrap'] !== 'nowrap'
});
};
LayoutDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: "\n [fxLayout],\n [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl],\n [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl],\n [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]\n" },] },
];
/** @nocollapse */
LayoutDirective.ctorParameters = function () { return [
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MediaMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["StyleUtils"], },
]; };
LayoutDirective.propDecorators = {
"layout": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout',] },],
"layoutXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.xs',] },],
"layoutSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.sm',] },],
"layoutMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.md',] },],
"layoutLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.lg',] },],
"layoutXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.xl',] },],
"layoutGtXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.gt-xs',] },],
"layoutGtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.gt-sm',] },],
"layoutGtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.gt-md',] },],
"layoutGtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.gt-lg',] },],
"layoutLtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.lt-sm',] },],
"layoutLtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.lt-md',] },],
"layoutLtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.lt-lg',] },],
"layoutLtXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayout.lt-xl',] },],
};
return LayoutDirective;
}(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BaseFxDirective"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* 'layout-padding' styling directive
* Defines padding of child elements in a layout container
*/
var LayoutGapDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LayoutGapDirective, _super);
/* tslint:enable */
function LayoutGapDirective(monitor, elRef, container, _zone, _directionality, styleUtils) {
var _this = _super.call(this, monitor, elRef, styleUtils) || this;
_this._zone = _zone;
_this._directionality = _directionality;
_this._layout = 'row';
if (container) {
// Subscribe to layout direction changes
_this._layoutWatcher = container.layout$.subscribe(_this._onLayoutChange.bind(_this));
}
_this._directionWatcher =
_this._directionality.change.subscribe(_this._updateWithValue.bind(_this));
return _this;
}
Object.defineProperty(LayoutGapDirective.prototype, "gap", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gap', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapGtXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapGtXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapGtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapGtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapGtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapGtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapGtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapGtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapLtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapLtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapLtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapLtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapLtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapLtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutGapDirective.prototype, "gapLtXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('gapLtXl', val); },
enumerable: true,
configurable: true
});
// *********************************************
// Lifecycle Methods
// *********************************************
/**
* @param {?} changes
* @return {?}
*/
LayoutGapDirective.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes['gap'] != null || this._mqActivation) {
this._updateWithValue();
}
};
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
*/
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
LayoutGapDirective.prototype.ngAfterContentInit = /**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
function () {
var _this = this;
this._watchContentChanges();
this._listenForMediaQueryChanges('gap', '0', function (changes) {
_this._updateWithValue(changes.value);
});
this._updateWithValue();
};
/**
* @return {?}
*/
LayoutGapDirective.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
_super.prototype.ngOnDestroy.call(this);
if (this._layoutWatcher) {
this._layoutWatcher.unsubscribe();
}
if (this._observer) {
this._observer.disconnect();
}
if (this._directionWatcher) {
this._directionWatcher.unsubscribe();
}
};
// *********************************************
// Protected methods
// *********************************************
/**
* Watch for child nodes to be added... and apply the layout gap styles to each.
* NOTE: this does NOT! differentiate between viewChildren and contentChildren
*/
/**
* Watch for child nodes to be added... and apply the layout gap styles to each.
* NOTE: this does NOT! differentiate between viewChildren and contentChildren
* @return {?}
*/
LayoutGapDirective.prototype._watchContentChanges = /**
* Watch for child nodes to be added... and apply the layout gap styles to each.
* NOTE: this does NOT! differentiate between viewChildren and contentChildren
* @return {?}
*/
function () {
var _this = this;
this._zone.runOutsideAngular(function () {
if (typeof MutationObserver !== 'undefined') {
_this._observer = new MutationObserver(function (mutations) {
var /** @type {?} */ validatedChanges = function (it) {
return (it.addedNodes && it.addedNodes.length > 0) ||
(it.removedNodes && it.removedNodes.length > 0);
};
// update gap styles only for child 'added' or 'removed' events
if (mutations.some(validatedChanges)) {
_this._updateWithValue();
}
});
_this._observer.observe(_this.nativeElement, { childList: true });
}
});
};
/**
* Cache the parent container 'flex-direction' and update the 'margin' styles
*/
/**
* Cache the parent container 'flex-direction' and update the 'margin' styles
* @param {?} layout
* @return {?}
*/
LayoutGapDirective.prototype._onLayoutChange = /**
* Cache the parent container 'flex-direction' and update the 'margin' styles
* @param {?} layout
* @return {?}
*/
function (layout) {
var _this = this;
this._layout = (layout.direction || '').toLowerCase();
if (!LAYOUT_VALUES.find(function (x) { return x === _this._layout; })) {
this._layout = 'row';
}
this._updateWithValue();
};
/**
*
*/
/**
*
* @param {?=} value
* @return {?}
*/
LayoutGapDirective.prototype._updateWithValue = /**
*
* @param {?=} value
* @return {?}
*/
function (value) {
var _this = this;
var /** @type {?} */ gapValue = value || this._queryInput('gap') || '0';
if (this._mqActivation) {
gapValue = this._mqActivation.activatedInput;
}
// Gather all non-hidden Element nodes
var /** @type {?} */ items = this.childrenNodes
.filter(function (el) { return el.nodeType === 1 && _this._getDisplayStyle(el) != 'none'; })
.sort(function (a, b) {
var /** @type {?} */ orderA = +_this._styler.lookupStyle(a, 'order');
var /** @type {?} */ orderB = +_this._styler.lookupStyle(b, 'order');
if (isNaN(orderA) || isNaN(orderB) || orderA === orderB) {
return 0;
}
else {
return orderA > orderB ? 1 : -1;
}
});
if (items.length > 0) {
if (gapValue.endsWith(GRID_SPECIFIER)) {
gapValue = gapValue.substring(0, gapValue.indexOf(GRID_SPECIFIER));
// For each `element` children, set the padding
this._applyStyleToElements(this._buildGridPadding(gapValue), items);
// Add the margin to the host element
this._applyStyleToElement(this._buildGridMargin(gapValue));
}
else {
var /** @type {?} */ lastItem = items.pop();
// For each `element` children EXCEPT the last,
// set the margin right/bottom styles...
this._applyStyleToElements(this._buildCSS(gapValue), items);
// Clear all gaps for all visible elements
this._applyStyleToElements(this._buildCSS(), [lastItem]);
}
}
};
/**
*
* @param {?} value
* @return {?}
*/
LayoutGapDirective.prototype._buildGridPadding = /**
*
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ paddingTop = '0px', /** @type {?} */ paddingRight = '0px', /** @type {?} */ paddingBottom = value, /** @type {?} */ paddingLeft = '0px';
if (this._directionality.value === 'rtl') {
paddingLeft = value;
}
else {
paddingRight = value;
}
return { 'padding': paddingTop + " " + paddingRight + " " + paddingBottom + " " + paddingLeft };
};
/**
* Prepare margin CSS, remove any previous explicitly
* assigned margin assignments
* Note: this will not work with calc values (negative calc values are invalid)
* @param {?} value
* @return {?}
*/
LayoutGapDirective.prototype._buildGridMargin = /**
* Prepare margin CSS, remove any previous explicitly
* assigned margin assignments
* Note: this will not work with calc values (negative calc values are invalid)
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ marginTop = '0px', /** @type {?} */ marginRight = '0px', /** @type {?} */ marginBottom = '-' + value, /** @type {?} */ marginLeft = '0px';
if (this._directionality.value === 'rtl') {
marginLeft = '-' + value;
}
else {
marginRight = '-' + value;
}
return { 'margin': marginTop + " " + marginRight + " " + marginBottom + " " + marginLeft };
};
/**
* Prepare margin CSS, remove any previous explicitly
* assigned margin assignments
* @param {?=} value
* @return {?}
*/
LayoutGapDirective.prototype._buildCSS = /**
* Prepare margin CSS, remove any previous explicitly
* assigned margin assignments
* @param {?=} value
* @return {?}
*/
function (value) {
if (value === void 0) { value = null; }
var /** @type {?} */ key, /** @type {?} */ margins = {
'margin-left': null,
'margin-right': null,
'margin-top': null,
'margin-bottom': null
};
switch (this._layout) {
case 'column':
key = 'margin-bottom';
break;
case 'column-reverse':
key = 'margin-top';
break;
case 'row':
key = this._directionality.value === 'rtl' ? 'margin-left' : 'margin-right';
break;
case 'row-reverse':
key = this._directionality.value === 'rtl' ? 'margin-right' : 'margin-left';
break;
default:
key = this._directionality.value === 'rtl' ? 'margin-left' : 'margin-right';
break;
}
margins[key] = value;
return margins;
};
LayoutGapDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: "\n [fxLayoutGap],\n [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl],\n [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl],\n [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]\n"
},] },
];
/** @nocollapse */
LayoutGapDirective.ctorParameters = function () { return [
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MediaMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: LayoutDirective, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_4__["Directionality"], },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["StyleUtils"], },
]; };
LayoutGapDirective.propDecorators = {
"gap": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap',] },],
"gapXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.xs',] },],
"gapSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.sm',] },],
"gapMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.md',] },],
"gapLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.lg',] },],
"gapXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.xl',] },],
"gapGtXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.gt-xs',] },],
"gapGtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.gt-sm',] },],
"gapGtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.gt-md',] },],
"gapGtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.gt-lg',] },],
"gapLtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.lt-sm',] },],
"gapLtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.lt-md',] },],
"gapLtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.lt-lg',] },],
"gapLtXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutGap.lt-xl',] },],
};
return LayoutGapDirective;
}(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BaseFxDirective"]));
var /** @type {?} */ GRID_SPECIFIER = ' grid';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Extends an object with the *enumerable* and *own* properties of one or more source objects,
* similar to Object.assign.
*
* @param {?} dest The object which will have properties copied to it.
* @param {...?} sources The source objects from which properties will be copied.
* @return {?}
*/
function extendObject(dest) {
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
if (dest == null) {
throw TypeError('Cannot convert undefined or null to object');
}
for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) {
var source = sources_1[_a];
if (source != null) {
for (var /** @type {?} */ key in source) {
if (source.hasOwnProperty(key)) {
dest[key] = source[key];
}
}
}
}
return dest;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* The flex API permits 3 or 1 parts of the value:
* - `flex-grow flex-shrink flex-basis`, or
* - `flex-basis`
* @param {?} basis
* @param {?=} grow
* @param {?=} shrink
* @return {?}
*/
function validateBasis(basis, grow, shrink) {
if (grow === void 0) { grow = '1'; }
if (shrink === void 0) { shrink = '1'; }
var /** @type {?} */ parts = [grow, shrink, basis];
var /** @type {?} */ j = basis.indexOf('calc');
if (j > 0) {
parts[2] = _validateCalcValue(basis.substring(j).trim());
var /** @type {?} */ matches = basis.substr(0, j).trim().split(' ');
if (matches.length == 2) {
parts[0] = matches[0];
parts[1] = matches[1];
}
}
else if (j == 0) {
parts[2] = _validateCalcValue(basis.trim());
}
else {
var /** @type {?} */ matches = basis.split(' ');
parts = (matches.length === 3) ? matches : [
grow, shrink, basis
];
}
return parts;
}
/**
* Calc expressions require whitespace before & after any expression operators
* This is a simple, crude whitespace padding solution.
* - '3 3 calc(15em + 20px)'
* - calc(100% / 7 * 2)
* - 'calc(15em + 20px)'
* - 'calc(15em+20px)'
* - '37px'
* = '43%'
* @param {?} calc
* @return {?}
*/
function _validateCalcValue(calc) {
return calc.replace(/[\s]/g, '').replace(/[\/\*\+\-]/g, ' $& ');
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Directive to control the size of a flex item using flex-basis, flex-grow, and flex-shrink.
* Corresponds to the css `flex` shorthand property.
*
* @see https://css-tricks.com/snippets/css/a-guide-to-flexbox/
*/
var FlexDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FlexDirective, _super);
/* tslint:enable */
// Note: Explicitly @SkipSelf on LayoutDirective because we are looking
// for the parent flex container for this flex item.
function FlexDirective(monitor, elRef, _container, styleUtils, addFlexStyles) {
var _this = _super.call(this, monitor, elRef, styleUtils) || this;
_this._container = _container;
_this.styleUtils = styleUtils;
_this.addFlexStyles = addFlexStyles;
_this._cacheInput('flex', '');
_this._cacheInput('shrink', 1);
_this._cacheInput('grow', 1);
if (_container) {
// If this flex item is inside of a flex container marked with
// Subscribe to layout immediate parent direction changes
// If this flex item is inside of a flex container marked with
// Subscribe to layout immediate parent direction changes
_this._layoutWatcher = _container.layout$.subscribe(function (layout) {
// `direction` === null if parent container does not have a `fxLayout`
// `direction` === null if parent container does not have a `fxLayout`
_this._onLayoutChange(layout);
});
}
return _this;
}
Object.defineProperty(FlexDirective.prototype, "shrink", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('shrink', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "grow", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('grow', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flex", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flex', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexGtXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexGtXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexGtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexGtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexGtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexGtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexGtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexGtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexLtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexLtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexLtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexLtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexLtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexLtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexDirective.prototype, "flexLtXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('flexLtXl', val); },
enumerable: true,
configurable: true
});
/**
* For @Input changes on the current mq activation property, see onMediaQueryChanges()
*/
/**
* For \@Input changes on the current mq activation property, see onMediaQueryChanges()
* @param {?} changes
* @return {?}
*/
FlexDirective.prototype.ngOnChanges = /**
* For \@Input changes on the current mq activation property, see onMediaQueryChanges()
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes['flex'] != null || this._mqActivation) {
this._updateStyle();
}
};
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
*/
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
FlexDirective.prototype.ngOnInit = /**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
function () {
var _this = this;
_super.prototype.ngOnInit.call(this);
this._listenForMediaQueryChanges('flex', '', function (changes) {
_this._updateStyle(changes.value);
});
this._updateStyle();
};
/**
* @return {?}
*/
FlexDirective.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
_super.prototype.ngOnDestroy.call(this);
if (this._layoutWatcher) {
this._layoutWatcher.unsubscribe();
}
};
/**
* Caches the parent container's 'flex-direction' and updates the element's style.
* Used as a handler for layout change events from the parent flex container.
*/
/**
* Caches the parent container's 'flex-direction' and updates the element's style.
* Used as a handler for layout change events from the parent flex container.
* @param {?=} layout
* @return {?}
*/
FlexDirective.prototype._onLayoutChange = /**
* Caches the parent container's 'flex-direction' and updates the element's style.
* Used as a handler for layout change events from the parent flex container.
* @param {?=} layout
* @return {?}
*/
function (layout) {
this._layout = layout || this._layout || { direction: 'row', wrap: false };
this._updateStyle();
};
/**
* @param {?=} value
* @return {?}
*/
FlexDirective.prototype._updateStyle = /**
* @param {?=} value
* @return {?}
*/
function (value) {
var /** @type {?} */ flexBasis = value || this._queryInput('flex') || '';
if (this._mqActivation) {
flexBasis = this._mqActivation.activatedInput;
}
var /** @type {?} */ basis = String(flexBasis).replace(';', '');
var /** @type {?} */ parts = validateBasis(basis, this._queryInput('grow'), this._queryInput('shrink'));
this._applyStyleToElement(this._validateValue.apply(this, parts));
};
/**
* Validate the value to be one of the acceptable value options
* Use default fallback of 'row'
*/
/**
* Validate the value to be one of the acceptable value options
* Use default fallback of 'row'
* @param {?} grow
* @param {?} shrink
* @param {?} basis
* @return {?}
*/
FlexDirective.prototype._validateValue = /**
* Validate the value to be one of the acceptable value options
* Use default fallback of 'row'
* @param {?} grow
* @param {?} shrink
* @param {?} basis
* @return {?}
*/
function (grow, shrink, basis) {
// The flex-direction of this element's flex container. Defaults to 'row'.
var /** @type {?} */ layout = this._getFlowDirection(this.parentElement, !!this.addFlexStyles);
var /** @type {?} */ direction = (layout.indexOf('column') > -1) ? 'column' : 'row';
var /** @type {?} */ max = isFlowHorizontal(direction) ? 'max-width' : 'max-height';
var /** @type {?} */ min = isFlowHorizontal(direction) ? 'min-width' : 'min-height';
var /** @type {?} */ hasCalc = String(basis).indexOf('calc') > -1;
var /** @type {?} */ usingCalc = hasCalc || (basis == 'auto');
var /** @type {?} */ isPercent = String(basis).indexOf('%') > -1 && !hasCalc;
var /** @type {?} */ hasUnits = String(basis).indexOf('px') > -1 || String(basis).indexOf('em') > -1 ||
String(basis).indexOf('vw') > -1 || String(basis).indexOf('vh') > -1;
var /** @type {?} */ isPx = String(basis).indexOf('px') > -1 || usingCalc;
var /** @type {?} */ isValue = (hasCalc || hasUnits);
grow = (grow == '0') ? 0 : grow;
shrink = (shrink == '0') ? 0 : shrink;
// make box inflexible when shrink and grow are both zero
// should not set a min when the grow is zero
// should not set a max when the shrink is zero
var /** @type {?} */ isFixed = !grow && !shrink;
var /** @type {?} */ css = {};
// flex-basis allows you to specify the initial/starting main-axis size of the element,
// before anything else is computed. It can either be a percentage or an absolute value.
// It is, however, not the breaking point for flex-grow/shrink properties
//
// flex-grow can be seen as this:
// 0: Do not stretch. Either size to element's content width, or obey 'flex-basis'.
// 1: (Default value). Stretch; will be the same size to all other flex items on
// the same row since they have a default value of 1.
// ≥2 (integer n): Stretch. Will be n times the size of other elements
// with 'flex-grow: 1' on the same row.
// Use `null` to clear existing styles.
var /** @type {?} */ clearStyles = {
'max-width': null,
'max-height': null,
'min-width': null,
'min-height': null
};
switch (basis || '') {
case '':
basis = direction === 'row' ? '0%' : 'auto';
break;
case 'initial': // default
case 'nogrow':
grow = 0;
basis = 'auto';
break;
case 'grow':
basis = '100%';
break;
case 'noshrink':
shrink = 0;
basis = 'auto';
break;
case 'auto':
break;
case 'none':
grow = 0;
shrink = 0;
basis = 'auto';
break;
default:
// Defaults to percentage sizing unless `px` is explicitly set
if (!isValue && !isPercent && !isNaN(/** @type {?} */ (basis))) {
basis = basis + '%';
}
// Fix for issue 280
if (basis === '0%') {
isValue = true;
}
if (basis === '0px') {
basis = '0%';
}
// fix issue #5345
if (hasCalc) {
css = extendObject(clearStyles, {
'flex-grow': grow,
'flex-shrink': shrink,
'flex-basis': isValue ? basis : '100%'
});
}
else {
css = extendObject(clearStyles, {
'flex': grow + " " + shrink + " " + (isValue ? basis : '100%')
});
}
break;
}
if (!(css['flex'] || css['flex-grow'])) {
if (hasCalc) {
css = extendObject(clearStyles, {
'flex-grow': grow,
'flex-shrink': shrink,
'flex-basis': basis
});
}
else {
css = extendObject(clearStyles, {
'flex': grow + " " + shrink + " " + basis
});
}
}
// Fix for issues 277 and 534
if (basis !== '0%') {
css[min] = isFixed || (isPx && grow) ? basis : null;
css[max] = isFixed || (!usingCalc && shrink) ? basis : null;
}
// Fix for issue 528
if (!css[min] && !css[max]) {
if (hasCalc) {
css = extendObject(clearStyles, {
'flex-grow': grow,
'flex-shrink': shrink,
'flex-basis': basis
});
}
else {
css = extendObject(clearStyles, {
'flex': grow + " " + shrink + " " + basis
});
}
}
else {
// Fix for issue 660
if (this._layout && this._layout.wrap) {
css[hasCalc ? 'flex-basis' : 'flex'] = css[max] ?
(hasCalc ? css[max] : grow + " " + shrink + " " + css[max]) :
(hasCalc ? css[min] : grow + " " + shrink + " " + css[min]);
}
}
return extendObject(css, { 'box-sizing': 'border-box' });
};
FlexDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: "\n [fxFlex],\n [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl],\n [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl],\n [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg],\n"
},] },
];
/** @nocollapse */
FlexDirective.ctorParameters = function () { return [
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MediaMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: LayoutDirective, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"] },] },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["StyleUtils"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["ADD_FLEX_STYLES"],] },] },
]; };
FlexDirective.propDecorators = {
"shrink": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxShrink',] },],
"grow": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxGrow',] },],
"flex": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex',] },],
"flexXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.xs',] },],
"flexSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.sm',] },],
"flexMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.md',] },],
"flexLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.lg',] },],
"flexXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.xl',] },],
"flexGtXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.gt-xs',] },],
"flexGtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.gt-sm',] },],
"flexGtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.gt-md',] },],
"flexGtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.gt-lg',] },],
"flexLtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.lt-sm',] },],
"flexLtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.lt-md',] },],
"flexLtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.lt-lg',] },],
"flexLtXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlex.lt-xl',] },],
};
return FlexDirective;
}(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BaseFxDirective"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* 'flex-order' flexbox styling directive
* Configures the positional ordering of the element in a sorted layout container
* @see https://css-tricks.com/almanac/properties/o/order/
*/
var FlexOrderDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FlexOrderDirective, _super);
/* tslint:enable */
function FlexOrderDirective(monitor, elRef, styleUtils) {
return _super.call(this, monitor, elRef, styleUtils) || this;
}
Object.defineProperty(FlexOrderDirective.prototype, "order", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('order', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderGtXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderGtXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderGtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderGtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderGtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderGtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderGtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderGtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderLtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderLtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderLtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderLtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderLtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderLtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOrderDirective.prototype, "orderLtXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('orderLtXl', val); },
enumerable: true,
configurable: true
});
// *********************************************
// Lifecycle Methods
// *********************************************
/**
* For @Input changes on the current mq activation property, see onMediaQueryChanges()
*/
/**
* For \@Input changes on the current mq activation property, see onMediaQueryChanges()
* @param {?} changes
* @return {?}
*/
FlexOrderDirective.prototype.ngOnChanges = /**
* For \@Input changes on the current mq activation property, see onMediaQueryChanges()
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes['order'] != null || this._mqActivation) {
this._updateWithValue();
}
};
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
*/
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
FlexOrderDirective.prototype.ngOnInit = /**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
function () {
var _this = this;
_super.prototype.ngOnInit.call(this);
this._listenForMediaQueryChanges('order', '0', function (changes) {
_this._updateWithValue(changes.value);
});
this._updateWithValue();
};
// *********************************************
// Protected methods
// *********************************************
/**
* @param {?=} value
* @return {?}
*/
FlexOrderDirective.prototype._updateWithValue = /**
* @param {?=} value
* @return {?}
*/
function (value) {
value = value || this._queryInput('order') || '0';
if (this._mqActivation) {
value = this._mqActivation.activatedInput;
}
this._applyStyleToElement(this._buildCSS(value));
};
/**
* @param {?} value
* @return {?}
*/
FlexOrderDirective.prototype._buildCSS = /**
* @param {?} value
* @return {?}
*/
function (value) {
value = parseInt(value, 10);
return { order: isNaN(value) ? 0 : value };
};
FlexOrderDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: "\n [fxFlexOrder],\n [fxFlexOrder.xs], [fxFlexOrder.sm], [fxFlexOrder.md], [fxFlexOrder.lg], [fxFlexOrder.xl],\n [fxFlexOrder.lt-sm], [fxFlexOrder.lt-md], [fxFlexOrder.lt-lg], [fxFlexOrder.lt-xl],\n [fxFlexOrder.gt-xs], [fxFlexOrder.gt-sm], [fxFlexOrder.gt-md], [fxFlexOrder.gt-lg]\n" },] },
];
/** @nocollapse */
FlexOrderDirective.ctorParameters = function () { return [
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MediaMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["StyleUtils"], },
]; };
FlexOrderDirective.propDecorators = {
"order": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder',] },],
"orderXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.xs',] },],
"orderSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.sm',] },],
"orderMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.md',] },],
"orderLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.lg',] },],
"orderXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.xl',] },],
"orderGtXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.gt-xs',] },],
"orderGtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.gt-sm',] },],
"orderGtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.gt-md',] },],
"orderGtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.gt-lg',] },],
"orderLtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.lt-sm',] },],
"orderLtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.lt-md',] },],
"orderLtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.lt-lg',] },],
"orderLtXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOrder.lt-xl',] },],
};
return FlexOrderDirective;
}(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BaseFxDirective"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* 'flex-offset' flexbox styling directive
* Configures the 'margin-left' of the element in a layout container
*/
var FlexOffsetDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FlexOffsetDirective, _super);
/* tslint:enable */
function FlexOffsetDirective(monitor, elRef, _container, _directionality, styleUtils) {
var _this = _super.call(this, monitor, elRef, styleUtils) || this;
_this._container = _container;
_this._directionality = _directionality;
/**
* The flex-direction of this element's host container. Defaults to 'row'.
*/
_this._layout = { direction: 'row', wrap: false };
_this._directionWatcher =
_this._directionality.change.subscribe(_this._updateWithValue.bind(_this));
_this.watchParentFlow();
return _this;
}
Object.defineProperty(FlexOffsetDirective.prototype, "offset", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offset', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetLtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetLtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetLtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetLtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetLtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetLtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetLtXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetLtXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetGtXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetGtXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetGtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetGtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetGtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetGtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexOffsetDirective.prototype, "offsetGtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('offsetGtLg', val); },
enumerable: true,
configurable: true
});
// *********************************************
// Lifecycle Methods
// *********************************************
/**
* For @Input changes on the current mq activation property, see onMediaQueryChanges()
*/
/**
* For \@Input changes on the current mq activation property, see onMediaQueryChanges()
* @param {?} changes
* @return {?}
*/
FlexOffsetDirective.prototype.ngOnChanges = /**
* For \@Input changes on the current mq activation property, see onMediaQueryChanges()
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes['offset'] != null || this._mqActivation) {
this._updateWithValue();
}
};
/**
* Cleanup
*/
/**
* Cleanup
* @return {?}
*/
FlexOffsetDirective.prototype.ngOnDestroy = /**
* Cleanup
* @return {?}
*/
function () {
_super.prototype.ngOnDestroy.call(this);
if (this._layoutWatcher) {
this._layoutWatcher.unsubscribe();
}
if (this._directionWatcher) {
this._directionWatcher.unsubscribe();
}
};
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
*/
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
FlexOffsetDirective.prototype.ngOnInit = /**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
function () {
var _this = this;
_super.prototype.ngOnInit.call(this);
this._listenForMediaQueryChanges('offset', 0, function (changes) {
_this._updateWithValue(changes.value);
});
};
/**
* If parent flow-direction changes, then update the margin property
* used to offset
*/
/**
* If parent flow-direction changes, then update the margin property
* used to offset
* @return {?}
*/
FlexOffsetDirective.prototype.watchParentFlow = /**
* If parent flow-direction changes, then update the margin property
* used to offset
* @return {?}
*/
function () {
var _this = this;
if (this._container) {
// Subscribe to layout immediate parent direction changes (if any)
this._layoutWatcher = this._container.layout$.subscribe(function (layout) {
// `direction` === null if parent container does not have a `fxLayout`
// `direction` === null if parent container does not have a `fxLayout`
_this._onLayoutChange(layout);
});
}
};
/**
* Caches the parent container's 'flex-direction' and updates the element's style.
* Used as a handler for layout change events from the parent flex container.
*/
/**
* Caches the parent container's 'flex-direction' and updates the element's style.
* Used as a handler for layout change events from the parent flex container.
* @param {?=} layout
* @return {?}
*/
FlexOffsetDirective.prototype._onLayoutChange = /**
* Caches the parent container's 'flex-direction' and updates the element's style.
* Used as a handler for layout change events from the parent flex container.
* @param {?=} layout
* @return {?}
*/
function (layout) {
this._layout = layout || this._layout || { direction: 'row', wrap: false };
this._updateWithValue();
};
/**
* Using the current fxFlexOffset value, update the inline CSS
* NOTE: this will assign `margin-left` if the parent flex-direction == 'row',
* otherwise `margin-top` is used for the offset.
*/
/**
* Using the current fxFlexOffset value, update the inline CSS
* NOTE: this will assign `margin-left` if the parent flex-direction == 'row',
* otherwise `margin-top` is used for the offset.
* @param {?=} value
* @return {?}
*/
FlexOffsetDirective.prototype._updateWithValue = /**
* Using the current fxFlexOffset value, update the inline CSS
* NOTE: this will assign `margin-left` if the parent flex-direction == 'row',
* otherwise `margin-top` is used for the offset.
* @param {?=} value
* @return {?}
*/
function (value) {
value = value || this._queryInput('offset') || 0;
if (this._mqActivation) {
value = this._mqActivation.activatedInput;
}
this._applyStyleToElement(this._buildCSS(value));
};
/**
* @param {?} offset
* @return {?}
*/
FlexOffsetDirective.prototype._buildCSS = /**
* @param {?} offset
* @return {?}
*/
function (offset) {
var /** @type {?} */ isPercent = String(offset).indexOf('%') > -1;
var /** @type {?} */ isPx = String(offset).indexOf('px') > -1;
if (!isPx && !isPercent && !isNaN(offset)) {
offset = offset + '%';
}
// The flex-direction of this element's flex container. Defaults to 'row'.
var /** @type {?} */ isRtl = this._directionality.value === 'rtl';
var /** @type {?} */ layout = this._getFlowDirection(this.parentElement, true);
var /** @type {?} */ horizontalLayoutKey = isRtl ? 'margin-right' : 'margin-left';
return isFlowHorizontal(layout) ? (_a = {}, _a[horizontalLayoutKey] = "" + offset, _a) :
{ 'margin-top': "" + offset };
var _a;
};
FlexOffsetDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: "\n [fxFlexOffset],\n [fxFlexOffset.xs], [fxFlexOffset.sm], [fxFlexOffset.md], [fxFlexOffset.lg], [fxFlexOffset.xl],\n [fxFlexOffset.lt-sm], [fxFlexOffset.lt-md], [fxFlexOffset.lt-lg], [fxFlexOffset.lt-xl],\n [fxFlexOffset.gt-xs], [fxFlexOffset.gt-sm], [fxFlexOffset.gt-md], [fxFlexOffset.gt-lg]\n" },] },
];
/** @nocollapse */
FlexOffsetDirective.ctorParameters = function () { return [
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MediaMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: LayoutDirective, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"] },] },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_4__["Directionality"], },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["StyleUtils"], },
]; };
FlexOffsetDirective.propDecorators = {
"offset": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset',] },],
"offsetXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.xs',] },],
"offsetSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.sm',] },],
"offsetMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.md',] },],
"offsetLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.lg',] },],
"offsetXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.xl',] },],
"offsetLtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.lt-sm',] },],
"offsetLtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.lt-md',] },],
"offsetLtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.lt-lg',] },],
"offsetLtXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.lt-xl',] },],
"offsetGtXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.gt-xs',] },],
"offsetGtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.gt-sm',] },],
"offsetGtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.gt-md',] },],
"offsetGtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexOffset.gt-lg',] },],
};
return FlexOffsetDirective;
}(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BaseFxDirective"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* 'flex-align' flexbox styling directive
* Allows element-specific overrides for cross-axis alignments in a layout container
* @see https://css-tricks.com/almanac/properties/a/align-self/
*/
var FlexAlignDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FlexAlignDirective, _super);
/* tslint:enable */
function FlexAlignDirective(monitor, elRef, styleUtils) {
return _super.call(this, monitor, elRef, styleUtils) || this;
}
Object.defineProperty(FlexAlignDirective.prototype, "align", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('align', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignLtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignLtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignLtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignLtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignLtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignLtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignLtXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignLtXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignGtXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignGtXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignGtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignGtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignGtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignGtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(FlexAlignDirective.prototype, "alignGtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignGtLg', val); },
enumerable: true,
configurable: true
});
// *********************************************
// Lifecycle Methods
// *********************************************
/**
* For @Input changes on the current mq activation property, see onMediaQueryChanges()
*/
/**
* For \@Input changes on the current mq activation property, see onMediaQueryChanges()
* @param {?} changes
* @return {?}
*/
FlexAlignDirective.prototype.ngOnChanges = /**
* For \@Input changes on the current mq activation property, see onMediaQueryChanges()
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes['align'] != null || this._mqActivation) {
this._updateWithValue();
}
};
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
*/
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
FlexAlignDirective.prototype.ngOnInit = /**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
function () {
var _this = this;
_super.prototype.ngOnInit.call(this);
this._listenForMediaQueryChanges('align', 'stretch', function (changes) {
_this._updateWithValue(changes.value);
});
this._updateWithValue();
};
// *********************************************
// Protected methods
// *********************************************
/**
* @param {?=} value
* @return {?}
*/
FlexAlignDirective.prototype._updateWithValue = /**
* @param {?=} value
* @return {?}
*/
function (value) {
value = value || this._queryInput('align') || 'stretch';
if (this._mqActivation) {
value = this._mqActivation.activatedInput;
}
this._applyStyleToElement(this._buildCSS(value));
};
/**
* @param {?} align
* @return {?}
*/
FlexAlignDirective.prototype._buildCSS = /**
* @param {?} align
* @return {?}
*/
function (align) {
var /** @type {?} */ css = {};
// Cross-axis
switch (align) {
case 'start':
css['align-self'] = 'flex-start';
break;
case 'end':
css['align-self'] = 'flex-end';
break;
default:
css['align-self'] = align;
break;
}
return css;
};
FlexAlignDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: "\n [fxFlexAlign],\n [fxFlexAlign.xs], [fxFlexAlign.sm], [fxFlexAlign.md], [fxFlexAlign.lg], [fxFlexAlign.xl],\n [fxFlexAlign.lt-sm], [fxFlexAlign.lt-md], [fxFlexAlign.lt-lg], [fxFlexAlign.lt-xl],\n [fxFlexAlign.gt-xs], [fxFlexAlign.gt-sm], [fxFlexAlign.gt-md], [fxFlexAlign.gt-lg]\n"
},] },
];
/** @nocollapse */
FlexAlignDirective.ctorParameters = function () { return [
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MediaMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["StyleUtils"], },
]; };
FlexAlignDirective.propDecorators = {
"align": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign',] },],
"alignXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.xs',] },],
"alignSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.sm',] },],
"alignMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.md',] },],
"alignLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.lg',] },],
"alignXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.xl',] },],
"alignLtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.lt-sm',] },],
"alignLtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.lt-md',] },],
"alignLtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.lt-lg',] },],
"alignLtXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.lt-xl',] },],
"alignGtXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.gt-xs',] },],
"alignGtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.gt-sm',] },],
"alignGtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.gt-md',] },],
"alignGtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxFlexAlign.gt-lg',] },],
};
return FlexAlignDirective;
}(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BaseFxDirective"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ FLEX_FILL_CSS = {
'margin': 0,
'width': '100%',
'height': '100%',
'min-width': '100%',
'min-height': '100%'
};
/**
* 'fxFill' flexbox styling directive
* Maximizes width and height of element in a layout container
*
* NOTE: fxFill is NOT responsive API!!
*/
var FlexFillDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FlexFillDirective, _super);
function FlexFillDirective(monitor, elRef, styleUtils) {
var _this = _super.call(this, monitor, elRef, styleUtils) || this;
_this.elRef = elRef;
_this._applyStyleToElement(FLEX_FILL_CSS);
return _this;
}
FlexFillDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: "\n [fxFill],\n [fxFlexFill]\n" },] },
];
/** @nocollapse */
FlexFillDirective.ctorParameters = function () { return [
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MediaMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["StyleUtils"], },
]; };
return FlexFillDirective;
}(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BaseFxDirective"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* 'layout-align' flexbox styling directive
* Defines positioning of child elements along main and cross axis in a layout container
* Optional values: {main-axis} values or {main-axis cross-axis} value pairs
*
* \@see https://css-tricks.com/almanac/properties/j/justify-content/
* \@see https://css-tricks.com/almanac/properties/a/align-items/
* \@see https://css-tricks.com/almanac/properties/a/align-content/
*/
var LayoutAlignDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LayoutAlignDirective, _super);
/* tslint:enable */
function LayoutAlignDirective(monitor, elRef, container, styleUtils) {
var _this = _super.call(this, monitor, elRef, styleUtils) || this;
_this._layout = 'row';
if (container) {
// Subscribe to layout direction changes
_this._layoutWatcher = container.layout$.subscribe(_this._onLayoutChange.bind(_this));
}
return _this;
}
Object.defineProperty(LayoutAlignDirective.prototype, "align", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('align', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignXl', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignGtXs", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignGtXs', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignGtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignGtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignGtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignGtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignGtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignGtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignLtSm", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignLtSm', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignLtMd", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignLtMd', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignLtLg", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignLtLg', val); },
enumerable: true,
configurable: true
});
Object.defineProperty(LayoutAlignDirective.prototype, "alignLtXl", {
set: /**
* @param {?} val
* @return {?}
*/
function (val) { this._cacheInput('alignLtXl', val); },
enumerable: true,
configurable: true
});
// *********************************************
// Lifecycle Methods
// *********************************************
/**
* @param {?} changes
* @return {?}
*/
LayoutAlignDirective.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes['align'] != null || this._mqActivation) {
this._updateWithValue();
}
};
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
*/
/**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
LayoutAlignDirective.prototype.ngOnInit = /**
* After the initial onChanges, build an mqActivation object that bridges
* mql change events to onMediaQueryChange handlers
* @return {?}
*/
function () {
var _this = this;
_super.prototype.ngOnInit.call(this);
this._listenForMediaQueryChanges('align', 'start stretch', function (changes) {
_this._updateWithValue(changes.value);
});
this._updateWithValue();
};
/**
* @return {?}
*/
LayoutAlignDirective.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
_super.prototype.ngOnDestroy.call(this);
if (this._layoutWatcher) {
this._layoutWatcher.unsubscribe();
}
};
// *********************************************
// Protected methods
// *********************************************
/**
*
*/
/**
*
* @param {?=} value
* @return {?}
*/
LayoutAlignDirective.prototype._updateWithValue = /**
*
* @param {?=} value
* @return {?}
*/
function (value) {
value = value || this._queryInput('align') || 'start stretch';
if (this._mqActivation) {
value = this._mqActivation.activatedInput;
}
this._applyStyleToElement(this._buildCSS(value));
this._allowStretching(value, !this._layout ? 'row' : this._layout);
};
/**
* Cache the parent container 'flex-direction' and update the 'flex' styles
*/
/**
* Cache the parent container 'flex-direction' and update the 'flex' styles
* @param {?} layout
* @return {?}
*/
LayoutAlignDirective.prototype._onLayoutChange = /**
* Cache the parent container 'flex-direction' and update the 'flex' styles
* @param {?} layout
* @return {?}
*/
function (layout) {
var _this = this;
this._layout = (layout.direction || '').toLowerCase();
if (!LAYOUT_VALUES.find(function (x) { return x === _this._layout; })) {
this._layout = 'row';
}
var /** @type {?} */ value = this._queryInput('align') || 'start stretch';
if (this._mqActivation) {
value = this._mqActivation.activatedInput;
}
this._allowStretching(value, this._layout || 'row');
};
/**
* @param {?} align
* @return {?}
*/
LayoutAlignDirective.prototype._buildCSS = /**
* @param {?} align
* @return {?}
*/
function (align) {
var /** @type {?} */ css = {}, _a = align.split(' '), main_axis = _a[0], cross_axis = _a[1]; // tslint:disable-line:variable-name
// Main axis
switch (main_axis) {
case 'center':
css['justify-content'] = 'center';
break;
case 'space-around':
css['justify-content'] = 'space-around';
break;
case 'space-between':
css['justify-content'] = 'space-between';
break;
case 'space-evenly':
css['justify-content'] = 'space-evenly';
break;
case 'end':
case 'flex-end':
css['justify-content'] = 'flex-end';
break;
case 'start':
case 'flex-start':
default:
css['justify-content'] = 'flex-start'; // default main axis
break;
}
// Cross-axis
switch (cross_axis) {
case 'start':
case 'flex-start':
css['align-items'] = css['align-content'] = 'flex-start';
break;
case 'baseline':
css['align-items'] = 'baseline';
break;
case 'center':
css['align-items'] = css['align-content'] = 'center';
break;
case 'end':
case 'flex-end':
css['align-items'] = css['align-content'] = 'flex-end';
break;
case 'stretch':
default:
// 'stretch'
css['align-items'] = css['align-content'] = 'stretch'; // default cross axis
break;
}
return extendObject(css, {
'display': 'flex',
'flex-direction': this._layout || 'row',
'box-sizing': 'border-box'
});
};
/**
* Update container element to 'stretch' as needed...
* NOTE: this is only done if the crossAxis is explicitly set to 'stretch'
*/
/**
* Update container element to 'stretch' as needed...
* NOTE: this is only done if the crossAxis is explicitly set to 'stretch'
* @param {?} align
* @param {?} layout
* @return {?}
*/
LayoutAlignDirective.prototype._allowStretching = /**
* Update container element to 'stretch' as needed...
* NOTE: this is only done if the crossAxis is explicitly set to 'stretch'
* @param {?} align
* @param {?} layout
* @return {?}
*/
function (align, layout) {
var _a = align.split(' '), cross_axis = _a[1]; // tslint:disable-line:variable-name
if (cross_axis == 'stretch') {
// Use `null` values to remove style
this._applyStyleToElement({
'box-sizing': 'border-box',
'max-width': !isFlowHorizontal(layout) ? '100%' : null,
'max-height': isFlowHorizontal(layout) ? '100%' : null
});
}
};
LayoutAlignDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: "\n [fxLayoutAlign],\n [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg],[fxLayoutAlign.xl],\n [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl],\n [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]\n" },] },
];
/** @nocollapse */
LayoutAlignDirective.ctorParameters = function () { return [
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["MediaMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: LayoutDirective, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] },] },
{ type: _angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["StyleUtils"], },
]; };
LayoutAlignDirective.propDecorators = {
"align": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign',] },],
"alignXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.xs',] },],
"alignSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.sm',] },],
"alignMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.md',] },],
"alignLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.lg',] },],
"alignXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.xl',] },],
"alignGtXs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.gt-xs',] },],
"alignGtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.gt-sm',] },],
"alignGtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.gt-md',] },],
"alignGtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.gt-lg',] },],
"alignLtSm": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.lt-sm',] },],
"alignLtMd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.lt-md',] },],
"alignLtLg": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.lt-lg',] },],
"alignLtXl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['fxLayoutAlign.lt-xl',] },],
};
return LayoutAlignDirective;
}(_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["BaseFxDirective"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ ALL_DIRECTIVES = [
LayoutDirective,
LayoutGapDirective,
LayoutAlignDirective,
FlexDirective,
FlexOrderDirective,
FlexOffsetDirective,
FlexFillDirective,
FlexAlignDirective,
];
/**
* *****************************************************************
* Define module for the Flex API
* *****************************************************************
*/
var FlexModule = /** @class */ (function () {
function FlexModule() {
}
FlexModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_flex_layout_core__WEBPACK_IMPORTED_MODULE_2__["CoreModule"], _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_4__["BidiModule"]],
declarations: ALL_DIRECTIVES.slice(),
exports: ALL_DIRECTIVES.slice()
},] },
];
/** @nocollapse */
FlexModule.ctorParameters = function () { return []; };
return FlexModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=flex.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/forms/fesm5/forms.js":
/*!****************************************************!*\
!*** ./node_modules/@angular/forms/fesm5/forms.js ***!
\****************************************************/
/*! exports provided: ɵangular_packages_forms_forms_bb, ɵangular_packages_forms_forms_ba, ɵangular_packages_forms_forms_y, ɵangular_packages_forms_forms_z, ɵangular_packages_forms_forms_a, ɵangular_packages_forms_forms_b, ɵangular_packages_forms_forms_c, ɵangular_packages_forms_forms_d, ɵangular_packages_forms_forms_e, ɵangular_packages_forms_forms_f, ɵangular_packages_forms_forms_g, ɵangular_packages_forms_forms_bg, ɵangular_packages_forms_forms_bc, ɵangular_packages_forms_forms_bd, ɵangular_packages_forms_forms_h, ɵangular_packages_forms_forms_i, ɵangular_packages_forms_forms_be, ɵangular_packages_forms_forms_bf, ɵangular_packages_forms_forms_j, ɵangular_packages_forms_forms_k, ɵangular_packages_forms_forms_l, ɵangular_packages_forms_forms_m, ɵangular_packages_forms_forms_o, ɵangular_packages_forms_forms_n, ɵangular_packages_forms_forms_p, ɵangular_packages_forms_forms_r, ɵangular_packages_forms_forms_q, ɵangular_packages_forms_forms_t, ɵangular_packages_forms_forms_u, ɵangular_packages_forms_forms_w, ɵangular_packages_forms_forms_v, ɵangular_packages_forms_forms_x, ɵangular_packages_forms_forms_s, AbstractControlDirective, AbstractFormGroupDirective, CheckboxControlValueAccessor, ControlContainer, NG_VALUE_ACCESSOR, COMPOSITION_BUFFER_MODE, DefaultValueAccessor, NgControl, NgControlStatus, NgControlStatusGroup, NgForm, NgModel, NgModelGroup, RadioControlValueAccessor, FormControlDirective, FormControlName, FormGroupDirective, FormArrayName, FormGroupName, NgSelectOption, SelectControlValueAccessor, SelectMultipleControlValueAccessor, CheckboxRequiredValidator, EmailValidator, MaxLengthValidator, MinLengthValidator, PatternValidator, RequiredValidator, FormBuilder, AbstractControl, FormArray, FormControl, FormGroup, NG_ASYNC_VALIDATORS, NG_VALIDATORS, Validators, VERSION, FormsModule, ReactiveFormsModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_bb", function() { return InternalFormsSharedModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_ba", function() { return REACTIVE_DRIVEN_DIRECTIVES; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_y", function() { return SHARED_FORM_DIRECTIVES; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_z", function() { return TEMPLATE_DRIVEN_DIRECTIVES; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_a", function() { return CHECKBOX_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_b", function() { return DEFAULT_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_c", function() { return AbstractControlStatus; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_d", function() { return ngControlStatusHost; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_e", function() { return formDirectiveProvider; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_f", function() { return formControlBinding; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_g", function() { return modelGroupProvider; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_bg", function() { return NgNoValidate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_bc", function() { return NUMBER_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_bd", function() { return NumberValueAccessor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_h", function() { return RADIO_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_i", function() { return RadioControlRegistry; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_be", function() { return RANGE_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_bf", function() { return RangeValueAccessor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_j", function() { return NG_MODEL_WITH_FORM_CONTROL_WARNING; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_k", function() { return formControlBinding$1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_l", function() { return controlNameBinding; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_m", function() { return formDirectiveProvider$1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_o", function() { return formArrayNameProvider; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_n", function() { return formGroupNameProvider; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_p", function() { return SELECT_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_r", function() { return NgSelectMultipleOption; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_q", function() { return SELECT_MULTIPLE_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_t", function() { return CHECKBOX_REQUIRED_VALIDATOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_u", function() { return EMAIL_VALIDATOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_w", function() { return MAX_LENGTH_VALIDATOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_v", function() { return MIN_LENGTH_VALIDATOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_x", function() { return PATTERN_VALIDATOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_s", function() { return REQUIRED_VALIDATOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractControlDirective", function() { return AbstractControlDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractFormGroupDirective", function() { return AbstractFormGroupDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CheckboxControlValueAccessor", function() { return CheckboxControlValueAccessor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ControlContainer", function() { return ControlContainer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NG_VALUE_ACCESSOR", function() { return NG_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMPOSITION_BUFFER_MODE", function() { return COMPOSITION_BUFFER_MODE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultValueAccessor", function() { return DefaultValueAccessor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgControl", function() { return NgControl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgControlStatus", function() { return NgControlStatus; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgControlStatusGroup", function() { return NgControlStatusGroup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgForm", function() { return NgForm; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModel", function() { return NgModel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModelGroup", function() { return NgModelGroup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RadioControlValueAccessor", function() { return RadioControlValueAccessor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormControlDirective", function() { return FormControlDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormControlName", function() { return FormControlName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormGroupDirective", function() { return FormGroupDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormArrayName", function() { return FormArrayName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormGroupName", function() { return FormGroupName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgSelectOption", function() { return NgSelectOption; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectControlValueAccessor", function() { return SelectControlValueAccessor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectMultipleControlValueAccessor", function() { return SelectMultipleControlValueAccessor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CheckboxRequiredValidator", function() { return CheckboxRequiredValidator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmailValidator", function() { return EmailValidator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaxLengthValidator", function() { return MaxLengthValidator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinLengthValidator", function() { return MinLengthValidator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PatternValidator", function() { return PatternValidator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequiredValidator", function() { return RequiredValidator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormBuilder", function() { return FormBuilder; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractControl", function() { return AbstractControl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormArray", function() { return FormArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormControl", function() { return FormControl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormGroup", function() { return FormGroup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NG_ASYNC_VALIDATORS", function() { return NG_ASYNC_VALIDATORS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NG_VALIDATORS", function() { return NG_VALIDATORS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Validators", function() { return Validators; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormsModule", function() { return FormsModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReactiveFormsModule", function() { return ReactiveFormsModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/fesm5/platform-browser.js");
/**
* @license Angular v6.0.9
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Base class for control directives.
*
* Only used internally in the forms module.
*
*
*/
var AbstractControlDirective = /** @class */ (function () {
function AbstractControlDirective() {
}
Object.defineProperty(AbstractControlDirective.prototype, "value", {
/** The value of the control. */
get: function () { return this.control ? this.control.value : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "valid", {
/**
* A control is `valid` when its `status === VALID`.
*
* In order to have this status, the control must have passed all its
* validation checks.
*/
get: function () { return this.control ? this.control.valid : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "invalid", {
/**
* A control is `invalid` when its `status === INVALID`.
*
* In order to have this status, the control must have failed
* at least one of its validation checks.
*/
get: function () { return this.control ? this.control.invalid : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "pending", {
/**
* A control is `pending` when its `status === PENDING`.
*
* In order to have this status, the control must be in the
* middle of conducting a validation check.
*/
get: function () { return this.control ? this.control.pending : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "disabled", {
/**
* A control is `disabled` when its `status === DISABLED`.
*
* Disabled controls are exempt from validation checks and
* are not included in the aggregate value of their ancestor
* controls.
*/
get: function () { return this.control ? this.control.disabled : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "enabled", {
/**
* A control is `enabled` as long as its `status !== DISABLED`.
*
* In other words, it has a status of `VALID`, `INVALID`, or
* `PENDING`.
*/
get: function () { return this.control ? this.control.enabled : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "errors", {
/**
* Returns any errors generated by failing validation. If there
* are no errors, it will return null.
*/
get: function () { return this.control ? this.control.errors : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "pristine", {
/**
* A control is `pristine` if the user has not yet changed
* the value in the UI.
*
* Note that programmatic changes to a control's value will
* *not* mark it dirty.
*/
get: function () { return this.control ? this.control.pristine : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "dirty", {
/**
* A control is `dirty` if the user has changed the value
* in the UI.
*
* Note that programmatic changes to a control's value will
* *not* mark it dirty.
*/
get: function () { return this.control ? this.control.dirty : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "touched", {
/**
* A control is marked `touched` once the user has triggered
* a `blur` event on it.
*/
get: function () { return this.control ? this.control.touched : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "status", {
get: function () { return this.control ? this.control.status : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "untouched", {
/**
* A control is `untouched` if the user has not yet triggered
* a `blur` event on it.
*/
get: function () { return this.control ? this.control.untouched : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "statusChanges", {
/**
* Emits an event every time the validation status of the control
* is re-calculated.
*/
get: function () {
return this.control ? this.control.statusChanges : null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "valueChanges", {
/**
* Emits an event every time the value of the control changes, in
* the UI or programmatically.
*/
get: function () {
return this.control ? this.control.valueChanges : null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlDirective.prototype, "path", {
/**
* Returns an array that represents the path from the top-level form
* to this control. Each index is the string name of the control on
* that level.
*/
get: function () { return null; },
enumerable: true,
configurable: true
});
/**
* Resets the form control. This means by default:
*
* * it is marked as `pristine`
* * it is marked as `untouched`
* * value is set to null
*
* For more information, see `AbstractControl`.
*/
AbstractControlDirective.prototype.reset = function (value) {
if (value === void 0) { value = undefined; }
if (this.control)
this.control.reset(value);
};
/**
* Returns true if the control with the given path has the error specified. Otherwise
* returns false.
*
* If no path is given, it checks for the error on the present control.
*/
AbstractControlDirective.prototype.hasError = function (errorCode, path) {
return this.control ? this.control.hasError(errorCode, path) : false;
};
/**
* Returns error data if the control with the given path has the error specified. Otherwise
* returns null or undefined.
*
* If no path is given, it checks for the error on the present control.
*/
AbstractControlDirective.prototype.getError = function (errorCode, path) {
return this.control ? this.control.getError(errorCode, path) : null;
};
return AbstractControlDirective;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A directive that contains multiple `NgControl`s.
*
* Only used by the forms module.
*
*
*/
var ControlContainer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ControlContainer, _super);
function ControlContainer() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(ControlContainer.prototype, "formDirective", {
/**
* Get the form to which this container belongs.
*/
get: function () { return null; },
enumerable: true,
configurable: true
});
Object.defineProperty(ControlContainer.prototype, "path", {
/**
* Get the path to this container.
*/
get: function () { return null; },
enumerable: true,
configurable: true
});
return ControlContainer;
}(AbstractControlDirective));
/**
* @license
* Copyright Google Inc. 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
*/
function isEmptyInputValue(value) {
// we don't check for string here so it also works with arrays
return value == null || value.length === 0;
}
/**
* @description
* An `InjectionToken` for registering additional synchronous validators used with `AbstractControl`s.
*
* @see `NG_ASYNC_VALIDATORS`
*
* @usageNotes
*
* ### Providing a custom validator
*
* The following example registers a custom validator directive. Adding the validator to the
* existing collection of validators requires the `multi: true` option.
*
* ```typescript
* @Directive({
* selector: '[customValidator]',
* providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]
* })
* class CustomValidatorDirective implements Validator {
* validate(control: AbstractControl): ValidationErrors | null {
* return { 'custom': true };
* }
* }
* ```
*
*/
var NG_VALIDATORS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('NgValidators');
/**
* @description
* An `InjectionToken` for registering additional asynchronous validators used with `AbstractControl`s.
*
* @see `NG_VALIDATORS`
*
*/
var NG_ASYNC_VALIDATORS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('NgAsyncValidators');
var EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;
/**
* @description
* Provides a set of built-in validators that can be used by form controls.
*
* A validator is a function that processes a `FormControl` or collection of
* controls and returns an error map or null. A null map means that validation has passed.
*
* @see [Form Validation](/guide/form-validation)
*
*/
var Validators = /** @class */ (function () {
function Validators() {
}
/**
* @description
* Validator that requires the control's value to be greater than or equal to the provided number.
* The validator exists only as a function and not as a directive.
*
* @usageNotes
*
* ### Validate against a minimum of 3
*
* ```typescript
* const control = new FormControl(2, Validators.min(3));
*
* console.log(control.errors); // {min: {min: 3, actual: 2}}
* ```
*
* @returns A validator function that returns an error map with the
* `min` property if the validation check fails, otherwise `null`.
*
*/
Validators.min = function (min) {
return function (control) {
if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {
return null; // don't validate empty values to allow optional controls
}
var value = parseFloat(control.value);
// Controls with NaN values after parsing should be treated as not having a
// minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min
return !isNaN(value) && value < min ? { 'min': { 'min': min, 'actual': control.value } } : null;
};
};
/**
* @description
* Validator that requires the control's value to be less than or equal to the provided number.
* The validator exists only as a function and not as a directive.
*
* @usageNotes
*
* ### Validate against a maximum of 15
*
* ```typescript
* const control = new FormControl(16, Validators.max(15));
*
* console.log(control.errors); // {max: {max: 15, actual: 16}}
* ```
*
* @returns A validator function that returns an error map with the
* `max` property if the validation check fails, otherwise `null`.
*
*/
Validators.max = function (max) {
return function (control) {
if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {
return null; // don't validate empty values to allow optional controls
}
var value = parseFloat(control.value);
// Controls with NaN values after parsing should be treated as not having a
// maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max
return !isNaN(value) && value > max ? { 'max': { 'max': max, 'actual': control.value } } : null;
};
};
/**
* @description
* Validator that requires the control have a non-empty value.
*
* @usageNotes
*
* ### Validate that the field is non-empty
*
* ```typescript
* const control = new FormControl('', Validators.required);
*
* console.log(control.errors); // {required: true}
* ```
*
* @returns An error map with the `required` property
* if the validation check fails, otherwise `null`.
*
*/
Validators.required = function (control) {
return isEmptyInputValue(control.value) ? { 'required': true } : null;
};
/**
* @description
* Validator that requires the control's value be true. This validator is commonly
* used for required checkboxes.
*
* @usageNotes
*
* ### Validate that the field value is true
*
* ```typescript
* const control = new FormControl('', Validators.requiredTrue);
*
* console.log(control.errors); // {required: true}
* ```
*
* @returns An error map that contains the `required` property
* set to `true` if the validation check fails, otherwise `null`.
*/
Validators.requiredTrue = function (control) {
return control.value === true ? null : { 'required': true };
};
/**
* @description
* Validator that requires the control's value pass an email validation test.
*
* @usageNotes
*
* ### Validate that the field matches a valid email pattern
*
* ```typescript
* const control = new FormControl('bad@', Validators.email);
*
* console.log(control.errors); // {email: true}
* ```
*
* @returns An error map with the `email` property
* if the validation check fails, otherwise `null`.
*
*/
Validators.email = function (control) {
if (isEmptyInputValue(control.value)) {
return null; // don't validate empty values to allow optional controls
}
return EMAIL_REGEXP.test(control.value) ? null : { 'email': true };
};
/**
* @description
* Validator that requires the length of the control's value to be greater than or equal
* to the provided minimum length. This validator is also provided by default if you use the
* the HTML5 `minlength` attribute.
*
* @usageNotes
*
* ### Validate that the field has a minimum of 3 characters
*
* ```typescript
* const control = new FormControl('ng', Validators.minLength(3));
*
* console.log(control.errors); // {minlength: {requiredLength: 3, actualLength: 2}}
* ```
*
* ```html
* <input minlength="5">
* ```
*
* @returns A validator function that returns an error map with the
* `minlength` if the validation check fails, otherwise `null`.
*/
Validators.minLength = function (minLength) {
return function (control) {
if (isEmptyInputValue(control.value)) {
return null; // don't validate empty values to allow optional controls
}
var length = control.value ? control.value.length : 0;
return length < minLength ?
{ 'minlength': { 'requiredLength': minLength, 'actualLength': length } } :
null;
};
};
/**
* @description
* Validator that requires the length of the control's value to be less than or equal
* to the provided maximum length. This validator is also provided by default if you use the
* the HTML5 `maxlength` attribute.
*
* @usageNotes
*
* ### Validate that the field has maximum of 5 characters
*
* ```typescript
* const control = new FormControl('Angular', Validators.maxLength(5));
*
* console.log(control.errors); // {maxlength: {requiredLength: 5, actualLength: 7}}
* ```
*
* ```html
* <input maxlength="5">
* ```
*
* @returns A validator function that returns an error map with the
* `maxlength` property if the validation check fails, otherwise `null`.
*/
Validators.maxLength = function (maxLength) {
return function (control) {
var length = control.value ? control.value.length : 0;
return length > maxLength ?
{ 'maxlength': { 'requiredLength': maxLength, 'actualLength': length } } :
null;
};
};
/**
* @description
* Validator that requires the control's value to match a regex pattern. This validator is also
* provided
* by default if you use the HTML5 `pattern` attribute.
*
* @usageNotes
*
* ### Validate that the field only contains letters or spaces
*
* ```typescript
* const control = new FormControl('1', Validators.pattern('[a-zA-Z ]*'));
*
* console.log(control.errors); // {pattern: {requiredPattern: '^[a-zA-Z ]*$', actualValue: '1'}}
* ```
*
* ```html
* <input pattern="[a-zA-Z ]*">
* ```
*
* @returns A validator function that returns an error map with the
* `pattern` property if the validation check fails, otherwise `null`.
*/
Validators.pattern = function (pattern) {
if (!pattern)
return Validators.nullValidator;
var regex;
var regexStr;
if (typeof pattern === 'string') {
regexStr = '';
if (pattern.charAt(0) !== '^')
regexStr += '^';
regexStr += pattern;
if (pattern.charAt(pattern.length - 1) !== '$')
regexStr += '$';
regex = new RegExp(regexStr);
}
else {
regexStr = pattern.toString();
regex = pattern;
}
return function (control) {
if (isEmptyInputValue(control.value)) {
return null; // don't validate empty values to allow optional controls
}
var value = control.value;
return regex.test(value) ? null :
{ 'pattern': { 'requiredPattern': regexStr, 'actualValue': value } };
};
};
/**
* @description
* Validator that performs no operation.
*/
Validators.nullValidator = function (c) { return null; };
Validators.compose = function (validators) {
if (!validators)
return null;
var presentValidators = validators.filter(isPresent);
if (presentValidators.length == 0)
return null;
return function (control) {
return _mergeErrors(_executeValidators(control, presentValidators));
};
};
/**
* @description
* Compose multiple async validators into a single function that returns the union
* of the individual error objects for the provided control.
*
* @returns A validator function that returns an error map with the
* merged error objects of the async validators if the validation check fails, otherwise `null`.
*/
Validators.composeAsync = function (validators) {
if (!validators)
return null;
var presentValidators = validators.filter(isPresent);
if (presentValidators.length == 0)
return null;
return function (control) {
var observables = _executeAsyncValidators(control, presentValidators).map(toObservable);
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["forkJoin"])(observables).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(_mergeErrors));
};
};
return Validators;
}());
function isPresent(o) {
return o != null;
}
function toObservable(r) {
var obs = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵisPromise"])(r) ? Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(r) : r;
if (!(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵisObservable"])(obs))) {
throw new Error("Expected validator to return Promise or Observable.");
}
return obs;
}
function _executeValidators(control, validators) {
return validators.map(function (v) { return v(control); });
}
function _executeAsyncValidators(control, validators) {
return validators.map(function (v) { return v(control); });
}
function _mergeErrors(arrayOfErrors) {
var res = arrayOfErrors.reduce(function (res, errors) {
return errors != null ? Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, res, errors) : res;
}, {});
return Object.keys(res).length === 0 ? null : res;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Used to provide a `ControlValueAccessor` for form controls.
*
* See `DefaultValueAccessor` for how to implement one.
*
*/
var NG_VALUE_ACCESSOR = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('NgValueAccessor');
/**
* @license
* Copyright Google Inc. 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 CHECKBOX_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return CheckboxControlValueAccessor; }),
multi: true,
};
/**
* The accessor for writing a value and listening to changes on a checkbox input element.
*
* ### Example
* ```
* <input type="checkbox" name="rememberLogin" ngModel>
* ```
*
*
*/
var CheckboxControlValueAccessor = /** @class */ (function () {
function CheckboxControlValueAccessor(_renderer, _elementRef) {
this._renderer = _renderer;
this._elementRef = _elementRef;
this.onChange = function (_) { };
this.onTouched = function () { };
}
CheckboxControlValueAccessor.prototype.writeValue = function (value) {
this._renderer.setProperty(this._elementRef.nativeElement, 'checked', value);
};
CheckboxControlValueAccessor.prototype.registerOnChange = function (fn) { this.onChange = fn; };
CheckboxControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };
CheckboxControlValueAccessor.prototype.setDisabledState = function (isDisabled) {
this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
};
CheckboxControlValueAccessor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]',
host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
providers: [CHECKBOX_VALUE_ACCESSOR]
},] }
];
/** @nocollapse */
CheckboxControlValueAccessor.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }
]; };
return CheckboxControlValueAccessor;
}());
/**
* @license
* Copyright Google Inc. 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 DEFAULT_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return DefaultValueAccessor; }),
multi: true
};
/**
* We must check whether the agent is Android because composition events
* behave differently between iOS and Android.
*/
function _isAndroid() {
var userAgent = Object(_angular_platform_browser__WEBPACK_IMPORTED_MODULE_4__["ɵgetDOM"])() ? Object(_angular_platform_browser__WEBPACK_IMPORTED_MODULE_4__["ɵgetDOM"])().getUserAgent() : '';
return /android (\d+)/.test(userAgent.toLowerCase());
}
/**
* Turn this mode on if you want form directives to buffer IME input until compositionend
* @experimental
*/
var COMPOSITION_BUFFER_MODE = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('CompositionEventMode');
/**
* The default accessor for writing a value and listening to changes that is used by the
* `NgModel`, `FormControlDirective`, and `FormControlName` directives.
*
* ### Example
* ```
* <input type="text" name="searchQuery" ngModel>
* ```
*
*
*/
var DefaultValueAccessor = /** @class */ (function () {
function DefaultValueAccessor(_renderer, _elementRef, _compositionMode) {
this._renderer = _renderer;
this._elementRef = _elementRef;
this._compositionMode = _compositionMode;
this.onChange = function (_) { };
this.onTouched = function () { };
/** Whether the user is creating a composition string (IME events). */
this._composing = false;
if (this._compositionMode == null) {
this._compositionMode = !_isAndroid();
}
}
DefaultValueAccessor.prototype.writeValue = function (value) {
var normalizedValue = value == null ? '' : value;
this._renderer.setProperty(this._elementRef.nativeElement, 'value', normalizedValue);
};
DefaultValueAccessor.prototype.registerOnChange = function (fn) { this.onChange = fn; };
DefaultValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };
DefaultValueAccessor.prototype.setDisabledState = function (isDisabled) {
this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
};
/** @internal */
DefaultValueAccessor.prototype._handleInput = function (value) {
if (!this._compositionMode || (this._compositionMode && !this._composing)) {
this.onChange(value);
}
};
/** @internal */
DefaultValueAccessor.prototype._compositionStart = function () { this._composing = true; };
/** @internal */
DefaultValueAccessor.prototype._compositionEnd = function (value) {
this._composing = false;
this._compositionMode && this.onChange(value);
};
DefaultValueAccessor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]',
// TODO: vsavkin replace the above selector with the one below it once
// https://github.com/angular/angular/issues/3011 is implemented
// selector: '[ngModel],[formControl],[formControlName]',
host: {
'(input)': '$any(this)._handleInput($event.target.value)',
'(blur)': 'onTouched()',
'(compositionstart)': '$any(this)._compositionStart()',
'(compositionend)': '$any(this)._compositionEnd($event.target.value)'
},
providers: [DEFAULT_VALUE_ACCESSOR]
},] }
];
/** @nocollapse */
DefaultValueAccessor.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] },
{ type: Boolean, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [COMPOSITION_BUFFER_MODE,] }] }
]; };
return DefaultValueAccessor;
}());
/**
* @license
* Copyright Google Inc. 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
*/
function normalizeValidator(validator) {
if (validator.validate) {
return function (c) { return validator.validate(c); };
}
else {
return validator;
}
}
function normalizeAsyncValidator(validator) {
if (validator.validate) {
return function (c) { return validator.validate(c); };
}
else {
return validator;
}
}
/**
* @license
* Copyright Google Inc. 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 NUMBER_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return NumberValueAccessor; }),
multi: true
};
/**
* The accessor for writing a number value and listening to changes that is used by the
* `NgModel`, `FormControlDirective`, and `FormControlName` directives.
*
* ### Example
* ```
* <input type="number" [(ngModel)]="age">
* ```
*/
var NumberValueAccessor = /** @class */ (function () {
function NumberValueAccessor(_renderer, _elementRef) {
this._renderer = _renderer;
this._elementRef = _elementRef;
this.onChange = function (_) { };
this.onTouched = function () { };
}
NumberValueAccessor.prototype.writeValue = function (value) {
// The value needs to be normalized for IE9, otherwise it is set to 'null' when null
var normalizedValue = value == null ? '' : value;
this._renderer.setProperty(this._elementRef.nativeElement, 'value', normalizedValue);
};
NumberValueAccessor.prototype.registerOnChange = function (fn) {
this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); };
};
NumberValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };
NumberValueAccessor.prototype.setDisabledState = function (isDisabled) {
this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
};
NumberValueAccessor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]',
host: {
'(change)': 'onChange($event.target.value)',
'(input)': 'onChange($event.target.value)',
'(blur)': 'onTouched()'
},
providers: [NUMBER_VALUE_ACCESSOR]
},] }
];
/** @nocollapse */
NumberValueAccessor.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }
]; };
return NumberValueAccessor;
}());
/**
* @license
* Copyright Google Inc. 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
*/
function unimplemented() {
throw new Error('unimplemented');
}
/**
* A base class that all control directive extend.
* It binds a `FormControl` object to a DOM element.
*
* Used internally by Angular forms.
*
*
*/
var NgControl = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NgControl, _super);
function NgControl() {
var _this = _super !== null && _super.apply(this, arguments) || this;
/** @internal */
_this._parent = null;
_this.name = null;
_this.valueAccessor = null;
/** @internal */
_this._rawValidators = [];
/** @internal */
_this._rawAsyncValidators = [];
return _this;
}
Object.defineProperty(NgControl.prototype, "validator", {
get: function () { return unimplemented(); },
enumerable: true,
configurable: true
});
Object.defineProperty(NgControl.prototype, "asyncValidator", {
get: function () { return unimplemented(); },
enumerable: true,
configurable: true
});
return NgControl;
}(AbstractControlDirective));
/**
* @license
* Copyright Google Inc. 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 RADIO_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return RadioControlValueAccessor; }),
multi: true
};
/**
* Internal class used by Angular to uncheck radio buttons with the matching name.
*/
var RadioControlRegistry = /** @class */ (function () {
function RadioControlRegistry() {
this._accessors = [];
}
RadioControlRegistry.prototype.add = function (control, accessor) {
this._accessors.push([control, accessor]);
};
RadioControlRegistry.prototype.remove = function (accessor) {
for (var i = this._accessors.length - 1; i >= 0; --i) {
if (this._accessors[i][1] === accessor) {
this._accessors.splice(i, 1);
return;
}
}
};
RadioControlRegistry.prototype.select = function (accessor) {
var _this = this;
this._accessors.forEach(function (c) {
if (_this._isSameGroup(c, accessor) && c[1] !== accessor) {
c[1].fireUncheck(accessor.value);
}
});
};
RadioControlRegistry.prototype._isSameGroup = function (controlPair, accessor) {
if (!controlPair[0].control)
return false;
return controlPair[0]._parent === accessor._control._parent &&
controlPair[1].name === accessor.name;
};
RadioControlRegistry.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
return RadioControlRegistry;
}());
/**
* @description
*
* Writes radio control values and listens to radio control changes.
*
* Used by `NgModel`, `FormControlDirective`, and `FormControlName`
* to keep the view synced with the `FormControl` model.
*
* If you have imported the `FormsModule` or the `ReactiveFormsModule`, this
* value accessor will be active on any radio control that has a form directive. You do
* **not** need to add a special selector to activate it.
*
* ### How to use radio buttons with form directives
*
* To use radio buttons in a template-driven form, you'll want to ensure that radio buttons
* in the same group have the same `name` attribute. Radio buttons with different `name`
* attributes do not affect each other.
*
* {@example forms/ts/radioButtons/radio_button_example.ts region='TemplateDriven'}
*
* When using radio buttons in a reactive form, radio buttons in the same group should have the
* same `formControlName`. You can also add a `name` attribute, but it's optional.
*
* {@example forms/ts/reactiveRadioButtons/reactive_radio_button_example.ts region='Reactive'}
*
* * **npm package**: `@angular/forms`
*
*
*/
var RadioControlValueAccessor = /** @class */ (function () {
function RadioControlValueAccessor(_renderer, _elementRef, _registry, _injector) {
this._renderer = _renderer;
this._elementRef = _elementRef;
this._registry = _registry;
this._injector = _injector;
this.onChange = function () { };
this.onTouched = function () { };
}
RadioControlValueAccessor.prototype.ngOnInit = function () {
this._control = this._injector.get(NgControl);
this._checkName();
this._registry.add(this._control, this);
};
RadioControlValueAccessor.prototype.ngOnDestroy = function () { this._registry.remove(this); };
RadioControlValueAccessor.prototype.writeValue = function (value) {
this._state = value === this.value;
this._renderer.setProperty(this._elementRef.nativeElement, 'checked', this._state);
};
RadioControlValueAccessor.prototype.registerOnChange = function (fn) {
var _this = this;
this._fn = fn;
this.onChange = function () {
fn(_this.value);
_this._registry.select(_this);
};
};
RadioControlValueAccessor.prototype.fireUncheck = function (value) { this.writeValue(value); };
RadioControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };
RadioControlValueAccessor.prototype.setDisabledState = function (isDisabled) {
this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
};
RadioControlValueAccessor.prototype._checkName = function () {
if (this.name && this.formControlName && this.name !== this.formControlName) {
this._throwNameError();
}
if (!this.name && this.formControlName)
this.name = this.formControlName;
};
RadioControlValueAccessor.prototype._throwNameError = function () {
throw new Error("\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: <input type=\"radio\" formControlName=\"food\" name=\"food\">\n ");
};
RadioControlValueAccessor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]',
host: { '(change)': 'onChange()', '(blur)': 'onTouched()' },
providers: [RADIO_VALUE_ACCESSOR]
},] }
];
/** @nocollapse */
RadioControlValueAccessor.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] },
{ type: RadioControlRegistry },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"] }
]; };
RadioControlValueAccessor.propDecorators = {
name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
formControlName: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
value: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }]
};
return RadioControlValueAccessor;
}());
/**
* @license
* Copyright Google Inc. 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 RANGE_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return RangeValueAccessor; }),
multi: true
};
/**
* The accessor for writing a range value and listening to changes that is used by the
* `NgModel`, `FormControlDirective`, and `FormControlName` directives.
*
* ### Example
* ```
* <input type="range" [(ngModel)]="age" >
* ```
*/
var RangeValueAccessor = /** @class */ (function () {
function RangeValueAccessor(_renderer, _elementRef) {
this._renderer = _renderer;
this._elementRef = _elementRef;
this.onChange = function (_) { };
this.onTouched = function () { };
}
RangeValueAccessor.prototype.writeValue = function (value) {
this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));
};
RangeValueAccessor.prototype.registerOnChange = function (fn) {
this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); };
};
RangeValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };
RangeValueAccessor.prototype.setDisabledState = function (isDisabled) {
this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
};
RangeValueAccessor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]',
host: {
'(change)': 'onChange($event.target.value)',
'(input)': 'onChange($event.target.value)',
'(blur)': 'onTouched()'
},
providers: [RANGE_VALUE_ACCESSOR]
},] }
];
/** @nocollapse */
RangeValueAccessor.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }
]; };
return RangeValueAccessor;
}());
/**
* @license
* Copyright Google Inc. 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 FormErrorExamples = {
formControlName: "\n <div [formGroup]=\"myGroup\">\n <input formControlName=\"firstName\">\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });",
formGroupName: "\n <div [formGroup]=\"myGroup\">\n <div formGroupName=\"person\">\n <input formControlName=\"firstName\">\n </div>\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });",
formArrayName: "\n <div [formGroup]=\"myGroup\">\n <div formArrayName=\"cities\">\n <div *ngFor=\"let city of cityArray.controls; index as i\">\n <input [formControlName]=\"i\">\n </div>\n </div>\n </div>\n\n In your class:\n\n this.cityArray = new FormArray([new FormControl('SF')]);\n this.myGroup = new FormGroup({\n cities: this.cityArray\n });",
ngModelGroup: "\n <form>\n <div ngModelGroup=\"person\">\n <input [(ngModel)]=\"person.name\" name=\"firstName\">\n </div>\n </form>",
ngModelWithFormGroup: "\n <div [formGroup]=\"myGroup\">\n <input formControlName=\"firstName\">\n <input [(ngModel)]=\"showMoreControls\" [ngModelOptions]=\"{standalone: true}\">\n </div>\n "
};
/**
* @license
* Copyright Google Inc. 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 ReactiveErrors = /** @class */ (function () {
function ReactiveErrors() {
}
ReactiveErrors.controlParentException = function () {
throw new Error("formControlName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n " + FormErrorExamples.formControlName);
};
ReactiveErrors.ngModelGroupException = function () {
throw new Error("formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n that also have a \"form\" prefix: formGroupName, formArrayName, or formGroup.\n\n Option 1: Update the parent to be formGroupName (reactive form strategy)\n\n " + FormErrorExamples.formGroupName + "\n\n Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n " + FormErrorExamples.ngModelGroup);
};
ReactiveErrors.missingFormException = function () {
throw new Error("formGroup expects a FormGroup instance. Please pass one in.\n\n Example:\n\n " + FormErrorExamples.formControlName);
};
ReactiveErrors.groupParentException = function () {
throw new Error("formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n " + FormErrorExamples.formGroupName);
};
ReactiveErrors.arrayParentException = function () {
throw new Error("formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n " + FormErrorExamples.formArrayName);
};
ReactiveErrors.disabledAttrWarning = function () {
console.warn("\n It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n you. We recommend using this approach to avoid 'changed after checked' errors.\n \n Example: \n form = new FormGroup({\n first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n last: new FormControl('Drew', Validators.required)\n });\n ");
};
ReactiveErrors.ngModelWarning = function (directiveName) {
console.warn("\n It looks like you're using ngModel on the same form field as " + directiveName + ". \n Support for using the ngModel input property and ngModelChange event with \n reactive form directives has been deprecated in Angular v6 and will be removed \n in Angular v7.\n \n For more information on this, see our API docs here:\n https://angular.io/api/forms/" + (directiveName === 'formControl' ? 'FormControlDirective'
: 'FormControlName') + "#use-with-ngmodel\n ");
};
return ReactiveErrors;
}());
/**
* @license
* Copyright Google Inc. 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 SELECT_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return SelectControlValueAccessor; }),
multi: true
};
function _buildValueString(id, value) {
if (id == null)
return "" + value;
if (value && typeof value === 'object')
value = 'Object';
return (id + ": " + value).slice(0, 50);
}
function _extractId(valueString) {
return valueString.split(':')[0];
}
/**
* @description
*
* Writes values and listens to changes on a select element.
*
* Used by `NgModel`, `FormControlDirective`, and `FormControlName`
* to keep the view synced with the `FormControl` model.
*
* If you have imported the `FormsModule` or the `ReactiveFormsModule`, this
* value accessor will be active on any select control that has a form directive. You do
* **not** need to add a special selector to activate it.
*
* ### How to use select controls with form directives
*
* To use a select in a template-driven form, simply add an `ngModel` and a `name`
* attribute to the main `<select>` tag.
*
* If your option values are simple strings, you can bind to the normal `value` property
* on the option. If your option values happen to be objects (and you'd like to save the
* selection in your form as an object), use `ngValue` instead:
*
* {@example forms/ts/selectControl/select_control_example.ts region='Component'}
*
* In reactive forms, you'll also want to add your form directive (`formControlName` or
* `formControl`) on the main `<select>` tag. Like in the former example, you have the
* choice of binding to the `value` or `ngValue` property on the select's options.
*
* {@example forms/ts/reactiveSelectControl/reactive_select_control_example.ts region='Component'}
*
* ### Caveat: Option selection
*
* Angular uses object identity to select option. It's possible for the identities of items
* to change while the data does not. This can happen, for example, if the items are produced
* from an RPC to the server, and that RPC is re-run. Even if the data hasn't changed, the
* second response will produce objects with different identities.
*
* To customize the default option comparison algorithm, `<select>` supports `compareWith` input.
* `compareWith` takes a **function** which has two arguments: `option1` and `option2`.
* If `compareWith` is given, Angular selects option by the return value of the function.
*
* #### Syntax
*
* ```
* <select [compareWith]="compareFn" [(ngModel)]="selectedCountries">
* <option *ngFor="let country of countries" [ngValue]="country">
* {{country.name}}
* </option>
* </select>
*
* compareFn(c1: Country, c2: Country): boolean {
* return c1 && c2 ? c1.id === c2.id : c1 === c2;
* }
* ```
*
* Note: We listen to the 'change' event because 'input' events aren't fired
* for selects in Firefox and IE:
* https://bugzilla.mozilla.org/show_bug.cgi?id=1024350
* https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4660045/
*
* * **npm package**: `@angular/forms`
*
*
*/
var SelectControlValueAccessor = /** @class */ (function () {
function SelectControlValueAccessor(_renderer, _elementRef) {
this._renderer = _renderer;
this._elementRef = _elementRef;
/** @internal */
this._optionMap = new Map();
/** @internal */
this._idCounter = 0;
this.onChange = function (_) { };
this.onTouched = function () { };
this._compareWith = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵlooseIdentical"];
}
Object.defineProperty(SelectControlValueAccessor.prototype, "compareWith", {
set: function (fn) {
if (typeof fn !== 'function') {
throw new Error("compareWith must be a function, but received " + JSON.stringify(fn));
}
this._compareWith = fn;
},
enumerable: true,
configurable: true
});
SelectControlValueAccessor.prototype.writeValue = function (value) {
this.value = value;
var id = this._getOptionId(value);
if (id == null) {
this._renderer.setProperty(this._elementRef.nativeElement, 'selectedIndex', -1);
}
var valueString = _buildValueString(id, value);
this._renderer.setProperty(this._elementRef.nativeElement, 'value', valueString);
};
SelectControlValueAccessor.prototype.registerOnChange = function (fn) {
var _this = this;
this.onChange = function (valueString) {
_this.value = _this._getOptionValue(valueString);
fn(_this.value);
};
};
SelectControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };
SelectControlValueAccessor.prototype.setDisabledState = function (isDisabled) {
this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
};
/** @internal */
SelectControlValueAccessor.prototype._registerOption = function () { return (this._idCounter++).toString(); };
/** @internal */
SelectControlValueAccessor.prototype._getOptionId = function (value) {
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(Array.from(this._optionMap.keys())), _b = _a.next(); !_b.done; _b = _a.next()) {
var id = _b.value;
if (this._compareWith(this._optionMap.get(id), value))
return id;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_1) throw e_1.error; }
}
return null;
var e_1, _c;
};
/** @internal */
SelectControlValueAccessor.prototype._getOptionValue = function (valueString) {
var id = _extractId(valueString);
return this._optionMap.has(id) ? this._optionMap.get(id) : valueString;
};
SelectControlValueAccessor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]',
host: { '(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },
providers: [SELECT_VALUE_ACCESSOR]
},] }
];
/** @nocollapse */
SelectControlValueAccessor.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }
]; };
SelectControlValueAccessor.propDecorators = {
compareWith: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }]
};
return SelectControlValueAccessor;
}());
/**
* @description
*
* Marks `<option>` as dynamic, so Angular can be notified when options change.
*
* See docs for `SelectControlValueAccessor` for usage examples.
*
*
*/
var NgSelectOption = /** @class */ (function () {
function NgSelectOption(_element, _renderer, _select) {
this._element = _element;
this._renderer = _renderer;
this._select = _select;
if (this._select)
this.id = this._select._registerOption();
}
Object.defineProperty(NgSelectOption.prototype, "ngValue", {
set: function (value) {
if (this._select == null)
return;
this._select._optionMap.set(this.id, value);
this._setElementValue(_buildValueString(this.id, value));
this._select.writeValue(this._select.value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgSelectOption.prototype, "value", {
set: function (value) {
this._setElementValue(value);
if (this._select)
this._select.writeValue(this._select.value);
},
enumerable: true,
configurable: true
});
/** @internal */
NgSelectOption.prototype._setElementValue = function (value) {
this._renderer.setProperty(this._element.nativeElement, 'value', value);
};
NgSelectOption.prototype.ngOnDestroy = function () {
if (this._select) {
this._select._optionMap.delete(this.id);
this._select.writeValue(this._select.value);
}
};
NgSelectOption.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: 'option' },] }
];
/** @nocollapse */
NgSelectOption.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
{ type: SelectControlValueAccessor, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Host"] }] }
]; };
NgSelectOption.propDecorators = {
ngValue: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngValue',] }],
value: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['value',] }]
};
return NgSelectOption;
}());
/**
* @license
* Copyright Google Inc. 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 SELECT_MULTIPLE_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return SelectMultipleControlValueAccessor; }),
multi: true
};
function _buildValueString$1(id, value) {
if (id == null)
return "" + value;
if (typeof value === 'string')
value = "'" + value + "'";
if (value && typeof value === 'object')
value = 'Object';
return (id + ": " + value).slice(0, 50);
}
function _extractId$1(valueString) {
return valueString.split(':')[0];
}
/**
* The accessor for writing a value and listening to changes on a select element.
*
* ### Caveat: Options selection
*
* Angular uses object identity to select options. It's possible for the identities of items
* to change while the data does not. This can happen, for example, if the items are produced
* from an RPC to the server, and that RPC is re-run. Even if the data hasn't changed, the
* second response will produce objects with different identities.
*
* To customize the default option comparison algorithm, `<select multiple>` supports `compareWith`
* input. `compareWith` takes a **function** which has two arguments: `option1` and `option2`.
* If `compareWith` is given, Angular selects options by the return value of the function.
*
* #### Syntax
*
* ```
* <select multiple [compareWith]="compareFn" [(ngModel)]="selectedCountries">
* <option *ngFor="let country of countries" [ngValue]="country">
* {{country.name}}
* </option>
* </select>
*
* compareFn(c1: Country, c2: Country): boolean {
* return c1 && c2 ? c1.id === c2.id : c1 === c2;
* }
* ```
*
*
*/
var SelectMultipleControlValueAccessor = /** @class */ (function () {
function SelectMultipleControlValueAccessor(_renderer, _elementRef) {
this._renderer = _renderer;
this._elementRef = _elementRef;
/** @internal */
this._optionMap = new Map();
/** @internal */
this._idCounter = 0;
this.onChange = function (_) { };
this.onTouched = function () { };
this._compareWith = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵlooseIdentical"];
}
Object.defineProperty(SelectMultipleControlValueAccessor.prototype, "compareWith", {
set: function (fn) {
if (typeof fn !== 'function') {
throw new Error("compareWith must be a function, but received " + JSON.stringify(fn));
}
this._compareWith = fn;
},
enumerable: true,
configurable: true
});
SelectMultipleControlValueAccessor.prototype.writeValue = function (value) {
var _this = this;
this.value = value;
var optionSelectedStateSetter;
if (Array.isArray(value)) {
// convert values to ids
var ids_1 = value.map(function (v) { return _this._getOptionId(v); });
optionSelectedStateSetter = function (opt, o) { opt._setSelected(ids_1.indexOf(o.toString()) > -1); };
}
else {
optionSelectedStateSetter = function (opt, o) { opt._setSelected(false); };
}
this._optionMap.forEach(optionSelectedStateSetter);
};
SelectMultipleControlValueAccessor.prototype.registerOnChange = function (fn) {
var _this = this;
this.onChange = function (_) {
var selected = [];
if (_.hasOwnProperty('selectedOptions')) {
var options = _.selectedOptions;
for (var i = 0; i < options.length; i++) {
var opt = options.item(i);
var val = _this._getOptionValue(opt.value);
selected.push(val);
}
}
else {
var options = _.options;
for (var i = 0; i < options.length; i++) {
var opt = options.item(i);
if (opt.selected) {
var val = _this._getOptionValue(opt.value);
selected.push(val);
}
}
}
_this.value = selected;
fn(selected);
};
};
SelectMultipleControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };
SelectMultipleControlValueAccessor.prototype.setDisabledState = function (isDisabled) {
this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
};
/** @internal */
SelectMultipleControlValueAccessor.prototype._registerOption = function (value) {
var id = (this._idCounter++).toString();
this._optionMap.set(id, value);
return id;
};
/** @internal */
SelectMultipleControlValueAccessor.prototype._getOptionId = function (value) {
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(Array.from(this._optionMap.keys())), _b = _a.next(); !_b.done; _b = _a.next()) {
var id = _b.value;
if (this._compareWith(this._optionMap.get(id)._value, value))
return id;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_1) throw e_1.error; }
}
return null;
var e_1, _c;
};
/** @internal */
SelectMultipleControlValueAccessor.prototype._getOptionValue = function (valueString) {
var id = _extractId$1(valueString);
return this._optionMap.has(id) ? this._optionMap.get(id)._value : valueString;
};
SelectMultipleControlValueAccessor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]',
host: { '(change)': 'onChange($event.target)', '(blur)': 'onTouched()' },
providers: [SELECT_MULTIPLE_VALUE_ACCESSOR]
},] }
];
/** @nocollapse */
SelectMultipleControlValueAccessor.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }
]; };
SelectMultipleControlValueAccessor.propDecorators = {
compareWith: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }]
};
return SelectMultipleControlValueAccessor;
}());
/**
* Marks `<option>` as dynamic, so Angular can be notified when options change.
*
* ### Example
*
* ```
* <select multiple name="city" ngModel>
* <option *ngFor="let c of cities" [value]="c"></option>
* </select>
* ```
*/
var NgSelectMultipleOption = /** @class */ (function () {
function NgSelectMultipleOption(_element, _renderer, _select) {
this._element = _element;
this._renderer = _renderer;
this._select = _select;
if (this._select) {
this.id = this._select._registerOption(this);
}
}
Object.defineProperty(NgSelectMultipleOption.prototype, "ngValue", {
set: function (value) {
if (this._select == null)
return;
this._value = value;
this._setElementValue(_buildValueString$1(this.id, value));
this._select.writeValue(this._select.value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgSelectMultipleOption.prototype, "value", {
set: function (value) {
if (this._select) {
this._value = value;
this._setElementValue(_buildValueString$1(this.id, value));
this._select.writeValue(this._select.value);
}
else {
this._setElementValue(value);
}
},
enumerable: true,
configurable: true
});
/** @internal */
NgSelectMultipleOption.prototype._setElementValue = function (value) {
this._renderer.setProperty(this._element.nativeElement, 'value', value);
};
/** @internal */
NgSelectMultipleOption.prototype._setSelected = function (selected) {
this._renderer.setProperty(this._element.nativeElement, 'selected', selected);
};
NgSelectMultipleOption.prototype.ngOnDestroy = function () {
if (this._select) {
this._select._optionMap.delete(this.id);
this._select.writeValue(this._select.value);
}
};
NgSelectMultipleOption.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: 'option' },] }
];
/** @nocollapse */
NgSelectMultipleOption.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
{ type: SelectMultipleControlValueAccessor, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Host"] }] }
]; };
NgSelectMultipleOption.propDecorators = {
ngValue: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngValue',] }],
value: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['value',] }]
};
return NgSelectMultipleOption;
}());
/**
* @license
* Copyright Google Inc. 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
*/
function controlPath(name, parent) {
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(parent.path, [name]);
}
function setUpControl(control, dir) {
if (!control)
_throwError(dir, 'Cannot find control with');
if (!dir.valueAccessor)
_throwError(dir, 'No value accessor for form control with');
control.validator = Validators.compose([control.validator, dir.validator]);
control.asyncValidator = Validators.composeAsync([control.asyncValidator, dir.asyncValidator]);
dir.valueAccessor.writeValue(control.value);
setUpViewChangePipeline(control, dir);
setUpModelChangePipeline(control, dir);
setUpBlurPipeline(control, dir);
if (dir.valueAccessor.setDisabledState) {
control.registerOnDisabledChange(function (isDisabled) { dir.valueAccessor.setDisabledState(isDisabled); });
}
// re-run validation when validator binding changes, e.g. minlength=3 -> minlength=4
dir._rawValidators.forEach(function (validator) {
if (validator.registerOnValidatorChange)
validator.registerOnValidatorChange(function () { return control.updateValueAndValidity(); });
});
dir._rawAsyncValidators.forEach(function (validator) {
if (validator.registerOnValidatorChange)
validator.registerOnValidatorChange(function () { return control.updateValueAndValidity(); });
});
}
function cleanUpControl(control, dir) {
dir.valueAccessor.registerOnChange(function () { return _noControlError(dir); });
dir.valueAccessor.registerOnTouched(function () { return _noControlError(dir); });
dir._rawValidators.forEach(function (validator) {
if (validator.registerOnValidatorChange) {
validator.registerOnValidatorChange(null);
}
});
dir._rawAsyncValidators.forEach(function (validator) {
if (validator.registerOnValidatorChange) {
validator.registerOnValidatorChange(null);
}
});
if (control)
control._clearChangeFns();
}
function setUpViewChangePipeline(control, dir) {
dir.valueAccessor.registerOnChange(function (newValue) {
control._pendingValue = newValue;
control._pendingChange = true;
control._pendingDirty = true;
if (control.updateOn === 'change')
updateControl(control, dir);
});
}
function setUpBlurPipeline(control, dir) {
dir.valueAccessor.registerOnTouched(function () {
control._pendingTouched = true;
if (control.updateOn === 'blur' && control._pendingChange)
updateControl(control, dir);
if (control.updateOn !== 'submit')
control.markAsTouched();
});
}
function updateControl(control, dir) {
if (control._pendingDirty)
control.markAsDirty();
control.setValue(control._pendingValue, { emitModelToViewChange: false });
dir.viewToModelUpdate(control._pendingValue);
control._pendingChange = false;
}
function setUpModelChangePipeline(control, dir) {
control.registerOnChange(function (newValue, emitModelEvent) {
// control -> view
dir.valueAccessor.writeValue(newValue);
// control -> ngModel
if (emitModelEvent)
dir.viewToModelUpdate(newValue);
});
}
function setUpFormContainer(control, dir) {
if (control == null)
_throwError(dir, 'Cannot find control with');
control.validator = Validators.compose([control.validator, dir.validator]);
control.asyncValidator = Validators.composeAsync([control.asyncValidator, dir.asyncValidator]);
}
function _noControlError(dir) {
return _throwError(dir, 'There is no FormControl instance attached to form control element with');
}
function _throwError(dir, message) {
var messageEnd;
if (dir.path.length > 1) {
messageEnd = "path: '" + dir.path.join(' -> ') + "'";
}
else if (dir.path[0]) {
messageEnd = "name: '" + dir.path + "'";
}
else {
messageEnd = 'unspecified name attribute';
}
throw new Error(message + " " + messageEnd);
}
function composeValidators(validators) {
return validators != null ? Validators.compose(validators.map(normalizeValidator)) : null;
}
function composeAsyncValidators(validators) {
return validators != null ? Validators.composeAsync(validators.map(normalizeAsyncValidator)) :
null;
}
function isPropertyUpdated(changes, viewModel) {
if (!changes.hasOwnProperty('model'))
return false;
var change = changes['model'];
if (change.isFirstChange())
return true;
return !Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵlooseIdentical"])(viewModel, change.currentValue);
}
var BUILTIN_ACCESSORS = [
CheckboxControlValueAccessor,
RangeValueAccessor,
NumberValueAccessor,
SelectControlValueAccessor,
SelectMultipleControlValueAccessor,
RadioControlValueAccessor,
];
function isBuiltInAccessor(valueAccessor) {
return BUILTIN_ACCESSORS.some(function (a) { return valueAccessor.constructor === a; });
}
function syncPendingControls(form, directives) {
form._syncPendingControls();
directives.forEach(function (dir) {
var control = dir.control;
if (control.updateOn === 'submit' && control._pendingChange) {
dir.viewToModelUpdate(control._pendingValue);
control._pendingChange = false;
}
});
}
// TODO: vsavkin remove it once https://github.com/angular/angular/issues/3011 is implemented
function selectValueAccessor(dir, valueAccessors) {
if (!valueAccessors)
return null;
if (!Array.isArray(valueAccessors))
_throwError(dir, 'Value accessor was not provided as an array for form control with');
var defaultAccessor = undefined;
var builtinAccessor = undefined;
var customAccessor = undefined;
valueAccessors.forEach(function (v) {
if (v.constructor === DefaultValueAccessor) {
defaultAccessor = v;
}
else if (isBuiltInAccessor(v)) {
if (builtinAccessor)
_throwError(dir, 'More than one built-in value accessor matches form control with');
builtinAccessor = v;
}
else {
if (customAccessor)
_throwError(dir, 'More than one custom value accessor matches form control with');
customAccessor = v;
}
});
if (customAccessor)
return customAccessor;
if (builtinAccessor)
return builtinAccessor;
if (defaultAccessor)
return defaultAccessor;
_throwError(dir, 'No valid value accessor for form control with');
return null;
}
function removeDir(list, el) {
var index = list.indexOf(el);
if (index > -1)
list.splice(index, 1);
}
// TODO(kara): remove after deprecation period
function _ngModelWarning(name, type, instance, warningConfig) {
if (!Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["isDevMode"])() || warningConfig === 'never')
return;
if (((warningConfig === null || warningConfig === 'once') && !type._ngModelWarningSentOnce) ||
(warningConfig === 'always' && !instance._ngModelWarningSent)) {
ReactiveErrors.ngModelWarning(name);
type._ngModelWarningSentOnce = true;
instance._ngModelWarningSent = true;
}
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* This is a base class for code shared between `NgModelGroup` and `FormGroupName`.
*
*
*/
var AbstractFormGroupDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(AbstractFormGroupDirective, _super);
function AbstractFormGroupDirective() {
return _super !== null && _super.apply(this, arguments) || this;
}
AbstractFormGroupDirective.prototype.ngOnInit = function () {
this._checkParentType();
this.formDirective.addFormGroup(this);
};
AbstractFormGroupDirective.prototype.ngOnDestroy = function () {
if (this.formDirective) {
this.formDirective.removeFormGroup(this);
}
};
Object.defineProperty(AbstractFormGroupDirective.prototype, "control", {
/**
* Get the `FormGroup` backing this binding.
*/
get: function () { return this.formDirective.getFormGroup(this); },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractFormGroupDirective.prototype, "path", {
/**
* Get the path to this control group.
*/
get: function () { return controlPath(this.name, this._parent); },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractFormGroupDirective.prototype, "formDirective", {
/**
* Get the `Form` to which this group belongs.
*/
get: function () { return this._parent ? this._parent.formDirective : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractFormGroupDirective.prototype, "validator", {
get: function () { return composeValidators(this._validators); },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractFormGroupDirective.prototype, "asyncValidator", {
get: function () {
return composeAsyncValidators(this._asyncValidators);
},
enumerable: true,
configurable: true
});
/** @internal */
AbstractFormGroupDirective.prototype._checkParentType = function () { };
return AbstractFormGroupDirective;
}(ControlContainer));
/**
* @license
* Copyright Google Inc. 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 AbstractControlStatus = /** @class */ (function () {
function AbstractControlStatus(cd) {
this._cd = cd;
}
Object.defineProperty(AbstractControlStatus.prototype, "ngClassUntouched", {
get: function () { return this._cd.control ? this._cd.control.untouched : false; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlStatus.prototype, "ngClassTouched", {
get: function () { return this._cd.control ? this._cd.control.touched : false; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlStatus.prototype, "ngClassPristine", {
get: function () { return this._cd.control ? this._cd.control.pristine : false; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlStatus.prototype, "ngClassDirty", {
get: function () { return this._cd.control ? this._cd.control.dirty : false; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlStatus.prototype, "ngClassValid", {
get: function () { return this._cd.control ? this._cd.control.valid : false; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlStatus.prototype, "ngClassInvalid", {
get: function () { return this._cd.control ? this._cd.control.invalid : false; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControlStatus.prototype, "ngClassPending", {
get: function () { return this._cd.control ? this._cd.control.pending : false; },
enumerable: true,
configurable: true
});
return AbstractControlStatus;
}());
var ngControlStatusHost = {
'[class.ng-untouched]': 'ngClassUntouched',
'[class.ng-touched]': 'ngClassTouched',
'[class.ng-pristine]': 'ngClassPristine',
'[class.ng-dirty]': 'ngClassDirty',
'[class.ng-valid]': 'ngClassValid',
'[class.ng-invalid]': 'ngClassInvalid',
'[class.ng-pending]': 'ngClassPending',
};
/**
* Directive automatically applied to Angular form controls that sets CSS classes
* based on control status. The following classes are applied as the properties
* become true:
*
* * ng-valid
* * ng-invalid
* * ng-pending
* * ng-pristine
* * ng-dirty
* * ng-untouched
* * ng-touched
*
*
*/
var NgControlStatus = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NgControlStatus, _super);
function NgControlStatus(cd) {
return _super.call(this, cd) || this;
}
NgControlStatus.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[formControlName],[ngModel],[formControl]', host: ngControlStatusHost },] }
];
/** @nocollapse */
NgControlStatus.ctorParameters = function () { return [
{ type: NgControl, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }] }
]; };
return NgControlStatus;
}(AbstractControlStatus));
/**
* Directive automatically applied to Angular form groups that sets CSS classes
* based on control status (valid/invalid/dirty/etc).
*
*
*/
var NgControlStatusGroup = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NgControlStatusGroup, _super);
function NgControlStatusGroup(cd) {
return _super.call(this, cd) || this;
}
NgControlStatusGroup.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]',
host: ngControlStatusHost
},] }
];
/** @nocollapse */
NgControlStatusGroup.ctorParameters = function () { return [
{ type: ControlContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }] }
]; };
return NgControlStatusGroup;
}(AbstractControlStatus));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Reports that a FormControl is valid, meaning that no errors exist in the input value.
*
* @see `status`
*/
var VALID = 'VALID';
/**
* Reports that a FormControl is invalid, meaning that an error exists in the input value.
*
* @see `status`
*/
var INVALID = 'INVALID';
/**
* Reports that a FormControl is pending, meaning that that async validation is occurring and
* errors are not yet available for the input value.
*
* @see `markAsPending`
* @see `status`
*/
var PENDING = 'PENDING';
/**
* Reports that a FormControl is disabled, meaning that the control is exempt from ancestor
* calculations of validity or value.
*
* @see `markAsDisabled`
* @see `status`
*/
var DISABLED = 'DISABLED';
function _find(control, path, delimiter) {
if (path == null)
return null;
if (!(path instanceof Array)) {
path = path.split(delimiter);
}
if (path instanceof Array && (path.length === 0))
return null;
return path.reduce(function (v, name) {
if (v instanceof FormGroup) {
return v.controls.hasOwnProperty(name) ? v.controls[name] : null;
}
if (v instanceof FormArray) {
return v.at(name) || null;
}
return null;
}, control);
}
function coerceToValidator(validatorOrOpts) {
var validator = (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators :
validatorOrOpts);
return Array.isArray(validator) ? composeValidators(validator) : validator || null;
}
function coerceToAsyncValidator(asyncValidator, validatorOrOpts) {
var origAsyncValidator = (isOptionsObj(validatorOrOpts) ? validatorOrOpts.asyncValidators :
asyncValidator);
return Array.isArray(origAsyncValidator) ? composeAsyncValidators(origAsyncValidator) :
origAsyncValidator || null;
}
function isOptionsObj(validatorOrOpts) {
return validatorOrOpts != null && !Array.isArray(validatorOrOpts) &&
typeof validatorOrOpts === 'object';
}
/**
* This is the base class for `FormControl`, `FormGroup`, and `FormArray`.
*
* It provides some of the shared behavior that all controls and groups of controls have, like
* running validators, calculating status, and resetting state. It also defines the properties
* that are shared between all sub-classes, like `value`, `valid`, and `dirty`. It shouldn't be
* instantiated directly.
*
* @see [Forms Guide](/guide/forms)
* @see [Reactive Forms Guide](/guide/reactive-forms)
* @see [Dynamic Forms Guide](/guide/dynamic-form)
*
*/
var AbstractControl = /** @class */ (function () {
/**
* Initialize the AbstractControl instance.
*
* @param validator The function that determines the synchronous validity of this control.
* @param asyncValidator The function that determines the asynchronous validity of this
* control.
*/
function AbstractControl(validator, asyncValidator) {
this.validator = validator;
this.asyncValidator = asyncValidator;
/** @internal */
this._onCollectionChange = function () { };
/**
* A control is `pristine` if the user has not yet changed
* the value in the UI.
*
* @returns True if the user has not yet changed the value in the UI; compare `dirty`.
* Programmatic changes to a control's value do not mark it dirty.
*/
this.pristine = true;
/**
* True if the control is marked as `touched`.
*
* A control is marked `touched` once the user has triggered
* a `blur` event on it.
*/
this.touched = false;
/** @internal */
this._onDisabledChange = [];
}
Object.defineProperty(AbstractControl.prototype, "parent", {
/**
* The parent control.
*/
get: function () { return this._parent; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControl.prototype, "valid", {
/**
* A control is `valid` when its `status` is `VALID`.
*
* @see `status`
*
* @returns True if the control has passed all of its validation tests,
* false otherwise.
*/
get: function () { return this.status === VALID; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControl.prototype, "invalid", {
/**
* A control is `invalid` when its `status` is `INVALID`.
*
* @see `status`
*
* @returns True if this control has failed one or more of its validation checks,
* false otherwise.
*/
get: function () { return this.status === INVALID; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControl.prototype, "pending", {
/**
* A control is `pending` when its `status` is `PENDING`.
*
* @see `status`
*
* @returns True if this control is in the process of conducting a validation check,
* false otherwise.
*/
get: function () { return this.status == PENDING; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControl.prototype, "disabled", {
/**
* A control is `disabled` when its `status` is `DISABLED`.
*
* @see `status`
*
* Disabled controls are exempt from validation checks and
* are not included in the aggregate value of their ancestor
* controls.
*
* @returns True if the control is disabled, false otherwise.
*/
get: function () { return this.status === DISABLED; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControl.prototype, "enabled", {
/**
* A control is `enabled` as long as its `status` is not `DISABLED`.
*
* @see `status`
*
* @returns True if the control has any status other than 'DISABLED',
* false if the status is 'DISABLED'.
*
*/
get: function () { return this.status !== DISABLED; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControl.prototype, "dirty", {
/**
* A control is `dirty` if the user has changed the value
* in the UI.
*
* @returns True if the user has changed the value of this control in the UI; compare `pristine`.
* Programmatic changes to a control's value do not mark it dirty.
*/
get: function () { return !this.pristine; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControl.prototype, "untouched", {
/**
* True if the control has not been marked as touched
*
* A control is `untouched` if the user has not yet triggered
* a `blur` event on it.
*/
get: function () { return !this.touched; },
enumerable: true,
configurable: true
});
Object.defineProperty(AbstractControl.prototype, "updateOn", {
/**
* Reports the update strategy of the `AbstractControl` (meaning
* the event on which the control updates itself).
* Possible values: `'change'` | `'blur'` | `'submit'`
* Default value: `'change'`
*/
get: function () {
return this._updateOn ? this._updateOn : (this.parent ? this.parent.updateOn : 'change');
},
enumerable: true,
configurable: true
});
/**
* Sets the synchronous validators that are active on this control. Calling
* this overwrites any existing sync validators.
*/
AbstractControl.prototype.setValidators = function (newValidator) {
this.validator = coerceToValidator(newValidator);
};
/**
* Sets the async validators that are active on this control. Calling this
* overwrites any existing async validators.
*/
AbstractControl.prototype.setAsyncValidators = function (newValidator) {
this.asyncValidator = coerceToAsyncValidator(newValidator);
};
/**
* Empties out the sync validator list.
*/
AbstractControl.prototype.clearValidators = function () { this.validator = null; };
/**
* Empties out the async validator list.
*/
AbstractControl.prototype.clearAsyncValidators = function () { this.asyncValidator = null; };
/**
* Marks the control as `touched`. A control is touched by focus and
* blur events that do not change the value; compare `markAsDirty`;
*
* @param opts Configuration options that determine how the control propagates changes
* and emits events events after marking is applied.
* * `onlySelf`: When true, mark only this control. When false or not supplied,
* marks all direct ancestors. Default is false.
*/
AbstractControl.prototype.markAsTouched = function (opts) {
if (opts === void 0) { opts = {}; }
this.touched = true;
if (this._parent && !opts.onlySelf) {
this._parent.markAsTouched(opts);
}
};
/**
* Marks the control as `untouched`.
*
* If the control has any children, also marks all children as `untouched`
* and recalculates the `touched` status of all parent controls.
*
* @param opts Configuration options that determine how the control propagates changes
* and emits events after the marking is applied.
* * `onlySelf`: When true, mark only this control. When false or not supplied,
* marks all direct ancestors. Default is false.
*/
AbstractControl.prototype.markAsUntouched = function (opts) {
if (opts === void 0) { opts = {}; }
this.touched = false;
this._pendingTouched = false;
this._forEachChild(function (control) { control.markAsUntouched({ onlySelf: true }); });
if (this._parent && !opts.onlySelf) {
this._parent._updateTouched(opts);
}
};
/**
* Marks the control as `dirty`. A control becomes dirty when
* the control's is changed through the UI; compare `markAsTouched`.
*
* @param opts Configuration options that determine how the control propagates changes
* and emits events after marking is applied.
* * `onlySelf`: When true, mark only this control. When false or not supplied,
* marks all direct ancestors. Default is false.
*/
AbstractControl.prototype.markAsDirty = function (opts) {
if (opts === void 0) { opts = {}; }
this.pristine = false;
if (this._parent && !opts.onlySelf) {
this._parent.markAsDirty(opts);
}
};
/**
* Marks the control as `pristine`.
*
* If the control has any children, marks all children as `pristine`,
* and recalculates the `pristine` status of all parent
* controls.
*
* @param opts Configuration options that determine how the control emits events after
* marking is applied.
* * `onlySelf`: When true, mark only this control. When false or not supplied,
* marks all direct ancestors. Default is false..
*/
AbstractControl.prototype.markAsPristine = function (opts) {
if (opts === void 0) { opts = {}; }
this.pristine = true;
this._pendingDirty = false;
this._forEachChild(function (control) { control.markAsPristine({ onlySelf: true }); });
if (this._parent && !opts.onlySelf) {
this._parent._updatePristine(opts);
}
};
/**
* Marks the control as `pending`.
*
* A control is pending while the control performs async validation.
*
* @param opts Configuration options that determine how the control propagates changes and
* emits events after marking is applied.
* * `onlySelf`: When true, mark only this control. When false or not supplied,
* marks all direct ancestors. Default is false..
* * `emitEvent`: When true or not supplied (the default), the `statusChanges`
* observable emits an event with the latest status the control is marked pending.
* When false, no events are emitted.
*
*/
AbstractControl.prototype.markAsPending = function (opts) {
if (opts === void 0) { opts = {}; }
this.status = PENDING;
if (opts.emitEvent !== false) {
this.statusChanges.emit(this.status);
}
if (this._parent && !opts.onlySelf) {
this._parent.markAsPending(opts);
}
};
/**
* Disables the control. This means the control is exempt from validation checks and
* excluded from the aggregate value of any parent. Its status is `DISABLED`.
*
* If the control has children, all children are also disabled.
*
* @param opts Configuration options that determine how the control propagates
* changes and emits events after the control is disabled.
* * `onlySelf`: When true, mark only this control. When false or not supplied,
* marks all direct ancestors. Default is false..
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control is disabled.
* When false, no events are emitted.
*/
AbstractControl.prototype.disable = function (opts) {
if (opts === void 0) { opts = {}; }
this.status = DISABLED;
this.errors = null;
this._forEachChild(function (control) { control.disable(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, opts, { onlySelf: true })); });
this._updateValue();
if (opts.emitEvent !== false) {
this.valueChanges.emit(this.value);
this.statusChanges.emit(this.status);
}
this._updateAncestors(opts);
this._onDisabledChange.forEach(function (changeFn) { return changeFn(true); });
};
/**
* Enables the control. This means the control is included in validation checks and
* the aggregate value of its parent. Its status recalculates based on its value and
* its validators.
*
* By default, if the control has children, all children are enabled.
*
* @param opts Configure options that control how the control propagates changes and
* emits events when marked as untouched
* * `onlySelf`: When true, mark only this control. When false or not supplied,
* marks all direct ancestors. Default is false..
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control is enabled.
* When false, no events are emitted.
*/
AbstractControl.prototype.enable = function (opts) {
if (opts === void 0) { opts = {}; }
this.status = VALID;
this._forEachChild(function (control) { control.enable(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, opts, { onlySelf: true })); });
this.updateValueAndValidity({ onlySelf: true, emitEvent: opts.emitEvent });
this._updateAncestors(opts);
this._onDisabledChange.forEach(function (changeFn) { return changeFn(false); });
};
AbstractControl.prototype._updateAncestors = function (opts) {
if (this._parent && !opts.onlySelf) {
this._parent.updateValueAndValidity(opts);
this._parent._updatePristine();
this._parent._updateTouched();
}
};
/**
* @param parent Sets the parent of the control
*/
AbstractControl.prototype.setParent = function (parent) { this._parent = parent; };
/**
* Recalculates the value and validation status of the control.
*
* By default, it also updates the value and validity of its ancestors.
*
* @param opts Configuration options determine how the control propagates changes and emits events
* after updates and validity checks are applied.
* * `onlySelf`: When true, only update this control. When false or not supplied,
* update all direct ancestors. Default is false..
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control is updated.
* When false, no events are emitted.
*/
AbstractControl.prototype.updateValueAndValidity = function (opts) {
if (opts === void 0) { opts = {}; }
this._setInitialStatus();
this._updateValue();
if (this.enabled) {
this._cancelExistingSubscription();
this.errors = this._runValidator();
this.status = this._calculateStatus();
if (this.status === VALID || this.status === PENDING) {
this._runAsyncValidator(opts.emitEvent);
}
}
if (opts.emitEvent !== false) {
this.valueChanges.emit(this.value);
this.statusChanges.emit(this.status);
}
if (this._parent && !opts.onlySelf) {
this._parent.updateValueAndValidity(opts);
}
};
/** @internal */
AbstractControl.prototype._updateTreeValidity = function (opts) {
if (opts === void 0) { opts = { emitEvent: true }; }
this._forEachChild(function (ctrl) { return ctrl._updateTreeValidity(opts); });
this.updateValueAndValidity({ onlySelf: true, emitEvent: opts.emitEvent });
};
AbstractControl.prototype._setInitialStatus = function () {
this.status = this._allControlsDisabled() ? DISABLED : VALID;
};
AbstractControl.prototype._runValidator = function () {
return this.validator ? this.validator(this) : null;
};
AbstractControl.prototype._runAsyncValidator = function (emitEvent) {
var _this = this;
if (this.asyncValidator) {
this.status = PENDING;
var obs = toObservable(this.asyncValidator(this));
this._asyncValidationSubscription =
obs.subscribe(function (errors) { return _this.setErrors(errors, { emitEvent: emitEvent }); });
}
};
AbstractControl.prototype._cancelExistingSubscription = function () {
if (this._asyncValidationSubscription) {
this._asyncValidationSubscription.unsubscribe();
}
};
/**
* Sets errors on a form control when running validations manually, rather than automatically.
*
* Calling `setErrors` also updates the validity of the parent control.
*
* ### Manually set the errors for a control
*
* ```
* const login = new FormControl('someLogin');
* login.setErrors({
* notUnique: true
* });
*
* expect(login.valid).toEqual(false);
* expect(login.errors).toEqual({ notUnique: true });
*
* login.setValue('someOtherLogin');
*
* expect(login.valid).toEqual(true);
* ```
*/
AbstractControl.prototype.setErrors = function (errors, opts) {
if (opts === void 0) { opts = {}; }
this.errors = errors;
this._updateControlsErrors(opts.emitEvent !== false);
};
/**
* Retrieves a child control given the control's name or path.
*
* @param path A dot-delimited string or array of string/number values that define the path to the
* control.
*
* ### Retrieve a nested control
*
* For example, to get a `name` control nested within a `person` sub-group:
*
* * `this.form.get('person.name');`
*
* -OR-
*
* * `this.form.get(['person', 'name']);`
*/
AbstractControl.prototype.get = function (path) { return _find(this, path, '.'); };
/**
* Reports error data for a specific error occurring in this control or in another control.
*
* @param errorCode The error code for which to retrieve data
* @param path The path to a control to check. If not supplied, checks for the error in this
* control.
*
* @returns The error data if the control with the given path has the given error, otherwise null
* or undefined.
*/
AbstractControl.prototype.getError = function (errorCode, path) {
var control = path ? this.get(path) : this;
return control && control.errors ? control.errors[errorCode] : null;
};
/**
* Reports whether the control with the given path has the error specified.
*
* @param errorCode The error code for which to retrieve data
* @param path The path to a control to check. If not supplied, checks for the error in this
* control.
* @returns True when the control with the given path has the error, otherwise false.
*/
AbstractControl.prototype.hasError = function (errorCode, path) { return !!this.getError(errorCode, path); };
Object.defineProperty(AbstractControl.prototype, "root", {
/**
* Retrieves the top-level ancestor of this control.
*/
get: function () {
var x = this;
while (x._parent) {
x = x._parent;
}
return x;
},
enumerable: true,
configurable: true
});
/** @internal */
AbstractControl.prototype._updateControlsErrors = function (emitEvent) {
this.status = this._calculateStatus();
if (emitEvent) {
this.statusChanges.emit(this.status);
}
if (this._parent) {
this._parent._updateControlsErrors(emitEvent);
}
};
/** @internal */
AbstractControl.prototype._initObservables = function () {
this.valueChanges = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
this.statusChanges = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
};
AbstractControl.prototype._calculateStatus = function () {
if (this._allControlsDisabled())
return DISABLED;
if (this.errors)
return INVALID;
if (this._anyControlsHaveStatus(PENDING))
return PENDING;
if (this._anyControlsHaveStatus(INVALID))
return INVALID;
return VALID;
};
/** @internal */
AbstractControl.prototype._anyControlsHaveStatus = function (status) {
return this._anyControls(function (control) { return control.status === status; });
};
/** @internal */
AbstractControl.prototype._anyControlsDirty = function () {
return this._anyControls(function (control) { return control.dirty; });
};
/** @internal */
AbstractControl.prototype._anyControlsTouched = function () {
return this._anyControls(function (control) { return control.touched; });
};
/** @internal */
AbstractControl.prototype._updatePristine = function (opts) {
if (opts === void 0) { opts = {}; }
this.pristine = !this._anyControlsDirty();
if (this._parent && !opts.onlySelf) {
this._parent._updatePristine(opts);
}
};
/** @internal */
AbstractControl.prototype._updateTouched = function (opts) {
if (opts === void 0) { opts = {}; }
this.touched = this._anyControlsTouched();
if (this._parent && !opts.onlySelf) {
this._parent._updateTouched(opts);
}
};
/** @internal */
AbstractControl.prototype._isBoxedValue = function (formState) {
return typeof formState === 'object' && formState !== null &&
Object.keys(formState).length === 2 && 'value' in formState && 'disabled' in formState;
};
/** @internal */
AbstractControl.prototype._registerOnCollectionChange = function (fn) { this._onCollectionChange = fn; };
/** @internal */
AbstractControl.prototype._setUpdateStrategy = function (opts) {
if (isOptionsObj(opts) && opts.updateOn != null) {
this._updateOn = opts.updateOn;
}
};
return AbstractControl;
}());
/**
* Tracks the value and validation status of an individual form control.
*
* This is one of the three fundamental building blocks of Angular forms, along with
* `FormGroup` and `FormArray`. It extends the `AbstractControl` class that
* implements most of the base functionality for accessing the value, validation status,
* user interactions and events.
*
* @see `AbstractControl`
* @see [Reactive Forms Guide](guide/reactive-forms)
* @see [Usage Notes](#usage-notes)
*
* @usageNotes
*
* ### Initializing Form Controls
*
* Instantiate a `FormControl`, with an initial value.
*
* ```ts
* const ctrl = new FormControl('some value');
* console.log(ctrl.value); // 'some value'
*```
*
* The following example initializes the control with a form state object. The `value`
* and `disabled` keys are required in this case.
*
* ```ts
* const ctrl = new FormControl({ value: 'n/a', disabled: true });
* console.log(ctrl.value); // 'n/a'
* console.log(ctrl.status); // 'DISABLED'
* ```
*
* The following example initializes the control with a sync validator.
*
* ```ts
* const ctrl = new FormControl('', Validators.required);
* console.log(ctrl.value); // ''
* console.log(ctrl.status); // 'INVALID'
* ```
*
* The following example initializes the control using an options object.
*
* ```ts
* const ctrl = new FormControl('', {
* validators: Validators.required,
* asyncValidators: myAsyncValidator
* });
* ```
*
* ### Configure the control to update on a blur event
*
* Set the `updateOn` option to `'blur'` to update on the blur `event`.
*
* ```ts
* const ctrl = new FormControl('', { updateOn: 'blur' });
* ```
*
* ### Configure the control to update on a submit event
*
* Set the `updateOn` option to `'submit'` to update on a submit `event`.
*
* ```ts
* const ctrl = new FormControl('', { updateOn: 'submit' });
* ```
*
* ### Reset the control back to an initial value
*
* You reset to a specific form state by passing through a standalone
* value or a form state object that contains both a value and a disabled state
* (these are the only two properties that cannot be calculated).
*
* ```ts
* const ctrl = new FormControl('Nancy');
*
* console.log(control.value); // 'Nancy'
*
* control.reset('Drew');
*
* console.log(control.value); // 'Drew'
* ```
*
* ### Reset the control back to an initial value and disabled
*
* ```
* const ctrl = new FormControl('Nancy');
*
* console.log(control.value); // 'Nancy'
* console.log(this.control.status); // 'DISABLED'
*
* control.reset({ value: 'Drew', disabled: true });
*
* console.log(this.control.value); // 'Drew'
* console.log(this.control.status); // 'DISABLED'
*
*/
var FormControl = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FormControl, _super);
/**
* Creates a new `FormControl` instance.
*
* @param formState Initializes the control with an initial state value,
* or with an object that defines the initial value, status, and options
* for handling updates and validation.
*
* @param validatorOrOpts A synchronous validator function, or an array of
* such functions, or an `AbstractControlOptions` object that contains validation functions
* and a validation trigger.
*
* @param asyncValidator A single async validator or array of async validator functions
*
*/
function FormControl(formState, validatorOrOpts, asyncValidator) {
if (formState === void 0) { formState = null; }
var _this = _super.call(this, coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)) || this;
/** @internal */
_this._onChange = [];
_this._applyFormState(formState);
_this._setUpdateStrategy(validatorOrOpts);
_this.updateValueAndValidity({ onlySelf: true, emitEvent: false });
_this._initObservables();
return _this;
}
/**
* Sets a new value for the form control.
*
* @param value The new value for the control.
* @param options Configuration options that determine how the control proopagates changes
* and emits events when the value changes.
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
* updateValueAndValidity} method.
*
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
* false.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control value is updated.
* When false, no events are emitted.
* * `emitModelToViewChange`: When true or not supplied (the default), each change triggers an
* `onChange` event to
* update the view.
* * `emitViewToModelChange`: When true or not supplied (the default), each change triggers an
* `ngModelChange`
* event to update the model.
*
*/
FormControl.prototype.setValue = function (value, options) {
var _this = this;
if (options === void 0) { options = {}; }
this.value = this._pendingValue = value;
if (this._onChange.length && options.emitModelToViewChange !== false) {
this._onChange.forEach(function (changeFn) { return changeFn(_this.value, options.emitViewToModelChange !== false); });
}
this.updateValueAndValidity(options);
};
/**
* Patches the value of a control.
*
* This function is functionally the same as {@link FormControl#setValue setValue} at this level.
* It exists for symmetry with {@link FormGroup#patchValue patchValue} on `FormGroups` and
* `FormArrays`, where it does behave differently.
*
* @see `setValue` for options
*/
FormControl.prototype.patchValue = function (value, options) {
if (options === void 0) { options = {}; }
this.setValue(value, options);
};
/**
* Resets the form control, marking it `pristine` and `untouched`, and setting
* the value to null.
*
* @param formState Initializes the control with an initial state value,
* or with an object that defines the initial value, status, and options
* for handling updates and validation.
*
* @param options Configuration options that determine how the control propagates changes
* and emits events after the value changes.
*
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
* false.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control is reset.
* When false, no events are emitted.
*
*/
FormControl.prototype.reset = function (formState, options) {
if (formState === void 0) { formState = null; }
if (options === void 0) { options = {}; }
this._applyFormState(formState);
this.markAsPristine(options);
this.markAsUntouched(options);
this.setValue(this.value, options);
this._pendingChange = false;
};
/**
* @internal
*/
FormControl.prototype._updateValue = function () { };
/**
* @internal
*/
FormControl.prototype._anyControls = function (condition) { return false; };
/**
* @internal
*/
FormControl.prototype._allControlsDisabled = function () { return this.disabled; };
/**
* Register a listener for change events.
*
* @param fn The method that is called when the value changes
*/
FormControl.prototype.registerOnChange = function (fn) { this._onChange.push(fn); };
/**
* @internal
*/
FormControl.prototype._clearChangeFns = function () {
this._onChange = [];
this._onDisabledChange = [];
this._onCollectionChange = function () { };
};
/**
* Register a listener for disabled events.
*
* @param fn The method that is called when the disabled status changes.
*/
FormControl.prototype.registerOnDisabledChange = function (fn) {
this._onDisabledChange.push(fn);
};
/**
* @internal
*/
FormControl.prototype._forEachChild = function (cb) { };
/** @internal */
FormControl.prototype._syncPendingControls = function () {
if (this.updateOn === 'submit') {
if (this._pendingDirty)
this.markAsDirty();
if (this._pendingTouched)
this.markAsTouched();
if (this._pendingChange) {
this.setValue(this._pendingValue, { onlySelf: true, emitModelToViewChange: false });
return true;
}
}
return false;
};
FormControl.prototype._applyFormState = function (formState) {
if (this._isBoxedValue(formState)) {
this.value = this._pendingValue = formState.value;
formState.disabled ? this.disable({ onlySelf: true, emitEvent: false }) :
this.enable({ onlySelf: true, emitEvent: false });
}
else {
this.value = this._pendingValue = formState;
}
};
return FormControl;
}(AbstractControl));
/**
* Tracks the value and validity state of a group of `FormControl` instances.
*
* A `FormGroup` aggregates the values of each child `FormControl` into one object,
* with each control name as the key. It calculates its status by reducing the status values
* of its children. For example, if one of the controls in a group is invalid, the entire
* group becomes invalid.
*
* `FormGroup` is one of the three fundamental building blocks used to define forms in Angular,
* along with `FormControl` and `FormArray`.
*
* When instantiating a `FormGroup`, pass in a collection of child controls as the first
* argument. The key for each child registers the name for the control.
*
* @usageNotes
*
* ### Create a form group with 2 controls
*
* ```
* const form = new FormGroup({
* first: new FormControl('Nancy', Validators.minLength(2)),
* last: new FormControl('Drew'),
* });
*
* console.log(form.value); // {first: 'Nancy', last; 'Drew'}
* console.log(form.status); // 'VALID'
* ```
*
* ### Create a form group with a group-level validator
*
* You include group-level validators as the second arg, or group-level async
* validators as the third arg. These come in handy when you want to perform validation
* that considers the value of more than one child control.
*
* ```
* const form = new FormGroup({
* password: new FormControl('', Validators.minLength(2)),
* passwordConfirm: new FormControl('', Validators.minLength(2)),
* }, passwordMatchValidator);
*
*
* function passwordMatchValidator(g: FormGroup) {
* return g.get('password').value === g.get('passwordConfirm').value
* ? null : {'mismatch': true};
* }
* ```
*
* Like `FormControl` instances, you choose to pass in
* validators and async validators as part of an options object.
*
* ```
* const form = new FormGroup({
* password: new FormControl('')
* passwordConfirm: new FormControl('')
* }, { validators: passwordMatchValidator, asyncValidators: otherValidator });
* ```
*
* ### Set the updateOn property for all controls in a form group
*
* The options object is used to set a default value for each child
* control's `updateOn` property. If you set `updateOn` to `'blur'` at the
* group level, all child controls default to 'blur', unless the child
* has explicitly specified a different `updateOn` value.
*
* ```ts
* const c = new FormGroup({
* one: new FormControl()
* }, { updateOn: 'blur' });
* ```
*/
var FormGroup = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FormGroup, _super);
/**
* Creates a new `FormGroup` instance.
*
* @param controls A collection of child controls. The key for each child is the name
* under which it is registered.
*
* @param validatorOrOpts A synchronous validator function, or an array of
* such functions, or an `AbstractControlOptions` object that contains validation functions
* and a validation trigger.
*
* @param asyncValidator A single async validator or array of async validator functions
*
*/
function FormGroup(controls, validatorOrOpts, asyncValidator) {
var _this = _super.call(this, coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)) || this;
_this.controls = controls;
_this._initObservables();
_this._setUpdateStrategy(validatorOrOpts);
_this._setUpControls();
_this.updateValueAndValidity({ onlySelf: true, emitEvent: false });
return _this;
}
/**
* Registers a control with the group's list of controls.
*
* This method does not update the value or validity of the control.
* Use {@link FormGroup#addControl addControl} instead.
*
* @param name The control name to register in the collection
* @param control Provides the control for the given name
*/
FormGroup.prototype.registerControl = function (name, control) {
if (this.controls[name])
return this.controls[name];
this.controls[name] = control;
control.setParent(this);
control._registerOnCollectionChange(this._onCollectionChange);
return control;
};
/**
* Add a control to this group.
*
* This method also updates the value and validity of the control.
*
* @param name The control name to add to the collection
* @param control Provides the control for the given name
*/
FormGroup.prototype.addControl = function (name, control) {
this.registerControl(name, control);
this.updateValueAndValidity();
this._onCollectionChange();
};
/**
* Remove a control from this group.
*
* @param name The control name to remove from the collection
*/
FormGroup.prototype.removeControl = function (name) {
if (this.controls[name])
this.controls[name]._registerOnCollectionChange(function () { });
delete (this.controls[name]);
this.updateValueAndValidity();
this._onCollectionChange();
};
/**
* Replace an existing control.
*
* @param name The control name to replace in the collection
* @param control Provides the control for the given name
*/
FormGroup.prototype.setControl = function (name, control) {
if (this.controls[name])
this.controls[name]._registerOnCollectionChange(function () { });
delete (this.controls[name]);
if (control)
this.registerControl(name, control);
this.updateValueAndValidity();
this._onCollectionChange();
};
/**
* Check whether there is an enabled control with the given name in the group.
*
* Reports false for disabled controls. If you'd like to check for existence in the group
* only, use {@link AbstractControl#get get} instead.
*
* @param name The control name to check for existence in the collection
*
* @returns false for disabled controls, true otherwise.
*/
FormGroup.prototype.contains = function (controlName) {
return this.controls.hasOwnProperty(controlName) && this.controls[controlName].enabled;
};
/**
* Sets the value of the `FormGroup`. It accepts an object that matches
* the structure of the group, with control names as keys.
*
* ### Set the complete value for the form group
*
* ```
* const form = new FormGroup({
* first: new FormControl(),
* last: new FormControl()
* });
*
* console.log(form.value); // {first: null, last: null}
*
* form.setValue({first: 'Nancy', last: 'Drew'});
* console.log(form.value); // {first: 'Nancy', last: 'Drew'}
*
* ```
* @throws When strict checks fail, such as setting the value of a control
* that doesn't exist or if you excluding the value of a control.
*
* @param value The new value for the control that matches the structure of the group.
* @param options Configuration options that determine how the control propagates changes
* and emits events after the value changes.
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
* updateValueAndValidity} method.
*
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
* false.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control value is updated.
* When false, no events are emitted.
*/
FormGroup.prototype.setValue = function (value, options) {
var _this = this;
if (options === void 0) { options = {}; }
this._checkAllValuesPresent(value);
Object.keys(value).forEach(function (name) {
_this._throwIfControlMissing(name);
_this.controls[name].setValue(value[name], { onlySelf: true, emitEvent: options.emitEvent });
});
this.updateValueAndValidity(options);
};
/**
* Patches the value of the `FormGroup`. It accepts an object with control
* names as keys, and does its best to match the values to the correct controls
* in the group.
*
* It accepts both super-sets and sub-sets of the group without throwing an error.
*
* ### Patch the value for a form group
*
* ```
* const form = new FormGroup({
* first: new FormControl(),
* last: new FormControl()
* });
* console.log(form.value); // {first: null, last: null}
*
* form.patchValue({first: 'Nancy'});
* console.log(form.value); // {first: 'Nancy', last: null}
*
* ```
*
* @param value The object that matches the structure of the group
* @param options Configure options that determines how the control propagates changes and
* emits events after the value is patched
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
* true.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control value is updated.
* When false, no events are emitted.
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
* updateValueAndValidity} method.
*/
FormGroup.prototype.patchValue = function (value, options) {
var _this = this;
if (options === void 0) { options = {}; }
Object.keys(value).forEach(function (name) {
if (_this.controls[name]) {
_this.controls[name].patchValue(value[name], { onlySelf: true, emitEvent: options.emitEvent });
}
});
this.updateValueAndValidity(options);
};
/**
* Resets the `FormGroup`, marks all descendants are marked `pristine` and `untouched`, and
* the value of all descendants to null.
*
* You reset to a specific form state by passing in a map of states
* that matches the structure of your form, with control names as keys. The state
* is a standalone value or a form state object with both a value and a disabled
* status.
*
* @param value Initializes the control with an initial state value,
* or with an object that defines the initial value, status,
* and options for handling updates and validation.
*
* @param options Configuration options that determine how the control propagates changes
* and emits events when the group is reset.
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
* false.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control is reset.
* When false, no events are emitted.
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
* updateValueAndValidity} method.
*
* @usageNotes
*
* ### Reset the form group values
*
* ```ts
* const form = new FormGroup({
* first: new FormControl('first name'),
* last: new FormControl('last name')
* });
*
* console.log(form.value); // {first: 'first name', last: 'last name'}
*
* form.reset({ first: 'name', last: 'last name' });
*
* console.log(form.value); // {first: 'name', last: 'last name'}
* ```
*
* ### Reset the form group values and disabled status
*
* ```
* const form = new FormGroup({
* first: new FormControl('first name'),
* last: new FormControl('last name')
* });
*
* form.reset({
* first: {value: 'name', disabled: true},
* last: 'last'
* });
*
* console.log(this.form.value); // {first: 'name', last: 'last name'}
* console.log(this.form.get('first').status); // 'DISABLED'
* ```
*/
FormGroup.prototype.reset = function (value, options) {
if (value === void 0) { value = {}; }
if (options === void 0) { options = {}; }
this._forEachChild(function (control, name) {
control.reset(value[name], { onlySelf: true, emitEvent: options.emitEvent });
});
this.updateValueAndValidity(options);
this._updatePristine(options);
this._updateTouched(options);
};
/**
* The aggregate value of the `FormGroup`, including any disabled controls.
*
* Retrieves all values regardless of disabled status.
* The `value` property is the best way to get the value of the group, because
* it excludes disabled controls in the `FormGroup`.
*/
FormGroup.prototype.getRawValue = function () {
return this._reduceChildren({}, function (acc, control, name) {
acc[name] = control instanceof FormControl ? control.value : control.getRawValue();
return acc;
});
};
/** @internal */
FormGroup.prototype._syncPendingControls = function () {
var subtreeUpdated = this._reduceChildren(false, function (updated, child) {
return child._syncPendingControls() ? true : updated;
});
if (subtreeUpdated)
this.updateValueAndValidity({ onlySelf: true });
return subtreeUpdated;
};
/** @internal */
FormGroup.prototype._throwIfControlMissing = function (name) {
if (!Object.keys(this.controls).length) {
throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");
}
if (!this.controls[name]) {
throw new Error("Cannot find form control with name: " + name + ".");
}
};
/** @internal */
FormGroup.prototype._forEachChild = function (cb) {
var _this = this;
Object.keys(this.controls).forEach(function (k) { return cb(_this.controls[k], k); });
};
/** @internal */
FormGroup.prototype._setUpControls = function () {
var _this = this;
this._forEachChild(function (control) {
control.setParent(_this);
control._registerOnCollectionChange(_this._onCollectionChange);
});
};
/** @internal */
FormGroup.prototype._updateValue = function () { this.value = this._reduceValue(); };
/** @internal */
FormGroup.prototype._anyControls = function (condition) {
var _this = this;
var res = false;
this._forEachChild(function (control, name) {
res = res || (_this.contains(name) && condition(control));
});
return res;
};
/** @internal */
FormGroup.prototype._reduceValue = function () {
var _this = this;
return this._reduceChildren({}, function (acc, control, name) {
if (control.enabled || _this.disabled) {
acc[name] = control.value;
}
return acc;
});
};
/** @internal */
FormGroup.prototype._reduceChildren = function (initValue, fn) {
var res = initValue;
this._forEachChild(function (control, name) { res = fn(res, control, name); });
return res;
};
/** @internal */
FormGroup.prototype._allControlsDisabled = function () {
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(Object.keys(this.controls)), _b = _a.next(); !_b.done; _b = _a.next()) {
var controlName = _b.value;
if (this.controls[controlName].enabled) {
return false;
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_1) throw e_1.error; }
}
return Object.keys(this.controls).length > 0 || this.disabled;
var e_1, _c;
};
/** @internal */
FormGroup.prototype._checkAllValuesPresent = function (value) {
this._forEachChild(function (control, name) {
if (value[name] === undefined) {
throw new Error("Must supply a value for form control with name: '" + name + "'.");
}
});
};
return FormGroup;
}(AbstractControl));
/**
* Tracks the value and validity state of an array of `FormControl`,
* `FormGroup` or `FormArray` instances.
*
* A `FormArray` aggregates the values of each child `FormControl` into an array.
* It calculates its status by reducing the status values of its children. For example, if one of
* the controls in a `FormArray` is invalid, the entire array becomes invalid.
*
* `FormArray` is one of the three fundamental building blocks used to define forms in Angular,
* along with `FormControl` and `FormGroup`.
*
* @usageNotes
*
* ### Create an array of form controls
*
* ```
* const arr = new FormArray([
* new FormControl('Nancy', Validators.minLength(2)),
* new FormControl('Drew'),
* ]);
*
* console.log(arr.value); // ['Nancy', 'Drew']
* console.log(arr.status); // 'VALID'
* ```
*
* ### Create a form array with array-level validators
*
* You include array-level validators and async validators. These come in handy
* when you want to perform validation that considers the value of more than one child
* control.
*
* The two types of validators are passed in separately as the second and third arg
* respectively, or together as part of an options object.
*
* ```
* const arr = new FormArray([
* new FormControl('Nancy'),
* new FormControl('Drew')
* ], {validators: myValidator, asyncValidators: myAsyncValidator});
* ```
*
* ### Set the updateOn property for all controls in a form array
*
* The options object is used to set a default value for each child
* control's `updateOn` property. If you set `updateOn` to `'blur'` at the
* array level, all child controls default to 'blur', unless the child
* has explicitly specified a different `updateOn` value.
*
* ```ts
* const arr = new FormArray([
* new FormControl()
* ], {updateOn: 'blur'});
* ```
*
* ### Adding or removing controls from a form array
*
* To change the controls in the array, use the `push`, `insert`, or `removeAt` methods
* in `FormArray` itself. These methods ensure the controls are properly tracked in the
* form's hierarchy. Do not modify the array of `AbstractControl`s used to instantiate
* the `FormArray` directly, as that result in strange and unexpected behavior such
* as broken change detection.
*
*
*/
var FormArray = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FormArray, _super);
/**
* Creates a new `FormArray` instance.
*
* @param controls An array of child controls. Each child control is given an index
* wheh it is registered.
*
* @param validatorOrOpts A synchronous validator function, or an array of
* such functions, or an `AbstractControlOptions` object that contains validation functions
* and a validation trigger.
*
* @param asyncValidator A single async validator or array of async validator functions
*
*/
function FormArray(controls, validatorOrOpts, asyncValidator) {
var _this = _super.call(this, coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)) || this;
_this.controls = controls;
_this._initObservables();
_this._setUpdateStrategy(validatorOrOpts);
_this._setUpControls();
_this.updateValueAndValidity({ onlySelf: true, emitEvent: false });
return _this;
}
/**
* Get the `AbstractControl` at the given `index` in the array.
*
* @param index Index in the array to retrieve the control
*/
FormArray.prototype.at = function (index) { return this.controls[index]; };
/**
* Insert a new `AbstractControl` at the end of the array.
*
* @param control Form control to be inserted
*/
FormArray.prototype.push = function (control) {
this.controls.push(control);
this._registerControl(control);
this.updateValueAndValidity();
this._onCollectionChange();
};
/**
* Insert a new `AbstractControl` at the given `index` in the array.
*
* @param index Index in the array to insert the control
* @param control Form control to be inserted
*/
FormArray.prototype.insert = function (index, control) {
this.controls.splice(index, 0, control);
this._registerControl(control);
this.updateValueAndValidity();
};
/**
* Remove the control at the given `index` in the array.
*
* @param index Index in the array to remove the control
*/
FormArray.prototype.removeAt = function (index) {
if (this.controls[index])
this.controls[index]._registerOnCollectionChange(function () { });
this.controls.splice(index, 1);
this.updateValueAndValidity();
};
/**
* Replace an existing control.
*
* @param index Index in the array to replace the control
* @param control The `AbstractControl` control to replace the existing control
*/
FormArray.prototype.setControl = function (index, control) {
if (this.controls[index])
this.controls[index]._registerOnCollectionChange(function () { });
this.controls.splice(index, 1);
if (control) {
this.controls.splice(index, 0, control);
this._registerControl(control);
}
this.updateValueAndValidity();
this._onCollectionChange();
};
Object.defineProperty(FormArray.prototype, "length", {
/**
* Length of the control array.
*/
get: function () { return this.controls.length; },
enumerable: true,
configurable: true
});
/**
* Sets the value of the `FormArray`. It accepts an array that matches
* the structure of the control.
*
* This method performs strict checks, and throws an error if you try
* to set the value of a control that doesn't exist or if you exclude the
* value of a control.
*
* ### Set the values for the controls in the form array
*
* ```
* const arr = new FormArray([
* new FormControl(),
* new FormControl()
* ]);
* console.log(arr.value); // [null, null]
*
* arr.setValue(['Nancy', 'Drew']);
* console.log(arr.value); // ['Nancy', 'Drew']
* ```
*
* @param value Array of values for the controls
* @param options Configure options that determine how the control propagates changes and
* emits events after the value changes
*
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default
* is false.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control value is updated.
* When false, no events are emitted.
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
* updateValueAndValidity} method.
*/
FormArray.prototype.setValue = function (value, options) {
var _this = this;
if (options === void 0) { options = {}; }
this._checkAllValuesPresent(value);
value.forEach(function (newValue, index) {
_this._throwIfControlMissing(index);
_this.at(index).setValue(newValue, { onlySelf: true, emitEvent: options.emitEvent });
});
this.updateValueAndValidity(options);
};
/**
* Patches the value of the `FormArray`. It accepts an array that matches the
* structure of the control, and does its best to match the values to the correct
* controls in the group.
*
* It accepts both super-sets and sub-sets of the array without throwing an error.
*
* ### Patch the values for controls in a form array
*
* ```
* const arr = new FormArray([
* new FormControl(),
* new FormControl()
* ]);
* console.log(arr.value); // [null, null]
*
* arr.patchValue(['Nancy']);
* console.log(arr.value); // ['Nancy', null]
* ```
*
* @param value Array of latest values for the controls
* @param options Configure options that determine how the control propagates changes and
* emits events after the value changes
*
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default
* is false.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control value is updated.
* When false, no events are emitted.
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
* updateValueAndValidity} method.
*/
FormArray.prototype.patchValue = function (value, options) {
var _this = this;
if (options === void 0) { options = {}; }
value.forEach(function (newValue, index) {
if (_this.at(index)) {
_this.at(index).patchValue(newValue, { onlySelf: true, emitEvent: options.emitEvent });
}
});
this.updateValueAndValidity(options);
};
/**
* Resets the `FormArray` and all descendants are marked `pristine` and `untouched`, and the
* value of all descendants to null or null maps.
*
* You reset to a specific form state by passing in an array of states
* that matches the structure of the control. The state is a standalone value
* or a form state object with both a value and a disabled status.
*
* ### Reset the values in a form array
*
* ```ts
* const arr = new FormArray([
* new FormControl(),
* new FormControl()
* ]);
* arr.reset(['name', 'last name']);
*
* console.log(this.arr.value); // ['name', 'last name']
* ```
*
* ### Reset the values in a form array and the disabled status for the first control
*
* ```
* this.arr.reset([
* {value: 'name', disabled: true},
* 'last'
* ]);
*
* console.log(this.arr.value); // ['name', 'last name']
* console.log(this.arr.get(0).status); // 'DISABLED'
* ```
*
* @param value Array of values for the controls
* @param options Configure options that determine how the control propagates changes and
* emits events after the value changes
*
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default
* is false.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control is reset.
* When false, no events are emitted.
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
* updateValueAndValidity} method.
*/
FormArray.prototype.reset = function (value, options) {
if (value === void 0) { value = []; }
if (options === void 0) { options = {}; }
this._forEachChild(function (control, index) {
control.reset(value[index], { onlySelf: true, emitEvent: options.emitEvent });
});
this.updateValueAndValidity(options);
this._updatePristine(options);
this._updateTouched(options);
};
/**
* The aggregate value of the array, including any disabled controls.
*
* Reports all values regardless of disabled status.
* For enabled controls only, the `value` property is the best way to get the value of the array.
*/
FormArray.prototype.getRawValue = function () {
return this.controls.map(function (control) {
return control instanceof FormControl ? control.value : control.getRawValue();
});
};
/** @internal */
FormArray.prototype._syncPendingControls = function () {
var subtreeUpdated = this.controls.reduce(function (updated, child) {
return child._syncPendingControls() ? true : updated;
}, false);
if (subtreeUpdated)
this.updateValueAndValidity({ onlySelf: true });
return subtreeUpdated;
};
/** @internal */
FormArray.prototype._throwIfControlMissing = function (index) {
if (!this.controls.length) {
throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");
}
if (!this.at(index)) {
throw new Error("Cannot find form control at index " + index);
}
};
/** @internal */
FormArray.prototype._forEachChild = function (cb) {
this.controls.forEach(function (control, index) { cb(control, index); });
};
/** @internal */
FormArray.prototype._updateValue = function () {
var _this = this;
this.value =
this.controls.filter(function (control) { return control.enabled || _this.disabled; })
.map(function (control) { return control.value; });
};
/** @internal */
FormArray.prototype._anyControls = function (condition) {
return this.controls.some(function (control) { return control.enabled && condition(control); });
};
/** @internal */
FormArray.prototype._setUpControls = function () {
var _this = this;
this._forEachChild(function (control) { return _this._registerControl(control); });
};
/** @internal */
FormArray.prototype._checkAllValuesPresent = function (value) {
this._forEachChild(function (control, i) {
if (value[i] === undefined) {
throw new Error("Must supply a value for form control at index: " + i + ".");
}
});
};
/** @internal */
FormArray.prototype._allControlsDisabled = function () {
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(this.controls), _b = _a.next(); !_b.done; _b = _a.next()) {
var control = _b.value;
if (control.enabled)
return false;
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_2) throw e_2.error; }
}
return this.controls.length > 0 || this.disabled;
var e_2, _c;
};
FormArray.prototype._registerControl = function (control) {
control.setParent(this);
control._registerOnCollectionChange(this._onCollectionChange);
};
return FormArray;
}(AbstractControl));
/**
* @license
* Copyright Google Inc. 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 formDirectiveProvider = {
provide: ControlContainer,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return NgForm; })
};
var resolvedPromise = Promise.resolve(null);
/**
* @description
*
* Creates a top-level `FormGroup` instance and binds it to a form
* to track aggregate form value and validation status.
*
* As soon as you import the `FormsModule`, this directive becomes active by default on
* all `<form>` tags. You don't need to add a special selector.
*
* You can export the directive into a local template variable using `ngForm` as the key
* (ex: `#myForm="ngForm"`). This is optional, but useful. Many properties from the underlying
* `FormGroup` instance are duplicated on the directive itself, so a reference to it
* will give you access to the aggregate value and validity status of the form, as well as
* user interaction properties like `dirty` and `touched`.
*
* To register child controls with the form, you'll want to use `NgModel` with a
* `name` attribute. You can also use `NgModelGroup` if you'd like to create
* sub-groups within the form.
*
* You can listen to the directive's `ngSubmit` event to be notified when the user has
* triggered a form submission. The `ngSubmit` event will be emitted with the original form
* submission event.
*
* In template driven forms, all `<form>` tags are automatically tagged as `NgForm`.
* If you want to import the `FormsModule` but skip its usage in some forms,
* for example, to use native HTML5 validation, you can add `ngNoForm` and the `<form>`
* tags won't create an `NgForm` directive. In reactive forms, using `ngNoForm` is
* unnecessary because the `<form>` tags are inert. In that case, you would
* refrain from using the `formGroup` directive.
*
* {@example forms/ts/simpleForm/simple_form_example.ts region='Component'}
*
* * **npm package**: `@angular/forms`
*
* * **NgModule**: `FormsModule`
*
*
*/
var NgForm = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NgForm, _super);
function NgForm(validators, asyncValidators) {
var _this = _super.call(this) || this;
_this.submitted = false;
_this._directives = [];
_this.ngSubmit = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
_this.form =
new FormGroup({}, composeValidators(validators), composeAsyncValidators(asyncValidators));
return _this;
}
NgForm.prototype.ngAfterViewInit = function () { this._setUpdateStrategy(); };
Object.defineProperty(NgForm.prototype, "formDirective", {
get: function () { return this; },
enumerable: true,
configurable: true
});
Object.defineProperty(NgForm.prototype, "control", {
get: function () { return this.form; },
enumerable: true,
configurable: true
});
Object.defineProperty(NgForm.prototype, "path", {
get: function () { return []; },
enumerable: true,
configurable: true
});
Object.defineProperty(NgForm.prototype, "controls", {
get: function () { return this.form.controls; },
enumerable: true,
configurable: true
});
NgForm.prototype.addControl = function (dir) {
var _this = this;
resolvedPromise.then(function () {
var container = _this._findContainer(dir.path);
dir.control =
container.registerControl(dir.name, dir.control);
setUpControl(dir.control, dir);
dir.control.updateValueAndValidity({ emitEvent: false });
_this._directives.push(dir);
});
};
NgForm.prototype.getControl = function (dir) { return this.form.get(dir.path); };
NgForm.prototype.removeControl = function (dir) {
var _this = this;
resolvedPromise.then(function () {
var container = _this._findContainer(dir.path);
if (container) {
container.removeControl(dir.name);
}
removeDir(_this._directives, dir);
});
};
NgForm.prototype.addFormGroup = function (dir) {
var _this = this;
resolvedPromise.then(function () {
var container = _this._findContainer(dir.path);
var group = new FormGroup({});
setUpFormContainer(group, dir);
container.registerControl(dir.name, group);
group.updateValueAndValidity({ emitEvent: false });
});
};
NgForm.prototype.removeFormGroup = function (dir) {
var _this = this;
resolvedPromise.then(function () {
var container = _this._findContainer(dir.path);
if (container) {
container.removeControl(dir.name);
}
});
};
NgForm.prototype.getFormGroup = function (dir) { return this.form.get(dir.path); };
NgForm.prototype.updateModel = function (dir, value) {
var _this = this;
resolvedPromise.then(function () {
var ctrl = _this.form.get(dir.path);
ctrl.setValue(value);
});
};
NgForm.prototype.setValue = function (value) { this.control.setValue(value); };
NgForm.prototype.onSubmit = function ($event) {
this.submitted = true;
syncPendingControls(this.form, this._directives);
this.ngSubmit.emit($event);
return false;
};
NgForm.prototype.onReset = function () { this.resetForm(); };
NgForm.prototype.resetForm = function (value) {
if (value === void 0) { value = undefined; }
this.form.reset(value);
this.submitted = false;
};
NgForm.prototype._setUpdateStrategy = function () {
if (this.options && this.options.updateOn != null) {
this.form._updateOn = this.options.updateOn;
}
};
/** @internal */
NgForm.prototype._findContainer = function (path) {
path.pop();
return path.length ? this.form.get(path) : this.form;
};
NgForm.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]',
providers: [formDirectiveProvider],
host: { '(submit)': 'onSubmit($event)', '(reset)': 'onReset()' },
outputs: ['ngSubmit'],
exportAs: 'ngForm'
},] }
];
/** @nocollapse */
NgForm.ctorParameters = function () { return [
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_VALIDATORS,] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] }
]; };
NgForm.propDecorators = {
options: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngFormOptions',] }]
};
return NgForm;
}(ControlContainer));
/**
* @license
* Copyright Google Inc. 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 TemplateDrivenErrors = /** @class */ (function () {
function TemplateDrivenErrors() {
}
TemplateDrivenErrors.modelParentException = function () {
throw new Error("\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\n formGroup's partner directive \"formControlName\" instead. Example:\n\n " + FormErrorExamples.formControlName + "\n\n Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:\n\n Example:\n\n " + FormErrorExamples.ngModelWithFormGroup);
};
TemplateDrivenErrors.formGroupNameException = function () {
throw new Error("\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n " + FormErrorExamples.formGroupName + "\n\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n " + FormErrorExamples.ngModelGroup);
};
TemplateDrivenErrors.missingNameException = function () {
throw new Error("If ngModel is used within a form tag, either the name attribute must be set or the form\n control must be defined as 'standalone' in ngModelOptions.\n\n Example 1: <input [(ngModel)]=\"person.firstName\" name=\"first\">\n Example 2: <input [(ngModel)]=\"person.firstName\" [ngModelOptions]=\"{standalone: true}\">");
};
TemplateDrivenErrors.modelGroupParentException = function () {
throw new Error("\n ngModelGroup cannot be used with a parent formGroup directive.\n\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n " + FormErrorExamples.formGroupName + "\n\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n " + FormErrorExamples.ngModelGroup);
};
return TemplateDrivenErrors;
}());
/**
* @license
* Copyright Google Inc. 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 modelGroupProvider = {
provide: ControlContainer,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return NgModelGroup; })
};
/**
* @description
*
* Creates and binds a `FormGroup` instance to a DOM element.
*
* This directive can only be used as a child of `NgForm` (or in other words,
* within `<form>` tags).
*
* Use this directive if you'd like to create a sub-group within a form. This can
* come in handy if you want to validate a sub-group of your form separately from
* the rest of your form, or if some values in your domain model make more sense to
* consume together in a nested object.
*
* Pass in the name you'd like this sub-group to have and it will become the key
* for the sub-group in the form's full value. You can also export the directive into
* a local template variable using `ngModelGroup` (ex: `#myGroup="ngModelGroup"`).
*
* {@example forms/ts/ngModelGroup/ng_model_group_example.ts region='Component'}
*
* * **npm package**: `@angular/forms`
*
* * **NgModule**: `FormsModule`
*
*
*/
var NgModelGroup = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NgModelGroup, _super);
function NgModelGroup(parent, validators, asyncValidators) {
var _this = _super.call(this) || this;
_this._parent = parent;
_this._validators = validators;
_this._asyncValidators = asyncValidators;
return _this;
}
/** @internal */
NgModelGroup.prototype._checkParentType = function () {
if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) {
TemplateDrivenErrors.modelGroupParentException();
}
};
NgModelGroup.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[ngModelGroup]', providers: [modelGroupProvider], exportAs: 'ngModelGroup' },] }
];
/** @nocollapse */
NgModelGroup.ctorParameters = function () { return [
{ type: ControlContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Host"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_VALIDATORS,] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] }
]; };
NgModelGroup.propDecorators = {
name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngModelGroup',] }]
};
return NgModelGroup;
}(AbstractFormGroupDirective));
/**
* @license
* Copyright Google Inc. 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 formControlBinding = {
provide: NgControl,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return NgModel; })
};
/**
* `ngModel` forces an additional change detection run when its inputs change:
* E.g.:
* ```
* <div>{{myModel.valid}}</div>
* <input [(ngModel)]="myValue" #myModel="ngModel">
* ```
* I.e. `ngModel` can export itself on the element and then be used in the template.
* Normally, this would result in expressions before the `input` that use the exported directive
* to have and old value as they have been
* dirty checked before. As this is a very common case for `ngModel`, we added this second change
* detection run.
*
* Notes:
* - this is just one extra run no matter how many `ngModel` have been changed.
* - this is a general problem when using `exportAs` for directives!
*/
var resolvedPromise$1 = Promise.resolve(null);
/**
* @description
*
* Creates a `FormControl` instance from a domain model and binds it
* to a form control element.
*
* The `FormControl` instance will track the value, user interaction, and
* validation status of the control and keep the view synced with the model. If used
* within a parent form, the directive will also register itself with the form as a child
* control.
*
* This directive can be used by itself or as part of a larger form. All you need is the
* `ngModel` selector to activate it.
*
* It accepts a domain model as an optional `Input`. If you have a one-way binding
* to `ngModel` with `[]` syntax, changing the value of the domain model in the component
* class will set the value in the view. If you have a two-way binding with `[()]` syntax
* (also known as 'banana-box syntax'), the value in the UI will always be synced back to
* the domain model in your class as well.
*
* If you wish to inspect the properties of the associated `FormControl` (like
* validity state), you can also export the directive into a local template variable using
* `ngModel` as the key (ex: `#myVar="ngModel"`). You can then access the control using the
* directive's `control` property, but most properties you'll need (like `valid` and `dirty`)
* will fall through to the control anyway, so you can access them directly. You can see a
* full list of properties directly available in `AbstractControlDirective`.
*
* The following is an example of a simple standalone control using `ngModel`:
*
* {@example forms/ts/simpleNgModel/simple_ng_model_example.ts region='Component'}
*
* When using the `ngModel` within `<form>` tags, you'll also need to supply a `name` attribute
* so that the control can be registered with the parent form under that name.
*
* It's worth noting that in the context of a parent form, you often can skip one-way or
* two-way binding because the parent form will sync the value for you. You can access
* its properties by exporting it into a local template variable using `ngForm` (ex:
* `#f="ngForm"`). Then you can pass it where it needs to go on submit.
*
* If you do need to populate initial values into your form, using a one-way binding for
* `ngModel` tends to be sufficient as long as you use the exported form's value rather
* than the domain model's value on submit.
*
* Take a look at an example of using `ngModel` within a form:
*
* {@example forms/ts/simpleForm/simple_form_example.ts region='Component'}
*
* To see `ngModel` examples with different form control types, see:
*
* * Radio buttons: `RadioControlValueAccessor`
* * Selects: `SelectControlValueAccessor`
*
* **npm package**: `@angular/forms`
*
* **NgModule**: `FormsModule`
*
*
*/
var NgModel = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NgModel, _super);
function NgModel(parent, validators, asyncValidators, valueAccessors) {
var _this = _super.call(this) || this;
_this.control = new FormControl();
/** @internal */
_this._registered = false;
_this.update = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
_this._parent = parent;
_this._rawValidators = validators || [];
_this._rawAsyncValidators = asyncValidators || [];
_this.valueAccessor = selectValueAccessor(_this, valueAccessors);
return _this;
}
NgModel.prototype.ngOnChanges = function (changes) {
this._checkForErrors();
if (!this._registered)
this._setUpControl();
if ('isDisabled' in changes) {
this._updateDisabled(changes);
}
if (isPropertyUpdated(changes, this.viewModel)) {
this._updateValue(this.model);
this.viewModel = this.model;
}
};
NgModel.prototype.ngOnDestroy = function () { this.formDirective && this.formDirective.removeControl(this); };
Object.defineProperty(NgModel.prototype, "path", {
get: function () {
return this._parent ? controlPath(this.name, this._parent) : [this.name];
},
enumerable: true,
configurable: true
});
Object.defineProperty(NgModel.prototype, "formDirective", {
get: function () { return this._parent ? this._parent.formDirective : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(NgModel.prototype, "validator", {
get: function () { return composeValidators(this._rawValidators); },
enumerable: true,
configurable: true
});
Object.defineProperty(NgModel.prototype, "asyncValidator", {
get: function () {
return composeAsyncValidators(this._rawAsyncValidators);
},
enumerable: true,
configurable: true
});
NgModel.prototype.viewToModelUpdate = function (newValue) {
this.viewModel = newValue;
this.update.emit(newValue);
};
NgModel.prototype._setUpControl = function () {
this._setUpdateStrategy();
this._isStandalone() ? this._setUpStandalone() :
this.formDirective.addControl(this);
this._registered = true;
};
NgModel.prototype._setUpdateStrategy = function () {
if (this.options && this.options.updateOn != null) {
this.control._updateOn = this.options.updateOn;
}
};
NgModel.prototype._isStandalone = function () {
return !this._parent || !!(this.options && this.options.standalone);
};
NgModel.prototype._setUpStandalone = function () {
setUpControl(this.control, this);
this.control.updateValueAndValidity({ emitEvent: false });
};
NgModel.prototype._checkForErrors = function () {
if (!this._isStandalone()) {
this._checkParentType();
}
this._checkName();
};
NgModel.prototype._checkParentType = function () {
if (!(this._parent instanceof NgModelGroup) &&
this._parent instanceof AbstractFormGroupDirective) {
TemplateDrivenErrors.formGroupNameException();
}
else if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) {
TemplateDrivenErrors.modelParentException();
}
};
NgModel.prototype._checkName = function () {
if (this.options && this.options.name)
this.name = this.options.name;
if (!this._isStandalone() && !this.name) {
TemplateDrivenErrors.missingNameException();
}
};
NgModel.prototype._updateValue = function (value) {
var _this = this;
resolvedPromise$1.then(function () { _this.control.setValue(value, { emitViewToModelChange: false }); });
};
NgModel.prototype._updateDisabled = function (changes) {
var _this = this;
var disabledValue = changes['isDisabled'].currentValue;
var isDisabled = disabledValue === '' || (disabledValue && disabledValue !== 'false');
resolvedPromise$1.then(function () {
if (isDisabled && !_this.control.disabled) {
_this.control.disable();
}
else if (!isDisabled && _this.control.disabled) {
_this.control.enable();
}
});
};
NgModel.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[ngModel]:not([formControlName]):not([formControl])',
providers: [formControlBinding],
exportAs: 'ngModel'
},] }
];
/** @nocollapse */
NgModel.ctorParameters = function () { return [
{ type: ControlContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Host"] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_VALIDATORS,] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_VALUE_ACCESSOR,] }] }
]; };
NgModel.propDecorators = {
name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
isDisabled: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['disabled',] }],
model: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngModel',] }],
options: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngModelOptions',] }],
update: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"], args: ['ngModelChange',] }]
};
return NgModel;
}(NgControl));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Token to provide to turn off the ngModel warning on formControl and formControlName.
*/
var NG_MODEL_WITH_FORM_CONTROL_WARNING = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('NgModelWithFormControlWarning');
var formControlBinding$1 = {
provide: NgControl,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return FormControlDirective; })
};
/**
* @description
*
* Syncs a standalone `FormControl` instance to a form control element.
*
* This directive ensures that any values written to the `FormControl`
* instance programmatically will be written to the DOM element (model -> view). Conversely,
* any values written to the DOM element through user input will be reflected in the
* `FormControl` instance (view -> model).
*
* Use this directive if you'd like to create and manage a `FormControl` instance directly.
* Simply create a `FormControl`, save it to your component class, and pass it into the
* `FormControlDirective`.
*
* This directive is designed to be used as a standalone control. Unlike `FormControlName`,
* it does not require that your `FormControl` instance be part of any parent
* `FormGroup`, and it won't be registered to any `FormGroupDirective` that
* exists above it.
*
* **Get the value**: the `value` property is always synced and available on the
* `FormControl` instance. See a full list of available properties in
* `AbstractControl`.
*
* **Set the value**: You can pass in an initial value when instantiating the `FormControl`,
* or you can set it programmatically later using {@link AbstractControl#setValue setValue} or
* {@link AbstractControl#patchValue patchValue}.
*
* **Listen to value**: If you want to listen to changes in the value of the control, you can
* subscribe to the {@link AbstractControl#valueChanges valueChanges} event. You can also listen to
* {@link AbstractControl#statusChanges statusChanges} to be notified when the validation status is
* re-calculated.
*
* ### Example
*
* {@example forms/ts/simpleFormControl/simple_form_control_example.ts region='Component'}
*
* * **npm package**: `@angular/forms`
*
* * **NgModule**: `ReactiveFormsModule`
*
* ### Use with ngModel
*
* Support for using the `ngModel` input property and `ngModelChange` event with reactive
* form directives has been deprecated in Angular v6 and will be removed in Angular v7.
*
* Now deprecated:
* ```html
* <input [formControl]="control" [(ngModel)]="value">
* ```
*
* ```ts
* this.value = 'some value';
* ```
*
* This has been deprecated for a few reasons. First, developers have found this pattern
* confusing. It seems like the actual `ngModel` directive is being used, but in fact it's
* an input/output property named `ngModel` on the reactive form directive that simply
* approximates (some of) its behavior. Specifically, it allows getting/setting the value
* and intercepting value events. However, some of `ngModel`'s other features - like
* delaying updates with`ngModelOptions` or exporting the directive - simply don't work,
* which has understandably caused some confusion.
*
* In addition, this pattern mixes template-driven and reactive forms strategies, which
* we generally don't recommend because it doesn't take advantage of the full benefits of
* either strategy. Setting the value in the template violates the template-agnostic
* principles behind reactive forms, whereas adding a `FormControl`/`FormGroup` layer in
* the class removes the convenience of defining forms in the template.
*
* To update your code before v7, you'll want to decide whether to stick with reactive form
* directives (and get/set values using reactive forms patterns) or switch over to
* template-driven directives.
*
* After (choice 1 - use reactive forms):
*
* ```html
* <input [formControl]="control">
* ```
*
* ```ts
* this.control.setValue('some value');
* ```
*
* After (choice 2 - use template-driven forms):
*
* ```html
* <input [(ngModel)]="value">
* ```
*
* ```ts
* this.value = 'some value';
* ```
*
* By default, when you use this pattern, you will see a deprecation warning once in dev
* mode. You can choose to silence this warning by providing a config for
* `ReactiveFormsModule` at import time:
*
* ```ts
* imports: [
* ReactiveFormsModule.withConfig({warnOnNgModelWithFormControl: 'never'});
* ]
* ```
*
* Alternatively, you can choose to surface a separate warning for each instance of this
* pattern with a config value of `"always"`. This may help to track down where in the code
* the pattern is being used as the code is being updated.
*
*
*/
var FormControlDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FormControlDirective, _super);
function FormControlDirective(validators, asyncValidators, valueAccessors, _ngModelWarningConfig) {
var _this = _super.call(this) || this;
_this._ngModelWarningConfig = _ngModelWarningConfig;
/** @deprecated as of v6 */
_this.update = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
/**
* Instance property used to track whether an ngModel warning has been sent out for this
* particular FormControlDirective instance. Used to support warning config of "always".
*
* @internal
*/
_this._ngModelWarningSent = false;
_this._rawValidators = validators || [];
_this._rawAsyncValidators = asyncValidators || [];
_this.valueAccessor = selectValueAccessor(_this, valueAccessors);
return _this;
}
Object.defineProperty(FormControlDirective.prototype, "isDisabled", {
set: function (isDisabled) { ReactiveErrors.disabledAttrWarning(); },
enumerable: true,
configurable: true
});
FormControlDirective.prototype.ngOnChanges = function (changes) {
if (this._isControlChanged(changes)) {
setUpControl(this.form, this);
if (this.control.disabled && this.valueAccessor.setDisabledState) {
this.valueAccessor.setDisabledState(true);
}
this.form.updateValueAndValidity({ emitEvent: false });
}
if (isPropertyUpdated(changes, this.viewModel)) {
_ngModelWarning('formControl', FormControlDirective, this, this._ngModelWarningConfig);
this.form.setValue(this.model);
this.viewModel = this.model;
}
};
Object.defineProperty(FormControlDirective.prototype, "path", {
get: function () { return []; },
enumerable: true,
configurable: true
});
Object.defineProperty(FormControlDirective.prototype, "validator", {
get: function () { return composeValidators(this._rawValidators); },
enumerable: true,
configurable: true
});
Object.defineProperty(FormControlDirective.prototype, "asyncValidator", {
get: function () {
return composeAsyncValidators(this._rawAsyncValidators);
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormControlDirective.prototype, "control", {
get: function () { return this.form; },
enumerable: true,
configurable: true
});
FormControlDirective.prototype.viewToModelUpdate = function (newValue) {
this.viewModel = newValue;
this.update.emit(newValue);
};
FormControlDirective.prototype._isControlChanged = function (changes) {
return changes.hasOwnProperty('form');
};
/**
* Static property used to track whether any ngModel warnings have been sent across
* all instances of FormControlDirective. Used to support warning config of "once".
*
* @internal
*/
FormControlDirective._ngModelWarningSentOnce = false;
FormControlDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[formControl]', providers: [formControlBinding$1], exportAs: 'ngForm' },] }
];
/** @nocollapse */
FormControlDirective.ctorParameters = function () { return [
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_VALIDATORS,] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_VALUE_ACCESSOR,] }] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_MODEL_WITH_FORM_CONTROL_WARNING,] }] }
]; };
FormControlDirective.propDecorators = {
form: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['formControl',] }],
isDisabled: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['disabled',] }],
model: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngModel',] }],
update: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"], args: ['ngModelChange',] }]
};
return FormControlDirective;
}(NgControl));
/**
* @license
* Copyright Google Inc. 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 formDirectiveProvider$1 = {
provide: ControlContainer,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return FormGroupDirective; })
};
/**
* @description
*
* Binds an existing `FormGroup` to a DOM element.
*
* This directive accepts an existing `FormGroup` instance. It will then use this
* `FormGroup` instance to match any child `FormControl`, `FormGroup`,
* and `FormArray` instances to child `FormControlName`, `FormGroupName`,
* and `FormArrayName` directives.
*
* **Set value**: You can set the form's initial value when instantiating the
* `FormGroup`, or you can set it programmatically later using the `FormGroup`'s
* {@link AbstractControl#setValue setValue} or {@link AbstractControl#patchValue patchValue}
* methods.
*
* **Listen to value**: If you want to listen to changes in the value of the form, you can subscribe
* to the `FormGroup`'s {@link AbstractControl#valueChanges valueChanges} event. You can also
* listen to its {@link AbstractControl#statusChanges statusChanges} event to be notified when the
* validation status is re-calculated.
*
* Furthermore, you can listen to the directive's `ngSubmit` event to be notified when the user has
* triggered a form submission. The `ngSubmit` event will be emitted with the original form
* submission event.
*
* ### Example
*
* In this example, we create form controls for first name and last name.
*
* {@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'}
*
* **npm package**: `@angular/forms`
*
* **NgModule**: `ReactiveFormsModule`
*
*
*/
var FormGroupDirective = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FormGroupDirective, _super);
function FormGroupDirective(_validators, _asyncValidators) {
var _this = _super.call(this) || this;
_this._validators = _validators;
_this._asyncValidators = _asyncValidators;
_this.submitted = false;
_this.directives = [];
_this.form = null;
_this.ngSubmit = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
return _this;
}
FormGroupDirective.prototype.ngOnChanges = function (changes) {
this._checkFormPresent();
if (changes.hasOwnProperty('form')) {
this._updateValidators();
this._updateDomValue();
this._updateRegistrations();
}
};
Object.defineProperty(FormGroupDirective.prototype, "formDirective", {
get: function () { return this; },
enumerable: true,
configurable: true
});
Object.defineProperty(FormGroupDirective.prototype, "control", {
get: function () { return this.form; },
enumerable: true,
configurable: true
});
Object.defineProperty(FormGroupDirective.prototype, "path", {
get: function () { return []; },
enumerable: true,
configurable: true
});
FormGroupDirective.prototype.addControl = function (dir) {
var ctrl = this.form.get(dir.path);
setUpControl(ctrl, dir);
ctrl.updateValueAndValidity({ emitEvent: false });
this.directives.push(dir);
return ctrl;
};
FormGroupDirective.prototype.getControl = function (dir) { return this.form.get(dir.path); };
FormGroupDirective.prototype.removeControl = function (dir) { removeDir(this.directives, dir); };
FormGroupDirective.prototype.addFormGroup = function (dir) {
var ctrl = this.form.get(dir.path);
setUpFormContainer(ctrl, dir);
ctrl.updateValueAndValidity({ emitEvent: false });
};
FormGroupDirective.prototype.removeFormGroup = function (dir) { };
FormGroupDirective.prototype.getFormGroup = function (dir) { return this.form.get(dir.path); };
FormGroupDirective.prototype.addFormArray = function (dir) {
var ctrl = this.form.get(dir.path);
setUpFormContainer(ctrl, dir);
ctrl.updateValueAndValidity({ emitEvent: false });
};
FormGroupDirective.prototype.removeFormArray = function (dir) { };
FormGroupDirective.prototype.getFormArray = function (dir) { return this.form.get(dir.path); };
FormGroupDirective.prototype.updateModel = function (dir, value) {
var ctrl = this.form.get(dir.path);
ctrl.setValue(value);
};
FormGroupDirective.prototype.onSubmit = function ($event) {
this.submitted = true;
syncPendingControls(this.form, this.directives);
this.ngSubmit.emit($event);
return false;
};
FormGroupDirective.prototype.onReset = function () { this.resetForm(); };
FormGroupDirective.prototype.resetForm = function (value) {
if (value === void 0) { value = undefined; }
this.form.reset(value);
this.submitted = false;
};
/** @internal */
FormGroupDirective.prototype._updateDomValue = function () {
var _this = this;
this.directives.forEach(function (dir) {
var newCtrl = _this.form.get(dir.path);
if (dir.control !== newCtrl) {
cleanUpControl(dir.control, dir);
if (newCtrl)
setUpControl(newCtrl, dir);
dir.control = newCtrl;
}
});
this.form._updateTreeValidity({ emitEvent: false });
};
FormGroupDirective.prototype._updateRegistrations = function () {
var _this = this;
this.form._registerOnCollectionChange(function () { return _this._updateDomValue(); });
if (this._oldForm)
this._oldForm._registerOnCollectionChange(function () { });
this._oldForm = this.form;
};
FormGroupDirective.prototype._updateValidators = function () {
var sync = composeValidators(this._validators);
this.form.validator = Validators.compose([this.form.validator, sync]);
var async = composeAsyncValidators(this._asyncValidators);
this.form.asyncValidator = Validators.composeAsync([this.form.asyncValidator, async]);
};
FormGroupDirective.prototype._checkFormPresent = function () {
if (!this.form) {
ReactiveErrors.missingFormException();
}
};
FormGroupDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[formGroup]',
providers: [formDirectiveProvider$1],
host: { '(submit)': 'onSubmit($event)', '(reset)': 'onReset()' },
exportAs: 'ngForm'
},] }
];
/** @nocollapse */
FormGroupDirective.ctorParameters = function () { return [
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_VALIDATORS,] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] }
]; };
FormGroupDirective.propDecorators = {
form: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['formGroup',] }],
ngSubmit: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] }]
};
return FormGroupDirective;
}(ControlContainer));
/**
* @license
* Copyright Google Inc. 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 formGroupNameProvider = {
provide: ControlContainer,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return FormGroupName; })
};
/**
* @description
*
* Syncs a nested `FormGroup` to a DOM element.
*
* This directive can only be used with a parent `FormGroupDirective` (selector:
* `[formGroup]`).
*
* It accepts the string name of the nested `FormGroup` you want to link, and
* will look for a `FormGroup` registered with that name in the parent
* `FormGroup` instance you passed into `FormGroupDirective`.
*
* Nested form groups can come in handy when you want to validate a sub-group of a
* form separately from the rest or when you'd like to group the values of certain
* controls into their own nested object.
*
* **Access the group**: You can access the associated `FormGroup` using the
* {@link AbstractControl#get get} method. Ex: `this.form.get('name')`.
*
* You can also access individual controls within the group using dot syntax.
* Ex: `this.form.get('name.first')`
*
* **Get the value**: the `value` property is always synced and available on the
* `FormGroup`. See a full list of available properties in `AbstractControl`.
*
* **Set the value**: You can set an initial value for each child control when instantiating
* the `FormGroup`, or you can set it programmatically later using
* {@link AbstractControl#setValue setValue} or {@link AbstractControl#patchValue patchValue}.
*
* **Listen to value**: If you want to listen to changes in the value of the group, you can
* subscribe to the {@link AbstractControl#valueChanges valueChanges} event. You can also listen to
* {@link AbstractControl#statusChanges statusChanges} to be notified when the validation status is
* re-calculated.
*
* ### Example
*
* {@example forms/ts/nestedFormGroup/nested_form_group_example.ts region='Component'}
*
* * **npm package**: `@angular/forms`
*
* * **NgModule**: `ReactiveFormsModule`
*
*
*/
var FormGroupName = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FormGroupName, _super);
function FormGroupName(parent, validators, asyncValidators) {
var _this = _super.call(this) || this;
_this._parent = parent;
_this._validators = validators;
_this._asyncValidators = asyncValidators;
return _this;
}
/** @internal */
FormGroupName.prototype._checkParentType = function () {
if (_hasInvalidParent(this._parent)) {
ReactiveErrors.groupParentException();
}
};
FormGroupName.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[formGroupName]', providers: [formGroupNameProvider] },] }
];
/** @nocollapse */
FormGroupName.ctorParameters = function () { return [
{ type: ControlContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Host"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_VALIDATORS,] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] }
]; };
FormGroupName.propDecorators = {
name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['formGroupName',] }]
};
return FormGroupName;
}(AbstractFormGroupDirective));
var formArrayNameProvider = {
provide: ControlContainer,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return FormArrayName; })
};
/**
* @description
*
* Syncs a nested `FormArray` to a DOM element.
*
* This directive is designed to be used with a parent `FormGroupDirective` (selector:
* `[formGroup]`).
*
* It accepts the string name of the nested `FormArray` you want to link, and
* will look for a `FormArray` registered with that name in the parent
* `FormGroup` instance you passed into `FormGroupDirective`.
*
* Nested form arrays can come in handy when you have a group of form controls but
* you're not sure how many there will be. Form arrays allow you to create new
* form controls dynamically.
*
* **Access the array**: You can access the associated `FormArray` using the
* {@link AbstractControl#get get} method on the parent `FormGroup`.
* Ex: `this.form.get('cities')`.
*
* **Get the value**: the `value` property is always synced and available on the
* `FormArray`. See a full list of available properties in `AbstractControl`.
*
* **Set the value**: You can set an initial value for each child control when instantiating
* the `FormArray`, or you can set the value programmatically later using the
* `FormArray`'s {@link AbstractControl#setValue setValue} or
* {@link AbstractControl#patchValue patchValue} methods.
*
* **Listen to value**: If you want to listen to changes in the value of the array, you can
* subscribe to the `FormArray`'s {@link AbstractControl#valueChanges valueChanges} event.
* You can also listen to its {@link AbstractControl#statusChanges statusChanges} event to be
* notified when the validation status is re-calculated.
*
* **Add new controls**: You can add new controls to the `FormArray` dynamically by calling
* its {@link FormArray#push push} method.
* Ex: `this.form.get('cities').push(new FormControl());`
*
* ### Example
*
* {@example forms/ts/nestedFormArray/nested_form_array_example.ts region='Component'}
*
* * **npm package**: `@angular/forms`
*
* * **NgModule**: `ReactiveFormsModule`
*
*
*/
var FormArrayName = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FormArrayName, _super);
function FormArrayName(parent, validators, asyncValidators) {
var _this = _super.call(this) || this;
_this._parent = parent;
_this._validators = validators;
_this._asyncValidators = asyncValidators;
return _this;
}
FormArrayName.prototype.ngOnInit = function () {
this._checkParentType();
this.formDirective.addFormArray(this);
};
FormArrayName.prototype.ngOnDestroy = function () {
if (this.formDirective) {
this.formDirective.removeFormArray(this);
}
};
Object.defineProperty(FormArrayName.prototype, "control", {
get: function () { return this.formDirective.getFormArray(this); },
enumerable: true,
configurable: true
});
Object.defineProperty(FormArrayName.prototype, "formDirective", {
get: function () {
return this._parent ? this._parent.formDirective : null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormArrayName.prototype, "path", {
get: function () { return controlPath(this.name, this._parent); },
enumerable: true,
configurable: true
});
Object.defineProperty(FormArrayName.prototype, "validator", {
get: function () { return composeValidators(this._validators); },
enumerable: true,
configurable: true
});
Object.defineProperty(FormArrayName.prototype, "asyncValidator", {
get: function () {
return composeAsyncValidators(this._asyncValidators);
},
enumerable: true,
configurable: true
});
FormArrayName.prototype._checkParentType = function () {
if (_hasInvalidParent(this._parent)) {
ReactiveErrors.arrayParentException();
}
};
FormArrayName.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[formArrayName]', providers: [formArrayNameProvider] },] }
];
/** @nocollapse */
FormArrayName.ctorParameters = function () { return [
{ type: ControlContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Host"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_VALIDATORS,] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] }
]; };
FormArrayName.propDecorators = {
name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['formArrayName',] }]
};
return FormArrayName;
}(ControlContainer));
function _hasInvalidParent(parent) {
return !(parent instanceof FormGroupName) && !(parent instanceof FormGroupDirective) &&
!(parent instanceof FormArrayName);
}
/**
* @license
* Copyright Google Inc. 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 controlNameBinding = {
provide: NgControl,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return FormControlName; })
};
/**
* @description
*
* Syncs a `FormControl` in an existing `FormGroup` to a form control
* element by name.
*
* This directive ensures that any values written to the `FormControl`
* instance programmatically will be written to the DOM element (model -> view). Conversely,
* any values written to the DOM element through user input will be reflected in the
* `FormControl` instance (view -> model).
*
* This directive is designed to be used with a parent `FormGroupDirective` (selector:
* `[formGroup]`).
*
* It accepts the string name of the `FormControl` instance you want to
* link, and will look for a `FormControl` registered with that name in the
* closest `FormGroup` or `FormArray` above it.
*
* **Access the control**: You can access the `FormControl` associated with
* this directive by using the {@link AbstractControl#get get} method.
* Ex: `this.form.get('first');`
*
* **Get value**: the `value` property is always synced and available on the `FormControl`.
* See a full list of available properties in `AbstractControl`.
*
* **Set value**: You can set an initial value for the control when instantiating the
* `FormControl`, or you can set it programmatically later using
* {@link AbstractControl#setValue setValue} or {@link AbstractControl#patchValue patchValue}.
*
* **Listen to value**: If you want to listen to changes in the value of the control, you can
* subscribe to the {@link AbstractControl#valueChanges valueChanges} event. You can also listen to
* {@link AbstractControl#statusChanges statusChanges} to be notified when the validation status is
* re-calculated.
*
* ### Example
*
* In this example, we create form controls for first name and last name.
*
* {@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'}
*
* To see `formControlName` examples with different form control types, see:
*
* * Radio buttons: `RadioControlValueAccessor`
* * Selects: `SelectControlValueAccessor`
*
* **npm package**: `@angular/forms`
*
* **NgModule**: `ReactiveFormsModule`
*
* ### Use with ngModel
*
* Support for using the `ngModel` input property and `ngModelChange` event with reactive
* form directives has been deprecated in Angular v6 and will be removed in Angular v7.
*
* Now deprecated:
* ```html
* <form [formGroup]="form">
* <input formControlName="first" [(ngModel)]="value">
* </form>
* ```
*
* ```ts
* this.value = 'some value';
* ```
*
* This has been deprecated for a few reasons. First, developers have found this pattern
* confusing. It seems like the actual `ngModel` directive is being used, but in fact it's
* an input/output property named `ngModel` on the reactive form directive that simply
* approximates (some of) its behavior. Specifically, it allows getting/setting the value
* and intercepting value events. However, some of `ngModel`'s other features - like
* delaying updates with`ngModelOptions` or exporting the directive - simply don't work,
* which has understandably caused some confusion.
*
* In addition, this pattern mixes template-driven and reactive forms strategies, which
* we generally don't recommend because it doesn't take advantage of the full benefits of
* either strategy. Setting the value in the template violates the template-agnostic
* principles behind reactive forms, whereas adding a `FormControl`/`FormGroup` layer in
* the class removes the convenience of defining forms in the template.
*
* To update your code before v7, you'll want to decide whether to stick with reactive form
* directives (and get/set values using reactive forms patterns) or switch over to
* template-driven directives.
*
* After (choice 1 - use reactive forms):
*
* ```html
* <form [formGroup]="form">
* <input formControlName="first">
* </form>
* ```
*
* ```ts
* this.form.get('first').setValue('some value');
* ```
*
* After (choice 2 - use template-driven forms):
*
* ```html
* <input [(ngModel)]="value">
* ```
*
* ```ts
* this.value = 'some value';
* ```
*
* By default, when you use this pattern, you will see a deprecation warning once in dev
* mode. You can choose to silence this warning by providing a config for
* `ReactiveFormsModule` at import time:
*
* ```ts
* imports: [
* ReactiveFormsModule.withConfig({warnOnNgModelWithFormControl: 'never'});
* ]
* ```
*
* Alternatively, you can choose to surface a separate warning for each instance of this
* pattern with a config value of `"always"`. This may help to track down where in the code
* the pattern is being used as the code is being updated.
*
*
*/
var FormControlName = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FormControlName, _super);
function FormControlName(parent, validators, asyncValidators, valueAccessors, _ngModelWarningConfig) {
var _this = _super.call(this) || this;
_this._ngModelWarningConfig = _ngModelWarningConfig;
_this._added = false;
/** @deprecated as of v6 */
_this.update = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
/**
* Instance property used to track whether an ngModel warning has been sent out for this
* particular FormControlName instance. Used to support warning config of "always".
*
* @internal
*/
_this._ngModelWarningSent = false;
_this._parent = parent;
_this._rawValidators = validators || [];
_this._rawAsyncValidators = asyncValidators || [];
_this.valueAccessor = selectValueAccessor(_this, valueAccessors);
return _this;
}
Object.defineProperty(FormControlName.prototype, "isDisabled", {
set: function (isDisabled) { ReactiveErrors.disabledAttrWarning(); },
enumerable: true,
configurable: true
});
FormControlName.prototype.ngOnChanges = function (changes) {
if (!this._added)
this._setUpControl();
if (isPropertyUpdated(changes, this.viewModel)) {
_ngModelWarning('formControlName', FormControlName, this, this._ngModelWarningConfig);
this.viewModel = this.model;
this.formDirective.updateModel(this, this.model);
}
};
FormControlName.prototype.ngOnDestroy = function () {
if (this.formDirective) {
this.formDirective.removeControl(this);
}
};
FormControlName.prototype.viewToModelUpdate = function (newValue) {
this.viewModel = newValue;
this.update.emit(newValue);
};
Object.defineProperty(FormControlName.prototype, "path", {
get: function () { return controlPath(this.name, this._parent); },
enumerable: true,
configurable: true
});
Object.defineProperty(FormControlName.prototype, "formDirective", {
get: function () { return this._parent ? this._parent.formDirective : null; },
enumerable: true,
configurable: true
});
Object.defineProperty(FormControlName.prototype, "validator", {
get: function () { return composeValidators(this._rawValidators); },
enumerable: true,
configurable: true
});
Object.defineProperty(FormControlName.prototype, "asyncValidator", {
get: function () {
return composeAsyncValidators(this._rawAsyncValidators);
},
enumerable: true,
configurable: true
});
FormControlName.prototype._checkParentType = function () {
if (!(this._parent instanceof FormGroupName) &&
this._parent instanceof AbstractFormGroupDirective) {
ReactiveErrors.ngModelGroupException();
}
else if (!(this._parent instanceof FormGroupName) && !(this._parent instanceof FormGroupDirective) &&
!(this._parent instanceof FormArrayName)) {
ReactiveErrors.controlParentException();
}
};
FormControlName.prototype._setUpControl = function () {
this._checkParentType();
this.control = this.formDirective.addControl(this);
if (this.control.disabled && this.valueAccessor.setDisabledState) {
this.valueAccessor.setDisabledState(true);
}
this._added = true;
};
/**
* Static property used to track whether any ngModel warnings have been sent across
* all instances of FormControlName. Used to support warning config of "once".
*
* @internal
*/
FormControlName._ngModelWarningSentOnce = false;
FormControlName.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[formControlName]', providers: [controlNameBinding] },] }
];
/** @nocollapse */
FormControlName.ctorParameters = function () { return [
{ type: ControlContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Host"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_VALIDATORS,] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] },
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_VALUE_ACCESSOR,] }] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [NG_MODEL_WITH_FORM_CONTROL_WARNING,] }] }
]; };
FormControlName.propDecorators = {
name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['formControlName',] }],
isDisabled: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['disabled',] }],
model: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['ngModel',] }],
update: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"], args: ['ngModelChange',] }]
};
return FormControlName;
}(NgControl));
/**
* @license
* Copyright Google Inc. 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 REQUIRED_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return RequiredValidator; }),
multi: true
};
var CHECKBOX_REQUIRED_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return CheckboxRequiredValidator; }),
multi: true
};
/**
* A Directive that adds the `required` validator to any controls marked with the
* `required` attribute, via the `NG_VALIDATORS` binding.
*
* ### Example
*
* ```
* <input name="fullName" ngModel required>
* ```
*
*
*/
var RequiredValidator = /** @class */ (function () {
function RequiredValidator() {
}
Object.defineProperty(RequiredValidator.prototype, "required", {
get: function () { return this._required; },
set: function (value) {
this._required = value != null && value !== false && "" + value !== 'false';
if (this._onChange)
this._onChange();
},
enumerable: true,
configurable: true
});
RequiredValidator.prototype.validate = function (c) {
return this.required ? Validators.required(c) : null;
};
RequiredValidator.prototype.registerOnValidatorChange = function (fn) { this._onChange = fn; };
RequiredValidator.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: ':not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]',
providers: [REQUIRED_VALIDATOR],
host: { '[attr.required]': 'required ? "" : null' }
},] }
];
RequiredValidator.propDecorators = {
required: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }]
};
return RequiredValidator;
}());
/**
* A Directive that adds the `required` validator to checkbox controls marked with the
* `required` attribute, via the `NG_VALIDATORS` binding.
*
* ### Example
*
* ```
* <input type="checkbox" name="active" ngModel required>
* ```
*
* @experimental
*/
var CheckboxRequiredValidator = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CheckboxRequiredValidator, _super);
function CheckboxRequiredValidator() {
return _super !== null && _super.apply(this, arguments) || this;
}
CheckboxRequiredValidator.prototype.validate = function (c) {
return this.required ? Validators.requiredTrue(c) : null;
};
CheckboxRequiredValidator.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]',
providers: [CHECKBOX_REQUIRED_VALIDATOR],
host: { '[attr.required]': 'required ? "" : null' }
},] }
];
return CheckboxRequiredValidator;
}(RequiredValidator));
/**
* Provider which adds `EmailValidator` to `NG_VALIDATORS`.
*/
var EMAIL_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return EmailValidator; }),
multi: true
};
/**
* A Directive that adds the `email` validator to controls marked with the
* `email` attribute, via the `NG_VALIDATORS` binding.
*
* ### Example
*
* ```
* <input type="email" name="email" ngModel email>
* <input type="email" name="email" ngModel email="true">
* <input type="email" name="email" ngModel [email]="true">
* ```
*
* @experimental
*/
var EmailValidator = /** @class */ (function () {
function EmailValidator() {
}
Object.defineProperty(EmailValidator.prototype, "email", {
set: function (value) {
this._enabled = value === '' || value === true || value === 'true';
if (this._onChange)
this._onChange();
},
enumerable: true,
configurable: true
});
EmailValidator.prototype.validate = function (c) {
return this._enabled ? Validators.email(c) : null;
};
EmailValidator.prototype.registerOnValidatorChange = function (fn) { this._onChange = fn; };
EmailValidator.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[email][formControlName],[email][formControl],[email][ngModel]',
providers: [EMAIL_VALIDATOR]
},] }
];
EmailValidator.propDecorators = {
email: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }]
};
return EmailValidator;
}());
/**
* Provider which adds `MinLengthValidator` to `NG_VALIDATORS`.
*
* ## Example:
*
* {@example common/forms/ts/validators/validators.ts region='min'}
*/
var MIN_LENGTH_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return MinLengthValidator; }),
multi: true
};
/**
* A directive which installs the `MinLengthValidator` for any `formControlName`,
* `formControl`, or control with `ngModel` that also has a `minlength` attribute.
*
*
*/
var MinLengthValidator = /** @class */ (function () {
function MinLengthValidator() {
}
MinLengthValidator.prototype.ngOnChanges = function (changes) {
if ('minlength' in changes) {
this._createValidator();
if (this._onChange)
this._onChange();
}
};
MinLengthValidator.prototype.validate = function (c) {
return this.minlength == null ? null : this._validator(c);
};
MinLengthValidator.prototype.registerOnValidatorChange = function (fn) { this._onChange = fn; };
MinLengthValidator.prototype._createValidator = function () {
this._validator = Validators.minLength(parseInt(this.minlength, 10));
};
MinLengthValidator.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[minlength][formControlName],[minlength][formControl],[minlength][ngModel]',
providers: [MIN_LENGTH_VALIDATOR],
host: { '[attr.minlength]': 'minlength ? minlength : null' }
},] }
];
MinLengthValidator.propDecorators = {
minlength: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }]
};
return MinLengthValidator;
}());
/**
* Provider which adds `MaxLengthValidator` to `NG_VALIDATORS`.
*
* ## Example:
*
* {@example common/forms/ts/validators/validators.ts region='max'}
*/
var MAX_LENGTH_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return MaxLengthValidator; }),
multi: true
};
/**
* A directive which installs the `MaxLengthValidator` for any `formControlName`,
* `formControl`, or control with `ngModel` that also has a `maxlength` attribute.
*
*
*/
var MaxLengthValidator = /** @class */ (function () {
function MaxLengthValidator() {
}
MaxLengthValidator.prototype.ngOnChanges = function (changes) {
if ('maxlength' in changes) {
this._createValidator();
if (this._onChange)
this._onChange();
}
};
MaxLengthValidator.prototype.validate = function (c) {
return this.maxlength != null ? this._validator(c) : null;
};
MaxLengthValidator.prototype.registerOnValidatorChange = function (fn) { this._onChange = fn; };
MaxLengthValidator.prototype._createValidator = function () {
this._validator = Validators.maxLength(parseInt(this.maxlength, 10));
};
MaxLengthValidator.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]',
providers: [MAX_LENGTH_VALIDATOR],
host: { '[attr.maxlength]': 'maxlength ? maxlength : null' }
},] }
];
MaxLengthValidator.propDecorators = {
maxlength: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }]
};
return MaxLengthValidator;
}());
var PATTERN_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return PatternValidator; }),
multi: true
};
/**
* A Directive that adds the `pattern` validator to any controls marked with the
* `pattern` attribute, via the `NG_VALIDATORS` binding. Uses attribute value
* as the regex to validate Control value against. Follows pattern attribute
* semantics; i.e. regex must match entire Control value.
*
* ### Example
*
* ```
* <input [name]="fullName" pattern="[a-zA-Z ]*" ngModel>
* ```
*
*/
var PatternValidator = /** @class */ (function () {
function PatternValidator() {
}
PatternValidator.prototype.ngOnChanges = function (changes) {
if ('pattern' in changes) {
this._createValidator();
if (this._onChange)
this._onChange();
}
};
PatternValidator.prototype.validate = function (c) { return this._validator(c); };
PatternValidator.prototype.registerOnValidatorChange = function (fn) { this._onChange = fn; };
PatternValidator.prototype._createValidator = function () { this._validator = Validators.pattern(this.pattern); };
PatternValidator.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[pattern][formControlName],[pattern][formControl],[pattern][ngModel]',
providers: [PATTERN_VALIDATOR],
host: { '[attr.pattern]': 'pattern ? pattern : null' }
},] }
];
PatternValidator.propDecorators = {
pattern: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }]
};
return PatternValidator;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
*
* Creates an `AbstractControl` from a user-specified configuration.
*
* This is essentially syntactic sugar that shortens the `new FormGroup()`,
* `new FormControl()`, and `new FormArray()` boilerplate that can build up in larger
* forms.
*
* To use, inject `FormBuilder` into your component class. You can then call its methods
* directly.
*
* {@example forms/ts/formBuilder/form_builder_example.ts region='Component'}
*
* * **npm package**: `@angular/forms`
*
* * **NgModule**: `ReactiveFormsModule`
*
*
*/
var FormBuilder = /** @class */ (function () {
function FormBuilder() {
}
/**
* Construct a new `FormGroup` with the given map of configuration.
* Valid keys for the `extra` parameter map are `validator` and `asyncValidator`.
*
* See the `FormGroup` constructor for more details.
*/
FormBuilder.prototype.group = function (controlsConfig, extra) {
if (extra === void 0) { extra = null; }
var controls = this._reduceControls(controlsConfig);
var validator = extra != null ? extra['validator'] : null;
var asyncValidator = extra != null ? extra['asyncValidator'] : null;
return new FormGroup(controls, validator, asyncValidator);
};
/**
* Construct a new `FormControl` with the given `formState`,`validator`, and
* `asyncValidator`.
*
* `formState` can either be a standalone value for the form control or an object
* that contains both a value and a disabled status.
*
*/
FormBuilder.prototype.control = function (formState, validator, asyncValidator) {
return new FormControl(formState, validator, asyncValidator);
};
/**
* Construct a `FormArray` from the given `controlsConfig` array of
* configuration, with the given optional `validator` and `asyncValidator`.
*/
FormBuilder.prototype.array = function (controlsConfig, validator, asyncValidator) {
var _this = this;
var controls = controlsConfig.map(function (c) { return _this._createControl(c); });
return new FormArray(controls, validator, asyncValidator);
};
/** @internal */
FormBuilder.prototype._reduceControls = function (controlsConfig) {
var _this = this;
var controls = {};
Object.keys(controlsConfig).forEach(function (controlName) {
controls[controlName] = _this._createControl(controlsConfig[controlName]);
});
return controls;
};
/** @internal */
FormBuilder.prototype._createControl = function (controlConfig) {
if (controlConfig instanceof FormControl || controlConfig instanceof FormGroup ||
controlConfig instanceof FormArray) {
return controlConfig;
}
else if (Array.isArray(controlConfig)) {
var value = controlConfig[0];
var validator = controlConfig.length > 1 ? controlConfig[1] : null;
var asyncValidator = controlConfig.length > 2 ? controlConfig[2] : null;
return this.control(value, validator, asyncValidator);
}
else {
return this.control(controlConfig);
}
};
FormBuilder.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
return FormBuilder;
}());
/**
* @license
* Copyright Google Inc. 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 VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Version"]('6.0.9');
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
*
* Adds `novalidate` attribute to all forms by default.
*
* `novalidate` is used to disable browser's native form validation.
*
* If you want to use native validation with Angular forms, just add `ngNativeValidate` attribute:
*
* ```
* <form ngNativeValidate></form>
* ```
*
* @experimental
*/
var NgNoValidate = /** @class */ (function () {
function NgNoValidate() {
}
NgNoValidate.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'form:not([ngNoForm]):not([ngNativeValidate])',
host: { 'novalidate': '' },
},] }
];
return NgNoValidate;
}());
/**
* @license
* Copyright Google Inc. 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 SHARED_FORM_DIRECTIVES = [
NgNoValidate,
NgSelectOption,
NgSelectMultipleOption,
DefaultValueAccessor,
NumberValueAccessor,
RangeValueAccessor,
CheckboxControlValueAccessor,
SelectControlValueAccessor,
SelectMultipleControlValueAccessor,
RadioControlValueAccessor,
NgControlStatus,
NgControlStatusGroup,
RequiredValidator,
MinLengthValidator,
MaxLengthValidator,
PatternValidator,
CheckboxRequiredValidator,
EmailValidator,
];
var TEMPLATE_DRIVEN_DIRECTIVES = [NgModel, NgModelGroup, NgForm];
var REACTIVE_DRIVEN_DIRECTIVES = [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName];
/**
* Internal module used for sharing directives between FormsModule and ReactiveFormsModule
*/
var InternalFormsSharedModule = /** @class */ (function () {
function InternalFormsSharedModule() {
}
InternalFormsSharedModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
declarations: SHARED_FORM_DIRECTIVES,
exports: SHARED_FORM_DIRECTIVES,
},] }
];
return InternalFormsSharedModule;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* The ng module for forms.
*
*/
var FormsModule = /** @class */ (function () {
function FormsModule() {
}
FormsModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
declarations: TEMPLATE_DRIVEN_DIRECTIVES,
providers: [RadioControlRegistry],
exports: [InternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES]
},] }
];
return FormsModule;
}());
/**
* The ng module for reactive forms.
*
*/
var ReactiveFormsModule = /** @class */ (function () {
function ReactiveFormsModule() {
}
ReactiveFormsModule.withConfig = function (opts) {
return {
ngModule: ReactiveFormsModule,
providers: [{
provide: NG_MODEL_WITH_FORM_CONTROL_WARNING,
useValue: opts.warnOnNgModelWithFormControl
}]
};
};
ReactiveFormsModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
declarations: [REACTIVE_DRIVEN_DIRECTIVES],
providers: [FormBuilder, RadioControlRegistry],
exports: [InternalFormsSharedModule, REACTIVE_DRIVEN_DIRECTIVES]
},] }
];
return ReactiveFormsModule;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
// This file only reexports content of the `src` folder. Keep it that way.
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Generated bundle index. Do not edit.
*/
//# sourceMappingURL=forms.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/autocomplete.es5.js":
/*!*****************************************************************!*\
!*** ./node_modules/@angular/material/esm5/autocomplete.es5.js ***!
\*****************************************************************/
/*! exports provided: MatAutocompleteSelectedEvent, MatAutocompleteBase, _MatAutocompleteMixinBase, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY, MatAutocomplete, MatAutocompleteModule, AUTOCOMPLETE_OPTION_HEIGHT, AUTOCOMPLETE_PANEL_HEIGHT, MAT_AUTOCOMPLETE_SCROLL_STRATEGY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY, MAT_AUTOCOMPLETE_VALUE_ACCESSOR, getMatAutocompleteMissingPanelError, MatAutocompleteTrigger */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatAutocompleteSelectedEvent", function() { return MatAutocompleteSelectedEvent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatAutocompleteBase", function() { return MatAutocompleteBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatAutocompleteMixinBase", function() { return _MatAutocompleteMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_AUTOCOMPLETE_DEFAULT_OPTIONS", function() { return MAT_AUTOCOMPLETE_DEFAULT_OPTIONS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY", function() { return MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatAutocomplete", function() { return MatAutocomplete; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatAutocompleteModule", function() { return MatAutocompleteModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AUTOCOMPLETE_OPTION_HEIGHT", function() { return AUTOCOMPLETE_OPTION_HEIGHT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AUTOCOMPLETE_PANEL_HEIGHT", function() { return AUTOCOMPLETE_PANEL_HEIGHT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_AUTOCOMPLETE_SCROLL_STRATEGY", function() { return MAT_AUTOCOMPLETE_SCROLL_STRATEGY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY", function() { return MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_AUTOCOMPLETE_VALUE_ACCESSOR", function() { return MAT_AUTOCOMPLETE_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatAutocompleteMissingPanelError", function() { return getMatAutocompleteMissingPanelError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatAutocompleteTrigger", function() { return MatAutocompleteTrigger; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/cdk/overlay */ "./node_modules/@angular/cdk/esm5/overlay.es5.js");
/* harmony import */ var _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/cdk/portal */ "./node_modules/@angular/cdk/esm5/portal.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/material/form-field */ "./node_modules/@angular/material/esm5/form-field.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Autocomplete IDs need to be unique across components, so this counter exists outside of
* the component definition.
*/
var /** @type {?} */ _uniqueAutocompleteIdCounter = 0;
/**
* Event object that is emitted when an autocomplete option is selected.
*/
var /**
* Event object that is emitted when an autocomplete option is selected.
*/
MatAutocompleteSelectedEvent = /** @class */ (function () {
function MatAutocompleteSelectedEvent(source, option) {
this.source = source;
this.option = option;
}
return MatAutocompleteSelectedEvent;
}());
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatAutocompleteBase = /** @class */ (function () {
function MatAutocompleteBase() {
}
return MatAutocompleteBase;
}());
var /** @type {?} */ _MatAutocompleteMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["mixinDisableRipple"])(MatAutocompleteBase);
/**
* Injection token to be used to override the default options for `mat-autocomplete`.
*/
var /** @type {?} */ MAT_AUTOCOMPLETE_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('mat-autocomplete-default-options', {
providedIn: 'root',
factory: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY() {
return { autoActiveFirstOption: false };
}
var MatAutocomplete = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatAutocomplete, _super);
function MatAutocomplete(_changeDetectorRef, _elementRef, defaults) {
var _this = _super.call(this) || this;
_this._changeDetectorRef = _changeDetectorRef;
_this._elementRef = _elementRef;
/**
* Whether the autocomplete panel should be visible, depending on option length.
*/
_this.showPanel = false;
_this._isOpen = false;
/**
* Function that maps an option's control value to its display value in the trigger.
*/
_this.displayWith = null;
/**
* Event that is emitted whenever an option from the list is selected.
*/
_this.optionSelected = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
/**
* Event that is emitted when the autocomplete panel is opened.
*/
_this.opened = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
/**
* Event that is emitted when the autocomplete panel is closed.
*/
_this.closed = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
_this._classList = {};
/**
* Unique ID to be used by autocomplete trigger's "aria-owns" property.
*/
_this.id = "mat-autocomplete-" + _uniqueAutocompleteIdCounter++;
_this._autoActiveFirstOption = !!defaults.autoActiveFirstOption;
return _this;
}
Object.defineProperty(MatAutocomplete.prototype, "isOpen", {
/** Whether the autocomplete panel is open. */
get: /**
* Whether the autocomplete panel is open.
* @return {?}
*/
function () { return this._isOpen && this.showPanel; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatAutocomplete.prototype, "autoActiveFirstOption", {
get: /**
* Whether the first option should be highlighted when the autocomplete panel is opened.
* Can be configured globally through the `MAT_AUTOCOMPLETE_DEFAULT_OPTIONS` token.
* @return {?}
*/
function () { return this._autoActiveFirstOption; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._autoActiveFirstOption = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatAutocomplete.prototype, "classList", {
set: /**
* Takes classes set on the host mat-autocomplete element and applies them to the panel
* inside the overlay container to allow for easy styling.
* @param {?} value
* @return {?}
*/
function (value) {
var _this = this;
if (value && value.length) {
value.split(' ').forEach(function (className) { return _this._classList[className.trim()] = true; });
this._elementRef.nativeElement.className = '';
}
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatAutocomplete.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
this._keyManager = new _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_3__["ActiveDescendantKeyManager"](this.options).withWrap();
// Set the initial visibility state.
this._setVisibility();
};
/**
* Sets the panel scrollTop. This allows us to manually scroll to display options
* above or below the fold, as they are not actually being focused when active.
*/
/**
* Sets the panel scrollTop. This allows us to manually scroll to display options
* above or below the fold, as they are not actually being focused when active.
* @param {?} scrollTop
* @return {?}
*/
MatAutocomplete.prototype._setScrollTop = /**
* Sets the panel scrollTop. This allows us to manually scroll to display options
* above or below the fold, as they are not actually being focused when active.
* @param {?} scrollTop
* @return {?}
*/
function (scrollTop) {
if (this.panel) {
this.panel.nativeElement.scrollTop = scrollTop;
}
};
/** Returns the panel's scrollTop. */
/**
* Returns the panel's scrollTop.
* @return {?}
*/
MatAutocomplete.prototype._getScrollTop = /**
* Returns the panel's scrollTop.
* @return {?}
*/
function () {
return this.panel ? this.panel.nativeElement.scrollTop : 0;
};
/** Panel should hide itself when the option list is empty. */
/**
* Panel should hide itself when the option list is empty.
* @return {?}
*/
MatAutocomplete.prototype._setVisibility = /**
* Panel should hide itself when the option list is empty.
* @return {?}
*/
function () {
this.showPanel = !!this.options.length;
this._classList['mat-autocomplete-visible'] = this.showPanel;
this._classList['mat-autocomplete-hidden'] = !this.showPanel;
this._changeDetectorRef.markForCheck();
};
/** Emits the `select` event. */
/**
* Emits the `select` event.
* @param {?} option
* @return {?}
*/
MatAutocomplete.prototype._emitSelectEvent = /**
* Emits the `select` event.
* @param {?} option
* @return {?}
*/
function (option) {
var /** @type {?} */ event = new MatAutocompleteSelectedEvent(this, option);
this.optionSelected.emit(event);
};
MatAutocomplete.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-autocomplete',
template: "<ng-template><div class=\"mat-autocomplete-panel\" role=\"listbox\" [id]=\"id\" [ngClass]=\"_classList\" #panel><ng-content></ng-content></div></ng-template>",
styles: [".mat-autocomplete-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;visibility:hidden;max-width:none;max-height:256px;position:relative;width:100%}.mat-autocomplete-panel:not([class*=mat-elevation-z]){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.mat-autocomplete-panel.mat-autocomplete-visible{visibility:visible}.mat-autocomplete-panel.mat-autocomplete-hidden{visibility:hidden}@media screen and (-ms-high-contrast:active){.mat-autocomplete-panel{outline:solid 1px}}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
exportAs: 'matAutocomplete',
inputs: ['disableRipple'],
host: {
'class': 'mat-autocomplete'
},
providers: [
{ provide: _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MAT_OPTION_PARENT_COMPONENT"], useExisting: MatAutocomplete }
]
},] },
];
/** @nocollapse */
MatAutocomplete.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [MAT_AUTOCOMPLETE_DEFAULT_OPTIONS,] },] },
]; };
MatAutocomplete.propDecorators = {
"template": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"],] },],
"panel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: ['panel',] },],
"options": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatOption"], { descendants: true },] },],
"optionGroups": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatOptgroup"],] },],
"displayWith": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"autoActiveFirstOption": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"optionSelected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] },],
"opened": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] },],
"closed": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] },],
"classList": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['class',] },],
};
return MatAutocomplete;
}(_MatAutocompleteMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* The height of each autocomplete option.
*/
var /** @type {?} */ AUTOCOMPLETE_OPTION_HEIGHT = 48;
/**
* The total height of the autocomplete panel.
*/
var /** @type {?} */ AUTOCOMPLETE_PANEL_HEIGHT = 256;
/**
* Injection token that determines the scroll handling while the autocomplete panel is open.
*/
var /** @type {?} */ MAT_AUTOCOMPLETE_SCROLL_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('mat-autocomplete-scroll-strategy', {
providedIn: 'root',
factory: MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY() {
var /** @type {?} */ overlay = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["inject"])(_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["Overlay"]);
return function () { return overlay.scrollStrategies.reposition(); };
}
/**
* Provider that allows the autocomplete to register as a ControlValueAccessor.
* \@docs-private
*/
var /** @type {?} */ MAT_AUTOCOMPLETE_VALUE_ACCESSOR = {
provide: _angular_forms__WEBPACK_IMPORTED_MODULE_11__["NG_VALUE_ACCESSOR"],
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return MatAutocompleteTrigger; }),
multi: true
};
/**
* Creates an error to be thrown when attempting to use an autocomplete trigger without a panel.
* @return {?}
*/
function getMatAutocompleteMissingPanelError() {
return Error('Attempting to open an undefined instance of `mat-autocomplete`. ' +
'Make sure that the id passed to the `matAutocomplete` is correct and that ' +
'you\'re attempting to open it after the ngAfterContentInit hook.');
}
var MatAutocompleteTrigger = /** @class */ (function () {
function MatAutocompleteTrigger(_element, _overlay, _viewContainerRef, _zone, _changeDetectorRef, _scrollStrategy, _dir, _formField, _document, _viewportRuler) {
var _this = this;
this._element = _element;
this._overlay = _overlay;
this._viewContainerRef = _viewContainerRef;
this._zone = _zone;
this._changeDetectorRef = _changeDetectorRef;
this._scrollStrategy = _scrollStrategy;
this._dir = _dir;
this._formField = _formField;
this._document = _document;
this._viewportRuler = _viewportRuler;
this._componentDestroyed = false;
/**
* Whether or not the label state is being overridden.
*/
this._manuallyFloatingLabel = false;
/**
* Subscription to viewport size changes.
*/
this._viewportSubscription = rxjs__WEBPACK_IMPORTED_MODULE_13__["Subscription"].EMPTY;
/**
* Stream of keyboard events that can close the panel.
*/
this._closeKeyEventStream = new rxjs__WEBPACK_IMPORTED_MODULE_13__["Subject"]();
/**
* `View -> model callback called when value changes`
*/
this._onChange = function () { };
/**
* `View -> model callback called when autocomplete has been touched`
*/
this._onTouched = function () { };
this._overlayAttached = false;
/**
* Stream of autocomplete option selections.
*/
this.optionSelections = Object(rxjs__WEBPACK_IMPORTED_MODULE_13__["defer"])(function () {
if (_this.autocomplete && _this.autocomplete.options) {
return rxjs__WEBPACK_IMPORTED_MODULE_13__["merge"].apply(void 0, _this.autocomplete.options.map(function (option) { return option.onSelectionChange; }));
}
// If there are any subscribers before `ngAfterViewInit`, the `autocomplete` will be undefined.
// Return a stream that we'll replace with the real one once everything is in place.
return _this._zone.onStable
.asObservable()
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["take"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["switchMap"])(function () { return _this.optionSelections; }));
});
}
/**
* @return {?}
*/
MatAutocompleteTrigger.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._viewportSubscription.unsubscribe();
this._componentDestroyed = true;
this._destroyPanel();
this._closeKeyEventStream.complete();
};
Object.defineProperty(MatAutocompleteTrigger.prototype, "panelOpen", {
/** Whether or not the autocomplete panel is open. */
get: /**
* Whether or not the autocomplete panel is open.
* @return {?}
*/
function () {
return this._overlayAttached && this.autocomplete.showPanel;
},
enumerable: true,
configurable: true
});
/** Opens the autocomplete suggestion panel. */
/**
* Opens the autocomplete suggestion panel.
* @return {?}
*/
MatAutocompleteTrigger.prototype.openPanel = /**
* Opens the autocomplete suggestion panel.
* @return {?}
*/
function () {
this._attachOverlay();
this._floatLabel();
};
/** Closes the autocomplete suggestion panel. */
/**
* Closes the autocomplete suggestion panel.
* @return {?}
*/
MatAutocompleteTrigger.prototype.closePanel = /**
* Closes the autocomplete suggestion panel.
* @return {?}
*/
function () {
this._resetLabel();
if (!this._overlayAttached) {
return;
}
if (this.panelOpen) {
// Only emit if the panel was visible.
this.autocomplete.closed.emit();
}
this.autocomplete._isOpen = this._overlayAttached = false;
if (this._overlayRef && this._overlayRef.hasAttached()) {
this._overlayRef.detach();
this._closingActionsSubscription.unsubscribe();
}
// Note that in some cases this can end up being called after the component is destroyed.
// Add a check to ensure that we don't try to run change detection on a destroyed view.
if (!this._componentDestroyed) {
// We need to trigger change detection manually, because
// `fromEvent` doesn't seem to do it at the proper time.
// This ensures that the label is reset when the
// user clicks outside.
this._changeDetectorRef.detectChanges();
}
};
Object.defineProperty(MatAutocompleteTrigger.prototype, "panelClosingActions", {
/**
* A stream of actions that should close the autocomplete panel, including
* when an option is selected, on blur, and when TAB is pressed.
*/
get: /**
* A stream of actions that should close the autocomplete panel, including
* when an option is selected, on blur, and when TAB is pressed.
* @return {?}
*/
function () {
var _this = this;
return Object(rxjs__WEBPACK_IMPORTED_MODULE_13__["merge"])(this.optionSelections, this.autocomplete._keyManager.tabOut.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["filter"])(function () { return _this._overlayAttached; })), this._closeKeyEventStream, this._outsideClickStream, this._overlayRef ?
this._overlayRef.detachments().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["filter"])(function () { return _this._overlayAttached; })) :
Object(rxjs__WEBPACK_IMPORTED_MODULE_13__["of"])());
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatAutocompleteTrigger.prototype, "activeOption", {
/** The currently active option, coerced to MatOption type. */
get: /**
* The currently active option, coerced to MatOption type.
* @return {?}
*/
function () {
if (this.autocomplete && this.autocomplete._keyManager) {
return this.autocomplete._keyManager.activeItem;
}
return null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatAutocompleteTrigger.prototype, "_outsideClickStream", {
get: /**
* Stream of clicks outside of the autocomplete panel.
* @return {?}
*/
function () {
var _this = this;
if (!this._document) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_13__["of"])(null);
}
return Object(rxjs__WEBPACK_IMPORTED_MODULE_13__["merge"])(Object(rxjs__WEBPACK_IMPORTED_MODULE_13__["fromEvent"])(this._document, 'click'), Object(rxjs__WEBPACK_IMPORTED_MODULE_13__["fromEvent"])(this._document, 'touchend'))
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["filter"])(function (event) {
var /** @type {?} */ clickTarget = /** @type {?} */ (event.target);
var /** @type {?} */ formField = _this._formField ?
_this._formField._elementRef.nativeElement : null;
return _this._overlayAttached &&
clickTarget !== _this._element.nativeElement &&
(!formField || !formField.contains(clickTarget)) &&
(!!_this._overlayRef && !_this._overlayRef.overlayElement.contains(clickTarget));
}));
},
enumerable: true,
configurable: true
});
// Implemented as part of ControlValueAccessor.
/**
* @param {?} value
* @return {?}
*/
MatAutocompleteTrigger.prototype.writeValue = /**
* @param {?} value
* @return {?}
*/
function (value) {
var _this = this;
Promise.resolve(null).then(function () { return _this._setTriggerValue(value); });
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} fn
* @return {?}
*/
MatAutocompleteTrigger.prototype.registerOnChange = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this._onChange = fn;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} fn
* @return {?}
*/
MatAutocompleteTrigger.prototype.registerOnTouched = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this._onTouched = fn;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} isDisabled
* @return {?}
*/
MatAutocompleteTrigger.prototype.setDisabledState = /**
* @param {?} isDisabled
* @return {?}
*/
function (isDisabled) {
this._element.nativeElement.disabled = isDisabled;
};
/**
* @param {?} event
* @return {?}
*/
MatAutocompleteTrigger.prototype._handleKeydown = /**
* @param {?} event
* @return {?}
*/
function (event) {
var /** @type {?} */ keyCode = event.keyCode;
// Prevent the default action on all escape key presses. This is here primarily to bring IE
// in line with other browsers. By default, pressing escape on IE will cause it to revert
// the input value to the one that it had on focus, however it won't dispatch any events
// which means that the model value will be out of sync with the view.
if (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["ESCAPE"]) {
event.preventDefault();
}
// Close when pressing ESCAPE or ALT + UP_ARROW, based on the a11y guidelines.
// See: https://www.w3.org/TR/wai-aria-practices-1.1/#textbox-keyboard-interaction
if (this.panelOpen && (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["ESCAPE"] || (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["UP_ARROW"] && event.altKey))) {
this._resetActiveItem();
this._closeKeyEventStream.next();
event.stopPropagation();
}
else if (this.activeOption && keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["ENTER"] && this.panelOpen) {
this.activeOption._selectViaInteraction();
this._resetActiveItem();
event.preventDefault();
}
else {
var /** @type {?} */ prevActiveItem = this.autocomplete._keyManager.activeItem;
var /** @type {?} */ isArrowKey = keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["UP_ARROW"] || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["DOWN_ARROW"];
if (this.panelOpen || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["TAB"]) {
this.autocomplete._keyManager.onKeydown(event);
}
else if (isArrowKey && this._canOpen()) {
this.openPanel();
}
if (isArrowKey || this.autocomplete._keyManager.activeItem !== prevActiveItem) {
this._scrollToOption();
}
}
};
/**
* @param {?} event
* @return {?}
*/
MatAutocompleteTrigger.prototype._handleInput = /**
* @param {?} event
* @return {?}
*/
function (event) {
var /** @type {?} */ target = /** @type {?} */ (event.target);
var /** @type {?} */ value = target.value;
// Based on `NumberValueAccessor` from forms.
if (target.type === 'number') {
value = value == '' ? null : parseFloat(value);
}
// If the input has a placeholder, IE will fire the `input` event on page load,
// focus and blur, in addition to when the user actually changed the value. To
// filter out all of the extra events, we save the value on focus and between
// `input` events, and we check whether it changed.
// See: https://connect.microsoft.com/IE/feedback/details/885747/
if (this._canOpen() && this._previousValue !== value &&
document.activeElement === event.target) {
this._previousValue = value;
this._onChange(value);
this.openPanel();
}
};
/**
* @return {?}
*/
MatAutocompleteTrigger.prototype._handleFocus = /**
* @return {?}
*/
function () {
if (this._canOpen()) {
this._previousValue = this._element.nativeElement.value;
this._attachOverlay();
this._floatLabel(true);
}
};
/**
* In "auto" mode, the label will animate down as soon as focus is lost.
* This causes the value to jump when selecting an option with the mouse.
* This method manually floats the label until the panel can be closed.
* @param {?=} shouldAnimate Whether the label should be animated when it is floated.
* @return {?}
*/
MatAutocompleteTrigger.prototype._floatLabel = /**
* In "auto" mode, the label will animate down as soon as focus is lost.
* This causes the value to jump when selecting an option with the mouse.
* This method manually floats the label until the panel can be closed.
* @param {?=} shouldAnimate Whether the label should be animated when it is floated.
* @return {?}
*/
function (shouldAnimate) {
if (shouldAnimate === void 0) { shouldAnimate = false; }
if (this._formField && this._formField.floatLabel === 'auto') {
if (shouldAnimate) {
this._formField._animateAndLockLabel();
}
else {
this._formField.floatLabel = 'always';
}
this._manuallyFloatingLabel = true;
}
};
/**
* If the label has been manually elevated, return it to its normal state.
* @return {?}
*/
MatAutocompleteTrigger.prototype._resetLabel = /**
* If the label has been manually elevated, return it to its normal state.
* @return {?}
*/
function () {
if (this._manuallyFloatingLabel) {
this._formField.floatLabel = 'auto';
this._manuallyFloatingLabel = false;
}
};
/**
* Given that we are not actually focusing active options, we must manually adjust scroll
* to reveal options below the fold. First, we find the offset of the option from the top
* of the panel. If that offset is below the fold, the new scrollTop will be the offset -
* the panel height + the option height, so the active option will be just visible at the
* bottom of the panel. If that offset is above the top of the visible panel, the new scrollTop
* will become the offset. If that offset is visible within the panel already, the scrollTop is
* not adjusted.
* @return {?}
*/
MatAutocompleteTrigger.prototype._scrollToOption = /**
* Given that we are not actually focusing active options, we must manually adjust scroll
* to reveal options below the fold. First, we find the offset of the option from the top
* of the panel. If that offset is below the fold, the new scrollTop will be the offset -
* the panel height + the option height, so the active option will be just visible at the
* bottom of the panel. If that offset is above the top of the visible panel, the new scrollTop
* will become the offset. If that offset is visible within the panel already, the scrollTop is
* not adjusted.
* @return {?}
*/
function () {
var /** @type {?} */ index = this.autocomplete._keyManager.activeItemIndex || 0;
var /** @type {?} */ labelCount = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["_countGroupLabelsBeforeOption"])(index, this.autocomplete.options, this.autocomplete.optionGroups);
var /** @type {?} */ newScrollPosition = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["_getOptionScrollPosition"])(index + labelCount, AUTOCOMPLETE_OPTION_HEIGHT, this.autocomplete._getScrollTop(), AUTOCOMPLETE_PANEL_HEIGHT);
this.autocomplete._setScrollTop(newScrollPosition);
};
/**
* This method listens to a stream of panel closing actions and resets the
* stream every time the option list changes.
* @return {?}
*/
MatAutocompleteTrigger.prototype._subscribeToClosingActions = /**
* This method listens to a stream of panel closing actions and resets the
* stream every time the option list changes.
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ firstStable = this._zone.onStable.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["take"])(1));
var /** @type {?} */ optionChanges = this.autocomplete.options.changes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["tap"])(function () { return _this._positionStrategy.reapplyLastPosition(); }),
// Defer emitting to the stream until the next tick, because changing
// bindings in here will cause "changed after checked" errors.
Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["delay"])(0));
// When the zone is stable initially, and when the option list changes...
return Object(rxjs__WEBPACK_IMPORTED_MODULE_13__["merge"])(firstStable, optionChanges)
.pipe(
// create a new stream of panelClosingActions, replacing any previous streams
// that were created, and flatten it so our stream only emits closing events...
Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["switchMap"])(function () {
_this._resetActiveItem();
_this.autocomplete._setVisibility();
return _this.panelClosingActions;
}),
// when the first closing event occurs...
Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["take"])(1))
.subscribe(function (event) { return _this._setValueAndClose(event); });
};
/**
* Destroys the autocomplete suggestion panel.
* @return {?}
*/
MatAutocompleteTrigger.prototype._destroyPanel = /**
* Destroys the autocomplete suggestion panel.
* @return {?}
*/
function () {
if (this._overlayRef) {
this.closePanel();
this._overlayRef.dispose();
this._overlayRef = null;
}
};
/**
* @param {?} value
* @return {?}
*/
MatAutocompleteTrigger.prototype._setTriggerValue = /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ toDisplay = this.autocomplete && this.autocomplete.displayWith ?
this.autocomplete.displayWith(value) :
value;
// Simply falling back to an empty string if the display value is falsy does not work properly.
// The display value can also be the number zero and shouldn't fall back to an empty string.
var /** @type {?} */ inputValue = toDisplay != null ? toDisplay : '';
// If it's used within a `MatFormField`, we should set it through the property so it can go
// through change detection.
if (this._formField) {
this._formField._control.value = inputValue;
}
else {
this._element.nativeElement.value = inputValue;
}
};
/**
* This method closes the panel, and if a value is specified, also sets the associated
* control to that value. It will also mark the control as dirty if this interaction
* stemmed from the user.
* @param {?} event
* @return {?}
*/
MatAutocompleteTrigger.prototype._setValueAndClose = /**
* This method closes the panel, and if a value is specified, also sets the associated
* control to that value. It will also mark the control as dirty if this interaction
* stemmed from the user.
* @param {?} event
* @return {?}
*/
function (event) {
if (event && event.source) {
this._clearPreviousSelectedOption(event.source);
this._setTriggerValue(event.source.value);
this._onChange(event.source.value);
this._element.nativeElement.focus();
this.autocomplete._emitSelectEvent(event.source);
}
this.closePanel();
};
/**
* Clear any previous selected option and emit a selection change event for this option
* @param {?} skip
* @return {?}
*/
MatAutocompleteTrigger.prototype._clearPreviousSelectedOption = /**
* Clear any previous selected option and emit a selection change event for this option
* @param {?} skip
* @return {?}
*/
function (skip) {
this.autocomplete.options.forEach(function (option) {
if (option != skip && option.selected) {
option.deselect();
}
});
};
/**
* @return {?}
*/
MatAutocompleteTrigger.prototype._attachOverlay = /**
* @return {?}
*/
function () {
var _this = this;
if (!this.autocomplete) {
throw getMatAutocompleteMissingPanelError();
}
if (!this._overlayRef) {
this._portal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_8__["TemplatePortal"](this.autocomplete.template, this._viewContainerRef);
this._overlayRef = this._overlay.create(this._getOverlayConfig());
if (this._viewportRuler) {
this._viewportSubscription = this._viewportRuler.change().subscribe(function () {
if (_this.panelOpen && _this._overlayRef) {
_this._overlayRef.updateSize({ width: _this._getHostWidth() });
}
});
}
}
else {
// Update the panel width and direction, in case anything has changed.
this._overlayRef.updateSize({ width: this._getHostWidth() });
this._overlayRef.setDirection(this._getDirection());
}
if (this._overlayRef && !this._overlayRef.hasAttached()) {
this._overlayRef.attach(this._portal);
this._closingActionsSubscription = this._subscribeToClosingActions();
}
var /** @type {?} */ wasOpen = this.panelOpen;
this.autocomplete._setVisibility();
this.autocomplete._isOpen = this._overlayAttached = true;
// We need to do an extra `panelOpen` check in here, because the
// autocomplete won't be shown if there are no options.
if (this.panelOpen && wasOpen !== this.panelOpen) {
this.autocomplete.opened.emit();
}
};
/**
* @return {?}
*/
MatAutocompleteTrigger.prototype._getOverlayConfig = /**
* @return {?}
*/
function () {
return new _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["OverlayConfig"]({
positionStrategy: this._getOverlayPosition(),
scrollStrategy: this._scrollStrategy(),
width: this._getHostWidth(),
direction: this._getDirection()
});
};
/**
* @return {?}
*/
MatAutocompleteTrigger.prototype._getOverlayPosition = /**
* @return {?}
*/
function () {
this._positionStrategy = this._overlay.position()
.flexibleConnectedTo(this._getConnectedElement())
.withFlexibleDimensions(false)
.withPush(false)
.withPositions([
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' }
]);
return this._positionStrategy;
};
/**
* @return {?}
*/
MatAutocompleteTrigger.prototype._getDirection = /**
* @return {?}
*/
function () {
return this._dir ? this._dir.value : 'ltr';
};
/**
* @return {?}
*/
MatAutocompleteTrigger.prototype._getConnectedElement = /**
* @return {?}
*/
function () {
return this._formField ? this._formField.getConnectedOverlayOrigin() : this._element;
};
/**
* Returns the width of the input element, so the panel width can match it.
* @return {?}
*/
MatAutocompleteTrigger.prototype._getHostWidth = /**
* Returns the width of the input element, so the panel width can match it.
* @return {?}
*/
function () {
return this._getConnectedElement().nativeElement.getBoundingClientRect().width;
};
/**
* Resets the active item to -1 so arrow events will activate the
* correct options, or to 0 if the consumer opted into it.
* @return {?}
*/
MatAutocompleteTrigger.prototype._resetActiveItem = /**
* Resets the active item to -1 so arrow events will activate the
* correct options, or to 0 if the consumer opted into it.
* @return {?}
*/
function () {
this.autocomplete._keyManager.setActiveItem(this.autocomplete.autoActiveFirstOption ? 0 : -1);
};
/**
* Determines whether the panel can be opened.
* @return {?}
*/
MatAutocompleteTrigger.prototype._canOpen = /**
* Determines whether the panel can be opened.
* @return {?}
*/
function () {
var /** @type {?} */ element = this._element.nativeElement;
return !element.readOnly && !element.disabled;
};
MatAutocompleteTrigger.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: "input[matAutocomplete], textarea[matAutocomplete]",
host: {
'role': 'combobox',
'autocomplete': 'off',
'aria-autocomplete': 'list',
'[attr.aria-activedescendant]': 'activeOption?.id',
'[attr.aria-expanded]': 'panelOpen.toString()',
'[attr.aria-owns]': 'autocomplete?.id',
// Note: we use `focusin`, as opposed to `focus`, in order to open the panel
// a little earlier. This avoids issues where IE delays the focusing of the input.
'(focusin)': '_handleFocus()',
'(blur)': '_onTouched()',
'(input)': '_handleInput($event)',
'(keydown)': '_handleKeydown($event)',
},
exportAs: 'matAutocompleteTrigger',
providers: [MAT_AUTOCOMPLETE_VALUE_ACCESSOR]
},] },
];
/** @nocollapse */
MatAutocompleteTrigger.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["Overlay"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [MAT_AUTOCOMPLETE_SCROLL_STRATEGY,] },] },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_5__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] },] },
{ type: _angular_material_form_field__WEBPACK_IMPORTED_MODULE_12__["MatFormField"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Host"] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_9__["DOCUMENT"],] },] },
{ type: _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["ViewportRuler"], },
]; };
MatAutocompleteTrigger.propDecorators = {
"autocomplete": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matAutocomplete',] },],
};
return MatAutocompleteTrigger;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatAutocompleteModule = /** @class */ (function () {
function MatAutocompleteModule() {
}
MatAutocompleteModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatOptionModule"], _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["OverlayModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatCommonModule"], _angular_common__WEBPACK_IMPORTED_MODULE_9__["CommonModule"]],
exports: [MatAutocomplete, _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatOptionModule"], MatAutocompleteTrigger, _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatCommonModule"]],
declarations: [MatAutocomplete, MatAutocompleteTrigger],
},] },
];
return MatAutocompleteModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=autocomplete.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/badge.es5.js":
/*!**********************************************************!*\
!*** ./node_modules/@angular/material/esm5/badge.es5.js ***!
\**********************************************************/
/*! exports provided: MatBadgeModule, MatBadge */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatBadgeModule", function() { return MatBadgeModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatBadge", function() { return MatBadge; });
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ nextId = 0;
/**
* Directive to display a text badge.
*/
var MatBadge = /** @class */ (function () {
function MatBadge(_document, _ngZone, _elementRef, _ariaDescriber) {
this._document = _document;
this._ngZone = _ngZone;
this._elementRef = _elementRef;
this._ariaDescriber = _ariaDescriber;
this._color = 'primary';
this._overlap = true;
/**
* Position the badge should reside.
* Accepts any combination of 'above'|'below' and 'before'|'after'
*/
this.position = 'above after';
/**
* Size of the badge. Can be 'small', 'medium', or 'large'.
*/
this.size = 'medium';
/**
* Unique id for the badge
*/
this._id = nextId++;
}
Object.defineProperty(MatBadge.prototype, "color", {
get: /**
* The color of the badge. Can be `primary`, `accent`, or `warn`.
* @return {?}
*/
function () { return this._color; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._setColor(value);
this._color = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatBadge.prototype, "overlap", {
get: /**
* Whether the badge should overlap its contents or not
* @return {?}
*/
function () { return this._overlap; },
set: /**
* @param {?} val
* @return {?}
*/
function (val) {
this._overlap = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(val);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatBadge.prototype, "content", {
get: /**
* The content for the badge
* @return {?}
*/
function () { return this._content; },
set: /**
* @param {?} val
* @return {?}
*/
function (val) {
this._content = val;
this._updateTextContent();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatBadge.prototype, "description", {
get: /**
* Message used to describe the decorated element via aria-describedby
* @return {?}
*/
function () { return this._description; },
set: /**
* @param {?} newDescription
* @return {?}
*/
function (newDescription) {
if (newDescription !== this._description) {
this._updateHostAriaDescription(newDescription, this._description);
this._description = newDescription;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatBadge.prototype, "hidden", {
get: /**
* Whether the badge is hidden.
* @return {?}
*/
function () { return this._hidden; },
set: /**
* @param {?} val
* @return {?}
*/
function (val) {
this._hidden = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(val);
},
enumerable: true,
configurable: true
});
/** Whether the badge is above the host or not */
/**
* Whether the badge is above the host or not
* @return {?}
*/
MatBadge.prototype.isAbove = /**
* Whether the badge is above the host or not
* @return {?}
*/
function () {
return this.position.indexOf('below') === -1;
};
/** Whether the badge is after the host or not */
/**
* Whether the badge is after the host or not
* @return {?}
*/
MatBadge.prototype.isAfter = /**
* Whether the badge is after the host or not
* @return {?}
*/
function () {
return this.position.indexOf('before') === -1;
};
/**
* @return {?}
*/
MatBadge.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this.description && this._badgeElement) {
this._ariaDescriber.removeDescription(this._badgeElement, this.description);
}
};
/**
* Injects a span element into the DOM with the content.
* @return {?}
*/
MatBadge.prototype._updateTextContent = /**
* Injects a span element into the DOM with the content.
* @return {?}
*/
function () {
if (!this._badgeElement) {
this._badgeElement = this._createBadgeElement();
}
else {
this._badgeElement.textContent = this.content;
}
return this._badgeElement;
};
/**
* Creates the badge element
* @return {?}
*/
MatBadge.prototype._createBadgeElement = /**
* Creates the badge element
* @return {?}
*/
function () {
var /** @type {?} */ badgeElement = this._document.createElement('span');
var /** @type {?} */ activeClass = 'mat-badge-active';
badgeElement.setAttribute('id', "mat-badge-content-" + this._id);
badgeElement.classList.add('mat-badge-content');
badgeElement.textContent = this.content;
if (this.description) {
badgeElement.setAttribute('aria-label', this.description);
}
this._elementRef.nativeElement.appendChild(badgeElement);
// animate in after insertion
if (typeof requestAnimationFrame === 'function') {
this._ngZone.runOutsideAngular(function () {
requestAnimationFrame(function () {
badgeElement.classList.add(activeClass);
});
});
}
else {
badgeElement.classList.add(activeClass);
}
return badgeElement;
};
/**
* Sets the aria-label property on the element
* @param {?} newDescription
* @param {?} oldDescription
* @return {?}
*/
MatBadge.prototype._updateHostAriaDescription = /**
* Sets the aria-label property on the element
* @param {?} newDescription
* @param {?} oldDescription
* @return {?}
*/
function (newDescription, oldDescription) {
// ensure content available before setting label
var /** @type {?} */ content = this._updateTextContent();
if (oldDescription) {
this._ariaDescriber.removeDescription(content, oldDescription);
}
if (newDescription) {
this._ariaDescriber.describe(content, newDescription);
}
};
/**
* Adds css theme class given the color to the component host
* @param {?} colorPalette
* @return {?}
*/
MatBadge.prototype._setColor = /**
* Adds css theme class given the color to the component host
* @param {?} colorPalette
* @return {?}
*/
function (colorPalette) {
if (colorPalette !== this._color) {
if (this._color) {
this._elementRef.nativeElement.classList.remove("mat-badge-" + this._color);
}
if (colorPalette) {
this._elementRef.nativeElement.classList.add("mat-badge-" + colorPalette);
}
}
};
MatBadge.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Directive"], args: [{
selector: '[matBadge]',
host: {
'class': 'mat-badge',
'[class.mat-badge-overlap]': 'overlap',
'[class.mat-badge-above]': 'isAbove()',
'[class.mat-badge-below]': '!isAbove()',
'[class.mat-badge-before]': '!isAfter()',
'[class.mat-badge-after]': 'isAfter()',
'[class.mat-badge-small]': 'size === "small"',
'[class.mat-badge-medium]': 'size === "medium"',
'[class.mat-badge-large]': 'size === "large"',
'[class.mat-badge-hidden]': 'hidden',
},
},] },
];
/** @nocollapse */
MatBadge.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_2__["DOCUMENT"],] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["NgZone"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ElementRef"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_0__["AriaDescriber"], },
]; };
MatBadge.propDecorators = {
"color": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"], args: ['matBadgeColor',] },],
"overlap": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"], args: ['matBadgeOverlap',] },],
"position": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"], args: ['matBadgePosition',] },],
"content": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"], args: ['matBadge',] },],
"description": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"], args: ['matBadgeDescription',] },],
"size": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"], args: ['matBadgeSize',] },],
"hidden": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"], args: ['matBadgeHidden',] },],
};
return MatBadge;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatBadgeModule = /** @class */ (function () {
function MatBadgeModule() {
}
MatBadgeModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["NgModule"], args: [{
imports: [_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["MatCommonModule"]],
exports: [MatBadge],
declarations: [MatBadge],
},] },
];
return MatBadgeModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=badge.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/bottom-sheet.es5.js":
/*!*****************************************************************!*\
!*** ./node_modules/@angular/material/esm5/bottom-sheet.es5.js ***!
\*****************************************************************/
/*! exports provided: MatBottomSheetModule, MatBottomSheet, MAT_BOTTOM_SHEET_DATA, MatBottomSheetConfig, MatBottomSheetContainer, matBottomSheetAnimations, MatBottomSheetRef */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatBottomSheetModule", function() { return MatBottomSheetModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatBottomSheet", function() { return MatBottomSheet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_BOTTOM_SHEET_DATA", function() { return MAT_BOTTOM_SHEET_DATA; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatBottomSheetConfig", function() { return MatBottomSheetConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatBottomSheetContainer", function() { return MatBottomSheetContainer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matBottomSheetAnimations", function() { return matBottomSheetAnimations; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatBottomSheetRef", function() { return MatBottomSheetRef; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/cdk/portal */ "./node_modules/@angular/cdk/esm5/portal.es5.js");
/* harmony import */ var _angular_cdk_layout__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/cdk/layout */ "./node_modules/@angular/cdk/esm5/layout.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/cdk/overlay */ "./node_modules/@angular/cdk/esm5/overlay.es5.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token that can be used to access the data that was passed in to a bottom sheet.
*/
var /** @type {?} */ MAT_BOTTOM_SHEET_DATA = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('MatBottomSheetData');
/**
* Configuration used when opening a bottom sheet.
* @template D
*/
var /**
* Configuration used when opening a bottom sheet.
* @template D
*/
MatBottomSheetConfig = /** @class */ (function () {
function MatBottomSheetConfig() {
/**
* Data being injected into the child component.
*/
this.data = null;
/**
* Whether the bottom sheet has a backdrop.
*/
this.hasBackdrop = true;
/**
* Whether the user can use escape or clicking outside to close the bottom sheet.
*/
this.disableClose = false;
/**
* Aria label to assign to the bottom sheet element.
*/
this.ariaLabel = null;
}
return MatBottomSheetConfig;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Reference to a bottom sheet dispatched from the bottom sheet service.
* @template T, R
*/
var /**
* Reference to a bottom sheet dispatched from the bottom sheet service.
* @template T, R
*/
MatBottomSheetRef = /** @class */ (function () {
function MatBottomSheetRef(containerInstance, _overlayRef) {
var _this = this;
this._overlayRef = _overlayRef;
/**
* Subject for notifying the user that the bottom sheet has been dismissed.
*/
this._afterDismissed = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
/**
* Subject for notifying the user that the bottom sheet has opened and appeared.
*/
this._afterOpened = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
this.containerInstance = containerInstance;
// Emit when opening animation completes
containerInstance._animationStateChanged.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])(function (event) { return event.phaseName === 'done' && event.toState === 'visible'; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["take"])(1))
.subscribe(function () {
_this._afterOpened.next();
_this._afterOpened.complete();
});
// Dispose overlay when closing animation is complete
containerInstance._animationStateChanged.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])(function (event) { return event.phaseName === 'done' && event.toState === 'hidden'; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["take"])(1))
.subscribe(function () {
_this._overlayRef.dispose();
_this._afterDismissed.next(_this._result);
_this._afterDismissed.complete();
});
if (!containerInstance.bottomSheetConfig.disableClose) {
Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["merge"])(_overlayRef.backdropClick(), _overlayRef._keydownEvents.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])(function (event) { return event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_1__["ESCAPE"]; }))).subscribe(function () { return _this.dismiss(); });
}
}
/**
* Dismisses the bottom sheet.
* @param result Data to be passed back to the bottom sheet opener.
*/
/**
* Dismisses the bottom sheet.
* @param {?=} result Data to be passed back to the bottom sheet opener.
* @return {?}
*/
MatBottomSheetRef.prototype.dismiss = /**
* Dismisses the bottom sheet.
* @param {?=} result Data to be passed back to the bottom sheet opener.
* @return {?}
*/
function (result) {
var _this = this;
if (!this._afterDismissed.closed) {
// Transition the backdrop in parallel to the bottom sheet.
this.containerInstance._animationStateChanged.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])(function (event) { return event.phaseName === 'start'; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["take"])(1)).subscribe(function () { return _this._overlayRef.detachBackdrop(); });
this._result = result;
this.containerInstance.exit();
}
};
/** Gets an observable that is notified when the bottom sheet is finished closing. */
/**
* Gets an observable that is notified when the bottom sheet is finished closing.
* @return {?}
*/
MatBottomSheetRef.prototype.afterDismissed = /**
* Gets an observable that is notified when the bottom sheet is finished closing.
* @return {?}
*/
function () {
return this._afterDismissed.asObservable();
};
/** Gets an observable that is notified when the bottom sheet has opened and appeared. */
/**
* Gets an observable that is notified when the bottom sheet has opened and appeared.
* @return {?}
*/
MatBottomSheetRef.prototype.afterOpened = /**
* Gets an observable that is notified when the bottom sheet has opened and appeared.
* @return {?}
*/
function () {
return this._afterOpened.asObservable();
};
/**
* Gets an observable that emits when the overlay's backdrop has been clicked.
*/
/**
* Gets an observable that emits when the overlay's backdrop has been clicked.
* @return {?}
*/
MatBottomSheetRef.prototype.backdropClick = /**
* Gets an observable that emits when the overlay's backdrop has been clicked.
* @return {?}
*/
function () {
return this._overlayRef.backdropClick();
};
/**
* Gets an observable that emits when keydown events are targeted on the overlay.
*/
/**
* Gets an observable that emits when keydown events are targeted on the overlay.
* @return {?}
*/
MatBottomSheetRef.prototype.keydownEvents = /**
* Gets an observable that emits when keydown events are targeted on the overlay.
* @return {?}
*/
function () {
return this._overlayRef.keydownEvents();
};
return MatBottomSheetRef;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Animations used by the Material bottom sheet.
*/
var /** @type {?} */ matBottomSheetAnimations = {
/** Animation that shows and hides a bottom sheet. */
bottomSheetState: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["trigger"])('state', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('void, hidden', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(100%)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('visible', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(0%)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('visible => void, visible => hidden', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["AnimationDurations"].COMPLEX + " " + _angular_material_core__WEBPACK_IMPORTED_MODULE_5__["AnimationCurves"].ACCELERATION_CURVE)),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('void => visible', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["AnimationDurations"].EXITING + " " + _angular_material_core__WEBPACK_IMPORTED_MODULE_5__["AnimationCurves"].DECELERATION_CURVE)),
])
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Internal component that wraps user-provided bottom sheet content.
* \@docs-private
*/
var MatBottomSheetContainer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_6__["__extends"])(MatBottomSheetContainer, _super);
function MatBottomSheetContainer(_elementRef, _changeDetectorRef, _focusTrapFactory, breakpointObserver, document) {
var _this = _super.call(this) || this;
_this._elementRef = _elementRef;
_this._changeDetectorRef = _changeDetectorRef;
_this._focusTrapFactory = _focusTrapFactory;
/**
* The state of the bottom sheet animations.
*/
_this._animationState = 'void';
/**
* Emits whenever the state of the animation changes.
*/
_this._animationStateChanged = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Element that was focused before the bottom sheet was opened.
*/
_this._elementFocusedBeforeOpened = null;
_this._document = document;
_this._breakpointSubscription = breakpointObserver
.observe([_angular_cdk_layout__WEBPACK_IMPORTED_MODULE_8__["Breakpoints"].Medium, _angular_cdk_layout__WEBPACK_IMPORTED_MODULE_8__["Breakpoints"].Large, _angular_cdk_layout__WEBPACK_IMPORTED_MODULE_8__["Breakpoints"].XLarge])
.subscribe(function () {
_this._toggleClass('mat-bottom-sheet-container-medium', breakpointObserver.isMatched(_angular_cdk_layout__WEBPACK_IMPORTED_MODULE_8__["Breakpoints"].Medium));
_this._toggleClass('mat-bottom-sheet-container-large', breakpointObserver.isMatched(_angular_cdk_layout__WEBPACK_IMPORTED_MODULE_8__["Breakpoints"].Large));
_this._toggleClass('mat-bottom-sheet-container-xlarge', breakpointObserver.isMatched(_angular_cdk_layout__WEBPACK_IMPORTED_MODULE_8__["Breakpoints"].XLarge));
});
return _this;
}
/** Attach a component portal as content to this bottom sheet container. */
/**
* Attach a component portal as content to this bottom sheet container.
* @template T
* @param {?} portal
* @return {?}
*/
MatBottomSheetContainer.prototype.attachComponentPortal = /**
* Attach a component portal as content to this bottom sheet container.
* @template T
* @param {?} portal
* @return {?}
*/
function (portal) {
this._validatePortalAttached();
this._setPanelClass();
this._savePreviouslyFocusedElement();
return this._portalOutlet.attachComponentPortal(portal);
};
/** Attach a template portal as content to this bottom sheet container. */
/**
* Attach a template portal as content to this bottom sheet container.
* @template C
* @param {?} portal
* @return {?}
*/
MatBottomSheetContainer.prototype.attachTemplatePortal = /**
* Attach a template portal as content to this bottom sheet container.
* @template C
* @param {?} portal
* @return {?}
*/
function (portal) {
this._validatePortalAttached();
this._setPanelClass();
this._savePreviouslyFocusedElement();
return this._portalOutlet.attachTemplatePortal(portal);
};
/** Begin animation of bottom sheet entrance into view. */
/**
* Begin animation of bottom sheet entrance into view.
* @return {?}
*/
MatBottomSheetContainer.prototype.enter = /**
* Begin animation of bottom sheet entrance into view.
* @return {?}
*/
function () {
if (!this._destroyed) {
this._animationState = 'visible';
this._changeDetectorRef.detectChanges();
}
};
/** Begin animation of the bottom sheet exiting from view. */
/**
* Begin animation of the bottom sheet exiting from view.
* @return {?}
*/
MatBottomSheetContainer.prototype.exit = /**
* Begin animation of the bottom sheet exiting from view.
* @return {?}
*/
function () {
if (!this._destroyed) {
this._animationState = 'hidden';
this._changeDetectorRef.markForCheck();
}
};
/**
* @return {?}
*/
MatBottomSheetContainer.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._breakpointSubscription.unsubscribe();
this._destroyed = true;
};
/**
* @param {?} event
* @return {?}
*/
MatBottomSheetContainer.prototype._onAnimationDone = /**
* @param {?} event
* @return {?}
*/
function (event) {
if (event.toState === 'visible') {
this._trapFocus();
}
else if (event.toState === 'hidden') {
this._restoreFocus();
}
this._animationStateChanged.emit(event);
};
/**
* @param {?} event
* @return {?}
*/
MatBottomSheetContainer.prototype._onAnimationStart = /**
* @param {?} event
* @return {?}
*/
function (event) {
this._animationStateChanged.emit(event);
};
/**
* @param {?} cssClass
* @param {?} add
* @return {?}
*/
MatBottomSheetContainer.prototype._toggleClass = /**
* @param {?} cssClass
* @param {?} add
* @return {?}
*/
function (cssClass, add) {
var /** @type {?} */ classList = this._elementRef.nativeElement.classList;
add ? classList.add(cssClass) : classList.remove(cssClass);
};
/**
* @return {?}
*/
MatBottomSheetContainer.prototype._validatePortalAttached = /**
* @return {?}
*/
function () {
if (this._portalOutlet.hasAttached()) {
throw Error('Attempting to attach bottom sheet content after content is already attached');
}
};
/**
* @return {?}
*/
MatBottomSheetContainer.prototype._setPanelClass = /**
* @return {?}
*/
function () {
var /** @type {?} */ element = this._elementRef.nativeElement;
var /** @type {?} */ panelClass = this.bottomSheetConfig.panelClass;
if (Array.isArray(panelClass)) {
// Note that we can't use a spread here, because IE doesn't support multiple arguments.
panelClass.forEach(function (cssClass) { return element.classList.add(cssClass); });
}
else if (panelClass) {
element.classList.add(panelClass);
}
};
/**
* Moves the focus inside the focus trap.
* @return {?}
*/
MatBottomSheetContainer.prototype._trapFocus = /**
* Moves the focus inside the focus trap.
* @return {?}
*/
function () {
if (!this._focusTrap) {
this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
}
this._focusTrap.focusInitialElementWhenReady();
};
/**
* Restores focus to the element that was focused before the bottom sheet opened.
* @return {?}
*/
MatBottomSheetContainer.prototype._restoreFocus = /**
* Restores focus to the element that was focused before the bottom sheet opened.
* @return {?}
*/
function () {
var /** @type {?} */ toFocus = this._elementFocusedBeforeOpened;
// We need the extra check, because IE can set the `activeElement` to null in some cases.
if (toFocus && typeof toFocus.focus === 'function') {
toFocus.focus();
}
if (this._focusTrap) {
this._focusTrap.destroy();
}
};
/**
* Saves a reference to the element that was focused before the bottom sheet was opened.
* @return {?}
*/
MatBottomSheetContainer.prototype._savePreviouslyFocusedElement = /**
* Saves a reference to the element that was focused before the bottom sheet was opened.
* @return {?}
*/
function () {
var _this = this;
this._elementFocusedBeforeOpened = /** @type {?} */ (this._document.activeElement);
// The `focus` method isn't available during server-side rendering.
if (this._elementRef.nativeElement.focus) {
Promise.resolve().then(function () { return _this._elementRef.nativeElement.focus(); });
}
};
MatBottomSheetContainer.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-bottom-sheet-container',
template: "<ng-template cdkPortalOutlet></ng-template>",
styles: [".mat-bottom-sheet-container{box-shadow:0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12);padding:8px 16px;min-width:100vw;box-sizing:border-box;display:block;outline:0;max-height:80vh;overflow:auto}@media screen and (-ms-high-contrast:active){.mat-bottom-sheet-container{outline:1px solid}}.mat-bottom-sheet-container-medium{min-width:384px;max-width:calc(100vw - 128px)}.mat-bottom-sheet-container-large{min-width:512px;max-width:calc(100vw - 256px)}.mat-bottom-sheet-container-xlarge{min-width:576px;max-width:calc(100vw - 384px)}"],
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
animations: [matBottomSheetAnimations.bottomSheetState],
host: {
'class': 'mat-bottom-sheet-container',
'tabindex': '-1',
'role': 'dialog',
'[attr.aria-label]': 'bottomSheetConfig?.ariaLabel',
'[@state]': '_animationState',
'(@state.start)': '_onAnimationStart($event)',
'(@state.done)': '_onAnimationDone($event)'
},
},] },
];
/** @nocollapse */
MatBottomSheetContainer.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_10__["FocusTrapFactory"], },
{ type: _angular_cdk_layout__WEBPACK_IMPORTED_MODULE_8__["BreakpointObserver"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_9__["DOCUMENT"],] },] },
]; };
MatBottomSheetContainer.propDecorators = {
"_portalOutlet": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_7__["CdkPortalOutlet"],] },],
};
return MatBottomSheetContainer;
}(_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_7__["BasePortalOutlet"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Service to trigger Material Design bottom sheets.
*/
var MatBottomSheet = /** @class */ (function () {
function MatBottomSheet(_overlay, _injector, _parentBottomSheet) {
this._overlay = _overlay;
this._injector = _injector;
this._parentBottomSheet = _parentBottomSheet;
this._bottomSheetRefAtThisLevel = null;
}
Object.defineProperty(MatBottomSheet.prototype, "_openedBottomSheetRef", {
/** Reference to the currently opened bottom sheet. */
get: /**
* Reference to the currently opened bottom sheet.
* @return {?}
*/
function () {
var /** @type {?} */ parent = this._parentBottomSheet;
return parent ? parent._openedBottomSheetRef : this._bottomSheetRefAtThisLevel;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (this._parentBottomSheet) {
this._parentBottomSheet._openedBottomSheetRef = value;
}
else {
this._bottomSheetRefAtThisLevel = value;
}
},
enumerable: true,
configurable: true
});
/**
* @template T, D, R
* @param {?} componentOrTemplateRef
* @param {?=} config
* @return {?}
*/
MatBottomSheet.prototype.open = /**
* @template T, D, R
* @param {?} componentOrTemplateRef
* @param {?=} config
* @return {?}
*/
function (componentOrTemplateRef, config) {
var _this = this;
var /** @type {?} */ _config = _applyConfigDefaults(config);
var /** @type {?} */ overlayRef = this._createOverlay(_config);
var /** @type {?} */ container = this._attachContainer(overlayRef, _config);
var /** @type {?} */ ref = new MatBottomSheetRef(container, overlayRef);
if (componentOrTemplateRef instanceof _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"]) {
container.attachTemplatePortal(new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_7__["TemplatePortal"](componentOrTemplateRef, /** @type {?} */ ((null)), /** @type {?} */ ({
$implicit: _config.data,
bottomSheetRef: ref
})));
}
else {
var /** @type {?} */ portal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_7__["ComponentPortal"](componentOrTemplateRef, undefined, this._createInjector(_config, ref));
var /** @type {?} */ contentRef = container.attachComponentPortal(portal);
ref.instance = contentRef.instance;
}
// When the bottom sheet is dismissed, clear the reference to it.
ref.afterDismissed().subscribe(function () {
// Clear the bottom sheet ref if it hasn't already been replaced by a newer one.
if (_this._openedBottomSheetRef == ref) {
_this._openedBottomSheetRef = null;
}
});
if (this._openedBottomSheetRef) {
// If a bottom sheet is already in view, dismiss it and enter the
// new bottom sheet after exit animation is complete.
this._openedBottomSheetRef.afterDismissed().subscribe(function () { return ref.containerInstance.enter(); });
this._openedBottomSheetRef.dismiss();
}
else {
// If no bottom sheet is in view, enter the new bottom sheet.
ref.containerInstance.enter();
}
this._openedBottomSheetRef = ref;
return ref;
};
/**
* Dismisses the currently-visible bottom sheet.
*/
/**
* Dismisses the currently-visible bottom sheet.
* @return {?}
*/
MatBottomSheet.prototype.dismiss = /**
* Dismisses the currently-visible bottom sheet.
* @return {?}
*/
function () {
if (this._openedBottomSheetRef) {
this._openedBottomSheetRef.dismiss();
}
};
/**
* Attaches the bottom sheet container component to the overlay.
* @param {?} overlayRef
* @param {?} config
* @return {?}
*/
MatBottomSheet.prototype._attachContainer = /**
* Attaches the bottom sheet container component to the overlay.
* @param {?} overlayRef
* @param {?} config
* @return {?}
*/
function (overlayRef, config) {
var /** @type {?} */ containerPortal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_7__["ComponentPortal"](MatBottomSheetContainer, config.viewContainerRef);
var /** @type {?} */ containerRef = overlayRef.attach(containerPortal);
containerRef.instance.bottomSheetConfig = config;
return containerRef.instance;
};
/**
* Creates a new overlay and places it in the correct location.
* @param {?} config The user-specified bottom sheet config.
* @return {?}
*/
MatBottomSheet.prototype._createOverlay = /**
* Creates a new overlay and places it in the correct location.
* @param {?} config The user-specified bottom sheet config.
* @return {?}
*/
function (config) {
var /** @type {?} */ overlayConfig = new _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_11__["OverlayConfig"]({
direction: config.direction,
hasBackdrop: config.hasBackdrop,
maxWidth: '100%',
scrollStrategy: this._overlay.scrollStrategies.block(),
positionStrategy: this._overlay.position()
.global()
.centerHorizontally()
.bottom('0')
});
if (config.backdropClass) {
overlayConfig.backdropClass = config.backdropClass;
}
return this._overlay.create(overlayConfig);
};
/**
* Creates an injector to be used inside of a bottom sheet component.
* @template T
* @param {?} config Config that was used to create the bottom sheet.
* @param {?} bottomSheetRef Reference to the bottom sheet.
* @return {?}
*/
MatBottomSheet.prototype._createInjector = /**
* Creates an injector to be used inside of a bottom sheet component.
* @template T
* @param {?} config Config that was used to create the bottom sheet.
* @param {?} bottomSheetRef Reference to the bottom sheet.
* @return {?}
*/
function (config, bottomSheetRef) {
var /** @type {?} */ userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
var /** @type {?} */ injectionTokens = new WeakMap();
injectionTokens.set(MatBottomSheetRef, bottomSheetRef);
injectionTokens.set(MAT_BOTTOM_SHEET_DATA, config.data);
if (!userInjector || !userInjector.get(_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__["Directionality"], null)) {
injectionTokens.set(_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__["Directionality"], {
value: config.direction,
change: Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])()
});
}
return new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_7__["PortalInjector"](userInjector || this._injector, injectionTokens);
};
MatBottomSheet.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
MatBottomSheet.ctorParameters = function () { return [
{ type: _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_11__["Overlay"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injector"], },
{ type: MatBottomSheet, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"] },] },
]; };
return MatBottomSheet;
}());
/**
* Applies default options to the bottom sheet config.
* @param {?=} config The configuration to which the defaults will be applied.
* @return {?} The new configuration object with defaults applied.
*/
function _applyConfigDefaults(config) {
return Object(tslib__WEBPACK_IMPORTED_MODULE_6__["__assign"])({}, new MatBottomSheetConfig(), config);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatBottomSheetModule = /** @class */ (function () {
function MatBottomSheetModule() {
}
MatBottomSheetModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_9__["CommonModule"],
_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_11__["OverlayModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["MatCommonModule"],
_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_7__["PortalModule"],
],
exports: [MatBottomSheetContainer, _angular_material_core__WEBPACK_IMPORTED_MODULE_5__["MatCommonModule"]],
declarations: [MatBottomSheetContainer],
entryComponents: [MatBottomSheetContainer],
providers: [MatBottomSheet],
},] },
];
return MatBottomSheetModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=bottom-sheet.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/button-toggle.es5.js":
/*!******************************************************************!*\
!*** ./node_modules/@angular/material/esm5/button-toggle.es5.js ***!
\******************************************************************/
/*! exports provided: MatButtonToggleGroupBase, _MatButtonToggleGroupMixinBase, MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR, MatButtonToggleGroupMultiple, MatButtonToggleChange, MatButtonToggleGroup, MatButtonToggleBase, _MatButtonToggleMixinBase, MatButtonToggle, MatButtonToggleModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggleGroupBase", function() { return MatButtonToggleGroupBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatButtonToggleGroupMixinBase", function() { return _MatButtonToggleGroupMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR", function() { return MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggleGroupMultiple", function() { return MatButtonToggleGroupMultiple; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggleChange", function() { return MatButtonToggleChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggleGroup", function() { return MatButtonToggleGroup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggleBase", function() { return MatButtonToggleBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatButtonToggleMixinBase", function() { return _MatButtonToggleMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggle", function() { return MatButtonToggle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggleModule", function() { return MatButtonToggleModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm5/collections.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatButtonToggleGroupBase = /** @class */ (function () {
function MatButtonToggleGroupBase() {
}
return MatButtonToggleGroupBase;
}());
var /** @type {?} */ _MatButtonToggleGroupMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["mixinDisabled"])(MatButtonToggleGroupBase);
/**
* Provider Expression that allows mat-button-toggle-group to register as a ControlValueAccessor.
* This allows it to support [(ngModel)].
* \@docs-private
*/
var /** @type {?} */ MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR = {
provide: _angular_forms__WEBPACK_IMPORTED_MODULE_4__["NG_VALUE_ACCESSOR"],
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_3__["forwardRef"])(function () { return MatButtonToggleGroup; }),
multi: true
};
/**
* @deprecated Use `MatButtonToggleGroup` instead.
* \@deletion-target 7.0.0
*/
var /**
* @deprecated Use `MatButtonToggleGroup` instead.
* \@deletion-target 7.0.0
*/
MatButtonToggleGroupMultiple = /** @class */ (function () {
function MatButtonToggleGroupMultiple() {
}
return MatButtonToggleGroupMultiple;
}());
var /** @type {?} */ _uniqueIdCounter = 0;
/**
* Change event object emitted by MatButtonToggle.
*/
var /**
* Change event object emitted by MatButtonToggle.
*/
MatButtonToggleChange = /** @class */ (function () {
function MatButtonToggleChange(source, value) {
this.source = source;
this.value = value;
}
return MatButtonToggleChange;
}());
/**
* Exclusive selection button toggle group that behaves like a radio-button group.
*/
var MatButtonToggleGroup = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatButtonToggleGroup, _super);
function MatButtonToggleGroup(_changeDetector) {
var _this = _super.call(this) || this;
_this._changeDetector = _changeDetector;
_this._vertical = false;
_this._multiple = false;
/**
* The method to be called in order to update ngModel.
* Now `ngModel` binding is not supported in multiple selection mode.
*/
_this._controlValueAccessorChangeFn = function () { };
/**
* onTouch function registered via registerOnTouch (ControlValueAccessor).
*/
_this._onTouched = function () { };
_this._name = "mat-button-toggle-group-" + _uniqueIdCounter++;
/**
* Event that emits whenever the value of the group changes.
* Used to facilitate two-way data binding.
* \@docs-private
*/
_this.valueChange = new _angular_core__WEBPACK_IMPORTED_MODULE_3__["EventEmitter"]();
/**
* Event emitted when the group's value changes.
*/
_this.change = new _angular_core__WEBPACK_IMPORTED_MODULE_3__["EventEmitter"]();
return _this;
}
Object.defineProperty(MatButtonToggleGroup.prototype, "name", {
get: /**
* `name` attribute for the underlying `input` element.
* @return {?}
*/
function () { return this._name; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var _this = this;
this._name = value;
if (this._buttonToggles) {
this._buttonToggles.forEach(function (toggle) { return toggle.name = _this._name; });
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatButtonToggleGroup.prototype, "vertical", {
get: /**
* Whether the toggle group is vertical.
* @return {?}
*/
function () { return this._vertical; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._vertical = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatButtonToggleGroup.prototype, "value", {
get: /**
* Value of the toggle group.
* @return {?}
*/
function () {
var /** @type {?} */ selected = this._selectionModel ? this._selectionModel.selected : [];
if (this.multiple) {
return selected.map(function (toggle) { return toggle.value; });
}
return selected[0] ? selected[0].value : undefined;
},
set: /**
* @param {?} newValue
* @return {?}
*/
function (newValue) {
this._setSelectionByValue(newValue);
this.valueChange.emit(this.value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatButtonToggleGroup.prototype, "selected", {
/** Selected button toggles in the group. */
get: /**
* Selected button toggles in the group.
* @return {?}
*/
function () {
var /** @type {?} */ selected = this._selectionModel.selected;
return this.multiple ? selected : (selected[0] || null);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatButtonToggleGroup.prototype, "multiple", {
get: /**
* Whether multiple button toggles can be selected.
* @return {?}
*/
function () { return this._multiple; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._multiple = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatButtonToggleGroup.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._selectionModel = new _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_6__["SelectionModel"](this.multiple, undefined, false);
};
/**
* @return {?}
*/
MatButtonToggleGroup.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
(_a = this._selectionModel).select.apply(_a, this._buttonToggles.filter(function (toggle) { return toggle.checked; }));
var _a;
};
/**
* Sets the model value. Implemented as part of ControlValueAccessor.
* @param value Value to be set to the model.
*/
/**
* Sets the model value. Implemented as part of ControlValueAccessor.
* @param {?} value Value to be set to the model.
* @return {?}
*/
MatButtonToggleGroup.prototype.writeValue = /**
* Sets the model value. Implemented as part of ControlValueAccessor.
* @param {?} value Value to be set to the model.
* @return {?}
*/
function (value) {
this.value = value;
this._changeDetector.markForCheck();
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} fn
* @return {?}
*/
MatButtonToggleGroup.prototype.registerOnChange = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this._controlValueAccessorChangeFn = fn;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} fn
* @return {?}
*/
MatButtonToggleGroup.prototype.registerOnTouched = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this._onTouched = fn;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} isDisabled
* @return {?}
*/
MatButtonToggleGroup.prototype.setDisabledState = /**
* @param {?} isDisabled
* @return {?}
*/
function (isDisabled) {
this.disabled = isDisabled;
if (this._buttonToggles) {
this._buttonToggles.forEach(function (toggle) { return toggle._markForCheck(); });
}
};
/** Dispatch change event with current selection and group value. */
/**
* Dispatch change event with current selection and group value.
* @return {?}
*/
MatButtonToggleGroup.prototype._emitChangeEvent = /**
* Dispatch change event with current selection and group value.
* @return {?}
*/
function () {
var /** @type {?} */ selected = this.selected;
var /** @type {?} */ source = Array.isArray(selected) ? selected[selected.length - 1] : selected;
var /** @type {?} */ event = new MatButtonToggleChange(/** @type {?} */ ((source)), this.value);
this._controlValueAccessorChangeFn(event.value);
this.change.emit(event);
};
/**
* Syncs a button toggle's selected state with the model value.
* @param toggle Toggle to be synced.
* @param select Whether the toggle should be selected.
* @param isUserInput Whether the change was a result of a user interaction.
*/
/**
* Syncs a button toggle's selected state with the model value.
* @param {?} toggle Toggle to be synced.
* @param {?} select Whether the toggle should be selected.
* @param {?=} isUserInput Whether the change was a result of a user interaction.
* @return {?}
*/
MatButtonToggleGroup.prototype._syncButtonToggle = /**
* Syncs a button toggle's selected state with the model value.
* @param {?} toggle Toggle to be synced.
* @param {?} select Whether the toggle should be selected.
* @param {?=} isUserInput Whether the change was a result of a user interaction.
* @return {?}
*/
function (toggle, select, isUserInput) {
if (isUserInput === void 0) { isUserInput = false; }
// Deselect the currently-selected toggle, if we're in single-selection
// mode and the button being toggled isn't selected at the moment.
if (!this.multiple && this.selected && !toggle.checked) {
(/** @type {?} */ (this.selected)).checked = false;
}
if (select) {
this._selectionModel.select(toggle);
}
else {
this._selectionModel.deselect(toggle);
}
// Only emit the change event for user input.
if (isUserInput) {
this._emitChangeEvent();
}
// Note: we emit this one no matter whether it was a user interaction, because
// it is used by Angular to sync up the two-way data binding.
this.valueChange.emit(this.value);
};
/** Checks whether a button toggle is selected. */
/**
* Checks whether a button toggle is selected.
* @param {?} toggle
* @return {?}
*/
MatButtonToggleGroup.prototype._isSelected = /**
* Checks whether a button toggle is selected.
* @param {?} toggle
* @return {?}
*/
function (toggle) {
return this._selectionModel.isSelected(toggle);
};
/** Determines whether a button toggle should be checked on init. */
/**
* Determines whether a button toggle should be checked on init.
* @param {?} toggle
* @return {?}
*/
MatButtonToggleGroup.prototype._isPrechecked = /**
* Determines whether a button toggle should be checked on init.
* @param {?} toggle
* @return {?}
*/
function (toggle) {
if (typeof this._rawValue === 'undefined') {
return false;
}
if (this.multiple && Array.isArray(this._rawValue)) {
return !!this._rawValue.find(function (value) { return toggle.value != null && value === toggle.value; });
}
return toggle.value === this._rawValue;
};
/**
* Updates the selection state of the toggles in the group based on a value.
* @param {?} value
* @return {?}
*/
MatButtonToggleGroup.prototype._setSelectionByValue = /**
* Updates the selection state of the toggles in the group based on a value.
* @param {?} value
* @return {?}
*/
function (value) {
var _this = this;
this._rawValue = value;
if (!this._buttonToggles) {
return;
}
if (this.multiple && value) {
if (!Array.isArray(value)) {
throw Error('Value must be an array in multiple-selection mode.');
}
this._clearSelection();
value.forEach(function (currentValue) { return _this._selectValue(currentValue); });
}
else {
this._clearSelection();
this._selectValue(value);
}
};
/**
* Clears the selected toggles.
* @return {?}
*/
MatButtonToggleGroup.prototype._clearSelection = /**
* Clears the selected toggles.
* @return {?}
*/
function () {
this._selectionModel.clear();
this._buttonToggles.forEach(function (toggle) { return toggle.checked = false; });
};
/**
* Selects a value if there's a toggle that corresponds to it.
* @param {?} value
* @return {?}
*/
MatButtonToggleGroup.prototype._selectValue = /**
* Selects a value if there's a toggle that corresponds to it.
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ correspondingOption = this._buttonToggles.find(function (toggle) {
return toggle.value != null && toggle.value === value;
});
if (correspondingOption) {
correspondingOption.checked = true;
this._selectionModel.select(correspondingOption);
}
};
MatButtonToggleGroup.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Directive"], args: [{
selector: 'mat-button-toggle-group',
providers: [
MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR,
{ provide: MatButtonToggleGroupMultiple, useExisting: MatButtonToggleGroup },
],
inputs: ['disabled'],
host: {
'[attr.role]': 'multiple ? "group" : "radiogroup"',
'class': 'mat-button-toggle-group',
'[class.mat-button-toggle-vertical]': 'vertical'
},
exportAs: 'matButtonToggleGroup',
},] },
];
/** @nocollapse */
MatButtonToggleGroup.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ChangeDetectorRef"], },
]; };
MatButtonToggleGroup.propDecorators = {
"_buttonToggles": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ContentChildren"], args: [Object(_angular_core__WEBPACK_IMPORTED_MODULE_3__["forwardRef"])(function () { return MatButtonToggle; }),] },],
"name": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"] },],
"vertical": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"] },],
"valueChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Output"] },],
"multiple": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"] },],
"change": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Output"] },],
};
return MatButtonToggleGroup;
}(_MatButtonToggleGroupMixinBase));
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatButtonToggleBase = /** @class */ (function () {
function MatButtonToggleBase() {
}
return MatButtonToggleBase;
}());
var /** @type {?} */ _MatButtonToggleMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["mixinDisableRipple"])(MatButtonToggleBase);
/**
* Single button inside of a toggle group.
*/
var MatButtonToggle = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatButtonToggle, _super);
function MatButtonToggle(toggleGroup, _changeDetectorRef, _elementRef, _focusMonitor) {
var _this = _super.call(this) || this;
_this._changeDetectorRef = _changeDetectorRef;
_this._elementRef = _elementRef;
_this._focusMonitor = _focusMonitor;
_this._isSingleSelector = false;
_this._checked = false;
/**
* Users can specify the `aria-labelledby` attribute which will be forwarded to the input element
*/
_this.ariaLabelledby = null;
_this._disabled = false;
/**
* Event emitted when the group value changes.
*/
_this.change = new _angular_core__WEBPACK_IMPORTED_MODULE_3__["EventEmitter"]();
_this.buttonToggleGroup = toggleGroup;
return _this;
}
Object.defineProperty(MatButtonToggle.prototype, "inputId", {
/** Unique ID for the underlying `input` element. */
get: /**
* Unique ID for the underlying `input` element.
* @return {?}
*/
function () { return this.id + "-input"; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatButtonToggle.prototype, "checked", {
get: /**
* Whether the button is checked.
* @return {?}
*/
function () {
return this.buttonToggleGroup ? this.buttonToggleGroup._isSelected(this) : this._checked;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ newValue = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value);
if (newValue !== this._checked) {
this._checked = newValue;
if (this.buttonToggleGroup) {
this.buttonToggleGroup._syncButtonToggle(this, this._checked);
}
this._changeDetectorRef.markForCheck();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatButtonToggle.prototype, "disabled", {
get: /**
* Whether the button is disabled.
* @return {?}
*/
function () {
return this._disabled || (this.buttonToggleGroup && this.buttonToggleGroup.disabled);
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._disabled = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatButtonToggle.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._isSingleSelector = this.buttonToggleGroup && !this.buttonToggleGroup.multiple;
this._type = this._isSingleSelector ? 'radio' : 'checkbox';
this.id = this.id || "mat-button-toggle-" + _uniqueIdCounter++;
if (this._isSingleSelector) {
this.name = this.buttonToggleGroup.name;
}
if (this.buttonToggleGroup && this.buttonToggleGroup._isPrechecked(this)) {
this.checked = true;
}
this._focusMonitor.monitor(this._elementRef.nativeElement, true);
};
/**
* @return {?}
*/
MatButtonToggle.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._focusMonitor.stopMonitoring(this._elementRef.nativeElement);
};
/** Focuses the button. */
/**
* Focuses the button.
* @return {?}
*/
MatButtonToggle.prototype.focus = /**
* Focuses the button.
* @return {?}
*/
function () {
this._inputElement.nativeElement.focus();
};
/** Checks the button toggle due to an interaction with the underlying native input. */
/**
* Checks the button toggle due to an interaction with the underlying native input.
* @param {?} event
* @return {?}
*/
MatButtonToggle.prototype._onInputChange = /**
* Checks the button toggle due to an interaction with the underlying native input.
* @param {?} event
* @return {?}
*/
function (event) {
event.stopPropagation();
this._checked = this._isSingleSelector ? true : !this._checked;
if (this.buttonToggleGroup) {
this.buttonToggleGroup._syncButtonToggle(this, this._checked, true);
this.buttonToggleGroup._onTouched();
}
// Emit a change event when the native input does.
this.change.emit(new MatButtonToggleChange(this, this.value));
};
/**
* @param {?} event
* @return {?}
*/
MatButtonToggle.prototype._onInputClick = /**
* @param {?} event
* @return {?}
*/
function (event) {
// We have to stop propagation for click events on the visual hidden input element.
// By default, when a user clicks on a label element, a generated click event will be
// dispatched on the associated input element. Since we are using a label element as our
// root container, the click event on the `slide-toggle` will be executed twice.
// The real click event will bubble up, and the generated click event also tries to bubble up.
// This will lead to multiple click events.
// Preventing bubbling for the second event will solve that issue.
event.stopPropagation();
};
/**
* Marks the button toggle as needing checking for change detection.
* This method is exposed because the parent button toggle group will directly
* update bound properties of the radio button.
*/
/**
* Marks the button toggle as needing checking for change detection.
* This method is exposed because the parent button toggle group will directly
* update bound properties of the radio button.
* @return {?}
*/
MatButtonToggle.prototype._markForCheck = /**
* Marks the button toggle as needing checking for change detection.
* This method is exposed because the parent button toggle group will directly
* update bound properties of the radio button.
* @return {?}
*/
function () {
// When the group value changes, the button will not be notified.
// Use `markForCheck` to explicit update button toggle's status.
this._changeDetectorRef.markForCheck();
};
MatButtonToggle.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Component"], args: [{selector: 'mat-button-toggle',
template: "<label [attr.for]=\"inputId\" class=\"mat-button-toggle-label\" #label><input #input class=\"mat-button-toggle-input cdk-visually-hidden\" [type]=\"_type\" [id]=\"inputId\" [checked]=\"checked\" [disabled]=\"disabled || null\" [attr.name]=\"name\" [attr.aria-label]=\"ariaLabel\" [attr.aria-labelledby]=\"ariaLabelledby\" (change)=\"_onInputChange($event)\" (click)=\"_onInputClick($event)\"><div class=\"mat-button-toggle-label-content\"><ng-content></ng-content></div></label><div class=\"mat-button-toggle-focus-overlay\"></div><div class=\"mat-button-toggle-ripple\" matRipple [matRippleTrigger]=\"label\" [matRippleDisabled]=\"this.disableRipple || this.disabled\"></div>",
styles: [".mat-button-toggle-group,.mat-button-toggle-standalone{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);position:relative;display:inline-flex;flex-direction:row;border-radius:2px;cursor:pointer;white-space:nowrap;overflow:hidden}@media screen and (-ms-high-contrast:active){.mat-button-toggle-group,.mat-button-toggle-standalone{outline:solid 1px}}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle-disabled .mat-button-toggle-label-content{cursor:default}.mat-button-toggle{white-space:nowrap;position:relative}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:1}@media screen and (-ms-high-contrast:active){.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:.5}}.mat-button-toggle-label-content{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;line-height:36px;padding:0 16px;cursor:pointer}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{border-radius:inherit;pointer-events:none;opacity:0;top:0;left:0;right:0;bottom:0;position:absolute}@media screen and (-ms-high-contrast:active){.mat-button-toggle-checked .mat-button-toggle-focus-overlay{opacity:.5;height:0;border-bottom:solid 36px}}.mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ViewEncapsulation"].None,
exportAs: 'matButtonToggle',
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ChangeDetectionStrategy"].OnPush,
inputs: ['disableRipple'],
host: {
'[class.mat-button-toggle-standalone]': '!buttonToggleGroup',
'[class.mat-button-toggle-checked]': 'checked',
'[class.mat-button-toggle-disabled]': 'disabled',
'class': 'mat-button-toggle',
'[attr.id]': 'id',
}
},] },
];
/** @nocollapse */
MatButtonToggle.ctorParameters = function () { return [
{ type: MatButtonToggleGroup, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Optional"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ChangeDetectorRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ElementRef"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__["FocusMonitor"], },
]; };
MatButtonToggle.propDecorators = {
"ariaLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"], args: ['aria-label',] },],
"ariaLabelledby": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"], args: ['aria-labelledby',] },],
"_inputElement": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ViewChild"], args: ['input',] },],
"id": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"] },],
"name": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"] },],
"checked": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Input"] },],
"change": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Output"] },],
};
return MatButtonToggle;
}(_MatButtonToggleMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatButtonToggleModule = /** @class */ (function () {
function MatButtonToggleModule() {
}
MatButtonToggleModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["NgModule"], args: [{
imports: [_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["MatCommonModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_5__["MatRippleModule"]],
exports: [_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["MatCommonModule"], MatButtonToggleGroup, MatButtonToggle],
declarations: [MatButtonToggleGroup, MatButtonToggle],
},] },
];
return MatButtonToggleModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=button-toggle.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/button.es5.js":
/*!***********************************************************!*\
!*** ./node_modules/@angular/material/esm5/button.es5.js ***!
\***********************************************************/
/*! exports provided: MatButtonModule, MatButtonBase, _MatButtonMixinBase, MatButton, MatAnchor */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatButtonModule", function() { return MatButtonModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatButtonBase", function() { return MatButtonBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatButtonMixinBase", function() { return _MatButtonMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatButton", function() { return MatButton; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatAnchor", function() { return MatAnchor; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Default color palette for round buttons (mat-fab and mat-mini-fab)
*/
var /** @type {?} */ DEFAULT_ROUND_BUTTON_COLOR = 'accent';
/**
* Default color palette for flat buttons (mat-flat-button)
*/
var /** @type {?} */ DEFAULT_FLAT_BUTTON_COLOR = 'primary';
/**
* List of classes to add to MatButton instances based on host attributes to
* style as different variants.
*/
var /** @type {?} */ BUTTON_HOST_ATTRIBUTES = [
'mat-button',
'mat-flat-button',
'mat-icon-button',
'mat-raised-button',
'mat-stroked-button',
'mat-mini-fab',
'mat-fab',
];
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatButtonBase = /** @class */ (function () {
function MatButtonBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatButtonBase;
}());
var /** @type {?} */ _MatButtonMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["mixinColor"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["mixinDisabled"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["mixinDisableRipple"])(MatButtonBase)));
/**
* Material design button.
*/
var MatButton = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatButton, _super);
function MatButton(elementRef, _platform, _focusMonitor) {
var _this = _super.call(this, elementRef) || this;
_this._platform = _platform;
_this._focusMonitor = _focusMonitor;
/**
* Whether the button is round.
*/
_this._isRoundButton = _this._hasHostAttributes('mat-fab', 'mat-mini-fab');
/**
* Whether the button is icon button.
*/
_this._isIconButton = _this._hasHostAttributes('mat-icon-button');
// For each of the variant selectors that is prevent in the button's host
// attributes, add the correct corresponding class.
for (var _i = 0, BUTTON_HOST_ATTRIBUTES_1 = BUTTON_HOST_ATTRIBUTES; _i < BUTTON_HOST_ATTRIBUTES_1.length; _i++) {
var attr = BUTTON_HOST_ATTRIBUTES_1[_i];
if (_this._hasHostAttributes(attr)) {
(/** @type {?} */ (elementRef.nativeElement)).classList.add(attr);
}
}
_this._focusMonitor.monitor(_this._elementRef.nativeElement, true);
if (_this._isRoundButton) {
_this.color = DEFAULT_ROUND_BUTTON_COLOR;
}
else if (_this._hasHostAttributes('mat-flat-button')) {
_this.color = DEFAULT_FLAT_BUTTON_COLOR;
}
return _this;
}
/**
* @return {?}
*/
MatButton.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._focusMonitor.stopMonitoring(this._elementRef.nativeElement);
};
/** Focuses the button. */
/**
* Focuses the button.
* @return {?}
*/
MatButton.prototype.focus = /**
* Focuses the button.
* @return {?}
*/
function () {
this._getHostElement().focus();
};
/**
* @return {?}
*/
MatButton.prototype._getHostElement = /**
* @return {?}
*/
function () {
return this._elementRef.nativeElement;
};
/**
* @return {?}
*/
MatButton.prototype._isRippleDisabled = /**
* @return {?}
*/
function () {
return this.disableRipple || this.disabled;
};
/** Gets whether the button has one of the given attributes. */
/**
* Gets whether the button has one of the given attributes.
* @param {...?} attributes
* @return {?}
*/
MatButton.prototype._hasHostAttributes = /**
* Gets whether the button has one of the given attributes.
* @param {...?} attributes
* @return {?}
*/
function () {
var _this = this;
var attributes = [];
for (var _i = 0; _i < arguments.length; _i++) {
attributes[_i] = arguments[_i];
}
return attributes.some(function (attribute) { return _this._getHostElement().hasAttribute(attribute); });
};
MatButton.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Component"], args: [{selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button],\n button[mat-fab], button[mat-mini-fab], button[mat-stroked-button],\n button[mat-flat-button]",
exportAs: 'matButton',
host: {
'[disabled]': 'disabled || null',
},
template: "<span class=\"mat-button-wrapper\"><ng-content></ng-content></span><div matRipple class=\"mat-button-ripple\" [class.mat-button-ripple-round]=\"_isRoundButton || _isIconButton\" [matRippleDisabled]=\"_isRippleDisabled()\" [matRippleCentered]=\"_isIconButton\" [matRippleTrigger]=\"_getHostElement()\"></div><div class=\"mat-button-focus-overlay\"></div>",
styles: [".mat-button,.mat-flat-button,.mat-icon-button,.mat-stroked-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:88px;line-height:36px;padding:0 16px;border-radius:2px;overflow:visible}.mat-button[disabled],.mat-flat-button[disabled],.mat-icon-button[disabled],.mat-stroked-button[disabled]{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay{opacity:1}.mat-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner{border:0}.mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{transition:none;opacity:0}.mat-button:hover .mat-button-focus-overlay,.mat-stroked-button:hover .mat-button-focus-overlay{opacity:1}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:88px;line-height:36px;padding:0 16px;border-radius:2px;overflow:visible;transform:translate3d(0,0,0);transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1)}.mat-raised-button[disabled]{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:1}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button:not([class*=mat-elevation-z]){box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mat-raised-button:not([disabled]):active:not([class*=mat-elevation-z]){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.mat-raised-button[disabled]{box-shadow:none}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button:not([class*=mat-elevation-z]){box-shadow:0 0 0 0 rgba(0,0,0,.2),0 0 0 0 rgba(0,0,0,.14),0 0 0 0 rgba(0,0,0,.12)}.mat-flat-button:not([class*=mat-elevation-z]){box-shadow:0 0 0 0 rgba(0,0,0,.2),0 0 0 0 rgba(0,0,0,.14),0 0 0 0 rgba(0,0,0,.12)}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:88px;line-height:36px;padding:0 16px;border-radius:2px;overflow:visible;transform:translate3d(0,0,0);transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab[disabled]{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:1}.mat-fab::-moz-focus-inner{border:0}.mat-fab:not([class*=mat-elevation-z]){box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mat-fab:not([disabled]):active:not([class*=mat-elevation-z]){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.mat-fab[disabled]{box-shadow:none}.mat-fab:not([class*=mat-elevation-z]){box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12)}.mat-fab:not([disabled]):active:not([class*=mat-elevation-z]){box-shadow:0 7px 8px -4px rgba(0,0,0,.2),0 12px 17px 2px rgba(0,0,0,.14),0 5px 22px 4px rgba(0,0,0,.12)}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:88px;line-height:36px;padding:0 16px;border-radius:2px;overflow:visible;transform:translate3d(0,0,0);transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab[disabled]{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:1}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab:not([class*=mat-elevation-z]){box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mat-mini-fab:not([disabled]):active:not([class*=mat-elevation-z]){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.mat-mini-fab[disabled]{box-shadow:none}.mat-mini-fab:not([class*=mat-elevation-z]){box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12)}.mat-mini-fab:not([disabled]):active:not([class*=mat-elevation-z]){box-shadow:0 7px 8px -4px rgba(0,0,0,.2),0 12px 17px 2px rgba(0,0,0,.14),0 5px 22px 4px rgba(0,0,0,.12)}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button .mat-icon,.mat-icon-button i{line-height:24px}.mat-button-focus-overlay,.mat-button-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-focus-overlay{background-color:rgba(0,0,0,.12);border-radius:inherit;opacity:0;transition:opacity .2s cubic-bezier(.35,0,.25,1),background-color .2s cubic-bezier(.35,0,.25,1)}@media screen and (-ms-high-contrast:active){.mat-button-focus-overlay{background-color:rgba(255,255,255,.5)}}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:block;font-size:inherit;width:2.5em;height:2.5em}@media screen and (-ms-high-contrast:active){.mat-button,.mat-fab,.mat-flat-button,.mat-icon-button,.mat-mini-fab,.mat-raised-button{outline:solid 1px}}"],
inputs: ['disabled', 'disableRipple', 'color'],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatButton.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ElementRef"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__["Platform"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__["FocusMonitor"], },
]; };
MatButton.propDecorators = {
"ripple": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ViewChild"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["MatRipple"],] },],
};
return MatButton;
}(_MatButtonMixinBase));
/**
* Raised Material design button.
*/
var MatAnchor = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatAnchor, _super);
function MatAnchor(platform, focusMonitor, elementRef) {
return _super.call(this, elementRef, platform, focusMonitor) || this;
}
/**
* @param {?} event
* @return {?}
*/
MatAnchor.prototype._haltDisabledEvents = /**
* @param {?} event
* @return {?}
*/
function (event) {
// A disabled button shouldn't apply any actions
if (this.disabled) {
event.preventDefault();
event.stopImmediatePropagation();
}
};
MatAnchor.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["Component"], args: [{selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab],\n a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]",
exportAs: 'matButton, matAnchor',
host: {
'[attr.tabindex]': 'disabled ? -1 : 0',
'[attr.disabled]': 'disabled || null',
'[attr.aria-disabled]': 'disabled.toString()',
'(click)': '_haltDisabledEvents($event)',
},
inputs: ['disabled', 'disableRipple', 'color'],
template: "<span class=\"mat-button-wrapper\"><ng-content></ng-content></span><div matRipple class=\"mat-button-ripple\" [class.mat-button-ripple-round]=\"_isRoundButton || _isIconButton\" [matRippleDisabled]=\"_isRippleDisabled()\" [matRippleCentered]=\"_isIconButton\" [matRippleTrigger]=\"_getHostElement()\"></div><div class=\"mat-button-focus-overlay\"></div>",
styles: [".mat-button,.mat-flat-button,.mat-icon-button,.mat-stroked-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:88px;line-height:36px;padding:0 16px;border-radius:2px;overflow:visible}.mat-button[disabled],.mat-flat-button[disabled],.mat-icon-button[disabled],.mat-stroked-button[disabled]{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay{opacity:1}.mat-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner{border:0}.mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{transition:none;opacity:0}.mat-button:hover .mat-button-focus-overlay,.mat-stroked-button:hover .mat-button-focus-overlay{opacity:1}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:88px;line-height:36px;padding:0 16px;border-radius:2px;overflow:visible;transform:translate3d(0,0,0);transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1)}.mat-raised-button[disabled]{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:1}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button:not([class*=mat-elevation-z]){box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mat-raised-button:not([disabled]):active:not([class*=mat-elevation-z]){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.mat-raised-button[disabled]{box-shadow:none}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button:not([class*=mat-elevation-z]){box-shadow:0 0 0 0 rgba(0,0,0,.2),0 0 0 0 rgba(0,0,0,.14),0 0 0 0 rgba(0,0,0,.12)}.mat-flat-button:not([class*=mat-elevation-z]){box-shadow:0 0 0 0 rgba(0,0,0,.2),0 0 0 0 rgba(0,0,0,.14),0 0 0 0 rgba(0,0,0,.12)}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:88px;line-height:36px;padding:0 16px;border-radius:2px;overflow:visible;transform:translate3d(0,0,0);transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab[disabled]{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:1}.mat-fab::-moz-focus-inner{border:0}.mat-fab:not([class*=mat-elevation-z]){box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mat-fab:not([disabled]):active:not([class*=mat-elevation-z]){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.mat-fab[disabled]{box-shadow:none}.mat-fab:not([class*=mat-elevation-z]){box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12)}.mat-fab:not([disabled]):active:not([class*=mat-elevation-z]){box-shadow:0 7px 8px -4px rgba(0,0,0,.2),0 12px 17px 2px rgba(0,0,0,.14),0 5px 22px 4px rgba(0,0,0,.12)}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:88px;line-height:36px;padding:0 16px;border-radius:2px;overflow:visible;transform:translate3d(0,0,0);transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab[disabled]{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:1}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab:not([class*=mat-elevation-z]){box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mat-mini-fab:not([disabled]):active:not([class*=mat-elevation-z]){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.mat-mini-fab[disabled]{box-shadow:none}.mat-mini-fab:not([class*=mat-elevation-z]){box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12)}.mat-mini-fab:not([disabled]):active:not([class*=mat-elevation-z]){box-shadow:0 7px 8px -4px rgba(0,0,0,.2),0 12px 17px 2px rgba(0,0,0,.14),0 5px 22px 4px rgba(0,0,0,.12)}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button .mat-icon,.mat-icon-button i{line-height:24px}.mat-button-focus-overlay,.mat-button-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-focus-overlay{background-color:rgba(0,0,0,.12);border-radius:inherit;opacity:0;transition:opacity .2s cubic-bezier(.35,0,.25,1),background-color .2s cubic-bezier(.35,0,.25,1)}@media screen and (-ms-high-contrast:active){.mat-button-focus-overlay{background-color:rgba(255,255,255,.5)}}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:block;font-size:inherit;width:2.5em;height:2.5em}@media screen and (-ms-high-contrast:active){.mat-button,.mat-fab,.mat-flat-button,.mat-icon-button,.mat-mini-fab,.mat-raised-button{outline:solid 1px}}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatAnchor.ctorParameters = function () { return [
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__["Platform"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__["FocusMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["ElementRef"], },
]; };
return MatAnchor;
}(MatButton));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatButtonModule = /** @class */ (function () {
function MatButtonModule() {
}
MatButtonModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["NgModule"], args: [{
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_5__["CommonModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["MatRippleModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["MatCommonModule"],
],
exports: [
MatButton,
MatAnchor,
_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["MatCommonModule"],
],
declarations: [
MatButton,
MatAnchor,
],
},] },
];
return MatButtonModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=button.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/card.es5.js":
/*!*********************************************************!*\
!*** ./node_modules/@angular/material/esm5/card.es5.js ***!
\*********************************************************/
/*! exports provided: MatCardContent, MatCardTitle, MatCardSubtitle, MatCardActions, MatCardFooter, MatCardImage, MatCardSmImage, MatCardMdImage, MatCardLgImage, MatCardXlImage, MatCardAvatar, MatCard, MatCardHeader, MatCardTitleGroup, MatCardModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardContent", function() { return MatCardContent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardTitle", function() { return MatCardTitle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardSubtitle", function() { return MatCardSubtitle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardActions", function() { return MatCardActions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardFooter", function() { return MatCardFooter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardImage", function() { return MatCardImage; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardSmImage", function() { return MatCardSmImage; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardMdImage", function() { return MatCardMdImage; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardLgImage", function() { return MatCardLgImage; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardXlImage", function() { return MatCardXlImage; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardAvatar", function() { return MatCardAvatar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCard", function() { return MatCard; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardHeader", function() { return MatCardHeader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardTitleGroup", function() { return MatCardTitleGroup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCardModule", function() { return MatCardModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Content of a card, needed as it's used as a selector in the API.
* \@docs-private
*/
var MatCardContent = /** @class */ (function () {
function MatCardContent() {
}
MatCardContent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'mat-card-content',
host: { 'class': 'mat-card-content' }
},] },
];
return MatCardContent;
}());
/**
* Title of a card, needed as it's used as a selector in the API.
* \@docs-private
*/
var MatCardTitle = /** @class */ (function () {
function MatCardTitle() {
}
MatCardTitle.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: "mat-card-title, [mat-card-title], [matCardTitle]",
host: {
'class': 'mat-card-title'
}
},] },
];
return MatCardTitle;
}());
/**
* Sub-title of a card, needed as it's used as a selector in the API.
* \@docs-private
*/
var MatCardSubtitle = /** @class */ (function () {
function MatCardSubtitle() {
}
MatCardSubtitle.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]",
host: {
'class': 'mat-card-subtitle'
}
},] },
];
return MatCardSubtitle;
}());
/**
* Action section of a card, needed as it's used as a selector in the API.
* \@docs-private
*/
var MatCardActions = /** @class */ (function () {
function MatCardActions() {
/**
* Position of the actions inside the card.
*/
this.align = 'start';
}
MatCardActions.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'mat-card-actions',
exportAs: 'matCardActions',
host: {
'class': 'mat-card-actions',
'[class.mat-card-actions-align-end]': 'align === "end"',
}
},] },
];
/** @nocollapse */
MatCardActions.propDecorators = {
"align": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatCardActions;
}());
/**
* Footer of a card, needed as it's used as a selector in the API.
* \@docs-private
*/
var MatCardFooter = /** @class */ (function () {
function MatCardFooter() {
}
MatCardFooter.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'mat-card-footer',
host: { 'class': 'mat-card-footer' }
},] },
];
return MatCardFooter;
}());
/**
* Image used in a card, needed to add the mat- CSS styling.
* \@docs-private
*/
var MatCardImage = /** @class */ (function () {
function MatCardImage() {
}
MatCardImage.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[mat-card-image], [matCardImage]',
host: { 'class': 'mat-card-image' }
},] },
];
return MatCardImage;
}());
/**
* Image used in a card, needed to add the mat- CSS styling.
* \@docs-private
*/
var MatCardSmImage = /** @class */ (function () {
function MatCardSmImage() {
}
MatCardSmImage.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[mat-card-sm-image], [matCardImageSmall]',
host: { 'class': 'mat-card-sm-image' }
},] },
];
return MatCardSmImage;
}());
/**
* Image used in a card, needed to add the mat- CSS styling.
* \@docs-private
*/
var MatCardMdImage = /** @class */ (function () {
function MatCardMdImage() {
}
MatCardMdImage.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[mat-card-md-image], [matCardImageMedium]',
host: { 'class': 'mat-card-md-image' }
},] },
];
return MatCardMdImage;
}());
/**
* Image used in a card, needed to add the mat- CSS styling.
* \@docs-private
*/
var MatCardLgImage = /** @class */ (function () {
function MatCardLgImage() {
}
MatCardLgImage.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[mat-card-lg-image], [matCardImageLarge]',
host: { 'class': 'mat-card-lg-image' }
},] },
];
return MatCardLgImage;
}());
/**
* Large image used in a card, needed to add the mat- CSS styling.
* \@docs-private
*/
var MatCardXlImage = /** @class */ (function () {
function MatCardXlImage() {
}
MatCardXlImage.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[mat-card-xl-image], [matCardImageXLarge]',
host: { 'class': 'mat-card-xl-image' }
},] },
];
return MatCardXlImage;
}());
/**
* Avatar image used in a card, needed to add the mat- CSS styling.
* \@docs-private
*/
var MatCardAvatar = /** @class */ (function () {
function MatCardAvatar() {
}
MatCardAvatar.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[mat-card-avatar], [matCardAvatar]',
host: { 'class': 'mat-card-avatar' }
},] },
];
return MatCardAvatar;
}());
/**
* A basic content container component that adds the styles of a Material design card.
*
* While this component can be used alone, it also provides a number
* of preset styles for common card sections, including:
* - mat-card-title
* - mat-card-subtitle
* - mat-card-content
* - mat-card-actions
* - mat-card-footer
*/
var MatCard = /** @class */ (function () {
function MatCard() {
}
MatCard.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-card',
exportAs: 'matCard',
template: "<ng-content></ng-content><ng-content select=\"mat-card-footer\"></ng-content>",
styles: [".mat-card{transition:box-shadow 280ms cubic-bezier(.4,0,.2,1);display:block;position:relative;padding:24px;border-radius:2px}.mat-card:not([class*=mat-elevation-z]){box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mat-card .mat-divider{position:absolute;left:0;width:100%}[dir=rtl] .mat-card .mat-divider{left:auto;right:0}.mat-card .mat-divider.mat-divider-inset{position:static;margin:0}.mat-card.mat-card-flat{box-shadow:none}@media screen and (-ms-high-contrast:active){.mat-card{outline:solid 1px}}.mat-card-actions,.mat-card-content,.mat-card-subtitle,.mat-card-title{display:block;margin-bottom:16px}.mat-card-actions{margin-left:-16px;margin-right:-16px;padding:8px 0}.mat-card-actions-align-end{display:flex;justify-content:flex-end}.mat-card-image{width:calc(100% + 48px);margin:0 -24px 16px -24px}.mat-card-xl-image{width:240px;height:240px;margin:-8px}.mat-card-footer{display:block;margin:0 -24px -24px -24px}.mat-card-actions .mat-button,.mat-card-actions .mat-raised-button{margin:0 4px}.mat-card-header{display:flex;flex-direction:row}.mat-card-header-text{margin:0 8px}.mat-card-avatar{height:40px;width:40px;border-radius:50%;flex-shrink:0}.mat-card-lg-image,.mat-card-md-image,.mat-card-sm-image{margin:-8px 0}.mat-card-title-group{display:flex;justify-content:space-between;margin:0 -8px}.mat-card-sm-image{width:80px;height:80px}.mat-card-md-image{width:112px;height:112px}.mat-card-lg-image{width:152px;height:152px}@media (max-width:599px){.mat-card{padding:24px 16px}.mat-card-actions{margin-left:-8px;margin-right:-8px}.mat-card-image{width:calc(100% + 32px);margin:16px -16px}.mat-card-title-group{margin:0}.mat-card-xl-image{margin-left:0;margin-right:0}.mat-card-header{margin:-8px 0 0 0}.mat-card-footer{margin-left:-16px;margin-right:-16px}}.mat-card-content>:first-child,.mat-card>:first-child{margin-top:0}.mat-card-content>:last-child:not(.mat-card-footer),.mat-card>:last-child:not(.mat-card-footer){margin-bottom:0}.mat-card-image:first-child{margin-top:-24px}.mat-card>.mat-card-actions:last-child{margin-bottom:-16px;padding-bottom:0}.mat-card-actions .mat-button:first-child,.mat-card-actions .mat-raised-button:first-child{margin-left:0;margin-right:0}.mat-card-subtitle:not(:first-child),.mat-card-title:not(:first-child){margin-top:-4px}.mat-card-header .mat-card-subtitle:not(:first-child){margin-top:-8px}.mat-card>.mat-card-xl-image:first-child{margin-top:-8px}.mat-card>.mat-card-xl-image:last-child{margin-bottom:-8px}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
host: { 'class': 'mat-card' }
},] },
];
return MatCard;
}());
/**
* Component intended to be used within the `<mat-card>` component. It adds styles for a
* preset header section (i.e. a title, subtitle, and avatar layout).
* \@docs-private
*/
var MatCardHeader = /** @class */ (function () {
function MatCardHeader() {
}
MatCardHeader.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-card-header',
template: "<ng-content select=\"[mat-card-avatar], [matCardAvatar]\"></ng-content><div class=\"mat-card-header-text\"><ng-content select=\"mat-card-title, mat-card-subtitle, [mat-card-title], [mat-card-subtitle], [matCardTitle], [matCardSubtitle]\"></ng-content></div><ng-content></ng-content>",
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
host: { 'class': 'mat-card-header' }
},] },
];
return MatCardHeader;
}());
/**
* Component intended to be used within the `<mat-card>` component. It adds styles for a preset
* layout that groups an image with a title section.
* \@docs-private
*/
var MatCardTitleGroup = /** @class */ (function () {
function MatCardTitleGroup() {
}
MatCardTitleGroup.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-card-title-group',
template: "<div><ng-content select=\"mat-card-title, mat-card-subtitle, [mat-card-title], [mat-card-subtitle], [matCardTitle], [matCardSubtitle]\"></ng-content></div><ng-content select=\"img\"></ng-content><ng-content></ng-content>",
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
host: { 'class': 'mat-card-title-group' }
},] },
];
return MatCardTitleGroup;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatCardModule = /** @class */ (function () {
function MatCardModule() {
}
MatCardModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [_angular_material_core__WEBPACK_IMPORTED_MODULE_1__["MatCommonModule"]],
exports: [
MatCard,
MatCardHeader,
MatCardTitleGroup,
MatCardContent,
MatCardTitle,
MatCardSubtitle,
MatCardActions,
MatCardFooter,
MatCardSmImage,
MatCardMdImage,
MatCardLgImage,
MatCardImage,
MatCardXlImage,
MatCardAvatar,
_angular_material_core__WEBPACK_IMPORTED_MODULE_1__["MatCommonModule"],
],
declarations: [
MatCard, MatCardHeader, MatCardTitleGroup, MatCardContent, MatCardTitle, MatCardSubtitle,
MatCardActions, MatCardFooter, MatCardSmImage, MatCardMdImage, MatCardLgImage, MatCardImage,
MatCardXlImage, MatCardAvatar,
],
},] },
];
return MatCardModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=card.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/checkbox.es5.js":
/*!*************************************************************!*\
!*** ./node_modules/@angular/material/esm5/checkbox.es5.js ***!
\*************************************************************/
/*! exports provided: MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR, TransitionCheckState, MatCheckboxChange, MatCheckboxBase, _MatCheckboxMixinBase, MatCheckbox, MAT_CHECKBOX_CLICK_ACTION, MatCheckboxModule, MAT_CHECKBOX_REQUIRED_VALIDATOR, MatCheckboxRequiredValidator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR", function() { return MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TransitionCheckState", function() { return TransitionCheckState; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCheckboxChange", function() { return MatCheckboxChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCheckboxBase", function() { return MatCheckboxBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatCheckboxMixinBase", function() { return _MatCheckboxMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCheckbox", function() { return MatCheckbox; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_CHECKBOX_CLICK_ACTION", function() { return MAT_CHECKBOX_CLICK_ACTION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCheckboxModule", function() { return MatCheckboxModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_CHECKBOX_REQUIRED_VALIDATOR", function() { return MAT_CHECKBOX_REQUIRED_VALIDATOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCheckboxRequiredValidator", function() { return MatCheckboxRequiredValidator; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_cdk_observers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/observers */ "./node_modules/@angular/cdk/esm5/observers.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token that can be used to specify the checkbox click behavior.
*/
var /** @type {?} */ MAT_CHECKBOX_CLICK_ACTION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('mat-checkbox-click-action');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
// Increasing integer for generating unique ids for checkbox components.
var /** @type {?} */ nextUniqueId = 0;
/**
* Provider Expression that allows mat-checkbox to register as a ControlValueAccessor.
* This allows it to support [(ngModel)].
* \@docs-private
*/
var /** @type {?} */ MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR = {
provide: _angular_forms__WEBPACK_IMPORTED_MODULE_4__["NG_VALUE_ACCESSOR"],
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(function () { return MatCheckbox; }),
multi: true
};
/** @enum {number} */
var TransitionCheckState = {
/** The initial state of the component before any user interaction. */
Init: 0,
/** The state representing the component when it's becoming checked. */
Checked: 1,
/** The state representing the component when it's becoming unchecked. */
Unchecked: 2,
/** The state representing the component when it's becoming indeterminate. */
Indeterminate: 3,
};
TransitionCheckState[TransitionCheckState.Init] = "Init";
TransitionCheckState[TransitionCheckState.Checked] = "Checked";
TransitionCheckState[TransitionCheckState.Unchecked] = "Unchecked";
TransitionCheckState[TransitionCheckState.Indeterminate] = "Indeterminate";
/**
* Change event object emitted by MatCheckbox.
*/
var /**
* Change event object emitted by MatCheckbox.
*/
MatCheckboxChange = /** @class */ (function () {
function MatCheckboxChange() {
}
return MatCheckboxChange;
}());
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatCheckboxBase = /** @class */ (function () {
function MatCheckboxBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatCheckboxBase;
}());
var /** @type {?} */ _MatCheckboxMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["mixinTabIndex"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["mixinColor"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["mixinDisableRipple"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["mixinDisabled"])(MatCheckboxBase)), 'accent'));
/**
* A material design checkbox component. Supports all of the functionality of an HTML5 checkbox,
* and exposes a similar API. A MatCheckbox can be either checked, unchecked, indeterminate, or
* disabled. Note that all additional accessibility attributes are taken care of by the component,
* so there is no need to provide them yourself. However, if you want to omit a label and still
* have the checkbox be accessible, you may supply an [aria-label] input.
* See: https://material.io/design/components/selection-controls.html
*/
var MatCheckbox = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatCheckbox, _super);
function MatCheckbox(elementRef, _changeDetectorRef, _focusMonitor, tabIndex, _clickAction) {
var _this = _super.call(this, elementRef) || this;
_this._changeDetectorRef = _changeDetectorRef;
_this._focusMonitor = _focusMonitor;
_this._clickAction = _clickAction;
/**
* Attached to the aria-label attribute of the host element. In most cases, arial-labelledby will
* take precedence so this may be omitted.
*/
_this.ariaLabel = '';
/**
* Users can specify the `aria-labelledby` attribute which will be forwarded to the input element
*/
_this.ariaLabelledby = null;
_this._uniqueId = "mat-checkbox-" + ++nextUniqueId;
/**
* A unique id for the checkbox input. If none is supplied, it will be auto-generated.
*/
_this.id = _this._uniqueId;
/**
* Whether the label should appear after or before the checkbox. Defaults to 'after'
*/
_this.labelPosition = 'after';
/**
* Name value will be applied to the input element if present
*/
_this.name = null;
/**
* Event emitted when the checkbox's `checked` value changes.
*/
_this.change = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when the checkbox's `indeterminate` value changes.
*/
_this.indeterminateChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor.
* \@docs-private
*/
_this._onTouched = function () { };
_this._currentAnimationClass = '';
_this._currentCheckState = TransitionCheckState.Init;
_this._controlValueAccessorChangeFn = function () { };
_this._checked = false;
_this._disabled = false;
_this._indeterminate = false;
_this.tabIndex = parseInt(tabIndex) || 0;
return _this;
}
Object.defineProperty(MatCheckbox.prototype, "inputId", {
/** Returns the unique id for the visual hidden input. */
get: /**
* Returns the unique id for the visual hidden input.
* @return {?}
*/
function () { return (this.id || this._uniqueId) + "-input"; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatCheckbox.prototype, "required", {
get: /**
* Whether the checkbox is required.
* @return {?}
*/
function () { return this._required; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._required = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatCheckbox.prototype.ngAfterViewInit = /**
* @return {?}
*/
function () {
var _this = this;
this._focusMonitor
.monitor(this._inputElement.nativeElement)
.subscribe(function (focusOrigin) { return _this._onInputFocusChange(focusOrigin); });
};
/**
* @return {?}
*/
MatCheckbox.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._focusMonitor.stopMonitoring(this._inputElement.nativeElement);
};
Object.defineProperty(MatCheckbox.prototype, "checked", {
get: /**
* Whether the checkbox is checked.
* @return {?}
*/
function () { return this._checked; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (value != this.checked) {
this._checked = value;
this._changeDetectorRef.markForCheck();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatCheckbox.prototype, "disabled", {
get: /**
* Whether the checkbox is disabled. This fully overrides the implementation provided by
* mixinDisabled, but the mixin is still required because mixinTabIndex requires it.
* @return {?}
*/
function () { return this._disabled; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (value != this.disabled) {
this._disabled = value;
this._changeDetectorRef.markForCheck();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatCheckbox.prototype, "indeterminate", {
get: /**
* Whether the checkbox is indeterminate. This is also known as "mixed" mode and can be used to
* represent a checkbox with three states, e.g. a checkbox that represents a nested list of
* checkable items. Note that whenever checkbox is manually clicked, indeterminate is immediately
* set to false.
* @return {?}
*/
function () { return this._indeterminate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ changed = value != this._indeterminate;
this._indeterminate = value;
if (changed) {
if (this._indeterminate) {
this._transitionCheckState(TransitionCheckState.Indeterminate);
}
else {
this._transitionCheckState(this.checked ? TransitionCheckState.Checked : TransitionCheckState.Unchecked);
}
this.indeterminateChange.emit(this._indeterminate);
}
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatCheckbox.prototype._isRippleDisabled = /**
* @return {?}
*/
function () {
return this.disableRipple || this.disabled;
};
/** Method being called whenever the label text changes. */
/**
* Method being called whenever the label text changes.
* @return {?}
*/
MatCheckbox.prototype._onLabelTextChange = /**
* Method being called whenever the label text changes.
* @return {?}
*/
function () {
// This method is getting called whenever the label of the checkbox changes.
// Since the checkbox uses the OnPush strategy we need to notify it about the change
// that has been recognized by the cdkObserveContent directive.
this._changeDetectorRef.markForCheck();
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} value
* @return {?}
*/
MatCheckbox.prototype.writeValue = /**
* @param {?} value
* @return {?}
*/
function (value) {
this.checked = !!value;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} fn
* @return {?}
*/
MatCheckbox.prototype.registerOnChange = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this._controlValueAccessorChangeFn = fn;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} fn
* @return {?}
*/
MatCheckbox.prototype.registerOnTouched = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this._onTouched = fn;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} isDisabled
* @return {?}
*/
MatCheckbox.prototype.setDisabledState = /**
* @param {?} isDisabled
* @return {?}
*/
function (isDisabled) {
this.disabled = isDisabled;
};
/**
* @return {?}
*/
MatCheckbox.prototype._getAriaChecked = /**
* @return {?}
*/
function () {
return this.checked ? 'true' : (this.indeterminate ? 'mixed' : 'false');
};
/**
* @param {?} newState
* @return {?}
*/
MatCheckbox.prototype._transitionCheckState = /**
* @param {?} newState
* @return {?}
*/
function (newState) {
var /** @type {?} */ oldState = this._currentCheckState;
var /** @type {?} */ element = this._elementRef.nativeElement;
if (oldState === newState) {
return;
}
if (this._currentAnimationClass.length > 0) {
element.classList.remove(this._currentAnimationClass);
}
this._currentAnimationClass = this._getAnimationClassForCheckStateTransition(oldState, newState);
this._currentCheckState = newState;
if (this._currentAnimationClass.length > 0) {
element.classList.add(this._currentAnimationClass);
}
};
/**
* @return {?}
*/
MatCheckbox.prototype._emitChangeEvent = /**
* @return {?}
*/
function () {
var /** @type {?} */ event = new MatCheckboxChange();
event.source = this;
event.checked = this.checked;
this._controlValueAccessorChangeFn(this.checked);
this.change.emit(event);
};
/**
* Function is called whenever the focus changes for the input element.
* @param {?} focusOrigin
* @return {?}
*/
MatCheckbox.prototype._onInputFocusChange = /**
* Function is called whenever the focus changes for the input element.
* @param {?} focusOrigin
* @return {?}
*/
function (focusOrigin) {
// TODO(paul): support `program`. See https://github.com/angular/material2/issues/9889
if (!this._focusRipple && focusOrigin === 'keyboard') {
this._focusRipple = this.ripple.launch(0, 0, { persistent: true });
}
else if (!focusOrigin) {
this._removeFocusRipple();
this._onTouched();
}
};
/** Toggles the `checked` state of the checkbox. */
/**
* Toggles the `checked` state of the checkbox.
* @return {?}
*/
MatCheckbox.prototype.toggle = /**
* Toggles the `checked` state of the checkbox.
* @return {?}
*/
function () {
this.checked = !this.checked;
};
/**
* Event handler for checkbox input element.
* Toggles checked state if element is not disabled.
* Do not toggle on (change) event since IE doesn't fire change event when
* indeterminate checkbox is clicked.
* @param event
*/
/**
* Event handler for checkbox input element.
* Toggles checked state if element is not disabled.
* Do not toggle on (change) event since IE doesn't fire change event when
* indeterminate checkbox is clicked.
* @param {?} event
* @return {?}
*/
MatCheckbox.prototype._onInputClick = /**
* Event handler for checkbox input element.
* Toggles checked state if element is not disabled.
* Do not toggle on (change) event since IE doesn't fire change event when
* indeterminate checkbox is clicked.
* @param {?} event
* @return {?}
*/
function (event) {
var _this = this;
// We have to stop propagation for click events on the visual hidden input element.
// By default, when a user clicks on a label element, a generated click event will be
// dispatched on the associated input element. Since we are using a label element as our
// root container, the click event on the `checkbox` will be executed twice.
// The real click event will bubble up, and the generated click event also tries to bubble up.
// This will lead to multiple click events.
// Preventing bubbling for the second event will solve that issue.
event.stopPropagation();
// If resetIndeterminate is false, and the current state is indeterminate, do nothing on click
if (!this.disabled && this._clickAction !== 'noop') {
// When user manually click on the checkbox, `indeterminate` is set to false.
if (this.indeterminate && this._clickAction !== 'check') {
Promise.resolve().then(function () {
_this._indeterminate = false;
_this.indeterminateChange.emit(_this._indeterminate);
});
}
this.toggle();
this._transitionCheckState(this._checked ? TransitionCheckState.Checked : TransitionCheckState.Unchecked);
// Emit our custom change event if the native input emitted one.
// It is important to only emit it, if the native input triggered one, because
// we don't want to trigger a change event, when the `checked` variable changes for example.
this._emitChangeEvent();
}
else if (!this.disabled && this._clickAction === 'noop') {
// Reset native input when clicked with noop. The native checkbox becomes checked after
// click, reset it to be align with `checked` value of `mat-checkbox`.
this._inputElement.nativeElement.checked = this.checked;
this._inputElement.nativeElement.indeterminate = this.indeterminate;
}
};
/** Focuses the checkbox. */
/**
* Focuses the checkbox.
* @return {?}
*/
MatCheckbox.prototype.focus = /**
* Focuses the checkbox.
* @return {?}
*/
function () {
this._focusMonitor.focusVia(this._inputElement.nativeElement, 'keyboard');
};
/**
* @param {?} event
* @return {?}
*/
MatCheckbox.prototype._onInteractionEvent = /**
* @param {?} event
* @return {?}
*/
function (event) {
// We always have to stop propagation on the change event.
// Otherwise the change event, from the input element, will bubble up and
// emit its event object to the `change` output.
event.stopPropagation();
};
/**
* @param {?} oldState
* @param {?} newState
* @return {?}
*/
MatCheckbox.prototype._getAnimationClassForCheckStateTransition = /**
* @param {?} oldState
* @param {?} newState
* @return {?}
*/
function (oldState, newState) {
var /** @type {?} */ animSuffix = '';
switch (oldState) {
case TransitionCheckState.Init:
// Handle edge case where user interacts with checkbox that does not have [(ngModel)] or
// [checked] bound to it.
if (newState === TransitionCheckState.Checked) {
animSuffix = 'unchecked-checked';
}
else if (newState == TransitionCheckState.Indeterminate) {
animSuffix = 'unchecked-indeterminate';
}
else {
return '';
}
break;
case TransitionCheckState.Unchecked:
animSuffix = newState === TransitionCheckState.Checked ?
'unchecked-checked' : 'unchecked-indeterminate';
break;
case TransitionCheckState.Checked:
animSuffix = newState === TransitionCheckState.Unchecked ?
'checked-unchecked' : 'checked-indeterminate';
break;
case TransitionCheckState.Indeterminate:
animSuffix = newState === TransitionCheckState.Checked ?
'indeterminate-checked' : 'indeterminate-unchecked';
break;
}
return "mat-checkbox-anim-" + animSuffix;
};
/**
* Fades out the focus state ripple.
* @return {?}
*/
MatCheckbox.prototype._removeFocusRipple = /**
* Fades out the focus state ripple.
* @return {?}
*/
function () {
if (this._focusRipple) {
this._focusRipple.fadeOut();
this._focusRipple = null;
}
};
MatCheckbox.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-checkbox',
template: "<label [attr.for]=\"inputId\" class=\"mat-checkbox-layout\" #label><div class=\"mat-checkbox-inner-container\" [class.mat-checkbox-inner-container-no-side-margin]=\"!checkboxLabel.textContent || !checkboxLabel.textContent.trim()\"><input #input class=\"mat-checkbox-input cdk-visually-hidden\" type=\"checkbox\" [id]=\"inputId\" [required]=\"required\" [checked]=\"checked\" [attr.value]=\"value\" [disabled]=\"disabled\" [attr.name]=\"name\" [tabIndex]=\"tabIndex\" [indeterminate]=\"indeterminate\" [attr.aria-label]=\"ariaLabel || null\" [attr.aria-labelledby]=\"ariaLabelledby\" [attr.aria-checked]=\"_getAriaChecked()\" (change)=\"_onInteractionEvent($event)\" (click)=\"_onInputClick($event)\"><div matRipple class=\"mat-checkbox-ripple\" [matRippleTrigger]=\"label\" [matRippleDisabled]=\"_isRippleDisabled()\" [matRippleRadius]=\"25\" [matRippleCentered]=\"true\" [matRippleAnimation]=\"{enterDuration: 150}\"></div><div class=\"mat-checkbox-frame\"></div><div class=\"mat-checkbox-background\"><svg version=\"1.1\" focusable=\"false\" class=\"mat-checkbox-checkmark\" viewBox=\"0 0 24 24\" xml:space=\"preserve\"><path class=\"mat-checkbox-checkmark-path\" fill=\"none\" stroke=\"white\" d=\"M4.1,12.7 9,17.6 20.3,6.3\"/></svg><div class=\"mat-checkbox-mixedmark\"></div></div></div><span class=\"mat-checkbox-label\" #checkboxLabel (cdkObserveContent)=\"_onLabelTextChange()\"><span style=\"display:none\">&nbsp;</span><ng-content></ng-content></span></label>",
styles: ["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.91026}50%{animation-timing-function:cubic-bezier(0,0,.2,.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0,0,0,1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(.4,0,1,1);stroke-dashoffset:0}to{stroke-dashoffset:-22.91026}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0,0,.2,.1);opacity:1;transform:rotate(0)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(.14,0,0,1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0,0,.2,.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(.14,0,0,1);opacity:1;transform:rotate(0)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}100%,32.8%{opacity:0;transform:scaleX(0)}}.mat-checkbox-checkmark,.mat-checkbox-mixedmark{width:calc(100% - 4px)}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1);cursor:pointer}.mat-checkbox-layout{cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-inner-container{display:inline-block;height:20px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:20px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0,0,.2,.1);border-width:2px;border-style:solid}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0,0,.2,.1),opacity 90ms cubic-bezier(0,0,.2,.1)}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.91026;stroke-dasharray:22.91026;stroke-width:2.66667px}.mat-checkbox-mixedmark{height:2px;opacity:0;transform:scaleX(0) rotate(0)}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0s mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0s mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0s mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0s mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0s mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0s mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0s mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0s mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:.5s linear 0s mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:.5s linear 0s mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0s mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:.3s linear 0s mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}.mat-checkbox-ripple{position:absolute;left:calc(50% - 25px);top:calc(50% - 25px);height:50px;width:50px;z-index:1;pointer-events:none}"],
exportAs: 'matCheckbox',
host: {
'class': 'mat-checkbox',
'[id]': 'id',
'[class.mat-checkbox-indeterminate]': 'indeterminate',
'[class.mat-checkbox-checked]': 'checked',
'[class.mat-checkbox-disabled]': 'disabled',
'[class.mat-checkbox-label-before]': 'labelPosition == "before"',
},
providers: [MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR],
inputs: ['disableRipple', 'color', 'tabIndex'],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush
},] },
];
/** @nocollapse */
MatCheckbox.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_2__["FocusMonitor"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Attribute"], args: ['tabindex',] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [MAT_CHECKBOX_CLICK_ACTION,] },] },
]; };
MatCheckbox.propDecorators = {
"ariaLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['aria-label',] },],
"ariaLabelledby": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['aria-labelledby',] },],
"id": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"required": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"labelPosition": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"name": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"change": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"indeterminateChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"_inputElement": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: ['input',] },],
"ripple": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["MatRipple"],] },],
"checked": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"indeterminate": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatCheckbox;
}(_MatCheckboxMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ MAT_CHECKBOX_REQUIRED_VALIDATOR = {
provide: _angular_forms__WEBPACK_IMPORTED_MODULE_4__["NG_VALIDATORS"],
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(function () { return MatCheckboxRequiredValidator; }),
multi: true
};
/**
* Validator for Material checkbox's required attribute in template-driven checkbox.
* Current CheckboxRequiredValidator only work with `input type=checkbox` and does not
* work with `mat-checkbox`.
*/
var MatCheckboxRequiredValidator = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatCheckboxRequiredValidator, _super);
function MatCheckboxRequiredValidator() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatCheckboxRequiredValidator.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: "mat-checkbox[required][formControlName],\n mat-checkbox[required][formControl], mat-checkbox[required][ngModel]",
providers: [MAT_CHECKBOX_REQUIRED_VALIDATOR],
host: { '[attr.required]': 'required ? "" : null' }
},] },
];
return MatCheckboxRequiredValidator;
}(_angular_forms__WEBPACK_IMPORTED_MODULE_4__["CheckboxRequiredValidator"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatCheckboxModule = /** @class */ (function () {
function MatCheckboxModule() {
}
MatCheckboxModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_7__["CommonModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_5__["MatRippleModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_5__["MatCommonModule"], _angular_cdk_observers__WEBPACK_IMPORTED_MODULE_6__["ObserversModule"]],
exports: [MatCheckbox, MatCheckboxRequiredValidator, _angular_material_core__WEBPACK_IMPORTED_MODULE_5__["MatCommonModule"]],
declarations: [MatCheckbox, MatCheckboxRequiredValidator],
},] },
];
return MatCheckboxModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=checkbox.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/chips.es5.js":
/*!**********************************************************!*\
!*** ./node_modules/@angular/material/esm5/chips.es5.js ***!
\**********************************************************/
/*! exports provided: MatChipsModule, MatChipListBase, _MatChipListMixinBase, MatChipListChange, MatChipList, MatChipSelectionChange, MatChipBase, _MatChipMixinBase, MatChipAvatar, MatChipTrailingIcon, MatChip, MatChipRemove, MatChipInput, MAT_CHIPS_DEFAULT_OPTIONS */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatChipsModule", function() { return MatChipsModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatChipListBase", function() { return MatChipListBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatChipListMixinBase", function() { return _MatChipListMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatChipListChange", function() { return MatChipListChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatChipList", function() { return MatChipList; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatChipSelectionChange", function() { return MatChipSelectionChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatChipBase", function() { return MatChipBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatChipMixinBase", function() { return _MatChipMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatChipAvatar", function() { return MatChipAvatar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatChipTrailingIcon", function() { return MatChipTrailingIcon; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatChip", function() { return MatChip; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatChipRemove", function() { return MatChipRemove; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatChipInput", function() { return MatChipInput; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_CHIPS_DEFAULT_OPTIONS", function() { return MAT_CHIPS_DEFAULT_OPTIONS; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm5/collections.es5.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/form-field */ "./node_modules/@angular/material/esm5/form-field.es5.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Event object emitted by MatChip when selected or deselected.
*/
var /**
* Event object emitted by MatChip when selected or deselected.
*/
MatChipSelectionChange = /** @class */ (function () {
function MatChipSelectionChange(source, selected, isUserInput) {
if (isUserInput === void 0) { isUserInput = false; }
this.source = source;
this.selected = selected;
this.isUserInput = isUserInput;
}
return MatChipSelectionChange;
}());
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatChipBase = /** @class */ (function () {
function MatChipBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatChipBase;
}());
var /** @type {?} */ _MatChipMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["mixinColor"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["mixinDisableRipple"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["mixinDisabled"])(MatChipBase)), 'primary');
var /** @type {?} */ CHIP_ATTRIBUTE_NAMES = ['mat-basic-chip'];
/**
* Dummy directive to add CSS class to chip avatar.
* \@docs-private
*/
var MatChipAvatar = /** @class */ (function () {
function MatChipAvatar() {
}
MatChipAvatar.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Directive"], args: [{
selector: 'mat-chip-avatar, [matChipAvatar]',
host: { 'class': 'mat-chip-avatar' }
},] },
];
return MatChipAvatar;
}());
/**
* Dummy directive to add CSS class to chip trailing icon.
* \@docs-private
*/
var MatChipTrailingIcon = /** @class */ (function () {
function MatChipTrailingIcon() {
}
MatChipTrailingIcon.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Directive"], args: [{
selector: 'mat-chip-trailing-icon, [matChipTrailingIcon]',
host: { 'class': 'mat-chip-trailing-icon' }
},] },
];
return MatChipTrailingIcon;
}());
/**
* Material design styled Chip component. Used inside the MatChipList component.
*/
var MatChip = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatChip, _super);
function MatChip(_elementRef, ngZone, platform, globalOptions) {
var _this = _super.call(this, _elementRef) || this;
_this._elementRef = _elementRef;
/**
* Ripple configuration for ripples that are launched on pointer down.
* \@docs-private
*/
_this.rippleConfig = {};
/**
* Whether the chip has focus.
*/
_this._hasFocus = false;
/**
* Whether the chip list is selectable
*/
_this.chipListSelectable = true;
_this._selected = false;
_this._selectable = true;
_this._removable = true;
/**
* Emits when the chip is focused.
*/
_this._onFocus = new rxjs__WEBPACK_IMPORTED_MODULE_6__["Subject"]();
/**
* Emits when the chip is blured.
*/
_this._onBlur = new rxjs__WEBPACK_IMPORTED_MODULE_6__["Subject"]();
/**
* Emitted when the chip is selected or deselected.
*/
_this.selectionChange = new _angular_core__WEBPACK_IMPORTED_MODULE_4__["EventEmitter"]();
/**
* Emitted when the chip is destroyed.
*/
_this.destroyed = new _angular_core__WEBPACK_IMPORTED_MODULE_4__["EventEmitter"]();
/**
* Emitted when a chip is to be removed.
*/
_this.removed = new _angular_core__WEBPACK_IMPORTED_MODULE_4__["EventEmitter"]();
_this._addHostClassName();
_this._chipRipple = new _angular_material_core__WEBPACK_IMPORTED_MODULE_5__["RippleRenderer"](_this, ngZone, _elementRef, platform);
_this._chipRipple.setupTriggerEvents(_elementRef.nativeElement);
if (globalOptions) {
_this.rippleConfig = {
speedFactor: globalOptions.baseSpeedFactor,
animation: globalOptions.animation,
terminateOnPointerUp: globalOptions.terminateOnPointerUp,
};
}
return _this;
}
Object.defineProperty(MatChip.prototype, "rippleDisabled", {
/**
* Whether ripples are disabled on interaction
* @docs-private
*/
get: /**
* Whether ripples are disabled on interaction
* \@docs-private
* @return {?}
*/
function () {
return this.disabled || this.disableRipple;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChip.prototype, "selected", {
get: /**
* Whether the chip is selected.
* @return {?}
*/
function () { return this._selected; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._selected = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(value);
this.selectionChange.emit({
source: this,
isUserInput: false,
selected: value
});
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChip.prototype, "value", {
get: /**
* The value of the chip. Defaults to the content inside `<mat-chip>` tags.
* @return {?}
*/
function () {
return this._value != undefined
? this._value
: this._elementRef.nativeElement.textContent;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._value = value; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatChip.prototype, "selectable", {
get: /**
* Whether or not the chip is selectable. When a chip is not selectable,
* changes to it's selected state are always ignored. By default a chip is
* selectable, and it becomes non-selectable if it's parent chip list is
* not selectable.
* @return {?}
*/
function () { return this._selectable && this.chipListSelectable; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._selectable = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChip.prototype, "removable", {
get: /**
* Determines whether or not the chip displays the remove styling and emits (removed) events.
* @return {?}
*/
function () { return this._removable; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._removable = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChip.prototype, "ariaSelected", {
/** The ARIA selected applied to the chip. */
get: /**
* The ARIA selected applied to the chip.
* @return {?}
*/
function () {
return this.selectable ? this.selected.toString() : null;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatChip.prototype._addHostClassName = /**
* @return {?}
*/
function () {
// Add class for the different chips
for (var _i = 0, CHIP_ATTRIBUTE_NAMES_1 = CHIP_ATTRIBUTE_NAMES; _i < CHIP_ATTRIBUTE_NAMES_1.length; _i++) {
var attr = CHIP_ATTRIBUTE_NAMES_1[_i];
if (this._elementRef.nativeElement.hasAttribute(attr) ||
this._elementRef.nativeElement.tagName.toLowerCase() === attr) {
(/** @type {?} */ (this._elementRef.nativeElement)).classList.add(attr);
return;
}
}
(/** @type {?} */ (this._elementRef.nativeElement)).classList.add('mat-standard-chip');
};
/**
* @return {?}
*/
MatChip.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.destroyed.emit({ chip: this });
this._chipRipple._removeTriggerEvents();
};
/** Selects the chip. */
/**
* Selects the chip.
* @return {?}
*/
MatChip.prototype.select = /**
* Selects the chip.
* @return {?}
*/
function () {
this._selected = true;
this.selectionChange.emit({
source: this,
isUserInput: false,
selected: true
});
};
/** Deselects the chip. */
/**
* Deselects the chip.
* @return {?}
*/
MatChip.prototype.deselect = /**
* Deselects the chip.
* @return {?}
*/
function () {
this._selected = false;
this.selectionChange.emit({
source: this,
isUserInput: false,
selected: false
});
};
/** Select this chip and emit selected event */
/**
* Select this chip and emit selected event
* @return {?}
*/
MatChip.prototype.selectViaInteraction = /**
* Select this chip and emit selected event
* @return {?}
*/
function () {
this._selected = true;
// Emit select event when selected changes.
this.selectionChange.emit({
source: this,
isUserInput: true,
selected: true
});
};
/** Toggles the current selected state of this chip. */
/**
* Toggles the current selected state of this chip.
* @param {?=} isUserInput
* @return {?}
*/
MatChip.prototype.toggleSelected = /**
* Toggles the current selected state of this chip.
* @param {?=} isUserInput
* @return {?}
*/
function (isUserInput) {
if (isUserInput === void 0) { isUserInput = false; }
this._selected = !this.selected;
this.selectionChange.emit({
source: this,
isUserInput: isUserInput,
selected: this._selected
});
return this.selected;
};
/** Allows for programmatic focusing of the chip. */
/**
* Allows for programmatic focusing of the chip.
* @return {?}
*/
MatChip.prototype.focus = /**
* Allows for programmatic focusing of the chip.
* @return {?}
*/
function () {
if (!this._hasFocus) {
this._elementRef.nativeElement.focus();
this._onFocus.next({ chip: this });
}
this._hasFocus = true;
};
/**
* Allows for programmatic removal of the chip. Called by the MatChipList when the DELETE or
* BACKSPACE keys are pressed.
*
* Informs any listeners of the removal request. Does not remove the chip from the DOM.
*/
/**
* Allows for programmatic removal of the chip. Called by the MatChipList when the DELETE or
* BACKSPACE keys are pressed.
*
* Informs any listeners of the removal request. Does not remove the chip from the DOM.
* @return {?}
*/
MatChip.prototype.remove = /**
* Allows for programmatic removal of the chip. Called by the MatChipList when the DELETE or
* BACKSPACE keys are pressed.
*
* Informs any listeners of the removal request. Does not remove the chip from the DOM.
* @return {?}
*/
function () {
if (this.removable) {
this.removed.emit({ chip: this });
}
};
/** Ensures events fire properly upon click. */
/**
* Ensures events fire properly upon click.
* @param {?} event
* @return {?}
*/
MatChip.prototype._handleClick = /**
* Ensures events fire properly upon click.
* @param {?} event
* @return {?}
*/
function (event) {
// Check disabled
if (this.disabled) {
return;
}
event.preventDefault();
event.stopPropagation();
};
/** Handle custom key presses. */
/**
* Handle custom key presses.
* @param {?} event
* @return {?}
*/
MatChip.prototype._handleKeydown = /**
* Handle custom key presses.
* @param {?} event
* @return {?}
*/
function (event) {
if (this.disabled) {
return;
}
switch (event.keyCode) {
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_2__["DELETE"]:
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_2__["BACKSPACE"]:
// If we are removable, remove the focused chip
this.remove();
// Always prevent so page navigation does not occur
event.preventDefault();
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_2__["SPACE"]:
// If we are selectable, toggle the focused chip
if (this.selectable) {
this.toggleSelected(true);
}
// Always prevent space from scrolling the page since the list has focus
event.preventDefault();
break;
}
};
/**
* @return {?}
*/
MatChip.prototype._blur = /**
* @return {?}
*/
function () {
this._hasFocus = false;
this._onBlur.next({ chip: this });
};
MatChip.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Directive"], args: [{
selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]",
inputs: ['color', 'disabled', 'disableRipple'],
exportAs: 'matChip',
host: {
'class': 'mat-chip',
'[attr.tabindex]': 'disabled ? null : -1',
'role': 'option',
'[class.mat-chip-selected]': 'selected',
'[class.mat-chip-with-avatar]': 'avatar',
'[class.mat-chip-with-trailing-icon]': 'trailingIcon || removeIcon',
'[class.mat-chip-disabled]': 'disabled',
'[attr.disabled]': 'disabled || null',
'[attr.aria-disabled]': 'disabled.toString()',
'[attr.aria-selected]': 'ariaSelected',
'(click)': '_handleClick($event)',
'(keydown)': '_handleKeydown($event)',
'(focus)': 'focus()',
'(blur)': '_blur()',
},
},] },
];
/** @nocollapse */
MatChip.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["NgZone"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_3__["Platform"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Inject"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["MAT_RIPPLE_GLOBAL_OPTIONS"],] },] },
]; };
MatChip.propDecorators = {
"avatar": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ContentChild"], args: [MatChipAvatar,] },],
"trailingIcon": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ContentChild"], args: [MatChipTrailingIcon,] },],
"removeIcon": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ContentChild"], args: [Object(_angular_core__WEBPACK_IMPORTED_MODULE_4__["forwardRef"])(function () { return MatChipRemove; }),] },],
"selected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"selectable": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"removable": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"selectionChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Output"] },],
"destroyed": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Output"] },],
"removed": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Output"] },],
};
return MatChip;
}(_MatChipMixinBase));
/**
* Applies proper (click) support and adds styling for use with the Material Design "cancel" icon
* available at https://material.io/icons/#ic_cancel.
*
* Example:
*
* `<mat-chip>
* <mat-icon matChipRemove>cancel</mat-icon>
* </mat-chip>`
*
* You *may* use a custom icon, but you may need to override the `mat-chip-remove` positioning
* styles to properly center the icon within the chip.
*/
var MatChipRemove = /** @class */ (function () {
function MatChipRemove(_parentChip) {
this._parentChip = _parentChip;
}
/** Calls the parent chip's public `remove()` method if applicable. */
/**
* Calls the parent chip's public `remove()` method if applicable.
* @return {?}
*/
MatChipRemove.prototype._handleClick = /**
* Calls the parent chip's public `remove()` method if applicable.
* @return {?}
*/
function () {
if (this._parentChip.removable) {
this._parentChip.remove();
}
};
MatChipRemove.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Directive"], args: [{
selector: '[matChipRemove]',
host: {
'class': 'mat-chip-remove mat-chip-trailing-icon',
'(click)': '_handleClick()',
}
},] },
];
/** @nocollapse */
MatChipRemove.ctorParameters = function () { return [
{ type: MatChip, },
]; };
return MatChipRemove;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token to be used to override the default options for the chips module.
*/
var /** @type {?} */ MAT_CHIPS_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_4__["InjectionToken"]('mat-chips-default-options');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatChipListBase = /** @class */ (function () {
function MatChipListBase(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl) {
this._defaultErrorStateMatcher = _defaultErrorStateMatcher;
this._parentForm = _parentForm;
this._parentFormGroup = _parentFormGroup;
this.ngControl = ngControl;
}
return MatChipListBase;
}());
var /** @type {?} */ _MatChipListMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["mixinErrorState"])(MatChipListBase);
// Increasing integer for generating unique ids for chip-list components.
var /** @type {?} */ nextUniqueId = 0;
/**
* Change event object that is emitted when the chip list value has changed.
*/
var /**
* Change event object that is emitted when the chip list value has changed.
*/
MatChipListChange = /** @class */ (function () {
function MatChipListChange(source, value) {
this.source = source;
this.value = value;
}
return MatChipListChange;
}());
/**
* A material design chips component (named ChipList for it's similarity to the List component).
*/
var MatChipList = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatChipList, _super);
function MatChipList(_elementRef, _changeDetectorRef, _dir, _parentForm, _parentFormGroup, _defaultErrorStateMatcher, /** @docs-private */
ngControl) {
var _this = _super.call(this, _defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl) || this;
_this._elementRef = _elementRef;
_this._changeDetectorRef = _changeDetectorRef;
_this._dir = _dir;
_this.ngControl = ngControl;
/**
* Implemented as part of MatFormFieldControl.
* \@docs-private
*/
_this.controlType = 'mat-chip-list';
/**
* When a chip is destroyed, we track the index so we can focus the appropriate next chip.
*/
_this._lastDestroyedIndex = null;
/**
* Track which chips we're listening to for focus/destruction.
*/
_this._chipSet = new WeakMap();
/**
* Subscription to tabbing out from the chip list.
*/
_this._tabOutSubscription = rxjs__WEBPACK_IMPORTED_MODULE_6__["Subscription"].EMPTY;
/**
* Uid of the chip list
*/
_this._uid = "mat-chip-list-" + nextUniqueId++;
/**
* Tab index for the chip list.
*/
_this._tabIndex = 0;
/**
* User defined tab index.
* When it is not null, use user defined tab index. Otherwise use _tabIndex
*/
_this._userTabIndex = null;
/**
* Function when touched
*/
_this._onTouched = function () { };
/**
* Function when changed
*/
_this._onChange = function () { };
_this._multiple = false;
_this._compareWith = function (o1, o2) { return o1 === o2; };
_this._required = false;
_this._disabled = false;
/**
* Orientation of the chip list.
*/
_this.ariaOrientation = 'horizontal';
_this._selectable = true;
/**
* Event emitted when the selected chip list value has been changed by the user.
*/
_this.change = new _angular_core__WEBPACK_IMPORTED_MODULE_4__["EventEmitter"]();
/**
* Event that emits whenever the raw value of the chip-list changes. This is here primarily
* to facilitate the two-way binding for the `value` input.
* \@docs-private
*/
_this.valueChange = new _angular_core__WEBPACK_IMPORTED_MODULE_4__["EventEmitter"]();
if (_this.ngControl) {
_this.ngControl.valueAccessor = _this;
}
return _this;
}
Object.defineProperty(MatChipList.prototype, "selected", {
/** The array of selected chips inside chip list. */
get: /**
* The array of selected chips inside chip list.
* @return {?}
*/
function () {
return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "role", {
/** The ARIA role applied to the chip list. */
get: /**
* The ARIA role applied to the chip list.
* @return {?}
*/
function () { return this.empty ? null : 'listbox'; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "multiple", {
get: /**
* Whether the user should be allowed to select multiple chips.
* @return {?}
*/
function () { return this._multiple; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._multiple = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "compareWith", {
get: /**
* A function to compare the option values with the selected values. The first argument
* is a value from an option. The second is a value from the selection. A boolean
* should be returned.
* @return {?}
*/
function () { return this._compareWith; },
set: /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this._compareWith = fn;
if (this._selectionModel) {
// A different comparator means the selection could change.
this._initializeSelection();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "value", {
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () { return this._value; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this.writeValue(value);
this._value = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "id", {
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () {
return this._chipInput ? this._chipInput.id : this._uid;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "required", {
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () { return this._required; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._required = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(value);
this.stateChanges.next();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "placeholder", {
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () {
return this._chipInput ? this._chipInput.placeholder : this._placeholder;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._placeholder = value;
this.stateChanges.next();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "focused", {
/** Whether any chips or the matChipInput inside of this chip-list has focus. */
get: /**
* Whether any chips or the matChipInput inside of this chip-list has focus.
* @return {?}
*/
function () {
return this.chips.some(function (chip) { return chip._hasFocus; }) ||
(this._chipInput && this._chipInput.focused);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "empty", {
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () {
return (!this._chipInput || this._chipInput.empty) && this.chips.length === 0;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "shouldLabelFloat", {
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () { return !this.empty || this.focused; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "disabled", {
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () { return this.ngControl ? !!this.ngControl.disabled : this._disabled; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._disabled = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "selectable", {
get: /**
* Whether or not this chip list is selectable. When a chip list is not selectable,
* the selected states for all the chips inside the chip list are always ignored.
* @return {?}
*/
function () { return this._selectable; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var _this = this;
this._selectable = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(value);
if (this.chips) {
this.chips.forEach(function (chip) { return chip.chipListSelectable = _this._selectable; });
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "tabIndex", {
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._userTabIndex = value;
this._tabIndex = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "chipSelectionChanges", {
/** Combined stream of all of the child chips' selection change events. */
get: /**
* Combined stream of all of the child chips' selection change events.
* @return {?}
*/
function () {
return rxjs__WEBPACK_IMPORTED_MODULE_6__["merge"].apply(void 0, this.chips.map(function (chip) { return chip.selectionChange; }));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "chipFocusChanges", {
/** Combined stream of all of the child chips' focus change events. */
get: /**
* Combined stream of all of the child chips' focus change events.
* @return {?}
*/
function () {
return rxjs__WEBPACK_IMPORTED_MODULE_6__["merge"].apply(void 0, this.chips.map(function (chip) { return chip._onFocus; }));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "chipBlurChanges", {
/** Combined stream of all of the child chips' blur change events. */
get: /**
* Combined stream of all of the child chips' blur change events.
* @return {?}
*/
function () {
return rxjs__WEBPACK_IMPORTED_MODULE_6__["merge"].apply(void 0, this.chips.map(function (chip) { return chip._onBlur; }));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipList.prototype, "chipRemoveChanges", {
/** Combined stream of all of the child chips' remove change events. */
get: /**
* Combined stream of all of the child chips' remove change events.
* @return {?}
*/
function () {
return rxjs__WEBPACK_IMPORTED_MODULE_6__["merge"].apply(void 0, this.chips.map(function (chip) { return chip.destroyed; }));
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatChipList.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
this._keyManager = new _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_7__["FocusKeyManager"](this.chips)
.withWrap()
.withVerticalOrientation()
.withHorizontalOrientation(this._dir ? this._dir.value : 'ltr');
// Prevents the chip list from capturing focus and redirecting
// it back to the first chip when the user tabs out.
this._tabOutSubscription = this._keyManager.tabOut.subscribe(function () {
_this._tabIndex = -1;
setTimeout(function () { return _this._tabIndex = _this._userTabIndex || 0; });
});
// When the list changes, re-subscribe
this._changeSubscription = this.chips.changes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_12__["startWith"])(null)).subscribe(function () {
_this._resetChips();
// Reset chips selected/deselected status
// Reset chips selected/deselected status
_this._initializeSelection();
// Check to see if we need to update our tab index
// Check to see if we need to update our tab index
_this._updateTabIndex();
// Check to see if we have a destroyed chip and need to refocus
// Check to see if we have a destroyed chip and need to refocus
_this._updateFocusForDestroyedChips();
_this.stateChanges.next();
});
};
/**
* @return {?}
*/
MatChipList.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._selectionModel = new _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_9__["SelectionModel"](this.multiple, undefined, false);
this.stateChanges.next();
};
/**
* @return {?}
*/
MatChipList.prototype.ngDoCheck = /**
* @return {?}
*/
function () {
if (this.ngControl) {
// We need to re-evaluate this on every change detection cycle, because there are some
// error triggers that we can't subscribe to (e.g. parent form submissions). This means
// that whatever logic is in here has to be super lean or we risk destroying the performance.
this.updateErrorState();
}
};
/**
* @return {?}
*/
MatChipList.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._tabOutSubscription.unsubscribe();
if (this._changeSubscription) {
this._changeSubscription.unsubscribe();
}
if (this._chipRemoveSubscription) {
this._chipRemoveSubscription.unsubscribe();
}
this._dropSubscriptions();
this.stateChanges.complete();
};
/** Associates an HTML input element with this chip list. */
/**
* Associates an HTML input element with this chip list.
* @param {?} inputElement
* @return {?}
*/
MatChipList.prototype.registerInput = /**
* Associates an HTML input element with this chip list.
* @param {?} inputElement
* @return {?}
*/
function (inputElement) {
this._chipInput = inputElement;
};
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
/**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @param {?} ids
* @return {?}
*/
MatChipList.prototype.setDescribedByIds = /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @param {?} ids
* @return {?}
*/
function (ids) { this._ariaDescribedby = ids.join(' '); };
// Implemented as part of ControlValueAccessor.
/**
* @param {?} value
* @return {?}
*/
MatChipList.prototype.writeValue = /**
* @param {?} value
* @return {?}
*/
function (value) {
if (this.chips) {
this._setSelectionByValue(value, false);
}
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} fn
* @return {?}
*/
MatChipList.prototype.registerOnChange = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this._onChange = fn;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} fn
* @return {?}
*/
MatChipList.prototype.registerOnTouched = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this._onTouched = fn;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} isDisabled
* @return {?}
*/
MatChipList.prototype.setDisabledState = /**
* @param {?} isDisabled
* @return {?}
*/
function (isDisabled) {
this.disabled = isDisabled;
this._elementRef.nativeElement.disabled = isDisabled;
this.stateChanges.next();
};
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
/**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
MatChipList.prototype.onContainerClick = /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () { this.focus(); };
/**
* Focuses the the first non-disabled chip in this chip list, or the associated input when there
* are no eligible chips.
*/
/**
* Focuses the the first non-disabled chip in this chip list, or the associated input when there
* are no eligible chips.
* @return {?}
*/
MatChipList.prototype.focus = /**
* Focuses the the first non-disabled chip in this chip list, or the associated input when there
* are no eligible chips.
* @return {?}
*/
function () {
// TODO: ARIA says this should focus the first `selected` chip if any are selected.
// Focus on first element if there's no chipInput inside chip-list
if (this._chipInput && this._chipInput.focused) {
// do nothing
}
else if (this.chips.length > 0) {
this._keyManager.setFirstItemActive();
this.stateChanges.next();
}
else {
this._focusInput();
this.stateChanges.next();
}
};
/** Attempt to focus an input if we have one. */
/**
* Attempt to focus an input if we have one.
* @return {?}
*/
MatChipList.prototype._focusInput = /**
* Attempt to focus an input if we have one.
* @return {?}
*/
function () {
if (this._chipInput) {
this._chipInput.focus();
}
};
/**
* Pass events to the keyboard manager. Available here for tests.
*/
/**
* Pass events to the keyboard manager. Available here for tests.
* @param {?} event
* @return {?}
*/
MatChipList.prototype._keydown = /**
* Pass events to the keyboard manager. Available here for tests.
* @param {?} event
* @return {?}
*/
function (event) {
var /** @type {?} */ target = /** @type {?} */ (event.target);
// If they are on an empty input and hit backspace, focus the last chip
if (event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_2__["BACKSPACE"] && this._isInputEmpty(target)) {
this._keyManager.setLastItemActive();
event.preventDefault();
}
else if (target && target.classList.contains('mat-chip')) {
this._keyManager.onKeydown(event);
this.stateChanges.next();
}
};
/**
* Check the tab index as you should not be allowed to focus an empty list.
*/
/**
* Check the tab index as you should not be allowed to focus an empty list.
* @return {?}
*/
MatChipList.prototype._updateTabIndex = /**
* Check the tab index as you should not be allowed to focus an empty list.
* @return {?}
*/
function () {
// If we have 0 chips, we should not allow keyboard focus
this._tabIndex = this._userTabIndex || (this.chips.length === 0 ? -1 : 0);
};
/**
* Update key manager's active item when chip is deleted.
* If the deleted chip is the last chip in chip list, focus the new last chip.
* Otherwise focus the next chip in the list.
* Save `_lastDestroyedIndex` so we can set the correct focus.
*/
/**
* Update key manager's active item when chip is deleted.
* If the deleted chip is the last chip in chip list, focus the new last chip.
* Otherwise focus the next chip in the list.
* Save `_lastDestroyedIndex` so we can set the correct focus.
* @param {?} chip
* @return {?}
*/
MatChipList.prototype._updateKeyManager = /**
* Update key manager's active item when chip is deleted.
* If the deleted chip is the last chip in chip list, focus the new last chip.
* Otherwise focus the next chip in the list.
* Save `_lastDestroyedIndex` so we can set the correct focus.
* @param {?} chip
* @return {?}
*/
function (chip) {
var /** @type {?} */ chipIndex = this.chips.toArray().indexOf(chip);
if (this._isValidIndex(chipIndex)) {
if (chip._hasFocus) {
// Check whether the chip is not the last item
if (chipIndex < this.chips.length - 1) {
this._keyManager.setActiveItem(chipIndex);
}
else if (chipIndex - 1 >= 0) {
this._keyManager.setActiveItem(chipIndex - 1);
}
}
if (this._keyManager.activeItemIndex === chipIndex) {
this._lastDestroyedIndex = chipIndex;
}
}
};
/**
* Checks to see if a focus chip was recently destroyed so that we can refocus the next closest
* one.
*/
/**
* Checks to see if a focus chip was recently destroyed so that we can refocus the next closest
* one.
* @return {?}
*/
MatChipList.prototype._updateFocusForDestroyedChips = /**
* Checks to see if a focus chip was recently destroyed so that we can refocus the next closest
* one.
* @return {?}
*/
function () {
var /** @type {?} */ chipsArray = this.chips;
if (this._lastDestroyedIndex != null && chipsArray.length > 0 && this.focused) {
// Check whether the destroyed chip was the last item
var /** @type {?} */ newFocusIndex = Math.min(this._lastDestroyedIndex, chipsArray.length - 1);
this._keyManager.setActiveItem(newFocusIndex);
var /** @type {?} */ focusChip = this._keyManager.activeItem;
// Focus the chip
if (focusChip) {
focusChip.focus();
}
}
// Reset our destroyed index
this._lastDestroyedIndex = null;
};
/**
* Utility to ensure all indexes are valid.
*
* @param {?} index The index to be checked.
* @return {?} True if the index is valid for our list of chips.
*/
MatChipList.prototype._isValidIndex = /**
* Utility to ensure all indexes are valid.
*
* @param {?} index The index to be checked.
* @return {?} True if the index is valid for our list of chips.
*/
function (index) {
return index >= 0 && index < this.chips.length;
};
/**
* @param {?} element
* @return {?}
*/
MatChipList.prototype._isInputEmpty = /**
* @param {?} element
* @return {?}
*/
function (element) {
if (element && element.nodeName.toLowerCase() === 'input') {
var /** @type {?} */ input = /** @type {?} */ (element);
return !input.value;
}
return false;
};
/**
* @param {?} value
* @param {?=} isUserInput
* @return {?}
*/
MatChipList.prototype._setSelectionByValue = /**
* @param {?} value
* @param {?=} isUserInput
* @return {?}
*/
function (value, isUserInput) {
var _this = this;
if (isUserInput === void 0) { isUserInput = true; }
this._clearSelection();
this.chips.forEach(function (chip) { return chip.deselect(); });
if (Array.isArray(value)) {
value.forEach(function (currentValue) { return _this._selectValue(currentValue, isUserInput); });
this._sortValues();
}
else {
var /** @type {?} */ correspondingChip = this._selectValue(value, isUserInput);
// Shift focus to the active item. Note that we shouldn't do this in multiple
// mode, because we don't know what chip the user interacted with last.
if (correspondingChip) {
if (isUserInput) {
this._keyManager.setActiveItem(correspondingChip);
}
}
}
};
/**
* Finds and selects the chip based on its value.
* @param {?} value
* @param {?=} isUserInput
* @return {?} Chip that has the corresponding value.
*/
MatChipList.prototype._selectValue = /**
* Finds and selects the chip based on its value.
* @param {?} value
* @param {?=} isUserInput
* @return {?} Chip that has the corresponding value.
*/
function (value, isUserInput) {
var _this = this;
if (isUserInput === void 0) { isUserInput = true; }
var /** @type {?} */ correspondingChip = this.chips.find(function (chip) {
return chip.value != null && _this._compareWith(chip.value, value);
});
if (correspondingChip) {
isUserInput ? correspondingChip.selectViaInteraction() : correspondingChip.select();
this._selectionModel.select(correspondingChip);
}
return correspondingChip;
};
/**
* @return {?}
*/
MatChipList.prototype._initializeSelection = /**
* @return {?}
*/
function () {
var _this = this;
// Defer setting the value in order to avoid the "Expression
// has changed after it was checked" errors from Angular.
Promise.resolve().then(function () {
if (_this.ngControl || _this._value) {
_this._setSelectionByValue(_this.ngControl ? _this.ngControl.value : _this._value, false);
_this.stateChanges.next();
}
});
};
/**
* Deselects every chip in the list.
* @param {?=} skip Chip that should not be deselected.
* @return {?}
*/
MatChipList.prototype._clearSelection = /**
* Deselects every chip in the list.
* @param {?=} skip Chip that should not be deselected.
* @return {?}
*/
function (skip) {
this._selectionModel.clear();
this.chips.forEach(function (chip) {
if (chip !== skip) {
chip.deselect();
}
});
this.stateChanges.next();
};
/**
* Sorts the model values, ensuring that they keep the same
* order that they have in the panel.
* @return {?}
*/
MatChipList.prototype._sortValues = /**
* Sorts the model values, ensuring that they keep the same
* order that they have in the panel.
* @return {?}
*/
function () {
var _this = this;
if (this._multiple) {
this._selectionModel.clear();
this.chips.forEach(function (chip) {
if (chip.selected) {
_this._selectionModel.select(chip);
}
});
this.stateChanges.next();
}
};
/**
* Emits change event to set the model value.
* @param {?=} fallbackValue
* @return {?}
*/
MatChipList.prototype._propagateChanges = /**
* Emits change event to set the model value.
* @param {?=} fallbackValue
* @return {?}
*/
function (fallbackValue) {
var /** @type {?} */ valueToEmit = null;
if (Array.isArray(this.selected)) {
valueToEmit = this.selected.map(function (chip) { return chip.value; });
}
else {
valueToEmit = this.selected ? this.selected.value : fallbackValue;
}
this._value = valueToEmit;
this.change.emit(new MatChipListChange(this, valueToEmit));
this.valueChange.emit(valueToEmit);
this._onChange(valueToEmit);
this._changeDetectorRef.markForCheck();
};
/** When blurred, mark the field as touched when focus moved outside the chip list. */
/**
* When blurred, mark the field as touched when focus moved outside the chip list.
* @return {?}
*/
MatChipList.prototype._blur = /**
* When blurred, mark the field as touched when focus moved outside the chip list.
* @return {?}
*/
function () {
var _this = this;
this._keyManager.setActiveItem(-1);
if (!this.disabled) {
if (this._chipInput) {
// If there's a chip input, we should check whether the focus moved to chip input.
// If the focus is not moved to chip input, mark the field as touched. If the focus moved
// to chip input, do nothing.
// Timeout is needed to wait for the focus() event trigger on chip input.
setTimeout(function () {
if (!_this.focused) {
_this._markAsTouched();
}
});
}
else {
// If there's no chip input, then mark the field as touched.
this._markAsTouched();
}
}
};
/** Mark the field as touched */
/**
* Mark the field as touched
* @return {?}
*/
MatChipList.prototype._markAsTouched = /**
* Mark the field as touched
* @return {?}
*/
function () {
this._onTouched();
this._changeDetectorRef.markForCheck();
this.stateChanges.next();
};
/**
* @return {?}
*/
MatChipList.prototype._resetChips = /**
* @return {?}
*/
function () {
this._dropSubscriptions();
this._listenToChipsFocus();
this._listenToChipsSelection();
this._listenToChipsRemoved();
};
/**
* @return {?}
*/
MatChipList.prototype._dropSubscriptions = /**
* @return {?}
*/
function () {
if (this._chipFocusSubscription) {
this._chipFocusSubscription.unsubscribe();
this._chipFocusSubscription = null;
}
if (this._chipBlurSubscription) {
this._chipBlurSubscription.unsubscribe();
this._chipBlurSubscription = null;
}
if (this._chipSelectionSubscription) {
this._chipSelectionSubscription.unsubscribe();
this._chipSelectionSubscription = null;
}
};
/**
* Listens to user-generated selection events on each chip.
* @return {?}
*/
MatChipList.prototype._listenToChipsSelection = /**
* Listens to user-generated selection events on each chip.
* @return {?}
*/
function () {
var _this = this;
this._chipSelectionSubscription = this.chipSelectionChanges.subscribe(function (event) {
event.source.selected
? _this._selectionModel.select(event.source)
: _this._selectionModel.deselect(event.source);
// For single selection chip list, make sure the deselected value is unselected.
if (!_this.multiple) {
_this.chips.forEach(function (chip) {
if (!_this._selectionModel.isSelected(chip) && chip.selected) {
chip.deselect();
}
});
}
if (event.isUserInput) {
_this._propagateChanges();
}
});
};
/**
* Listens to user-generated selection events on each chip.
* @return {?}
*/
MatChipList.prototype._listenToChipsFocus = /**
* Listens to user-generated selection events on each chip.
* @return {?}
*/
function () {
var _this = this;
this._chipFocusSubscription = this.chipFocusChanges.subscribe(function (event) {
var /** @type {?} */ chipIndex = _this.chips.toArray().indexOf(event.chip);
if (_this._isValidIndex(chipIndex)) {
_this._keyManager.updateActiveItemIndex(chipIndex);
}
_this.stateChanges.next();
});
this._chipBlurSubscription = this.chipBlurChanges.subscribe(function () {
_this._blur();
_this.stateChanges.next();
});
};
/**
* @return {?}
*/
MatChipList.prototype._listenToChipsRemoved = /**
* @return {?}
*/
function () {
var _this = this;
this._chipRemoveSubscription = this.chipRemoveChanges.subscribe(function (event) {
_this._updateKeyManager(event.chip);
});
};
MatChipList.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Component"], args: [{selector: 'mat-chip-list',
template: "<div class=\"mat-chip-list-wrapper\"><ng-content></ng-content></div>",
exportAs: 'matChipList',
host: {
'[attr.tabindex]': '_tabIndex',
'[attr.aria-describedby]': '_ariaDescribedby || null',
'[attr.aria-required]': 'required.toString()',
'[attr.aria-disabled]': 'disabled.toString()',
'[attr.aria-invalid]': 'errorState',
'[attr.aria-multiselectable]': 'multiple',
'[attr.role]': 'role',
'[class.mat-chip-list-disabled]': 'disabled',
'[class.mat-chip-list-invalid]': 'errorState',
'[class.mat-chip-list-required]': 'required',
'[attr.aria-orientation]': 'ariaOrientation',
'class': 'mat-chip-list',
'(focus)': 'focus()',
'(blur)': '_blur()',
'(keydown)': '_keydown($event)',
'[id]': '_uid',
},
providers: [{ provide: _angular_material_form_field__WEBPACK_IMPORTED_MODULE_11__["MatFormFieldControl"], useExisting: MatChipList }],
styles: [".mat-chip{position:relative;overflow:hidden;box-sizing:border-box}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(.4,0,.2,1);display:inline-flex;padding:7px 12px;border-radius:24px;align-items:center;cursor:default}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip:focus{box-shadow:0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12);outline:0}@media screen and (-ms-high-contrast:active){.mat-standard-chip{outline:solid 1px}}.mat-standard-chip.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:7px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:7px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:7px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:7px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:32px;height:32px;margin-right:8px;margin-left:0}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:0}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:7px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:7px;margin-left:0}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper .mat-standard-chip,.mat-chip-list-wrapper input.mat-input-element{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden}input.mat-chip-input{width:150px;margin:3px;flex:1 0 150px}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ChangeDetectionStrategy"].OnPush
},] },
];
/** @nocollapse */
MatChipList.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ChangeDetectorRef"], },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_8__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Optional"] },] },
{ type: _angular_forms__WEBPACK_IMPORTED_MODULE_10__["NgForm"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Optional"] },] },
{ type: _angular_forms__WEBPACK_IMPORTED_MODULE_10__["FormGroupDirective"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Optional"] },] },
{ type: _angular_material_core__WEBPACK_IMPORTED_MODULE_5__["ErrorStateMatcher"], },
{ type: _angular_forms__WEBPACK_IMPORTED_MODULE_10__["NgControl"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Self"] },] },
]; };
MatChipList.propDecorators = {
"errorStateMatcher": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"multiple": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"compareWith": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"required": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"placeholder": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"ariaOrientation": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"], args: ['aria-orientation',] },],
"selectable": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"tabIndex": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"change": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Output"] },],
"valueChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Output"] },],
"chips": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ContentChildren"], args: [MatChip,] },],
};
return MatChipList;
}(_MatChipListMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
// Increasing integer for generating unique ids.
var /** @type {?} */ nextUniqueId$1 = 0;
/**
* Directive that adds chip-specific behaviors to an input element inside `<mat-form-field>`.
* May be placed inside or outside of an `<mat-chip-list>`.
*/
var MatChipInput = /** @class */ (function () {
function MatChipInput(_elementRef, _defaultOptions) {
this._elementRef = _elementRef;
this._defaultOptions = _defaultOptions;
/**
* Whether the control is focused.
*/
this.focused = false;
this._addOnBlur = false;
/**
* The list of key codes that will trigger a chipEnd event.
*
* Defaults to `[ENTER]`.
*/
this.separatorKeyCodes = this._defaultOptions.separatorKeyCodes;
/**
* Emitted when a chip is to be added.
*/
this.chipEnd = new _angular_core__WEBPACK_IMPORTED_MODULE_4__["EventEmitter"]();
/**
* The input's placeholder text.
* @deprecated Bind to the `placeholder` attribute directly.
* \@deletion-target 7.0.0
*/
this.placeholder = '';
/**
* Unique id for the input.
*/
this.id = "mat-chip-list-input-" + nextUniqueId$1++;
this._inputElement = /** @type {?} */ (this._elementRef.nativeElement);
}
Object.defineProperty(MatChipInput.prototype, "chipList", {
set: /**
* Register input for chip list
* @param {?} value
* @return {?}
*/
function (value) {
if (value) {
this._chipList = value;
this._chipList.registerInput(this);
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipInput.prototype, "addOnBlur", {
get: /**
* Whether or not the chipEnd event will be emitted when the input is blurred.
* @return {?}
*/
function () { return this._addOnBlur; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._addOnBlur = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatChipInput.prototype, "empty", {
/** Whether the input is empty. */
get: /**
* Whether the input is empty.
* @return {?}
*/
function () { return !this._inputElement.value; },
enumerable: true,
configurable: true
});
/** Utility method to make host definition/tests more clear. */
/**
* Utility method to make host definition/tests more clear.
* @param {?=} event
* @return {?}
*/
MatChipInput.prototype._keydown = /**
* Utility method to make host definition/tests more clear.
* @param {?=} event
* @return {?}
*/
function (event) {
this._emitChipEnd(event);
};
/** Checks to see if the blur should emit the (chipEnd) event. */
/**
* Checks to see if the blur should emit the (chipEnd) event.
* @return {?}
*/
MatChipInput.prototype._blur = /**
* Checks to see if the blur should emit the (chipEnd) event.
* @return {?}
*/
function () {
if (this.addOnBlur) {
this._emitChipEnd();
}
this.focused = false;
// Blur the chip list if it is not focused
if (!this._chipList.focused) {
this._chipList._blur();
}
this._chipList.stateChanges.next();
};
/**
* @return {?}
*/
MatChipInput.prototype._focus = /**
* @return {?}
*/
function () {
this.focused = true;
this._chipList.stateChanges.next();
};
/** Checks to see if the (chipEnd) event needs to be emitted. */
/**
* Checks to see if the (chipEnd) event needs to be emitted.
* @param {?=} event
* @return {?}
*/
MatChipInput.prototype._emitChipEnd = /**
* Checks to see if the (chipEnd) event needs to be emitted.
* @param {?=} event
* @return {?}
*/
function (event) {
if (!this._inputElement.value && !!event) {
this._chipList._keydown(event);
}
if (!event || this.separatorKeyCodes.indexOf(event.keyCode) > -1) {
this.chipEnd.emit({ input: this._inputElement, value: this._inputElement.value });
if (event) {
event.preventDefault();
}
}
};
/**
* @return {?}
*/
MatChipInput.prototype._onInput = /**
* @return {?}
*/
function () {
// Let chip list know whenever the value changes.
this._chipList.stateChanges.next();
};
/** Focuses the input. */
/**
* Focuses the input.
* @return {?}
*/
MatChipInput.prototype.focus = /**
* Focuses the input.
* @return {?}
*/
function () { this._inputElement.focus(); };
MatChipInput.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Directive"], args: [{
selector: 'input[matChipInputFor]',
exportAs: 'matChipInput, matChipInputFor',
host: {
'class': 'mat-chip-input mat-input-element',
'(keydown)': '_keydown($event)',
'(blur)': '_blur()',
'(focus)': '_focus()',
'(input)': '_onInput()',
'[id]': 'id',
'[attr.placeholder]': 'placeholder || null',
}
},] },
];
/** @nocollapse */
MatChipInput.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ElementRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Inject"], args: [MAT_CHIPS_DEFAULT_OPTIONS,] },] },
]; };
MatChipInput.propDecorators = {
"chipList": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"], args: ['matChipInputFor',] },],
"addOnBlur": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"], args: ['matChipInputAddOnBlur',] },],
"separatorKeyCodes": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"], args: ['matChipInputSeparatorKeyCodes',] },],
"chipEnd": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Output"], args: ['matChipInputTokenEnd',] },],
"placeholder": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"id": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
};
return MatChipInput;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ CHIP_DECLARATIONS = [
MatChipList,
MatChip,
MatChipInput,
MatChipRemove,
MatChipAvatar,
MatChipTrailingIcon,
];
var ɵ0 = {
separatorKeyCodes: [_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_2__["ENTER"]]
};
var MatChipsModule = /** @class */ (function () {
function MatChipsModule() {
}
MatChipsModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["NgModule"], args: [{
exports: CHIP_DECLARATIONS,
declarations: CHIP_DECLARATIONS,
providers: [
_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["ErrorStateMatcher"],
{
provide: MAT_CHIPS_DEFAULT_OPTIONS,
useValue: /** @type {?} */ ((ɵ0))
}
]
},] },
];
return MatChipsModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=chips.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/core.es5.js":
/*!*********************************************************!*\
!*** ./node_modules/@angular/material/esm5/core.es5.js ***!
\*********************************************************/
/*! exports provided: AnimationCurves, AnimationDurations, MatCommonModule, MATERIAL_SANITY_CHECKS, mixinDisabled, mixinColor, mixinDisableRipple, mixinTabIndex, mixinErrorState, mixinInitialized, NativeDateModule, MatNativeDateModule, MAT_DATE_LOCALE, MAT_DATE_LOCALE_FACTORY, MAT_DATE_LOCALE_PROVIDER, DateAdapter, MAT_DATE_FORMATS, NativeDateAdapter, MAT_NATIVE_DATE_FORMATS, ShowOnDirtyErrorStateMatcher, ErrorStateMatcher, MAT_HAMMER_OPTIONS, GestureConfig, MatLine, MatLineSetter, MatLineModule, MatOptionModule, MatOptionSelectionChange, MAT_OPTION_PARENT_COMPONENT, MatOption, _countGroupLabelsBeforeOption, _getOptionScrollPosition, MatOptgroupBase, _MatOptgroupMixinBase, MatOptgroup, MAT_LABEL_GLOBAL_OPTIONS, MatRippleModule, MAT_RIPPLE_GLOBAL_OPTIONS, MatRipple, RippleState, RippleRef, defaultRippleAnimationConfig, RippleRenderer, MatPseudoCheckboxModule, MatPseudoCheckbox, JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC, ɵa1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationCurves", function() { return AnimationCurves; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationDurations", function() { return AnimationDurations; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCommonModule", function() { return MatCommonModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MATERIAL_SANITY_CHECKS", function() { return MATERIAL_SANITY_CHECKS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixinDisabled", function() { return mixinDisabled; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixinColor", function() { return mixinColor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixinDisableRipple", function() { return mixinDisableRipple; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixinTabIndex", function() { return mixinTabIndex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixinErrorState", function() { return mixinErrorState; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixinInitialized", function() { return mixinInitialized; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NativeDateModule", function() { return NativeDateModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatNativeDateModule", function() { return MatNativeDateModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DATE_LOCALE", function() { return MAT_DATE_LOCALE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DATE_LOCALE_FACTORY", function() { return MAT_DATE_LOCALE_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DATE_LOCALE_PROVIDER", function() { return MAT_DATE_LOCALE_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateAdapter", function() { return DateAdapter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DATE_FORMATS", function() { return MAT_DATE_FORMATS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NativeDateAdapter", function() { return NativeDateAdapter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_NATIVE_DATE_FORMATS", function() { return MAT_NATIVE_DATE_FORMATS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShowOnDirtyErrorStateMatcher", function() { return ShowOnDirtyErrorStateMatcher; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorStateMatcher", function() { return ErrorStateMatcher; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_HAMMER_OPTIONS", function() { return MAT_HAMMER_OPTIONS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GestureConfig", function() { return GestureConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatLine", function() { return MatLine; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatLineSetter", function() { return MatLineSetter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatLineModule", function() { return MatLineModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatOptionModule", function() { return MatOptionModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatOptionSelectionChange", function() { return MatOptionSelectionChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_OPTION_PARENT_COMPONENT", function() { return MAT_OPTION_PARENT_COMPONENT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatOption", function() { return MatOption; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_countGroupLabelsBeforeOption", function() { return _countGroupLabelsBeforeOption; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_getOptionScrollPosition", function() { return _getOptionScrollPosition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatOptgroupBase", function() { return MatOptgroupBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatOptgroupMixinBase", function() { return _MatOptgroupMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatOptgroup", function() { return MatOptgroup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_LABEL_GLOBAL_OPTIONS", function() { return MAT_LABEL_GLOBAL_OPTIONS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatRippleModule", function() { return MatRippleModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_RIPPLE_GLOBAL_OPTIONS", function() { return MAT_RIPPLE_GLOBAL_OPTIONS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatRipple", function() { return MatRipple; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RippleState", function() { return RippleState; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RippleRef", function() { return RippleRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultRippleAnimationConfig", function() { return defaultRippleAnimationConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RippleRenderer", function() { return RippleRenderer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatPseudoCheckboxModule", function() { return MatPseudoCheckboxModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatPseudoCheckbox", function() { return MatPseudoCheckbox; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JAN", function() { return JAN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FEB", function() { return FEB; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAR", function() { return MAR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APR", function() { return APR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAY", function() { return MAY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JUN", function() { return JUN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JUL", function() { return JUL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AUG", function() { return AUG; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SEP", function() { return SEP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OCT", function() { return OCT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NOV", function() { return NOV; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEC", function() { return DEC; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵa1", function() { return MATERIAL_SANITY_CHECKS_FACTORY; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/fesm5/platform-browser.js");
/* harmony import */ var _angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/platform-browser/animations */ "./node_modules/@angular/platform-browser/fesm5/animations.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var AnimationCurves = /** @class */ (function () {
function AnimationCurves() {
}
AnimationCurves.STANDARD_CURVE = 'cubic-bezier(0.4,0.0,0.2,1)';
AnimationCurves.DECELERATION_CURVE = 'cubic-bezier(0.0,0.0,0.2,1)';
AnimationCurves.ACCELERATION_CURVE = 'cubic-bezier(0.4,0.0,1,1)';
AnimationCurves.SHARP_CURVE = 'cubic-bezier(0.4,0.0,0.6,1)';
return AnimationCurves;
}());
/**
* \@docs-private
*/
var AnimationDurations = /** @class */ (function () {
function AnimationDurations() {
}
AnimationDurations.COMPLEX = '375ms';
AnimationDurations.ENTERING = '225ms';
AnimationDurations.EXITING = '195ms';
return AnimationDurations;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token that configures whether the Material sanity checks are enabled.
*/
var /** @type {?} */ MATERIAL_SANITY_CHECKS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('mat-sanity-checks', {
providedIn: 'root',
factory: MATERIAL_SANITY_CHECKS_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function MATERIAL_SANITY_CHECKS_FACTORY() {
return true;
}
/**
* Module that captures anything that should be loaded and/or run for *all* Angular Material
* components. This includes Bidi, etc.
*
* This module should be imported to each top-level component module (e.g., MatTabsModule).
*/
var MatCommonModule = /** @class */ (function () {
function MatCommonModule(_sanityChecksEnabled) {
this._sanityChecksEnabled = _sanityChecksEnabled;
/**
* Whether we've done the global sanity checks (e.g. a theme is loaded, there is a doctype).
*/
this._hasDoneGlobalChecks = false;
/**
* Whether we've already checked for HammerJs availability.
*/
this._hasCheckedHammer = false;
/**
* Reference to the global `document` object.
*/
this._document = typeof document === 'object' && document ? document : null;
/**
* Reference to the global 'window' object.
*/
this._window = typeof window === 'object' && window ? window : null;
if (this._areChecksEnabled() && !this._hasDoneGlobalChecks) {
this._checkDoctypeIsDefined();
this._checkThemeIsPresent();
this._hasDoneGlobalChecks = true;
}
}
/**
* Whether any sanity checks are enabled
* @return {?}
*/
MatCommonModule.prototype._areChecksEnabled = /**
* Whether any sanity checks are enabled
* @return {?}
*/
function () {
return this._sanityChecksEnabled && Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["isDevMode"])() && !this._isTestEnv();
};
/**
* Whether the code is running in tests.
* @return {?}
*/
MatCommonModule.prototype._isTestEnv = /**
* Whether the code is running in tests.
* @return {?}
*/
function () {
return this._window && (this._window['__karma__'] || this._window['jasmine']);
};
/**
* @return {?}
*/
MatCommonModule.prototype._checkDoctypeIsDefined = /**
* @return {?}
*/
function () {
if (this._document && !this._document.doctype) {
console.warn('Current document does not have a doctype. This may cause ' +
'some Angular Material components not to behave as expected.');
}
};
/**
* @return {?}
*/
MatCommonModule.prototype._checkThemeIsPresent = /**
* @return {?}
*/
function () {
if (this._document && typeof getComputedStyle === 'function') {
var /** @type {?} */ testElement = this._document.createElement('div');
testElement.classList.add('mat-theme-loaded-marker');
this._document.body.appendChild(testElement);
var /** @type {?} */ computedStyle = getComputedStyle(testElement);
// In some situations, the computed style of the test element can be null. For example in
// Firefox, the computed style is null if an application is running inside of a hidden iframe.
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=548397
if (computedStyle && computedStyle.display !== 'none') {
console.warn('Could not find Angular Material core theme. Most Material ' +
'components may not work as expected. For more info refer ' +
'to the theming guide: https://material.angular.io/guide/theming');
}
this._document.body.removeChild(testElement);
}
};
/** Checks whether HammerJS is available. */
/**
* Checks whether HammerJS is available.
* @return {?}
*/
MatCommonModule.prototype._checkHammerIsAvailable = /**
* Checks whether HammerJS is available.
* @return {?}
*/
function () {
if (this._hasCheckedHammer || !this._window) {
return;
}
if (this._areChecksEnabled() && !this._window['Hammer']) {
console.warn('Could not find HammerJS. Certain Angular Material components may not work correctly.');
}
this._hasCheckedHammer = true;
};
MatCommonModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_1__["BidiModule"]],
exports: [_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_1__["BidiModule"]],
},] },
];
/** @nocollapse */
MatCommonModule.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [MATERIAL_SANITY_CHECKS,] },] },
]; };
return MatCommonModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Mixin to augment a directive with a `disabled` property.
* @template T
* @param {?} base
* @return {?}
*/
function mixinDisabled(base) {
return /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(class_1, _super);
function class_1() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _this = _super.apply(this, args) || this;
_this._disabled = false;
return _this;
}
Object.defineProperty(class_1.prototype, "disabled", {
get: /**
* @return {?}
*/
function () { return this._disabled; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._disabled = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
return class_1;
}(base));
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Mixin to augment a directive with a `color` property.
* @template T
* @param {?} base
* @param {?=} defaultColor
* @return {?}
*/
function mixinColor(base, defaultColor) {
return /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(class_1, _super);
function class_1() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _this = _super.apply(this, args) || this;
// Set the default color that can be specified from the mixin.
// Set the default color that can be specified from the mixin.
_this.color = defaultColor;
return _this;
}
Object.defineProperty(class_1.prototype, "color", {
get: /**
* @return {?}
*/
function () { return this._color; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ colorPalette = value || defaultColor;
if (colorPalette !== this._color) {
if (this._color) {
this._elementRef.nativeElement.classList.remove("mat-" + this._color);
}
if (colorPalette) {
this._elementRef.nativeElement.classList.add("mat-" + colorPalette);
}
this._color = colorPalette;
}
},
enumerable: true,
configurable: true
});
return class_1;
}(base));
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Mixin to augment a directive with a `disableRipple` property.
* @template T
* @param {?} base
* @return {?}
*/
function mixinDisableRipple(base) {
return /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(class_1, _super);
function class_1() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _this = _super.apply(this, args) || this;
_this._disableRipple = false;
return _this;
}
Object.defineProperty(class_1.prototype, "disableRipple", {
/** Whether the ripple effect is disabled or not. */
get: /**
* Whether the ripple effect is disabled or not.
* @return {?}
*/
function () { return this._disableRipple; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._disableRipple = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
return class_1;
}(base));
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Mixin to augment a directive with a `tabIndex` property.
* @template T
* @param {?} base
* @param {?=} defaultTabIndex
* @return {?}
*/
function mixinTabIndex(base, defaultTabIndex) {
if (defaultTabIndex === void 0) { defaultTabIndex = 0; }
return /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(class_1, _super);
function class_1() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _this = _super.apply(this, args) || this;
_this._tabIndex = defaultTabIndex;
return _this;
}
Object.defineProperty(class_1.prototype, "tabIndex", {
get: /**
* @return {?}
*/
function () { return this.disabled ? -1 : this._tabIndex; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
// If the specified tabIndex value is null or undefined, fall back to the default value.
this._tabIndex = value != null ? value : defaultTabIndex;
},
enumerable: true,
configurable: true
});
return class_1;
}(base));
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Mixin to augment a directive with updateErrorState method.
* For component with `errorState` and need to update `errorState`.
* @template T
* @param {?} base
* @return {?}
*/
function mixinErrorState(base) {
return /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(class_1, _super);
function class_1() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _this = _super.apply(this, args) || this;
/**
* Whether the component is in an error state.
*/
_this.errorState = false;
/**
* Stream that emits whenever the state of the input changes such that the wrapping
* `MatFormField` needs to run change detection.
*/
_this.stateChanges = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
return _this;
}
/**
* @return {?}
*/
class_1.prototype.updateErrorState = /**
* @return {?}
*/
function () {
var /** @type {?} */ oldState = this.errorState;
var /** @type {?} */ parent = this._parentFormGroup || this._parentForm;
var /** @type {?} */ matcher = this.errorStateMatcher || this._defaultErrorStateMatcher;
var /** @type {?} */ control = this.ngControl ? /** @type {?} */ (this.ngControl.control) : null;
var /** @type {?} */ newState = matcher.isErrorState(control, parent);
if (newState !== oldState) {
this.errorState = newState;
this.stateChanges.next();
}
};
return class_1;
}(base));
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Mixin to augment a directive with an initialized property that will emits when ngOnInit ends.
* @template T
* @param {?} base
* @return {?}
*/
function mixinInitialized(base) {
return /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(class_1, _super);
function class_1() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _this = _super.apply(this, args) || this;
/**
* Whether this directive has been marked as initialized.
*/
_this._isInitialized = false;
/**
* List of subscribers that subscribed before the directive was initialized. Should be notified
* during _markInitialized. Set to null after pending subscribers are notified, and should
* not expect to be populated after.
*/
_this._pendingSubscribers = [];
/**
* Observable stream that emits when the directive initializes. If already initialized, the
* subscriber is stored to be notified once _markInitialized is called.
*/
_this.initialized = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Observable"](function (subscriber) {
// If initialized, immediately notify the subscriber. Otherwise store the subscriber to notify
// when _markInitialized is called.
if (_this._isInitialized) {
_this._notifySubscriber(subscriber);
}
else {
/** @type {?} */ ((_this._pendingSubscribers)).push(subscriber);
}
});
return _this;
}
/**
* Marks the state as initialized and notifies pending subscribers. Should be called at the end
* of ngOnInit.
* @docs-private
*/
/**
* Marks the state as initialized and notifies pending subscribers. Should be called at the end
* of ngOnInit.
* \@docs-private
* @return {?}
*/
class_1.prototype._markInitialized = /**
* Marks the state as initialized and notifies pending subscribers. Should be called at the end
* of ngOnInit.
* \@docs-private
* @return {?}
*/
function () {
if (this._isInitialized) {
throw Error('This directive has already been marked as initialized and ' +
'should not be called twice.');
}
this._isInitialized = true; /** @type {?} */
((this._pendingSubscribers)).forEach(this._notifySubscriber);
this._pendingSubscribers = null;
};
/** Emits and completes the subscriber stream (should only emit once). */
/**
* Emits and completes the subscriber stream (should only emit once).
* @param {?} subscriber
* @return {?}
*/
class_1.prototype._notifySubscriber = /**
* Emits and completes the subscriber stream (should only emit once).
* @param {?} subscriber
* @return {?}
*/
function (subscriber) {
subscriber.next();
subscriber.complete();
};
return class_1;
}(base));
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* InjectionToken for datepicker that can be used to override default locale code.
*/
var /** @type {?} */ MAT_DATE_LOCALE = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('MAT_DATE_LOCALE', {
providedIn: 'root',
factory: MAT_DATE_LOCALE_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function MAT_DATE_LOCALE_FACTORY() {
return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]);
}
/**
* No longer needed since MAT_DATE_LOCALE has been changed to a scoped injectable.
* If you are importing and providing this in your code you can simply remove it.
* @deprecated
* \@deletion-target 7.0.0
*/
var /** @type {?} */ MAT_DATE_LOCALE_PROVIDER = { provide: MAT_DATE_LOCALE, useExisting: _angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"] };
/**
* Adapts type `D` to be usable as a date by cdk-based components that work with dates.
* @abstract
* @template D
*/
var /**
* Adapts type `D` to be usable as a date by cdk-based components that work with dates.
* @abstract
* @template D
*/
DateAdapter = /** @class */ (function () {
function DateAdapter() {
this._localeChanges = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
}
Object.defineProperty(DateAdapter.prototype, "localeChanges", {
/** A stream that emits when the locale changes. */
get: /**
* A stream that emits when the locale changes.
* @return {?}
*/
function () { return this._localeChanges; },
enumerable: true,
configurable: true
});
/**
* Attempts to deserialize a value to a valid date object. This is different from parsing in that
* deserialize should only accept non-ambiguous, locale-independent formats (e.g. a ISO 8601
* string). The default implementation does not allow any deserialization, it simply checks that
* the given value is already a valid date object or null. The `<mat-datepicker>` will call this
* method on all of it's `@Input()` properties that accept dates. It is therefore possible to
* support passing values from your backend directly to these properties by overriding this method
* to also deserialize the format used by your backend.
* @param value The value to be deserialized into a date object.
* @returns The deserialized date object, either a valid date, null if the value can be
* deserialized into a null date (e.g. the empty string), or an invalid date.
*/
/**
* Attempts to deserialize a value to a valid date object. This is different from parsing in that
* deserialize should only accept non-ambiguous, locale-independent formats (e.g. a ISO 8601
* string). The default implementation does not allow any deserialization, it simply checks that
* the given value is already a valid date object or null. The `<mat-datepicker>` will call this
* method on all of it's `\@Input()` properties that accept dates. It is therefore possible to
* support passing values from your backend directly to these properties by overriding this method
* to also deserialize the format used by your backend.
* @param {?} value The value to be deserialized into a date object.
* @return {?} The deserialized date object, either a valid date, null if the value can be
* deserialized into a null date (e.g. the empty string), or an invalid date.
*/
DateAdapter.prototype.deserialize = /**
* Attempts to deserialize a value to a valid date object. This is different from parsing in that
* deserialize should only accept non-ambiguous, locale-independent formats (e.g. a ISO 8601
* string). The default implementation does not allow any deserialization, it simply checks that
* the given value is already a valid date object or null. The `<mat-datepicker>` will call this
* method on all of it's `\@Input()` properties that accept dates. It is therefore possible to
* support passing values from your backend directly to these properties by overriding this method
* to also deserialize the format used by your backend.
* @param {?} value The value to be deserialized into a date object.
* @return {?} The deserialized date object, either a valid date, null if the value can be
* deserialized into a null date (e.g. the empty string), or an invalid date.
*/
function (value) {
if (value == null || this.isDateInstance(value) && this.isValid(value)) {
return value;
}
return this.invalid();
};
/**
* Sets the locale used for all dates.
* @param locale The new locale.
*/
/**
* Sets the locale used for all dates.
* @param {?} locale The new locale.
* @return {?}
*/
DateAdapter.prototype.setLocale = /**
* Sets the locale used for all dates.
* @param {?} locale The new locale.
* @return {?}
*/
function (locale) {
this.locale = locale;
this._localeChanges.next();
};
/**
* Compares two dates.
* @param first The first date to compare.
* @param second The second date to compare.
* @returns 0 if the dates are equal, a number less than 0 if the first date is earlier,
* a number greater than 0 if the first date is later.
*/
/**
* Compares two dates.
* @param {?} first The first date to compare.
* @param {?} second The second date to compare.
* @return {?} 0 if the dates are equal, a number less than 0 if the first date is earlier,
* a number greater than 0 if the first date is later.
*/
DateAdapter.prototype.compareDate = /**
* Compares two dates.
* @param {?} first The first date to compare.
* @param {?} second The second date to compare.
* @return {?} 0 if the dates are equal, a number less than 0 if the first date is earlier,
* a number greater than 0 if the first date is later.
*/
function (first, second) {
return this.getYear(first) - this.getYear(second) ||
this.getMonth(first) - this.getMonth(second) ||
this.getDate(first) - this.getDate(second);
};
/**
* Checks if two dates are equal.
* @param first The first date to check.
* @param second The second date to check.
* @returns Whether the two dates are equal.
* Null dates are considered equal to other null dates.
*/
/**
* Checks if two dates are equal.
* @param {?} first The first date to check.
* @param {?} second The second date to check.
* @return {?} Whether the two dates are equal.
* Null dates are considered equal to other null dates.
*/
DateAdapter.prototype.sameDate = /**
* Checks if two dates are equal.
* @param {?} first The first date to check.
* @param {?} second The second date to check.
* @return {?} Whether the two dates are equal.
* Null dates are considered equal to other null dates.
*/
function (first, second) {
if (first && second) {
var /** @type {?} */ firstValid = this.isValid(first);
var /** @type {?} */ secondValid = this.isValid(second);
if (firstValid && secondValid) {
return !this.compareDate(first, second);
}
return firstValid == secondValid;
}
return first == second;
};
/**
* Clamp the given date between min and max dates.
* @param date The date to clamp.
* @param min The minimum value to allow. If null or omitted no min is enforced.
* @param max The maximum value to allow. If null or omitted no max is enforced.
* @returns `min` if `date` is less than `min`, `max` if date is greater than `max`,
* otherwise `date`.
*/
/**
* Clamp the given date between min and max dates.
* @param {?} date The date to clamp.
* @param {?=} min The minimum value to allow. If null or omitted no min is enforced.
* @param {?=} max The maximum value to allow. If null or omitted no max is enforced.
* @return {?} `min` if `date` is less than `min`, `max` if date is greater than `max`,
* otherwise `date`.
*/
DateAdapter.prototype.clampDate = /**
* Clamp the given date between min and max dates.
* @param {?} date The date to clamp.
* @param {?=} min The minimum value to allow. If null or omitted no min is enforced.
* @param {?=} max The maximum value to allow. If null or omitted no max is enforced.
* @return {?} `min` if `date` is less than `min`, `max` if date is greater than `max`,
* otherwise `date`.
*/
function (date, min, max) {
if (min && this.compareDate(date, min) < 0) {
return min;
}
if (max && this.compareDate(date, max) > 0) {
return max;
}
return date;
};
return DateAdapter;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ MAT_DATE_FORMATS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('mat-date-formats');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Whether the browser supports the Intl API.
*/
var /** @type {?} */ SUPPORTS_INTL_API = typeof Intl != 'undefined';
/**
* The default month names to use if Intl API is not available.
*/
var /** @type {?} */ DEFAULT_MONTH_NAMES = {
'long': [
'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',
'October', 'November', 'December'
],
'short': ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
'narrow': ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D']
};
var ɵ0 = function (i) { return String(i + 1); };
/**
* The default date names to use if Intl API is not available.
*/
var /** @type {?} */ DEFAULT_DATE_NAMES = range(31, ɵ0);
/**
* The default day of the week names to use if Intl API is not available.
*/
var /** @type {?} */ DEFAULT_DAY_OF_WEEK_NAMES = {
'long': ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
'short': ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
'narrow': ['S', 'M', 'T', 'W', 'T', 'F', 'S']
};
/**
* Matches strings that have the form of a valid RFC 3339 string
* (https://tools.ietf.org/html/rfc3339). Note that the string may not actually be a valid date
* because the regex will match strings an with out of bounds month, date, etc.
*/
var /** @type {?} */ ISO_8601_REGEX = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;
/**
* Creates an array and fills it with values.
* @template T
* @param {?} length
* @param {?} valueFunction
* @return {?}
*/
function range(length, valueFunction) {
var /** @type {?} */ valuesArray = Array(length);
for (var /** @type {?} */ i = 0; i < length; i++) {
valuesArray[i] = valueFunction(i);
}
return valuesArray;
}
/**
* Adapts the native JS Date for use with cdk-based components that work with dates.
*/
var NativeDateAdapter = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(NativeDateAdapter, _super);
function NativeDateAdapter(matDateLocale, platform) {
var _this = _super.call(this) || this;
/**
* Whether to use `timeZone: 'utc'` with `Intl.DateTimeFormat` when formatting dates.
* Without this `Intl.DateTimeFormat` sometimes chooses the wrong timeZone, which can throw off
* the result. (e.g. in the en-US locale `new Date(1800, 7, 14).toLocaleDateString()`
* will produce `'8/13/1800'`.
*
* TODO(mmalerba): drop this variable. It's not being used in the code right now. We're now
* getting the string representation of a Date object from it's utc representation. We're keeping
* it here for sometime, just for precaution, in case we decide to revert some of these changes
* though.
*/
_this.useUtcForDisplay = true;
_super.prototype.setLocale.call(_this, matDateLocale);
// IE does its own time zone correction, so we disable this on IE.
// IE does its own time zone correction, so we disable this on IE.
_this.useUtcForDisplay = !platform.TRIDENT;
_this._clampDate = platform.TRIDENT || platform.EDGE;
return _this;
}
/**
* @param {?} date
* @return {?}
*/
NativeDateAdapter.prototype.getYear = /**
* @param {?} date
* @return {?}
*/
function (date) {
return date.getFullYear();
};
/**
* @param {?} date
* @return {?}
*/
NativeDateAdapter.prototype.getMonth = /**
* @param {?} date
* @return {?}
*/
function (date) {
return date.getMonth();
};
/**
* @param {?} date
* @return {?}
*/
NativeDateAdapter.prototype.getDate = /**
* @param {?} date
* @return {?}
*/
function (date) {
return date.getDate();
};
/**
* @param {?} date
* @return {?}
*/
NativeDateAdapter.prototype.getDayOfWeek = /**
* @param {?} date
* @return {?}
*/
function (date) {
return date.getDay();
};
/**
* @param {?} style
* @return {?}
*/
NativeDateAdapter.prototype.getMonthNames = /**
* @param {?} style
* @return {?}
*/
function (style) {
var _this = this;
if (SUPPORTS_INTL_API) {
var /** @type {?} */ dtf_1 = new Intl.DateTimeFormat(this.locale, { month: style, timeZone: 'utc' });
return range(12, function (i) {
return _this._stripDirectionalityCharacters(_this._format(dtf_1, new Date(2017, i, 1)));
});
}
return DEFAULT_MONTH_NAMES[style];
};
/**
* @return {?}
*/
NativeDateAdapter.prototype.getDateNames = /**
* @return {?}
*/
function () {
var _this = this;
if (SUPPORTS_INTL_API) {
var /** @type {?} */ dtf_2 = new Intl.DateTimeFormat(this.locale, { day: 'numeric', timeZone: 'utc' });
return range(31, function (i) {
return _this._stripDirectionalityCharacters(_this._format(dtf_2, new Date(2017, 0, i + 1)));
});
}
return DEFAULT_DATE_NAMES;
};
/**
* @param {?} style
* @return {?}
*/
NativeDateAdapter.prototype.getDayOfWeekNames = /**
* @param {?} style
* @return {?}
*/
function (style) {
var _this = this;
if (SUPPORTS_INTL_API) {
var /** @type {?} */ dtf_3 = new Intl.DateTimeFormat(this.locale, { weekday: style, timeZone: 'utc' });
return range(7, function (i) {
return _this._stripDirectionalityCharacters(_this._format(dtf_3, new Date(2017, 0, i + 1)));
});
}
return DEFAULT_DAY_OF_WEEK_NAMES[style];
};
/**
* @param {?} date
* @return {?}
*/
NativeDateAdapter.prototype.getYearName = /**
* @param {?} date
* @return {?}
*/
function (date) {
if (SUPPORTS_INTL_API) {
var /** @type {?} */ dtf = new Intl.DateTimeFormat(this.locale, { year: 'numeric', timeZone: 'utc' });
return this._stripDirectionalityCharacters(this._format(dtf, date));
}
return String(this.getYear(date));
};
/**
* @return {?}
*/
NativeDateAdapter.prototype.getFirstDayOfWeek = /**
* @return {?}
*/
function () {
// We can't tell using native JS Date what the first day of the week is, we default to Sunday.
return 0;
};
/**
* @param {?} date
* @return {?}
*/
NativeDateAdapter.prototype.getNumDaysInMonth = /**
* @param {?} date
* @return {?}
*/
function (date) {
return this.getDate(this._createDateWithOverflow(this.getYear(date), this.getMonth(date) + 1, 0));
};
/**
* @param {?} date
* @return {?}
*/
NativeDateAdapter.prototype.clone = /**
* @param {?} date
* @return {?}
*/
function (date) {
return this.createDate(this.getYear(date), this.getMonth(date), this.getDate(date));
};
/**
* @param {?} year
* @param {?} month
* @param {?} date
* @return {?}
*/
NativeDateAdapter.prototype.createDate = /**
* @param {?} year
* @param {?} month
* @param {?} date
* @return {?}
*/
function (year, month, date) {
// Check for invalid month and date (except upper bound on date which we have to check after
// creating the Date).
if (month < 0 || month > 11) {
throw Error("Invalid month index \"" + month + "\". Month index has to be between 0 and 11.");
}
if (date < 1) {
throw Error("Invalid date \"" + date + "\". Date has to be greater than 0.");
}
var /** @type {?} */ result = this._createDateWithOverflow(year, month, date);
// Check that the date wasn't above the upper bound for the month, causing the month to overflow
if (result.getMonth() != month) {
throw Error("Invalid date \"" + date + "\" for month with index \"" + month + "\".");
}
return result;
};
/**
* @return {?}
*/
NativeDateAdapter.prototype.today = /**
* @return {?}
*/
function () {
return new Date();
};
/**
* @param {?} value
* @return {?}
*/
NativeDateAdapter.prototype.parse = /**
* @param {?} value
* @return {?}
*/
function (value) {
// We have no way using the native JS Date to set the parse format or locale, so we ignore these
// parameters.
if (typeof value == 'number') {
return new Date(value);
}
return value ? new Date(Date.parse(value)) : null;
};
/**
* @param {?} date
* @param {?} displayFormat
* @return {?}
*/
NativeDateAdapter.prototype.format = /**
* @param {?} date
* @param {?} displayFormat
* @return {?}
*/
function (date, displayFormat) {
if (!this.isValid(date)) {
throw Error('NativeDateAdapter: Cannot format invalid date.');
}
if (SUPPORTS_INTL_API) {
// On IE and Edge the i18n API will throw a hard error that can crash the entire app
// if we attempt to format a date whose year is less than 1 or greater than 9999.
if (this._clampDate && (date.getFullYear() < 1 || date.getFullYear() > 9999)) {
date = this.clone(date);
date.setFullYear(Math.max(1, Math.min(9999, date.getFullYear())));
}
displayFormat = Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__assign"])({}, displayFormat, { timeZone: 'utc' });
var /** @type {?} */ dtf = new Intl.DateTimeFormat(this.locale, displayFormat);
return this._stripDirectionalityCharacters(this._format(dtf, date));
}
return this._stripDirectionalityCharacters(date.toDateString());
};
/**
* @param {?} date
* @param {?} years
* @return {?}
*/
NativeDateAdapter.prototype.addCalendarYears = /**
* @param {?} date
* @param {?} years
* @return {?}
*/
function (date, years) {
return this.addCalendarMonths(date, years * 12);
};
/**
* @param {?} date
* @param {?} months
* @return {?}
*/
NativeDateAdapter.prototype.addCalendarMonths = /**
* @param {?} date
* @param {?} months
* @return {?}
*/
function (date, months) {
var /** @type {?} */ newDate = this._createDateWithOverflow(this.getYear(date), this.getMonth(date) + months, this.getDate(date));
// It's possible to wind up in the wrong month if the original month has more days than the new
// month. In this case we want to go to the last day of the desired month.
// Note: the additional + 12 % 12 ensures we end up with a positive number, since JS % doesn't
// guarantee this.
if (this.getMonth(newDate) != ((this.getMonth(date) + months) % 12 + 12) % 12) {
newDate = this._createDateWithOverflow(this.getYear(newDate), this.getMonth(newDate), 0);
}
return newDate;
};
/**
* @param {?} date
* @param {?} days
* @return {?}
*/
NativeDateAdapter.prototype.addCalendarDays = /**
* @param {?} date
* @param {?} days
* @return {?}
*/
function (date, days) {
return this._createDateWithOverflow(this.getYear(date), this.getMonth(date), this.getDate(date) + days);
};
/**
* @param {?} date
* @return {?}
*/
NativeDateAdapter.prototype.toIso8601 = /**
* @param {?} date
* @return {?}
*/
function (date) {
return [
date.getUTCFullYear(),
this._2digit(date.getUTCMonth() + 1),
this._2digit(date.getUTCDate())
].join('-');
};
/**
* Returns the given value if given a valid Date or null. Deserializes valid ISO 8601 strings
* (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into null. Returns an
* invalid date for all other values.
*/
/**
* Returns the given value if given a valid Date or null. Deserializes valid ISO 8601 strings
* (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into null. Returns an
* invalid date for all other values.
* @param {?} value
* @return {?}
*/
NativeDateAdapter.prototype.deserialize = /**
* Returns the given value if given a valid Date or null. Deserializes valid ISO 8601 strings
* (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into null. Returns an
* invalid date for all other values.
* @param {?} value
* @return {?}
*/
function (value) {
if (typeof value === 'string') {
if (!value) {
return null;
}
// The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the
// string is the right format first.
if (ISO_8601_REGEX.test(value)) {
var /** @type {?} */ date = new Date(value);
if (this.isValid(date)) {
return date;
}
}
}
return _super.prototype.deserialize.call(this, value);
};
/**
* @param {?} obj
* @return {?}
*/
NativeDateAdapter.prototype.isDateInstance = /**
* @param {?} obj
* @return {?}
*/
function (obj) {
return obj instanceof Date;
};
/**
* @param {?} date
* @return {?}
*/
NativeDateAdapter.prototype.isValid = /**
* @param {?} date
* @return {?}
*/
function (date) {
return !isNaN(date.getTime());
};
/**
* @return {?}
*/
NativeDateAdapter.prototype.invalid = /**
* @return {?}
*/
function () {
return new Date(NaN);
};
/**
* Creates a date but allows the month and date to overflow.
* @param {?} year
* @param {?} month
* @param {?} date
* @return {?}
*/
NativeDateAdapter.prototype._createDateWithOverflow = /**
* Creates a date but allows the month and date to overflow.
* @param {?} year
* @param {?} month
* @param {?} date
* @return {?}
*/
function (year, month, date) {
var /** @type {?} */ result = new Date(year, month, date);
// We need to correct for the fact that JS native Date treats years in range [0, 99] as
// abbreviations for 19xx.
if (year >= 0 && year < 100) {
result.setFullYear(this.getYear(result) - 1900);
}
return result;
};
/**
* Pads a number to make it two digits.
* @param {?} n The number to pad.
* @return {?} The padded number.
*/
NativeDateAdapter.prototype._2digit = /**
* Pads a number to make it two digits.
* @param {?} n The number to pad.
* @return {?} The padded number.
*/
function (n) {
return ('00' + n).slice(-2);
};
/**
* Strip out unicode LTR and RTL characters. Edge and IE insert these into formatted dates while
* other browsers do not. We remove them to make output consistent and because they interfere with
* date parsing.
* @param {?} str The string to strip direction characters from.
* @return {?} The stripped string.
*/
NativeDateAdapter.prototype._stripDirectionalityCharacters = /**
* Strip out unicode LTR and RTL characters. Edge and IE insert these into formatted dates while
* other browsers do not. We remove them to make output consistent and because they interfere with
* date parsing.
* @param {?} str The string to strip direction characters from.
* @return {?} The stripped string.
*/
function (str) {
return str.replace(/[\u200e\u200f]/g, '');
};
/**
* When converting Date object to string, javascript built-in functions may return wrong
* results because it applies its internal DST rules. The DST rules around the world change
* very frequently, and the current valid rule is not always valid in previous years though.
* We work around this problem building a new Date object which has its internal UTC
* representation with the local date and time.
* @param {?} dtf Intl.DateTimeFormat object, containg the desired string format. It must have
* timeZone set to 'utc' to work fine.
* @param {?} date Date from which we want to get the string representation according to dtf
* @return {?} A Date object with its UTC representation based on the passed in date info
*/
NativeDateAdapter.prototype._format = /**
* When converting Date object to string, javascript built-in functions may return wrong
* results because it applies its internal DST rules. The DST rules around the world change
* very frequently, and the current valid rule is not always valid in previous years though.
* We work around this problem building a new Date object which has its internal UTC
* representation with the local date and time.
* @param {?} dtf Intl.DateTimeFormat object, containg the desired string format. It must have
* timeZone set to 'utc' to work fine.
* @param {?} date Date from which we want to get the string representation according to dtf
* @return {?} A Date object with its UTC representation based on the passed in date info
*/
function (dtf, date) {
var /** @type {?} */ d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
return dtf.format(d);
};
NativeDateAdapter.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
NativeDateAdapter.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [MAT_DATE_LOCALE,] },] },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_5__["Platform"], },
]; };
return NativeDateAdapter;
}(DateAdapter));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ MAT_NATIVE_DATE_FORMATS = {
parse: {
dateInput: null,
},
display: {
dateInput: { year: 'numeric', month: 'numeric', day: 'numeric' },
monthYearLabel: { year: 'numeric', month: 'short' },
dateA11yLabel: { year: 'numeric', month: 'long', day: 'numeric' },
monthYearA11yLabel: { year: 'numeric', month: 'long' },
}
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var NativeDateModule = /** @class */ (function () {
function NativeDateModule() {
}
NativeDateModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_5__["PlatformModule"]],
providers: [
{ provide: DateAdapter, useClass: NativeDateAdapter },
],
},] },
];
return NativeDateModule;
}());
var ɵ0$1 = MAT_NATIVE_DATE_FORMATS;
var MatNativeDateModule = /** @class */ (function () {
function MatNativeDateModule() {
}
MatNativeDateModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [NativeDateModule],
providers: [{ provide: MAT_DATE_FORMATS, useValue: ɵ0$1 }],
},] },
];
return MatNativeDateModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Error state matcher that matches when a control is invalid and dirty.
*/
var ShowOnDirtyErrorStateMatcher = /** @class */ (function () {
function ShowOnDirtyErrorStateMatcher() {
}
/**
* @param {?} control
* @param {?} form
* @return {?}
*/
ShowOnDirtyErrorStateMatcher.prototype.isErrorState = /**
* @param {?} control
* @param {?} form
* @return {?}
*/
function (control, form) {
return !!(control && control.invalid && (control.dirty || (form && form.submitted)));
};
ShowOnDirtyErrorStateMatcher.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
return ShowOnDirtyErrorStateMatcher;
}());
/**
* Provider that defines how form controls behave with regards to displaying error messages.
*/
var ErrorStateMatcher = /** @class */ (function () {
function ErrorStateMatcher() {
}
/**
* @param {?} control
* @param {?} form
* @return {?}
*/
ErrorStateMatcher.prototype.isErrorState = /**
* @param {?} control
* @param {?} form
* @return {?}
*/
function (control, form) {
return !!(control && control.invalid && (control.touched || (form && form.submitted)));
};
ErrorStateMatcher.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */ ErrorStateMatcher.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["defineInjectable"])({ factory: function ErrorStateMatcher_Factory() { return new ErrorStateMatcher(); }, token: ErrorStateMatcher, providedIn: "root" });
return ErrorStateMatcher;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token that can be used to provide options to the Hammerjs instance.
* More info at http://hammerjs.github.io/api/.
*/
var /** @type {?} */ MAT_HAMMER_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('MAT_HAMMER_OPTIONS');
/**
* Adjusts configuration of our gesture library, Hammer.
*/
var GestureConfig = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(GestureConfig, _super);
function GestureConfig(_hammerOptions, commonModule) {
var _this = _super.call(this) || this;
_this._hammerOptions = _hammerOptions;
_this._hammer = typeof window !== 'undefined' ? (/** @type {?} */ (window)).Hammer : null;
/**
* List of new event names to add to the gesture support list
*/
_this.events = _this._hammer ? [
'longpress',
'slide',
'slidestart',
'slideend',
'slideright',
'slideleft'
] : [];
if (commonModule) {
commonModule._checkHammerIsAvailable();
}
return _this;
}
/**
* Builds Hammer instance manually to add custom recognizers that match the Material Design spec.
*
* Our gesture names come from the Material Design gestures spec:
* https://material.io/design/#gestures-touch-mechanics
*
* More information on default recognizers can be found in Hammer docs:
* http://hammerjs.github.io/recognizer-pan/
* http://hammerjs.github.io/recognizer-press/
*
* @param element Element to which to assign the new HammerJS gestures.
* @returns Newly-created HammerJS instance.
*/
/**
* Builds Hammer instance manually to add custom recognizers that match the Material Design spec.
*
* Our gesture names come from the Material Design gestures spec:
* https://material.io/design/#gestures-touch-mechanics
*
* More information on default recognizers can be found in Hammer docs:
* http://hammerjs.github.io/recognizer-pan/
* http://hammerjs.github.io/recognizer-press/
*
* @param {?} element Element to which to assign the new HammerJS gestures.
* @return {?} Newly-created HammerJS instance.
*/
GestureConfig.prototype.buildHammer = /**
* Builds Hammer instance manually to add custom recognizers that match the Material Design spec.
*
* Our gesture names come from the Material Design gestures spec:
* https://material.io/design/#gestures-touch-mechanics
*
* More information on default recognizers can be found in Hammer docs:
* http://hammerjs.github.io/recognizer-pan/
* http://hammerjs.github.io/recognizer-press/
*
* @param {?} element Element to which to assign the new HammerJS gestures.
* @return {?} Newly-created HammerJS instance.
*/
function (element) {
var /** @type {?} */ mc = new this._hammer(element, this._hammerOptions || undefined);
// Default Hammer Recognizers.
var /** @type {?} */ pan = new this._hammer.Pan();
var /** @type {?} */ swipe = new this._hammer.Swipe();
var /** @type {?} */ press = new this._hammer.Press();
// Notice that a HammerJS recognizer can only depend on one other recognizer once.
// Otherwise the previous `recognizeWith` will be dropped.
// TODO: Confirm threshold numbers with Material Design UX Team
var /** @type {?} */ slide = this._createRecognizer(pan, { event: 'slide', threshold: 0 }, swipe);
var /** @type {?} */ longpress = this._createRecognizer(press, { event: 'longpress', time: 500 });
// Overwrite the default `pan` event to use the swipe event.
pan.recognizeWith(swipe);
// Add customized gestures to Hammer manager
mc.add([swipe, press, pan, slide, longpress]);
return /** @type {?} */ (mc);
};
/**
* Creates a new recognizer, without affecting the default recognizers of HammerJS
* @param {?} base
* @param {?} options
* @param {...?} inheritances
* @return {?}
*/
GestureConfig.prototype._createRecognizer = /**
* Creates a new recognizer, without affecting the default recognizers of HammerJS
* @param {?} base
* @param {?} options
* @param {...?} inheritances
* @return {?}
*/
function (base, options) {
var inheritances = [];
for (var _i = 2; _i < arguments.length; _i++) {
inheritances[_i - 2] = arguments[_i];
}
var /** @type {?} */ recognizer = new (/** @type {?} */ (base.constructor))(options);
inheritances.push(base);
inheritances.forEach(function (item) { return recognizer.recognizeWith(item); });
return recognizer;
};
GestureConfig.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] },
];
/** @nocollapse */
GestureConfig.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [MAT_HAMMER_OPTIONS,] },] },
{ type: MatCommonModule, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
return GestureConfig;
}(_angular_platform_browser__WEBPACK_IMPORTED_MODULE_6__["HammerGestureConfig"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Shared directive to count lines inside a text area, such as a list item.
* Line elements can be extracted with a \@ContentChildren(MatLine) query, then
* counted by checking the query list's length.
*/
var MatLine = /** @class */ (function () {
function MatLine() {
}
MatLine.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[mat-line], [matLine]',
host: { 'class': 'mat-line' }
},] },
];
return MatLine;
}());
/**
* Helper that takes a query list of lines and sets the correct class on the host.
* \@docs-private
*/
var /**
* Helper that takes a query list of lines and sets the correct class on the host.
* \@docs-private
*/
MatLineSetter = /** @class */ (function () {
function MatLineSetter(_lines, _element) {
var _this = this;
this._lines = _lines;
this._element = _element;
this._setLineClass(this._lines.length);
this._lines.changes.subscribe(function () {
_this._setLineClass(_this._lines.length);
});
}
/**
* @param {?} count
* @return {?}
*/
MatLineSetter.prototype._setLineClass = /**
* @param {?} count
* @return {?}
*/
function (count) {
this._resetClasses();
if (count === 2 || count === 3) {
this._setClass("mat-" + count + "-line", true);
}
else if (count > 3) {
this._setClass("mat-multi-line", true);
}
};
/**
* @return {?}
*/
MatLineSetter.prototype._resetClasses = /**
* @return {?}
*/
function () {
this._setClass('mat-2-line', false);
this._setClass('mat-3-line', false);
this._setClass('mat-multi-line', false);
};
/**
* @param {?} className
* @param {?} isAdd
* @return {?}
*/
MatLineSetter.prototype._setClass = /**
* @param {?} className
* @param {?} isAdd
* @return {?}
*/
function (className, isAdd) {
if (isAdd) {
this._element.nativeElement.classList.add(className);
}
else {
this._element.nativeElement.classList.remove(className);
}
};
return MatLineSetter;
}());
var MatLineModule = /** @class */ (function () {
function MatLineModule() {
}
MatLineModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [MatCommonModule],
exports: [MatLine, MatCommonModule],
declarations: [MatLine],
},] },
];
return MatLineModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/** @enum {number} */
var RippleState = {
FADING_IN: 0,
VISIBLE: 1,
FADING_OUT: 2,
HIDDEN: 3,
};
RippleState[RippleState.FADING_IN] = "FADING_IN";
RippleState[RippleState.VISIBLE] = "VISIBLE";
RippleState[RippleState.FADING_OUT] = "FADING_OUT";
RippleState[RippleState.HIDDEN] = "HIDDEN";
/**
* Reference to a previously launched ripple element.
*/
var /**
* Reference to a previously launched ripple element.
*/
RippleRef = /** @class */ (function () {
function RippleRef(_renderer, element, config) {
this._renderer = _renderer;
this.element = element;
this.config = config;
/**
* Current state of the ripple reference.
*/
this.state = RippleState.HIDDEN;
}
/** Fades out the ripple element. */
/**
* Fades out the ripple element.
* @return {?}
*/
RippleRef.prototype.fadeOut = /**
* Fades out the ripple element.
* @return {?}
*/
function () {
this._renderer.fadeOutRipple(this);
};
return RippleRef;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Default ripple animation configuration for ripples without an explicit
* animation config specified.
*/
var /** @type {?} */ defaultRippleAnimationConfig = {
enterDuration: 450,
exitDuration: 400
};
/**
* Timeout for ignoring mouse events. Mouse events will be temporary ignored after touch
* events to avoid synthetic mouse events.
*/
var /** @type {?} */ ignoreMouseEventsTimeout = 800;
/**
* Helper service that performs DOM manipulations. Not intended to be used outside this module.
* The constructor takes a reference to the ripple directive's host element and a map of DOM
* event handlers to be installed on the element that triggers ripple animations.
* This will eventually become a custom renderer once Angular support exists.
* \@docs-private
*/
var /**
* Helper service that performs DOM manipulations. Not intended to be used outside this module.
* The constructor takes a reference to the ripple directive's host element and a map of DOM
* event handlers to be installed on the element that triggers ripple animations.
* This will eventually become a custom renderer once Angular support exists.
* \@docs-private
*/
RippleRenderer = /** @class */ (function () {
function RippleRenderer(_target, _ngZone, elementRef, platform) {
var _this = this;
this._target = _target;
this._ngZone = _ngZone;
/**
* Whether the pointer is currently down or not.
*/
this._isPointerDown = false;
/**
* Events to be registered on the trigger element.
*/
this._triggerEvents = new Map();
/**
* Set of currently active ripple references.
*/
this._activeRipples = new Set();
/**
* Options that apply to all the event listeners that are bound by the renderer.
*/
this._eventOptions = Object(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_5__["supportsPassiveEventListeners"])() ? (/** @type {?} */ ({ passive: true })) : false;
/**
* Function being called whenever the trigger is being pressed using mouse.
*/
this.onMousedown = function (event) {
var /** @type {?} */ isSyntheticEvent = _this._lastTouchStartEvent &&
Date.now() < _this._lastTouchStartEvent + ignoreMouseEventsTimeout;
if (!_this._target.rippleDisabled && !isSyntheticEvent) {
_this._isPointerDown = true;
_this.fadeInRipple(event.clientX, event.clientY, _this._target.rippleConfig);
}
};
/**
* Function being called whenever the trigger is being pressed using touch.
*/
this.onTouchStart = function (event) {
if (!_this._target.rippleDisabled) {
// Some browsers fire mouse events after a `touchstart` event. Those synthetic mouse
// events will launch a second ripple if we don't ignore mouse events for a specific
// time after a touchstart event.
// Some browsers fire mouse events after a `touchstart` event. Those synthetic mouse
// events will launch a second ripple if we don't ignore mouse events for a specific
// time after a touchstart event.
_this._lastTouchStartEvent = Date.now();
_this._isPointerDown = true;
_this.fadeInRipple(event.touches[0].clientX, event.touches[0].clientY, _this._target.rippleConfig);
}
};
/**
* Function being called whenever the trigger is being released.
*/
this.onPointerUp = function () {
if (!_this._isPointerDown) {
return;
}
_this._isPointerDown = false;
// Fade-out all ripples that are visible and not persistent.
// Fade-out all ripples that are visible and not persistent.
_this._activeRipples.forEach(function (ripple) {
// By default, only ripples that are completely visible will fade out on pointer release.
// If the `terminateOnPointerUp` option is set, ripples that still fade in will also fade out.
var /** @type {?} */ isVisible = ripple.state === RippleState.VISIBLE ||
ripple.config.terminateOnPointerUp && ripple.state === RippleState.FADING_IN;
if (!ripple.config.persistent && isVisible) {
ripple.fadeOut();
}
});
};
// Only do anything if we're on the browser.
if (platform.isBrowser) {
this._containerElement = elementRef.nativeElement;
// Specify events which need to be registered on the trigger.
this._triggerEvents.set('mousedown', this.onMousedown);
this._triggerEvents.set('mouseup', this.onPointerUp);
this._triggerEvents.set('mouseleave', this.onPointerUp);
this._triggerEvents.set('touchstart', this.onTouchStart);
this._triggerEvents.set('touchend', this.onPointerUp);
}
}
/**
* Fades in a ripple at the given coordinates.
* @param x Coordinate within the element, along the X axis at which to start the ripple.
* @param y Coordinate within the element, along the Y axis at which to start the ripple.
* @param config Extra ripple options.
*/
/**
* Fades in a ripple at the given coordinates.
* @param {?} x Coordinate within the element, along the X axis at which to start the ripple.
* @param {?} y Coordinate within the element, along the Y axis at which to start the ripple.
* @param {?=} config Extra ripple options.
* @return {?}
*/
RippleRenderer.prototype.fadeInRipple = /**
* Fades in a ripple at the given coordinates.
* @param {?} x Coordinate within the element, along the X axis at which to start the ripple.
* @param {?} y Coordinate within the element, along the Y axis at which to start the ripple.
* @param {?=} config Extra ripple options.
* @return {?}
*/
function (x, y, config) {
var _this = this;
if (config === void 0) { config = {}; }
var /** @type {?} */ containerRect = this._containerRect =
this._containerRect || this._containerElement.getBoundingClientRect();
var /** @type {?} */ animationConfig = Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__assign"])({}, defaultRippleAnimationConfig, config.animation);
if (config.centered) {
x = containerRect.left + containerRect.width / 2;
y = containerRect.top + containerRect.height / 2;
}
var /** @type {?} */ radius = config.radius || distanceToFurthestCorner(x, y, containerRect);
var /** @type {?} */ offsetX = x - containerRect.left;
var /** @type {?} */ offsetY = y - containerRect.top;
var /** @type {?} */ duration = animationConfig.enterDuration / (config.speedFactor || 1);
var /** @type {?} */ ripple = document.createElement('div');
ripple.classList.add('mat-ripple-element');
ripple.style.left = offsetX - radius + "px";
ripple.style.top = offsetY - radius + "px";
ripple.style.height = radius * 2 + "px";
ripple.style.width = radius * 2 + "px";
// If the color is not set, the default CSS color will be used.
ripple.style.backgroundColor = config.color || null;
ripple.style.transitionDuration = duration + "ms";
this._containerElement.appendChild(ripple);
// By default the browser does not recalculate the styles of dynamically created
// ripple elements. This is critical because then the `scale` would not animate properly.
enforceStyleRecalculation(ripple);
ripple.style.transform = 'scale(1)';
// Exposed reference to the ripple that will be returned.
var /** @type {?} */ rippleRef = new RippleRef(this, ripple, config);
rippleRef.state = RippleState.FADING_IN;
// Add the ripple reference to the list of all active ripples.
this._activeRipples.add(rippleRef);
if (!config.persistent) {
this._mostRecentTransientRipple = rippleRef;
}
// Wait for the ripple element to be completely faded in.
// Once it's faded in, the ripple can be hidden immediately if the mouse is released.
this.runTimeoutOutsideZone(function () {
var /** @type {?} */ isMostRecentTransientRipple = rippleRef === _this._mostRecentTransientRipple;
rippleRef.state = RippleState.VISIBLE;
// When the timer runs out while the user has kept their pointer down, we want to
// keep only the persistent ripples and the latest transient ripple. We do this,
// because we don't want stacked transient ripples to appear after their enter
// animation has finished.
if (!config.persistent && (!isMostRecentTransientRipple || !_this._isPointerDown)) {
rippleRef.fadeOut();
}
}, duration);
return rippleRef;
};
/** Fades out a ripple reference. */
/**
* Fades out a ripple reference.
* @param {?} rippleRef
* @return {?}
*/
RippleRenderer.prototype.fadeOutRipple = /**
* Fades out a ripple reference.
* @param {?} rippleRef
* @return {?}
*/
function (rippleRef) {
var /** @type {?} */ wasActive = this._activeRipples.delete(rippleRef);
if (rippleRef === this._mostRecentTransientRipple) {
this._mostRecentTransientRipple = null;
}
// Clear out the cached bounding rect if we have no more ripples.
if (!this._activeRipples.size) {
this._containerRect = null;
}
// For ripples that are not active anymore, don't re-un the fade-out animation.
if (!wasActive) {
return;
}
var /** @type {?} */ rippleEl = rippleRef.element;
var /** @type {?} */ animationConfig = Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__assign"])({}, defaultRippleAnimationConfig, rippleRef.config.animation);
rippleEl.style.transitionDuration = animationConfig.exitDuration + "ms";
rippleEl.style.opacity = '0';
rippleRef.state = RippleState.FADING_OUT;
// Once the ripple faded out, the ripple can be safely removed from the DOM.
this.runTimeoutOutsideZone(function () {
rippleRef.state = RippleState.HIDDEN; /** @type {?} */
((rippleEl.parentNode)).removeChild(rippleEl);
}, animationConfig.exitDuration);
};
/** Fades out all currently active ripples. */
/**
* Fades out all currently active ripples.
* @return {?}
*/
RippleRenderer.prototype.fadeOutAll = /**
* Fades out all currently active ripples.
* @return {?}
*/
function () {
this._activeRipples.forEach(function (ripple) { return ripple.fadeOut(); });
};
/** Sets up the trigger event listeners */
/**
* Sets up the trigger event listeners
* @param {?} element
* @return {?}
*/
RippleRenderer.prototype.setupTriggerEvents = /**
* Sets up the trigger event listeners
* @param {?} element
* @return {?}
*/
function (element) {
var _this = this;
if (!element || element === this._triggerElement) {
return;
}
// Remove all previously registered event listeners from the trigger element.
this._removeTriggerEvents();
this._ngZone.runOutsideAngular(function () {
_this._triggerEvents.forEach(function (fn, type) {
return element.addEventListener(type, fn, _this._eventOptions);
});
});
this._triggerElement = element;
};
/**
* Runs a timeout outside of the Angular zone to avoid triggering the change detection.
* @param {?} fn
* @param {?=} delay
* @return {?}
*/
RippleRenderer.prototype.runTimeoutOutsideZone = /**
* Runs a timeout outside of the Angular zone to avoid triggering the change detection.
* @param {?} fn
* @param {?=} delay
* @return {?}
*/
function (fn, delay) {
if (delay === void 0) { delay = 0; }
this._ngZone.runOutsideAngular(function () { return setTimeout(fn, delay); });
};
/** Removes previously registered event listeners from the trigger element. */
/**
* Removes previously registered event listeners from the trigger element.
* @return {?}
*/
RippleRenderer.prototype._removeTriggerEvents = /**
* Removes previously registered event listeners from the trigger element.
* @return {?}
*/
function () {
var _this = this;
if (this._triggerElement) {
this._triggerEvents.forEach(function (fn, type) {
/** @type {?} */ ((_this._triggerElement)).removeEventListener(type, fn, _this._eventOptions);
});
}
};
return RippleRenderer;
}());
/**
* Enforces a style recalculation of a DOM element by computing its styles.
* @param {?} element
* @return {?}
*/
function enforceStyleRecalculation(element) {
// Enforce a style recalculation by calling `getComputedStyle` and accessing any property.
// Calling `getPropertyValue` is important to let optimizers know that this is not a noop.
// See: https://gist.github.com/paulirish/5d52fb081b3570c81e3a
window.getComputedStyle(element).getPropertyValue('opacity');
}
/**
* Returns the distance from the point (x, y) to the furthest corner of a rectangle.
* @param {?} x
* @param {?} y
* @param {?} rect
* @return {?}
*/
function distanceToFurthestCorner(x, y, rect) {
var /** @type {?} */ distX = Math.max(Math.abs(x - rect.left), Math.abs(x - rect.right));
var /** @type {?} */ distY = Math.max(Math.abs(y - rect.top), Math.abs(y - rect.bottom));
return Math.sqrt(distX * distX + distY * distY);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token that can be used to specify the global ripple options.
*/
var /** @type {?} */ MAT_RIPPLE_GLOBAL_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('mat-ripple-global-options');
var MatRipple = /** @class */ (function () {
function MatRipple(_elementRef, ngZone, platform, globalOptions, _animationMode) {
this._elementRef = _elementRef;
this._animationMode = _animationMode;
/**
* If set, the radius in pixels of foreground ripples when fully expanded. If unset, the radius
* will be the distance from the center of the ripple to the furthest corner of the host element's
* bounding rectangle.
*/
this.radius = 0;
/**
* If set, the normal duration of ripple animations is divided by this value. For example,
* setting it to 0.5 will cause the animations to take twice as long.
* A changed speedFactor will not modify the fade-out duration of the ripples.
* @deprecated Use the [matRippleAnimation] binding instead.
* \@deletion-target 7.0.0
*/
this.speedFactor = 1;
this._disabled = false;
/**
* Whether ripple directive is initialized and the input bindings are set.
*/
this._isInitialized = false;
this._globalOptions = globalOptions || {};
this._rippleRenderer = new RippleRenderer(this, ngZone, _elementRef, platform);
}
Object.defineProperty(MatRipple.prototype, "disabled", {
get: /**
* Whether click events will not trigger the ripple. Ripples can be still launched manually
* by using the `launch()` method.
* @return {?}
*/
function () { return this._disabled; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._disabled = value;
this._setupTriggerEventsIfEnabled();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatRipple.prototype, "trigger", {
get: /**
* The element that triggers the ripple when click events are received.
* Defaults to the directive's host element.
* @return {?}
*/
function () { return this._trigger || this._elementRef.nativeElement; },
set: /**
* @param {?} trigger
* @return {?}
*/
function (trigger) {
this._trigger = trigger;
this._setupTriggerEventsIfEnabled();
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatRipple.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._isInitialized = true;
this._setupTriggerEventsIfEnabled();
};
/**
* @return {?}
*/
MatRipple.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._rippleRenderer._removeTriggerEvents();
};
/** Fades out all currently showing ripple elements. */
/**
* Fades out all currently showing ripple elements.
* @return {?}
*/
MatRipple.prototype.fadeOutAll = /**
* Fades out all currently showing ripple elements.
* @return {?}
*/
function () {
this._rippleRenderer.fadeOutAll();
};
Object.defineProperty(MatRipple.prototype, "rippleConfig", {
/** Ripple configuration from the directive's input values. */
get: /**
* Ripple configuration from the directive's input values.
* @return {?}
*/
function () {
return {
centered: this.centered,
radius: this.radius,
color: this.color,
animation: this._animationMode === 'NoopAnimations' ?
{ enterDuration: 0, exitDuration: 0 } : Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__assign"])({}, this._globalOptions.animation, this.animation),
terminateOnPointerUp: this._globalOptions.terminateOnPointerUp,
speedFactor: this.speedFactor * (this._globalOptions.baseSpeedFactor || 1),
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatRipple.prototype, "rippleDisabled", {
/** Whether ripples on pointer-down are disabled or not. */
get: /**
* Whether ripples on pointer-down are disabled or not.
* @return {?}
*/
function () {
return this.disabled || !!this._globalOptions.disabled;
},
enumerable: true,
configurable: true
});
/**
* Sets up the the trigger event listeners if ripples are enabled.
* @return {?}
*/
MatRipple.prototype._setupTriggerEventsIfEnabled = /**
* Sets up the the trigger event listeners if ripples are enabled.
* @return {?}
*/
function () {
if (!this.disabled && this._isInitialized) {
this._rippleRenderer.setupTriggerEvents(this.trigger);
}
};
/** Launches a manual ripple at the specified coordinated or just by the ripple config. */
/**
* Launches a manual ripple at the specified coordinated or just by the ripple config.
* @param {?} configOrX
* @param {?=} y
* @param {?=} config
* @return {?}
*/
MatRipple.prototype.launch = /**
* Launches a manual ripple at the specified coordinated or just by the ripple config.
* @param {?} configOrX
* @param {?=} y
* @param {?=} config
* @return {?}
*/
function (configOrX, y, config) {
if (y === void 0) { y = 0; }
if (typeof configOrX === 'number') {
return this._rippleRenderer.fadeInRipple(configOrX, y, Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__assign"])({}, this.rippleConfig, config));
}
else {
return this._rippleRenderer.fadeInRipple(0, 0, Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__assign"])({}, this.rippleConfig, configOrX));
}
};
MatRipple.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[mat-ripple], [matRipple]',
exportAs: 'matRipple',
host: {
'class': 'mat-ripple',
'[class.mat-ripple-unbounded]': 'unbounded'
}
},] },
];
/** @nocollapse */
MatRipple.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_5__["Platform"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [MAT_RIPPLE_GLOBAL_OPTIONS,] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_7__["ANIMATION_MODULE_TYPE"],] },] },
]; };
MatRipple.propDecorators = {
"color": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matRippleColor',] },],
"unbounded": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matRippleUnbounded',] },],
"centered": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matRippleCentered',] },],
"radius": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matRippleRadius',] },],
"speedFactor": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matRippleSpeedFactor',] },],
"animation": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matRippleAnimation',] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matRippleDisabled',] },],
"trigger": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matRippleTrigger',] },],
};
return MatRipple;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatRippleModule = /** @class */ (function () {
function MatRippleModule() {
}
MatRippleModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [MatCommonModule, _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_5__["PlatformModule"]],
exports: [MatRipple, MatCommonModule],
declarations: [MatRipple],
},] },
];
return MatRippleModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Component that shows a simplified checkbox without including any kind of "real" checkbox.
* Meant to be used when the checkbox is purely decorative and a large number of them will be
* included, such as for the options in a multi-select. Uses no SVGs or complex animations.
* Note that theming is meant to be handled by the parent element, e.g.
* `mat-primary .mat-pseudo-checkbox`.
*
* Note that this component will be completely invisible to screen-reader users. This is *not*
* interchangeable with `<mat-checkbox>` and should *not* be used if the user would directly
* interact with the checkbox. The pseudo-checkbox should only be used as an implementation detail
* of more complex components that appropriately handle selected / checked state.
* \@docs-private
*/
var MatPseudoCheckbox = /** @class */ (function () {
function MatPseudoCheckbox() {
/**
* Display state of the checkbox.
*/
this.state = 'unchecked';
/**
* Whether the checkbox is disabled.
*/
this.disabled = false;
}
MatPseudoCheckbox.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
selector: 'mat-pseudo-checkbox',
styles: [".mat-pseudo-checkbox{width:20px;height:20px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0,0,.2,.1),background-color 90ms cubic-bezier(0,0,.2,.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:'';border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0,0,.2,.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:9px;left:2px;width:16px;opacity:1}.mat-pseudo-checkbox-checked::after{top:5px;left:3px;width:12px;height:5px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1}"],
template: '',
host: {
'class': 'mat-pseudo-checkbox',
'[class.mat-pseudo-checkbox-indeterminate]': 'state === "indeterminate"',
'[class.mat-pseudo-checkbox-checked]': 'state === "checked"',
'[class.mat-pseudo-checkbox-disabled]': 'disabled',
},
},] },
];
/** @nocollapse */
MatPseudoCheckbox.propDecorators = {
"state": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatPseudoCheckbox;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatPseudoCheckboxModule = /** @class */ (function () {
function MatPseudoCheckboxModule() {
}
MatPseudoCheckboxModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
exports: [MatPseudoCheckbox],
declarations: [MatPseudoCheckbox]
},] },
];
return MatPseudoCheckboxModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatOptgroupBase = /** @class */ (function () {
function MatOptgroupBase() {
}
return MatOptgroupBase;
}());
var /** @type {?} */ _MatOptgroupMixinBase = mixinDisabled(MatOptgroupBase);
// Counter for unique group ids.
var /** @type {?} */ _uniqueOptgroupIdCounter = 0;
/**
* Component that is used to group instances of `mat-option`.
*/
var MatOptgroup = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(MatOptgroup, _super);
function MatOptgroup() {
var _this = _super !== null && _super.apply(this, arguments) || this;
/**
* Unique id for the underlying label.
*/
_this._labelId = "mat-optgroup-label-" + _uniqueOptgroupIdCounter++;
return _this;
}
MatOptgroup.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-optgroup',
exportAs: 'matOptgroup',
template: "<label class=\"mat-optgroup-label\" [id]=\"_labelId\">{{ label }}</label><ng-content select=\"mat-option, ng-container\"></ng-content>",
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
inputs: ['disabled'],
styles: [".mat-optgroup-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup-label[disabled]{cursor:default}[dir=rtl] .mat-optgroup-label{text-align:right}.mat-optgroup-label .mat-icon{margin-right:16px;vertical-align:middle}.mat-optgroup-label .mat-icon svg{vertical-align:top}[dir=rtl] .mat-optgroup-label .mat-icon{margin-left:16px;margin-right:0}"],
host: {
'class': 'mat-optgroup',
'role': 'group',
'[class.mat-optgroup-disabled]': 'disabled',
'[attr.aria-disabled]': 'disabled.toString()',
'[attr.aria-labelledby]': '_labelId',
}
},] },
];
/** @nocollapse */
MatOptgroup.propDecorators = {
"label": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatOptgroup;
}(_MatOptgroupMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Option IDs need to be unique across components, so this counter exists outside of
* the component definition.
*/
var /** @type {?} */ _uniqueIdCounter = 0;
/**
* Event object emitted by MatOption when selected or deselected.
*/
var /**
* Event object emitted by MatOption when selected or deselected.
*/
MatOptionSelectionChange = /** @class */ (function () {
function MatOptionSelectionChange(source, isUserInput) {
if (isUserInput === void 0) { isUserInput = false; }
this.source = source;
this.isUserInput = isUserInput;
}
return MatOptionSelectionChange;
}());
/**
* Injection token used to provide the parent component to options.
*/
var /** @type {?} */ MAT_OPTION_PARENT_COMPONENT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('MAT_OPTION_PARENT_COMPONENT');
/**
* Single option inside of a `<mat-select>` element.
*/
var MatOption = /** @class */ (function () {
function MatOption(_element, _changeDetectorRef, _parent, group) {
this._element = _element;
this._changeDetectorRef = _changeDetectorRef;
this._parent = _parent;
this.group = group;
this._selected = false;
this._active = false;
this._disabled = false;
this._id = "mat-option-" + _uniqueIdCounter++;
this._mostRecentViewValue = '';
/**
* Event emitted when the option is selected or deselected.
*/
this.onSelectionChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits when the state of the option changes and any parents have to be notified.
*/
this._stateChanges = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
}
Object.defineProperty(MatOption.prototype, "multiple", {
/** Whether the wrapping component is in multiple selection mode. */
get: /**
* Whether the wrapping component is in multiple selection mode.
* @return {?}
*/
function () { return this._parent && this._parent.multiple; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatOption.prototype, "id", {
/** The unique ID of the option. */
get: /**
* The unique ID of the option.
* @return {?}
*/
function () { return this._id; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatOption.prototype, "selected", {
/** Whether or not the option is currently selected. */
get: /**
* Whether or not the option is currently selected.
* @return {?}
*/
function () { return this._selected; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatOption.prototype, "disabled", {
get: /**
* Whether the option is disabled.
* @return {?}
*/
function () { return (this.group && this.group.disabled) || this._disabled; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._disabled = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatOption.prototype, "disableRipple", {
/** Whether ripples for the option are disabled. */
get: /**
* Whether ripples for the option are disabled.
* @return {?}
*/
function () { return this._parent && this._parent.disableRipple; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatOption.prototype, "active", {
/**
* Whether or not the option is currently active and ready to be selected.
* An active option displays styles as if it is focused, but the
* focus is actually retained somewhere else. This comes in handy
* for components like autocomplete where focus must remain on the input.
*/
get: /**
* Whether or not the option is currently active and ready to be selected.
* An active option displays styles as if it is focused, but the
* focus is actually retained somewhere else. This comes in handy
* for components like autocomplete where focus must remain on the input.
* @return {?}
*/
function () {
return this._active;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatOption.prototype, "viewValue", {
/**
* The displayed value of the option. It is necessary to show the selected option in the
* select's trigger.
*/
get: /**
* The displayed value of the option. It is necessary to show the selected option in the
* select's trigger.
* @return {?}
*/
function () {
// TODO(kara): Add input property alternative for node envs.
return (this._getHostElement().textContent || '').trim();
},
enumerable: true,
configurable: true
});
/** Selects the option. */
/**
* Selects the option.
* @return {?}
*/
MatOption.prototype.select = /**
* Selects the option.
* @return {?}
*/
function () {
this._selected = true;
this._changeDetectorRef.markForCheck();
this._emitSelectionChangeEvent();
};
/** Deselects the option. */
/**
* Deselects the option.
* @return {?}
*/
MatOption.prototype.deselect = /**
* Deselects the option.
* @return {?}
*/
function () {
this._selected = false;
this._changeDetectorRef.markForCheck();
this._emitSelectionChangeEvent();
};
/** Sets focus onto this option. */
/**
* Sets focus onto this option.
* @return {?}
*/
MatOption.prototype.focus = /**
* Sets focus onto this option.
* @return {?}
*/
function () {
var /** @type {?} */ element = this._getHostElement();
if (typeof element.focus === 'function') {
element.focus();
}
};
/**
* This method sets display styles on the option to make it appear
* active. This is used by the ActiveDescendantKeyManager so key
* events will display the proper options as active on arrow key events.
*/
/**
* This method sets display styles on the option to make it appear
* active. This is used by the ActiveDescendantKeyManager so key
* events will display the proper options as active on arrow key events.
* @return {?}
*/
MatOption.prototype.setActiveStyles = /**
* This method sets display styles on the option to make it appear
* active. This is used by the ActiveDescendantKeyManager so key
* events will display the proper options as active on arrow key events.
* @return {?}
*/
function () {
if (!this._active) {
this._active = true;
this._changeDetectorRef.markForCheck();
}
};
/**
* This method removes display styles on the option that made it appear
* active. This is used by the ActiveDescendantKeyManager so key
* events will display the proper options as active on arrow key events.
*/
/**
* This method removes display styles on the option that made it appear
* active. This is used by the ActiveDescendantKeyManager so key
* events will display the proper options as active on arrow key events.
* @return {?}
*/
MatOption.prototype.setInactiveStyles = /**
* This method removes display styles on the option that made it appear
* active. This is used by the ActiveDescendantKeyManager so key
* events will display the proper options as active on arrow key events.
* @return {?}
*/
function () {
if (this._active) {
this._active = false;
this._changeDetectorRef.markForCheck();
}
};
/** Gets the label to be used when determining whether the option should be focused. */
/**
* Gets the label to be used when determining whether the option should be focused.
* @return {?}
*/
MatOption.prototype.getLabel = /**
* Gets the label to be used when determining whether the option should be focused.
* @return {?}
*/
function () {
return this.viewValue;
};
/** Ensures the option is selected when activated from the keyboard. */
/**
* Ensures the option is selected when activated from the keyboard.
* @param {?} event
* @return {?}
*/
MatOption.prototype._handleKeydown = /**
* Ensures the option is selected when activated from the keyboard.
* @param {?} event
* @return {?}
*/
function (event) {
if (event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_8__["ENTER"] || event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_8__["SPACE"]) {
this._selectViaInteraction();
// Prevent the page from scrolling down and form submits.
event.preventDefault();
}
};
/**
* `Selects the option while indicating the selection came from the user. Used to
* determine if the select's view -> model callback should be invoked.`
*/
/**
* `Selects the option while indicating the selection came from the user. Used to
* determine if the select's view -> model callback should be invoked.`
* @return {?}
*/
MatOption.prototype._selectViaInteraction = /**
* `Selects the option while indicating the selection came from the user. Used to
* determine if the select's view -> model callback should be invoked.`
* @return {?}
*/
function () {
if (!this.disabled) {
this._selected = this.multiple ? !this._selected : true;
this._changeDetectorRef.markForCheck();
this._emitSelectionChangeEvent(true);
}
};
/** Returns the correct tabindex for the option depending on disabled state. */
/**
* Returns the correct tabindex for the option depending on disabled state.
* @return {?}
*/
MatOption.prototype._getTabIndex = /**
* Returns the correct tabindex for the option depending on disabled state.
* @return {?}
*/
function () {
return this.disabled ? '-1' : '0';
};
/** Gets the host DOM element. */
/**
* Gets the host DOM element.
* @return {?}
*/
MatOption.prototype._getHostElement = /**
* Gets the host DOM element.
* @return {?}
*/
function () {
return this._element.nativeElement;
};
/**
* @return {?}
*/
MatOption.prototype.ngAfterViewChecked = /**
* @return {?}
*/
function () {
// Since parent components could be using the option's label to display the selected values
// (e.g. `mat-select`) and they don't have a way of knowing if the option's label has changed
// we have to check for changes in the DOM ourselves and dispatch an event. These checks are
// relatively cheap, however we still limit them only to selected options in order to avoid
// hitting the DOM too often.
if (this._selected) {
var /** @type {?} */ viewValue = this.viewValue;
if (viewValue !== this._mostRecentViewValue) {
this._mostRecentViewValue = viewValue;
this._stateChanges.next();
}
}
};
/**
* @return {?}
*/
MatOption.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._stateChanges.complete();
};
/**
* Emits the selection change event.
* @param {?=} isUserInput
* @return {?}
*/
MatOption.prototype._emitSelectionChangeEvent = /**
* Emits the selection change event.
* @param {?=} isUserInput
* @return {?}
*/
function (isUserInput) {
if (isUserInput === void 0) { isUserInput = false; }
this.onSelectionChange.emit(new MatOptionSelectionChange(this, isUserInput));
};
MatOption.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-option',
exportAs: 'matOption',
host: {
'role': 'option',
'[attr.tabindex]': '_getTabIndex()',
'[class.mat-selected]': 'selected',
'[class.mat-option-multiple]': 'multiple',
'[class.mat-active]': 'active',
'[id]': 'id',
'[attr.aria-selected]': 'selected.toString()',
'[attr.aria-disabled]': 'disabled.toString()',
'[class.mat-option-disabled]': 'disabled',
'(click)': '_selectViaInteraction()',
'(keydown)': '_handleKeydown($event)',
'class': 'mat-option',
},
styles: [".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;position:relative;cursor:pointer;outline:0;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}@media screen and (-ms-high-contrast:active){.mat-option{margin:0 1px}.mat-option.mat-active{border:solid 1px currentColor;margin:0}}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}@media screen and (-ms-high-contrast:active){.mat-option-ripple{opacity:.5}}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}"],
template: "<mat-pseudo-checkbox *ngIf=\"multiple\" class=\"mat-option-pseudo-checkbox\" [state]=\"selected ? 'checked' : ''\" [disabled]=\"disabled\"></mat-pseudo-checkbox><span class=\"mat-option-text\"><ng-content></ng-content></span><div class=\"mat-option-ripple\" mat-ripple [matRippleTrigger]=\"_getHostElement()\" [matRippleDisabled]=\"disabled || disableRipple\"></div>",
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatOption.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [MAT_OPTION_PARENT_COMPONENT,] },] },
{ type: MatOptgroup, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
MatOption.propDecorators = {
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"onSelectionChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
return MatOption;
}());
/**
* Counts the amount of option group labels that precede the specified option.
* \@docs-private
* @param {?} optionIndex Index of the option at which to start counting.
* @param {?} options Flat list of all of the options.
* @param {?} optionGroups Flat list of all of the option groups.
* @return {?}
*/
function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {
if (optionGroups.length) {
var /** @type {?} */ optionsArray = options.toArray();
var /** @type {?} */ groups = optionGroups.toArray();
var /** @type {?} */ groupCounter = 0;
for (var /** @type {?} */ i = 0; i < optionIndex + 1; i++) {
if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {
groupCounter++;
}
}
return groupCounter;
}
return 0;
}
/**
* Determines the position to which to scroll a panel in order for an option to be into view.
* \@docs-private
* @param {?} optionIndex Index of the option to be scrolled into the view.
* @param {?} optionHeight Height of the options.
* @param {?} currentScrollPosition Current scroll position of the panel.
* @param {?} panelHeight Height of the panel.
* @return {?}
*/
function _getOptionScrollPosition(optionIndex, optionHeight, currentScrollPosition, panelHeight) {
var /** @type {?} */ optionOffset = optionIndex * optionHeight;
if (optionOffset < currentScrollPosition) {
return optionOffset;
}
if (optionOffset + optionHeight > currentScrollPosition + panelHeight) {
return Math.max(0, optionOffset - panelHeight + optionHeight);
}
return currentScrollPosition;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatOptionModule = /** @class */ (function () {
function MatOptionModule() {
}
MatOptionModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [MatRippleModule, _angular_common__WEBPACK_IMPORTED_MODULE_9__["CommonModule"], MatPseudoCheckboxModule],
exports: [MatOption, MatOptgroup],
declarations: [MatOption, MatOptgroup]
},] },
];
return MatOptionModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* InjectionToken that can be used to specify the global label options.
*/
var /** @type {?} */ MAT_LABEL_GLOBAL_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('mat-label-global-options');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* When constructing a Date, the month is zero-based. This can be confusing, since people are
* used to seeing them one-based. So we create these aliases to make writing the tests easier.
*/
var /** @type {?} */ JAN = 0, /** @type {?} */ FEB = 1, /** @type {?} */ MAR = 2, /** @type {?} */ APR = 3, /** @type {?} */ MAY = 4, /** @type {?} */ JUN = 5, /** @type {?} */ JUL = 6, /** @type {?} */ AUG = 7, /** @type {?} */ SEP = 8, /** @type {?} */
OCT = 9, /** @type {?} */ NOV = 10, /** @type {?} */ DEC = 11;
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=core.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/datepicker.es5.js":
/*!***************************************************************!*\
!*** ./node_modules/@angular/material/esm5/datepicker.es5.js ***!
\***************************************************************/
/*! exports provided: MatDatepickerModule, MatCalendarHeader, MatCalendar, MatCalendarCell, MatCalendarBody, MAT_DATEPICKER_SCROLL_STRATEGY, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY, MatDatepickerContentBase, _MatDatepickerContentMixinBase, MatDatepickerContent, MatDatepicker, matDatepickerAnimations, MAT_DATEPICKER_VALUE_ACCESSOR, MAT_DATEPICKER_VALIDATORS, MatDatepickerInputEvent, MatDatepickerInput, MatDatepickerIntl, MatDatepickerToggleIcon, MatDatepickerToggle, MatMonthView, MatYearView, ɵa34 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerModule", function() { return MatDatepickerModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCalendarHeader", function() { return MatCalendarHeader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCalendar", function() { return MatCalendar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCalendarCell", function() { return MatCalendarCell; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCalendarBody", function() { return MatCalendarBody; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DATEPICKER_SCROLL_STRATEGY", function() { return MAT_DATEPICKER_SCROLL_STRATEGY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY", function() { return MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerContentBase", function() { return MatDatepickerContentBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatDatepickerContentMixinBase", function() { return _MatDatepickerContentMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerContent", function() { return MatDatepickerContent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDatepicker", function() { return MatDatepicker; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matDatepickerAnimations", function() { return matDatepickerAnimations; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DATEPICKER_VALUE_ACCESSOR", function() { return MAT_DATEPICKER_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DATEPICKER_VALIDATORS", function() { return MAT_DATEPICKER_VALIDATORS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerInputEvent", function() { return MatDatepickerInputEvent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerInput", function() { return MatDatepickerInput; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerIntl", function() { return MatDatepickerIntl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerToggleIcon", function() { return MatDatepickerToggleIcon; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerToggle", function() { return MatDatepickerToggle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatMonthView", function() { return MatMonthView; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatYearView", function() { return MatYearView; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵa34", function() { return MatMultiYearView; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/portal */ "./node_modules/@angular/cdk/esm5/portal.es5.js");
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/cdk/overlay */ "./node_modules/@angular/cdk/esm5/overlay.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/material/dialog */ "./node_modules/@angular/material/esm5/dialog.es5.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @angular/material/form-field */ "./node_modules/@angular/material/esm5/form-field.es5.js");
/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @angular/material/input */ "./node_modules/@angular/material/esm5/input.es5.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @angular/material/button */ "./node_modules/@angular/material/esm5/button.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
* @param {?} provider
* @return {?}
*/
function createMissingDateImplError(provider) {
return Error("MatDatepicker: No provider found for " + provider + ". You must import one of the following " +
"modules at your application root: MatNativeDateModule, MatMomentDateModule, or provide a " +
"custom implementation.");
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Datepicker data that requires internationalization.
*/
var MatDatepickerIntl = /** @class */ (function () {
function MatDatepickerIntl() {
/**
* Stream that emits whenever the labels here are changed. Use this to notify
* components if the labels have changed after initialization.
*/
this.changes = new rxjs__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
/**
* A label for the calendar popup (used by screen readers).
*/
this.calendarLabel = 'Calendar';
/**
* A label for the button used to open the calendar popup (used by screen readers).
*/
this.openCalendarLabel = 'Open calendar';
/**
* A label for the previous month button (used by screen readers).
*/
this.prevMonthLabel = 'Previous month';
/**
* A label for the next month button (used by screen readers).
*/
this.nextMonthLabel = 'Next month';
/**
* A label for the previous year button (used by screen readers).
*/
this.prevYearLabel = 'Previous year';
/**
* A label for the next year button (used by screen readers).
*/
this.nextYearLabel = 'Next year';
/**
* A label for the previous multi-year button (used by screen readers).
*/
this.prevMultiYearLabel = 'Previous 20 years';
/**
* A label for the next multi-year button (used by screen readers).
*/
this.nextMultiYearLabel = 'Next 20 years';
/**
* A label for the 'switch to month view' button (used by screen readers).
*/
this.switchToMonthViewLabel = 'Choose date';
/**
* A label for the 'switch to year view' button (used by screen readers).
*/
this.switchToMultiYearViewLabel = 'Choose month and year';
}
MatDatepickerIntl.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */ MatDatepickerIntl.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["defineInjectable"])({ factory: function MatDatepickerIntl_Factory() { return new MatDatepickerIntl(); }, token: MatDatepickerIntl, providedIn: "root" });
return MatDatepickerIntl;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* An internal class that represents the data corresponding to a single calendar cell.
* \@docs-private
*/
var /**
* An internal class that represents the data corresponding to a single calendar cell.
* \@docs-private
*/
MatCalendarCell = /** @class */ (function () {
function MatCalendarCell(value, displayValue, ariaLabel, enabled) {
this.value = value;
this.displayValue = displayValue;
this.ariaLabel = ariaLabel;
this.enabled = enabled;
}
return MatCalendarCell;
}());
/**
* An internal component used to display calendar data in a table.
* \@docs-private
*/
var MatCalendarBody = /** @class */ (function () {
function MatCalendarBody(_elementRef, _ngZone) {
this._elementRef = _elementRef;
this._ngZone = _ngZone;
/**
* The number of columns in the table.
*/
this.numCols = 7;
/**
* Whether to allow selection of disabled cells.
*/
this.allowDisabledSelection = false;
/**
* The cell number of the active cell in the table.
*/
this.activeCell = 0;
/**
* The aspect ratio (width / height) to use for the cells in the table. This aspect ratio will be
* maintained even as the table resizes.
*/
this.cellAspectRatio = 1;
/**
* Emits when a new value is selected.
*/
this.selectedValueChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
}
/**
* @param {?} cell
* @return {?}
*/
MatCalendarBody.prototype._cellClicked = /**
* @param {?} cell
* @return {?}
*/
function (cell) {
if (!this.allowDisabledSelection && !cell.enabled) {
return;
}
this.selectedValueChange.emit(cell.value);
};
Object.defineProperty(MatCalendarBody.prototype, "_firstRowOffset", {
/** The number of blank cells to put at the beginning for the first row. */
get: /**
* The number of blank cells to put at the beginning for the first row.
* @return {?}
*/
function () {
return this.rows && this.rows.length && this.rows[0].length ?
this.numCols - this.rows[0].length : 0;
},
enumerable: true,
configurable: true
});
/**
* @param {?} rowIndex
* @param {?} colIndex
* @return {?}
*/
MatCalendarBody.prototype._isActiveCell = /**
* @param {?} rowIndex
* @param {?} colIndex
* @return {?}
*/
function (rowIndex, colIndex) {
var /** @type {?} */ cellNumber = rowIndex * this.numCols + colIndex;
// Account for the fact that the first row may not have as many cells.
if (rowIndex) {
cellNumber -= this._firstRowOffset;
}
return cellNumber == this.activeCell;
};
/** Focuses the active cell after the microtask queue is empty. */
/**
* Focuses the active cell after the microtask queue is empty.
* @return {?}
*/
MatCalendarBody.prototype._focusActiveCell = /**
* Focuses the active cell after the microtask queue is empty.
* @return {?}
*/
function () {
var _this = this;
this._ngZone.runOutsideAngular(function () {
_this._ngZone.onStable.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["take"])(1)).subscribe(function () {
_this._elementRef.nativeElement.querySelector('.mat-calendar-body-active').focus();
});
});
};
MatCalendarBody.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: '[mat-calendar-body]',
template: "<tr *ngIf=\"_firstRowOffset < labelMinRequiredCells\" aria-hidden=\"true\"><td class=\"mat-calendar-body-label\" [attr.colspan]=\"numCols\" [style.paddingTop.%]=\"50 * cellAspectRatio / numCols\" [style.paddingBottom.%]=\"50 * cellAspectRatio / numCols\">{{label}}</td></tr><tr *ngFor=\"let row of rows; let rowIndex = index\" role=\"row\"><td *ngIf=\"rowIndex === 0 && _firstRowOffset\" aria-hidden=\"true\" class=\"mat-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" [style.paddingTop.%]=\"50 * cellAspectRatio / numCols\" [style.paddingBottom.%]=\"50 * cellAspectRatio / numCols\">{{_firstRowOffset >= labelMinRequiredCells ? label : ''}}</td><td *ngFor=\"let item of row; let colIndex = index\" role=\"gridcell\" class=\"mat-calendar-body-cell\" [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\" [class.mat-calendar-body-disabled]=\"!item.enabled\" [class.mat-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\" [attr.aria-label]=\"item.ariaLabel\" [attr.aria-disabled]=\"!item.enabled || null\" (click)=\"_cellClicked(item)\" [style.width.%]=\"100 / numCols\" [style.paddingTop.%]=\"50 * cellAspectRatio / numCols\" [style.paddingBottom.%]=\"50 * cellAspectRatio / numCols\"><div class=\"mat-calendar-body-cell-content\" [class.mat-calendar-body-selected]=\"selectedValue === item.value\" [class.mat-calendar-body-today]=\"todayValue === item.value\">{{item.displayValue}}</div></td></tr>",
styles: [".mat-calendar-body{min-width:224px}.mat-calendar-body-label{height:0;line-height:0;text-align:left;padding-left:4.71429%;padding-right:4.71429%}.mat-calendar-body-cell{position:relative;height:0;line-height:0;text-align:center;outline:0;cursor:pointer}.mat-calendar-body-disabled{cursor:default}.mat-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;line-height:1;border-width:1px;border-style:solid;border-radius:999px}@media screen and (-ms-high-contrast:active){.mat-calendar-body-cell-content{border:none}}@media screen and (-ms-high-contrast:active){.mat-calendar-body-selected,.mat-datepicker-popup{outline:solid 1px}.mat-calendar-body-today{outline:dotted 1px}}[dir=rtl] .mat-calendar-body-label{text-align:right}"],
host: {
'class': 'mat-calendar-body',
'role': 'grid',
'attr.aria-readonly': 'true'
},
exportAs: 'matCalendarBody',
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatCalendarBody.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
]; };
MatCalendarBody.propDecorators = {
"label": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"rows": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"todayValue": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selectedValue": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"labelMinRequiredCells": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"numCols": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"allowDisabledSelection": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"activeCell": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"cellAspectRatio": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selectedValueChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
return MatCalendarBody;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ DAYS_PER_WEEK = 7;
/**
* An internal component used to display a single month in the datepicker.
* \@docs-private
* @template D
*/
var MatMonthView = /** @class */ (function () {
function MatMonthView(_changeDetectorRef, _dateFormats, _dateAdapter, _dir) {
this._changeDetectorRef = _changeDetectorRef;
this._dateFormats = _dateFormats;
this._dateAdapter = _dateAdapter;
this._dir = _dir;
/**
* Emits when a new date is selected.
*/
this.selectedChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits when any date is selected.
*/
this._userSelection = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits when any date is activated.
*/
this.activeDateChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
if (!this._dateAdapter) {
throw createMissingDateImplError('DateAdapter');
}
if (!this._dateFormats) {
throw createMissingDateImplError('MAT_DATE_FORMATS');
}
var /** @type {?} */ firstDayOfWeek = this._dateAdapter.getFirstDayOfWeek();
var /** @type {?} */ narrowWeekdays = this._dateAdapter.getDayOfWeekNames('narrow');
var /** @type {?} */ longWeekdays = this._dateAdapter.getDayOfWeekNames('long');
// Rotate the labels for days of the week based on the configured first day of the week.
var /** @type {?} */ weekdays = longWeekdays.map(function (long, i) {
return { long: long, narrow: narrowWeekdays[i] };
});
this._weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek));
this._activeDate = this._dateAdapter.today();
}
Object.defineProperty(MatMonthView.prototype, "activeDate", {
get: /**
* The date to display in this month view (everything other than the month and year is ignored).
* @return {?}
*/
function () { return this._activeDate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ oldActiveDate = this._activeDate;
var /** @type {?} */ validDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value)) || this._dateAdapter.today();
this._activeDate = this._dateAdapter.clampDate(validDate, this.minDate, this.maxDate);
if (!this._hasSameMonthAndYear(oldActiveDate, this._activeDate)) {
this._init();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatMonthView.prototype, "selected", {
get: /**
* The currently selected date.
* @return {?}
*/
function () { return this._selected; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._selected = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
this._selectedDate = this._getDateInCurrentMonth(this._selected);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatMonthView.prototype, "minDate", {
get: /**
* The minimum selectable date.
* @return {?}
*/
function () { return this._minDate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._minDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatMonthView.prototype, "maxDate", {
get: /**
* The maximum selectable date.
* @return {?}
*/
function () { return this._maxDate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._maxDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatMonthView.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
this._init();
};
/** Handles when a new date is selected. */
/**
* Handles when a new date is selected.
* @param {?} date
* @return {?}
*/
MatMonthView.prototype._dateSelected = /**
* Handles when a new date is selected.
* @param {?} date
* @return {?}
*/
function (date) {
if (this._selectedDate != date) {
var /** @type {?} */ selectedYear = this._dateAdapter.getYear(this.activeDate);
var /** @type {?} */ selectedMonth = this._dateAdapter.getMonth(this.activeDate);
var /** @type {?} */ selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);
this.selectedChange.emit(selectedDate);
}
this._userSelection.emit();
};
/** Handles keydown events on the calendar body when calendar is in month view. */
/**
* Handles keydown events on the calendar body when calendar is in month view.
* @param {?} event
* @return {?}
*/
MatMonthView.prototype._handleCalendarBodyKeydown = /**
* Handles keydown events on the calendar body when calendar is in month view.
* @param {?} event
* @return {?}
*/
function (event) {
// TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent
// disabled ones from being selected. This may not be ideal, we should look into whether
// navigation should skip over disabled dates, and if so, how to implement that efficiently.
var /** @type {?} */ oldActiveDate = this._activeDate;
var /** @type {?} */ isRtl = this._isRtl();
switch (event.keyCode) {
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["LEFT_ARROW"]:
this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, isRtl ? 1 : -1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["RIGHT_ARROW"]:
this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, isRtl ? -1 : 1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["UP_ARROW"]:
this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, -7);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["DOWN_ARROW"]:
this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, 7);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["HOME"]:
this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, 1 - this._dateAdapter.getDate(this._activeDate));
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["END"]:
this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, (this._dateAdapter.getNumDaysInMonth(this._activeDate) -
this._dateAdapter.getDate(this._activeDate)));
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["PAGE_UP"]:
this.activeDate = event.altKey ?
this._dateAdapter.addCalendarYears(this._activeDate, -1) :
this._dateAdapter.addCalendarMonths(this._activeDate, -1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["PAGE_DOWN"]:
this.activeDate = event.altKey ?
this._dateAdapter.addCalendarYears(this._activeDate, 1) :
this._dateAdapter.addCalendarMonths(this._activeDate, 1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["ENTER"]:
if (!this.dateFilter || this.dateFilter(this._activeDate)) {
this._dateSelected(this._dateAdapter.getDate(this._activeDate));
this._userSelection.emit();
// Prevent unexpected default actions such as form submission.
event.preventDefault();
}
return;
default:
// Don't prevent default or focus active cell on keys that we don't explicitly handle.
return;
}
if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) {
this.activeDateChange.emit(this.activeDate);
}
this._focusActiveCell();
// Prevent unexpected default actions such as form submission.
event.preventDefault();
};
/** Initializes this month view. */
/**
* Initializes this month view.
* @return {?}
*/
MatMonthView.prototype._init = /**
* Initializes this month view.
* @return {?}
*/
function () {
this._selectedDate = this._getDateInCurrentMonth(this.selected);
this._todayDate = this._getDateInCurrentMonth(this._dateAdapter.today());
this._monthLabel =
this._dateAdapter.getMonthNames('short')[this._dateAdapter.getMonth(this.activeDate)]
.toLocaleUpperCase();
var /** @type {?} */ firstOfMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), 1);
this._firstWeekOffset =
(DAYS_PER_WEEK + this._dateAdapter.getDayOfWeek(firstOfMonth) -
this._dateAdapter.getFirstDayOfWeek()) % DAYS_PER_WEEK;
this._createWeekCells();
this._changeDetectorRef.markForCheck();
};
/** Focuses the active cell after the microtask queue is empty. */
/**
* Focuses the active cell after the microtask queue is empty.
* @return {?}
*/
MatMonthView.prototype._focusActiveCell = /**
* Focuses the active cell after the microtask queue is empty.
* @return {?}
*/
function () {
this._matCalendarBody._focusActiveCell();
};
/**
* Creates MatCalendarCells for the dates in this month.
* @return {?}
*/
MatMonthView.prototype._createWeekCells = /**
* Creates MatCalendarCells for the dates in this month.
* @return {?}
*/
function () {
var /** @type {?} */ daysInMonth = this._dateAdapter.getNumDaysInMonth(this.activeDate);
var /** @type {?} */ dateNames = this._dateAdapter.getDateNames();
this._weeks = [[]];
for (var /** @type {?} */ i = 0, /** @type {?} */ cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {
if (cell == DAYS_PER_WEEK) {
this._weeks.push([]);
cell = 0;
}
var /** @type {?} */ date = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), i + 1);
var /** @type {?} */ enabled = this._shouldEnableDate(date);
var /** @type {?} */ ariaLabel = this._dateAdapter.format(date, this._dateFormats.display.dateA11yLabel);
this._weeks[this._weeks.length - 1]
.push(new MatCalendarCell(i + 1, dateNames[i], ariaLabel, enabled));
}
};
/**
* Date filter for the month
* @param {?} date
* @return {?}
*/
MatMonthView.prototype._shouldEnableDate = /**
* Date filter for the month
* @param {?} date
* @return {?}
*/
function (date) {
return !!date &&
(!this.dateFilter || this.dateFilter(date)) &&
(!this.minDate || this._dateAdapter.compareDate(date, this.minDate) >= 0) &&
(!this.maxDate || this._dateAdapter.compareDate(date, this.maxDate) <= 0);
};
/**
* Gets the date in this month that the given Date falls on.
* Returns null if the given Date is in another month.
* @param {?} date
* @return {?}
*/
MatMonthView.prototype._getDateInCurrentMonth = /**
* Gets the date in this month that the given Date falls on.
* Returns null if the given Date is in another month.
* @param {?} date
* @return {?}
*/
function (date) {
return date && this._hasSameMonthAndYear(date, this.activeDate) ?
this._dateAdapter.getDate(date) : null;
};
/**
* Checks whether the 2 dates are non-null and fall within the same month of the same year.
* @param {?} d1
* @param {?} d2
* @return {?}
*/
MatMonthView.prototype._hasSameMonthAndYear = /**
* Checks whether the 2 dates are non-null and fall within the same month of the same year.
* @param {?} d1
* @param {?} d2
* @return {?}
*/
function (d1, d2) {
return !!(d1 && d2 && this._dateAdapter.getMonth(d1) == this._dateAdapter.getMonth(d2) &&
this._dateAdapter.getYear(d1) == this._dateAdapter.getYear(d2));
};
/**
* @param {?} obj The object to check.
* @return {?} The given object if it is both a date instance and valid, otherwise null.
*/
MatMonthView.prototype._getValidDateOrNull = /**
* @param {?} obj The object to check.
* @return {?} The given object if it is both a date instance and valid, otherwise null.
*/
function (obj) {
return (this._dateAdapter.isDateInstance(obj) && this._dateAdapter.isValid(obj)) ? obj : null;
};
/**
* Determines whether the user has the RTL layout direction.
* @return {?}
*/
MatMonthView.prototype._isRtl = /**
* Determines whether the user has the RTL layout direction.
* @return {?}
*/
function () {
return this._dir && this._dir.value === 'rtl';
};
MatMonthView.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-month-view',
template: "<table class=\"mat-calendar-table\"><thead class=\"mat-calendar-table-header\"><tr><th *ngFor=\"let day of _weekdays\" [attr.aria-label]=\"day.long\">{{day.narrow}}</th></tr><tr><th class=\"mat-calendar-table-header-divider\" colspan=\"7\" aria-hidden=\"true\"></th></tr></thead><tbody mat-calendar-body [label]=\"_monthLabel\" [rows]=\"_weeks\" [todayValue]=\"_todayDate\" [selectedValue]=\"_selectedDate\" [labelMinRequiredCells]=\"3\" [activeCell]=\"_dateAdapter.getDate(activeDate) - 1\" (selectedValueChange)=\"_dateSelected($event)\" (keydown)=\"_handleCalendarBodyKeydown($event)\"></tbody></table>",
exportAs: 'matMonthView',
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush
},] },
];
/** @nocollapse */
MatMonthView.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["MAT_DATE_FORMATS"],] },] },
{ type: _angular_material_core__WEBPACK_IMPORTED_MODULE_4__["DateAdapter"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_5__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
MatMonthView.propDecorators = {
"activeDate": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"minDate": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"maxDate": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"dateFilter": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selectedChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"_userSelection": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"activeDateChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"_matCalendarBody": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [MatCalendarBody,] },],
};
return MatMonthView;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ yearsPerPage = 24;
var /** @type {?} */ yearsPerRow = 4;
/**
* An internal component used to display a year selector in the datepicker.
* \@docs-private
* @template D
*/
var MatMultiYearView = /** @class */ (function () {
function MatMultiYearView(_changeDetectorRef, _dateAdapter, _dir) {
this._changeDetectorRef = _changeDetectorRef;
this._dateAdapter = _dateAdapter;
this._dir = _dir;
/**
* Emits when a new year is selected.
*/
this.selectedChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits the selected year. This doesn't imply a change on the selected date
*/
this.yearSelected = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
if (!this._dateAdapter) {
throw createMissingDateImplError('DateAdapter');
}
this._activeDate = this._dateAdapter.today();
}
Object.defineProperty(MatMultiYearView.prototype, "activeDate", {
get: /**
* The date to display in this multi-year view (everything other than the year is ignored).
* @return {?}
*/
function () { return this._activeDate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ oldActiveDate = this._activeDate;
var /** @type {?} */ validDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value)) || this._dateAdapter.today();
this._activeDate = this._dateAdapter.clampDate(validDate, this.minDate, this.maxDate);
if (Math.floor(this._dateAdapter.getYear(oldActiveDate) / yearsPerPage) !=
Math.floor(this._dateAdapter.getYear(this._activeDate) / yearsPerPage)) {
this._init();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatMultiYearView.prototype, "selected", {
get: /**
* The currently selected date.
* @return {?}
*/
function () { return this._selected; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._selected = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
this._selectedYear = this._selected && this._dateAdapter.getYear(this._selected);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatMultiYearView.prototype, "minDate", {
get: /**
* The minimum selectable date.
* @return {?}
*/
function () { return this._minDate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._minDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatMultiYearView.prototype, "maxDate", {
get: /**
* The maximum selectable date.
* @return {?}
*/
function () { return this._maxDate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._maxDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatMultiYearView.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
this._init();
};
/** Initializes this multi-year view. */
/**
* Initializes this multi-year view.
* @return {?}
*/
MatMultiYearView.prototype._init = /**
* Initializes this multi-year view.
* @return {?}
*/
function () {
var _this = this;
this._todayYear = this._dateAdapter.getYear(this._dateAdapter.today());
var /** @type {?} */ activeYear = this._dateAdapter.getYear(this._activeDate);
var /** @type {?} */ activeOffset = activeYear % yearsPerPage;
this._years = [];
for (var /** @type {?} */ i = 0, /** @type {?} */ row = []; i < yearsPerPage; i++) {
row.push(activeYear - activeOffset + i);
if (row.length == yearsPerRow) {
this._years.push(row.map(function (year) { return _this._createCellForYear(year); }));
row = [];
}
}
this._changeDetectorRef.markForCheck();
};
/** Handles when a new year is selected. */
/**
* Handles when a new year is selected.
* @param {?} year
* @return {?}
*/
MatMultiYearView.prototype._yearSelected = /**
* Handles when a new year is selected.
* @param {?} year
* @return {?}
*/
function (year) {
this.yearSelected.emit(this._dateAdapter.createDate(year, 0, 1));
var /** @type {?} */ month = this._dateAdapter.getMonth(this.activeDate);
var /** @type {?} */ daysInMonth = this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(year, month, 1));
this.selectedChange.emit(this._dateAdapter.createDate(year, month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));
};
/** Handles keydown events on the calendar body when calendar is in multi-year view. */
/**
* Handles keydown events on the calendar body when calendar is in multi-year view.
* @param {?} event
* @return {?}
*/
MatMultiYearView.prototype._handleCalendarBodyKeydown = /**
* Handles keydown events on the calendar body when calendar is in multi-year view.
* @param {?} event
* @return {?}
*/
function (event) {
// TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent
// disabled ones from being selected. This may not be ideal, we should look into whether
// navigation should skip over disabled dates, and if so, how to implement that efficiently.
var /** @type {?} */ isRtl = this._isRtl();
switch (event.keyCode) {
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["LEFT_ARROW"]:
this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, isRtl ? 1 : -1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["RIGHT_ARROW"]:
this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, isRtl ? -1 : 1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["UP_ARROW"]:
this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, -yearsPerRow);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["DOWN_ARROW"]:
this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, yearsPerRow);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["HOME"]:
this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, -this._dateAdapter.getYear(this._activeDate) % yearsPerPage);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["END"]:
this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, yearsPerPage - this._dateAdapter.getYear(this._activeDate) % yearsPerPage - 1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["PAGE_UP"]:
this.activeDate =
this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? -yearsPerPage * 10 : -yearsPerPage);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["PAGE_DOWN"]:
this.activeDate =
this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? yearsPerPage * 10 : yearsPerPage);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["ENTER"]:
this._yearSelected(this._dateAdapter.getYear(this._activeDate));
break;
default:
// Don't prevent default or focus active cell on keys that we don't explicitly handle.
return;
}
this._focusActiveCell();
// Prevent unexpected default actions such as form submission.
event.preventDefault();
};
/**
* @return {?}
*/
MatMultiYearView.prototype._getActiveCell = /**
* @return {?}
*/
function () {
return this._dateAdapter.getYear(this.activeDate) % yearsPerPage;
};
/** Focuses the active cell after the microtask queue is empty. */
/**
* Focuses the active cell after the microtask queue is empty.
* @return {?}
*/
MatMultiYearView.prototype._focusActiveCell = /**
* Focuses the active cell after the microtask queue is empty.
* @return {?}
*/
function () {
this._matCalendarBody._focusActiveCell();
};
/**
* Creates an MatCalendarCell for the given year.
* @param {?} year
* @return {?}
*/
MatMultiYearView.prototype._createCellForYear = /**
* Creates an MatCalendarCell for the given year.
* @param {?} year
* @return {?}
*/
function (year) {
var /** @type {?} */ yearName = this._dateAdapter.getYearName(this._dateAdapter.createDate(year, 0, 1));
return new MatCalendarCell(year, yearName, yearName, this._shouldEnableYear(year));
};
/**
* Whether the given year is enabled.
* @param {?} year
* @return {?}
*/
MatMultiYearView.prototype._shouldEnableYear = /**
* Whether the given year is enabled.
* @param {?} year
* @return {?}
*/
function (year) {
// disable if the year is greater than maxDate lower than minDate
if (year === undefined || year === null ||
(this.maxDate && year > this._dateAdapter.getYear(this.maxDate)) ||
(this.minDate && year < this._dateAdapter.getYear(this.minDate))) {
return false;
}
// enable if it reaches here and there's no filter defined
if (!this.dateFilter) {
return true;
}
var /** @type {?} */ firstOfYear = this._dateAdapter.createDate(year, 0, 1);
// If any date in the year is enabled count the year as enabled.
for (var /** @type {?} */ date = firstOfYear; this._dateAdapter.getYear(date) == year; date = this._dateAdapter.addCalendarDays(date, 1)) {
if (this.dateFilter(date)) {
return true;
}
}
return false;
};
/**
* @param {?} obj The object to check.
* @return {?} The given object if it is both a date instance and valid, otherwise null.
*/
MatMultiYearView.prototype._getValidDateOrNull = /**
* @param {?} obj The object to check.
* @return {?} The given object if it is both a date instance and valid, otherwise null.
*/
function (obj) {
return (this._dateAdapter.isDateInstance(obj) && this._dateAdapter.isValid(obj)) ? obj : null;
};
/**
* Determines whether the user has the RTL layout direction.
* @return {?}
*/
MatMultiYearView.prototype._isRtl = /**
* Determines whether the user has the RTL layout direction.
* @return {?}
*/
function () {
return this._dir && this._dir.value === 'rtl';
};
MatMultiYearView.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-multi-year-view',
template: "<table class=\"mat-calendar-table\"><thead class=\"mat-calendar-table-header\"><tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr></thead><tbody mat-calendar-body allowDisabledSelection=\"true\" [rows]=\"_years\" [todayValue]=\"_todayYear\" [selectedValue]=\"_selectedYear\" [numCols]=\"4\" [cellAspectRatio]=\"4 / 7\" [activeCell]=\"_getActiveCell()\" (selectedValueChange)=\"_yearSelected($event)\" (keydown)=\"_handleCalendarBodyKeydown($event)\"></tbody></table>",
exportAs: 'matMultiYearView',
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush
},] },
];
/** @nocollapse */
MatMultiYearView.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
{ type: _angular_material_core__WEBPACK_IMPORTED_MODULE_4__["DateAdapter"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_5__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
MatMultiYearView.propDecorators = {
"activeDate": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"minDate": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"maxDate": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"dateFilter": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selectedChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"yearSelected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"_matCalendarBody": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [MatCalendarBody,] },],
};
return MatMultiYearView;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* An internal component used to display a single year in the datepicker.
* \@docs-private
* @template D
*/
var MatYearView = /** @class */ (function () {
function MatYearView(_changeDetectorRef, _dateFormats, _dateAdapter, _dir) {
this._changeDetectorRef = _changeDetectorRef;
this._dateFormats = _dateFormats;
this._dateAdapter = _dateAdapter;
this._dir = _dir;
/**
* Emits when a new month is selected.
*/
this.selectedChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits the selected month. This doesn't imply a change on the selected date
*/
this.monthSelected = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
if (!this._dateAdapter) {
throw createMissingDateImplError('DateAdapter');
}
if (!this._dateFormats) {
throw createMissingDateImplError('MAT_DATE_FORMATS');
}
this._activeDate = this._dateAdapter.today();
}
Object.defineProperty(MatYearView.prototype, "activeDate", {
get: /**
* The date to display in this year view (everything other than the year is ignored).
* @return {?}
*/
function () { return this._activeDate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ oldActiveDate = this._activeDate;
var /** @type {?} */ validDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value)) || this._dateAdapter.today();
this._activeDate = this._dateAdapter.clampDate(validDate, this.minDate, this.maxDate);
if (this._dateAdapter.getYear(oldActiveDate) !== this._dateAdapter.getYear(this._activeDate)) {
this._init();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatYearView.prototype, "selected", {
get: /**
* The currently selected date.
* @return {?}
*/
function () { return this._selected; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._selected = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
this._selectedMonth = this._getMonthInCurrentYear(this._selected);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatYearView.prototype, "minDate", {
get: /**
* The minimum selectable date.
* @return {?}
*/
function () { return this._minDate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._minDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatYearView.prototype, "maxDate", {
get: /**
* The maximum selectable date.
* @return {?}
*/
function () { return this._maxDate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._maxDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatYearView.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
this._init();
};
/** Handles when a new month is selected. */
/**
* Handles when a new month is selected.
* @param {?} month
* @return {?}
*/
MatYearView.prototype._monthSelected = /**
* Handles when a new month is selected.
* @param {?} month
* @return {?}
*/
function (month) {
var /** @type {?} */ normalizedDate = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);
this.monthSelected.emit(normalizedDate);
var /** @type {?} */ daysInMonth = this._dateAdapter.getNumDaysInMonth(normalizedDate);
this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));
};
/** Handles keydown events on the calendar body when calendar is in year view. */
/**
* Handles keydown events on the calendar body when calendar is in year view.
* @param {?} event
* @return {?}
*/
MatYearView.prototype._handleCalendarBodyKeydown = /**
* Handles keydown events on the calendar body when calendar is in year view.
* @param {?} event
* @return {?}
*/
function (event) {
// TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent
// disabled ones from being selected. This may not be ideal, we should look into whether
// navigation should skip over disabled dates, and if so, how to implement that efficiently.
var /** @type {?} */ isRtl = this._isRtl();
switch (event.keyCode) {
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["LEFT_ARROW"]:
this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, isRtl ? 1 : -1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["RIGHT_ARROW"]:
this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, isRtl ? -1 : 1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["UP_ARROW"]:
this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, -4);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["DOWN_ARROW"]:
this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, 4);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["HOME"]:
this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, -this._dateAdapter.getMonth(this._activeDate));
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["END"]:
this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, 11 - this._dateAdapter.getMonth(this._activeDate));
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["PAGE_UP"]:
this.activeDate =
this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? -10 : -1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["PAGE_DOWN"]:
this.activeDate =
this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? 10 : 1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["ENTER"]:
this._monthSelected(this._dateAdapter.getMonth(this._activeDate));
break;
default:
// Don't prevent default or focus active cell on keys that we don't explicitly handle.
return;
}
this._focusActiveCell();
// Prevent unexpected default actions such as form submission.
event.preventDefault();
};
/** Initializes this year view. */
/**
* Initializes this year view.
* @return {?}
*/
MatYearView.prototype._init = /**
* Initializes this year view.
* @return {?}
*/
function () {
var _this = this;
this._selectedMonth = this._getMonthInCurrentYear(this.selected);
this._todayMonth = this._getMonthInCurrentYear(this._dateAdapter.today());
this._yearLabel = this._dateAdapter.getYearName(this.activeDate);
var /** @type {?} */ monthNames = this._dateAdapter.getMonthNames('short');
// First row of months only contains 5 elements so we can fit the year label on the same row.
this._months = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]].map(function (row) {
return row.map(function (month) { return _this._createCellForMonth(month, monthNames[month]); });
});
this._changeDetectorRef.markForCheck();
};
/** Focuses the active cell after the microtask queue is empty. */
/**
* Focuses the active cell after the microtask queue is empty.
* @return {?}
*/
MatYearView.prototype._focusActiveCell = /**
* Focuses the active cell after the microtask queue is empty.
* @return {?}
*/
function () {
this._matCalendarBody._focusActiveCell();
};
/**
* Gets the month in this year that the given Date falls on.
* Returns null if the given Date is in another year.
* @param {?} date
* @return {?}
*/
MatYearView.prototype._getMonthInCurrentYear = /**
* Gets the month in this year that the given Date falls on.
* Returns null if the given Date is in another year.
* @param {?} date
* @return {?}
*/
function (date) {
return date && this._dateAdapter.getYear(date) == this._dateAdapter.getYear(this.activeDate) ?
this._dateAdapter.getMonth(date) : null;
};
/**
* Creates an MatCalendarCell for the given month.
* @param {?} month
* @param {?} monthName
* @return {?}
*/
MatYearView.prototype._createCellForMonth = /**
* Creates an MatCalendarCell for the given month.
* @param {?} month
* @param {?} monthName
* @return {?}
*/
function (month, monthName) {
var /** @type {?} */ ariaLabel = this._dateAdapter.format(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1), this._dateFormats.display.monthYearA11yLabel);
return new MatCalendarCell(month, monthName.toLocaleUpperCase(), ariaLabel, this._shouldEnableMonth(month));
};
/**
* Whether the given month is enabled.
* @param {?} month
* @return {?}
*/
MatYearView.prototype._shouldEnableMonth = /**
* Whether the given month is enabled.
* @param {?} month
* @return {?}
*/
function (month) {
var /** @type {?} */ activeYear = this._dateAdapter.getYear(this.activeDate);
if (month === undefined || month === null ||
this._isYearAndMonthAfterMaxDate(activeYear, month) ||
this._isYearAndMonthBeforeMinDate(activeYear, month)) {
return false;
}
if (!this.dateFilter) {
return true;
}
var /** @type {?} */ firstOfMonth = this._dateAdapter.createDate(activeYear, month, 1);
// If any date in the month is enabled count the month as enabled.
for (var /** @type {?} */ date = firstOfMonth; this._dateAdapter.getMonth(date) == month; date = this._dateAdapter.addCalendarDays(date, 1)) {
if (this.dateFilter(date)) {
return true;
}
}
return false;
};
/**
* Tests whether the combination month/year is after this.maxDate, considering
* just the month and year of this.maxDate
* @param {?} year
* @param {?} month
* @return {?}
*/
MatYearView.prototype._isYearAndMonthAfterMaxDate = /**
* Tests whether the combination month/year is after this.maxDate, considering
* just the month and year of this.maxDate
* @param {?} year
* @param {?} month
* @return {?}
*/
function (year, month) {
if (this.maxDate) {
var /** @type {?} */ maxYear = this._dateAdapter.getYear(this.maxDate);
var /** @type {?} */ maxMonth = this._dateAdapter.getMonth(this.maxDate);
return year > maxYear || (year === maxYear && month > maxMonth);
}
return false;
};
/**
* Tests whether the combination month/year is before this.minDate, considering
* just the month and year of this.minDate
* @param {?} year
* @param {?} month
* @return {?}
*/
MatYearView.prototype._isYearAndMonthBeforeMinDate = /**
* Tests whether the combination month/year is before this.minDate, considering
* just the month and year of this.minDate
* @param {?} year
* @param {?} month
* @return {?}
*/
function (year, month) {
if (this.minDate) {
var /** @type {?} */ minYear = this._dateAdapter.getYear(this.minDate);
var /** @type {?} */ minMonth = this._dateAdapter.getMonth(this.minDate);
return year < minYear || (year === minYear && month < minMonth);
}
return false;
};
/**
* @param {?} obj The object to check.
* @return {?} The given object if it is both a date instance and valid, otherwise null.
*/
MatYearView.prototype._getValidDateOrNull = /**
* @param {?} obj The object to check.
* @return {?} The given object if it is both a date instance and valid, otherwise null.
*/
function (obj) {
return (this._dateAdapter.isDateInstance(obj) && this._dateAdapter.isValid(obj)) ? obj : null;
};
/**
* Determines whether the user has the RTL layout direction.
* @return {?}
*/
MatYearView.prototype._isRtl = /**
* Determines whether the user has the RTL layout direction.
* @return {?}
*/
function () {
return this._dir && this._dir.value === 'rtl';
};
MatYearView.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-year-view',
template: "<table class=\"mat-calendar-table\"><thead class=\"mat-calendar-table-header\"><tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr></thead><tbody mat-calendar-body allowDisabledSelection=\"true\" [label]=\"_yearLabel\" [rows]=\"_months\" [todayValue]=\"_todayMonth\" [selectedValue]=\"_selectedMonth\" [labelMinRequiredCells]=\"2\" [numCols]=\"4\" [cellAspectRatio]=\"4 / 7\" [activeCell]=\"_dateAdapter.getMonth(activeDate)\" (selectedValueChange)=\"_monthSelected($event)\" (keydown)=\"_handleCalendarBodyKeydown($event)\"></tbody></table>",
exportAs: 'matYearView',
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush
},] },
];
/** @nocollapse */
MatYearView.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["MAT_DATE_FORMATS"],] },] },
{ type: _angular_material_core__WEBPACK_IMPORTED_MODULE_4__["DateAdapter"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_5__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
MatYearView.propDecorators = {
"activeDate": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"minDate": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"maxDate": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"dateFilter": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selectedChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"monthSelected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"_matCalendarBody": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [MatCalendarBody,] },],
};
return MatYearView;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Default header for MatCalendar
* @template D
*/
var MatCalendarHeader = /** @class */ (function () {
function MatCalendarHeader(_intl, calendar, _dateAdapter, _dateFormats, changeDetectorRef) {
this._intl = _intl;
this.calendar = calendar;
this._dateAdapter = _dateAdapter;
this._dateFormats = _dateFormats;
this.calendar.stateChanges.subscribe(function () { return changeDetectorRef.markForCheck(); });
}
Object.defineProperty(MatCalendarHeader.prototype, "periodButtonText", {
/** The label for the current calendar view. */
get: /**
* The label for the current calendar view.
* @return {?}
*/
function () {
if (this.calendar.currentView == 'month') {
return this._dateAdapter
.format(this.calendar.activeDate, this._dateFormats.display.monthYearLabel)
.toLocaleUpperCase();
}
if (this.calendar.currentView == 'year') {
return this._dateAdapter.getYearName(this.calendar.activeDate);
}
var /** @type {?} */ activeYear = this._dateAdapter.getYear(this.calendar.activeDate);
var /** @type {?} */ firstYearInView = this._dateAdapter.getYearName(this._dateAdapter.createDate(activeYear - activeYear % 24, 0, 1));
var /** @type {?} */ lastYearInView = this._dateAdapter.getYearName(this._dateAdapter.createDate(activeYear + yearsPerPage - 1 - activeYear % 24, 0, 1));
return firstYearInView + " \u2013 " + lastYearInView;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatCalendarHeader.prototype, "periodButtonLabel", {
get: /**
* @return {?}
*/
function () {
return this.calendar.currentView == 'month' ?
this._intl.switchToMultiYearViewLabel : this._intl.switchToMonthViewLabel;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatCalendarHeader.prototype, "prevButtonLabel", {
/** The label for the the previous button. */
get: /**
* The label for the the previous button.
* @return {?}
*/
function () {
return {
'month': this._intl.prevMonthLabel,
'year': this._intl.prevYearLabel,
'multi-year': this._intl.prevMultiYearLabel
}[this.calendar.currentView];
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatCalendarHeader.prototype, "nextButtonLabel", {
/** The label for the the next button. */
get: /**
* The label for the the next button.
* @return {?}
*/
function () {
return {
'month': this._intl.nextMonthLabel,
'year': this._intl.nextYearLabel,
'multi-year': this._intl.nextMultiYearLabel
}[this.calendar.currentView];
},
enumerable: true,
configurable: true
});
/** Handles user clicks on the period label. */
/**
* Handles user clicks on the period label.
* @return {?}
*/
MatCalendarHeader.prototype.currentPeriodClicked = /**
* Handles user clicks on the period label.
* @return {?}
*/
function () {
this.calendar.currentView = this.calendar.currentView == 'month' ? 'multi-year' : 'month';
};
/** Handles user clicks on the previous button. */
/**
* Handles user clicks on the previous button.
* @return {?}
*/
MatCalendarHeader.prototype.previousClicked = /**
* Handles user clicks on the previous button.
* @return {?}
*/
function () {
this.calendar.activeDate = this.calendar.currentView == 'month' ?
this._dateAdapter.addCalendarMonths(this.calendar.activeDate, -1) :
this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage);
};
/** Handles user clicks on the next button. */
/**
* Handles user clicks on the next button.
* @return {?}
*/
MatCalendarHeader.prototype.nextClicked = /**
* Handles user clicks on the next button.
* @return {?}
*/
function () {
this.calendar.activeDate = this.calendar.currentView == 'month' ?
this._dateAdapter.addCalendarMonths(this.calendar.activeDate, 1) :
this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage);
};
/** Whether the previous period button is enabled. */
/**
* Whether the previous period button is enabled.
* @return {?}
*/
MatCalendarHeader.prototype.previousEnabled = /**
* Whether the previous period button is enabled.
* @return {?}
*/
function () {
if (!this.calendar.minDate) {
return true;
}
return !this.calendar.minDate ||
!this._isSameView(this.calendar.activeDate, this.calendar.minDate);
};
/** Whether the next period button is enabled. */
/**
* Whether the next period button is enabled.
* @return {?}
*/
MatCalendarHeader.prototype.nextEnabled = /**
* Whether the next period button is enabled.
* @return {?}
*/
function () {
return !this.calendar.maxDate ||
!this._isSameView(this.calendar.activeDate, this.calendar.maxDate);
};
/**
* Whether the two dates represent the same view in the current view mode (month or year).
* @param {?} date1
* @param {?} date2
* @return {?}
*/
MatCalendarHeader.prototype._isSameView = /**
* Whether the two dates represent the same view in the current view mode (month or year).
* @param {?} date1
* @param {?} date2
* @return {?}
*/
function (date1, date2) {
if (this.calendar.currentView == 'month') {
return this._dateAdapter.getYear(date1) == this._dateAdapter.getYear(date2) &&
this._dateAdapter.getMonth(date1) == this._dateAdapter.getMonth(date2);
}
if (this.calendar.currentView == 'year') {
return this._dateAdapter.getYear(date1) == this._dateAdapter.getYear(date2);
}
// Otherwise we are in 'multi-year' view.
return Math.floor(this._dateAdapter.getYear(date1) / yearsPerPage) ==
Math.floor(this._dateAdapter.getYear(date2) / yearsPerPage);
};
MatCalendarHeader.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-calendar-header',
template: "<div class=\"mat-calendar-header\"><div class=\"mat-calendar-controls\"><button mat-button type=\"button\" class=\"mat-calendar-period-button\" (click)=\"currentPeriodClicked()\" [attr.aria-label]=\"periodButtonLabel\">{{periodButtonText}}<div class=\"mat-calendar-arrow\" [class.mat-calendar-invert]=\"calendar.currentView != 'month'\"></div></button><div class=\"mat-calendar-spacer\"></div><button mat-icon-button type=\"button\" class=\"mat-calendar-previous-button\" [disabled]=\"!previousEnabled()\" (click)=\"previousClicked()\" [attr.aria-label]=\"prevButtonLabel\"></button> <button mat-icon-button type=\"button\" class=\"mat-calendar-next-button\" [disabled]=\"!nextEnabled()\" (click)=\"nextClicked()\" [attr.aria-label]=\"nextButtonLabel\"></button></div></div>",
exportAs: 'matCalendarHeader',
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatCalendarHeader.ctorParameters = function () { return [
{ type: MatDatepickerIntl, },
{ type: MatCalendar, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(function () { return MatCalendar; }),] },] },
{ type: _angular_material_core__WEBPACK_IMPORTED_MODULE_4__["DateAdapter"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["MAT_DATE_FORMATS"],] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
]; };
return MatCalendarHeader;
}());
/**
* A calendar that is used as part of the datepicker.
* \@docs-private
* @template D
*/
var MatCalendar = /** @class */ (function () {
function MatCalendar(_intl, _dateAdapter, _dateFormats, changeDetectorRef) {
var _this = this;
this._dateAdapter = _dateAdapter;
this._dateFormats = _dateFormats;
/**
* Used for scheduling that focus should be moved to the active cell on the next tick.
* We need to schedule it, rather than do it immediately, because we have to wait
* for Angular to re-evaluate the view children.
*/
this._moveFocusOnNextTick = false;
/**
* Whether the calendar should be started in month or year view.
*/
this.startView = 'month';
/**
* Emits when the currently selected date changes.
*/
this.selectedChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits the year chosen in multiyear view.
* This doesn't imply a change on the selected date.
*/
this.yearSelected = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits the month chosen in year view.
* This doesn't imply a change on the selected date.
*/
this.monthSelected = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits when any date is selected.
*/
this._userSelection = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits whenever there is a state change that the header may need to respond to.
*/
this.stateChanges = new rxjs__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
if (!this._dateAdapter) {
throw createMissingDateImplError('DateAdapter');
}
if (!this._dateFormats) {
throw createMissingDateImplError('MAT_DATE_FORMATS');
}
this._intlChanges = _intl.changes.subscribe(function () {
changeDetectorRef.markForCheck();
_this.stateChanges.next();
});
}
Object.defineProperty(MatCalendar.prototype, "startAt", {
get: /**
* A date representing the period (month or year) to start the calendar in.
* @return {?}
*/
function () { return this._startAt; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._startAt = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatCalendar.prototype, "selected", {
get: /**
* The currently selected date.
* @return {?}
*/
function () { return this._selected; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._selected = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatCalendar.prototype, "minDate", {
get: /**
* The minimum selectable date.
* @return {?}
*/
function () { return this._minDate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._minDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatCalendar.prototype, "maxDate", {
get: /**
* The maximum selectable date.
* @return {?}
*/
function () { return this._maxDate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._maxDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatCalendar.prototype, "activeDate", {
/**
* The current active date. This determines which time period is shown and which date is
* highlighted when using keyboard navigation.
*/
get: /**
* The current active date. This determines which time period is shown and which date is
* highlighted when using keyboard navigation.
* @return {?}
*/
function () { return this._clampedActiveDate; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._clampedActiveDate = this._dateAdapter.clampDate(value, this.minDate, this.maxDate);
this.stateChanges.next();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatCalendar.prototype, "currentView", {
/** Whether the calendar is in month view. */
get: /**
* Whether the calendar is in month view.
* @return {?}
*/
function () { return this._currentView; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._currentView = value;
this._moveFocusOnNextTick = true;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatCalendar.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
this._calendarHeaderPortal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__["ComponentPortal"](this.headerComponent || MatCalendarHeader);
this.activeDate = this.startAt || this._dateAdapter.today();
// Assign to the private property since we don't want to move focus on init.
this._currentView = this.startView;
};
/**
* @return {?}
*/
MatCalendar.prototype.ngAfterViewChecked = /**
* @return {?}
*/
function () {
if (this._moveFocusOnNextTick) {
this._moveFocusOnNextTick = false;
this.focusActiveCell();
}
};
/**
* @return {?}
*/
MatCalendar.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._intlChanges.unsubscribe();
this.stateChanges.complete();
};
/**
* @param {?} changes
* @return {?}
*/
MatCalendar.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
var /** @type {?} */ change = changes["minDate"] || changes["maxDate"] || changes["dateFilter"];
if (change && !change.firstChange) {
var /** @type {?} */ view = this._getCurrentViewComponent();
if (view) {
view._init();
}
}
this.stateChanges.next();
};
/**
* @return {?}
*/
MatCalendar.prototype.focusActiveCell = /**
* @return {?}
*/
function () {
this._getCurrentViewComponent()._focusActiveCell();
};
/** Handles date selection in the month view. */
/**
* Handles date selection in the month view.
* @param {?} date
* @return {?}
*/
MatCalendar.prototype._dateSelected = /**
* Handles date selection in the month view.
* @param {?} date
* @return {?}
*/
function (date) {
if (!this._dateAdapter.sameDate(date, this.selected)) {
this.selectedChange.emit(date);
}
};
/** Handles year selection in the multiyear view. */
/**
* Handles year selection in the multiyear view.
* @param {?} normalizedYear
* @return {?}
*/
MatCalendar.prototype._yearSelectedInMultiYearView = /**
* Handles year selection in the multiyear view.
* @param {?} normalizedYear
* @return {?}
*/
function (normalizedYear) {
this.yearSelected.emit(normalizedYear);
};
/** Handles month selection in the year view. */
/**
* Handles month selection in the year view.
* @param {?} normalizedMonth
* @return {?}
*/
MatCalendar.prototype._monthSelectedInYearView = /**
* Handles month selection in the year view.
* @param {?} normalizedMonth
* @return {?}
*/
function (normalizedMonth) {
this.monthSelected.emit(normalizedMonth);
};
/**
* @return {?}
*/
MatCalendar.prototype._userSelected = /**
* @return {?}
*/
function () {
this._userSelection.emit();
};
/** Handles year/month selection in the multi-year/year views. */
/**
* Handles year/month selection in the multi-year/year views.
* @param {?} date
* @param {?} view
* @return {?}
*/
MatCalendar.prototype._goToDateInView = /**
* Handles year/month selection in the multi-year/year views.
* @param {?} date
* @param {?} view
* @return {?}
*/
function (date, view) {
this.activeDate = date;
this.currentView = view;
};
/**
* @param {?} obj The object to check.
* @return {?} The given object if it is both a date instance and valid, otherwise null.
*/
MatCalendar.prototype._getValidDateOrNull = /**
* @param {?} obj The object to check.
* @return {?} The given object if it is both a date instance and valid, otherwise null.
*/
function (obj) {
return (this._dateAdapter.isDateInstance(obj) && this._dateAdapter.isValid(obj)) ? obj : null;
};
/**
* Returns the component instance that corresponds to the current calendar view.
* @return {?}
*/
MatCalendar.prototype._getCurrentViewComponent = /**
* Returns the component instance that corresponds to the current calendar view.
* @return {?}
*/
function () {
return this.monthView || this.yearView || this.multiYearView;
};
MatCalendar.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-calendar',
template: "<ng-template [cdkPortalOutlet]=\"_calendarHeaderPortal\"></ng-template><div class=\"mat-calendar-content\" [ngSwitch]=\"currentView\" cdkMonitorSubtreeFocus tabindex=\"-1\"><mat-month-view *ngSwitchCase=\"'month'\" [(activeDate)]=\"activeDate\" [selected]=\"selected\" [dateFilter]=\"dateFilter\" [maxDate]=\"maxDate\" [minDate]=\"minDate\" (selectedChange)=\"_dateSelected($event)\" (_userSelection)=\"_userSelected()\"></mat-month-view><mat-year-view *ngSwitchCase=\"'year'\" [activeDate]=\"activeDate\" [selected]=\"selected\" [dateFilter]=\"dateFilter\" [maxDate]=\"maxDate\" [minDate]=\"minDate\" (monthSelected)=\"_monthSelectedInYearView($event)\" (selectedChange)=\"_goToDateInView($event, 'month')\"></mat-year-view><mat-multi-year-view *ngSwitchCase=\"'multi-year'\" [activeDate]=\"activeDate\" [selected]=\"selected\" [dateFilter]=\"dateFilter\" [maxDate]=\"maxDate\" [minDate]=\"minDate\" (yearSelected)=\"_yearSelectedInMultiYearView($event)\" (selectedChange)=\"_goToDateInView($event, 'year')\"></mat-multi-year-view></div>",
styles: [".mat-calendar{display:block}.mat-calendar-header{padding:8px 8px 0 8px}.mat-calendar-content{padding:0 8px 8px 8px;outline:0}.mat-calendar-controls{display:flex;margin:5% calc(33% / 7 - 16px)}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0}.mat-calendar-arrow{display:inline-block;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top-width:5px;border-top-style:solid;margin:0 0 0 5px;vertical-align:middle}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}.mat-calendar-next-button,.mat-calendar-previous-button{position:relative}.mat-calendar-next-button::after,.mat-calendar-previous-button::after{top:0;left:0;right:0;bottom:0;position:absolute;content:'';margin:15.5px;border:0 solid currentColor;border-top-width:2px}[dir=rtl] .mat-calendar-next-button,[dir=rtl] .mat-calendar-previous-button{transform:rotate(180deg)}.mat-calendar-previous-button::after{border-left-width:2px;transform:translateX(2px) rotate(-45deg)}.mat-calendar-next-button::after{border-right-width:2px;transform:translateX(-2px) rotate(45deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px 0}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider::after{content:'';position:absolute;top:0;left:-8px;right:-8px;height:1px}"],
host: {
'class': 'mat-calendar',
},
exportAs: 'matCalendar',
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatCalendar.ctorParameters = function () { return [
{ type: MatDatepickerIntl, },
{ type: _angular_material_core__WEBPACK_IMPORTED_MODULE_4__["DateAdapter"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["MAT_DATE_FORMATS"],] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
]; };
MatCalendar.propDecorators = {
"headerComponent": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"startAt": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"startView": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"minDate": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"maxDate": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"dateFilter": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selectedChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"yearSelected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"monthSelected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"_userSelection": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"monthView": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [MatMonthView,] },],
"yearView": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [MatYearView,] },],
"multiYearView": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [MatMultiYearView,] },],
};
return MatCalendar;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Animations used by the Material datepicker.
*/
var /** @type {?} */ matDatepickerAnimations = {
/** Transforms the height of the datepicker's calendar. */
transformPanel: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["trigger"])('transformPanel', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["state"])('void', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["style"])({ opacity: 0, transform: 'scale(1, 0)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["state"])('enter', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["style"])({ opacity: 1, transform: 'scale(1, 1)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["transition"])('void => enter', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["group"])([
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["query"])('@fadeInCalendar', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["animateChild"])()),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["animate"])('400ms cubic-bezier(0.25, 0.8, 0.25, 1)')
])),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["transition"])('* => void', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["animate"])('100ms linear', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["style"])({ opacity: 0 })))
]),
/** Fades in the content of the calendar. */
fadeInCalendar: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["trigger"])('fadeInCalendar', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["state"])('void', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["style"])({ opacity: 0 })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["state"])('enter', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["style"])({ opacity: 1 })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["transition"])('void => *', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_7__["animate"])('400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)'))
])
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Used to generate a unique ID for each datepicker instance.
*/
var /** @type {?} */ datepickerUid = 0;
/**
* Injection token that determines the scroll handling while the calendar is open.
*/
var /** @type {?} */ MAT_DATEPICKER_SCROLL_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('mat-datepicker-scroll-strategy', {
providedIn: 'root',
factory: MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY() {
var /** @type {?} */ overlay = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_10__["Overlay"]);
return function () { return overlay.scrollStrategies.reposition(); };
}
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatDatepickerContentBase = /** @class */ (function () {
function MatDatepickerContentBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatDatepickerContentBase;
}());
var /** @type {?} */ _MatDatepickerContentMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["mixinColor"])(MatDatepickerContentBase);
/**
* Component used as the content for the datepicker dialog and popup. We use this instead of using
* MatCalendar directly as the content so we can control the initial focus. This also gives us a
* place to put additional features of the popup that are not part of the calendar itself in the
* future. (e.g. confirmation buttons).
* \@docs-private
* @template D
*/
var MatDatepickerContent = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_8__["__extends"])(MatDatepickerContent, _super);
function MatDatepickerContent(elementRef, _changeDetectorRef, _ngZone) {
var _this = _super.call(this, elementRef) || this;
_this._changeDetectorRef = _changeDetectorRef;
_this._ngZone = _ngZone;
return _this;
}
/**
* @return {?}
*/
MatDatepickerContent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
if (!this.datepicker._popupRef || this._positionChange) {
return;
}
var /** @type {?} */ positionStrategy = /** @type {?} */ (((this.datepicker._popupRef.getConfig().positionStrategy)));
this._positionChange = positionStrategy.positionChanges.subscribe(function (change) {
var /** @type {?} */ isAbove = change.connectionPair.overlayY === 'bottom';
if (isAbove !== _this._isAbove) {
_this._ngZone.run(function () {
_this._isAbove = isAbove;
_this._changeDetectorRef.markForCheck();
});
}
});
};
/**
* @return {?}
*/
MatDatepickerContent.prototype.ngAfterViewInit = /**
* @return {?}
*/
function () {
this._calendar.focusActiveCell();
};
/**
* @return {?}
*/
MatDatepickerContent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this._positionChange) {
this._positionChange.unsubscribe();
this._positionChange = null;
}
};
MatDatepickerContent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-datepicker-content',
template: "<mat-calendar cdkTrapFocus [id]=\"datepicker.id\" [ngClass]=\"datepicker.panelClass\" [startAt]=\"datepicker.startAt\" [startView]=\"datepicker.startView\" [minDate]=\"datepicker._minDate\" [maxDate]=\"datepicker._maxDate\" [dateFilter]=\"datepicker._dateFilter\" [headerComponent]=\"datepicker.calendarHeaderComponent\" [selected]=\"datepicker._selected\" [@fadeInCalendar]=\"'enter'\" (selectedChange)=\"datepicker._select($event)\" (yearSelected)=\"datepicker._selectYear($event)\" (monthSelected)=\"datepicker._selectMonth($event)\" (_userSelection)=\"datepicker.close()\"></mat-calendar>",
styles: [".mat-datepicker-content{box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);display:block;border-radius:2px;transform-origin:top center}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content-above{transform-origin:bottom center}.mat-datepicker-content-touch{box-shadow:0 0 0 0 rgba(0,0,0,.2),0 0 0 0 rgba(0,0,0,.14),0 0 0 0 rgba(0,0,0,.12);display:block;max-height:80vh;overflow:auto;margin:-24px}.mat-datepicker-content-touch .mat-calendar{min-width:250px;min-height:312px;max-width:750px;max-height:788px}@media all and (orientation:landscape){.mat-datepicker-content-touch .mat-calendar{width:64vh;height:80vh}}@media all and (orientation:portrait){.mat-datepicker-content-touch .mat-calendar{width:80vw;height:100vw}}"],
host: {
'class': 'mat-datepicker-content',
'[@transformPanel]': '"enter"',
'[class.mat-datepicker-content-touch]': 'datepicker.touchUi',
'[class.mat-datepicker-content-above]': '_isAbove',
},
animations: [
matDatepickerAnimations.transformPanel,
matDatepickerAnimations.fadeInCalendar,
],
exportAs: 'matDatepickerContent',
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
inputs: ['color'],
},] },
];
/** @nocollapse */
MatDatepickerContent.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
]; };
MatDatepickerContent.propDecorators = {
"_calendar": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [MatCalendar,] },],
};
return MatDatepickerContent;
}(_MatDatepickerContentMixinBase));
/**
* Component responsible for managing the datepicker popup/dialog.
* @template D
*/
var MatDatepicker = /** @class */ (function () {
function MatDatepicker(_dialog, _overlay, _ngZone, _viewContainerRef, _scrollStrategy, _dateAdapter, _dir, _document) {
this._dialog = _dialog;
this._overlay = _overlay;
this._ngZone = _ngZone;
this._viewContainerRef = _viewContainerRef;
this._scrollStrategy = _scrollStrategy;
this._dateAdapter = _dateAdapter;
this._dir = _dir;
this._document = _document;
/**
* The view that the calendar should start in.
*/
this.startView = 'month';
this._touchUi = false;
/**
* Emits selected year in multiyear view.
* This doesn't imply a change on the selected date.
*/
this.yearSelected = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits selected month in year view.
* This doesn't imply a change on the selected date.
*/
this.monthSelected = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits when the datepicker has been opened.
*/
this.openedStream = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits when the datepicker has been closed.
*/
this.closedStream = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this._opened = false;
/**
* The id for the datepicker calendar.
*/
this.id = "mat-datepicker-" + datepickerUid++;
this._validSelected = null;
/**
* The element that was focused before the datepicker was opened.
*/
this._focusedElementBeforeOpen = null;
/**
* Subscription to value changes in the associated input element.
*/
this._inputSubscription = rxjs__WEBPACK_IMPORTED_MODULE_1__["Subscription"].EMPTY;
/**
* Emits when the datepicker is disabled.
*/
this._disabledChange = new rxjs__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
/**
* Emits new selected date when selected date changes.
*/
this._selectedChanged = new rxjs__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
if (!this._dateAdapter) {
throw createMissingDateImplError('DateAdapter');
}
}
Object.defineProperty(MatDatepicker.prototype, "startAt", {
get: /**
* The date to open the calendar to initially.
* @return {?}
*/
function () {
// If an explicit startAt is set we start there, otherwise we start at whatever the currently
// selected value is.
return this._startAt || (this._datepickerInput ? this._datepickerInput.value : null);
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._startAt = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDatepicker.prototype, "color", {
get: /**
* Color palette to use on the datepicker's calendar.
* @return {?}
*/
function () {
return this._color ||
(this._datepickerInput ? this._datepickerInput._getThemePalette() : undefined);
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._color = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDatepicker.prototype, "touchUi", {
get: /**
* Whether the calendar UI is in touch mode. In touch mode the calendar opens in a dialog rather
* than a popup and elements have more padding to allow for bigger touch targets.
* @return {?}
*/
function () { return this._touchUi; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._touchUi = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_9__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDatepicker.prototype, "disabled", {
get: /**
* Whether the datepicker pop-up should be disabled.
* @return {?}
*/
function () {
return this._disabled === undefined && this._datepickerInput ?
this._datepickerInput.disabled : !!this._disabled;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ newValue = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_9__["coerceBooleanProperty"])(value);
if (newValue !== this._disabled) {
this._disabled = newValue;
this._disabledChange.next(newValue);
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDatepicker.prototype, "opened", {
get: /**
* Whether the calendar is open.
* @return {?}
*/
function () { return this._opened; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { value ? this.open() : this.close(); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatDatepicker.prototype, "_selected", {
/** The currently selected date. */
get: /**
* The currently selected date.
* @return {?}
*/
function () { return this._validSelected; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._validSelected = value; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatDatepicker.prototype, "_minDate", {
/** The minimum selectable date. */
get: /**
* The minimum selectable date.
* @return {?}
*/
function () {
return this._datepickerInput && this._datepickerInput.min;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDatepicker.prototype, "_maxDate", {
/** The maximum selectable date. */
get: /**
* The maximum selectable date.
* @return {?}
*/
function () {
return this._datepickerInput && this._datepickerInput.max;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDatepicker.prototype, "_dateFilter", {
get: /**
* @return {?}
*/
function () {
return this._datepickerInput && this._datepickerInput._dateFilter;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatDatepicker.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.close();
this._inputSubscription.unsubscribe();
this._disabledChange.complete();
if (this._popupRef) {
this._popupRef.dispose();
this._popupComponentRef = null;
}
};
/** Selects the given date */
/**
* Selects the given date
* @param {?} date
* @return {?}
*/
MatDatepicker.prototype._select = /**
* Selects the given date
* @param {?} date
* @return {?}
*/
function (date) {
var /** @type {?} */ oldValue = this._selected;
this._selected = date;
if (!this._dateAdapter.sameDate(oldValue, this._selected)) {
this._selectedChanged.next(date);
}
};
/** Emits the selected year in multiyear view */
/**
* Emits the selected year in multiyear view
* @param {?} normalizedYear
* @return {?}
*/
MatDatepicker.prototype._selectYear = /**
* Emits the selected year in multiyear view
* @param {?} normalizedYear
* @return {?}
*/
function (normalizedYear) {
this.yearSelected.emit(normalizedYear);
};
/** Emits selected month in year view */
/**
* Emits selected month in year view
* @param {?} normalizedMonth
* @return {?}
*/
MatDatepicker.prototype._selectMonth = /**
* Emits selected month in year view
* @param {?} normalizedMonth
* @return {?}
*/
function (normalizedMonth) {
this.monthSelected.emit(normalizedMonth);
};
/**
* Register an input with this datepicker.
* @param input The datepicker input to register with this datepicker.
*/
/**
* Register an input with this datepicker.
* @param {?} input The datepicker input to register with this datepicker.
* @return {?}
*/
MatDatepicker.prototype._registerInput = /**
* Register an input with this datepicker.
* @param {?} input The datepicker input to register with this datepicker.
* @return {?}
*/
function (input) {
var _this = this;
if (this._datepickerInput) {
throw Error('A MatDatepicker can only be associated with a single input.');
}
this._datepickerInput = input;
this._inputSubscription =
this._datepickerInput._valueChange.subscribe(function (value) { return _this._selected = value; });
};
/** Open the calendar. */
/**
* Open the calendar.
* @return {?}
*/
MatDatepicker.prototype.open = /**
* Open the calendar.
* @return {?}
*/
function () {
if (this._opened || this.disabled) {
return;
}
if (!this._datepickerInput) {
throw Error('Attempted to open an MatDatepicker with no associated input.');
}
if (this._document) {
this._focusedElementBeforeOpen = this._document.activeElement;
}
this.touchUi ? this._openAsDialog() : this._openAsPopup();
this._opened = true;
this.openedStream.emit();
};
/** Close the calendar. */
/**
* Close the calendar.
* @return {?}
*/
MatDatepicker.prototype.close = /**
* Close the calendar.
* @return {?}
*/
function () {
var _this = this;
if (!this._opened) {
return;
}
if (this._popupRef && this._popupRef.hasAttached()) {
this._popupRef.detach();
}
if (this._dialogRef) {
this._dialogRef.close();
this._dialogRef = null;
}
if (this._calendarPortal && this._calendarPortal.isAttached) {
this._calendarPortal.detach();
}
var /** @type {?} */ completeClose = function () {
// The `_opened` could've been reset already if
// we got two events in quick succession.
if (_this._opened) {
_this._opened = false;
_this.closedStream.emit();
_this._focusedElementBeforeOpen = null;
}
};
if (this._focusedElementBeforeOpen &&
typeof this._focusedElementBeforeOpen.focus === 'function') {
// Because IE moves focus asynchronously, we can't count on it being restored before we've
// marked the datepicker as closed. If the event fires out of sequence and the element that
// we're refocusing opens the datepicker on focus, the user could be stuck with not being
// able to close the calendar at all. We work around it by making the logic, that marks
// the datepicker as closed, async as well.
this._focusedElementBeforeOpen.focus();
setTimeout(completeClose);
}
else {
completeClose();
}
};
/**
* Open the calendar as a dialog.
* @return {?}
*/
MatDatepicker.prototype._openAsDialog = /**
* Open the calendar as a dialog.
* @return {?}
*/
function () {
var _this = this;
this._dialogRef = this._dialog.open(MatDatepickerContent, {
direction: this._getDirection(),
viewContainerRef: this._viewContainerRef,
panelClass: 'mat-datepicker-dialog',
});
this._dialogRef.afterClosed().subscribe(function () { return _this.close(); });
this._dialogRef.componentInstance.datepicker = this;
this._setColor();
};
/**
* Open the calendar as a popup.
* @return {?}
*/
MatDatepicker.prototype._openAsPopup = /**
* Open the calendar as a popup.
* @return {?}
*/
function () {
var _this = this;
if (!this._calendarPortal) {
this._calendarPortal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__["ComponentPortal"](MatDatepickerContent, this._viewContainerRef);
}
if (!this._popupRef) {
this._createPopup();
}
if (!this._popupRef.hasAttached()) {
this._popupRef.setDirection(this._getDirection());
this._popupComponentRef = this._popupRef.attach(this._calendarPortal);
this._popupComponentRef.instance.datepicker = this;
this._setColor();
// Update the position once the calendar has rendered.
this._ngZone.onStable.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["take"])(1)).subscribe(function () {
_this._popupRef.updatePosition();
});
}
};
/**
* Create the popup.
* @return {?}
*/
MatDatepicker.prototype._createPopup = /**
* Create the popup.
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ overlayConfig = new _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_10__["OverlayConfig"]({
positionStrategy: this._createPopupPositionStrategy(),
hasBackdrop: true,
backdropClass: 'mat-overlay-transparent-backdrop',
direction: this._getDirection(),
scrollStrategy: this._scrollStrategy(),
panelClass: 'mat-datepicker-popup',
});
this._popupRef = this._overlay.create(overlayConfig);
Object(rxjs__WEBPACK_IMPORTED_MODULE_1__["merge"])(this._popupRef.backdropClick(), this._popupRef.detachments(), this._popupRef.keydownEvents().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["filter"])(function (event) {
// Closing on alt + up is only valid when there's an input associated with the datepicker.
return event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["ESCAPE"] ||
(_this._datepickerInput && event.altKey && event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["UP_ARROW"]);
}))).subscribe(function () { return _this.close(); });
};
/**
* Create the popup PositionStrategy.
* @return {?}
*/
MatDatepicker.prototype._createPopupPositionStrategy = /**
* Create the popup PositionStrategy.
* @return {?}
*/
function () {
return this._overlay.position()
.flexibleConnectedTo(this._datepickerInput.getPopupConnectionElementRef())
.withFlexibleDimensions(false)
.withViewportMargin(8)
.withPush(false)
.withPositions([
{
originX: 'start',
originY: 'bottom',
overlayX: 'start',
overlayY: 'top'
},
{
originX: 'start',
originY: 'top',
overlayX: 'start',
overlayY: 'bottom'
},
{
originX: 'end',
originY: 'bottom',
overlayX: 'end',
overlayY: 'top'
},
{
originX: 'end',
originY: 'top',
overlayX: 'end',
overlayY: 'bottom'
}
]);
};
/**
* @param {?} obj The object to check.
* @return {?} The given object if it is both a date instance and valid, otherwise null.
*/
MatDatepicker.prototype._getValidDateOrNull = /**
* @param {?} obj The object to check.
* @return {?} The given object if it is both a date instance and valid, otherwise null.
*/
function (obj) {
return (this._dateAdapter.isDateInstance(obj) && this._dateAdapter.isValid(obj)) ? obj : null;
};
/**
* Passes the current theme color along to the calendar overlay.
* @return {?}
*/
MatDatepicker.prototype._setColor = /**
* Passes the current theme color along to the calendar overlay.
* @return {?}
*/
function () {
var /** @type {?} */ color = this.color;
if (this._popupComponentRef) {
this._popupComponentRef.instance.color = color;
}
if (this._dialogRef) {
this._dialogRef.componentInstance.color = color;
}
};
/**
* Returns the layout direction of the datepicker.
* @return {?}
*/
MatDatepicker.prototype._getDirection = /**
* Returns the layout direction of the datepicker.
* @return {?}
*/
function () {
return this._dir ? this._dir.value : 'ltr';
};
MatDatepicker.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-datepicker',
template: '',
exportAs: 'matDatepicker',
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatDatepicker.ctorParameters = function () { return [
{ type: _angular_material_dialog__WEBPACK_IMPORTED_MODULE_12__["MatDialog"], },
{ type: _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_10__["Overlay"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [MAT_DATEPICKER_SCROLL_STRATEGY,] },] },
{ type: _angular_material_core__WEBPACK_IMPORTED_MODULE_4__["DateAdapter"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_5__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_11__["DOCUMENT"],] },] },
]; };
MatDatepicker.propDecorators = {
"calendarHeaderComponent": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"startAt": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"startView": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"color": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"touchUi": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"yearSelected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"monthSelected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"panelClass": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"openedStream": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['opened',] },],
"closedStream": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['closed',] },],
"opened": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatDatepicker;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ MAT_DATEPICKER_VALUE_ACCESSOR = {
provide: _angular_forms__WEBPACK_IMPORTED_MODULE_13__["NG_VALUE_ACCESSOR"],
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(function () { return MatDatepickerInput; }),
multi: true
};
var /** @type {?} */ MAT_DATEPICKER_VALIDATORS = {
provide: _angular_forms__WEBPACK_IMPORTED_MODULE_13__["NG_VALIDATORS"],
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(function () { return MatDatepickerInput; }),
multi: true
};
/**
* An event used for datepicker input and change events. We don't always have access to a native
* input or change event because the event may have been triggered by the user clicking on the
* calendar popup. For consistency, we always use MatDatepickerInputEvent instead.
* @template D
*/
var /**
* An event used for datepicker input and change events. We don't always have access to a native
* input or change event because the event may have been triggered by the user clicking on the
* calendar popup. For consistency, we always use MatDatepickerInputEvent instead.
* @template D
*/
MatDatepickerInputEvent = /** @class */ (function () {
function MatDatepickerInputEvent(target, targetElement) {
this.target = target;
this.targetElement = targetElement;
this.value = this.target.value;
}
return MatDatepickerInputEvent;
}());
/**
* Directive used to connect an input to a MatDatepicker.
* @template D
*/
var MatDatepickerInput = /** @class */ (function () {
function MatDatepickerInput(_elementRef, _dateAdapter, _dateFormats, _formField) {
var _this = this;
this._elementRef = _elementRef;
this._dateAdapter = _dateAdapter;
this._dateFormats = _dateFormats;
this._formField = _formField;
/**
* Emits when a `change` event is fired on this `<input>`.
*/
this.dateChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits when an `input` event is fired on this `<input>`.
*/
this.dateInput = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits when the value changes (either due to user input or programmatic change).
*/
this._valueChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Emits when the disabled state has changed
*/
this._disabledChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this._onTouched = function () { };
this._cvaOnChange = function () { };
this._validatorOnChange = function () { };
this._datepickerSubscription = rxjs__WEBPACK_IMPORTED_MODULE_1__["Subscription"].EMPTY;
this._localeSubscription = rxjs__WEBPACK_IMPORTED_MODULE_1__["Subscription"].EMPTY;
/**
* The form control validator for whether the input parses.
*/
this._parseValidator = function () {
return _this._lastValueValid ?
null : { 'matDatepickerParse': { 'text': _this._elementRef.nativeElement.value } };
};
/**
* The form control validator for the min date.
*/
this._minValidator = function (control) {
var /** @type {?} */ controlValue = _this._getValidDateOrNull(_this._dateAdapter.deserialize(control.value));
return (!_this.min || !controlValue ||
_this._dateAdapter.compareDate(_this.min, controlValue) <= 0) ?
null : { 'matDatepickerMin': { 'min': _this.min, 'actual': controlValue } };
};
/**
* The form control validator for the max date.
*/
this._maxValidator = function (control) {
var /** @type {?} */ controlValue = _this._getValidDateOrNull(_this._dateAdapter.deserialize(control.value));
return (!_this.max || !controlValue ||
_this._dateAdapter.compareDate(_this.max, controlValue) >= 0) ?
null : { 'matDatepickerMax': { 'max': _this.max, 'actual': controlValue } };
};
/**
* The form control validator for the date filter.
*/
this._filterValidator = function (control) {
var /** @type {?} */ controlValue = _this._getValidDateOrNull(_this._dateAdapter.deserialize(control.value));
return !_this._dateFilter || !controlValue || _this._dateFilter(controlValue) ?
null : { 'matDatepickerFilter': true };
};
/**
* The combined form control validator for this input.
*/
this._validator = _angular_forms__WEBPACK_IMPORTED_MODULE_13__["Validators"].compose([this._parseValidator, this._minValidator, this._maxValidator, this._filterValidator]);
/**
* Whether the last value set on the input was valid.
*/
this._lastValueValid = false;
if (!this._dateAdapter) {
throw createMissingDateImplError('DateAdapter');
}
if (!this._dateFormats) {
throw createMissingDateImplError('MAT_DATE_FORMATS');
}
// Update the displayed date when the locale changes.
this._localeSubscription = _dateAdapter.localeChanges.subscribe(function () {
_this.value = _this.value;
});
}
Object.defineProperty(MatDatepickerInput.prototype, "matDatepicker", {
set: /**
* The datepicker that this input is associated with.
* @param {?} value
* @return {?}
*/
function (value) {
this.registerDatepicker(value);
},
enumerable: true,
configurable: true
});
/**
* @param {?} value
* @return {?}
*/
MatDatepickerInput.prototype.registerDatepicker = /**
* @param {?} value
* @return {?}
*/
function (value) {
if (value) {
this._datepicker = value;
this._datepicker._registerInput(this);
}
};
Object.defineProperty(MatDatepickerInput.prototype, "matDatepickerFilter", {
set: /**
* Function that can be used to filter out dates within the datepicker.
* @param {?} value
* @return {?}
*/
function (value) {
this._dateFilter = value;
this._validatorOnChange();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDatepickerInput.prototype, "value", {
get: /**
* The value of the input.
* @return {?}
*/
function () { return this._value; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
value = this._dateAdapter.deserialize(value);
this._lastValueValid = !value || this._dateAdapter.isValid(value);
value = this._getValidDateOrNull(value);
var /** @type {?} */ oldDate = this.value;
this._value = value;
this._formatValue(value);
if (!this._dateAdapter.sameDate(oldDate, value)) {
this._valueChange.emit(value);
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDatepickerInput.prototype, "min", {
get: /**
* The minimum valid date.
* @return {?}
*/
function () { return this._min; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._min = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
this._validatorOnChange();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDatepickerInput.prototype, "max", {
get: /**
* The maximum valid date.
* @return {?}
*/
function () { return this._max; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._max = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
this._validatorOnChange();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDatepickerInput.prototype, "disabled", {
get: /**
* Whether the datepicker-input is disabled.
* @return {?}
*/
function () { return !!this._disabled; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ newValue = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_9__["coerceBooleanProperty"])(value);
var /** @type {?} */ element = this._elementRef.nativeElement;
if (this._disabled !== newValue) {
this._disabled = newValue;
this._disabledChange.emit(newValue);
}
// We need to null check the `blur` method, because it's undefined during SSR.
if (newValue && element.blur) {
// Normally, native input elements automatically blur if they turn disabled. This behavior
// is problematic, because it would mean that it triggers another change detection cycle,
// which then causes a changed after checked error if the input element was focused before.
element.blur();
}
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatDatepickerInput.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
if (this._datepicker) {
this._datepickerSubscription = this._datepicker._selectedChanged.subscribe(function (selected) {
_this.value = selected;
_this._cvaOnChange(selected);
_this._onTouched();
_this.dateInput.emit(new MatDatepickerInputEvent(_this, _this._elementRef.nativeElement));
_this.dateChange.emit(new MatDatepickerInputEvent(_this, _this._elementRef.nativeElement));
});
}
};
/**
* @return {?}
*/
MatDatepickerInput.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._datepickerSubscription.unsubscribe();
this._localeSubscription.unsubscribe();
this._valueChange.complete();
this._disabledChange.complete();
};
/** @docs-private */
/**
* \@docs-private
* @param {?} fn
* @return {?}
*/
MatDatepickerInput.prototype.registerOnValidatorChange = /**
* \@docs-private
* @param {?} fn
* @return {?}
*/
function (fn) {
this._validatorOnChange = fn;
};
/** @docs-private */
/**
* \@docs-private
* @param {?} c
* @return {?}
*/
MatDatepickerInput.prototype.validate = /**
* \@docs-private
* @param {?} c
* @return {?}
*/
function (c) {
return this._validator ? this._validator(c) : null;
};
/**
* @deprecated
* @deletion-target 7.0.0 Use `getConnectedOverlayOrigin` instead
*/
/**
* @deprecated
* \@deletion-target 7.0.0 Use `getConnectedOverlayOrigin` instead
* @return {?}
*/
MatDatepickerInput.prototype.getPopupConnectionElementRef = /**
* @deprecated
* \@deletion-target 7.0.0 Use `getConnectedOverlayOrigin` instead
* @return {?}
*/
function () {
return this.getConnectedOverlayOrigin();
};
/**
* Gets the element that the datepicker popup should be connected to.
* @return The element to connect the popup to.
*/
/**
* Gets the element that the datepicker popup should be connected to.
* @return {?} The element to connect the popup to.
*/
MatDatepickerInput.prototype.getConnectedOverlayOrigin = /**
* Gets the element that the datepicker popup should be connected to.
* @return {?} The element to connect the popup to.
*/
function () {
return this._formField ? this._formField.getConnectedOverlayOrigin() : this._elementRef;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} value
* @return {?}
*/
MatDatepickerInput.prototype.writeValue = /**
* @param {?} value
* @return {?}
*/
function (value) {
this.value = value;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} fn
* @return {?}
*/
MatDatepickerInput.prototype.registerOnChange = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this._cvaOnChange = fn;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} fn
* @return {?}
*/
MatDatepickerInput.prototype.registerOnTouched = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this._onTouched = fn;
};
// Implemented as part of ControlValueAccessor.
/**
* @param {?} isDisabled
* @return {?}
*/
MatDatepickerInput.prototype.setDisabledState = /**
* @param {?} isDisabled
* @return {?}
*/
function (isDisabled) {
this.disabled = isDisabled;
};
/**
* @param {?} event
* @return {?}
*/
MatDatepickerInput.prototype._onKeydown = /**
* @param {?} event
* @return {?}
*/
function (event) {
if (event.altKey && event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_3__["DOWN_ARROW"]) {
this._datepicker.open();
event.preventDefault();
}
};
/**
* @param {?} value
* @return {?}
*/
MatDatepickerInput.prototype._onInput = /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ date = this._dateAdapter.parse(value, this._dateFormats.parse.dateInput);
this._lastValueValid = !date || this._dateAdapter.isValid(date);
date = this._getValidDateOrNull(date);
if (!this._dateAdapter.sameDate(date, this._value)) {
this._value = date;
this._cvaOnChange(date);
this._valueChange.emit(date);
this.dateInput.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
}
};
/**
* @return {?}
*/
MatDatepickerInput.prototype._onChange = /**
* @return {?}
*/
function () {
this.dateChange.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
};
/** Returns the palette used by the input's form field, if any. */
/**
* Returns the palette used by the input's form field, if any.
* @return {?}
*/
MatDatepickerInput.prototype._getThemePalette = /**
* Returns the palette used by the input's form field, if any.
* @return {?}
*/
function () {
return this._formField ? this._formField.color : undefined;
};
/** Handles blur events on the input. */
/**
* Handles blur events on the input.
* @return {?}
*/
MatDatepickerInput.prototype._onBlur = /**
* Handles blur events on the input.
* @return {?}
*/
function () {
// Reformat the input only if we have a valid value.
if (this.value) {
this._formatValue(this.value);
}
this._onTouched();
};
/**
* Formats a value and sets it on the input element.
* @param {?} value
* @return {?}
*/
MatDatepickerInput.prototype._formatValue = /**
* Formats a value and sets it on the input element.
* @param {?} value
* @return {?}
*/
function (value) {
this._elementRef.nativeElement.value =
value ? this._dateAdapter.format(value, this._dateFormats.display.dateInput) : '';
};
/**
* @param {?} obj The object to check.
* @return {?} The given object if it is both a date instance and valid, otherwise null.
*/
MatDatepickerInput.prototype._getValidDateOrNull = /**
* @param {?} obj The object to check.
* @return {?} The given object if it is both a date instance and valid, otherwise null.
*/
function (obj) {
return (this._dateAdapter.isDateInstance(obj) && this._dateAdapter.isValid(obj)) ? obj : null;
};
MatDatepickerInput.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'input[matDatepicker]',
providers: [
MAT_DATEPICKER_VALUE_ACCESSOR,
MAT_DATEPICKER_VALIDATORS,
{ provide: _angular_material_input__WEBPACK_IMPORTED_MODULE_15__["MAT_INPUT_VALUE_ACCESSOR"], useExisting: MatDatepickerInput },
],
host: {
'[attr.aria-haspopup]': 'true',
'[attr.aria-owns]': '(_datepicker?.opened && _datepicker.id) || null',
'[attr.min]': 'min ? _dateAdapter.toIso8601(min) : null',
'[attr.max]': 'max ? _dateAdapter.toIso8601(max) : null',
'[disabled]': 'disabled',
'(input)': '_onInput($event.target.value)',
'(change)': '_onChange()',
'(blur)': '_onBlur()',
'(keydown)': '_onKeydown($event)',
},
exportAs: 'matDatepickerInput',
},] },
];
/** @nocollapse */
MatDatepickerInput.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_material_core__WEBPACK_IMPORTED_MODULE_4__["DateAdapter"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["MAT_DATE_FORMATS"],] },] },
{ type: _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["MatFormField"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
MatDatepickerInput.propDecorators = {
"matDatepicker": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"matDatepickerFilter": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"min": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"max": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"dateChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"dateInput": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
return MatDatepickerInput;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Can be used to override the icon of a `matDatepickerToggle`.
*/
var MatDatepickerToggleIcon = /** @class */ (function () {
function MatDatepickerToggleIcon() {
}
MatDatepickerToggleIcon.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[matDatepickerToggleIcon]'
},] },
];
return MatDatepickerToggleIcon;
}());
/**
* @template D
*/
var MatDatepickerToggle = /** @class */ (function () {
function MatDatepickerToggle(_intl, _changeDetectorRef) {
this._intl = _intl;
this._changeDetectorRef = _changeDetectorRef;
this._stateChanges = rxjs__WEBPACK_IMPORTED_MODULE_1__["Subscription"].EMPTY;
}
Object.defineProperty(MatDatepickerToggle.prototype, "disabled", {
get: /**
* Whether the toggle button is disabled.
* @return {?}
*/
function () {
return this._disabled === undefined ? this.datepicker.disabled : !!this._disabled;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._disabled = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_9__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
/**
* @param {?} changes
* @return {?}
*/
MatDatepickerToggle.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes["datepicker"]) {
this._watchStateChanges();
}
};
/**
* @return {?}
*/
MatDatepickerToggle.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._stateChanges.unsubscribe();
};
/**
* @return {?}
*/
MatDatepickerToggle.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
this._watchStateChanges();
};
/**
* @param {?} event
* @return {?}
*/
MatDatepickerToggle.prototype._open = /**
* @param {?} event
* @return {?}
*/
function (event) {
if (this.datepicker && !this.disabled) {
this.datepicker.open();
event.stopPropagation();
}
};
/**
* @return {?}
*/
MatDatepickerToggle.prototype._watchStateChanges = /**
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ datepickerDisabled = this.datepicker ? this.datepicker._disabledChange : Object(rxjs__WEBPACK_IMPORTED_MODULE_1__["of"])();
var /** @type {?} */ inputDisabled = this.datepicker && this.datepicker._datepickerInput ?
this.datepicker._datepickerInput._disabledChange : Object(rxjs__WEBPACK_IMPORTED_MODULE_1__["of"])();
var /** @type {?} */ datepickerToggled = this.datepicker ?
Object(rxjs__WEBPACK_IMPORTED_MODULE_1__["merge"])(this.datepicker.openedStream, this.datepicker.closedStream) :
Object(rxjs__WEBPACK_IMPORTED_MODULE_1__["of"])();
this._stateChanges.unsubscribe();
this._stateChanges = Object(rxjs__WEBPACK_IMPORTED_MODULE_1__["merge"])(this._intl.changes, datepickerDisabled, inputDisabled, datepickerToggled).subscribe(function () { return _this._changeDetectorRef.markForCheck(); });
};
MatDatepickerToggle.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-datepicker-toggle',
template: "<button mat-icon-button type=\"button\" [attr.aria-label]=\"_intl.openCalendarLabel\" [disabled]=\"disabled\" (click)=\"_open($event)\"><svg *ngIf=\"!_customIcon\" class=\"mat-datepicker-toggle-default-icon\" viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\"/></svg><ng-content select=\"[matDatepickerToggleIcon]\"></ng-content></button>",
styles: [".mat-form-field-appearance-legacy .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-datepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-datepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-datepicker-toggle-default-icon{margin:auto}"],
host: {
'class': 'mat-datepicker-toggle',
'[class.mat-datepicker-toggle-active]': 'datepicker && datepicker.opened',
'[class.mat-accent]': 'datepicker && datepicker.color === "accent"',
'[class.mat-warn]': 'datepicker && datepicker.color === "warn"',
},
exportAs: 'matDatepickerToggle',
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatDatepickerToggle.ctorParameters = function () { return [
{ type: MatDatepickerIntl, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
]; };
MatDatepickerToggle.propDecorators = {
"datepicker": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['for',] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"_customIcon": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChild"], args: [MatDatepickerToggleIcon,] },],
};
return MatDatepickerToggle;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatDatepickerModule = /** @class */ (function () {
function MatDatepickerModule() {
}
MatDatepickerModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_11__["CommonModule"],
_angular_material_button__WEBPACK_IMPORTED_MODULE_17__["MatButtonModule"],
_angular_material_dialog__WEBPACK_IMPORTED_MODULE_12__["MatDialogModule"],
_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_10__["OverlayModule"],
_angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_16__["A11yModule"],
_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__["PortalModule"],
],
exports: [
MatCalendar,
MatCalendarBody,
MatDatepicker,
MatDatepickerContent,
MatDatepickerInput,
MatDatepickerToggle,
MatDatepickerToggleIcon,
MatMonthView,
MatYearView,
MatMultiYearView,
MatCalendarHeader,
],
declarations: [
MatCalendar,
MatCalendarBody,
MatDatepicker,
MatDatepickerContent,
MatDatepickerInput,
MatDatepickerToggle,
MatDatepickerToggleIcon,
MatMonthView,
MatYearView,
MatMultiYearView,
MatCalendarHeader,
],
providers: [
MatDatepickerIntl,
],
entryComponents: [
MatDatepickerContent,
MatCalendarHeader,
]
},] },
];
return MatDatepickerModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=datepicker.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/dialog.es5.js":
/*!***********************************************************!*\
!*** ./node_modules/@angular/material/esm5/dialog.es5.js ***!
\***********************************************************/
/*! exports provided: MatDialogModule, MAT_DIALOG_DATA, MAT_DIALOG_DEFAULT_OPTIONS, MAT_DIALOG_SCROLL_STRATEGY, MAT_DIALOG_SCROLL_STRATEGY_FACTORY, MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY, MAT_DIALOG_SCROLL_STRATEGY_PROVIDER, MatDialog, throwMatDialogContentAlreadyAttachedError, MatDialogContainer, MatDialogClose, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogConfig, MatDialogRef, matDialogAnimations */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDialogModule", function() { return MatDialogModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DIALOG_DATA", function() { return MAT_DIALOG_DATA; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DIALOG_DEFAULT_OPTIONS", function() { return MAT_DIALOG_DEFAULT_OPTIONS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DIALOG_SCROLL_STRATEGY", function() { return MAT_DIALOG_SCROLL_STRATEGY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DIALOG_SCROLL_STRATEGY_FACTORY", function() { return MAT_DIALOG_SCROLL_STRATEGY_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY", function() { return MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DIALOG_SCROLL_STRATEGY_PROVIDER", function() { return MAT_DIALOG_SCROLL_STRATEGY_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDialog", function() { return MatDialog; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwMatDialogContentAlreadyAttachedError", function() { return throwMatDialogContentAlreadyAttachedError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDialogContainer", function() { return MatDialogContainer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDialogClose", function() { return MatDialogClose; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDialogTitle", function() { return MatDialogTitle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDialogContent", function() { return MatDialogContent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDialogActions", function() { return MatDialogActions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDialogConfig", function() { return MatDialogConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDialogRef", function() { return MatDialogRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matDialogAnimations", function() { return matDialogAnimations; });
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/portal */ "./node_modules/@angular/cdk/esm5/portal.es5.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/cdk/overlay */ "./node_modules/@angular/cdk/esm5/overlay.es5.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Configuration for opening a modal dialog with the MatDialog service.
* @template D
*/
var /**
* Configuration for opening a modal dialog with the MatDialog service.
* @template D
*/
MatDialogConfig = /** @class */ (function () {
function MatDialogConfig() {
/**
* The ARIA role of the dialog element.
*/
this.role = 'dialog';
/**
* Custom class for the overlay pane.
*/
this.panelClass = '';
/**
* Whether the dialog has a backdrop.
*/
this.hasBackdrop = true;
/**
* Custom class for the backdrop,
*/
this.backdropClass = '';
/**
* Whether the user can use escape or clicking outside to close a modal.
*/
this.disableClose = false;
/**
* Width of the dialog.
*/
this.width = '';
/**
* Height of the dialog.
*/
this.height = '';
/**
* Max-width of the dialog. If a number is provided, pixel units are assumed. Defaults to 80vw
*/
this.maxWidth = '80vw';
/**
* Data being injected into the child component.
*/
this.data = null;
/**
* ID of the element that describes the dialog.
*/
this.ariaDescribedBy = null;
/**
* Aria label to assign to the dialog element
*/
this.ariaLabel = null;
/**
* Whether the dialog should focus the first focusable element on open.
*/
this.autoFocus = true;
/**
* Whether the dialog should close when the user goes backwards/forwards in history.
*/
this.closeOnNavigation = true;
}
return MatDialogConfig;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Animations used by MatDialog.
*/
var /** @type {?} */ matDialogAnimations = {
/** Animation that slides the dialog in and out of view and fades the opacity. */
slideDialog: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["trigger"])('slideDialog', [
// Note: The `enter` animation doesn't transition to something like `translate3d(0, 0, 0)
// scale(1)`, because for some reason specifying the transform explicitly, causes IE both
// to blur the dialog content and decimate the animation performance. Leaving it as `none`
// solves both issues.
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["state"])('enter', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({ transform: 'none', opacity: 1 })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["state"])('void', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({ transform: 'translate3d(0, 25%, 0) scale(0.9)', opacity: 0 })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["state"])('exit', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({ transform: 'translate3d(0, 25%, 0)', opacity: 0 })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["transition"])('* => *', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["animate"])('400ms cubic-bezier(0.25, 0.8, 0.25, 1)')),
])
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Throws an exception for the case when a ComponentPortal is
* attached to a DomPortalOutlet without an origin.
* \@docs-private
* @return {?}
*/
function throwMatDialogContentAlreadyAttachedError() {
throw Error('Attempting to attach dialog content after content is already attached');
}
/**
* Internal component that wraps user-provided dialog content.
* Animation is based on https://material.io/guidelines/motion/choreography.html.
* \@docs-private
*/
var MatDialogContainer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatDialogContainer, _super);
function MatDialogContainer(_elementRef, _focusTrapFactory, _changeDetectorRef, _document) {
var _this = _super.call(this) || this;
_this._elementRef = _elementRef;
_this._focusTrapFactory = _focusTrapFactory;
_this._changeDetectorRef = _changeDetectorRef;
_this._document = _document;
/**
* Element that was focused before the dialog was opened. Save this to restore upon close.
*/
_this._elementFocusedBeforeDialogWasOpened = null;
/**
* State of the dialog animation.
*/
_this._state = 'enter';
/**
* Emits when an animation state changes.
*/
_this._animationStateChanged = new _angular_core__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"]();
/**
* ID of the element that should be considered as the dialog's label.
*/
_this._ariaLabelledBy = null;
return _this;
}
/**
* Attach a ComponentPortal as content to this dialog container.
* @param portal Portal to be attached as the dialog content.
*/
/**
* Attach a ComponentPortal as content to this dialog container.
* @template T
* @param {?} portal Portal to be attached as the dialog content.
* @return {?}
*/
MatDialogContainer.prototype.attachComponentPortal = /**
* Attach a ComponentPortal as content to this dialog container.
* @template T
* @param {?} portal Portal to be attached as the dialog content.
* @return {?}
*/
function (portal) {
if (this._portalOutlet.hasAttached()) {
throwMatDialogContentAlreadyAttachedError();
}
this._savePreviouslyFocusedElement();
return this._portalOutlet.attachComponentPortal(portal);
};
/**
* Attach a TemplatePortal as content to this dialog container.
* @param portal Portal to be attached as the dialog content.
*/
/**
* Attach a TemplatePortal as content to this dialog container.
* @template C
* @param {?} portal Portal to be attached as the dialog content.
* @return {?}
*/
MatDialogContainer.prototype.attachTemplatePortal = /**
* Attach a TemplatePortal as content to this dialog container.
* @template C
* @param {?} portal Portal to be attached as the dialog content.
* @return {?}
*/
function (portal) {
if (this._portalOutlet.hasAttached()) {
throwMatDialogContentAlreadyAttachedError();
}
this._savePreviouslyFocusedElement();
return this._portalOutlet.attachTemplatePortal(portal);
};
/**
* Moves the focus inside the focus trap.
* @return {?}
*/
MatDialogContainer.prototype._trapFocus = /**
* Moves the focus inside the focus trap.
* @return {?}
*/
function () {
if (!this._focusTrap) {
this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
}
// If were to attempt to focus immediately, then the content of the dialog would not yet be
// ready in instances where change detection has to run first. To deal with this, we simply
// wait for the microtask queue to be empty.
if (this._config.autoFocus) {
this._focusTrap.focusInitialElementWhenReady();
}
};
/**
* Restores focus to the element that was focused before the dialog opened.
* @return {?}
*/
MatDialogContainer.prototype._restoreFocus = /**
* Restores focus to the element that was focused before the dialog opened.
* @return {?}
*/
function () {
var /** @type {?} */ toFocus = this._elementFocusedBeforeDialogWasOpened;
// We need the extra check, because IE can set the `activeElement` to null in some cases.
if (toFocus && typeof toFocus.focus === 'function') {
toFocus.focus();
}
if (this._focusTrap) {
this._focusTrap.destroy();
}
};
/**
* Saves a reference to the element that was focused before the dialog was opened.
* @return {?}
*/
MatDialogContainer.prototype._savePreviouslyFocusedElement = /**
* Saves a reference to the element that was focused before the dialog was opened.
* @return {?}
*/
function () {
var _this = this;
if (this._document) {
this._elementFocusedBeforeDialogWasOpened = /** @type {?} */ (this._document.activeElement);
// Note that there is no focus method when rendering on the server.
if (this._elementRef.nativeElement.focus) {
// Move focus onto the dialog immediately in order to prevent the user from accidentally
// opening multiple dialogs at the same time. Needs to be async, because the element
// may not be focusable immediately.
Promise.resolve().then(function () { return _this._elementRef.nativeElement.focus(); });
}
}
};
/** Callback, invoked whenever an animation on the host completes. */
/**
* Callback, invoked whenever an animation on the host completes.
* @param {?} event
* @return {?}
*/
MatDialogContainer.prototype._onAnimationDone = /**
* Callback, invoked whenever an animation on the host completes.
* @param {?} event
* @return {?}
*/
function (event) {
if (event.toState === 'enter') {
this._trapFocus();
}
else if (event.toState === 'exit') {
this._restoreFocus();
}
this._animationStateChanged.emit(event);
};
/** Callback, invoked when an animation on the host starts. */
/**
* Callback, invoked when an animation on the host starts.
* @param {?} event
* @return {?}
*/
MatDialogContainer.prototype._onAnimationStart = /**
* Callback, invoked when an animation on the host starts.
* @param {?} event
* @return {?}
*/
function (event) {
this._animationStateChanged.emit(event);
};
/** Starts the dialog exit animation. */
/**
* Starts the dialog exit animation.
* @return {?}
*/
MatDialogContainer.prototype._startExitAnimation = /**
* Starts the dialog exit animation.
* @return {?}
*/
function () {
this._state = 'exit';
// Mark the container for check so it can react if the
// view container is using OnPush change detection.
this._changeDetectorRef.markForCheck();
};
MatDialogContainer.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Component"], args: [{selector: 'mat-dialog-container',
template: "<ng-template cdkPortalOutlet></ng-template>",
styles: [".mat-dialog-container{box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);display:block;padding:24px;border-radius:2px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}@media screen and (-ms-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:12px 0;display:flex;flex-wrap:wrap;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+.mat-button,.mat-dialog-actions .mat-button+.mat-raised-button,.mat-dialog-actions .mat-raised-button+.mat-button,.mat-dialog-actions .mat-raised-button+.mat-raised-button{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button+.mat-button,[dir=rtl] .mat-dialog-actions .mat-button+.mat-raised-button,[dir=rtl] .mat-dialog-actions .mat-raised-button+.mat-button,[dir=rtl] .mat-dialog-actions .mat-raised-button+.mat-raised-button{margin-left:0;margin-right:8px}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewEncapsulation"].None,
// Using OnPush for dialogs caused some G3 sync issues. Disabled until we can track them down.
// tslint:disable-next-line:validate-decorators
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ChangeDetectionStrategy"].Default,
animations: [matDialogAnimations.slideDialog],
host: {
'class': 'mat-dialog-container',
'tabindex': '-1',
'[attr.id]': '_id',
'[attr.role]': '_config?.role',
'[attr.aria-labelledby]': '_config?.ariaLabel ? null : _ariaLabelledBy',
'[attr.aria-label]': '_config?.ariaLabel',
'[attr.aria-describedby]': '_config?.ariaDescribedBy || null',
'[@slideDialog]': '_state',
'(@slideDialog.start)': '_onAnimationStart($event)',
'(@slideDialog.done)': '_onAnimationDone($event)',
},
},] },
];
/** @nocollapse */
MatDialogContainer.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ElementRef"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_5__["FocusTrapFactory"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ChangeDetectorRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"],] },] },
]; };
MatDialogContainer.propDecorators = {
"_portalOutlet": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewChild"], args: [_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_4__["CdkPortalOutlet"],] },],
};
return MatDialogContainer;
}(_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_4__["BasePortalOutlet"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
// TODO(jelbourn): resizing
// Counter for unique dialog ids.
var /** @type {?} */ uniqueId = 0;
/**
* Reference to a dialog opened via the MatDialog service.
* @template T, R
*/
var /**
* Reference to a dialog opened via the MatDialog service.
* @template T, R
*/
MatDialogRef = /** @class */ (function () {
function MatDialogRef(_overlayRef, _containerInstance, location, id) {
if (id === void 0) { id = "mat-dialog-" + uniqueId++; }
var _this = this;
this._overlayRef = _overlayRef;
this._containerInstance = _containerInstance;
this.id = id;
/**
* Whether the user is allowed to close the dialog.
*/
this.disableClose = this._containerInstance._config.disableClose;
/**
* Subject for notifying the user that the dialog has finished opening.
*/
this._afterOpen = new rxjs__WEBPACK_IMPORTED_MODULE_7__["Subject"]();
/**
* Subject for notifying the user that the dialog has finished closing.
*/
this._afterClosed = new rxjs__WEBPACK_IMPORTED_MODULE_7__["Subject"]();
/**
* Subject for notifying the user that the dialog has started closing.
*/
this._beforeClose = new rxjs__WEBPACK_IMPORTED_MODULE_7__["Subject"]();
/**
* Subscription to changes in the user's location.
*/
this._locationChanges = rxjs__WEBPACK_IMPORTED_MODULE_7__["Subscription"].EMPTY;
// Pass the id along to the container.
_containerInstance._id = id;
// Emit when opening animation completes
_containerInstance._animationStateChanged.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["filter"])(function (event) { return event.phaseName === 'done' && event.toState === 'enter'; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["take"])(1))
.subscribe(function () {
_this._afterOpen.next();
_this._afterOpen.complete();
});
// Dispose overlay when closing animation is complete
_containerInstance._animationStateChanged.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["filter"])(function (event) { return event.phaseName === 'done' && event.toState === 'exit'; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["take"])(1))
.subscribe(function () {
_this._overlayRef.dispose();
_this._locationChanges.unsubscribe();
_this._afterClosed.next(_this._result);
_this._afterClosed.complete();
_this.componentInstance = /** @type {?} */ ((null));
});
_overlayRef.keydownEvents()
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["filter"])(function (event) { return event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["ESCAPE"] && !_this.disableClose; }))
.subscribe(function () { return _this.close(); });
if (location) {
// Close the dialog when the user goes forwards/backwards in history or when the location
// hash changes. Note that this usually doesn't include clicking on links (unless the user
// is using the `HashLocationStrategy`).
this._locationChanges = location.subscribe(function () {
if (_this._containerInstance._config.closeOnNavigation) {
_this.close();
}
});
}
}
/**
* Close the dialog.
* @param dialogResult Optional result to return to the dialog opener.
*/
/**
* Close the dialog.
* @param {?=} dialogResult Optional result to return to the dialog opener.
* @return {?}
*/
MatDialogRef.prototype.close = /**
* Close the dialog.
* @param {?=} dialogResult Optional result to return to the dialog opener.
* @return {?}
*/
function (dialogResult) {
var _this = this;
this._result = dialogResult;
// Transition the backdrop in parallel to the dialog.
this._containerInstance._animationStateChanged.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["filter"])(function (event) { return event.phaseName === 'start'; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["take"])(1))
.subscribe(function () {
_this._beforeClose.next(dialogResult);
_this._beforeClose.complete();
_this._overlayRef.detachBackdrop();
});
this._containerInstance._startExitAnimation();
};
/**
* Gets an observable that is notified when the dialog is finished opening.
*/
/**
* Gets an observable that is notified when the dialog is finished opening.
* @return {?}
*/
MatDialogRef.prototype.afterOpen = /**
* Gets an observable that is notified when the dialog is finished opening.
* @return {?}
*/
function () {
return this._afterOpen.asObservable();
};
/**
* Gets an observable that is notified when the dialog is finished closing.
*/
/**
* Gets an observable that is notified when the dialog is finished closing.
* @return {?}
*/
MatDialogRef.prototype.afterClosed = /**
* Gets an observable that is notified when the dialog is finished closing.
* @return {?}
*/
function () {
return this._afterClosed.asObservable();
};
/**
* Gets an observable that is notified when the dialog has started closing.
*/
/**
* Gets an observable that is notified when the dialog has started closing.
* @return {?}
*/
MatDialogRef.prototype.beforeClose = /**
* Gets an observable that is notified when the dialog has started closing.
* @return {?}
*/
function () {
return this._beforeClose.asObservable();
};
/**
* Gets an observable that emits when the overlay's backdrop has been clicked.
*/
/**
* Gets an observable that emits when the overlay's backdrop has been clicked.
* @return {?}
*/
MatDialogRef.prototype.backdropClick = /**
* Gets an observable that emits when the overlay's backdrop has been clicked.
* @return {?}
*/
function () {
return this._overlayRef.backdropClick();
};
/**
* Gets an observable that emits when keydown events are targeted on the overlay.
*/
/**
* Gets an observable that emits when keydown events are targeted on the overlay.
* @return {?}
*/
MatDialogRef.prototype.keydownEvents = /**
* Gets an observable that emits when keydown events are targeted on the overlay.
* @return {?}
*/
function () {
return this._overlayRef.keydownEvents();
};
/**
* Updates the dialog's position.
* @param position New dialog position.
*/
/**
* Updates the dialog's position.
* @param {?=} position New dialog position.
* @return {?}
*/
MatDialogRef.prototype.updatePosition = /**
* Updates the dialog's position.
* @param {?=} position New dialog position.
* @return {?}
*/
function (position) {
var /** @type {?} */ strategy = this._getPositionStrategy();
if (position && (position.left || position.right)) {
position.left ? strategy.left(position.left) : strategy.right(position.right);
}
else {
strategy.centerHorizontally();
}
if (position && (position.top || position.bottom)) {
position.top ? strategy.top(position.top) : strategy.bottom(position.bottom);
}
else {
strategy.centerVertically();
}
this._overlayRef.updatePosition();
return this;
};
/**
* Updates the dialog's width and height.
* @param width New width of the dialog.
* @param height New height of the dialog.
*/
/**
* Updates the dialog's width and height.
* @param {?=} width New width of the dialog.
* @param {?=} height New height of the dialog.
* @return {?}
*/
MatDialogRef.prototype.updateSize = /**
* Updates the dialog's width and height.
* @param {?=} width New width of the dialog.
* @param {?=} height New height of the dialog.
* @return {?}
*/
function (width, height) {
if (width === void 0) { width = 'auto'; }
if (height === void 0) { height = 'auto'; }
this._getPositionStrategy().width(width).height(height);
this._overlayRef.updatePosition();
return this;
};
/**
* Fetches the position strategy object from the overlay ref.
* @return {?}
*/
MatDialogRef.prototype._getPositionStrategy = /**
* Fetches the position strategy object from the overlay ref.
* @return {?}
*/
function () {
return /** @type {?} */ (this._overlayRef.getConfig().positionStrategy);
};
return MatDialogRef;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token that can be used to access the data that was passed in to a dialog.
*/
var /** @type {?} */ MAT_DIALOG_DATA = new _angular_core__WEBPACK_IMPORTED_MODULE_2__["InjectionToken"]('MatDialogData');
/**
* Injection token that can be used to specify default dialog options.
*/
var /** @type {?} */ MAT_DIALOG_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_2__["InjectionToken"]('mat-dialog-default-options');
/**
* Injection token that determines the scroll handling while the dialog is open.
*/
var /** @type {?} */ MAT_DIALOG_SCROLL_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_2__["InjectionToken"]('mat-dialog-scroll-strategy', {
providedIn: 'root',
factory: MAT_DIALOG_SCROLL_STRATEGY_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function MAT_DIALOG_SCROLL_STRATEGY_FACTORY() {
var /** @type {?} */ overlay = Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["inject"])(_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_10__["Overlay"]);
return function () { return overlay.scrollStrategies.block(); };
}
/**
* \@docs-private
* @param {?} overlay
* @return {?}
*/
function MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
return function () { return overlay.scrollStrategies.block(); };
}
/**
* \@docs-private
*/
var /** @type {?} */ MAT_DIALOG_SCROLL_STRATEGY_PROVIDER = {
provide: MAT_DIALOG_SCROLL_STRATEGY,
deps: [_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_10__["Overlay"]],
useFactory: MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY,
};
/**
* Service to open Material Design modal dialogs.
*/
var MatDialog = /** @class */ (function () {
function MatDialog(_overlay, _injector, _location, _defaultOptions, _scrollStrategy, _parentDialog, _overlayContainer) {
var _this = this;
this._overlay = _overlay;
this._injector = _injector;
this._location = _location;
this._defaultOptions = _defaultOptions;
this._scrollStrategy = _scrollStrategy;
this._parentDialog = _parentDialog;
this._overlayContainer = _overlayContainer;
this._openDialogsAtThisLevel = [];
this._afterAllClosedAtThisLevel = new rxjs__WEBPACK_IMPORTED_MODULE_7__["Subject"]();
this._afterOpenAtThisLevel = new rxjs__WEBPACK_IMPORTED_MODULE_7__["Subject"]();
this._ariaHiddenElements = new Map();
/**
* Stream that emits when all open dialog have finished closing.
* Will emit on subscribe if there are no open dialogs to begin with.
*/
this.afterAllClosed = Object(rxjs__WEBPACK_IMPORTED_MODULE_7__["defer"])(function () {
return _this.openDialogs.length ?
_this._afterAllClosed :
_this._afterAllClosed.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["startWith"])(undefined));
});
}
Object.defineProperty(MatDialog.prototype, "openDialogs", {
/** Keeps track of the currently-open dialogs. */
get: /**
* Keeps track of the currently-open dialogs.
* @return {?}
*/
function () {
return this._parentDialog ? this._parentDialog.openDialogs : this._openDialogsAtThisLevel;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDialog.prototype, "afterOpen", {
/** Stream that emits when a dialog has been opened. */
get: /**
* Stream that emits when a dialog has been opened.
* @return {?}
*/
function () {
return this._parentDialog ? this._parentDialog.afterOpen : this._afterOpenAtThisLevel;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDialog.prototype, "_afterAllClosed", {
get: /**
* @return {?}
*/
function () {
var /** @type {?} */ parent = this._parentDialog;
return parent ? parent._afterAllClosed : this._afterAllClosedAtThisLevel;
},
enumerable: true,
configurable: true
});
/**
* Opens a modal dialog containing the given component.
* @param componentOrTemplateRef Type of the component to load into the dialog,
* or a TemplateRef to instantiate as the dialog content.
* @param config Extra configuration options.
* @returns Reference to the newly-opened dialog.
*/
/**
* Opens a modal dialog containing the given component.
* @template T, D, R
* @param {?} componentOrTemplateRef Type of the component to load into the dialog,
* or a TemplateRef to instantiate as the dialog content.
* @param {?=} config Extra configuration options.
* @return {?} Reference to the newly-opened dialog.
*/
MatDialog.prototype.open = /**
* Opens a modal dialog containing the given component.
* @template T, D, R
* @param {?} componentOrTemplateRef Type of the component to load into the dialog,
* or a TemplateRef to instantiate as the dialog content.
* @param {?=} config Extra configuration options.
* @return {?} Reference to the newly-opened dialog.
*/
function (componentOrTemplateRef, config) {
var _this = this;
config = _applyConfigDefaults(config, this._defaultOptions || new MatDialogConfig());
if (config.id && this.getDialogById(config.id)) {
throw Error("Dialog with id \"" + config.id + "\" exists already. The dialog id must be unique.");
}
var /** @type {?} */ overlayRef = this._createOverlay(config);
var /** @type {?} */ dialogContainer = this._attachDialogContainer(overlayRef, config);
var /** @type {?} */ dialogRef = this._attachDialogContent(componentOrTemplateRef, dialogContainer, overlayRef, config);
// If this is the first dialog that we're opening, hide all the non-overlay content.
if (!this.openDialogs.length) {
this._hideNonDialogContentFromAssistiveTechnology();
}
this.openDialogs.push(dialogRef);
dialogRef.afterClosed().subscribe(function () { return _this._removeOpenDialog(dialogRef); });
this.afterOpen.next(dialogRef);
return dialogRef;
};
/**
* Closes all of the currently-open dialogs.
*/
/**
* Closes all of the currently-open dialogs.
* @return {?}
*/
MatDialog.prototype.closeAll = /**
* Closes all of the currently-open dialogs.
* @return {?}
*/
function () {
var /** @type {?} */ i = this.openDialogs.length;
while (i--) {
// The `_openDialogs` property isn't updated after close until the rxjs subscription
// runs on the next microtask, in addition to modifying the array as we're going
// through it. We loop through all of them and call close without assuming that
// they'll be removed from the list instantaneously.
this.openDialogs[i].close();
}
};
/**
* Finds an open dialog by its id.
* @param id ID to use when looking up the dialog.
*/
/**
* Finds an open dialog by its id.
* @param {?} id ID to use when looking up the dialog.
* @return {?}
*/
MatDialog.prototype.getDialogById = /**
* Finds an open dialog by its id.
* @param {?} id ID to use when looking up the dialog.
* @return {?}
*/
function (id) {
return this.openDialogs.find(function (dialog) { return dialog.id === id; });
};
/**
* Creates the overlay into which the dialog will be loaded.
* @param {?} config The dialog configuration.
* @return {?} A promise resolving to the OverlayRef for the created overlay.
*/
MatDialog.prototype._createOverlay = /**
* Creates the overlay into which the dialog will be loaded.
* @param {?} config The dialog configuration.
* @return {?} A promise resolving to the OverlayRef for the created overlay.
*/
function (config) {
var /** @type {?} */ overlayConfig = this._getOverlayConfig(config);
return this._overlay.create(overlayConfig);
};
/**
* Creates an overlay config from a dialog config.
* @param {?} dialogConfig The dialog configuration.
* @return {?} The overlay configuration.
*/
MatDialog.prototype._getOverlayConfig = /**
* Creates an overlay config from a dialog config.
* @param {?} dialogConfig The dialog configuration.
* @return {?} The overlay configuration.
*/
function (dialogConfig) {
var /** @type {?} */ state$$1 = new _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_10__["OverlayConfig"]({
positionStrategy: this._overlay.position().global(),
scrollStrategy: dialogConfig.scrollStrategy || this._scrollStrategy(),
panelClass: dialogConfig.panelClass,
hasBackdrop: dialogConfig.hasBackdrop,
direction: dialogConfig.direction,
minWidth: dialogConfig.minWidth,
minHeight: dialogConfig.minHeight,
maxWidth: dialogConfig.maxWidth,
maxHeight: dialogConfig.maxHeight
});
if (dialogConfig.backdropClass) {
state$$1.backdropClass = dialogConfig.backdropClass;
}
return state$$1;
};
/**
* Attaches an MatDialogContainer to a dialog's already-created overlay.
* @param {?} overlay Reference to the dialog's underlying overlay.
* @param {?} config The dialog configuration.
* @return {?} A promise resolving to a ComponentRef for the attached container.
*/
MatDialog.prototype._attachDialogContainer = /**
* Attaches an MatDialogContainer to a dialog's already-created overlay.
* @param {?} overlay Reference to the dialog's underlying overlay.
* @param {?} config The dialog configuration.
* @return {?} A promise resolving to a ComponentRef for the attached container.
*/
function (overlay, config) {
var /** @type {?} */ containerPortal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_4__["ComponentPortal"](MatDialogContainer, config.viewContainerRef);
var /** @type {?} */ containerRef = overlay.attach(containerPortal);
containerRef.instance._config = config;
return containerRef.instance;
};
/**
* Attaches the user-provided component to the already-created MatDialogContainer.
* @template T, R
* @param {?} componentOrTemplateRef The type of component being loaded into the dialog,
* or a TemplateRef to instantiate as the content.
* @param {?} dialogContainer Reference to the wrapping MatDialogContainer.
* @param {?} overlayRef Reference to the overlay in which the dialog resides.
* @param {?} config The dialog configuration.
* @return {?} A promise resolving to the MatDialogRef that should be returned to the user.
*/
MatDialog.prototype._attachDialogContent = /**
* Attaches the user-provided component to the already-created MatDialogContainer.
* @template T, R
* @param {?} componentOrTemplateRef The type of component being loaded into the dialog,
* or a TemplateRef to instantiate as the content.
* @param {?} dialogContainer Reference to the wrapping MatDialogContainer.
* @param {?} overlayRef Reference to the overlay in which the dialog resides.
* @param {?} config The dialog configuration.
* @return {?} A promise resolving to the MatDialogRef that should be returned to the user.
*/
function (componentOrTemplateRef, dialogContainer, overlayRef, config) {
// Create a reference to the dialog we're creating in order to give the user a handle
// to modify and close it.
var /** @type {?} */ dialogRef = new MatDialogRef(overlayRef, dialogContainer, this._location, config.id);
// When the dialog backdrop is clicked, we want to close it.
if (config.hasBackdrop) {
overlayRef.backdropClick().subscribe(function () {
if (!dialogRef.disableClose) {
dialogRef.close();
}
});
}
if (componentOrTemplateRef instanceof _angular_core__WEBPACK_IMPORTED_MODULE_2__["TemplateRef"]) {
dialogContainer.attachTemplatePortal(new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_4__["TemplatePortal"](componentOrTemplateRef, /** @type {?} */ ((null)), /** @type {?} */ ({ $implicit: config.data, dialogRef: dialogRef })));
}
else {
var /** @type {?} */ injector = this._createInjector(config, dialogRef, dialogContainer);
var /** @type {?} */ contentRef = dialogContainer.attachComponentPortal(new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_4__["ComponentPortal"](componentOrTemplateRef, undefined, injector));
dialogRef.componentInstance = contentRef.instance;
}
dialogRef
.updateSize(config.width, config.height)
.updatePosition(config.position);
return dialogRef;
};
/**
* Creates a custom injector to be used inside the dialog. This allows a component loaded inside
* of a dialog to close itself and, optionally, to return a value.
* @template T
* @param {?} config Config object that is used to construct the dialog.
* @param {?} dialogRef Reference to the dialog.
* @param {?} dialogContainer
* @return {?} The custom injector that can be used inside the dialog.
*/
MatDialog.prototype._createInjector = /**
* Creates a custom injector to be used inside the dialog. This allows a component loaded inside
* of a dialog to close itself and, optionally, to return a value.
* @template T
* @param {?} config Config object that is used to construct the dialog.
* @param {?} dialogRef Reference to the dialog.
* @param {?} dialogContainer
* @return {?} The custom injector that can be used inside the dialog.
*/
function (config, dialogRef, dialogContainer) {
var /** @type {?} */ userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
var /** @type {?} */ injectionTokens = new WeakMap();
// The MatDialogContainer is injected in the portal as the MatDialogContainer and the dialog's
// content are created out of the same ViewContainerRef and as such, are siblings for injector
// purposes. To allow the hierarchy that is expected, the MatDialogContainer is explicitly
// added to the injection tokens.
injectionTokens
.set(MatDialogContainer, dialogContainer)
.set(MAT_DIALOG_DATA, config.data)
.set(MatDialogRef, dialogRef);
if (!userInjector || !userInjector.get(_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_9__["Directionality"], null)) {
injectionTokens.set(_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_9__["Directionality"], {
value: config.direction,
change: Object(rxjs__WEBPACK_IMPORTED_MODULE_7__["of"])()
});
}
return new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_4__["PortalInjector"](userInjector || this._injector, injectionTokens);
};
/**
* Removes a dialog from the array of open dialogs.
* @param {?} dialogRef Dialog to be removed.
* @return {?}
*/
MatDialog.prototype._removeOpenDialog = /**
* Removes a dialog from the array of open dialogs.
* @param {?} dialogRef Dialog to be removed.
* @return {?}
*/
function (dialogRef) {
var /** @type {?} */ index = this.openDialogs.indexOf(dialogRef);
if (index > -1) {
this.openDialogs.splice(index, 1);
// If all the dialogs were closed, remove/restore the `aria-hidden`
// to a the siblings and emit to the `afterAllClosed` stream.
if (!this.openDialogs.length) {
this._ariaHiddenElements.forEach(function (previousValue, element) {
if (previousValue) {
element.setAttribute('aria-hidden', previousValue);
}
else {
element.removeAttribute('aria-hidden');
}
});
this._ariaHiddenElements.clear();
this._afterAllClosed.next();
}
}
};
/**
* Hides all of the content that isn't an overlay from assistive technology.
* @return {?}
*/
MatDialog.prototype._hideNonDialogContentFromAssistiveTechnology = /**
* Hides all of the content that isn't an overlay from assistive technology.
* @return {?}
*/
function () {
var /** @type {?} */ overlayContainer = this._overlayContainer.getContainerElement();
// Ensure that the overlay container is attached to the DOM.
if (overlayContainer.parentElement) {
var /** @type {?} */ siblings = overlayContainer.parentElement.children;
for (var /** @type {?} */ i = siblings.length - 1; i > -1; i--) {
var /** @type {?} */ sibling = siblings[i];
if (sibling !== overlayContainer &&
sibling.nodeName !== 'SCRIPT' &&
sibling.nodeName !== 'STYLE' &&
!sibling.hasAttribute('aria-live')) {
this._ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));
sibling.setAttribute('aria-hidden', 'true');
}
}
}
};
MatDialog.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] },
];
/** @nocollapse */
MatDialog.ctorParameters = function () { return [
{ type: _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_10__["Overlay"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injector"], },
{ type: _angular_common__WEBPACK_IMPORTED_MODULE_3__["Location"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [MAT_DIALOG_DEFAULT_OPTIONS,] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [MAT_DIALOG_SCROLL_STRATEGY,] },] },
{ type: MatDialog, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["SkipSelf"] },] },
{ type: _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_10__["OverlayContainer"], },
]; };
return MatDialog;
}());
/**
* Applies default options to the dialog config.
* @param {?=} config Config to be modified.
* @param {?=} defaultOptions Default options provided.
* @return {?} The new configuration object.
*/
function _applyConfigDefaults(config, defaultOptions) {
return Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__assign"])({}, defaultOptions, config);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Counter used to generate unique IDs for dialog elements.
*/
var /** @type {?} */ dialogElementUid = 0;
/**
* Button that will close the current dialog.
*/
var MatDialogClose = /** @class */ (function () {
function MatDialogClose(dialogRef, _elementRef, _dialog) {
this.dialogRef = dialogRef;
this._elementRef = _elementRef;
this._dialog = _dialog;
/**
* Screenreader label for the button.
*/
this.ariaLabel = 'Close dialog';
}
/**
* @return {?}
*/
MatDialogClose.prototype.ngOnInit = /**
* @return {?}
*/
function () {
if (!this.dialogRef) {
// When this directive is included in a dialog via TemplateRef (rather than being
// in a Component), the DialogRef isn't available via injection because embedded
// views cannot be given a custom injector. Instead, we look up the DialogRef by
// ID. This must occur in `onInit`, as the ID binding for the dialog container won't
// be resolved at constructor time.
this.dialogRef = /** @type {?} */ ((getClosestDialog(this._elementRef, this._dialog.openDialogs)));
}
};
/**
* @param {?} changes
* @return {?}
*/
MatDialogClose.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
var /** @type {?} */ proxiedChange = changes["_matDialogClose"] || changes["_matDialogCloseResult"];
if (proxiedChange) {
this.dialogResult = proxiedChange.currentValue;
}
};
MatDialogClose.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Directive"], args: [{
selector: "button[mat-dialog-close], button[matDialogClose]",
exportAs: 'matDialogClose',
host: {
'(click)': 'dialogRef.close(dialogResult)',
'[attr.aria-label]': 'ariaLabel',
'type': 'button',
}
},] },
];
/** @nocollapse */
MatDialogClose.ctorParameters = function () { return [
{ type: MatDialogRef, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ElementRef"], },
{ type: MatDialog, },
]; };
MatDialogClose.propDecorators = {
"ariaLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"], args: ['aria-label',] },],
"dialogResult": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"], args: ['mat-dialog-close',] },],
"_matDialogClose": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"], args: ['matDialogClose',] },],
};
return MatDialogClose;
}());
/**
* Title of a dialog element. Stays fixed to the top of the dialog when scrolling.
*/
var MatDialogTitle = /** @class */ (function () {
function MatDialogTitle(_dialogRef, _elementRef, _dialog) {
this._dialogRef = _dialogRef;
this._elementRef = _elementRef;
this._dialog = _dialog;
this.id = "mat-dialog-title-" + dialogElementUid++;
}
/**
* @return {?}
*/
MatDialogTitle.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
if (!this._dialogRef) {
this._dialogRef = /** @type {?} */ ((getClosestDialog(this._elementRef, this._dialog.openDialogs)));
}
if (this._dialogRef) {
Promise.resolve().then(function () {
var /** @type {?} */ container = _this._dialogRef._containerInstance;
if (container && !container._ariaLabelledBy) {
container._ariaLabelledBy = _this.id;
}
});
}
};
MatDialogTitle.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Directive"], args: [{
selector: '[mat-dialog-title], [matDialogTitle]',
exportAs: 'matDialogTitle',
host: {
'class': 'mat-dialog-title',
'[id]': 'id',
},
},] },
];
/** @nocollapse */
MatDialogTitle.ctorParameters = function () { return [
{ type: MatDialogRef, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ElementRef"], },
{ type: MatDialog, },
]; };
MatDialogTitle.propDecorators = {
"id": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
};
return MatDialogTitle;
}());
/**
* Scrollable content container of a dialog.
*/
var MatDialogContent = /** @class */ (function () {
function MatDialogContent() {
}
MatDialogContent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Directive"], args: [{
selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]",
host: { 'class': 'mat-dialog-content' }
},] },
];
return MatDialogContent;
}());
/**
* Container for the bottom action buttons in a dialog.
* Stays fixed to the bottom when scrolling.
*/
var MatDialogActions = /** @class */ (function () {
function MatDialogActions() {
}
MatDialogActions.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Directive"], args: [{
selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]",
host: { 'class': 'mat-dialog-actions' }
},] },
];
return MatDialogActions;
}());
/**
* Finds the closest MatDialogRef to an element by looking at the DOM.
* @param {?} element Element relative to which to look for a dialog.
* @param {?} openDialogs References to the currently-open dialogs.
* @return {?}
*/
function getClosestDialog(element, openDialogs) {
var /** @type {?} */ parent = element.nativeElement.parentElement;
while (parent && !parent.classList.contains('mat-dialog-container')) {
parent = parent.parentElement;
}
return parent ? openDialogs.find(function (dialog) { return dialog.id === /** @type {?} */ ((parent)).id; }) : null;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatDialogModule = /** @class */ (function () {
function MatDialogModule() {
}
MatDialogModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgModule"], args: [{
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_3__["CommonModule"],
_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_10__["OverlayModule"],
_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_4__["PortalModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_11__["MatCommonModule"],
],
exports: [
MatDialogContainer,
MatDialogClose,
MatDialogTitle,
MatDialogContent,
MatDialogActions,
_angular_material_core__WEBPACK_IMPORTED_MODULE_11__["MatCommonModule"],
],
declarations: [
MatDialogContainer,
MatDialogClose,
MatDialogTitle,
MatDialogActions,
MatDialogContent,
],
providers: [
MatDialog,
MAT_DIALOG_SCROLL_STRATEGY_PROVIDER,
],
entryComponents: [MatDialogContainer],
},] },
];
return MatDialogModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=dialog.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/divider.es5.js":
/*!************************************************************!*\
!*** ./node_modules/@angular/material/esm5/divider.es5.js ***!
\************************************************************/
/*! exports provided: MatDivider, MatDividerModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDivider", function() { return MatDivider; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDividerModule", function() { return MatDividerModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatDivider = /** @class */ (function () {
function MatDivider() {
this._vertical = false;
this._inset = false;
}
Object.defineProperty(MatDivider.prototype, "vertical", {
get: /**
* Whether the divider is vertically aligned.
* @return {?}
*/
function () { return this._vertical; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._vertical = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatDivider.prototype, "inset", {
get: /**
* Whether the divider is an inset divider.
* @return {?}
*/
function () { return this._inset; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._inset = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
MatDivider.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-divider',
host: {
'role': 'separator',
'[attr.aria-orientation]': 'vertical ? "vertical" : "horizontal"',
'[class.mat-divider-vertical]': 'vertical',
'[class.mat-divider-inset]': 'inset',
'class': 'mat-divider'
},
template: '',
styles: [".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatDivider.propDecorators = {
"vertical": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"inset": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatDivider;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatDividerModule = /** @class */ (function () {
function MatDividerModule() {
}
MatDividerModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["MatCommonModule"], _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"]],
exports: [MatDivider, _angular_material_core__WEBPACK_IMPORTED_MODULE_3__["MatCommonModule"]],
declarations: [MatDivider],
},] },
];
return MatDividerModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=divider.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/expansion.es5.js":
/*!**************************************************************!*\
!*** ./node_modules/@angular/material/esm5/expansion.es5.js ***!
\**************************************************************/
/*! exports provided: MatExpansionModule, MatAccordion, MatExpansionPanel, MatExpansionPanelActionRow, MatExpansionPanelHeader, MatExpansionPanelDescription, MatExpansionPanelTitle, MatExpansionPanelContent, EXPANSION_PANEL_ANIMATION_TIMING, matExpansionAnimations */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatExpansionModule", function() { return MatExpansionModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatAccordion", function() { return MatAccordion; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatExpansionPanel", function() { return MatExpansionPanel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatExpansionPanelActionRow", function() { return MatExpansionPanelActionRow; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatExpansionPanelHeader", function() { return MatExpansionPanelHeader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatExpansionPanelDescription", function() { return MatExpansionPanelDescription; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatExpansionPanelTitle", function() { return MatExpansionPanelTitle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatExpansionPanelContent", function() { return MatExpansionPanelContent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPANSION_PANEL_ANIMATION_TIMING", function() { return EXPANSION_PANEL_ANIMATION_TIMING; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matExpansionAnimations", function() { return matExpansionAnimations; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_accordion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/accordion */ "./node_modules/@angular/cdk/esm5/accordion.es5.js");
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm5/collections.es5.js");
/* harmony import */ var _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/portal */ "./node_modules/@angular/cdk/esm5/portal.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Directive for a Material Design Accordion.
*/
var MatAccordion = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatAccordion, _super);
function MatAccordion() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._hideToggle = false;
/**
* The display mode used for all expansion panels in the accordion. Currently two display
* modes exist:
* default - a gutter-like spacing is placed around any expanded panel, placing the expanded
* panel at a different elevation from the reset of the accordion.
* flat - no spacing is placed around expanded panels, showing all panels at the same
* elevation.
*/
_this.displayMode = 'default';
return _this;
}
Object.defineProperty(MatAccordion.prototype, "hideToggle", {
get: /**
* Whether the expansion indicator should be hidden.
* @return {?}
*/
function () { return this._hideToggle; },
set: /**
* @param {?} show
* @return {?}
*/
function (show) { this._hideToggle = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(show); },
enumerable: true,
configurable: true
});
MatAccordion.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'mat-accordion',
exportAs: 'matAccordion',
host: {
class: 'mat-accordion'
}
},] },
];
/** @nocollapse */
MatAccordion.propDecorators = {
"hideToggle": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"displayMode": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
};
return MatAccordion;
}(_angular_cdk_accordion__WEBPACK_IMPORTED_MODULE_3__["CdkAccordion"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Time and timing curve for expansion panel animations.
*/
var /** @type {?} */ EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,1)';
/**
* Animations used by the Material expansion panel.
*/
var /** @type {?} */ matExpansionAnimations = {
/** Animation that rotates the indicator arrow. */
indicatorRotate: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["trigger"])('indicatorRotate', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('collapsed', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'rotate(0deg)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('expanded', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'rotate(180deg)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('expanded <=> collapsed', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(EXPANSION_PANEL_ANIMATION_TIMING)),
]),
/** Animation that expands and collapses the panel header height. */
expansionHeaderHeight: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["trigger"])('expansionHeight', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('collapsed', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({
height: '{{collapsedHeight}}',
}), {
params: { collapsedHeight: '48px' },
}),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('expanded', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({
height: '{{expandedHeight}}'
}), {
params: { expandedHeight: '64px' }
}),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('expanded <=> collapsed', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["group"])([
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["query"])('@indicatorRotate', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animateChild"])(), { optional: true }),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(EXPANSION_PANEL_ANIMATION_TIMING),
])),
]),
/** Animation that expands and collapses the panel content. */
bodyExpansion: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["trigger"])('bodyExpansion', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('collapsed', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ height: '0px', visibility: 'hidden' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('expanded', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ height: '*', visibility: 'visible' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('expanded <=> collapsed', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(EXPANSION_PANEL_ANIMATION_TIMING)),
])
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Expansion panel content that will be rendered lazily
* after the panel is opened for the first time.
*/
var MatExpansionPanelContent = /** @class */ (function () {
function MatExpansionPanelContent(_template) {
this._template = _template;
}
MatExpansionPanelContent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'ng-template[matExpansionPanelContent]'
},] },
];
/** @nocollapse */
MatExpansionPanelContent.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
]; };
return MatExpansionPanelContent;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Counter for generating unique element ids.
*/
var /** @type {?} */ uniqueId = 0;
/**
* `<mat-expansion-panel>`
*
* This component can be used as a single element to show expandable content, or as one of
* multiple children of an element with the MatAccordion directive attached.
*/
var MatExpansionPanel = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatExpansionPanel, _super);
function MatExpansionPanel(accordion, _changeDetectorRef, _uniqueSelectionDispatcher, _viewContainerRef) {
var _this = _super.call(this, accordion, _changeDetectorRef, _uniqueSelectionDispatcher) || this;
_this._viewContainerRef = _viewContainerRef;
_this._hideToggle = false;
/**
* Stream that emits for changes in `\@Input` properties.
*/
_this._inputChanges = new rxjs__WEBPACK_IMPORTED_MODULE_7__["Subject"]();
/**
* ID for the associated header element. Used for a11y labelling.
*/
_this._headerId = "mat-expansion-panel-header-" + uniqueId++;
_this.accordion = accordion;
return _this;
}
Object.defineProperty(MatExpansionPanel.prototype, "hideToggle", {
get: /**
* Whether the toggle indicator should be hidden.
* @return {?}
*/
function () { return this._hideToggle; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._hideToggle = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
/** Whether the expansion indicator should be hidden. */
/**
* Whether the expansion indicator should be hidden.
* @return {?}
*/
MatExpansionPanel.prototype._getHideToggle = /**
* Whether the expansion indicator should be hidden.
* @return {?}
*/
function () {
if (this.accordion) {
return this.accordion.hideToggle;
}
return this.hideToggle;
};
/** Determines whether the expansion panel should have spacing between it and its siblings. */
/**
* Determines whether the expansion panel should have spacing between it and its siblings.
* @return {?}
*/
MatExpansionPanel.prototype._hasSpacing = /**
* Determines whether the expansion panel should have spacing between it and its siblings.
* @return {?}
*/
function () {
if (this.accordion) {
return (this.expanded ? this.accordion.displayMode : this._getExpandedState()) === 'default';
}
return false;
};
/** Gets the expanded state string. */
/**
* Gets the expanded state string.
* @return {?}
*/
MatExpansionPanel.prototype._getExpandedState = /**
* Gets the expanded state string.
* @return {?}
*/
function () {
return this.expanded ? 'expanded' : 'collapsed';
};
/**
* @return {?}
*/
MatExpansionPanel.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
if (this._lazyContent) {
// Render the content as soon as the panel becomes open.
this.opened.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["startWith"])(/** @type {?} */ ((null))), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["filter"])(function () { return _this.expanded && !_this._portal; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["take"])(1)).subscribe(function () {
_this._portal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__["TemplatePortal"](_this._lazyContent._template, _this._viewContainerRef);
});
}
};
/**
* @param {?} changes
* @return {?}
*/
MatExpansionPanel.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
this._inputChanges.next(changes);
};
/**
* @return {?}
*/
MatExpansionPanel.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
_super.prototype.ngOnDestroy.call(this);
this._inputChanges.complete();
};
/**
* @param {?} event
* @return {?}
*/
MatExpansionPanel.prototype._bodyAnimation = /**
* @param {?} event
* @return {?}
*/
function (event) {
var /** @type {?} */ classList = event.element.classList;
var /** @type {?} */ cssClass = 'mat-expanded';
var phaseName = event.phaseName, toState = event.toState;
// Toggle the body's `overflow: hidden` class when closing starts or when expansion ends in
// order to prevent the cases where switching too early would cause the animation to jump.
// Note that we do it directly on the DOM element to avoid the slight delay that comes
// with doing it via change detection.
if (phaseName === 'done' && toState === 'expanded') {
classList.add(cssClass);
}
else if (phaseName === 'start' && toState === 'collapsed') {
classList.remove(cssClass);
}
};
MatExpansionPanel.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{styles: [".mat-expansion-panel{transition:box-shadow 280ms cubic-bezier(.4,0,.2,1);box-sizing:content-box;display:block;margin:0;transition:margin 225ms cubic-bezier(.4,0,.2,1)}.mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mat-expansion-panel-content{overflow:hidden}.mat-expansion-panel-content.mat-expanded{overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>:first-child .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>:last-child .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button{margin-left:0;margin-right:8px}"],
selector: 'mat-expansion-panel',
exportAs: 'matExpansionPanel',
template: "<ng-content select=\"mat-expansion-panel-header\"></ng-content><div class=\"mat-expansion-panel-content\" role=\"region\" [@bodyExpansion]=\"_getExpandedState()\" (@bodyExpansion.done)=\"_bodyAnimation($event)\" (@bodyExpansion.start)=\"_bodyAnimation($event)\" [attr.aria-labelledby]=\"_headerId\" [id]=\"id\" #body><div class=\"mat-expansion-panel-body\"><ng-content></ng-content><ng-template [cdkPortalOutlet]=\"_portal\"></ng-template></div><ng-content select=\"mat-action-row\"></ng-content></div>",
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
inputs: ['disabled', 'expanded'],
outputs: ['opened', 'closed', 'expandedChange'],
animations: [matExpansionAnimations.bodyExpansion],
host: {
'class': 'mat-expansion-panel',
'[class.mat-expanded]': 'expanded',
'[class.mat-expansion-panel-spacing]': '_hasSpacing()',
}
},] },
];
/** @nocollapse */
MatExpansionPanel.ctorParameters = function () { return [
{ type: MatAccordion, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"], },
{ type: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_5__["UniqueSelectionDispatcher"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"], },
]; };
MatExpansionPanel.propDecorators = {
"hideToggle": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"_lazyContent": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChild"], args: [MatExpansionPanelContent,] },],
};
return MatExpansionPanel;
}(_angular_cdk_accordion__WEBPACK_IMPORTED_MODULE_3__["CdkAccordionItem"]));
var MatExpansionPanelActionRow = /** @class */ (function () {
function MatExpansionPanelActionRow() {
}
MatExpansionPanelActionRow.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'mat-action-row',
host: {
class: 'mat-action-row'
}
},] },
];
return MatExpansionPanelActionRow;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* `<mat-expansion-panel-header>`
*
* This component corresponds to the header element of an `<mat-expansion-panel>`.
*/
var MatExpansionPanelHeader = /** @class */ (function () {
function MatExpansionPanelHeader(panel, _element, _focusMonitor, _changeDetectorRef) {
var _this = this;
this.panel = panel;
this._element = _element;
this._focusMonitor = _focusMonitor;
this._changeDetectorRef = _changeDetectorRef;
this._parentChangeSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__["Subscription"].EMPTY;
// Since the toggle state depends on an @Input on the panel, we
// need to subscribe and trigger change detection manually.
this._parentChangeSubscription = Object(rxjs__WEBPACK_IMPORTED_MODULE_7__["merge"])(panel.opened, panel.closed, panel._inputChanges.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["filter"])(function (changes) { return !!(changes["hideToggle"] || changes["disabled"]); })))
.subscribe(function () { return _this._changeDetectorRef.markForCheck(); });
_focusMonitor.monitor(_element.nativeElement);
}
/** Toggles the expanded state of the panel. */
/**
* Toggles the expanded state of the panel.
* @return {?}
*/
MatExpansionPanelHeader.prototype._toggle = /**
* Toggles the expanded state of the panel.
* @return {?}
*/
function () {
this.panel.toggle();
};
/** Gets whether the panel is expanded. */
/**
* Gets whether the panel is expanded.
* @return {?}
*/
MatExpansionPanelHeader.prototype._isExpanded = /**
* Gets whether the panel is expanded.
* @return {?}
*/
function () {
return this.panel.expanded;
};
/** Gets the expanded state string of the panel. */
/**
* Gets the expanded state string of the panel.
* @return {?}
*/
MatExpansionPanelHeader.prototype._getExpandedState = /**
* Gets the expanded state string of the panel.
* @return {?}
*/
function () {
return this.panel._getExpandedState();
};
/** Gets the panel id. */
/**
* Gets the panel id.
* @return {?}
*/
MatExpansionPanelHeader.prototype._getPanelId = /**
* Gets the panel id.
* @return {?}
*/
function () {
return this.panel.id;
};
/** Gets whether the expand indicator should be shown. */
/**
* Gets whether the expand indicator should be shown.
* @return {?}
*/
MatExpansionPanelHeader.prototype._showToggle = /**
* Gets whether the expand indicator should be shown.
* @return {?}
*/
function () {
return !this.panel.hideToggle && !this.panel.disabled;
};
/** Handle keydown event calling to toggle() if appropriate. */
/**
* Handle keydown event calling to toggle() if appropriate.
* @param {?} event
* @return {?}
*/
MatExpansionPanelHeader.prototype._keydown = /**
* Handle keydown event calling to toggle() if appropriate.
* @param {?} event
* @return {?}
*/
function (event) {
switch (event.keyCode) {
// Toggle for space and enter keys.
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__["SPACE"]:
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__["ENTER"]:
event.preventDefault();
this._toggle();
break;
default:
return;
}
};
/**
* @return {?}
*/
MatExpansionPanelHeader.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._parentChangeSubscription.unsubscribe();
this._focusMonitor.stopMonitoring(this._element.nativeElement);
};
MatExpansionPanelHeader.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-expansion-panel-header',
styles: [".mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:0}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-description,.mat-expansion-panel-header-title{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-description,[dir=rtl] .mat-expansion-panel-header-title{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:'';display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}"],
template: "<span class=\"mat-content\"><ng-content select=\"mat-panel-title\"></ng-content><ng-content select=\"mat-panel-description\"></ng-content><ng-content></ng-content></span><span [@indicatorRotate]=\"_getExpandedState()\" *ngIf=\"_showToggle()\" class=\"mat-expansion-indicator\"></span>",
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
animations: [
matExpansionAnimations.indicatorRotate,
matExpansionAnimations.expansionHeaderHeight
],
host: {
'class': 'mat-expansion-panel-header',
'role': 'button',
'[attr.id]': 'panel._headerId',
'[attr.tabindex]': 'panel.disabled ? -1 : 0',
'[attr.aria-controls]': '_getPanelId()',
'[attr.aria-expanded]': '_isExpanded()',
'[attr.aria-disabled]': 'panel.disabled',
'[class.mat-expanded]': '_isExpanded()',
'(click)': '_toggle()',
'(keydown)': '_keydown($event)',
'[@expansionHeight]': "{\n value: _getExpandedState(),\n params: {\n collapsedHeight: collapsedHeight,\n expandedHeight: expandedHeight\n }\n }",
},
},] },
];
/** @nocollapse */
MatExpansionPanelHeader.ctorParameters = function () { return [
{ type: MatExpansionPanel, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Host"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_9__["FocusMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"], },
]; };
MatExpansionPanelHeader.propDecorators = {
"expandedHeight": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"collapsedHeight": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
};
return MatExpansionPanelHeader;
}());
/**
* `<mat-panel-description>`
*
* This directive is to be used inside of the MatExpansionPanelHeader component.
*/
var MatExpansionPanelDescription = /** @class */ (function () {
function MatExpansionPanelDescription() {
}
MatExpansionPanelDescription.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'mat-panel-description',
host: {
class: 'mat-expansion-panel-header-description'
}
},] },
];
return MatExpansionPanelDescription;
}());
/**
* `<mat-panel-title>`
*
* This directive is to be used inside of the MatExpansionPanelHeader component.
*/
var MatExpansionPanelTitle = /** @class */ (function () {
function MatExpansionPanelTitle() {
}
MatExpansionPanelTitle.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'mat-panel-title',
host: {
class: 'mat-expansion-panel-header-title'
}
},] },
];
return MatExpansionPanelTitle;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatExpansionModule = /** @class */ (function () {
function MatExpansionModule() {
}
MatExpansionModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_11__["CommonModule"], _angular_cdk_accordion__WEBPACK_IMPORTED_MODULE_3__["CdkAccordionModule"], _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__["PortalModule"]],
exports: [
MatAccordion,
MatExpansionPanel,
MatExpansionPanelActionRow,
MatExpansionPanelHeader,
MatExpansionPanelTitle,
MatExpansionPanelDescription,
MatExpansionPanelContent,
],
declarations: [
MatAccordion,
MatExpansionPanel,
MatExpansionPanelActionRow,
MatExpansionPanelHeader,
MatExpansionPanelTitle,
MatExpansionPanelDescription,
MatExpansionPanelContent,
],
},] },
];
return MatExpansionModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=expansion.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/form-field.es5.js":
/*!***************************************************************!*\
!*** ./node_modules/@angular/material/esm5/form-field.es5.js ***!
\***************************************************************/
/*! exports provided: MatFormFieldModule, MatError, MatFormFieldBase, _MatFormFieldMixinBase, MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormField, MatFormFieldControl, getMatFormFieldPlaceholderConflictError, getMatFormFieldDuplicatedHintError, getMatFormFieldMissingControlError, MatHint, MatPlaceholder, MatPrefix, MatSuffix, MatLabel, matFormFieldAnimations */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatFormFieldModule", function() { return MatFormFieldModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatError", function() { return MatError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatFormFieldBase", function() { return MatFormFieldBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatFormFieldMixinBase", function() { return _MatFormFieldMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_FORM_FIELD_DEFAULT_OPTIONS", function() { return MAT_FORM_FIELD_DEFAULT_OPTIONS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatFormField", function() { return MatFormField; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatFormFieldControl", function() { return MatFormFieldControl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatFormFieldPlaceholderConflictError", function() { return getMatFormFieldPlaceholderConflictError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatFormFieldDuplicatedHintError", function() { return getMatFormFieldDuplicatedHintError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatFormFieldMissingControlError", function() { return getMatFormFieldMissingControlError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatHint", function() { return MatHint; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatPlaceholder", function() { return MatPlaceholder; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatPrefix", function() { return MatPrefix; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSuffix", function() { return MatSuffix; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatLabel", function() { return MatLabel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matFormFieldAnimations", function() { return matFormFieldAnimations; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ nextUniqueId = 0;
/**
* Single error message to be shown underneath the form field.
*/
var MatError = /** @class */ (function () {
function MatError() {
this.id = "mat-error-" + nextUniqueId++;
}
MatError.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'mat-error',
host: {
'class': 'mat-error',
'role': 'alert',
'[attr.id]': 'id',
}
},] },
];
/** @nocollapse */
MatError.propDecorators = {
"id": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatError;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Animations used by the MatFormField.
*/
var /** @type {?} */ matFormFieldAnimations = {
/** Animation that transitions the form field's error and hint messages. */
transitionMessages: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["trigger"])('transitionMessages', [
// TODO(mmalerba): Use angular animations for label animation as well.
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["state"])('enter', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["style"])({ opacity: 1, transform: 'translateY(0%)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["transition"])('void => enter', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["style"])({ opacity: 0, transform: 'translateY(-100%)' }),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["animate"])('300ms cubic-bezier(0.55, 0, 0.55, 0.2)'),
]),
])
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* An interface which allows a control to work inside of a `MatFormField`.
* @abstract
* @template T
*/
var /**
* An interface which allows a control to work inside of a `MatFormField`.
* @abstract
* @template T
*/
MatFormFieldControl = /** @class */ (function () {
function MatFormFieldControl() {
}
return MatFormFieldControl;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
* @return {?}
*/
function getMatFormFieldPlaceholderConflictError() {
return Error('Placeholder attribute and child element were both specified.');
}
/**
* \@docs-private
* @param {?} align
* @return {?}
*/
function getMatFormFieldDuplicatedHintError(align) {
return Error("A hint was already declared for 'align=\"" + align + "\"'.");
}
/**
* \@docs-private
* @return {?}
*/
function getMatFormFieldMissingControlError() {
return Error('mat-form-field must contain a MatFormFieldControl.');
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ nextUniqueId$1 = 0;
/**
* Hint text to be shown underneath the form field control.
*/
var MatHint = /** @class */ (function () {
function MatHint() {
/**
* Whether to align the hint label at the start or end of the line.
*/
this.align = 'start';
/**
* Unique ID for the hint. Used for the aria-describedby on the form field control.
*/
this.id = "mat-hint-" + nextUniqueId$1++;
}
MatHint.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'mat-hint',
host: {
'class': 'mat-hint',
'[class.mat-right]': 'align == "end"',
'[attr.id]': 'id',
// Remove align attribute to prevent it from interfering with layout.
'[attr.align]': 'null',
}
},] },
];
/** @nocollapse */
MatHint.propDecorators = {
"align": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"id": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatHint;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* The floating label for a `mat-form-field`.
*/
var MatLabel = /** @class */ (function () {
function MatLabel() {
}
MatLabel.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'mat-label'
},] },
];
return MatLabel;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* The placeholder text for an `MatFormField`.
* @deprecated Use `<mat-label>` to specify the label and the `placeholder` attribute to specify the
* placeholder.
* \@deletion-target 8.0.0
*/
var MatPlaceholder = /** @class */ (function () {
function MatPlaceholder() {
}
MatPlaceholder.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'mat-placeholder'
},] },
];
return MatPlaceholder;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Prefix to be placed the the front of the form field.
*/
var MatPrefix = /** @class */ (function () {
function MatPrefix() {
}
MatPrefix.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[matPrefix]',
},] },
];
return MatPrefix;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Suffix to be placed at the end of the form field.
*/
var MatSuffix = /** @class */ (function () {
function MatSuffix() {
}
MatSuffix.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[matSuffix]',
},] },
];
return MatSuffix;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ nextUniqueId$2 = 0;
var /** @type {?} */ floatingLabelScale = 0.75;
var /** @type {?} */ outlineGapPadding = 5;
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatFormFieldBase = /** @class */ (function () {
function MatFormFieldBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatFormFieldBase;
}());
var /** @type {?} */ _MatFormFieldMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["mixinColor"])(MatFormFieldBase, 'primary');
var /** @type {?} */ MAT_FORM_FIELD_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('MAT_FORM_FIELD_DEFAULT_OPTIONS');
/**
* Container for form controls that applies Material Design styling and behavior.
*/
var MatFormField = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(MatFormField, _super);
function MatFormField(_elementRef, _changeDetectorRef, labelOptions, _dir, _defaultOptions, _platform) {
var _this = _super.call(this, _elementRef) || this;
_this._elementRef = _elementRef;
_this._changeDetectorRef = _changeDetectorRef;
_this._dir = _dir;
_this._defaultOptions = _defaultOptions;
_this._platform = _platform;
/**
* Override for the logic that disables the label animation in certain cases.
*/
_this._showAlwaysAnimate = false;
/**
* State of the mat-hint and mat-error animations.
*/
_this._subscriptAnimationState = '';
_this._hintLabel = '';
// Unique id for the hint label.
_this._hintLabelId = "mat-hint-" + nextUniqueId$2++;
_this._outlineGapWidth = 0;
_this._outlineGapStart = 0;
_this._initialGapCalculated = false;
_this._labelOptions = labelOptions ? labelOptions : {};
_this.floatLabel = _this._labelOptions.float || 'auto';
return _this;
}
Object.defineProperty(MatFormField.prototype, "appearance", {
get: /**
* The form-field appearance style.
* @return {?}
*/
function () {
return this._appearance || this._defaultOptions && this._defaultOptions.appearance || 'legacy';
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._appearance = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatFormField.prototype, "hideRequiredMarker", {
get: /**
* Whether the required marker should be hidden.
* @return {?}
*/
function () { return this._hideRequiredMarker; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._hideRequiredMarker = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatFormField.prototype, "_shouldAlwaysFloat", {
/** Whether the floating label should always float or not. */
get: /**
* Whether the floating label should always float or not.
* @return {?}
*/
function () {
return this.floatLabel === 'always' && !this._showAlwaysAnimate;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatFormField.prototype, "_canLabelFloat", {
/** Whether the label can float or not. */
get: /**
* Whether the label can float or not.
* @return {?}
*/
function () { return this.floatLabel !== 'never'; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatFormField.prototype, "hintLabel", {
get: /**
* Text for the form field hint.
* @return {?}
*/
function () { return this._hintLabel; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._hintLabel = value;
this._processHints();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatFormField.prototype, "floatLabel", {
get: /**
* Whether the label should always float, never float or float as the user types.
*
* Note: only the legacy appearance supports the `never` option. `never` was originally added as a
* way to make the floating label emulate the behavior of a standard input placeholder. However
* the form field now supports both floating labels and placeholders. Therefore in the non-legacy
* appearances the `never` option has been disabled in favor of just using the placeholder.
* @return {?}
*/
function () {
return this.appearance !== 'legacy' && this._floatLabel === 'never' ? 'auto' : this._floatLabel;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (value !== this._floatLabel) {
this._floatLabel = value || this._labelOptions.float || 'auto';
this._changeDetectorRef.markForCheck();
}
},
enumerable: true,
configurable: true
});
/**
* Gets an ElementRef for the element that a overlay attached to the form-field should be
* positioned relative to.
*/
/**
* Gets an ElementRef for the element that a overlay attached to the form-field should be
* positioned relative to.
* @return {?}
*/
MatFormField.prototype.getConnectedOverlayOrigin = /**
* Gets an ElementRef for the element that a overlay attached to the form-field should be
* positioned relative to.
* @return {?}
*/
function () {
return this._connectionContainerRef || this._elementRef;
};
/**
* @return {?}
*/
MatFormField.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
this._validateControlChild();
if (this._control.controlType) {
this._elementRef.nativeElement.classList
.add("mat-form-field-type-" + this._control.controlType);
}
// Subscribe to changes in the child control state in order to update the form field UI.
this._control.stateChanges.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["startWith"])(/** @type {?} */ ((null)))).subscribe(function () {
_this._validatePlaceholders();
_this._syncDescribedByIds();
_this._changeDetectorRef.markForCheck();
});
// Run change detection if the value, prefix, or suffix changes.
var /** @type {?} */ valueChanges = this._control.ngControl && this._control.ngControl.valueChanges || rxjs__WEBPACK_IMPORTED_MODULE_6__["EMPTY"];
Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["merge"])(valueChanges, this._prefixChildren.changes, this._suffixChildren.changes)
.subscribe(function () { return _this._changeDetectorRef.markForCheck(); });
// Re-validate when the number of hints changes.
this._hintChildren.changes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["startWith"])(null)).subscribe(function () {
_this._processHints();
_this._changeDetectorRef.markForCheck();
});
// Update the aria-described by when the number of errors changes.
this._errorChildren.changes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["startWith"])(null)).subscribe(function () {
_this._syncDescribedByIds();
_this._changeDetectorRef.markForCheck();
});
};
/**
* @return {?}
*/
MatFormField.prototype.ngAfterContentChecked = /**
* @return {?}
*/
function () {
var _this = this;
this._validateControlChild();
if (!this._initialGapCalculated) {
Promise.resolve().then(function () { return _this.updateOutlineGap(); });
}
};
/**
* @return {?}
*/
MatFormField.prototype.ngAfterViewInit = /**
* @return {?}
*/
function () {
// Avoid animations on load.
this._subscriptAnimationState = 'enter';
this._changeDetectorRef.detectChanges();
};
/** Determines whether a class from the NgControl should be forwarded to the host element. */
/**
* Determines whether a class from the NgControl should be forwarded to the host element.
* @param {?} prop
* @return {?}
*/
MatFormField.prototype._shouldForward = /**
* Determines whether a class from the NgControl should be forwarded to the host element.
* @param {?} prop
* @return {?}
*/
function (prop) {
var /** @type {?} */ ngControl = this._control ? this._control.ngControl : null;
return ngControl && (/** @type {?} */ (ngControl))[prop];
};
/**
* @return {?}
*/
MatFormField.prototype._hasPlaceholder = /**
* @return {?}
*/
function () {
return !!(this._control && this._control.placeholder || this._placeholderChild);
};
/**
* @return {?}
*/
MatFormField.prototype._hasLabel = /**
* @return {?}
*/
function () {
return !!this._labelChild;
};
/**
* @return {?}
*/
MatFormField.prototype._shouldLabelFloat = /**
* @return {?}
*/
function () {
return this._canLabelFloat && (this._control.shouldLabelFloat || this._shouldAlwaysFloat);
};
/**
* @return {?}
*/
MatFormField.prototype._hideControlPlaceholder = /**
* @return {?}
*/
function () {
// In the legacy appearance the placeholder is promoted to a label if no label is given.
return this.appearance === 'legacy' && !this._hasLabel() ||
this._hasLabel() && !this._shouldLabelFloat();
};
/**
* @return {?}
*/
MatFormField.prototype._hasFloatingLabel = /**
* @return {?}
*/
function () {
// In the legacy appearance the placeholder is promoted to a label if no label is given.
return this._hasLabel() || this.appearance === 'legacy' && this._hasPlaceholder();
};
/** Determines whether to display hints or errors. */
/**
* Determines whether to display hints or errors.
* @return {?}
*/
MatFormField.prototype._getDisplayedMessages = /**
* Determines whether to display hints or errors.
* @return {?}
*/
function () {
return (this._errorChildren && this._errorChildren.length > 0 &&
this._control.errorState) ? 'error' : 'hint';
};
/** Animates the placeholder up and locks it in position. */
/**
* Animates the placeholder up and locks it in position.
* @return {?}
*/
MatFormField.prototype._animateAndLockLabel = /**
* Animates the placeholder up and locks it in position.
* @return {?}
*/
function () {
var _this = this;
if (this._hasFloatingLabel() && this._canLabelFloat) {
this._showAlwaysAnimate = true;
this.floatLabel = 'always';
Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["fromEvent"])(this._label.nativeElement, 'transitionend').pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["take"])(1)).subscribe(function () {
_this._showAlwaysAnimate = false;
});
this._changeDetectorRef.markForCheck();
}
};
/**
* Ensure that there is only one placeholder (either `placeholder` attribute on the child control
* or child element with the `mat-placeholder` directive).
* @return {?}
*/
MatFormField.prototype._validatePlaceholders = /**
* Ensure that there is only one placeholder (either `placeholder` attribute on the child control
* or child element with the `mat-placeholder` directive).
* @return {?}
*/
function () {
if (this._control.placeholder && this._placeholderChild) {
throw getMatFormFieldPlaceholderConflictError();
}
};
/**
* Does any extra processing that is required when handling the hints.
* @return {?}
*/
MatFormField.prototype._processHints = /**
* Does any extra processing that is required when handling the hints.
* @return {?}
*/
function () {
this._validateHints();
this._syncDescribedByIds();
};
/**
* Ensure that there is a maximum of one of each `<mat-hint>` alignment specified, with the
* attribute being considered as `align="start"`.
* @return {?}
*/
MatFormField.prototype._validateHints = /**
* Ensure that there is a maximum of one of each `<mat-hint>` alignment specified, with the
* attribute being considered as `align="start"`.
* @return {?}
*/
function () {
var _this = this;
if (this._hintChildren) {
var /** @type {?} */ startHint_1;
var /** @type {?} */ endHint_1;
this._hintChildren.forEach(function (hint) {
if (hint.align === 'start') {
if (startHint_1 || _this.hintLabel) {
throw getMatFormFieldDuplicatedHintError('start');
}
startHint_1 = hint;
}
else if (hint.align === 'end') {
if (endHint_1) {
throw getMatFormFieldDuplicatedHintError('end');
}
endHint_1 = hint;
}
});
}
};
/**
* Sets the list of element IDs that describe the child control. This allows the control to update
* its `aria-describedby` attribute accordingly.
* @return {?}
*/
MatFormField.prototype._syncDescribedByIds = /**
* Sets the list of element IDs that describe the child control. This allows the control to update
* its `aria-describedby` attribute accordingly.
* @return {?}
*/
function () {
if (this._control) {
var /** @type {?} */ ids = [];
if (this._getDisplayedMessages() === 'hint') {
var /** @type {?} */ startHint = this._hintChildren ?
this._hintChildren.find(function (hint) { return hint.align === 'start'; }) : null;
var /** @type {?} */ endHint = this._hintChildren ?
this._hintChildren.find(function (hint) { return hint.align === 'end'; }) : null;
if (startHint) {
ids.push(startHint.id);
}
else if (this._hintLabel) {
ids.push(this._hintLabelId);
}
if (endHint) {
ids.push(endHint.id);
}
}
else if (this._errorChildren) {
ids = this._errorChildren.map(function (error) { return error.id; });
}
this._control.setDescribedByIds(ids);
}
};
/** Throws an error if the form field's control is missing. */
/**
* Throws an error if the form field's control is missing.
* @return {?}
*/
MatFormField.prototype._validateControlChild = /**
* Throws an error if the form field's control is missing.
* @return {?}
*/
function () {
if (!this._control) {
throw getMatFormFieldMissingControlError();
}
};
/**
* Updates the width and position of the gap in the outline. Only relevant for the outline
* appearance.
*/
/**
* Updates the width and position of the gap in the outline. Only relevant for the outline
* appearance.
* @return {?}
*/
MatFormField.prototype.updateOutlineGap = /**
* Updates the width and position of the gap in the outline. Only relevant for the outline
* appearance.
* @return {?}
*/
function () {
if (this.appearance === 'outline' && this._label && this._label.nativeElement.children.length) {
if (this._platform && !this._platform.isBrowser) {
// getBoundingClientRect isn't available on the server.
this._initialGapCalculated = true;
return;
}
if (!document.documentElement.contains(this._elementRef.nativeElement)) {
return;
}
var /** @type {?} */ containerStart = this._getStartEnd(this._connectionContainerRef.nativeElement.getBoundingClientRect());
var /** @type {?} */ labelStart = this._getStartEnd(this._label.nativeElement.children[0].getBoundingClientRect());
var /** @type {?} */ labelWidth = 0;
for (var _i = 0, _a = this._label.nativeElement.children; _i < _a.length; _i++) {
var child = _a[_i];
labelWidth += child.offsetWidth;
}
this._outlineGapStart = labelStart - containerStart - outlineGapPadding;
this._outlineGapWidth = labelWidth * floatingLabelScale + outlineGapPadding * 2;
}
else {
this._outlineGapStart = 0;
this._outlineGapWidth = 0;
}
this._initialGapCalculated = true;
this._changeDetectorRef.markForCheck();
};
/**
* Gets the start end of the rect considering the current directionality.
* @param {?} rect
* @return {?}
*/
MatFormField.prototype._getStartEnd = /**
* Gets the start end of the rect considering the current directionality.
* @param {?} rect
* @return {?}
*/
function (rect) {
return this._dir && this._dir.value === 'rtl' ? rect.right : rect.left;
};
MatFormField.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-form-field',
exportAs: 'matFormField',
template: "<div class=\"mat-form-field-wrapper\"><div class=\"mat-form-field-flex\" #connectionContainer (click)=\"_control.onContainerClick && _control.onContainerClick($event)\"><div class=\"mat-form-field-prefix\" *ngIf=\"_prefixChildren.length\"><ng-content select=\"[matPrefix]\"></ng-content></div><div class=\"mat-form-field-infix\" #inputContainer><ng-content></ng-content><span class=\"mat-form-field-label-wrapper\"><label class=\"mat-form-field-label\" [attr.for]=\"_control.id\" [attr.aria-owns]=\"_control.id\" [class.mat-empty]=\"_control.empty && !_shouldAlwaysFloat\" [class.mat-form-field-empty]=\"_control.empty && !_shouldAlwaysFloat\" [class.mat-accent]=\"color == 'accent'\" [class.mat-warn]=\"color == 'warn'\" #label *ngIf=\"_hasFloatingLabel()\" [ngSwitch]=\"_hasLabel()\"><ng-container *ngSwitchCase=\"false\"><ng-content select=\"mat-placeholder\"></ng-content>{{_control.placeholder}}</ng-container><ng-content select=\"mat-label\" *ngSwitchCase=\"true\"></ng-content><span class=\"mat-placeholder-required mat-form-field-required-marker\" aria-hidden=\"true\" *ngIf=\"!hideRequiredMarker && _control.required && !_control.disabled\">&nbsp;*</span></label></span></div><div class=\"mat-form-field-suffix\" *ngIf=\"_suffixChildren.length\"><ng-content select=\"[matSuffix]\"></ng-content></div></div><div class=\"mat-form-field-underline\" #underline *ngIf=\"appearance != 'outline'\"><span class=\"mat-form-field-ripple\" [class.mat-accent]=\"color == 'accent'\" [class.mat-warn]=\"color == 'warn'\"></span></div><ng-container *ngIf=\"appearance == 'outline'\"><div class=\"mat-form-field-outline\"><div class=\"mat-form-field-outline-start\" [style.width.px]=\"_outlineGapStart\"></div><div class=\"mat-form-field-outline-gap\" [style.width.px]=\"_outlineGapWidth\"></div><div class=\"mat-form-field-outline-end\"></div></div><div class=\"mat-form-field-outline mat-form-field-outline-thick\"><div class=\"mat-form-field-outline-start\" [style.width.px]=\"_outlineGapStart\"></div><div class=\"mat-form-field-outline-gap\" [style.width.px]=\"_outlineGapWidth\"></div><div class=\"mat-form-field-outline-end\"></div></div></ng-container><div class=\"mat-form-field-subscript-wrapper\" [ngSwitch]=\"_getDisplayedMessages()\"><div *ngSwitchCase=\"'error'\" [@transitionMessages]=\"_subscriptAnimationState\"><ng-content select=\"mat-error\"></ng-content></div><div class=\"mat-form-field-hint-wrapper\" *ngSwitchCase=\"'hint'\" [@transitionMessages]=\"_subscriptAnimationState\"><div *ngIf=\"hintLabel\" [id]=\"_hintLabelId\" class=\"mat-hint\">{{hintLabel}}</div><ng-content select=\"mat-hint:not([align='end'])\"></ng-content><div class=\"mat-form-field-hint-spacer\"></div><ng-content select=\"mat-hint[align='end']\"></ng-content></div></div></div>",
// MatInput is a directive and can't have styles, so we need to include its styles here.
// The MatInput styles are fairly minimal so it shouldn't be a big deal for people who
// aren't using MatInput.
styles: [".mat-form-field{display:inline-block;position:relative;text-align:left}[dir=rtl] .mat-form-field{text-align:right}.mat-form-field-wrapper{position:relative}.mat-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-form-field-prefix,.mat-form-field-suffix{white-space:nowrap;flex:none;position:relative}.mat-form-field-infix{display:block;position:relative;flex:auto;min-width:0;width:180px}.mat-form-field-label-wrapper{position:absolute;left:0;box-sizing:content-box;width:100%;height:100%;overflow:hidden;pointer-events:none}.mat-form-field-label{position:absolute;left:0;font:inherit;pointer-events:none;width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;transform-origin:0 0;transition:transform .4s cubic-bezier(.25,.8,.25,1),color .4s cubic-bezier(.25,.8,.25,1),width .4s cubic-bezier(.25,.8,.25,1);display:none}[dir=rtl] .mat-form-field-label{transform-origin:100% 0;left:auto;right:0}.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label,.mat-form-field-empty.mat-form-field-label{display:block}.mat-form-field-autofill-control:-webkit-autofill+.mat-form-field-label-wrapper .mat-form-field-label{display:none}.mat-form-field-can-float .mat-form-field-autofill-control:-webkit-autofill+.mat-form-field-label-wrapper .mat-form-field-label{display:block;transition:none}.mat-input-server:focus+.mat-form-field-label-wrapper .mat-form-field-label,.mat-input-server[placeholder]:not(:placeholder-shown)+.mat-form-field-label-wrapper .mat-form-field-label{display:none}.mat-form-field-can-float .mat-input-server:focus+.mat-form-field-label-wrapper .mat-form-field-label,.mat-form-field-can-float .mat-input-server[placeholder]:not(:placeholder-shown)+.mat-form-field-label-wrapper .mat-form-field-label{display:block}.mat-form-field-label:not(.mat-form-field-empty){transition:none}.mat-form-field-underline{position:absolute;width:100%;pointer-events:none;transform:scaleY(1.0001)}.mat-form-field-ripple{position:absolute;left:0;width:100%;transform-origin:50%;transform:scaleX(.5);opacity:0;transition:background-color .3s cubic-bezier(.55,0,.55,.2)}.mat-form-field.mat-focused .mat-form-field-ripple,.mat-form-field.mat-form-field-invalid .mat-form-field-ripple{opacity:1;transform:scaleX(1);transition:transform .3s cubic-bezier(.25,.8,.25,1),opacity .1s cubic-bezier(.25,.8,.25,1),background-color .3s cubic-bezier(.25,.8,.25,1)}.mat-form-field-subscript-wrapper{position:absolute;box-sizing:border-box;width:100%;overflow:hidden}.mat-form-field-label-wrapper .mat-icon,.mat-form-field-subscript-wrapper .mat-icon{width:1em;height:1em;font-size:inherit;vertical-align:baseline}.mat-form-field-hint-wrapper{display:flex}.mat-form-field-hint-spacer{flex:1 0 1em}.mat-error{display:block} .mat-form-field-appearance-fill .mat-form-field-flex{border-radius:4px 4px 0 0;padding:.75em .75em 0 .75em}.mat-form-field-appearance-fill .mat-form-field-underline::before{content:'';display:block;position:absolute;bottom:0;height:1px;width:100%}.mat-form-field-appearance-fill .mat-form-field-ripple{bottom:0;height:2px}.mat-form-field-appearance-fill:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{opacity:1;transform:none;transition:opacity .6s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-fill .mat-form-field-subscript-wrapper{padding:0 1em} .mat-form-field-appearance-legacy .mat-form-field-label{transform:perspective(100px);-ms-transform:none}.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-icon{width:1em}.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-icon-button,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-icon-button{font:inherit;vertical-align:baseline}.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-icon-button .mat-icon{font-size:inherit}.mat-form-field-appearance-legacy .mat-form-field-underline{height:1px}.mat-form-field-appearance-legacy .mat-form-field-ripple{top:0;height:2px}.mat-form-field-appearance-legacy.mat-form-field-disabled .mat-form-field-underline{background-position:0;background-color:transparent}.mat-form-field-appearance-legacy.mat-form-field-invalid:not(.mat-focused) .mat-form-field-ripple{height:1px} .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:.25em 0}.mat-form-field-appearance-outline .mat-form-field-flex{padding:0 .75em 0 .75em;margin-top:-.25em}.mat-form-field-appearance-outline .mat-form-field-prefix,.mat-form-field-appearance-outline .mat-form-field-suffix{top:.25em}.mat-form-field-appearance-outline .mat-form-field-outline{display:flex;position:absolute;top:0;left:0;right:0;pointer-events:none}.mat-form-field-appearance-outline .mat-form-field-outline-end,.mat-form-field-appearance-outline .mat-form-field-outline-start{border:1px solid currentColor;min-width:5px}.mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:5px 0 0 5px;border-right-style:none}[dir=rtl] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-right-style:solid;border-left-style:none;border-radius:0 5px 5px 0}.mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 5px 5px 0;border-left-style:none;flex-grow:1}[dir=rtl] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-left-style:solid;border-right-style:none;border-radius:5px 0 0 5px}.mat-form-field-appearance-outline .mat-form-field-outline-gap{border-radius:.000001px;border:1px solid currentColor;border-left-style:none;border-right-style:none}.mat-form-field-appearance-outline.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-outline-gap{border-top-color:transparent}.mat-form-field-appearance-outline .mat-form-field-outline-thick{opacity:0}.mat-form-field-appearance-outline .mat-form-field-outline-thick .mat-form-field-outline-end,.mat-form-field-appearance-outline .mat-form-field-outline-thick .mat-form-field-outline-gap,.mat-form-field-appearance-outline .mat-form-field-outline-thick .mat-form-field-outline-start{border-width:2px;transition:border-color .3s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-outline.mat-focused .mat-form-field-outline,.mat-form-field-appearance-outline.mat-form-field-invalid .mat-form-field-outline{opacity:0;transition:opacity .1s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick,.mat-form-field-appearance-outline.mat-form-field-invalid .mat-form-field-outline-thick{opacity:1}.mat-form-field-appearance-outline:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-outline{opacity:0;transition:opacity .6s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-outline:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-outline-thick{opacity:1}.mat-form-field-appearance-outline .mat-form-field-subscript-wrapper{padding:0 1em} .mat-form-field-appearance-standard .mat-form-field-flex{padding-top:.75em}.mat-form-field-appearance-standard .mat-form-field-underline{height:1px}.mat-form-field-appearance-standard .mat-form-field-ripple{bottom:0;height:2px}.mat-form-field-appearance-standard.mat-form-field-disabled .mat-form-field-underline{background-position:0;background-color:transparent}.mat-form-field-appearance-standard:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{opacity:1;transform:none;transition:opacity .6s cubic-bezier(.25,.8,.25,1)} .mat-input-element{font:inherit;background:0 0;color:currentColor;border:none;outline:0;padding:0;margin:0;width:100%;max-width:100%;vertical-align:bottom;text-align:inherit}.mat-input-element:-moz-ui-invalid{box-shadow:none}.mat-input-element::-ms-clear,.mat-input-element::-ms-reveal{display:none}.mat-input-element[type=date]::after,.mat-input-element[type=datetime-local]::after,.mat-input-element[type=datetime]::after,.mat-input-element[type=month]::after,.mat-input-element[type=time]::after,.mat-input-element[type=week]::after{content:' ';white-space:pre;width:1px}.mat-input-element::placeholder{transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-input-element::-moz-placeholder{transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-input-element::-webkit-input-placeholder{transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-input-element:-ms-input-placeholder{transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-form-field-hide-placeholder .mat-input-element::placeholder{color:transparent!important;transition:none}.mat-form-field-hide-placeholder .mat-input-element::-moz-placeholder{color:transparent!important;transition:none}.mat-form-field-hide-placeholder .mat-input-element::-webkit-input-placeholder{color:transparent!important;transition:none}.mat-form-field-hide-placeholder .mat-input-element:-ms-input-placeholder{color:transparent!important;transition:none}textarea.mat-input-element{resize:vertical;overflow:auto}textarea.mat-input-element.cdk-textarea-autosize{resize:none}textarea.mat-input-element{padding:2px 0;margin:-2px 0}"],
animations: [matFormFieldAnimations.transitionMessages],
host: {
'class': 'mat-form-field',
'[class.mat-form-field-appearance-standard]': 'appearance == "standard"',
'[class.mat-form-field-appearance-fill]': 'appearance == "fill"',
'[class.mat-form-field-appearance-outline]': 'appearance == "outline"',
'[class.mat-form-field-appearance-legacy]': 'appearance == "legacy"',
'[class.mat-form-field-invalid]': '_control.errorState',
'[class.mat-form-field-can-float]': '_canLabelFloat',
'[class.mat-form-field-should-float]': '_shouldLabelFloat()',
'[class.mat-form-field-hide-placeholder]': '_hideControlPlaceholder()',
'[class.mat-form-field-disabled]': '_control.disabled',
'[class.mat-form-field-autofilled]': '_control.autofilled',
'[class.mat-focused]': '_control.focused',
'[class.mat-accent]': 'color == "accent"',
'[class.mat-warn]': 'color == "warn"',
'[class.ng-untouched]': '_shouldForward("untouched")',
'[class.ng-touched]': '_shouldForward("touched")',
'[class.ng-pristine]': '_shouldForward("pristine")',
'[class.ng-dirty]': '_shouldForward("dirty")',
'[class.ng-valid]': '_shouldForward("valid")',
'[class.ng-invalid]': '_shouldForward("invalid")',
'[class.ng-pending]': '_shouldForward("pending")',
},
inputs: ['color'],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatFormField.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_5__["MAT_LABEL_GLOBAL_OPTIONS"],] },] },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_3__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [MAT_FORM_FIELD_DEFAULT_OPTIONS,] },] },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_8__["Platform"], },
]; };
MatFormField.propDecorators = {
"appearance": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"hideRequiredMarker": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"hintLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"floatLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"underlineRef": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: ['underline',] },],
"_connectionContainerRef": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: ['connectionContainer',] },],
"_inputContainerRef": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: ['inputContainer',] },],
"_label": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: ['label',] },],
"_control": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChild"], args: [MatFormFieldControl,] },],
"_placeholderChild": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChild"], args: [MatPlaceholder,] },],
"_labelChild": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChild"], args: [MatLabel,] },],
"_errorChildren": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [MatError,] },],
"_hintChildren": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [MatHint,] },],
"_prefixChildren": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [MatPrefix,] },],
"_suffixChildren": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [MatSuffix,] },],
};
return MatFormField;
}(_MatFormFieldMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatFormFieldModule = /** @class */ (function () {
function MatFormFieldModule() {
}
MatFormFieldModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
declarations: [
MatError,
MatFormField,
MatHint,
MatLabel,
MatPlaceholder,
MatPrefix,
MatSuffix,
],
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_9__["CommonModule"]],
exports: [
MatError,
MatFormField,
MatHint,
MatLabel,
MatPlaceholder,
MatPrefix,
MatSuffix,
],
},] },
];
return MatFormFieldModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=form-field.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/grid-list.es5.js":
/*!**************************************************************!*\
!*** ./node_modules/@angular/material/esm5/grid-list.es5.js ***!
\**************************************************************/
/*! exports provided: MatGridListModule, MatGridList, MatGridTile, MatGridTileText, MatGridAvatarCssMatStyler, MatGridTileHeaderCssMatStyler, MatGridTileFooterCssMatStyler */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatGridListModule", function() { return MatGridListModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatGridList", function() { return MatGridList; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatGridTile", function() { return MatGridTile; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatGridTileText", function() { return MatGridTileText; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatGridAvatarCssMatStyler", function() { return MatGridAvatarCssMatStyler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatGridTileHeaderCssMatStyler", function() { return MatGridTileHeaderCssMatStyler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatGridTileFooterCssMatStyler", function() { return MatGridTileFooterCssMatStyler; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Converts values into strings. Falsy values become empty strings.
* \@docs-private
* @param {?} value
* @return {?}
*/
function coerceToString(value) {
return "" + (value || '');
}
/**
* Converts a value that might be a string into a number.
* \@docs-private
* @param {?} value
* @return {?}
*/
function coerceToNumber(value) {
return typeof value === 'string' ? parseInt(value, 10) : value;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatGridTile = /** @class */ (function () {
function MatGridTile(_element) {
this._element = _element;
this._rowspan = 1;
this._colspan = 1;
}
Object.defineProperty(MatGridTile.prototype, "rowspan", {
get: /**
* Amount of rows that the grid tile takes up.
* @return {?}
*/
function () { return this._rowspan; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._rowspan = coerceToNumber(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatGridTile.prototype, "colspan", {
get: /**
* Amount of columns that the grid tile takes up.
* @return {?}
*/
function () { return this._colspan; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._colspan = coerceToNumber(value); },
enumerable: true,
configurable: true
});
/**
* Sets the style of the grid-tile element. Needs to be set manually to avoid
* "Changed after checked" errors that would occur with HostBinding.
*/
/**
* Sets the style of the grid-tile element. Needs to be set manually to avoid
* "Changed after checked" errors that would occur with HostBinding.
* @param {?} property
* @param {?} value
* @return {?}
*/
MatGridTile.prototype._setStyle = /**
* Sets the style of the grid-tile element. Needs to be set manually to avoid
* "Changed after checked" errors that would occur with HostBinding.
* @param {?} property
* @param {?} value
* @return {?}
*/
function (property, value) {
this._element.nativeElement.style[property] = value;
};
MatGridTile.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-grid-tile',
exportAs: 'matGridTile',
host: {
'class': 'mat-grid-tile',
},
template: "<figure class=\"mat-figure\"><ng-content></ng-content></figure>",
styles: [".mat-grid-list{display:block;position:relative}.mat-grid-tile{display:block;position:absolute;overflow:hidden}.mat-grid-tile .mat-figure{top:0;left:0;right:0;bottom:0;position:absolute;display:flex;align-items:center;justify-content:center;height:100%;padding:0;margin:0}.mat-grid-tile .mat-grid-tile-footer,.mat-grid-tile .mat-grid-tile-header{display:flex;align-items:center;height:48px;color:#fff;background:rgba(0,0,0,.38);overflow:hidden;padding:0 16px;position:absolute;left:0;right:0}.mat-grid-tile .mat-grid-tile-footer>*,.mat-grid-tile .mat-grid-tile-header>*{margin:0;padding:0;font-weight:400;font-size:inherit}.mat-grid-tile .mat-grid-tile-footer.mat-2-line,.mat-grid-tile .mat-grid-tile-header.mat-2-line{height:68px}.mat-grid-tile .mat-grid-list-text{display:flex;flex-direction:column;width:100%;box-sizing:border-box;overflow:hidden}.mat-grid-tile .mat-grid-list-text>*{margin:0;padding:0;font-weight:400;font-size:inherit}.mat-grid-tile .mat-grid-list-text:empty{display:none}.mat-grid-tile .mat-grid-tile-header{top:0}.mat-grid-tile .mat-grid-tile-footer{bottom:0}.mat-grid-tile .mat-grid-avatar{padding-right:16px}[dir=rtl] .mat-grid-tile .mat-grid-avatar{padding-right:0;padding-left:16px}.mat-grid-tile .mat-grid-avatar:empty{display:none}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatGridTile.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
]; };
MatGridTile.propDecorators = {
"rowspan": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"colspan": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatGridTile;
}());
var MatGridTileText = /** @class */ (function () {
function MatGridTileText(_element) {
this._element = _element;
}
/**
* @return {?}
*/
MatGridTileText.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
this._lineSetter = new _angular_material_core__WEBPACK_IMPORTED_MODULE_1__["MatLineSetter"](this._lines, this._element);
};
MatGridTileText.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-grid-tile-header, mat-grid-tile-footer',
template: "<ng-content select=\"[mat-grid-avatar], [matGridAvatar]\"></ng-content><div class=\"mat-grid-list-text\"><ng-content select=\"[mat-line], [matLine]\"></ng-content></div><ng-content></ng-content>",
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatGridTileText.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
]; };
MatGridTileText.propDecorators = {
"_lines": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_1__["MatLine"],] },],
};
return MatGridTileText;
}());
/**
* Directive whose purpose is to add the mat- CSS styling to this selector.
* \@docs-private
*/
var MatGridAvatarCssMatStyler = /** @class */ (function () {
function MatGridAvatarCssMatStyler() {
}
MatGridAvatarCssMatStyler.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[mat-grid-avatar], [matGridAvatar]',
host: { 'class': 'mat-grid-avatar' }
},] },
];
return MatGridAvatarCssMatStyler;
}());
/**
* Directive whose purpose is to add the mat- CSS styling to this selector.
* \@docs-private
*/
var MatGridTileHeaderCssMatStyler = /** @class */ (function () {
function MatGridTileHeaderCssMatStyler() {
}
MatGridTileHeaderCssMatStyler.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'mat-grid-tile-header',
host: { 'class': 'mat-grid-tile-header' }
},] },
];
return MatGridTileHeaderCssMatStyler;
}());
/**
* Directive whose purpose is to add the mat- CSS styling to this selector.
* \@docs-private
*/
var MatGridTileFooterCssMatStyler = /** @class */ (function () {
function MatGridTileFooterCssMatStyler() {
}
MatGridTileFooterCssMatStyler.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'mat-grid-tile-footer',
host: { 'class': 'mat-grid-tile-footer' }
},] },
];
return MatGridTileFooterCssMatStyler;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Class for determining, from a list of tiles, the (row, col) position of each of those tiles
* in the grid. This is necessary (rather than just rendering the tiles in normal document flow)
* because the tiles can have a rowspan.
*
* The positioning algorithm greedily places each tile as soon as it encounters a gap in the grid
* large enough to accommodate it so that the tiles still render in the same order in which they
* are given.
*
* The basis of the algorithm is the use of an array to track the already placed tiles. Each
* element of the array corresponds to a column, and the value indicates how many cells in that
* column are already occupied; zero indicates an empty cell. Moving "down" to the next row
* decrements each value in the tracking array (indicating that the column is one cell closer to
* being free).
*
* \@docs-private
*/
var /**
* Class for determining, from a list of tiles, the (row, col) position of each of those tiles
* in the grid. This is necessary (rather than just rendering the tiles in normal document flow)
* because the tiles can have a rowspan.
*
* The positioning algorithm greedily places each tile as soon as it encounters a gap in the grid
* large enough to accommodate it so that the tiles still render in the same order in which they
* are given.
*
* The basis of the algorithm is the use of an array to track the already placed tiles. Each
* element of the array corresponds to a column, and the value indicates how many cells in that
* column are already occupied; zero indicates an empty cell. Moving "down" to the next row
* decrements each value in the tracking array (indicating that the column is one cell closer to
* being free).
*
* \@docs-private
*/
TileCoordinator = /** @class */ (function () {
function TileCoordinator(numColumns, tiles) {
var _this = this;
/**
* Index at which the search for the next gap will start.
*/
this.columnIndex = 0;
/**
* The current row index.
*/
this.rowIndex = 0;
this.tracker = new Array(numColumns);
this.tracker.fill(0, 0, this.tracker.length);
this.positions = tiles.map(function (tile) { return _this._trackTile(tile); });
}
Object.defineProperty(TileCoordinator.prototype, "rowCount", {
/** Gets the total number of rows occupied by tiles */
get: /**
* Gets the total number of rows occupied by tiles
* @return {?}
*/
function () { return this.rowIndex + 1; },
enumerable: true,
configurable: true
});
Object.defineProperty(TileCoordinator.prototype, "rowspan", {
/**
* Gets the total span of rows occupied by tiles.
* Ex: A list with 1 row that contains a tile with rowspan 2 will have a total rowspan of 2.
*/
get: /**
* Gets the total span of rows occupied by tiles.
* Ex: A list with 1 row that contains a tile with rowspan 2 will have a total rowspan of 2.
* @return {?}
*/
function () {
var /** @type {?} */ lastRowMax = Math.max.apply(Math, this.tracker);
// if any of the tiles has a rowspan that pushes it beyond the total row count,
// add the difference to the rowcount
return lastRowMax > 1 ? this.rowCount + lastRowMax - 1 : this.rowCount;
},
enumerable: true,
configurable: true
});
/**
* Calculates the row and col position of a tile.
* @param {?} tile
* @return {?}
*/
TileCoordinator.prototype._trackTile = /**
* Calculates the row and col position of a tile.
* @param {?} tile
* @return {?}
*/
function (tile) {
// Find a gap large enough for this tile.
var /** @type {?} */ gapStartIndex = this._findMatchingGap(tile.colspan);
// Place tile in the resulting gap.
this._markTilePosition(gapStartIndex, tile);
// The next time we look for a gap, the search will start at columnIndex, which should be
// immediately after the tile that has just been placed.
this.columnIndex = gapStartIndex + tile.colspan;
return new TilePosition(this.rowIndex, gapStartIndex);
};
/**
* Finds the next available space large enough to fit the tile.
* @param {?} tileCols
* @return {?}
*/
TileCoordinator.prototype._findMatchingGap = /**
* Finds the next available space large enough to fit the tile.
* @param {?} tileCols
* @return {?}
*/
function (tileCols) {
if (tileCols > this.tracker.length) {
throw Error("mat-grid-list: tile with colspan " + tileCols + " is wider than " +
("grid with cols=\"" + this.tracker.length + "\"."));
}
// Start index is inclusive, end index is exclusive.
var /** @type {?} */ gapStartIndex = -1;
var /** @type {?} */ gapEndIndex = -1;
// Look for a gap large enough to fit the given tile. Empty spaces are marked with a zero.
do {
// If we've reached the end of the row, go to the next row.
if (this.columnIndex + tileCols > this.tracker.length) {
this._nextRow();
continue;
}
gapStartIndex = this.tracker.indexOf(0, this.columnIndex);
// If there are no more empty spaces in this row at all, move on to the next row.
if (gapStartIndex == -1) {
this._nextRow();
continue;
}
gapEndIndex = this._findGapEndIndex(gapStartIndex);
// If a gap large enough isn't found, we want to start looking immediately after the current
// gap on the next iteration.
this.columnIndex = gapStartIndex + 1;
// Continue iterating until we find a gap wide enough for this tile.
} while (gapEndIndex - gapStartIndex < tileCols);
// If we still didn't manage to find a gap, ensure that the index is
// at least zero so the tile doesn't get pulled out of the grid.
return Math.max(gapStartIndex, 0);
};
/**
* Move "down" to the next row.
* @return {?}
*/
TileCoordinator.prototype._nextRow = /**
* Move "down" to the next row.
* @return {?}
*/
function () {
this.columnIndex = 0;
this.rowIndex++;
// Decrement all spaces by one to reflect moving down one row.
for (var /** @type {?} */ i = 0; i < this.tracker.length; i++) {
this.tracker[i] = Math.max(0, this.tracker[i] - 1);
}
};
/**
* Finds the end index (exclusive) of a gap given the index from which to start looking.
* The gap ends when a non-zero value is found.
* @param {?} gapStartIndex
* @return {?}
*/
TileCoordinator.prototype._findGapEndIndex = /**
* Finds the end index (exclusive) of a gap given the index from which to start looking.
* The gap ends when a non-zero value is found.
* @param {?} gapStartIndex
* @return {?}
*/
function (gapStartIndex) {
for (var /** @type {?} */ i = gapStartIndex + 1; i < this.tracker.length; i++) {
if (this.tracker[i] != 0) {
return i;
}
}
// The gap ends with the end of the row.
return this.tracker.length;
};
/**
* Update the tile tracker to account for the given tile in the given space.
* @param {?} start
* @param {?} tile
* @return {?}
*/
TileCoordinator.prototype._markTilePosition = /**
* Update the tile tracker to account for the given tile in the given space.
* @param {?} start
* @param {?} tile
* @return {?}
*/
function (start, tile) {
for (var /** @type {?} */ i = 0; i < tile.colspan; i++) {
this.tracker[start + i] = tile.rowspan;
}
};
return TileCoordinator;
}());
/**
* Simple data structure for tile position (row, col).
* \@docs-private
*/
var /**
* Simple data structure for tile position (row, col).
* \@docs-private
*/
TilePosition = /** @class */ (function () {
function TilePosition(row, col) {
this.row = row;
this.col = col;
}
return TilePosition;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Sets the style properties for an individual tile, given the position calculated by the
* Tile Coordinator.
* \@docs-private
* @abstract
*/
var /**
* Sets the style properties for an individual tile, given the position calculated by the
* Tile Coordinator.
* \@docs-private
* @abstract
*/
TileStyler = /** @class */ (function () {
function TileStyler() {
this._rows = 0;
this._rowspan = 0;
}
/**
* Adds grid-list layout info once it is available. Cannot be processed in the constructor
* because these properties haven't been calculated by that point.
*
* @param gutterSize Size of the grid's gutter.
* @param tracker Instance of the TileCoordinator.
* @param cols Amount of columns in the grid.
* @param direction Layout direction of the grid.
*/
/**
* Adds grid-list layout info once it is available. Cannot be processed in the constructor
* because these properties haven't been calculated by that point.
*
* @param {?} gutterSize Size of the grid's gutter.
* @param {?} tracker Instance of the TileCoordinator.
* @param {?} cols Amount of columns in the grid.
* @param {?} direction Layout direction of the grid.
* @return {?}
*/
TileStyler.prototype.init = /**
* Adds grid-list layout info once it is available. Cannot be processed in the constructor
* because these properties haven't been calculated by that point.
*
* @param {?} gutterSize Size of the grid's gutter.
* @param {?} tracker Instance of the TileCoordinator.
* @param {?} cols Amount of columns in the grid.
* @param {?} direction Layout direction of the grid.
* @return {?}
*/
function (gutterSize, tracker, cols, direction) {
this._gutterSize = normalizeUnits(gutterSize);
this._rows = tracker.rowCount;
this._rowspan = tracker.rowspan;
this._cols = cols;
this._direction = direction;
};
/**
* Computes the amount of space a single 1x1 tile would take up (width or height).
* Used as a basis for other calculations.
* @param sizePercent Percent of the total grid-list space that one 1x1 tile would take up.
* @param gutterFraction Fraction of the gutter size taken up by one 1x1 tile.
* @return The size of a 1x1 tile as an expression that can be evaluated via CSS calc().
*/
/**
* Computes the amount of space a single 1x1 tile would take up (width or height).
* Used as a basis for other calculations.
* @param {?} sizePercent Percent of the total grid-list space that one 1x1 tile would take up.
* @param {?} gutterFraction Fraction of the gutter size taken up by one 1x1 tile.
* @return {?} The size of a 1x1 tile as an expression that can be evaluated via CSS calc().
*/
TileStyler.prototype.getBaseTileSize = /**
* Computes the amount of space a single 1x1 tile would take up (width or height).
* Used as a basis for other calculations.
* @param {?} sizePercent Percent of the total grid-list space that one 1x1 tile would take up.
* @param {?} gutterFraction Fraction of the gutter size taken up by one 1x1 tile.
* @return {?} The size of a 1x1 tile as an expression that can be evaluated via CSS calc().
*/
function (sizePercent, gutterFraction) {
// Take the base size percent (as would be if evenly dividing the size between cells),
// and then subtracting the size of one gutter. However, since there are no gutters on the
// edges, each tile only uses a fraction (gutterShare = numGutters / numCells) of the gutter
// size. (Imagine having one gutter per tile, and then breaking up the extra gutter on the
// edge evenly among the cells).
return "(" + sizePercent + "% - (" + this._gutterSize + " * " + gutterFraction + "))";
};
/**
* Gets The horizontal or vertical position of a tile, e.g., the 'top' or 'left' property value.
* @param offset Number of tiles that have already been rendered in the row/column.
* @param baseSize Base size of a 1x1 tile (as computed in getBaseTileSize).
* @return Position of the tile as a CSS calc() expression.
*/
/**
* Gets The horizontal or vertical position of a tile, e.g., the 'top' or 'left' property value.
* @param {?} baseSize Base size of a 1x1 tile (as computed in getBaseTileSize).
* @param {?} offset Number of tiles that have already been rendered in the row/column.
* @return {?} Position of the tile as a CSS calc() expression.
*/
TileStyler.prototype.getTilePosition = /**
* Gets The horizontal or vertical position of a tile, e.g., the 'top' or 'left' property value.
* @param {?} baseSize Base size of a 1x1 tile (as computed in getBaseTileSize).
* @param {?} offset Number of tiles that have already been rendered in the row/column.
* @return {?} Position of the tile as a CSS calc() expression.
*/
function (baseSize, offset) {
// The position comes the size of a 1x1 tile plus gutter for each previous tile in the
// row/column (offset).
return offset === 0 ? '0' : calc("(" + baseSize + " + " + this._gutterSize + ") * " + offset);
};
/**
* Gets the actual size of a tile, e.g., width or height, taking rowspan or colspan into account.
* @param baseSize Base size of a 1x1 tile (as computed in getBaseTileSize).
* @param span The tile's rowspan or colspan.
* @return Size of the tile as a CSS calc() expression.
*/
/**
* Gets the actual size of a tile, e.g., width or height, taking rowspan or colspan into account.
* @param {?} baseSize Base size of a 1x1 tile (as computed in getBaseTileSize).
* @param {?} span The tile's rowspan or colspan.
* @return {?} Size of the tile as a CSS calc() expression.
*/
TileStyler.prototype.getTileSize = /**
* Gets the actual size of a tile, e.g., width or height, taking rowspan or colspan into account.
* @param {?} baseSize Base size of a 1x1 tile (as computed in getBaseTileSize).
* @param {?} span The tile's rowspan or colspan.
* @return {?} Size of the tile as a CSS calc() expression.
*/
function (baseSize, span) {
return "(" + baseSize + " * " + span + ") + (" + (span - 1) + " * " + this._gutterSize + ")";
};
/**
* Sets the style properties to be applied to a tile for the given row and column index.
* @param tile Tile to which to apply the styling.
* @param rowIndex Index of the tile's row.
* @param colIndex Index of the tile's column.
*/
/**
* Sets the style properties to be applied to a tile for the given row and column index.
* @param {?} tile Tile to which to apply the styling.
* @param {?} rowIndex Index of the tile's row.
* @param {?} colIndex Index of the tile's column.
* @return {?}
*/
TileStyler.prototype.setStyle = /**
* Sets the style properties to be applied to a tile for the given row and column index.
* @param {?} tile Tile to which to apply the styling.
* @param {?} rowIndex Index of the tile's row.
* @param {?} colIndex Index of the tile's column.
* @return {?}
*/
function (tile, rowIndex, colIndex) {
// Percent of the available horizontal space that one column takes up.
var /** @type {?} */ percentWidthPerTile = 100 / this._cols;
// Fraction of the vertical gutter size that each column takes up.
// For example, if there are 5 columns, each column uses 4/5 = 0.8 times the gutter width.
var /** @type {?} */ gutterWidthFractionPerTile = (this._cols - 1) / this._cols;
this.setColStyles(tile, colIndex, percentWidthPerTile, gutterWidthFractionPerTile);
this.setRowStyles(tile, rowIndex, percentWidthPerTile, gutterWidthFractionPerTile);
};
/** Sets the horizontal placement of the tile in the list. */
/**
* Sets the horizontal placement of the tile in the list.
* @param {?} tile
* @param {?} colIndex
* @param {?} percentWidth
* @param {?} gutterWidth
* @return {?}
*/
TileStyler.prototype.setColStyles = /**
* Sets the horizontal placement of the tile in the list.
* @param {?} tile
* @param {?} colIndex
* @param {?} percentWidth
* @param {?} gutterWidth
* @return {?}
*/
function (tile, colIndex, percentWidth, gutterWidth) {
// Base horizontal size of a column.
var /** @type {?} */ baseTileWidth = this.getBaseTileSize(percentWidth, gutterWidth);
// The width and horizontal position of each tile is always calculated the same way, but the
// height and vertical position depends on the rowMode.
var /** @type {?} */ side = this._direction === 'rtl' ? 'right' : 'left';
tile._setStyle(side, this.getTilePosition(baseTileWidth, colIndex));
tile._setStyle('width', calc(this.getTileSize(baseTileWidth, tile.colspan)));
};
/**
* Calculates the total size taken up by gutters across one axis of a list.
*/
/**
* Calculates the total size taken up by gutters across one axis of a list.
* @return {?}
*/
TileStyler.prototype.getGutterSpan = /**
* Calculates the total size taken up by gutters across one axis of a list.
* @return {?}
*/
function () {
return this._gutterSize + " * (" + this._rowspan + " - 1)";
};
/**
* Calculates the total size taken up by tiles across one axis of a list.
* @param tileHeight Height of the tile.
*/
/**
* Calculates the total size taken up by tiles across one axis of a list.
* @param {?} tileHeight Height of the tile.
* @return {?}
*/
TileStyler.prototype.getTileSpan = /**
* Calculates the total size taken up by tiles across one axis of a list.
* @param {?} tileHeight Height of the tile.
* @return {?}
*/
function (tileHeight) {
return this._rowspan + " * " + this.getTileSize(tileHeight, 1);
};
/**
* Calculates the computed height and returns the correct style property to set.
* This method can be implemented by each type of TileStyler.
* @docs-private
*/
/**
* Calculates the computed height and returns the correct style property to set.
* This method can be implemented by each type of TileStyler.
* \@docs-private
* @return {?}
*/
TileStyler.prototype.getComputedHeight = /**
* Calculates the computed height and returns the correct style property to set.
* This method can be implemented by each type of TileStyler.
* \@docs-private
* @return {?}
*/
function () { return null; };
return TileStyler;
}());
/**
* This type of styler is instantiated when the user passes in a fixed row height.
* Example `<mat-grid-list cols="3" rowHeight="100px">`
* \@docs-private
*/
var /**
* This type of styler is instantiated when the user passes in a fixed row height.
* Example `<mat-grid-list cols="3" rowHeight="100px">`
* \@docs-private
*/
FixedTileStyler = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(FixedTileStyler, _super);
function FixedTileStyler(fixedRowHeight) {
var _this = _super.call(this) || this;
_this.fixedRowHeight = fixedRowHeight;
return _this;
}
/**
* @param {?} gutterSize
* @param {?} tracker
* @param {?} cols
* @param {?} direction
* @return {?}
*/
FixedTileStyler.prototype.init = /**
* @param {?} gutterSize
* @param {?} tracker
* @param {?} cols
* @param {?} direction
* @return {?}
*/
function (gutterSize, tracker, cols, direction) {
_super.prototype.init.call(this, gutterSize, tracker, cols, direction);
this.fixedRowHeight = normalizeUnits(this.fixedRowHeight);
};
/**
* @param {?} tile
* @param {?} rowIndex
* @return {?}
*/
FixedTileStyler.prototype.setRowStyles = /**
* @param {?} tile
* @param {?} rowIndex
* @return {?}
*/
function (tile, rowIndex) {
tile._setStyle('top', this.getTilePosition(this.fixedRowHeight, rowIndex));
tile._setStyle('height', calc(this.getTileSize(this.fixedRowHeight, tile.rowspan)));
};
/**
* @return {?}
*/
FixedTileStyler.prototype.getComputedHeight = /**
* @return {?}
*/
function () {
return [
'height', calc(this.getTileSpan(this.fixedRowHeight) + " + " + this.getGutterSpan())
];
};
/**
* @param {?} list
* @return {?}
*/
FixedTileStyler.prototype.reset = /**
* @param {?} list
* @return {?}
*/
function (list) {
list._setListStyle(['height', null]);
list._tiles.forEach(function (tile) {
tile._setStyle('top', null);
tile._setStyle('height', null);
});
};
return FixedTileStyler;
}(TileStyler));
/**
* This type of styler is instantiated when the user passes in a width:height ratio
* for the row height. Example `<mat-grid-list cols="3" rowHeight="3:1">`
* \@docs-private
*/
var /**
* This type of styler is instantiated when the user passes in a width:height ratio
* for the row height. Example `<mat-grid-list cols="3" rowHeight="3:1">`
* \@docs-private
*/
RatioTileStyler = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(RatioTileStyler, _super);
function RatioTileStyler(value) {
var _this = _super.call(this) || this;
_this._parseRatio(value);
return _this;
}
/**
* @param {?} tile
* @param {?} rowIndex
* @param {?} percentWidth
* @param {?} gutterWidth
* @return {?}
*/
RatioTileStyler.prototype.setRowStyles = /**
* @param {?} tile
* @param {?} rowIndex
* @param {?} percentWidth
* @param {?} gutterWidth
* @return {?}
*/
function (tile, rowIndex, percentWidth, gutterWidth) {
var /** @type {?} */ percentHeightPerTile = percentWidth / this.rowHeightRatio;
this.baseTileHeight = this.getBaseTileSize(percentHeightPerTile, gutterWidth);
// Use padding-top and margin-top to maintain the given aspect ratio, as
// a percentage-based value for these properties is applied versus the *width* of the
// containing block. See http://www.w3.org/TR/CSS2/box.html#margin-properties
tile._setStyle('marginTop', this.getTilePosition(this.baseTileHeight, rowIndex));
tile._setStyle('paddingTop', calc(this.getTileSize(this.baseTileHeight, tile.rowspan)));
};
/**
* @return {?}
*/
RatioTileStyler.prototype.getComputedHeight = /**
* @return {?}
*/
function () {
return [
'paddingBottom', calc(this.getTileSpan(this.baseTileHeight) + " + " + this.getGutterSpan())
];
};
/**
* @param {?} list
* @return {?}
*/
RatioTileStyler.prototype.reset = /**
* @param {?} list
* @return {?}
*/
function (list) {
list._setListStyle(['paddingBottom', null]);
list._tiles.forEach(function (tile) {
tile._setStyle('marginTop', null);
tile._setStyle('paddingTop', null);
});
};
/**
* @param {?} value
* @return {?}
*/
RatioTileStyler.prototype._parseRatio = /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ ratioParts = value.split(':');
if (ratioParts.length !== 2) {
throw Error("mat-grid-list: invalid ratio given for row-height: \"" + value + "\"");
}
this.rowHeightRatio = parseFloat(ratioParts[0]) / parseFloat(ratioParts[1]);
};
return RatioTileStyler;
}(TileStyler));
/**
* This type of styler is instantiated when the user selects a "fit" row height mode.
* In other words, the row height will reflect the total height of the container divided
* by the number of rows. Example `<mat-grid-list cols="3" rowHeight="fit">`
*
* \@docs-private
*/
var /**
* This type of styler is instantiated when the user selects a "fit" row height mode.
* In other words, the row height will reflect the total height of the container divided
* by the number of rows. Example `<mat-grid-list cols="3" rowHeight="fit">`
*
* \@docs-private
*/
FitTileStyler = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(FitTileStyler, _super);
function FitTileStyler() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* @param {?} tile
* @param {?} rowIndex
* @return {?}
*/
FitTileStyler.prototype.setRowStyles = /**
* @param {?} tile
* @param {?} rowIndex
* @return {?}
*/
function (tile, rowIndex) {
// Percent of the available vertical space that one row takes up.
var /** @type {?} */ percentHeightPerTile = 100 / this._rowspan;
// Fraction of the horizontal gutter size that each column takes up.
var /** @type {?} */ gutterHeightPerTile = (this._rows - 1) / this._rows;
// Base vertical size of a column.
var /** @type {?} */ baseTileHeight = this.getBaseTileSize(percentHeightPerTile, gutterHeightPerTile);
tile._setStyle('top', this.getTilePosition(baseTileHeight, rowIndex));
tile._setStyle('height', calc(this.getTileSize(baseTileHeight, tile.rowspan)));
};
/**
* @param {?} list
* @return {?}
*/
FitTileStyler.prototype.reset = /**
* @param {?} list
* @return {?}
*/
function (list) {
list._tiles.forEach(function (tile) {
tile._setStyle('top', null);
tile._setStyle('height', null);
});
};
return FitTileStyler;
}(TileStyler));
/**
* Wraps a CSS string in a calc function
* @param {?} exp
* @return {?}
*/
function calc(exp) { return "calc(" + exp + ")"; }
/**
* Appends pixels to a CSS string if no units are given.
* @param {?} value
* @return {?}
*/
function normalizeUnits(value) {
return (value.match(/px|em|rem/)) ? value : value + 'px';
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
// TODO(kara): Conditional (responsive) column count / row size.
// TODO(kara): Re-layout on window resize / media change (debounced).
// TODO(kara): gridTileHeader and gridTileFooter.
var /** @type {?} */ MAT_FIT_MODE = 'fit';
var MatGridList = /** @class */ (function () {
function MatGridList(_element, _dir) {
this._element = _element;
this._dir = _dir;
/**
* The amount of space between tiles. This will be something like '5px' or '2em'.
*/
this._gutter = '1px';
}
Object.defineProperty(MatGridList.prototype, "cols", {
get: /**
* Amount of columns in the grid list.
* @return {?}
*/
function () { return this._cols; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._cols = coerceToNumber(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatGridList.prototype, "gutterSize", {
get: /**
* Size of the grid list's gutter in pixels.
* @return {?}
*/
function () { return this._gutter; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._gutter = coerceToString(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatGridList.prototype, "rowHeight", {
set: /**
* Set internal representation of row height from the user-provided value.
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ newValue = coerceToString(value);
if (newValue !== this._rowHeight) {
this._rowHeight = newValue;
this._setTileStyler(this._rowHeight);
}
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatGridList.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._checkCols();
this._checkRowHeight();
};
/**
* The layout calculation is fairly cheap if nothing changes, so there's little cost
* to run it frequently.
*/
/**
* The layout calculation is fairly cheap if nothing changes, so there's little cost
* to run it frequently.
* @return {?}
*/
MatGridList.prototype.ngAfterContentChecked = /**
* The layout calculation is fairly cheap if nothing changes, so there's little cost
* to run it frequently.
* @return {?}
*/
function () {
this._layoutTiles();
};
/**
* Throw a friendly error if cols property is missing
* @return {?}
*/
MatGridList.prototype._checkCols = /**
* Throw a friendly error if cols property is missing
* @return {?}
*/
function () {
if (!this.cols) {
throw Error("mat-grid-list: must pass in number of columns. " +
"Example: <mat-grid-list cols=\"3\">");
}
};
/**
* Default to equal width:height if rowHeight property is missing
* @return {?}
*/
MatGridList.prototype._checkRowHeight = /**
* Default to equal width:height if rowHeight property is missing
* @return {?}
*/
function () {
if (!this._rowHeight) {
this._setTileStyler('1:1');
}
};
/**
* Creates correct Tile Styler subtype based on rowHeight passed in by user
* @param {?} rowHeight
* @return {?}
*/
MatGridList.prototype._setTileStyler = /**
* Creates correct Tile Styler subtype based on rowHeight passed in by user
* @param {?} rowHeight
* @return {?}
*/
function (rowHeight) {
if (this._tileStyler) {
this._tileStyler.reset(this);
}
if (rowHeight === MAT_FIT_MODE) {
this._tileStyler = new FitTileStyler();
}
else if (rowHeight && rowHeight.indexOf(':') > -1) {
this._tileStyler = new RatioTileStyler(rowHeight);
}
else {
this._tileStyler = new FixedTileStyler(rowHeight);
}
};
/**
* Computes and applies the size and position for all children grid tiles.
* @return {?}
*/
MatGridList.prototype._layoutTiles = /**
* Computes and applies the size and position for all children grid tiles.
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ tracker = new TileCoordinator(this.cols, this._tiles);
var /** @type {?} */ direction = this._dir ? this._dir.value : 'ltr';
this._tileStyler.init(this.gutterSize, tracker, this.cols, direction);
this._tiles.forEach(function (tile, index) {
var /** @type {?} */ pos = tracker.positions[index];
_this._tileStyler.setStyle(tile, pos.row, pos.col);
});
this._setListStyle(this._tileStyler.getComputedHeight());
};
/** Sets style on the main grid-list element, given the style name and value. */
/**
* Sets style on the main grid-list element, given the style name and value.
* @param {?} style
* @return {?}
*/
MatGridList.prototype._setListStyle = /**
* Sets style on the main grid-list element, given the style name and value.
* @param {?} style
* @return {?}
*/
function (style) {
if (style) {
this._element.nativeElement.style[style[0]] = style[1];
}
};
MatGridList.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-grid-list',
exportAs: 'matGridList',
template: "<div><ng-content></ng-content></div>",
styles: [".mat-grid-list{display:block;position:relative}.mat-grid-tile{display:block;position:absolute;overflow:hidden}.mat-grid-tile .mat-figure{top:0;left:0;right:0;bottom:0;position:absolute;display:flex;align-items:center;justify-content:center;height:100%;padding:0;margin:0}.mat-grid-tile .mat-grid-tile-footer,.mat-grid-tile .mat-grid-tile-header{display:flex;align-items:center;height:48px;color:#fff;background:rgba(0,0,0,.38);overflow:hidden;padding:0 16px;position:absolute;left:0;right:0}.mat-grid-tile .mat-grid-tile-footer>*,.mat-grid-tile .mat-grid-tile-header>*{margin:0;padding:0;font-weight:400;font-size:inherit}.mat-grid-tile .mat-grid-tile-footer.mat-2-line,.mat-grid-tile .mat-grid-tile-header.mat-2-line{height:68px}.mat-grid-tile .mat-grid-list-text{display:flex;flex-direction:column;width:100%;box-sizing:border-box;overflow:hidden}.mat-grid-tile .mat-grid-list-text>*{margin:0;padding:0;font-weight:400;font-size:inherit}.mat-grid-tile .mat-grid-list-text:empty{display:none}.mat-grid-tile .mat-grid-tile-header{top:0}.mat-grid-tile .mat-grid-tile-footer{bottom:0}.mat-grid-tile .mat-grid-avatar{padding-right:16px}[dir=rtl] .mat-grid-tile .mat-grid-avatar{padding-right:0;padding-left:16px}.mat-grid-tile .mat-grid-avatar:empty{display:none}"],
host: {
'class': 'mat-grid-list',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatGridList.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_3__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
MatGridList.propDecorators = {
"_tiles": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [MatGridTile,] },],
"cols": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"gutterSize": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"rowHeight": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatGridList;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatGridListModule = /** @class */ (function () {
function MatGridListModule() {
}
MatGridListModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [_angular_material_core__WEBPACK_IMPORTED_MODULE_1__["MatLineModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_1__["MatCommonModule"]],
exports: [
MatGridList,
MatGridTile,
MatGridTileText,
_angular_material_core__WEBPACK_IMPORTED_MODULE_1__["MatLineModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_1__["MatCommonModule"],
MatGridTileHeaderCssMatStyler,
MatGridTileFooterCssMatStyler,
MatGridAvatarCssMatStyler
],
declarations: [
MatGridList,
MatGridTile,
MatGridTileText,
MatGridTileHeaderCssMatStyler,
MatGridTileFooterCssMatStyler,
MatGridAvatarCssMatStyler
],
},] },
];
return MatGridListModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=grid-list.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/icon.es5.js":
/*!*********************************************************!*\
!*** ./node_modules/@angular/material/esm5/icon.es5.js ***!
\*********************************************************/
/*! exports provided: MatIconModule, MatIconBase, _MatIconMixinBase, MatIcon, getMatIconNameNotFoundError, getMatIconNoHttpProviderError, getMatIconFailedToSanitizeUrlError, getMatIconFailedToSanitizeLiteralError, MatIconRegistry, ICON_REGISTRY_PROVIDER_FACTORY, ICON_REGISTRY_PROVIDER */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatIconModule", function() { return MatIconModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatIconBase", function() { return MatIconBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatIconMixinBase", function() { return _MatIconMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatIcon", function() { return MatIcon; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatIconNameNotFoundError", function() { return getMatIconNameNotFoundError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatIconNoHttpProviderError", function() { return getMatIconNoHttpProviderError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatIconFailedToSanitizeUrlError", function() { return getMatIconFailedToSanitizeUrlError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatIconFailedToSanitizeLiteralError", function() { return getMatIconFailedToSanitizeLiteralError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatIconRegistry", function() { return MatIconRegistry; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ICON_REGISTRY_PROVIDER_FACTORY", function() { return ICON_REGISTRY_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ICON_REGISTRY_PROVIDER", function() { return ICON_REGISTRY_PROVIDER; });
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/fesm5/platform-browser.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Returns an exception to be thrown in the case when attempting to
* load an icon with a name that cannot be found.
* \@docs-private
* @param {?} iconName
* @return {?}
*/
function getMatIconNameNotFoundError(iconName) {
return Error("Unable to find icon with the name \"" + iconName + "\"");
}
/**
* Returns an exception to be thrown when the consumer attempts to use
* `<mat-icon>` without including \@angular/http.
* \@docs-private
* @return {?}
*/
function getMatIconNoHttpProviderError() {
return Error('Could not find HttpClient provider for use with Angular Material icons. ' +
'Please include the HttpClientModule from @angular/common/http in your ' +
'app imports.');
}
/**
* Returns an exception to be thrown when a URL couldn't be sanitized.
* \@docs-private
* @param {?} url URL that was attempted to be sanitized.
* @return {?}
*/
function getMatIconFailedToSanitizeUrlError(url) {
return Error("The URL provided to MatIconRegistry was not trusted as a resource URL " +
("via Angular's DomSanitizer. Attempted URL was \"" + url + "\"."));
}
/**
* Returns an exception to be thrown when a HTML string couldn't be sanitized.
* \@docs-private
* @param {?} literal HTML that was attempted to be sanitized.
* @return {?}
*/
function getMatIconFailedToSanitizeLiteralError(literal) {
return Error("The literal provided to MatIconRegistry was not trusted as safe HTML by " +
("Angular's DomSanitizer. Attempted literal was \"" + literal + "\"."));
}
/**
* Configuration for an icon, including the URL and possibly the cached SVG element.
* \@docs-private
*/
var /**
* Configuration for an icon, including the URL and possibly the cached SVG element.
* \@docs-private
*/
SvgIconConfig = /** @class */ (function () {
function SvgIconConfig(data) {
// Note that we can't use `instanceof SVGElement` here,
// because it'll break during server-side rendering.
if (!!(/** @type {?} */ (data)).nodeName) {
this.svgElement = /** @type {?} */ (data);
}
else {
this.url = /** @type {?} */ (data);
}
}
return SvgIconConfig;
}());
/**
* Service to register and display icons used by the `<mat-icon>` component.
* - Registers icon URLs by namespace and name.
* - Registers icon set URLs by namespace.
* - Registers aliases for CSS classes, for use with icon fonts.
* - Loads icons from URLs and extracts individual icons from icon sets.
*/
var MatIconRegistry = /** @class */ (function () {
function MatIconRegistry(_httpClient, _sanitizer, document) {
this._httpClient = _httpClient;
this._sanitizer = _sanitizer;
/**
* URLs and cached SVG elements for individual icons. Keys are of the format "[namespace]:[icon]".
*/
this._svgIconConfigs = new Map();
/**
* SvgIconConfig objects and cached SVG elements for icon sets, keyed by namespace.
* Multiple icon sets can be registered under the same namespace.
*/
this._iconSetConfigs = new Map();
/**
* Cache for icons loaded by direct URLs.
*/
this._cachedIconsByUrl = new Map();
/**
* In-progress icon fetches. Used to coalesce multiple requests to the same URL.
*/
this._inProgressUrlFetches = new Map();
/**
* Map from font identifiers to their CSS class names. Used for icon fonts.
*/
this._fontCssClassesByAlias = new Map();
/**
* The CSS class to apply when an `<mat-icon>` component has no icon name, url, or font specified.
* The default 'material-icons' value assumes that the material icon font has been loaded as
* described at http://google.github.io/material-design-icons/#icon-font-for-the-web
*/
this._defaultFontSetClass = 'material-icons';
this._document = document;
}
/**
* Registers an icon by URL in the default namespace.
* @param iconName Name under which the icon should be registered.
* @param url
*/
/**
* Registers an icon by URL in the default namespace.
* @param {?} iconName Name under which the icon should be registered.
* @param {?} url
* @return {?}
*/
MatIconRegistry.prototype.addSvgIcon = /**
* Registers an icon by URL in the default namespace.
* @param {?} iconName Name under which the icon should be registered.
* @param {?} url
* @return {?}
*/
function (iconName, url) {
return this.addSvgIconInNamespace('', iconName, url);
};
/**
* Registers an icon using an HTML string in the default namespace.
* @param iconName Name under which the icon should be registered.
* @param literal SVG source of the icon.
*/
/**
* Registers an icon using an HTML string in the default namespace.
* @param {?} iconName Name under which the icon should be registered.
* @param {?} literal SVG source of the icon.
* @return {?}
*/
MatIconRegistry.prototype.addSvgIconLiteral = /**
* Registers an icon using an HTML string in the default namespace.
* @param {?} iconName Name under which the icon should be registered.
* @param {?} literal SVG source of the icon.
* @return {?}
*/
function (iconName, literal) {
return this.addSvgIconLiteralInNamespace('', iconName, literal);
};
/**
* Registers an icon by URL in the specified namespace.
* @param namespace Namespace in which the icon should be registered.
* @param iconName Name under which the icon should be registered.
* @param url
*/
/**
* Registers an icon by URL in the specified namespace.
* @param {?} namespace Namespace in which the icon should be registered.
* @param {?} iconName Name under which the icon should be registered.
* @param {?} url
* @return {?}
*/
MatIconRegistry.prototype.addSvgIconInNamespace = /**
* Registers an icon by URL in the specified namespace.
* @param {?} namespace Namespace in which the icon should be registered.
* @param {?} iconName Name under which the icon should be registered.
* @param {?} url
* @return {?}
*/
function (namespace, iconName, url) {
return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(url));
};
/**
* Registers an icon using an HTML string in the specified namespace.
* @param namespace Namespace in which the icon should be registered.
* @param iconName Name under which the icon should be registered.
* @param literal SVG source of the icon.
*/
/**
* Registers an icon using an HTML string in the specified namespace.
* @param {?} namespace Namespace in which the icon should be registered.
* @param {?} iconName Name under which the icon should be registered.
* @param {?} literal SVG source of the icon.
* @return {?}
*/
MatIconRegistry.prototype.addSvgIconLiteralInNamespace = /**
* Registers an icon using an HTML string in the specified namespace.
* @param {?} namespace Namespace in which the icon should be registered.
* @param {?} iconName Name under which the icon should be registered.
* @param {?} literal SVG source of the icon.
* @return {?}
*/
function (namespace, iconName, literal) {
var /** @type {?} */ sanitizedLiteral = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_2__["SecurityContext"].HTML, literal);
if (!sanitizedLiteral) {
throw getMatIconFailedToSanitizeLiteralError(literal);
}
var /** @type {?} */ svgElement = this._createSvgElementForSingleIcon(sanitizedLiteral);
return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(svgElement));
};
/**
* Registers an icon set by URL in the default namespace.
* @param url
*/
/**
* Registers an icon set by URL in the default namespace.
* @param {?} url
* @return {?}
*/
MatIconRegistry.prototype.addSvgIconSet = /**
* Registers an icon set by URL in the default namespace.
* @param {?} url
* @return {?}
*/
function (url) {
return this.addSvgIconSetInNamespace('', url);
};
/**
* Registers an icon set using an HTML string in the default namespace.
* @param literal SVG source of the icon set.
*/
/**
* Registers an icon set using an HTML string in the default namespace.
* @param {?} literal SVG source of the icon set.
* @return {?}
*/
MatIconRegistry.prototype.addSvgIconSetLiteral = /**
* Registers an icon set using an HTML string in the default namespace.
* @param {?} literal SVG source of the icon set.
* @return {?}
*/
function (literal) {
return this.addSvgIconSetLiteralInNamespace('', literal);
};
/**
* Registers an icon set by URL in the specified namespace.
* @param namespace Namespace in which to register the icon set.
* @param url
*/
/**
* Registers an icon set by URL in the specified namespace.
* @param {?} namespace Namespace in which to register the icon set.
* @param {?} url
* @return {?}
*/
MatIconRegistry.prototype.addSvgIconSetInNamespace = /**
* Registers an icon set by URL in the specified namespace.
* @param {?} namespace Namespace in which to register the icon set.
* @param {?} url
* @return {?}
*/
function (namespace, url) {
return this._addSvgIconSetConfig(namespace, new SvgIconConfig(url));
};
/**
* Registers an icon set using an HTML string in the specified namespace.
* @param namespace Namespace in which to register the icon set.
* @param literal SVG source of the icon set.
*/
/**
* Registers an icon set using an HTML string in the specified namespace.
* @param {?} namespace Namespace in which to register the icon set.
* @param {?} literal SVG source of the icon set.
* @return {?}
*/
MatIconRegistry.prototype.addSvgIconSetLiteralInNamespace = /**
* Registers an icon set using an HTML string in the specified namespace.
* @param {?} namespace Namespace in which to register the icon set.
* @param {?} literal SVG source of the icon set.
* @return {?}
*/
function (namespace, literal) {
var /** @type {?} */ sanitizedLiteral = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_2__["SecurityContext"].HTML, literal);
if (!sanitizedLiteral) {
throw getMatIconFailedToSanitizeLiteralError(literal);
}
var /** @type {?} */ svgElement = this._svgElementFromString(sanitizedLiteral);
return this._addSvgIconSetConfig(namespace, new SvgIconConfig(svgElement));
};
/**
* Defines an alias for a CSS class name to be used for icon fonts. Creating an matIcon
* component with the alias as the fontSet input will cause the class name to be applied
* to the `<mat-icon>` element.
*
* @param alias Alias for the font.
* @param className Class name override to be used instead of the alias.
*/
/**
* Defines an alias for a CSS class name to be used for icon fonts. Creating an matIcon
* component with the alias as the fontSet input will cause the class name to be applied
* to the `<mat-icon>` element.
*
* @param {?} alias Alias for the font.
* @param {?=} className Class name override to be used instead of the alias.
* @return {?}
*/
MatIconRegistry.prototype.registerFontClassAlias = /**
* Defines an alias for a CSS class name to be used for icon fonts. Creating an matIcon
* component with the alias as the fontSet input will cause the class name to be applied
* to the `<mat-icon>` element.
*
* @param {?} alias Alias for the font.
* @param {?=} className Class name override to be used instead of the alias.
* @return {?}
*/
function (alias, className) {
if (className === void 0) { className = alias; }
this._fontCssClassesByAlias.set(alias, className);
return this;
};
/**
* Returns the CSS class name associated with the alias by a previous call to
* registerFontClassAlias. If no CSS class has been associated, returns the alias unmodified.
*/
/**
* Returns the CSS class name associated with the alias by a previous call to
* registerFontClassAlias. If no CSS class has been associated, returns the alias unmodified.
* @param {?} alias
* @return {?}
*/
MatIconRegistry.prototype.classNameForFontAlias = /**
* Returns the CSS class name associated with the alias by a previous call to
* registerFontClassAlias. If no CSS class has been associated, returns the alias unmodified.
* @param {?} alias
* @return {?}
*/
function (alias) {
return this._fontCssClassesByAlias.get(alias) || alias;
};
/**
* Sets the CSS class name to be used for icon fonts when an `<mat-icon>` component does not
* have a fontSet input value, and is not loading an icon by name or URL.
*
* @param className
*/
/**
* Sets the CSS class name to be used for icon fonts when an `<mat-icon>` component does not
* have a fontSet input value, and is not loading an icon by name or URL.
*
* @param {?} className
* @return {?}
*/
MatIconRegistry.prototype.setDefaultFontSetClass = /**
* Sets the CSS class name to be used for icon fonts when an `<mat-icon>` component does not
* have a fontSet input value, and is not loading an icon by name or URL.
*
* @param {?} className
* @return {?}
*/
function (className) {
this._defaultFontSetClass = className;
return this;
};
/**
* Returns the CSS class name to be used for icon fonts when an `<mat-icon>` component does not
* have a fontSet input value, and is not loading an icon by name or URL.
*/
/**
* Returns the CSS class name to be used for icon fonts when an `<mat-icon>` component does not
* have a fontSet input value, and is not loading an icon by name or URL.
* @return {?}
*/
MatIconRegistry.prototype.getDefaultFontSetClass = /**
* Returns the CSS class name to be used for icon fonts when an `<mat-icon>` component does not
* have a fontSet input value, and is not loading an icon by name or URL.
* @return {?}
*/
function () {
return this._defaultFontSetClass;
};
/**
* Returns an Observable that produces the icon (as an `<svg>` DOM element) from the given URL.
* The response from the URL may be cached so this will not always cause an HTTP request, but
* the produced element will always be a new copy of the originally fetched icon. (That is,
* it will not contain any modifications made to elements previously returned).
*
* @param safeUrl URL from which to fetch the SVG icon.
*/
/**
* Returns an Observable that produces the icon (as an `<svg>` DOM element) from the given URL.
* The response from the URL may be cached so this will not always cause an HTTP request, but
* the produced element will always be a new copy of the originally fetched icon. (That is,
* it will not contain any modifications made to elements previously returned).
*
* @param {?} safeUrl URL from which to fetch the SVG icon.
* @return {?}
*/
MatIconRegistry.prototype.getSvgIconFromUrl = /**
* Returns an Observable that produces the icon (as an `<svg>` DOM element) from the given URL.
* The response from the URL may be cached so this will not always cause an HTTP request, but
* the produced element will always be a new copy of the originally fetched icon. (That is,
* it will not contain any modifications made to elements previously returned).
*
* @param {?} safeUrl URL from which to fetch the SVG icon.
* @return {?}
*/
function (safeUrl) {
var _this = this;
var /** @type {?} */ url = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_2__["SecurityContext"].RESOURCE_URL, safeUrl);
if (!url) {
throw getMatIconFailedToSanitizeUrlError(safeUrl);
}
var /** @type {?} */ cachedIcon = this._cachedIconsByUrl.get(url);
if (cachedIcon) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["of"])(cloneSvg(cachedIcon));
}
return this._loadSvgIconFromConfig(new SvgIconConfig(safeUrl)).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["tap"])(function (svg) { return _this._cachedIconsByUrl.set(/** @type {?} */ ((url)), svg); }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["map"])(function (svg) { return cloneSvg(svg); }));
};
/**
* Returns an Observable that produces the icon (as an `<svg>` DOM element) with the given name
* and namespace. The icon must have been previously registered with addIcon or addIconSet;
* if not, the Observable will throw an error.
*
* @param name Name of the icon to be retrieved.
* @param namespace Namespace in which to look for the icon.
*/
/**
* Returns an Observable that produces the icon (as an `<svg>` DOM element) with the given name
* and namespace. The icon must have been previously registered with addIcon or addIconSet;
* if not, the Observable will throw an error.
*
* @param {?} name Name of the icon to be retrieved.
* @param {?=} namespace Namespace in which to look for the icon.
* @return {?}
*/
MatIconRegistry.prototype.getNamedSvgIcon = /**
* Returns an Observable that produces the icon (as an `<svg>` DOM element) with the given name
* and namespace. The icon must have been previously registered with addIcon or addIconSet;
* if not, the Observable will throw an error.
*
* @param {?} name Name of the icon to be retrieved.
* @param {?=} namespace Namespace in which to look for the icon.
* @return {?}
*/
function (name, namespace) {
if (namespace === void 0) { namespace = ''; }
// Return (copy of) cached icon if possible.
var /** @type {?} */ key = iconKey(namespace, name);
var /** @type {?} */ config = this._svgIconConfigs.get(key);
if (config) {
return this._getSvgFromConfig(config);
}
// See if we have any icon sets registered for the namespace.
var /** @type {?} */ iconSetConfigs = this._iconSetConfigs.get(namespace);
if (iconSetConfigs) {
return this._getSvgFromIconSetConfigs(name, iconSetConfigs);
}
return Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["throwError"])(getMatIconNameNotFoundError(key));
};
/**
* Returns the cached icon for a SvgIconConfig if available, or fetches it from its URL if not.
* @param {?} config
* @return {?}
*/
MatIconRegistry.prototype._getSvgFromConfig = /**
* Returns the cached icon for a SvgIconConfig if available, or fetches it from its URL if not.
* @param {?} config
* @return {?}
*/
function (config) {
if (config.svgElement) {
// We already have the SVG element for this icon, return a copy.
return Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["of"])(cloneSvg(config.svgElement));
}
else {
// Fetch the icon from the config's URL, cache it, and return a copy.
return this._loadSvgIconFromConfig(config).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["tap"])(function (svg) { return config.svgElement = svg; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["map"])(function (svg) { return cloneSvg(svg); }));
}
};
/**
* Attempts to find an icon with the specified name in any of the SVG icon sets.
* First searches the available cached icons for a nested element with a matching name, and
* if found copies the element to a new `<svg>` element. If not found, fetches all icon sets
* that have not been cached, and searches again after all fetches are completed.
* The returned Observable produces the SVG element if possible, and throws
* an error if no icon with the specified name can be found.
* @param {?} name
* @param {?} iconSetConfigs
* @return {?}
*/
MatIconRegistry.prototype._getSvgFromIconSetConfigs = /**
* Attempts to find an icon with the specified name in any of the SVG icon sets.
* First searches the available cached icons for a nested element with a matching name, and
* if found copies the element to a new `<svg>` element. If not found, fetches all icon sets
* that have not been cached, and searches again after all fetches are completed.
* The returned Observable produces the SVG element if possible, and throws
* an error if no icon with the specified name can be found.
* @param {?} name
* @param {?} iconSetConfigs
* @return {?}
*/
function (name, iconSetConfigs) {
var _this = this;
// For all the icon set SVG elements we've fetched, see if any contain an icon with the
// requested name.
var /** @type {?} */ namedIcon = this._extractIconWithNameFromAnySet(name, iconSetConfigs);
if (namedIcon) {
// We could cache namedIcon in _svgIconConfigs, but since we have to make a copy every
// time anyway, there's probably not much advantage compared to just always extracting
// it from the icon set.
return Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["of"])(namedIcon);
}
// Not found in any cached icon sets. If there are icon sets with URLs that we haven't
// fetched, fetch them now and look for iconName in the results.
var /** @type {?} */ iconSetFetchRequests = iconSetConfigs
.filter(function (iconSetConfig) { return !iconSetConfig.svgElement; })
.map(function (iconSetConfig) {
return _this._loadSvgIconSetFromConfig(iconSetConfig).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["catchError"])(function (err) {
var /** @type {?} */ url = _this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_2__["SecurityContext"].RESOURCE_URL, iconSetConfig.url);
// Swallow errors fetching individual URLs so the
// combined Observable won't necessarily fail.
console.error("Loading icon set URL: " + url + " failed: " + err.message);
return Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["of"])(null);
}));
});
// Fetch all the icon set URLs. When the requests complete, every IconSet should have a
// cached SVG element (unless the request failed), and we can check again for the icon.
return Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["forkJoin"])(iconSetFetchRequests).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["map"])(function () {
var /** @type {?} */ foundIcon = _this._extractIconWithNameFromAnySet(name, iconSetConfigs);
if (!foundIcon) {
throw getMatIconNameNotFoundError(name);
}
return foundIcon;
}));
};
/**
* Searches the cached SVG elements for the given icon sets for a nested icon element whose "id"
* tag matches the specified name. If found, copies the nested element to a new SVG element and
* returns it. Returns null if no matching element is found.
* @param {?} iconName
* @param {?} iconSetConfigs
* @return {?}
*/
MatIconRegistry.prototype._extractIconWithNameFromAnySet = /**
* Searches the cached SVG elements for the given icon sets for a nested icon element whose "id"
* tag matches the specified name. If found, copies the nested element to a new SVG element and
* returns it. Returns null if no matching element is found.
* @param {?} iconName
* @param {?} iconSetConfigs
* @return {?}
*/
function (iconName, iconSetConfigs) {
// Iterate backwards, so icon sets added later have precedence.
for (var /** @type {?} */ i = iconSetConfigs.length - 1; i >= 0; i--) {
var /** @type {?} */ config = iconSetConfigs[i];
if (config.svgElement) {
var /** @type {?} */ foundIcon = this._extractSvgIconFromSet(config.svgElement, iconName);
if (foundIcon) {
return foundIcon;
}
}
}
return null;
};
/**
* Loads the content of the icon URL specified in the SvgIconConfig and creates an SVG element
* from it.
* @param {?} config
* @return {?}
*/
MatIconRegistry.prototype._loadSvgIconFromConfig = /**
* Loads the content of the icon URL specified in the SvgIconConfig and creates an SVG element
* from it.
* @param {?} config
* @return {?}
*/
function (config) {
var _this = this;
return this._fetchUrl(config.url)
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["map"])(function (svgText) { return _this._createSvgElementForSingleIcon(svgText); }));
};
/**
* Loads the content of the icon set URL specified in the SvgIconConfig and creates an SVG element
* from it.
* @param {?} config
* @return {?}
*/
MatIconRegistry.prototype._loadSvgIconSetFromConfig = /**
* Loads the content of the icon set URL specified in the SvgIconConfig and creates an SVG element
* from it.
* @param {?} config
* @return {?}
*/
function (config) {
var _this = this;
// If the SVG for this icon set has already been parsed, do nothing.
if (config.svgElement) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["of"])(config.svgElement);
}
return this._fetchUrl(config.url).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["map"])(function (svgText) {
// It is possible that the icon set was parsed and cached by an earlier request, so parsing
// only needs to occur if the cache is yet unset.
if (!config.svgElement) {
config.svgElement = _this._svgElementFromString(svgText);
}
return config.svgElement;
}));
};
/**
* Creates a DOM element from the given SVG string, and adds default attributes.
* @param {?} responseText
* @return {?}
*/
MatIconRegistry.prototype._createSvgElementForSingleIcon = /**
* Creates a DOM element from the given SVG string, and adds default attributes.
* @param {?} responseText
* @return {?}
*/
function (responseText) {
var /** @type {?} */ svg = this._svgElementFromString(responseText);
this._setSvgAttributes(svg);
return svg;
};
/**
* Searches the cached element of the given SvgIconConfig for a nested icon element whose "id"
* tag matches the specified name. If found, copies the nested element to a new SVG element and
* returns it. Returns null if no matching element is found.
* @param {?} iconSet
* @param {?} iconName
* @return {?}
*/
MatIconRegistry.prototype._extractSvgIconFromSet = /**
* Searches the cached element of the given SvgIconConfig for a nested icon element whose "id"
* tag matches the specified name. If found, copies the nested element to a new SVG element and
* returns it. Returns null if no matching element is found.
* @param {?} iconSet
* @param {?} iconName
* @return {?}
*/
function (iconSet, iconName) {
var /** @type {?} */ iconSource = iconSet.querySelector('#' + iconName);
if (!iconSource) {
return null;
}
// Clone the element and remove the ID to prevent multiple elements from being added
// to the page with the same ID.
var /** @type {?} */ iconElement = /** @type {?} */ (iconSource.cloneNode(true));
iconElement.removeAttribute('id');
// If the icon node is itself an <svg> node, clone and return it directly. If not, set it as
// the content of a new <svg> node.
if (iconElement.nodeName.toLowerCase() === 'svg') {
return this._setSvgAttributes(/** @type {?} */ (iconElement));
}
// If the node is a <symbol>, it won't be rendered so we have to convert it into <svg>. Note
// that the same could be achieved by referring to it via <use href="#id">, however the <use>
// tag is problematic on Firefox, because it needs to include the current page path.
if (iconElement.nodeName.toLowerCase() === 'symbol') {
return this._setSvgAttributes(this._toSvgElement(iconElement));
}
// createElement('SVG') doesn't work as expected; the DOM ends up with
// the correct nodes, but the SVG content doesn't render. Instead we
// have to create an empty SVG node using innerHTML and append its content.
// Elements created using DOMParser.parseFromString have the same problem.
// http://stackoverflow.com/questions/23003278/svg-innerhtml-in-firefox-can-not-display
var /** @type {?} */ svg = this._svgElementFromString('<svg></svg>');
// Clone the node so we don't remove it from the parent icon set element.
svg.appendChild(iconElement);
return this._setSvgAttributes(svg);
};
/**
* Creates a DOM element from the given SVG string.
* @param {?} str
* @return {?}
*/
MatIconRegistry.prototype._svgElementFromString = /**
* Creates a DOM element from the given SVG string.
* @param {?} str
* @return {?}
*/
function (str) {
var /** @type {?} */ div = this._document.createElement('DIV');
div.innerHTML = str;
var /** @type {?} */ svg = /** @type {?} */ (div.querySelector('svg'));
if (!svg) {
throw Error('<svg> tag not found');
}
return svg;
};
/**
* Converts an element into an SVG node by cloning all of its children.
* @param {?} element
* @return {?}
*/
MatIconRegistry.prototype._toSvgElement = /**
* Converts an element into an SVG node by cloning all of its children.
* @param {?} element
* @return {?}
*/
function (element) {
var /** @type {?} */ svg = this._svgElementFromString('<svg></svg>');
for (var /** @type {?} */ i = 0; i < element.childNodes.length; i++) {
if (element.childNodes[i].nodeType === this._document.ELEMENT_NODE) {
svg.appendChild(element.childNodes[i].cloneNode(true));
}
}
return svg;
};
/**
* Sets the default attributes for an SVG element to be used as an icon.
* @param {?} svg
* @return {?}
*/
MatIconRegistry.prototype._setSvgAttributes = /**
* Sets the default attributes for an SVG element to be used as an icon.
* @param {?} svg
* @return {?}
*/
function (svg) {
svg.setAttribute('fit', '');
svg.setAttribute('height', '100%');
svg.setAttribute('width', '100%');
svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
svg.setAttribute('focusable', 'false'); // Disable IE11 default behavior to make SVGs focusable.
return svg;
};
/**
* Returns an Observable which produces the string contents of the given URL. Results may be
* cached, so future calls with the same URL may not cause another HTTP request.
* @param {?} safeUrl
* @return {?}
*/
MatIconRegistry.prototype._fetchUrl = /**
* Returns an Observable which produces the string contents of the given URL. Results may be
* cached, so future calls with the same URL may not cause another HTTP request.
* @param {?} safeUrl
* @return {?}
*/
function (safeUrl) {
var _this = this;
if (!this._httpClient) {
throw getMatIconNoHttpProviderError();
}
if (safeUrl == null) {
throw Error("Cannot fetch icon from URL \"" + safeUrl + "\".");
}
var /** @type {?} */ url = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_2__["SecurityContext"].RESOURCE_URL, safeUrl);
if (!url) {
throw getMatIconFailedToSanitizeUrlError(safeUrl);
}
// Store in-progress fetches to avoid sending a duplicate request for a URL when there is
// already a request in progress for that URL. It's necessary to call share() on the
// Observable returned by http.get() so that multiple subscribers don't cause multiple XHRs.
var /** @type {?} */ inProgressFetch = this._inProgressUrlFetches.get(url);
if (inProgressFetch) {
return inProgressFetch;
}
// TODO(jelbourn): for some reason, the `finalize` operator "loses" the generic type on the
// Observable. Figure out why and fix it.
var /** @type {?} */ req = this._httpClient.get(url, { responseType: 'text' }).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["finalize"])(function () { return _this._inProgressUrlFetches.delete(url); }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["share"])());
this._inProgressUrlFetches.set(url, req);
return req;
};
/**
* Registers an icon config by name in the specified namespace.
* @param {?} namespace Namespace in which to register the icon config.
* @param {?} iconName Name under which to register the config.
* @param {?} config Config to be registered.
* @return {?}
*/
MatIconRegistry.prototype._addSvgIconConfig = /**
* Registers an icon config by name in the specified namespace.
* @param {?} namespace Namespace in which to register the icon config.
* @param {?} iconName Name under which to register the config.
* @param {?} config Config to be registered.
* @return {?}
*/
function (namespace, iconName, config) {
this._svgIconConfigs.set(iconKey(namespace, iconName), config);
return this;
};
/**
* Registers an icon set config in the specified namespace.
* @param {?} namespace Namespace in which to register the icon config.
* @param {?} config Config to be registered.
* @return {?}
*/
MatIconRegistry.prototype._addSvgIconSetConfig = /**
* Registers an icon set config in the specified namespace.
* @param {?} namespace Namespace in which to register the icon config.
* @param {?} config Config to be registered.
* @return {?}
*/
function (namespace, config) {
var /** @type {?} */ configNamespace = this._iconSetConfigs.get(namespace);
if (configNamespace) {
configNamespace.push(config);
}
else {
this._iconSetConfigs.set(namespace, [config]);
}
return this;
};
MatIconRegistry.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */
MatIconRegistry.ctorParameters = function () { return [
{ type: _angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] },] },
{ type: _angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__["DomSanitizer"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] },] },
]; };
/** @nocollapse */ MatIconRegistry.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["defineInjectable"])({ factory: function MatIconRegistry_Factory() { return new MatIconRegistry(Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["inject"])(_angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"], 8), Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["inject"])(_angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__["DomSanitizer"]), Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["inject"])(_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], 8)); }, token: MatIconRegistry, providedIn: "root" });
return MatIconRegistry;
}());
/**
* \@docs-private
* @param {?} parentRegistry
* @param {?} httpClient
* @param {?} sanitizer
* @param {?=} document
* @return {?}
*/
function ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry, httpClient, sanitizer, document) {
return parentRegistry || new MatIconRegistry(httpClient, sanitizer, document);
}
/**
* \@docs-private
*/
var /** @type {?} */ ICON_REGISTRY_PROVIDER = {
// If there is already an MatIconRegistry available, use that. Otherwise, provide a new one.
provide: MatIconRegistry,
deps: [
[new _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_2__["SkipSelf"](), MatIconRegistry],
[new _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"](), _angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"]],
_angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__["DomSanitizer"],
[new _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"](), /** @type {?} */ (_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])],
],
useFactory: ICON_REGISTRY_PROVIDER_FACTORY,
};
/**
* Clones an SVGElement while preserving type information.
* @param {?} svg
* @return {?}
*/
function cloneSvg(svg) {
return /** @type {?} */ (svg.cloneNode(true));
}
/**
* Returns the cache key to use for an icon namespace and name.
* @param {?} namespace
* @param {?} name
* @return {?}
*/
function iconKey(namespace, name) {
return namespace + ':' + name;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatIconBase = /** @class */ (function () {
function MatIconBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatIconBase;
}());
var /** @type {?} */ _MatIconMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_7__["mixinColor"])(MatIconBase);
/**
* Component to display an icon. It can be used in the following ways:
*
* - Specify the svgIcon input to load an SVG icon from a URL previously registered with the
* addSvgIcon, addSvgIconInNamespace, addSvgIconSet, or addSvgIconSetInNamespace methods of
* MatIconRegistry. If the svgIcon value contains a colon it is assumed to be in the format
* "[namespace]:[name]", if not the value will be the name of an icon in the default namespace.
* Examples:
* `<mat-icon svgIcon="left-arrow"></mat-icon>
* <mat-icon svgIcon="animals:cat"></mat-icon>`
*
* - Use a font ligature as an icon by putting the ligature text in the content of the `<mat-icon>`
* component. By default the Material icons font is used as described at
* http://google.github.io/material-design-icons/#icon-font-for-the-web. You can specify an
* alternate font by setting the fontSet input to either the CSS class to apply to use the
* desired font, or to an alias previously registered with MatIconRegistry.registerFontClassAlias.
* Examples:
* `<mat-icon>home</mat-icon>
* <mat-icon fontSet="myfont">sun</mat-icon>`
*
* - Specify a font glyph to be included via CSS rules by setting the fontSet input to specify the
* font, and the fontIcon input to specify the icon. Typically the fontIcon will specify a
* CSS class which causes the glyph to be displayed via a :before selector, as in
* https://fortawesome.github.io/Font-Awesome/examples/
* Example:
* `<mat-icon fontSet="fa" fontIcon="alarm"></mat-icon>`
*/
var MatIcon = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_6__["__extends"])(MatIcon, _super);
function MatIcon(elementRef, _iconRegistry, ariaHidden) {
var _this = _super.call(this, elementRef) || this;
_this._iconRegistry = _iconRegistry;
_this._inline = false;
// If the user has not explicitly set aria-hidden, mark the icon as hidden, as this is
// the right thing to do for the majority of icon use-cases.
if (!ariaHidden) {
elementRef.nativeElement.setAttribute('aria-hidden', 'true');
}
return _this;
}
Object.defineProperty(MatIcon.prototype, "inline", {
get: /**
* Whether the icon should be inlined, automatically sizing the icon to match the font size of
* the element the icon is contained in.
* @return {?}
*/
function () {
return this._inline;
},
set: /**
* @param {?} inline
* @return {?}
*/
function (inline) {
this._inline = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_8__["coerceBooleanProperty"])(inline);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatIcon.prototype, "fontSet", {
get: /**
* Font set that the icon is a part of.
* @return {?}
*/
function () { return this._fontSet; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._fontSet = this._cleanupFontValue(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatIcon.prototype, "fontIcon", {
get: /**
* Name of an icon within a font set.
* @return {?}
*/
function () { return this._fontIcon; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._fontIcon = this._cleanupFontValue(value);
},
enumerable: true,
configurable: true
});
/**
* Splits an svgIcon binding value into its icon set and icon name components.
* Returns a 2-element array of [(icon set), (icon name)].
* The separator for the two fields is ':'. If there is no separator, an empty
* string is returned for the icon set and the entire value is returned for
* the icon name. If the argument is falsy, returns an array of two empty strings.
* Throws an error if the name contains two or more ':' separators.
* Examples:
* `'social:cake' -> ['social', 'cake']
* 'penguin' -> ['', 'penguin']
* null -> ['', '']
* 'a:b:c' -> (throws Error)`
* @param {?} iconName
* @return {?}
*/
MatIcon.prototype._splitIconName = /**
* Splits an svgIcon binding value into its icon set and icon name components.
* Returns a 2-element array of [(icon set), (icon name)].
* The separator for the two fields is ':'. If there is no separator, an empty
* string is returned for the icon set and the entire value is returned for
* the icon name. If the argument is falsy, returns an array of two empty strings.
* Throws an error if the name contains two or more ':' separators.
* Examples:
* `'social:cake' -> ['social', 'cake']
* 'penguin' -> ['', 'penguin']
* null -> ['', '']
* 'a:b:c' -> (throws Error)`
* @param {?} iconName
* @return {?}
*/
function (iconName) {
if (!iconName) {
return ['', ''];
}
var /** @type {?} */ parts = iconName.split(':');
switch (parts.length) {
case 1: return ['', parts[0]]; // Use default namespace.
case 2: return /** @type {?} */ (parts);
default: throw Error("Invalid icon name: \"" + iconName + "\"");
}
};
/**
* @param {?} changes
* @return {?}
*/
MatIcon.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
var _this = this;
// Only update the inline SVG icon if the inputs changed, to avoid unnecessary DOM operations.
if (changes["svgIcon"]) {
if (this.svgIcon) {
var _a = this._splitIconName(this.svgIcon), namespace = _a[0], iconName = _a[1];
this._iconRegistry.getNamedSvgIcon(iconName, namespace).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["take"])(1)).subscribe(function (svg) { return _this._setSvgElement(svg); }, function (err) { return console.log("Error retrieving icon: " + err.message); });
}
else {
this._clearSvgElement();
}
}
if (this._usingFontIcon()) {
this._updateFontIconClasses();
}
};
/**
* @return {?}
*/
MatIcon.prototype.ngOnInit = /**
* @return {?}
*/
function () {
// Update font classes because ngOnChanges won't be called if none of the inputs are present,
// e.g. <mat-icon>arrow</mat-icon> In this case we need to add a CSS class for the default font.
if (this._usingFontIcon()) {
this._updateFontIconClasses();
}
};
/**
* @return {?}
*/
MatIcon.prototype._usingFontIcon = /**
* @return {?}
*/
function () {
return !this.svgIcon;
};
/**
* @param {?} svg
* @return {?}
*/
MatIcon.prototype._setSvgElement = /**
* @param {?} svg
* @return {?}
*/
function (svg) {
this._clearSvgElement();
this._elementRef.nativeElement.appendChild(svg);
};
/**
* @return {?}
*/
MatIcon.prototype._clearSvgElement = /**
* @return {?}
*/
function () {
var /** @type {?} */ layoutElement = this._elementRef.nativeElement;
var /** @type {?} */ childCount = layoutElement.childNodes.length;
// Remove existing child nodes and add the new SVG element. Note that we can't
// use innerHTML, because IE will throw if the element has a data binding.
for (var /** @type {?} */ i = 0; i < childCount; i++) {
layoutElement.removeChild(layoutElement.childNodes[i]);
}
};
/**
* @return {?}
*/
MatIcon.prototype._updateFontIconClasses = /**
* @return {?}
*/
function () {
if (!this._usingFontIcon()) {
return;
}
var /** @type {?} */ elem = this._elementRef.nativeElement;
var /** @type {?} */ fontSetClass = this.fontSet ?
this._iconRegistry.classNameForFontAlias(this.fontSet) :
this._iconRegistry.getDefaultFontSetClass();
if (fontSetClass != this._previousFontSetClass) {
if (this._previousFontSetClass) {
elem.classList.remove(this._previousFontSetClass);
}
if (fontSetClass) {
elem.classList.add(fontSetClass);
}
this._previousFontSetClass = fontSetClass;
}
if (this.fontIcon != this._previousFontIconClass) {
if (this._previousFontIconClass) {
elem.classList.remove(this._previousFontIconClass);
}
if (this.fontIcon) {
elem.classList.add(this.fontIcon);
}
this._previousFontIconClass = this.fontIcon;
}
};
/**
* Cleans up a value to be used as a fontIcon or fontSet.
* Since the value ends up being assigned as a CSS class, we
* have to trim the value and omit space-separated values.
* @param {?} value
* @return {?}
*/
MatIcon.prototype._cleanupFontValue = /**
* Cleans up a value to be used as a fontIcon or fontSet.
* Since the value ends up being assigned as a CSS class, we
* have to trim the value and omit space-separated values.
* @param {?} value
* @return {?}
*/
function (value) {
return typeof value === 'string' ? value.trim().split(' ')[0] : value;
};
MatIcon.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Component"], args: [{template: '<ng-content></ng-content>',
selector: 'mat-icon',
exportAs: 'matIcon',
styles: [".mat-icon{background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1,1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}"],
inputs: ['color'],
host: {
'role': 'img',
'class': 'mat-icon',
'[class.mat-icon-inline]': 'inline',
},
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatIcon.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ElementRef"], },
{ type: MatIconRegistry, },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Attribute"], args: ['aria-hidden',] },] },
]; };
MatIcon.propDecorators = {
"inline": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
"svgIcon": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
"fontSet": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
"fontIcon": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
};
return MatIcon;
}(_MatIconMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatIconModule = /** @class */ (function () {
function MatIconModule() {
}
MatIconModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgModule"], args: [{
imports: [_angular_material_core__WEBPACK_IMPORTED_MODULE_7__["MatCommonModule"]],
exports: [MatIcon, _angular_material_core__WEBPACK_IMPORTED_MODULE_7__["MatCommonModule"]],
declarations: [MatIcon],
},] },
];
return MatIconModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=icon.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/input.es5.js":
/*!**********************************************************!*\
!*** ./node_modules/@angular/material/esm5/input.es5.js ***!
\**********************************************************/
/*! exports provided: MatTextareaAutosize, MatInputBase, _MatInputMixinBase, MatInput, getMatInputUnsupportedTypeError, MatInputModule, MAT_INPUT_VALUE_ACCESSOR */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTextareaAutosize", function() { return MatTextareaAutosize; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatInputBase", function() { return MatInputBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatInputMixinBase", function() { return _MatInputMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatInput", function() { return MatInput; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatInputUnsupportedTypeError", function() { return getMatInputUnsupportedTypeError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatInputModule", function() { return MatInputModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_INPUT_VALUE_ACCESSOR", function() { return MAT_INPUT_VALUE_ACCESSOR; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_text_field__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/text-field */ "./node_modules/@angular/cdk/esm5/text-field.es5.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/form-field */ "./node_modules/@angular/material/esm5/form-field.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Directive to automatically resize a textarea to fit its content.
* \@deletion-target 7.0.0 deprecate in favor of `cdkTextareaAutosize`.
*/
var MatTextareaAutosize = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatTextareaAutosize, _super);
function MatTextareaAutosize() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(MatTextareaAutosize.prototype, "matAutosizeMinRows", {
get: /**
* @return {?}
*/
function () { return this.minRows; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this.minRows = value; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatTextareaAutosize.prototype, "matAutosizeMaxRows", {
get: /**
* @return {?}
*/
function () { return this.maxRows; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this.maxRows = value; },
enumerable: true,
configurable: true
});
MatTextareaAutosize.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Directive"], args: [{
selector: 'textarea[mat-autosize], textarea[matTextareaAutosize]',
exportAs: 'matTextareaAutosize',
inputs: ['cdkAutosizeMinRows', 'cdkAutosizeMaxRows'],
host: {
'class': 'cdk-textarea-autosize mat-autosize',
// Textarea elements that have the directive applied should have a single row by default.
// Browsers normally show two rows by default and therefore this limits the minRows binding.
'rows': '1',
'(input)': '_noopInputHandler()',
},
},] },
];
/** @nocollapse */
MatTextareaAutosize.propDecorators = {
"matAutosizeMinRows": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
"matAutosizeMaxRows": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
};
return MatTextareaAutosize;
}(_angular_cdk_text_field__WEBPACK_IMPORTED_MODULE_1__["CdkTextareaAutosize"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
* @param {?} type
* @return {?}
*/
function getMatInputUnsupportedTypeError(type) {
return Error("Input type \"" + type + "\" isn't supported by matInput.");
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* This token is used to inject the object whose value should be set into `MatInput`. If none is
* provided, the native `HTMLInputElement` is used. Directives like `MatDatepickerInput` can provide
* themselves for this token, in order to make `MatInput` delegate the getting and setting of the
* value to them.
*/
var /** @type {?} */ MAT_INPUT_VALUE_ACCESSOR = new _angular_core__WEBPACK_IMPORTED_MODULE_2__["InjectionToken"]('MAT_INPUT_VALUE_ACCESSOR');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
// Invalid input type. Using one of these will throw an MatInputUnsupportedTypeError.
var /** @type {?} */ MAT_INPUT_INVALID_TYPES = [
'button',
'checkbox',
'file',
'hidden',
'image',
'radio',
'range',
'reset',
'submit'
];
var /** @type {?} */ nextUniqueId = 0;
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatInputBase = /** @class */ (function () {
function MatInputBase(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl) {
this._defaultErrorStateMatcher = _defaultErrorStateMatcher;
this._parentForm = _parentForm;
this._parentFormGroup = _parentFormGroup;
this.ngControl = ngControl;
}
return MatInputBase;
}());
var /** @type {?} */ _MatInputMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["mixinErrorState"])(MatInputBase);
/**
* Directive that allows a native input to work inside a `MatFormField`.
*/
var MatInput = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatInput, _super);
function MatInput(_elementRef, _platform, /** @docs-private */
ngControl, _parentForm, _parentFormGroup, _defaultErrorStateMatcher, inputValueAccessor, _autofillMonitor, ngZone) {
var _this = _super.call(this, _defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl) || this;
_this._elementRef = _elementRef;
_this._platform = _platform;
_this.ngControl = ngControl;
_this._autofillMonitor = _autofillMonitor;
_this._uid = "mat-input-" + nextUniqueId++;
/**
* Whether the component is being rendered on the server.
*/
_this._isServer = false;
/**
* Implemented as part of MatFormFieldControl.
* \@docs-private
*/
_this.focused = false;
/**
* Implemented as part of MatFormFieldControl.
* \@docs-private
*/
_this.stateChanges = new rxjs__WEBPACK_IMPORTED_MODULE_8__["Subject"]();
/**
* Implemented as part of MatFormFieldControl.
* \@docs-private
*/
_this.controlType = 'mat-input';
/**
* Implemented as part of MatFormFieldControl.
* \@docs-private
*/
_this.autofilled = false;
_this._disabled = false;
_this._required = false;
_this._type = 'text';
_this._readonly = false;
_this._neverEmptyInputTypes = [
'date',
'datetime',
'datetime-local',
'month',
'time',
'week'
].filter(function (t) { return Object(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_4__["getSupportedInputTypes"])().has(t); });
// If no input value accessor was explicitly specified, use the element as the input value
// accessor.
// If no input value accessor was explicitly specified, use the element as the input value
// accessor.
_this._inputValueAccessor = inputValueAccessor || _this._elementRef.nativeElement;
_this._previousNativeValue = _this.value;
// Force setter to be called in case id was not specified.
// Force setter to be called in case id was not specified.
_this.id = _this.id;
// On some versions of iOS the caret gets stuck in the wrong place when holding down the delete
// key. In order to get around this we need to "jiggle" the caret loose. Since this bug only
// exists on iOS, we only bother to install the listener on iOS.
if (_platform.IOS) {
ngZone.runOutsideAngular(function () {
_elementRef.nativeElement.addEventListener('keyup', function (event) {
var /** @type {?} */ el = /** @type {?} */ (event.target);
if (!el.value && !el.selectionStart && !el.selectionEnd) {
// Note: Just setting `0, 0` doesn't fix the issue. Setting
// `1, 1` fixes it for the first time that you type text and
// then hold delete. Toggling to `1, 1` and then back to
// `0, 0` seems to completely fix it.
el.setSelectionRange(1, 1);
el.setSelectionRange(0, 0);
}
});
});
}
_this._isServer = !_this._platform.isBrowser;
return _this;
}
Object.defineProperty(MatInput.prototype, "disabled", {
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () {
if (this.ngControl && this.ngControl.disabled !== null) {
return this.ngControl.disabled;
}
return this._disabled;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._disabled = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value);
// Browsers may not fire the blur event if the input is disabled too quickly.
// Reset from here to ensure that the element doesn't become stuck.
if (this.focused) {
this.focused = false;
this.stateChanges.next();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatInput.prototype, "id", {
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () { return this._id; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._id = value || this._uid; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatInput.prototype, "required", {
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () { return this._required; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._required = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatInput.prototype, "type", {
get: /**
* Input type of the element.
* @return {?}
*/
function () { return this._type; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._type = value || 'text';
this._validateType();
// When using Angular inputs, developers are no longer able to set the properties on the native
// input element. To ensure that bindings for `type` work, we need to sync the setter
// with the native property. Textarea elements don't support the type property or attribute.
if (!this._isTextarea() && Object(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_4__["getSupportedInputTypes"])().has(this._type)) {
this._elementRef.nativeElement.type = this._type;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatInput.prototype, "value", {
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () { return this._inputValueAccessor.value; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (value !== this.value) {
this._inputValueAccessor.value = value;
this.stateChanges.next();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatInput.prototype, "readonly", {
get: /**
* Whether the element is readonly.
* @return {?}
*/
function () { return this._readonly; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._readonly = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatInput.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(function (event) {
_this.autofilled = event.isAutofilled;
_this.stateChanges.next();
});
};
/**
* @return {?}
*/
MatInput.prototype.ngOnChanges = /**
* @return {?}
*/
function () {
this.stateChanges.next();
};
/**
* @return {?}
*/
MatInput.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.stateChanges.complete();
this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement);
};
/**
* @return {?}
*/
MatInput.prototype.ngDoCheck = /**
* @return {?}
*/
function () {
if (this.ngControl) {
// We need to re-evaluate this on every change detection cycle, because there are some
// error triggers that we can't subscribe to (e.g. parent form submissions). This means
// that whatever logic is in here has to be super lean or we risk destroying the performance.
this.updateErrorState();
}
// We need to dirty-check the native element's value, because there are some cases where
// we won't be notified when it changes (e.g. the consumer isn't using forms or they're
// updating the value using `emitEvent: false`).
this._dirtyCheckNativeValue();
};
/** Focuses the input. */
/**
* Focuses the input.
* @return {?}
*/
MatInput.prototype.focus = /**
* Focuses the input.
* @return {?}
*/
function () { this._elementRef.nativeElement.focus(); };
/** Callback for the cases where the focused state of the input changes. */
/**
* Callback for the cases where the focused state of the input changes.
* @param {?} isFocused
* @return {?}
*/
MatInput.prototype._focusChanged = /**
* Callback for the cases where the focused state of the input changes.
* @param {?} isFocused
* @return {?}
*/
function (isFocused) {
if (isFocused !== this.focused && !this.readonly) {
this.focused = isFocused;
this.stateChanges.next();
}
};
/**
* @return {?}
*/
MatInput.prototype._onInput = /**
* @return {?}
*/
function () {
// This is a noop function and is used to let Angular know whenever the value changes.
// Angular will run a new change detection each time the `input` event has been dispatched.
// It's necessary that Angular recognizes the value change, because when floatingLabel
// is set to false and Angular forms aren't used, the placeholder won't recognize the
// value changes and will not disappear.
// Listening to the input event wouldn't be necessary when the input is using the
// FormsModule or ReactiveFormsModule, because Angular forms also listens to input events.
};
/** Does some manual dirty checking on the native input `value` property. */
/**
* Does some manual dirty checking on the native input `value` property.
* @return {?}
*/
MatInput.prototype._dirtyCheckNativeValue = /**
* Does some manual dirty checking on the native input `value` property.
* @return {?}
*/
function () {
var /** @type {?} */ newValue = this.value;
if (this._previousNativeValue !== newValue) {
this._previousNativeValue = newValue;
this.stateChanges.next();
}
};
/** Make sure the input is a supported type. */
/**
* Make sure the input is a supported type.
* @return {?}
*/
MatInput.prototype._validateType = /**
* Make sure the input is a supported type.
* @return {?}
*/
function () {
if (MAT_INPUT_INVALID_TYPES.indexOf(this._type) > -1) {
throw getMatInputUnsupportedTypeError(this._type);
}
};
/** Checks whether the input type is one of the types that are never empty. */
/**
* Checks whether the input type is one of the types that are never empty.
* @return {?}
*/
MatInput.prototype._isNeverEmpty = /**
* Checks whether the input type is one of the types that are never empty.
* @return {?}
*/
function () {
return this._neverEmptyInputTypes.indexOf(this._type) > -1;
};
/** Checks whether the input is invalid based on the native validation. */
/**
* Checks whether the input is invalid based on the native validation.
* @return {?}
*/
MatInput.prototype._isBadInput = /**
* Checks whether the input is invalid based on the native validation.
* @return {?}
*/
function () {
// The `validity` property won't be present on platform-server.
var /** @type {?} */ validity = (/** @type {?} */ (this._elementRef.nativeElement)).validity;
return validity && validity.badInput;
};
/** Determines if the component host is a textarea. */
/**
* Determines if the component host is a textarea.
* @return {?}
*/
MatInput.prototype._isTextarea = /**
* Determines if the component host is a textarea.
* @return {?}
*/
function () {
return this._elementRef.nativeElement.nodeName.toLowerCase() === 'textarea';
};
Object.defineProperty(MatInput.prototype, "empty", {
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () {
return !this._isNeverEmpty() && !this._elementRef.nativeElement.value && !this._isBadInput() &&
!this.autofilled;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatInput.prototype, "shouldLabelFloat", {
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () { return this.focused || !this.empty; },
enumerable: true,
configurable: true
});
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
/**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @param {?} ids
* @return {?}
*/
MatInput.prototype.setDescribedByIds = /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @param {?} ids
* @return {?}
*/
function (ids) { this._ariaDescribedby = ids.join(' '); };
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
/**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
MatInput.prototype.onContainerClick = /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () { this.focus(); };
MatInput.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Directive"], args: [{
selector: "input[matInput], textarea[matInput]",
exportAs: 'matInput',
host: {
/**
* @deletion-target 7.0.0 remove .mat-form-field-autofill-control in favor of AutofillMonitor.
*/
'class': 'mat-input-element mat-form-field-autofill-control',
'[class.mat-input-server]': '_isServer',
// Native input properties that are overwritten by Angular inputs need to be synced with
// the native input element. Otherwise property bindings for those don't work.
'[attr.id]': 'id',
'[attr.placeholder]': 'placeholder',
'[disabled]': 'disabled',
'[required]': 'required',
'[readonly]': 'readonly',
'[attr.aria-describedby]': '_ariaDescribedby || null',
'[attr.aria-invalid]': 'errorState',
'[attr.aria-required]': 'required.toString()',
'(blur)': '_focusChanged(false)',
'(focus)': '_focusChanged(true)',
'(input)': '_onInput()',
},
providers: [{ provide: _angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__["MatFormFieldControl"], useExisting: MatInput }],
},] },
];
/** @nocollapse */
MatInput.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ElementRef"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_4__["Platform"], },
{ type: _angular_forms__WEBPACK_IMPORTED_MODULE_5__["NgControl"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Self"] },] },
{ type: _angular_forms__WEBPACK_IMPORTED_MODULE_5__["NgForm"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] },] },
{ type: _angular_forms__WEBPACK_IMPORTED_MODULE_5__["FormGroupDirective"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] },] },
{ type: _angular_material_core__WEBPACK_IMPORTED_MODULE_6__["ErrorStateMatcher"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [MAT_INPUT_VALUE_ACCESSOR,] },] },
{ type: _angular_cdk_text_field__WEBPACK_IMPORTED_MODULE_1__["AutofillMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgZone"], },
]; };
MatInput.propDecorators = {
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
"id": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
"placeholder": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
"required": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
"type": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
"errorStateMatcher": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
"readonly": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Input"] },],
};
return MatInput;
}(_MatInputMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatInputModule = /** @class */ (function () {
function MatInputModule() {
}
MatInputModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgModule"], args: [{
declarations: [MatInput, MatTextareaAutosize],
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_9__["CommonModule"],
_angular_cdk_text_field__WEBPACK_IMPORTED_MODULE_1__["TextFieldModule"],
_angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__["MatFormFieldModule"],
],
exports: [
_angular_cdk_text_field__WEBPACK_IMPORTED_MODULE_1__["TextFieldModule"],
_angular_material_form_field__WEBPACK_IMPORTED_MODULE_7__["MatFormFieldModule"],
MatInput,
MatTextareaAutosize,
],
providers: [_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["ErrorStateMatcher"]],
},] },
];
return MatInputModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=input.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/list.es5.js":
/*!*********************************************************!*\
!*** ./node_modules/@angular/material/esm5/list.es5.js ***!
\*********************************************************/
/*! exports provided: MatListModule, MatListBase, _MatListMixinBase, MatListItemBase, _MatListItemMixinBase, MatNavList, MatList, MatListAvatarCssMatStyler, MatListIconCssMatStyler, MatListSubheaderCssMatStyler, MatListItem, MatSelectionListBase, _MatSelectionListMixinBase, MatListOptionBase, _MatListOptionMixinBase, MAT_SELECTION_LIST_VALUE_ACCESSOR, MatSelectionListChange, MatListOption, MatSelectionList */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatListModule", function() { return MatListModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatListBase", function() { return MatListBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatListMixinBase", function() { return _MatListMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatListItemBase", function() { return MatListItemBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatListItemMixinBase", function() { return _MatListItemMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatNavList", function() { return MatNavList; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatList", function() { return MatList; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatListAvatarCssMatStyler", function() { return MatListAvatarCssMatStyler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatListIconCssMatStyler", function() { return MatListIconCssMatStyler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatListSubheaderCssMatStyler", function() { return MatListSubheaderCssMatStyler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatListItem", function() { return MatListItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSelectionListBase", function() { return MatSelectionListBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatSelectionListMixinBase", function() { return _MatSelectionListMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatListOptionBase", function() { return MatListOptionBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatListOptionMixinBase", function() { return _MatListOptionMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SELECTION_LIST_VALUE_ACCESSOR", function() { return MAT_SELECTION_LIST_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSelectionListChange", function() { return MatSelectionListChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatListOption", function() { return MatListOption; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSelectionList", function() { return MatSelectionList; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm5/collections.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_material_divider__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/material/divider */ "./node_modules/@angular/material/esm5/divider.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatListBase = /** @class */ (function () {
function MatListBase() {
}
return MatListBase;
}());
var /** @type {?} */ _MatListMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["mixinDisableRipple"])(MatListBase);
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatListItemBase = /** @class */ (function () {
function MatListItemBase() {
}
return MatListItemBase;
}());
var /** @type {?} */ _MatListItemMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["mixinDisableRipple"])(MatListItemBase);
var MatNavList = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatNavList, _super);
function MatNavList() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatNavList.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-nav-list',
exportAs: 'matNavList',
host: {
'role': 'navigation',
'class': 'mat-nav-list'
},
template: "<ng-content></ng-content>",
styles: [".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}.mat-subheader{display:flex;box-sizing:border-box;padding:16px;align-items:center}.mat-list .mat-subheader,.mat-nav-list .mat-subheader,.mat-selection-list .mat-subheader{margin:0}.mat-list,.mat-nav-list,.mat-selection-list{padding-top:8px;display:block}.mat-list .mat-subheader,.mat-nav-list .mat-subheader,.mat-selection-list .mat-subheader{height:48px;line-height:16px}.mat-list .mat-subheader:first-child,.mat-nav-list .mat-subheader:first-child,.mat-selection-list .mat-subheader:first-child{margin-top:-8px}.mat-list .mat-list-item,.mat-list .mat-list-option,.mat-nav-list .mat-list-item,.mat-nav-list .mat-list-option,.mat-selection-list .mat-list-item,.mat-selection-list .mat-list-option{display:block;height:48px}.mat-list .mat-list-item .mat-list-item-content,.mat-list .mat-list-option .mat-list-item-content,.mat-nav-list .mat-list-item .mat-list-item-content,.mat-nav-list .mat-list-option .mat-list-item-content,.mat-selection-list .mat-list-item .mat-list-item-content,.mat-selection-list .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list .mat-list-item .mat-list-item-content-reverse,.mat-list .mat-list-option .mat-list-item-content-reverse,.mat-nav-list .mat-list-item .mat-list-item-content-reverse,.mat-nav-list .mat-list-option .mat-list-item-content-reverse,.mat-selection-list .mat-list-item .mat-list-item-content-reverse,.mat-selection-list .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list .mat-list-item .mat-list-item-ripple,.mat-list .mat-list-option .mat-list-item-ripple,.mat-nav-list .mat-list-item .mat-list-item-ripple,.mat-nav-list .mat-list-option .mat-list-item-ripple,.mat-selection-list .mat-list-item .mat-list-item-ripple,.mat-selection-list .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list .mat-list-item.mat-list-item-with-avatar,.mat-list .mat-list-option.mat-list-item-with-avatar,.mat-nav-list .mat-list-item.mat-list-item-with-avatar,.mat-nav-list .mat-list-option.mat-list-item-with-avatar,.mat-selection-list .mat-list-item.mat-list-item-with-avatar,.mat-selection-list .mat-list-option.mat-list-item-with-avatar{height:56px}.mat-list .mat-list-item.mat-2-line,.mat-list .mat-list-option.mat-2-line,.mat-nav-list .mat-list-item.mat-2-line,.mat-nav-list .mat-list-option.mat-2-line,.mat-selection-list .mat-list-item.mat-2-line,.mat-selection-list .mat-list-option.mat-2-line{height:72px}.mat-list .mat-list-item.mat-3-line,.mat-list .mat-list-option.mat-3-line,.mat-nav-list .mat-list-item.mat-3-line,.mat-nav-list .mat-list-option.mat-3-line,.mat-selection-list .mat-list-item.mat-3-line,.mat-selection-list .mat-list-option.mat-3-line{height:88px}.mat-list .mat-list-item.mat-multi-line,.mat-list .mat-list-option.mat-multi-line,.mat-nav-list .mat-list-item.mat-multi-line,.mat-nav-list .mat-list-option.mat-multi-line,.mat-selection-list .mat-list-item.mat-multi-line,.mat-selection-list .mat-list-option.mat-multi-line{height:auto}.mat-list .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list .mat-list-option.mat-multi-line .mat-list-item-content,.mat-nav-list .mat-list-item.mat-multi-line .mat-list-item-content,.mat-nav-list .mat-list-option.mat-multi-line .mat-list-item-content,.mat-selection-list .mat-list-item.mat-multi-line .mat-list-item-content,.mat-selection-list .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list .mat-list-item .mat-list-text,.mat-list .mat-list-option .mat-list-text,.mat-nav-list .mat-list-item .mat-list-text,.mat-nav-list .mat-list-option .mat-list-text,.mat-selection-list .mat-list-item .mat-list-text,.mat-selection-list .mat-list-option .mat-list-text{display:flex;flex-direction:column;width:100%;box-sizing:border-box;overflow:hidden;padding:0}.mat-list .mat-list-item .mat-list-text>*,.mat-list .mat-list-option .mat-list-text>*,.mat-nav-list .mat-list-item .mat-list-text>*,.mat-nav-list .mat-list-option .mat-list-text>*,.mat-selection-list .mat-list-item .mat-list-text>*,.mat-selection-list .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:400;font-size:inherit}.mat-list .mat-list-item .mat-list-text:empty,.mat-list .mat-list-option .mat-list-text:empty,.mat-nav-list .mat-list-item .mat-list-text:empty,.mat-nav-list .mat-list-option .mat-list-text:empty,.mat-selection-list .mat-list-item .mat-list-text:empty,.mat-selection-list .mat-list-option .mat-list-text:empty{display:none}.mat-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-nav-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-nav-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-selection-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-selection-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)){padding-right:0;padding-left:16px}[dir=rtl] .mat-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)){padding-right:16px;padding-left:0}.mat-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-nav-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-nav-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-selection-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-selection-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)){padding-left:0;padding-right:16px}[dir=rtl] .mat-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)){padding-right:0;padding-left:16px}.mat-list .mat-list-item .mat-list-avatar,.mat-list .mat-list-option .mat-list-avatar,.mat-nav-list .mat-list-item .mat-list-avatar,.mat-nav-list .mat-list-option .mat-list-avatar,.mat-selection-list .mat-list-item .mat-list-avatar,.mat-selection-list .mat-list-option .mat-list-avatar{flex-shrink:0;width:40px;height:40px;border-radius:50%}.mat-list .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list .mat-list-option .mat-list-avatar~.mat-divider-inset,.mat-nav-list .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-nav-list .mat-list-option .mat-list-avatar~.mat-divider-inset,.mat-selection-list .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-selection-list .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:72px;width:calc(100% - 72px)}[dir=rtl] .mat-list .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list .mat-list-option .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-nav-list .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-nav-list .mat-list-option .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-selection-list .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-selection-list .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:72px}.mat-list .mat-list-item .mat-list-icon,.mat-list .mat-list-option .mat-list-icon,.mat-nav-list .mat-list-item .mat-list-icon,.mat-nav-list .mat-list-option .mat-list-icon,.mat-selection-list .mat-list-item .mat-list-icon,.mat-selection-list .mat-list-option .mat-list-icon{flex-shrink:0;width:24px;height:24px;font-size:24px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list .mat-list-option .mat-list-icon~.mat-divider-inset,.mat-nav-list .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-nav-list .mat-list-option .mat-list-icon~.mat-divider-inset,.mat-selection-list .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-selection-list .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:64px;width:calc(100% - 64px)}[dir=rtl] .mat-list .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list .mat-list-option .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-nav-list .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-nav-list .mat-list-option .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-selection-list .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-selection-list .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:64px}.mat-list .mat-list-item .mat-divider,.mat-list .mat-list-option .mat-divider,.mat-nav-list .mat-list-item .mat-divider,.mat-nav-list .mat-list-option .mat-divider,.mat-selection-list .mat-list-item .mat-divider,.mat-selection-list .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list .mat-list-item .mat-divider,[dir=rtl] .mat-list .mat-list-option .mat-divider,[dir=rtl] .mat-nav-list .mat-list-item .mat-divider,[dir=rtl] .mat-nav-list .mat-list-option .mat-divider,[dir=rtl] .mat-selection-list .mat-list-item .mat-divider,[dir=rtl] .mat-selection-list .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list .mat-list-item .mat-divider.mat-divider-inset,.mat-list .mat-list-option .mat-divider.mat-divider-inset,.mat-nav-list .mat-list-item .mat-divider.mat-divider-inset,.mat-nav-list .mat-list-option .mat-divider.mat-divider-inset,.mat-selection-list .mat-list-item .mat-divider.mat-divider-inset,.mat-selection-list .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-list[dense],.mat-nav-list[dense],.mat-selection-list[dense]{padding-top:4px;display:block}.mat-list[dense] .mat-subheader,.mat-nav-list[dense] .mat-subheader,.mat-selection-list[dense] .mat-subheader{height:40px;line-height:8px}.mat-list[dense] .mat-subheader:first-child,.mat-nav-list[dense] .mat-subheader:first-child,.mat-selection-list[dense] .mat-subheader:first-child{margin-top:-4px}.mat-list[dense] .mat-list-item,.mat-list[dense] .mat-list-option,.mat-nav-list[dense] .mat-list-item,.mat-nav-list[dense] .mat-list-option,.mat-selection-list[dense] .mat-list-item,.mat-selection-list[dense] .mat-list-option{display:block;height:40px}.mat-list[dense] .mat-list-item .mat-list-item-content,.mat-list[dense] .mat-list-option .mat-list-item-content,.mat-nav-list[dense] .mat-list-item .mat-list-item-content,.mat-nav-list[dense] .mat-list-option .mat-list-item-content,.mat-selection-list[dense] .mat-list-item .mat-list-item-content,.mat-selection-list[dense] .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list[dense] .mat-list-item .mat-list-item-content-reverse,.mat-list[dense] .mat-list-option .mat-list-item-content-reverse,.mat-nav-list[dense] .mat-list-item .mat-list-item-content-reverse,.mat-nav-list[dense] .mat-list-option .mat-list-item-content-reverse,.mat-selection-list[dense] .mat-list-item .mat-list-item-content-reverse,.mat-selection-list[dense] .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list[dense] .mat-list-item .mat-list-item-ripple,.mat-list[dense] .mat-list-option .mat-list-item-ripple,.mat-nav-list[dense] .mat-list-item .mat-list-item-ripple,.mat-nav-list[dense] .mat-list-option .mat-list-item-ripple,.mat-selection-list[dense] .mat-list-item .mat-list-item-ripple,.mat-selection-list[dense] .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list[dense] .mat-list-item.mat-list-item-with-avatar,.mat-list[dense] .mat-list-option.mat-list-item-with-avatar,.mat-nav-list[dense] .mat-list-item.mat-list-item-with-avatar,.mat-nav-list[dense] .mat-list-option.mat-list-item-with-avatar,.mat-selection-list[dense] .mat-list-item.mat-list-item-with-avatar,.mat-selection-list[dense] .mat-list-option.mat-list-item-with-avatar{height:48px}.mat-list[dense] .mat-list-item.mat-2-line,.mat-list[dense] .mat-list-option.mat-2-line,.mat-nav-list[dense] .mat-list-item.mat-2-line,.mat-nav-list[dense] .mat-list-option.mat-2-line,.mat-selection-list[dense] .mat-list-item.mat-2-line,.mat-selection-list[dense] .mat-list-option.mat-2-line{height:60px}.mat-list[dense] .mat-list-item.mat-3-line,.mat-list[dense] .mat-list-option.mat-3-line,.mat-nav-list[dense] .mat-list-item.mat-3-line,.mat-nav-list[dense] .mat-list-option.mat-3-line,.mat-selection-list[dense] .mat-list-item.mat-3-line,.mat-selection-list[dense] .mat-list-option.mat-3-line{height:76px}.mat-list[dense] .mat-list-item.mat-multi-line,.mat-list[dense] .mat-list-option.mat-multi-line,.mat-nav-list[dense] .mat-list-item.mat-multi-line,.mat-nav-list[dense] .mat-list-option.mat-multi-line,.mat-selection-list[dense] .mat-list-item.mat-multi-line,.mat-selection-list[dense] .mat-list-option.mat-multi-line{height:auto}.mat-list[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list[dense] .mat-list-option.mat-multi-line .mat-list-item-content,.mat-nav-list[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-nav-list[dense] .mat-list-option.mat-multi-line .mat-list-item-content,.mat-selection-list[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-selection-list[dense] .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list[dense] .mat-list-item .mat-list-text,.mat-list[dense] .mat-list-option .mat-list-text,.mat-nav-list[dense] .mat-list-item .mat-list-text,.mat-nav-list[dense] .mat-list-option .mat-list-text,.mat-selection-list[dense] .mat-list-item .mat-list-text,.mat-selection-list[dense] .mat-list-option .mat-list-text{display:flex;flex-direction:column;width:100%;box-sizing:border-box;overflow:hidden;padding:0}.mat-list[dense] .mat-list-item .mat-list-text>*,.mat-list[dense] .mat-list-option .mat-list-text>*,.mat-nav-list[dense] .mat-list-item .mat-list-text>*,.mat-nav-list[dense] .mat-list-option .mat-list-text>*,.mat-selection-list[dense] .mat-list-item .mat-list-text>*,.mat-selection-list[dense] .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:400;font-size:inherit}.mat-list[dense] .mat-list-item .mat-list-text:empty,.mat-list[dense] .mat-list-option .mat-list-text:empty,.mat-nav-list[dense] .mat-list-item .mat-list-text:empty,.mat-nav-list[dense] .mat-list-option .mat-list-text:empty,.mat-selection-list[dense] .mat-list-item .mat-list-text:empty,.mat-selection-list[dense] .mat-list-option .mat-list-text:empty{display:none}.mat-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-nav-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-nav-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-selection-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-selection-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)){padding-right:0;padding-left:16px}[dir=rtl] .mat-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)){padding-right:16px;padding-left:0}.mat-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-nav-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-nav-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-selection-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-selection-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)){padding-left:0;padding-right:16px}[dir=rtl] .mat-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)){padding-right:0;padding-left:16px}.mat-list[dense] .mat-list-item .mat-list-avatar,.mat-list[dense] .mat-list-option .mat-list-avatar,.mat-nav-list[dense] .mat-list-item .mat-list-avatar,.mat-nav-list[dense] .mat-list-option .mat-list-avatar,.mat-selection-list[dense] .mat-list-item .mat-list-avatar,.mat-selection-list[dense] .mat-list-option .mat-list-avatar{flex-shrink:0;width:36px;height:36px;border-radius:50%}.mat-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset,.mat-nav-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-nav-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset,.mat-selection-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-selection-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:68px;width:calc(100% - 68px)}[dir=rtl] .mat-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:68px}.mat-list[dense] .mat-list-item .mat-list-icon,.mat-list[dense] .mat-list-option .mat-list-icon,.mat-nav-list[dense] .mat-list-item .mat-list-icon,.mat-nav-list[dense] .mat-list-option .mat-list-icon,.mat-selection-list[dense] .mat-list-item .mat-list-icon,.mat-selection-list[dense] .mat-list-option .mat-list-icon{flex-shrink:0;width:20px;height:20px;font-size:20px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset,.mat-nav-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-nav-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset,.mat-selection-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-selection-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:60px;width:calc(100% - 60px)}[dir=rtl] .mat-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:60px}.mat-list[dense] .mat-list-item .mat-divider,.mat-list[dense] .mat-list-option .mat-divider,.mat-nav-list[dense] .mat-list-item .mat-divider,.mat-nav-list[dense] .mat-list-option .mat-divider,.mat-selection-list[dense] .mat-list-item .mat-divider,.mat-selection-list[dense] .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-list[dense] .mat-list-option .mat-divider,[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-divider,[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-list[dense] .mat-list-option .mat-divider.mat-divider-inset,.mat-nav-list[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-nav-list[dense] .mat-list-option .mat-divider.mat-divider-inset,.mat-selection-list[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-selection-list[dense] .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-nav-list a{text-decoration:none;color:inherit}.mat-nav-list .mat-list-item{cursor:pointer;outline:0}.mat-list-option:not(.mat-list-item-disabled){cursor:pointer;outline:0}"],
inputs: ['disableRipple'],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
},] },
];
return MatNavList;
}(_MatListMixinBase));
var MatList = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatList, _super);
function MatList() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatList.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-list',
exportAs: 'matList',
template: "<ng-content></ng-content>",
host: { 'class': 'mat-list' },
styles: [".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}.mat-subheader{display:flex;box-sizing:border-box;padding:16px;align-items:center}.mat-list .mat-subheader,.mat-nav-list .mat-subheader,.mat-selection-list .mat-subheader{margin:0}.mat-list,.mat-nav-list,.mat-selection-list{padding-top:8px;display:block}.mat-list .mat-subheader,.mat-nav-list .mat-subheader,.mat-selection-list .mat-subheader{height:48px;line-height:16px}.mat-list .mat-subheader:first-child,.mat-nav-list .mat-subheader:first-child,.mat-selection-list .mat-subheader:first-child{margin-top:-8px}.mat-list .mat-list-item,.mat-list .mat-list-option,.mat-nav-list .mat-list-item,.mat-nav-list .mat-list-option,.mat-selection-list .mat-list-item,.mat-selection-list .mat-list-option{display:block;height:48px}.mat-list .mat-list-item .mat-list-item-content,.mat-list .mat-list-option .mat-list-item-content,.mat-nav-list .mat-list-item .mat-list-item-content,.mat-nav-list .mat-list-option .mat-list-item-content,.mat-selection-list .mat-list-item .mat-list-item-content,.mat-selection-list .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list .mat-list-item .mat-list-item-content-reverse,.mat-list .mat-list-option .mat-list-item-content-reverse,.mat-nav-list .mat-list-item .mat-list-item-content-reverse,.mat-nav-list .mat-list-option .mat-list-item-content-reverse,.mat-selection-list .mat-list-item .mat-list-item-content-reverse,.mat-selection-list .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list .mat-list-item .mat-list-item-ripple,.mat-list .mat-list-option .mat-list-item-ripple,.mat-nav-list .mat-list-item .mat-list-item-ripple,.mat-nav-list .mat-list-option .mat-list-item-ripple,.mat-selection-list .mat-list-item .mat-list-item-ripple,.mat-selection-list .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list .mat-list-item.mat-list-item-with-avatar,.mat-list .mat-list-option.mat-list-item-with-avatar,.mat-nav-list .mat-list-item.mat-list-item-with-avatar,.mat-nav-list .mat-list-option.mat-list-item-with-avatar,.mat-selection-list .mat-list-item.mat-list-item-with-avatar,.mat-selection-list .mat-list-option.mat-list-item-with-avatar{height:56px}.mat-list .mat-list-item.mat-2-line,.mat-list .mat-list-option.mat-2-line,.mat-nav-list .mat-list-item.mat-2-line,.mat-nav-list .mat-list-option.mat-2-line,.mat-selection-list .mat-list-item.mat-2-line,.mat-selection-list .mat-list-option.mat-2-line{height:72px}.mat-list .mat-list-item.mat-3-line,.mat-list .mat-list-option.mat-3-line,.mat-nav-list .mat-list-item.mat-3-line,.mat-nav-list .mat-list-option.mat-3-line,.mat-selection-list .mat-list-item.mat-3-line,.mat-selection-list .mat-list-option.mat-3-line{height:88px}.mat-list .mat-list-item.mat-multi-line,.mat-list .mat-list-option.mat-multi-line,.mat-nav-list .mat-list-item.mat-multi-line,.mat-nav-list .mat-list-option.mat-multi-line,.mat-selection-list .mat-list-item.mat-multi-line,.mat-selection-list .mat-list-option.mat-multi-line{height:auto}.mat-list .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list .mat-list-option.mat-multi-line .mat-list-item-content,.mat-nav-list .mat-list-item.mat-multi-line .mat-list-item-content,.mat-nav-list .mat-list-option.mat-multi-line .mat-list-item-content,.mat-selection-list .mat-list-item.mat-multi-line .mat-list-item-content,.mat-selection-list .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list .mat-list-item .mat-list-text,.mat-list .mat-list-option .mat-list-text,.mat-nav-list .mat-list-item .mat-list-text,.mat-nav-list .mat-list-option .mat-list-text,.mat-selection-list .mat-list-item .mat-list-text,.mat-selection-list .mat-list-option .mat-list-text{display:flex;flex-direction:column;width:100%;box-sizing:border-box;overflow:hidden;padding:0}.mat-list .mat-list-item .mat-list-text>*,.mat-list .mat-list-option .mat-list-text>*,.mat-nav-list .mat-list-item .mat-list-text>*,.mat-nav-list .mat-list-option .mat-list-text>*,.mat-selection-list .mat-list-item .mat-list-text>*,.mat-selection-list .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:400;font-size:inherit}.mat-list .mat-list-item .mat-list-text:empty,.mat-list .mat-list-option .mat-list-text:empty,.mat-nav-list .mat-list-item .mat-list-text:empty,.mat-nav-list .mat-list-option .mat-list-text:empty,.mat-selection-list .mat-list-item .mat-list-text:empty,.mat-selection-list .mat-list-option .mat-list-text:empty{display:none}.mat-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-nav-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-nav-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-selection-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-selection-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)){padding-right:0;padding-left:16px}[dir=rtl] .mat-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)){padding-right:16px;padding-left:0}.mat-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-nav-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-nav-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-selection-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-selection-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)){padding-left:0;padding-right:16px}[dir=rtl] .mat-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)){padding-right:0;padding-left:16px}.mat-list .mat-list-item .mat-list-avatar,.mat-list .mat-list-option .mat-list-avatar,.mat-nav-list .mat-list-item .mat-list-avatar,.mat-nav-list .mat-list-option .mat-list-avatar,.mat-selection-list .mat-list-item .mat-list-avatar,.mat-selection-list .mat-list-option .mat-list-avatar{flex-shrink:0;width:40px;height:40px;border-radius:50%}.mat-list .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list .mat-list-option .mat-list-avatar~.mat-divider-inset,.mat-nav-list .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-nav-list .mat-list-option .mat-list-avatar~.mat-divider-inset,.mat-selection-list .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-selection-list .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:72px;width:calc(100% - 72px)}[dir=rtl] .mat-list .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list .mat-list-option .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-nav-list .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-nav-list .mat-list-option .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-selection-list .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-selection-list .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:72px}.mat-list .mat-list-item .mat-list-icon,.mat-list .mat-list-option .mat-list-icon,.mat-nav-list .mat-list-item .mat-list-icon,.mat-nav-list .mat-list-option .mat-list-icon,.mat-selection-list .mat-list-item .mat-list-icon,.mat-selection-list .mat-list-option .mat-list-icon{flex-shrink:0;width:24px;height:24px;font-size:24px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list .mat-list-option .mat-list-icon~.mat-divider-inset,.mat-nav-list .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-nav-list .mat-list-option .mat-list-icon~.mat-divider-inset,.mat-selection-list .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-selection-list .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:64px;width:calc(100% - 64px)}[dir=rtl] .mat-list .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list .mat-list-option .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-nav-list .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-nav-list .mat-list-option .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-selection-list .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-selection-list .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:64px}.mat-list .mat-list-item .mat-divider,.mat-list .mat-list-option .mat-divider,.mat-nav-list .mat-list-item .mat-divider,.mat-nav-list .mat-list-option .mat-divider,.mat-selection-list .mat-list-item .mat-divider,.mat-selection-list .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list .mat-list-item .mat-divider,[dir=rtl] .mat-list .mat-list-option .mat-divider,[dir=rtl] .mat-nav-list .mat-list-item .mat-divider,[dir=rtl] .mat-nav-list .mat-list-option .mat-divider,[dir=rtl] .mat-selection-list .mat-list-item .mat-divider,[dir=rtl] .mat-selection-list .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list .mat-list-item .mat-divider.mat-divider-inset,.mat-list .mat-list-option .mat-divider.mat-divider-inset,.mat-nav-list .mat-list-item .mat-divider.mat-divider-inset,.mat-nav-list .mat-list-option .mat-divider.mat-divider-inset,.mat-selection-list .mat-list-item .mat-divider.mat-divider-inset,.mat-selection-list .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-list[dense],.mat-nav-list[dense],.mat-selection-list[dense]{padding-top:4px;display:block}.mat-list[dense] .mat-subheader,.mat-nav-list[dense] .mat-subheader,.mat-selection-list[dense] .mat-subheader{height:40px;line-height:8px}.mat-list[dense] .mat-subheader:first-child,.mat-nav-list[dense] .mat-subheader:first-child,.mat-selection-list[dense] .mat-subheader:first-child{margin-top:-4px}.mat-list[dense] .mat-list-item,.mat-list[dense] .mat-list-option,.mat-nav-list[dense] .mat-list-item,.mat-nav-list[dense] .mat-list-option,.mat-selection-list[dense] .mat-list-item,.mat-selection-list[dense] .mat-list-option{display:block;height:40px}.mat-list[dense] .mat-list-item .mat-list-item-content,.mat-list[dense] .mat-list-option .mat-list-item-content,.mat-nav-list[dense] .mat-list-item .mat-list-item-content,.mat-nav-list[dense] .mat-list-option .mat-list-item-content,.mat-selection-list[dense] .mat-list-item .mat-list-item-content,.mat-selection-list[dense] .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list[dense] .mat-list-item .mat-list-item-content-reverse,.mat-list[dense] .mat-list-option .mat-list-item-content-reverse,.mat-nav-list[dense] .mat-list-item .mat-list-item-content-reverse,.mat-nav-list[dense] .mat-list-option .mat-list-item-content-reverse,.mat-selection-list[dense] .mat-list-item .mat-list-item-content-reverse,.mat-selection-list[dense] .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list[dense] .mat-list-item .mat-list-item-ripple,.mat-list[dense] .mat-list-option .mat-list-item-ripple,.mat-nav-list[dense] .mat-list-item .mat-list-item-ripple,.mat-nav-list[dense] .mat-list-option .mat-list-item-ripple,.mat-selection-list[dense] .mat-list-item .mat-list-item-ripple,.mat-selection-list[dense] .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list[dense] .mat-list-item.mat-list-item-with-avatar,.mat-list[dense] .mat-list-option.mat-list-item-with-avatar,.mat-nav-list[dense] .mat-list-item.mat-list-item-with-avatar,.mat-nav-list[dense] .mat-list-option.mat-list-item-with-avatar,.mat-selection-list[dense] .mat-list-item.mat-list-item-with-avatar,.mat-selection-list[dense] .mat-list-option.mat-list-item-with-avatar{height:48px}.mat-list[dense] .mat-list-item.mat-2-line,.mat-list[dense] .mat-list-option.mat-2-line,.mat-nav-list[dense] .mat-list-item.mat-2-line,.mat-nav-list[dense] .mat-list-option.mat-2-line,.mat-selection-list[dense] .mat-list-item.mat-2-line,.mat-selection-list[dense] .mat-list-option.mat-2-line{height:60px}.mat-list[dense] .mat-list-item.mat-3-line,.mat-list[dense] .mat-list-option.mat-3-line,.mat-nav-list[dense] .mat-list-item.mat-3-line,.mat-nav-list[dense] .mat-list-option.mat-3-line,.mat-selection-list[dense] .mat-list-item.mat-3-line,.mat-selection-list[dense] .mat-list-option.mat-3-line{height:76px}.mat-list[dense] .mat-list-item.mat-multi-line,.mat-list[dense] .mat-list-option.mat-multi-line,.mat-nav-list[dense] .mat-list-item.mat-multi-line,.mat-nav-list[dense] .mat-list-option.mat-multi-line,.mat-selection-list[dense] .mat-list-item.mat-multi-line,.mat-selection-list[dense] .mat-list-option.mat-multi-line{height:auto}.mat-list[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list[dense] .mat-list-option.mat-multi-line .mat-list-item-content,.mat-nav-list[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-nav-list[dense] .mat-list-option.mat-multi-line .mat-list-item-content,.mat-selection-list[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-selection-list[dense] .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list[dense] .mat-list-item .mat-list-text,.mat-list[dense] .mat-list-option .mat-list-text,.mat-nav-list[dense] .mat-list-item .mat-list-text,.mat-nav-list[dense] .mat-list-option .mat-list-text,.mat-selection-list[dense] .mat-list-item .mat-list-text,.mat-selection-list[dense] .mat-list-option .mat-list-text{display:flex;flex-direction:column;width:100%;box-sizing:border-box;overflow:hidden;padding:0}.mat-list[dense] .mat-list-item .mat-list-text>*,.mat-list[dense] .mat-list-option .mat-list-text>*,.mat-nav-list[dense] .mat-list-item .mat-list-text>*,.mat-nav-list[dense] .mat-list-option .mat-list-text>*,.mat-selection-list[dense] .mat-list-item .mat-list-text>*,.mat-selection-list[dense] .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:400;font-size:inherit}.mat-list[dense] .mat-list-item .mat-list-text:empty,.mat-list[dense] .mat-list-option .mat-list-text:empty,.mat-nav-list[dense] .mat-list-item .mat-list-text:empty,.mat-nav-list[dense] .mat-list-option .mat-list-text:empty,.mat-selection-list[dense] .mat-list-item .mat-list-text:empty,.mat-selection-list[dense] .mat-list-option .mat-list-text:empty{display:none}.mat-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-nav-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-nav-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-selection-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-selection-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)){padding-right:0;padding-left:16px}[dir=rtl] .mat-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)){padding-right:16px;padding-left:0}.mat-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-nav-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-nav-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-selection-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-selection-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)){padding-left:0;padding-right:16px}[dir=rtl] .mat-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)){padding-right:0;padding-left:16px}.mat-list[dense] .mat-list-item .mat-list-avatar,.mat-list[dense] .mat-list-option .mat-list-avatar,.mat-nav-list[dense] .mat-list-item .mat-list-avatar,.mat-nav-list[dense] .mat-list-option .mat-list-avatar,.mat-selection-list[dense] .mat-list-item .mat-list-avatar,.mat-selection-list[dense] .mat-list-option .mat-list-avatar{flex-shrink:0;width:36px;height:36px;border-radius:50%}.mat-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset,.mat-nav-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-nav-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset,.mat-selection-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-selection-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:68px;width:calc(100% - 68px)}[dir=rtl] .mat-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:68px}.mat-list[dense] .mat-list-item .mat-list-icon,.mat-list[dense] .mat-list-option .mat-list-icon,.mat-nav-list[dense] .mat-list-item .mat-list-icon,.mat-nav-list[dense] .mat-list-option .mat-list-icon,.mat-selection-list[dense] .mat-list-item .mat-list-icon,.mat-selection-list[dense] .mat-list-option .mat-list-icon{flex-shrink:0;width:20px;height:20px;font-size:20px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset,.mat-nav-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-nav-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset,.mat-selection-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-selection-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:60px;width:calc(100% - 60px)}[dir=rtl] .mat-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:60px}.mat-list[dense] .mat-list-item .mat-divider,.mat-list[dense] .mat-list-option .mat-divider,.mat-nav-list[dense] .mat-list-item .mat-divider,.mat-nav-list[dense] .mat-list-option .mat-divider,.mat-selection-list[dense] .mat-list-item .mat-divider,.mat-selection-list[dense] .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-list[dense] .mat-list-option .mat-divider,[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-divider,[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-list[dense] .mat-list-option .mat-divider.mat-divider-inset,.mat-nav-list[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-nav-list[dense] .mat-list-option .mat-divider.mat-divider-inset,.mat-selection-list[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-selection-list[dense] .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-nav-list a{text-decoration:none;color:inherit}.mat-nav-list .mat-list-item{cursor:pointer;outline:0}.mat-list-option:not(.mat-list-item-disabled){cursor:pointer;outline:0}"],
inputs: ['disableRipple'],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
},] },
];
return MatList;
}(_MatListMixinBase));
/**
* Directive whose purpose is to add the mat- CSS styling to this selector.
* \@docs-private
*/
var MatListAvatarCssMatStyler = /** @class */ (function () {
function MatListAvatarCssMatStyler() {
}
MatListAvatarCssMatStyler.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[mat-list-avatar], [matListAvatar]',
host: { 'class': 'mat-list-avatar' }
},] },
];
return MatListAvatarCssMatStyler;
}());
/**
* Directive whose purpose is to add the mat- CSS styling to this selector.
* \@docs-private
*/
var MatListIconCssMatStyler = /** @class */ (function () {
function MatListIconCssMatStyler() {
}
MatListIconCssMatStyler.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[mat-list-icon], [matListIcon]',
host: { 'class': 'mat-list-icon' }
},] },
];
return MatListIconCssMatStyler;
}());
/**
* Directive whose purpose is to add the mat- CSS styling to this selector.
* \@docs-private
*/
var MatListSubheaderCssMatStyler = /** @class */ (function () {
function MatListSubheaderCssMatStyler() {
}
MatListSubheaderCssMatStyler.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[mat-subheader], [matSubheader]',
host: { 'class': 'mat-subheader' }
},] },
];
return MatListSubheaderCssMatStyler;
}());
/**
* An item within a Material Design list.
*/
var MatListItem = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatListItem, _super);
function MatListItem(_element, _navList) {
var _this = _super.call(this) || this;
_this._element = _element;
_this._navList = _navList;
_this._isNavList = false;
_this._isNavList = !!_navList;
return _this;
}
/**
* @return {?}
*/
MatListItem.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
// TODO: consider turning the setter into a function, it doesn't do anything as a class.
// tslint:disable-next-line:no-unused-expression
new _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatLineSetter"](this._lines, this._element);
};
/** Whether this list item should show a ripple effect when clicked. */
/**
* Whether this list item should show a ripple effect when clicked.
* @return {?}
*/
MatListItem.prototype._isRippleDisabled = /**
* Whether this list item should show a ripple effect when clicked.
* @return {?}
*/
function () {
return !this._isNavList || this.disableRipple || this._navList.disableRipple;
};
/**
* @return {?}
*/
MatListItem.prototype._handleFocus = /**
* @return {?}
*/
function () {
this._element.nativeElement.classList.add('mat-list-item-focus');
};
/**
* @return {?}
*/
MatListItem.prototype._handleBlur = /**
* @return {?}
*/
function () {
this._element.nativeElement.classList.remove('mat-list-item-focus');
};
/** Retrieves the DOM element of the component host. */
/**
* Retrieves the DOM element of the component host.
* @return {?}
*/
MatListItem.prototype._getHostElement = /**
* Retrieves the DOM element of the component host.
* @return {?}
*/
function () {
return this._element.nativeElement;
};
MatListItem.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-list-item, a[mat-list-item]',
exportAs: 'matListItem',
host: {
'class': 'mat-list-item',
// @deletion-target 7.0.0 Remove `mat-list-item-avatar` in favor of `mat-list-item-with-avatar`.
'[class.mat-list-item-avatar]': '_avatar',
'[class.mat-list-item-with-avatar]': '_avatar',
'(focus)': '_handleFocus()',
'(blur)': '_handleBlur()',
},
inputs: ['disableRipple'],
template: "<div class=\"mat-list-item-content\"><div class=\"mat-list-item-ripple\" mat-ripple [matRippleTrigger]=\"_getHostElement()\" [matRippleDisabled]=\"_isRippleDisabled()\"></div><ng-content select=\"[mat-list-avatar], [mat-list-icon], [matListAvatar], [matListIcon]\"></ng-content><div class=\"mat-list-text\"><ng-content select=\"[mat-line], [matLine]\"></ng-content></div><ng-content></ng-content></div>",
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatListItem.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: MatNavList, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] },] },
]; };
MatListItem.propDecorators = {
"_lines": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatLine"],] },],
"_avatar": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChild"], args: [MatListAvatarCssMatStyler,] },],
};
return MatListItem;
}(_MatListItemMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatSelectionListBase = /** @class */ (function () {
function MatSelectionListBase() {
}
return MatSelectionListBase;
}());
var /** @type {?} */ _MatSelectionListMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["mixinDisableRipple"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["mixinDisabled"])(MatSelectionListBase));
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatListOptionBase = /** @class */ (function () {
function MatListOptionBase() {
}
return MatListOptionBase;
}());
var /** @type {?} */ _MatListOptionMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["mixinDisableRipple"])(MatListOptionBase);
/**
* \@docs-private
*/
var /** @type {?} */ MAT_SELECTION_LIST_VALUE_ACCESSOR = {
provide: _angular_forms__WEBPACK_IMPORTED_MODULE_7__["NG_VALUE_ACCESSOR"],
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return MatSelectionList; }),
multi: true
};
/**
* Change event that is being fired whenever the selected state of an option changes.
*/
var /**
* Change event that is being fired whenever the selected state of an option changes.
*/
MatSelectionListChange = /** @class */ (function () {
function MatSelectionListChange(source, option) {
this.source = source;
this.option = option;
}
return MatSelectionListChange;
}());
/**
* Component for list-options of selection-list. Each list-option can automatically
* generate a checkbox and can put current item into the selectionModel of selection-list
* if the current item is selected.
*/
var MatListOption = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatListOption, _super);
function MatListOption(_element, _changeDetector, /** @docs-private */
selectionList) {
var _this = _super.call(this) || this;
_this._element = _element;
_this._changeDetector = _changeDetector;
_this.selectionList = selectionList;
_this._selected = false;
_this._disabled = false;
/**
* Whether the option has focus.
*/
_this._hasFocus = false;
/**
* Whether the label should appear before or after the checkbox. Defaults to 'after'
*/
_this.checkboxPosition = 'after';
return _this;
}
Object.defineProperty(MatListOption.prototype, "disabled", {
get: /**
* Whether the option is disabled.
* @return {?}
*/
function () { return this._disabled || (this.selectionList && this.selectionList.disabled); },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ newValue = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__["coerceBooleanProperty"])(value);
if (newValue !== this._disabled) {
this._disabled = newValue;
this._changeDetector.markForCheck();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatListOption.prototype, "selected", {
get: /**
* Whether the option is selected.
* @return {?}
*/
function () { return this.selectionList.selectedOptions.isSelected(this); },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ isSelected = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__["coerceBooleanProperty"])(value);
if (isSelected !== this._selected) {
this._setSelected(isSelected);
this.selectionList._reportValueChange();
}
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatListOption.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
// List options that are selected at initialization can't be reported properly to the form
// control. This is because it takes some time until the selection-list knows about all
// available options. Also it can happen that the ControlValueAccessor has an initial value
// that should be used instead. Deferring the value change report to the next tick ensures
// that the form control value is not being overwritten.
var /** @type {?} */ wasSelected = this._selected;
Promise.resolve().then(function () {
if (_this._selected || wasSelected) {
_this.selected = true;
_this._changeDetector.markForCheck();
}
});
};
/**
* @return {?}
*/
MatListOption.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
// TODO: consider turning the setter into a function, it doesn't do anything as a class.
// tslint:disable-next-line:no-unused-expression
new _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatLineSetter"](this._lines, this._element);
};
/**
* @return {?}
*/
MatListOption.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
var _this = this;
if (this.selected) {
// We have to delay this until the next tick in order
// to avoid changed after checked errors.
Promise.resolve().then(function () { return _this.selected = false; });
}
this.selectionList._removeOptionFromList(this);
};
/** Toggles the selection state of the option. */
/**
* Toggles the selection state of the option.
* @return {?}
*/
MatListOption.prototype.toggle = /**
* Toggles the selection state of the option.
* @return {?}
*/
function () {
this.selected = !this.selected;
};
/** Allows for programmatic focusing of the option. */
/**
* Allows for programmatic focusing of the option.
* @return {?}
*/
MatListOption.prototype.focus = /**
* Allows for programmatic focusing of the option.
* @return {?}
*/
function () {
this._element.nativeElement.focus();
};
/**
* Returns the list item's text label. Implemented as a part of the FocusKeyManager.
* @docs-private
*/
/**
* Returns the list item's text label. Implemented as a part of the FocusKeyManager.
* \@docs-private
* @return {?}
*/
MatListOption.prototype.getLabel = /**
* Returns the list item's text label. Implemented as a part of the FocusKeyManager.
* \@docs-private
* @return {?}
*/
function () {
return this._text ? this._text.nativeElement.textContent : '';
};
/** Whether this list item should show a ripple effect when clicked. */
/**
* Whether this list item should show a ripple effect when clicked.
* @return {?}
*/
MatListOption.prototype._isRippleDisabled = /**
* Whether this list item should show a ripple effect when clicked.
* @return {?}
*/
function () {
return this.disabled || this.disableRipple || this.selectionList.disableRipple;
};
/**
* @return {?}
*/
MatListOption.prototype._handleClick = /**
* @return {?}
*/
function () {
if (!this.disabled) {
this.toggle();
// Emit a change event if the selected state of the option changed through user interaction.
this.selectionList._emitChangeEvent(this);
}
};
/**
* @return {?}
*/
MatListOption.prototype._handleFocus = /**
* @return {?}
*/
function () {
this._hasFocus = true;
this.selectionList._setFocusedOption(this);
};
/**
* @return {?}
*/
MatListOption.prototype._handleBlur = /**
* @return {?}
*/
function () {
this._hasFocus = false;
this.selectionList._onTouched();
};
/** Retrieves the DOM element of the component host. */
/**
* Retrieves the DOM element of the component host.
* @return {?}
*/
MatListOption.prototype._getHostElement = /**
* Retrieves the DOM element of the component host.
* @return {?}
*/
function () {
return this._element.nativeElement;
};
/** Sets the selected state of the option. Returns whether the value has changed. */
/**
* Sets the selected state of the option. Returns whether the value has changed.
* @param {?} selected
* @return {?}
*/
MatListOption.prototype._setSelected = /**
* Sets the selected state of the option. Returns whether the value has changed.
* @param {?} selected
* @return {?}
*/
function (selected) {
if (selected === this._selected) {
return false;
}
this._selected = selected;
if (selected) {
this.selectionList.selectedOptions.select(this);
}
else {
this.selectionList.selectedOptions.deselect(this);
}
this._changeDetector.markForCheck();
return true;
};
MatListOption.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-list-option',
exportAs: 'matListOption',
inputs: ['disableRipple'],
host: {
'role': 'option',
'class': 'mat-list-item mat-list-option',
'(focus)': '_handleFocus()',
'(blur)': '_handleBlur()',
'(click)': '_handleClick()',
'tabindex': '-1',
'[class.mat-list-item-disabled]': 'disabled',
'[class.mat-list-item-focus]': '_hasFocus',
'[attr.aria-selected]': 'selected.toString()',
'[attr.aria-disabled]': 'disabled.toString()',
},
template: "<div class=\"mat-list-item-content\" [class.mat-list-item-content-reverse]=\"checkboxPosition == 'after'\"><div mat-ripple class=\"mat-list-item-ripple\" [matRippleTrigger]=\"_getHostElement()\" [matRippleDisabled]=\"_isRippleDisabled()\"></div><mat-pseudo-checkbox [state]=\"selected ? 'checked' : 'unchecked'\" [disabled]=\"disabled\"></mat-pseudo-checkbox><div class=\"mat-list-text\" #text><ng-content></ng-content></div></div>",
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatListOption.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"], },
{ type: MatSelectionList, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return MatSelectionList; }),] },] },
]; };
MatListOption.propDecorators = {
"_lines": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatLine"],] },],
"_text": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: ['text',] },],
"checkboxPosition": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"selected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
};
return MatListOption;
}(_MatListOptionMixinBase));
/**
* Material Design list component where each item is a selectable option. Behaves as a listbox.
*/
var MatSelectionList = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatSelectionList, _super);
function MatSelectionList(_element, tabIndex) {
var _this = _super.call(this) || this;
_this._element = _element;
/**
* Emits a change event whenever the selected state of an option changes.
*/
_this.selectionChange = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
/**
* Tabindex of the selection list.
*/
_this.tabIndex = 0;
/**
* The currently selected options.
*/
_this.selectedOptions = new _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_5__["SelectionModel"](true);
/**
* View to model callback that should be called whenever the selected options change.
*/
_this._onChange = function (_) { };
_this._modelChanges = rxjs__WEBPACK_IMPORTED_MODULE_8__["Subscription"].EMPTY;
/**
* View to model callback that should be called if the list or its options lost focus.
*/
_this._onTouched = function () { };
_this.tabIndex = parseInt(tabIndex) || 0;
return _this;
}
/**
* @return {?}
*/
MatSelectionList.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
this._keyManager = new _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_3__["FocusKeyManager"](this.options)
.withWrap()
.withTypeAhead()
.skipPredicate(function () { return false; });
if (this._tempValues) {
this._setOptionsFromValues(this._tempValues);
this._tempValues = null;
}
// Sync external changes to the model back to the options.
this._modelChanges = /** @type {?} */ ((this.selectedOptions.onChange)).subscribe(function (event) {
if (event.added) {
for (var _i = 0, _a = event.added; _i < _a.length; _i++) {
var item = _a[_i];
item.selected = true;
}
}
if (event.removed) {
for (var _b = 0, _c = event.removed; _b < _c.length; _b++) {
var item = _c[_b];
item.selected = false;
}
}
});
};
/**
* @return {?}
*/
MatSelectionList.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._modelChanges.unsubscribe();
};
/** Focuses the last active list option. */
/**
* Focuses the last active list option.
* @return {?}
*/
MatSelectionList.prototype.focus = /**
* Focuses the last active list option.
* @return {?}
*/
function () {
this._element.nativeElement.focus();
};
/** Selects all of the options. */
/**
* Selects all of the options.
* @return {?}
*/
MatSelectionList.prototype.selectAll = /**
* Selects all of the options.
* @return {?}
*/
function () {
this._setAllOptionsSelected(true);
};
/** Deselects all of the options. */
/**
* Deselects all of the options.
* @return {?}
*/
MatSelectionList.prototype.deselectAll = /**
* Deselects all of the options.
* @return {?}
*/
function () {
this._setAllOptionsSelected(false);
};
/** Sets the focused option of the selection-list. */
/**
* Sets the focused option of the selection-list.
* @param {?} option
* @return {?}
*/
MatSelectionList.prototype._setFocusedOption = /**
* Sets the focused option of the selection-list.
* @param {?} option
* @return {?}
*/
function (option) {
this._keyManager.updateActiveItemIndex(this._getOptionIndex(option));
};
/** Removes an option from the selection list and updates the active item. */
/**
* Removes an option from the selection list and updates the active item.
* @param {?} option
* @return {?}
*/
MatSelectionList.prototype._removeOptionFromList = /**
* Removes an option from the selection list and updates the active item.
* @param {?} option
* @return {?}
*/
function (option) {
if (option._hasFocus) {
var /** @type {?} */ optionIndex = this._getOptionIndex(option);
// Check whether the option is the last item
if (optionIndex > 0) {
this._keyManager.setPreviousItemActive();
}
else if (optionIndex === 0 && this.options.length > 1) {
this._keyManager.setNextItemActive();
}
}
};
/** Passes relevant key presses to our key manager. */
/**
* Passes relevant key presses to our key manager.
* @param {?} event
* @return {?}
*/
MatSelectionList.prototype._keydown = /**
* Passes relevant key presses to our key manager.
* @param {?} event
* @return {?}
*/
function (event) {
var /** @type {?} */ keyCode = event.keyCode;
var /** @type {?} */ manager = this._keyManager;
var /** @type {?} */ previousFocusIndex = manager.activeItemIndex;
switch (keyCode) {
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["SPACE"]:
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["ENTER"]:
if (!this.disabled) {
this._toggleSelectOnFocusedOption();
// Always prevent space from scrolling the page since the list has focus
event.preventDefault();
}
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["HOME"]:
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["END"]:
keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["HOME"] ? manager.setFirstItemActive() : manager.setLastItemActive();
event.preventDefault();
break;
default:
manager.onKeydown(event);
}
if ((keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["UP_ARROW"] || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["DOWN_ARROW"]) && event.shiftKey &&
manager.activeItemIndex !== previousFocusIndex) {
this._toggleSelectOnFocusedOption();
}
};
/** Reports a value change to the ControlValueAccessor */
/**
* Reports a value change to the ControlValueAccessor
* @return {?}
*/
MatSelectionList.prototype._reportValueChange = /**
* Reports a value change to the ControlValueAccessor
* @return {?}
*/
function () {
if (this.options) {
this._onChange(this._getSelectedOptionValues());
}
};
/** Emits a change event if the selected state of an option changed. */
/**
* Emits a change event if the selected state of an option changed.
* @param {?} option
* @return {?}
*/
MatSelectionList.prototype._emitChangeEvent = /**
* Emits a change event if the selected state of an option changed.
* @param {?} option
* @return {?}
*/
function (option) {
this.selectionChange.emit(new MatSelectionListChange(this, option));
};
/** Implemented as part of ControlValueAccessor. */
/**
* Implemented as part of ControlValueAccessor.
* @param {?} values
* @return {?}
*/
MatSelectionList.prototype.writeValue = /**
* Implemented as part of ControlValueAccessor.
* @param {?} values
* @return {?}
*/
function (values) {
if (this.options) {
this._setOptionsFromValues(values || []);
}
else {
this._tempValues = values;
}
};
/** Implemented as a part of ControlValueAccessor. */
/**
* Implemented as a part of ControlValueAccessor.
* @param {?} isDisabled
* @return {?}
*/
MatSelectionList.prototype.setDisabledState = /**
* Implemented as a part of ControlValueAccessor.
* @param {?} isDisabled
* @return {?}
*/
function (isDisabled) {
if (this.options) {
this.options.forEach(function (option) { return option.disabled = isDisabled; });
}
};
/** Implemented as part of ControlValueAccessor. */
/**
* Implemented as part of ControlValueAccessor.
* @param {?} fn
* @return {?}
*/
MatSelectionList.prototype.registerOnChange = /**
* Implemented as part of ControlValueAccessor.
* @param {?} fn
* @return {?}
*/
function (fn) {
this._onChange = fn;
};
/** Implemented as part of ControlValueAccessor. */
/**
* Implemented as part of ControlValueAccessor.
* @param {?} fn
* @return {?}
*/
MatSelectionList.prototype.registerOnTouched = /**
* Implemented as part of ControlValueAccessor.
* @param {?} fn
* @return {?}
*/
function (fn) {
this._onTouched = fn;
};
/**
* Sets the selected options based on the specified values.
* @param {?} values
* @return {?}
*/
MatSelectionList.prototype._setOptionsFromValues = /**
* Sets the selected options based on the specified values.
* @param {?} values
* @return {?}
*/
function (values) {
var _this = this;
this.options.forEach(function (option) { return option._setSelected(false); });
values
.map(function (value) {
return _this.options.find(function (option) {
return _this.compareWith ? _this.compareWith(option.value, value) : option.value === value;
});
})
.filter(Boolean)
.forEach(function (option) { return ((option))._setSelected(true); });
};
/**
* Returns the values of the selected options.
* @return {?}
*/
MatSelectionList.prototype._getSelectedOptionValues = /**
* Returns the values of the selected options.
* @return {?}
*/
function () {
return this.options.filter(function (option) { return option.selected; }).map(function (option) { return option.value; });
};
/**
* Toggles the selected state of the currently focused option.
* @return {?}
*/
MatSelectionList.prototype._toggleSelectOnFocusedOption = /**
* Toggles the selected state of the currently focused option.
* @return {?}
*/
function () {
var /** @type {?} */ focusedIndex = this._keyManager.activeItemIndex;
if (focusedIndex != null && this._isValidIndex(focusedIndex)) {
var /** @type {?} */ focusedOption = this.options.toArray()[focusedIndex];
if (focusedOption) {
focusedOption.toggle();
// Emit a change event because the focused option changed its state through user
// interaction.
this._emitChangeEvent(focusedOption);
}
}
};
/**
* Sets the selected state on all of the options
* and emits an event if anything changed.
* @param {?} isSelected
* @return {?}
*/
MatSelectionList.prototype._setAllOptionsSelected = /**
* Sets the selected state on all of the options
* and emits an event if anything changed.
* @param {?} isSelected
* @return {?}
*/
function (isSelected) {
// Keep track of whether anything changed, because we only want to
// emit the changed event when something actually changed.
var /** @type {?} */ hasChanged = false;
this.options.forEach(function (option) {
if (option._setSelected(isSelected)) {
hasChanged = true;
}
});
if (hasChanged) {
this._reportValueChange();
}
};
/**
* Utility to ensure all indexes are valid.
* @param {?} index The index to be checked.
* @return {?} True if the index is valid for our list of options.
*/
MatSelectionList.prototype._isValidIndex = /**
* Utility to ensure all indexes are valid.
* @param {?} index The index to be checked.
* @return {?} True if the index is valid for our list of options.
*/
function (index) {
return index >= 0 && index < this.options.length;
};
/**
* Returns the index of the specified list option.
* @param {?} option
* @return {?}
*/
MatSelectionList.prototype._getOptionIndex = /**
* Returns the index of the specified list option.
* @param {?} option
* @return {?}
*/
function (option) {
return this.options.toArray().indexOf(option);
};
MatSelectionList.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-selection-list',
exportAs: 'matSelectionList',
inputs: ['disabled', 'disableRipple', 'tabIndex'],
host: {
'role': 'listbox',
'[tabIndex]': 'tabIndex',
'class': 'mat-selection-list',
'(focus)': 'focus()',
'(blur)': '_onTouched()',
'(keydown)': '_keydown($event)',
'[attr.aria-disabled]': 'disabled.toString()',
},
template: '<ng-content></ng-content>',
styles: [".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}.mat-subheader{display:flex;box-sizing:border-box;padding:16px;align-items:center}.mat-list .mat-subheader,.mat-nav-list .mat-subheader,.mat-selection-list .mat-subheader{margin:0}.mat-list,.mat-nav-list,.mat-selection-list{padding-top:8px;display:block}.mat-list .mat-subheader,.mat-nav-list .mat-subheader,.mat-selection-list .mat-subheader{height:48px;line-height:16px}.mat-list .mat-subheader:first-child,.mat-nav-list .mat-subheader:first-child,.mat-selection-list .mat-subheader:first-child{margin-top:-8px}.mat-list .mat-list-item,.mat-list .mat-list-option,.mat-nav-list .mat-list-item,.mat-nav-list .mat-list-option,.mat-selection-list .mat-list-item,.mat-selection-list .mat-list-option{display:block;height:48px}.mat-list .mat-list-item .mat-list-item-content,.mat-list .mat-list-option .mat-list-item-content,.mat-nav-list .mat-list-item .mat-list-item-content,.mat-nav-list .mat-list-option .mat-list-item-content,.mat-selection-list .mat-list-item .mat-list-item-content,.mat-selection-list .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list .mat-list-item .mat-list-item-content-reverse,.mat-list .mat-list-option .mat-list-item-content-reverse,.mat-nav-list .mat-list-item .mat-list-item-content-reverse,.mat-nav-list .mat-list-option .mat-list-item-content-reverse,.mat-selection-list .mat-list-item .mat-list-item-content-reverse,.mat-selection-list .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list .mat-list-item .mat-list-item-ripple,.mat-list .mat-list-option .mat-list-item-ripple,.mat-nav-list .mat-list-item .mat-list-item-ripple,.mat-nav-list .mat-list-option .mat-list-item-ripple,.mat-selection-list .mat-list-item .mat-list-item-ripple,.mat-selection-list .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list .mat-list-item.mat-list-item-with-avatar,.mat-list .mat-list-option.mat-list-item-with-avatar,.mat-nav-list .mat-list-item.mat-list-item-with-avatar,.mat-nav-list .mat-list-option.mat-list-item-with-avatar,.mat-selection-list .mat-list-item.mat-list-item-with-avatar,.mat-selection-list .mat-list-option.mat-list-item-with-avatar{height:56px}.mat-list .mat-list-item.mat-2-line,.mat-list .mat-list-option.mat-2-line,.mat-nav-list .mat-list-item.mat-2-line,.mat-nav-list .mat-list-option.mat-2-line,.mat-selection-list .mat-list-item.mat-2-line,.mat-selection-list .mat-list-option.mat-2-line{height:72px}.mat-list .mat-list-item.mat-3-line,.mat-list .mat-list-option.mat-3-line,.mat-nav-list .mat-list-item.mat-3-line,.mat-nav-list .mat-list-option.mat-3-line,.mat-selection-list .mat-list-item.mat-3-line,.mat-selection-list .mat-list-option.mat-3-line{height:88px}.mat-list .mat-list-item.mat-multi-line,.mat-list .mat-list-option.mat-multi-line,.mat-nav-list .mat-list-item.mat-multi-line,.mat-nav-list .mat-list-option.mat-multi-line,.mat-selection-list .mat-list-item.mat-multi-line,.mat-selection-list .mat-list-option.mat-multi-line{height:auto}.mat-list .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list .mat-list-option.mat-multi-line .mat-list-item-content,.mat-nav-list .mat-list-item.mat-multi-line .mat-list-item-content,.mat-nav-list .mat-list-option.mat-multi-line .mat-list-item-content,.mat-selection-list .mat-list-item.mat-multi-line .mat-list-item-content,.mat-selection-list .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list .mat-list-item .mat-list-text,.mat-list .mat-list-option .mat-list-text,.mat-nav-list .mat-list-item .mat-list-text,.mat-nav-list .mat-list-option .mat-list-text,.mat-selection-list .mat-list-item .mat-list-text,.mat-selection-list .mat-list-option .mat-list-text{display:flex;flex-direction:column;width:100%;box-sizing:border-box;overflow:hidden;padding:0}.mat-list .mat-list-item .mat-list-text>*,.mat-list .mat-list-option .mat-list-text>*,.mat-nav-list .mat-list-item .mat-list-text>*,.mat-nav-list .mat-list-option .mat-list-text>*,.mat-selection-list .mat-list-item .mat-list-text>*,.mat-selection-list .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:400;font-size:inherit}.mat-list .mat-list-item .mat-list-text:empty,.mat-list .mat-list-option .mat-list-text:empty,.mat-nav-list .mat-list-item .mat-list-text:empty,.mat-nav-list .mat-list-option .mat-list-text:empty,.mat-selection-list .mat-list-item .mat-list-text:empty,.mat-selection-list .mat-list-option .mat-list-text:empty{display:none}.mat-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-nav-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-nav-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-selection-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-selection-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)){padding-right:0;padding-left:16px}[dir=rtl] .mat-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)){padding-right:16px;padding-left:0}.mat-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-nav-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-nav-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-selection-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-selection-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)){padding-left:0;padding-right:16px}[dir=rtl] .mat-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)){padding-right:0;padding-left:16px}.mat-list .mat-list-item .mat-list-avatar,.mat-list .mat-list-option .mat-list-avatar,.mat-nav-list .mat-list-item .mat-list-avatar,.mat-nav-list .mat-list-option .mat-list-avatar,.mat-selection-list .mat-list-item .mat-list-avatar,.mat-selection-list .mat-list-option .mat-list-avatar{flex-shrink:0;width:40px;height:40px;border-radius:50%}.mat-list .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list .mat-list-option .mat-list-avatar~.mat-divider-inset,.mat-nav-list .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-nav-list .mat-list-option .mat-list-avatar~.mat-divider-inset,.mat-selection-list .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-selection-list .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:72px;width:calc(100% - 72px)}[dir=rtl] .mat-list .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list .mat-list-option .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-nav-list .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-nav-list .mat-list-option .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-selection-list .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-selection-list .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:72px}.mat-list .mat-list-item .mat-list-icon,.mat-list .mat-list-option .mat-list-icon,.mat-nav-list .mat-list-item .mat-list-icon,.mat-nav-list .mat-list-option .mat-list-icon,.mat-selection-list .mat-list-item .mat-list-icon,.mat-selection-list .mat-list-option .mat-list-icon{flex-shrink:0;width:24px;height:24px;font-size:24px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list .mat-list-option .mat-list-icon~.mat-divider-inset,.mat-nav-list .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-nav-list .mat-list-option .mat-list-icon~.mat-divider-inset,.mat-selection-list .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-selection-list .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:64px;width:calc(100% - 64px)}[dir=rtl] .mat-list .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list .mat-list-option .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-nav-list .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-nav-list .mat-list-option .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-selection-list .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-selection-list .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:64px}.mat-list .mat-list-item .mat-divider,.mat-list .mat-list-option .mat-divider,.mat-nav-list .mat-list-item .mat-divider,.mat-nav-list .mat-list-option .mat-divider,.mat-selection-list .mat-list-item .mat-divider,.mat-selection-list .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list .mat-list-item .mat-divider,[dir=rtl] .mat-list .mat-list-option .mat-divider,[dir=rtl] .mat-nav-list .mat-list-item .mat-divider,[dir=rtl] .mat-nav-list .mat-list-option .mat-divider,[dir=rtl] .mat-selection-list .mat-list-item .mat-divider,[dir=rtl] .mat-selection-list .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list .mat-list-item .mat-divider.mat-divider-inset,.mat-list .mat-list-option .mat-divider.mat-divider-inset,.mat-nav-list .mat-list-item .mat-divider.mat-divider-inset,.mat-nav-list .mat-list-option .mat-divider.mat-divider-inset,.mat-selection-list .mat-list-item .mat-divider.mat-divider-inset,.mat-selection-list .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-list[dense],.mat-nav-list[dense],.mat-selection-list[dense]{padding-top:4px;display:block}.mat-list[dense] .mat-subheader,.mat-nav-list[dense] .mat-subheader,.mat-selection-list[dense] .mat-subheader{height:40px;line-height:8px}.mat-list[dense] .mat-subheader:first-child,.mat-nav-list[dense] .mat-subheader:first-child,.mat-selection-list[dense] .mat-subheader:first-child{margin-top:-4px}.mat-list[dense] .mat-list-item,.mat-list[dense] .mat-list-option,.mat-nav-list[dense] .mat-list-item,.mat-nav-list[dense] .mat-list-option,.mat-selection-list[dense] .mat-list-item,.mat-selection-list[dense] .mat-list-option{display:block;height:40px}.mat-list[dense] .mat-list-item .mat-list-item-content,.mat-list[dense] .mat-list-option .mat-list-item-content,.mat-nav-list[dense] .mat-list-item .mat-list-item-content,.mat-nav-list[dense] .mat-list-option .mat-list-item-content,.mat-selection-list[dense] .mat-list-item .mat-list-item-content,.mat-selection-list[dense] .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list[dense] .mat-list-item .mat-list-item-content-reverse,.mat-list[dense] .mat-list-option .mat-list-item-content-reverse,.mat-nav-list[dense] .mat-list-item .mat-list-item-content-reverse,.mat-nav-list[dense] .mat-list-option .mat-list-item-content-reverse,.mat-selection-list[dense] .mat-list-item .mat-list-item-content-reverse,.mat-selection-list[dense] .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list[dense] .mat-list-item .mat-list-item-ripple,.mat-list[dense] .mat-list-option .mat-list-item-ripple,.mat-nav-list[dense] .mat-list-item .mat-list-item-ripple,.mat-nav-list[dense] .mat-list-option .mat-list-item-ripple,.mat-selection-list[dense] .mat-list-item .mat-list-item-ripple,.mat-selection-list[dense] .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list[dense] .mat-list-item.mat-list-item-with-avatar,.mat-list[dense] .mat-list-option.mat-list-item-with-avatar,.mat-nav-list[dense] .mat-list-item.mat-list-item-with-avatar,.mat-nav-list[dense] .mat-list-option.mat-list-item-with-avatar,.mat-selection-list[dense] .mat-list-item.mat-list-item-with-avatar,.mat-selection-list[dense] .mat-list-option.mat-list-item-with-avatar{height:48px}.mat-list[dense] .mat-list-item.mat-2-line,.mat-list[dense] .mat-list-option.mat-2-line,.mat-nav-list[dense] .mat-list-item.mat-2-line,.mat-nav-list[dense] .mat-list-option.mat-2-line,.mat-selection-list[dense] .mat-list-item.mat-2-line,.mat-selection-list[dense] .mat-list-option.mat-2-line{height:60px}.mat-list[dense] .mat-list-item.mat-3-line,.mat-list[dense] .mat-list-option.mat-3-line,.mat-nav-list[dense] .mat-list-item.mat-3-line,.mat-nav-list[dense] .mat-list-option.mat-3-line,.mat-selection-list[dense] .mat-list-item.mat-3-line,.mat-selection-list[dense] .mat-list-option.mat-3-line{height:76px}.mat-list[dense] .mat-list-item.mat-multi-line,.mat-list[dense] .mat-list-option.mat-multi-line,.mat-nav-list[dense] .mat-list-item.mat-multi-line,.mat-nav-list[dense] .mat-list-option.mat-multi-line,.mat-selection-list[dense] .mat-list-item.mat-multi-line,.mat-selection-list[dense] .mat-list-option.mat-multi-line{height:auto}.mat-list[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list[dense] .mat-list-option.mat-multi-line .mat-list-item-content,.mat-nav-list[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-nav-list[dense] .mat-list-option.mat-multi-line .mat-list-item-content,.mat-selection-list[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-selection-list[dense] .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list[dense] .mat-list-item .mat-list-text,.mat-list[dense] .mat-list-option .mat-list-text,.mat-nav-list[dense] .mat-list-item .mat-list-text,.mat-nav-list[dense] .mat-list-option .mat-list-text,.mat-selection-list[dense] .mat-list-item .mat-list-text,.mat-selection-list[dense] .mat-list-option .mat-list-text{display:flex;flex-direction:column;width:100%;box-sizing:border-box;overflow:hidden;padding:0}.mat-list[dense] .mat-list-item .mat-list-text>*,.mat-list[dense] .mat-list-option .mat-list-text>*,.mat-nav-list[dense] .mat-list-item .mat-list-text>*,.mat-nav-list[dense] .mat-list-option .mat-list-text>*,.mat-selection-list[dense] .mat-list-item .mat-list-text>*,.mat-selection-list[dense] .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:400;font-size:inherit}.mat-list[dense] .mat-list-item .mat-list-text:empty,.mat-list[dense] .mat-list-option .mat-list-text:empty,.mat-nav-list[dense] .mat-list-item .mat-list-text:empty,.mat-nav-list[dense] .mat-list-option .mat-list-text:empty,.mat-selection-list[dense] .mat-list-item .mat-list-text:empty,.mat-selection-list[dense] .mat-list-option .mat-list-text:empty{display:none}.mat-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-nav-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-nav-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-selection-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),.mat-selection-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)){padding-right:0;padding-left:16px}[dir=rtl] .mat-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-list-item-content .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-list-item-content .mat-list-text:not(:nth-child(2)){padding-right:16px;padding-left:0}.mat-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-nav-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-nav-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-selection-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),.mat-selection-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)){padding-left:0;padding-right:16px}[dir=rtl] .mat-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)),[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-list-item-content-reverse .mat-list-text:not(:nth-child(2)){padding-right:0;padding-left:16px}.mat-list[dense] .mat-list-item .mat-list-avatar,.mat-list[dense] .mat-list-option .mat-list-avatar,.mat-nav-list[dense] .mat-list-item .mat-list-avatar,.mat-nav-list[dense] .mat-list-option .mat-list-avatar,.mat-selection-list[dense] .mat-list-item .mat-list-avatar,.mat-selection-list[dense] .mat-list-option .mat-list-avatar{flex-shrink:0;width:36px;height:36px;border-radius:50%}.mat-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset,.mat-nav-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-nav-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset,.mat-selection-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-selection-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:68px;width:calc(100% - 68px)}[dir=rtl] .mat-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:68px}.mat-list[dense] .mat-list-item .mat-list-icon,.mat-list[dense] .mat-list-option .mat-list-icon,.mat-nav-list[dense] .mat-list-item .mat-list-icon,.mat-nav-list[dense] .mat-list-option .mat-list-icon,.mat-selection-list[dense] .mat-list-item .mat-list-icon,.mat-selection-list[dense] .mat-list-option .mat-list-icon{flex-shrink:0;width:20px;height:20px;font-size:20px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset,.mat-nav-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-nav-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset,.mat-selection-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-selection-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:60px;width:calc(100% - 60px)}[dir=rtl] .mat-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:60px}.mat-list[dense] .mat-list-item .mat-divider,.mat-list[dense] .mat-list-option .mat-divider,.mat-nav-list[dense] .mat-list-item .mat-divider,.mat-nav-list[dense] .mat-list-option .mat-divider,.mat-selection-list[dense] .mat-list-item .mat-divider,.mat-selection-list[dense] .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-list[dense] .mat-list-option .mat-divider,[dir=rtl] .mat-nav-list[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-nav-list[dense] .mat-list-option .mat-divider,[dir=rtl] .mat-selection-list[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-selection-list[dense] .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-list[dense] .mat-list-option .mat-divider.mat-divider-inset,.mat-nav-list[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-nav-list[dense] .mat-list-option .mat-divider.mat-divider-inset,.mat-selection-list[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-selection-list[dense] .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-nav-list a{text-decoration:none;color:inherit}.mat-nav-list .mat-list-item{cursor:pointer;outline:0}.mat-list-option:not(.mat-list-item-disabled){cursor:pointer;outline:0}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
providers: [MAT_SELECTION_LIST_VALUE_ACCESSOR],
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush
},] },
];
/** @nocollapse */
MatSelectionList.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Attribute"], args: ['tabindex',] },] },
]; };
MatSelectionList.propDecorators = {
"options": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [MatListOption,] },],
"selectionChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] },],
"tabIndex": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"compareWith": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
};
return MatSelectionList;
}(_MatSelectionListMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatListModule = /** @class */ (function () {
function MatListModule() {
}
MatListModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatLineModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatRippleModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatCommonModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatPseudoCheckboxModule"], _angular_common__WEBPACK_IMPORTED_MODULE_9__["CommonModule"]],
exports: [
MatList,
MatNavList,
MatListItem,
MatListAvatarCssMatStyler,
_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatLineModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatCommonModule"],
MatListIconCssMatStyler,
MatListSubheaderCssMatStyler,
_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatPseudoCheckboxModule"],
MatSelectionList,
MatListOption,
_angular_material_divider__WEBPACK_IMPORTED_MODULE_10__["MatDividerModule"]
],
declarations: [
MatList,
MatNavList,
MatListItem,
MatListAvatarCssMatStyler,
MatListIconCssMatStyler,
MatListSubheaderCssMatStyler,
MatSelectionList,
MatListOption
],
},] },
];
return MatListModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=list.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/material.es5.js":
/*!*************************************************************!*\
!*** ./node_modules/@angular/material/esm5/material.es5.js ***!
\*************************************************************/
/*! exports provided: MatAutocompleteSelectedEvent, MatAutocompleteBase, _MatAutocompleteMixinBase, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY, MatAutocomplete, MatAutocompleteModule, AUTOCOMPLETE_OPTION_HEIGHT, AUTOCOMPLETE_PANEL_HEIGHT, MAT_AUTOCOMPLETE_SCROLL_STRATEGY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY, MAT_AUTOCOMPLETE_VALUE_ACCESSOR, getMatAutocompleteMissingPanelError, MatAutocompleteTrigger, MatBadgeModule, MatBadge, MatBottomSheetModule, MatBottomSheet, MAT_BOTTOM_SHEET_DATA, MatBottomSheetConfig, MatBottomSheetContainer, matBottomSheetAnimations, MatBottomSheetRef, MatButtonModule, MatButtonBase, _MatButtonMixinBase, MatButton, MatAnchor, MatButtonToggleGroupBase, _MatButtonToggleGroupMixinBase, MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR, MatButtonToggleGroupMultiple, MatButtonToggleChange, MatButtonToggleGroup, MatButtonToggleBase, _MatButtonToggleMixinBase, MatButtonToggle, MatButtonToggleModule, MatCardContent, MatCardTitle, MatCardSubtitle, MatCardActions, MatCardFooter, MatCardImage, MatCardSmImage, MatCardMdImage, MatCardLgImage, MatCardXlImage, MatCardAvatar, MatCard, MatCardHeader, MatCardTitleGroup, MatCardModule, MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR, TransitionCheckState, MatCheckboxChange, MatCheckboxBase, _MatCheckboxMixinBase, MatCheckbox, MAT_CHECKBOX_CLICK_ACTION, MatCheckboxModule, MAT_CHECKBOX_REQUIRED_VALIDATOR, MatCheckboxRequiredValidator, MatChipsModule, MatChipListBase, _MatChipListMixinBase, MatChipListChange, MatChipList, MatChipSelectionChange, MatChipBase, _MatChipMixinBase, MatChipAvatar, MatChipTrailingIcon, MatChip, MatChipRemove, MatChipInput, MAT_CHIPS_DEFAULT_OPTIONS, ɵa1, AnimationCurves, AnimationDurations, MatCommonModule, MATERIAL_SANITY_CHECKS, mixinDisabled, mixinColor, mixinDisableRipple, mixinTabIndex, mixinErrorState, mixinInitialized, NativeDateModule, MatNativeDateModule, MAT_DATE_LOCALE, MAT_DATE_LOCALE_FACTORY, MAT_DATE_LOCALE_PROVIDER, DateAdapter, MAT_DATE_FORMATS, NativeDateAdapter, MAT_NATIVE_DATE_FORMATS, ShowOnDirtyErrorStateMatcher, ErrorStateMatcher, MAT_HAMMER_OPTIONS, GestureConfig, MatLine, MatLineSetter, MatLineModule, MatOptionModule, MatOptionSelectionChange, MAT_OPTION_PARENT_COMPONENT, MatOption, _countGroupLabelsBeforeOption, _getOptionScrollPosition, MatOptgroupBase, _MatOptgroupMixinBase, MatOptgroup, MAT_LABEL_GLOBAL_OPTIONS, MatRippleModule, MAT_RIPPLE_GLOBAL_OPTIONS, MatRipple, RippleState, RippleRef, defaultRippleAnimationConfig, RippleRenderer, MatPseudoCheckboxModule, MatPseudoCheckbox, JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC, ɵa34, MatDatepickerModule, MatCalendarHeader, MatCalendar, MatCalendarCell, MatCalendarBody, MAT_DATEPICKER_SCROLL_STRATEGY, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY, MatDatepickerContentBase, _MatDatepickerContentMixinBase, MatDatepickerContent, MatDatepicker, matDatepickerAnimations, MAT_DATEPICKER_VALUE_ACCESSOR, MAT_DATEPICKER_VALIDATORS, MatDatepickerInputEvent, MatDatepickerInput, MatDatepickerIntl, MatDatepickerToggleIcon, MatDatepickerToggle, MatMonthView, MatYearView, MatDialogModule, MAT_DIALOG_DATA, MAT_DIALOG_DEFAULT_OPTIONS, MAT_DIALOG_SCROLL_STRATEGY, MAT_DIALOG_SCROLL_STRATEGY_FACTORY, MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY, MAT_DIALOG_SCROLL_STRATEGY_PROVIDER, MatDialog, throwMatDialogContentAlreadyAttachedError, MatDialogContainer, MatDialogClose, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogConfig, MatDialogRef, matDialogAnimations, MatDivider, MatDividerModule, MatExpansionModule, MatAccordion, MatExpansionPanel, MatExpansionPanelActionRow, MatExpansionPanelHeader, MatExpansionPanelDescription, MatExpansionPanelTitle, MatExpansionPanelContent, EXPANSION_PANEL_ANIMATION_TIMING, matExpansionAnimations, MatFormFieldModule, MatError, MatFormFieldBase, _MatFormFieldMixinBase, MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormField, MatFormFieldControl, getMatFormFieldPlaceholderConflictError, getMatFormFieldDuplicatedHintError, getMatFormFieldMissingControlError, MatHint, MatPlaceholder, MatPrefix, MatSuffix, MatLabel, matFormFieldAnimations, MatGridListModule, MatGridList, MatGridTile, MatGridTileText, MatGridAvatarCssMatStyler, MatGridTileHeaderCssMatStyler, MatGridTileFooterCssMatStyler, MatIconModule, MatIconBase, _MatIconMixinBase, MatIcon, getMatIconNameNotFoundError, getMatIconNoHttpProviderError, getMatIconFailedToSanitizeUrlError, getMatIconFailedToSanitizeLiteralError, MatIconRegistry, ICON_REGISTRY_PROVIDER_FACTORY, ICON_REGISTRY_PROVIDER, MatTextareaAutosize, MatInputBase, _MatInputMixinBase, MatInput, getMatInputUnsupportedTypeError, MatInputModule, MAT_INPUT_VALUE_ACCESSOR, MatListModule, MatListBase, _MatListMixinBase, MatListItemBase, _MatListItemMixinBase, MatNavList, MatList, MatListAvatarCssMatStyler, MatListIconCssMatStyler, MatListSubheaderCssMatStyler, MatListItem, MatSelectionListBase, _MatSelectionListMixinBase, MatListOptionBase, _MatListOptionMixinBase, MAT_SELECTION_LIST_VALUE_ACCESSOR, MatSelectionListChange, MatListOption, MatSelectionList, ɵa24, ɵb24, ɵc24, ɵe24, ɵd24, MAT_MENU_SCROLL_STRATEGY, MatMenuModule, MatMenu, MAT_MENU_DEFAULT_OPTIONS, MatMenuItem, MatMenuTrigger, matMenuAnimations, fadeInItems, transformMenu, MatMenuContent, MatPaginatorModule, PageEvent, MatPaginatorBase, _MatPaginatorBase, MatPaginator, MatPaginatorIntl, MAT_PAGINATOR_INTL_PROVIDER_FACTORY, MAT_PAGINATOR_INTL_PROVIDER, MatProgressBarModule, MatProgressBarBase, _MatProgressBarMixinBase, MatProgressBar, MatProgressSpinnerModule, MatProgressSpinnerBase, _MatProgressSpinnerMixinBase, MatProgressSpinner, MatSpinner, MatRadioModule, MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, MatRadioChange, MatRadioGroupBase, _MatRadioGroupMixinBase, MatRadioGroup, MatRadioButtonBase, _MatRadioButtonMixinBase, MatRadioButton, MatSelectModule, SELECT_PANEL_MAX_HEIGHT, SELECT_PANEL_PADDING_X, SELECT_PANEL_INDENT_PADDING_X, SELECT_ITEM_HEIGHT_EM, SELECT_MULTIPLE_PANEL_PADDING_X, SELECT_PANEL_VIEWPORT_PADDING, MAT_SELECT_SCROLL_STRATEGY, MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY, MAT_SELECT_SCROLL_STRATEGY_PROVIDER, MatSelectChange, MatSelectBase, _MatSelectMixinBase, MatSelectTrigger, MatSelect, matSelectAnimations, transformPanel, fadeInContent, MatSidenavModule, throwMatDuplicatedDrawerError, MAT_DRAWER_DEFAULT_AUTOSIZE, MAT_DRAWER_DEFAULT_AUTOSIZE_FACTORY, MatDrawerContent, MatDrawer, MatDrawerContainer, MatSidenavContent, MatSidenav, MatSidenavContainer, matDrawerAnimations, MatSlideToggleModule, MAT_SLIDE_TOGGLE_VALUE_ACCESSOR, MatSlideToggleChange, MatSlideToggleBase, _MatSlideToggleMixinBase, MatSlideToggle, MatSliderModule, MAT_SLIDER_VALUE_ACCESSOR, MatSliderChange, MatSliderBase, _MatSliderMixinBase, MatSlider, MatSnackBarModule, MAT_SNACK_BAR_DEFAULT_OPTIONS, MAT_SNACK_BAR_DEFAULT_OPTIONS_FACTORY, MatSnackBar, MatSnackBarContainer, MAT_SNACK_BAR_DATA, MatSnackBarConfig, MatSnackBarRef, SimpleSnackBar, matSnackBarAnimations, MatSortModule, MatSortHeaderBase, _MatSortHeaderMixinBase, MatSortHeader, MatSortHeaderIntl, MAT_SORT_HEADER_INTL_PROVIDER_FACTORY, MAT_SORT_HEADER_INTL_PROVIDER, MatSortBase, _MatSortMixinBase, MatSort, matSortAnimations, MatStepperModule, MatStepLabel, MatStep, MatStepper, MatHorizontalStepper, MatVerticalStepper, MatStepperNext, MatStepperPrevious, MatStepHeader, MatStepperIntl, matStepperAnimations, MatStepperIcon, MatTableModule, MatCellDef, MatHeaderCellDef, MatFooterCellDef, MatColumnDef, MatHeaderCell, MatFooterCell, MatCell, MatTable, MatHeaderRowDef, MatFooterRowDef, MatRowDef, MatHeaderRow, MatFooterRow, MatRow, MatTableDataSource, ɵa23, ɵf23, ɵg23, ɵb23, ɵc23, ɵd23, ɵe23, ɵj23, ɵh23, ɵk23, ɵi23, MatInkBar, _MAT_INK_BAR_POSITIONER, MatTabBody, MatTabBodyPortal, MatTabHeader, MatTabLabelWrapper, MatTab, MatTabLabel, MatTabNav, MatTabLink, MatTabContent, MatTabsModule, MatTabChangeEvent, MatTabGroupBase, _MatTabGroupMixinBase, MatTabGroup, matTabsAnimations, MatToolbarModule, MatToolbarBase, _MatToolbarMixinBase, MatToolbarRow, MatToolbar, throwToolbarMixedModesError, MatTooltipModule, SCROLL_THROTTLE_MS, TOOLTIP_PANEL_CLASS, getMatTooltipInvalidPositionError, MAT_TOOLTIP_SCROLL_STRATEGY, MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY, MAT_TOOLTIP_DEFAULT_OPTIONS, MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY, MatTooltip, TooltipComponent, matTooltipAnimations, _MatTreeNodeMixinBase, _MatNestedTreeNodeMixinBase, MatTreeNode, MatTreeNodeDef, MatNestedTreeNode, MatTreeNodePadding, MatTree, MatTreeModule, MatTreeNodeToggle, MatTreeNodeOutlet, MatTreeFlattener, MatTreeFlatDataSource, MatTreeNestedDataSource, VERSION */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/material/autocomplete */ "./node_modules/@angular/material/esm5/autocomplete.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatAutocompleteSelectedEvent", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["MatAutocompleteSelectedEvent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatAutocompleteBase", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["MatAutocompleteBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatAutocompleteMixinBase", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["_MatAutocompleteMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_AUTOCOMPLETE_DEFAULT_OPTIONS", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["MAT_AUTOCOMPLETE_DEFAULT_OPTIONS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatAutocomplete", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["MatAutocomplete"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatAutocompleteModule", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["MatAutocompleteModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AUTOCOMPLETE_OPTION_HEIGHT", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["AUTOCOMPLETE_OPTION_HEIGHT"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AUTOCOMPLETE_PANEL_HEIGHT", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["AUTOCOMPLETE_PANEL_HEIGHT"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_AUTOCOMPLETE_SCROLL_STRATEGY", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["MAT_AUTOCOMPLETE_SCROLL_STRATEGY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_AUTOCOMPLETE_VALUE_ACCESSOR", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["MAT_AUTOCOMPLETE_VALUE_ACCESSOR"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMatAutocompleteMissingPanelError", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["getMatAutocompleteMissingPanelError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatAutocompleteTrigger", function() { return _angular_material_autocomplete__WEBPACK_IMPORTED_MODULE_1__["MatAutocompleteTrigger"]; });
/* harmony import */ var _angular_material_badge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/badge */ "./node_modules/@angular/material/esm5/badge.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatBadgeModule", function() { return _angular_material_badge__WEBPACK_IMPORTED_MODULE_2__["MatBadgeModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatBadge", function() { return _angular_material_badge__WEBPACK_IMPORTED_MODULE_2__["MatBadge"]; });
/* harmony import */ var _angular_material_bottom_sheet__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/bottom-sheet */ "./node_modules/@angular/material/esm5/bottom-sheet.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatBottomSheetModule", function() { return _angular_material_bottom_sheet__WEBPACK_IMPORTED_MODULE_3__["MatBottomSheetModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatBottomSheet", function() { return _angular_material_bottom_sheet__WEBPACK_IMPORTED_MODULE_3__["MatBottomSheet"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_BOTTOM_SHEET_DATA", function() { return _angular_material_bottom_sheet__WEBPACK_IMPORTED_MODULE_3__["MAT_BOTTOM_SHEET_DATA"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatBottomSheetConfig", function() { return _angular_material_bottom_sheet__WEBPACK_IMPORTED_MODULE_3__["MatBottomSheetConfig"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatBottomSheetContainer", function() { return _angular_material_bottom_sheet__WEBPACK_IMPORTED_MODULE_3__["MatBottomSheetContainer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matBottomSheetAnimations", function() { return _angular_material_bottom_sheet__WEBPACK_IMPORTED_MODULE_3__["matBottomSheetAnimations"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatBottomSheetRef", function() { return _angular_material_bottom_sheet__WEBPACK_IMPORTED_MODULE_3__["MatBottomSheetRef"]; });
/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/button */ "./node_modules/@angular/material/esm5/button.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatButtonModule", function() { return _angular_material_button__WEBPACK_IMPORTED_MODULE_4__["MatButtonModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatButtonBase", function() { return _angular_material_button__WEBPACK_IMPORTED_MODULE_4__["MatButtonBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatButtonMixinBase", function() { return _angular_material_button__WEBPACK_IMPORTED_MODULE_4__["_MatButtonMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatButton", function() { return _angular_material_button__WEBPACK_IMPORTED_MODULE_4__["MatButton"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatAnchor", function() { return _angular_material_button__WEBPACK_IMPORTED_MODULE_4__["MatAnchor"]; });
/* harmony import */ var _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/button-toggle */ "./node_modules/@angular/material/esm5/button-toggle.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggleGroupBase", function() { return _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_5__["MatButtonToggleGroupBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatButtonToggleGroupMixinBase", function() { return _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_5__["_MatButtonToggleGroupMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR", function() { return _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_5__["MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggleGroupMultiple", function() { return _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_5__["MatButtonToggleGroupMultiple"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggleChange", function() { return _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_5__["MatButtonToggleChange"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggleGroup", function() { return _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_5__["MatButtonToggleGroup"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggleBase", function() { return _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_5__["MatButtonToggleBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatButtonToggleMixinBase", function() { return _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_5__["_MatButtonToggleMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggle", function() { return _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_5__["MatButtonToggle"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatButtonToggleModule", function() { return _angular_material_button_toggle__WEBPACK_IMPORTED_MODULE_5__["MatButtonToggleModule"]; });
/* harmony import */ var _angular_material_card__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/card */ "./node_modules/@angular/material/esm5/card.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardContent", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardContent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardTitle", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardTitle"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardSubtitle", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardSubtitle"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardActions", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardActions"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardFooter", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardFooter"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardImage", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardImage"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardSmImage", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardSmImage"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardMdImage", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardMdImage"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardLgImage", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardLgImage"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardXlImage", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardXlImage"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardAvatar", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardAvatar"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCard", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCard"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardHeader", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardHeader"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardTitleGroup", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardTitleGroup"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCardModule", function() { return _angular_material_card__WEBPACK_IMPORTED_MODULE_6__["MatCardModule"]; });
/* harmony import */ var _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/checkbox */ "./node_modules/@angular/material/esm5/checkbox.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR", function() { return _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_7__["MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransitionCheckState", function() { return _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_7__["TransitionCheckState"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCheckboxChange", function() { return _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_7__["MatCheckboxChange"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCheckboxBase", function() { return _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_7__["MatCheckboxBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatCheckboxMixinBase", function() { return _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_7__["_MatCheckboxMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCheckbox", function() { return _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_7__["MatCheckbox"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_CHECKBOX_CLICK_ACTION", function() { return _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_7__["MAT_CHECKBOX_CLICK_ACTION"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCheckboxModule", function() { return _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_7__["MatCheckboxModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_CHECKBOX_REQUIRED_VALIDATOR", function() { return _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_7__["MAT_CHECKBOX_REQUIRED_VALIDATOR"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCheckboxRequiredValidator", function() { return _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_7__["MatCheckboxRequiredValidator"]; });
/* harmony import */ var _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/chips */ "./node_modules/@angular/material/esm5/chips.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatChipsModule", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["MatChipsModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatChipListBase", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["MatChipListBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatChipListMixinBase", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["_MatChipListMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatChipListChange", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["MatChipListChange"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatChipList", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["MatChipList"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatChipSelectionChange", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["MatChipSelectionChange"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatChipBase", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["MatChipBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatChipMixinBase", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["_MatChipMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatChipAvatar", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["MatChipAvatar"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatChipTrailingIcon", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["MatChipTrailingIcon"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatChip", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["MatChip"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatChipRemove", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["MatChipRemove"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatChipInput", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["MatChipInput"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_CHIPS_DEFAULT_OPTIONS", function() { return _angular_material_chips__WEBPACK_IMPORTED_MODULE_8__["MAT_CHIPS_DEFAULT_OPTIONS"]; });
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵa1", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["ɵa1"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimationCurves", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["AnimationCurves"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimationDurations", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["AnimationDurations"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCommonModule", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatCommonModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MATERIAL_SANITY_CHECKS", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MATERIAL_SANITY_CHECKS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixinDisabled", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["mixinDisabled"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixinColor", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["mixinColor"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixinDisableRipple", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["mixinDisableRipple"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixinTabIndex", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["mixinTabIndex"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixinErrorState", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["mixinErrorState"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixinInitialized", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["mixinInitialized"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NativeDateModule", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["NativeDateModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatNativeDateModule", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatNativeDateModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DATE_LOCALE", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MAT_DATE_LOCALE"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DATE_LOCALE_FACTORY", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MAT_DATE_LOCALE_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DATE_LOCALE_PROVIDER", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MAT_DATE_LOCALE_PROVIDER"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DateAdapter", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["DateAdapter"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DATE_FORMATS", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MAT_DATE_FORMATS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NativeDateAdapter", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["NativeDateAdapter"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_NATIVE_DATE_FORMATS", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MAT_NATIVE_DATE_FORMATS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShowOnDirtyErrorStateMatcher", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["ShowOnDirtyErrorStateMatcher"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ErrorStateMatcher", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["ErrorStateMatcher"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_HAMMER_OPTIONS", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MAT_HAMMER_OPTIONS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GestureConfig", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["GestureConfig"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatLine", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatLine"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatLineSetter", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatLineSetter"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatLineModule", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatLineModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatOptionModule", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatOptionModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatOptionSelectionChange", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatOptionSelectionChange"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_OPTION_PARENT_COMPONENT", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MAT_OPTION_PARENT_COMPONENT"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatOption", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatOption"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_countGroupLabelsBeforeOption", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["_countGroupLabelsBeforeOption"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_getOptionScrollPosition", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["_getOptionScrollPosition"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatOptgroupBase", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatOptgroupBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatOptgroupMixinBase", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["_MatOptgroupMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatOptgroup", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatOptgroup"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_LABEL_GLOBAL_OPTIONS", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MAT_LABEL_GLOBAL_OPTIONS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatRippleModule", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatRippleModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_RIPPLE_GLOBAL_OPTIONS", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MAT_RIPPLE_GLOBAL_OPTIONS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatRipple", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatRipple"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RippleState", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["RippleState"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RippleRef", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["RippleRef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultRippleAnimationConfig", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["defaultRippleAnimationConfig"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RippleRenderer", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["RippleRenderer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatPseudoCheckboxModule", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatPseudoCheckboxModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatPseudoCheckbox", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MatPseudoCheckbox"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "JAN", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["JAN"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FEB", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["FEB"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAR", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MAR"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "APR", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["APR"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAY", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["MAY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "JUN", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["JUN"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "JUL", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["JUL"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AUG", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["AUG"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SEP", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["SEP"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OCT", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["OCT"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NOV", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["NOV"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DEC", function() { return _angular_material_core__WEBPACK_IMPORTED_MODULE_9__["DEC"]; });
/* harmony import */ var _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/material/datepicker */ "./node_modules/@angular/material/esm5/datepicker.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵa34", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["ɵa34"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerModule", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatDatepickerModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCalendarHeader", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatCalendarHeader"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCalendar", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatCalendar"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCalendarCell", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatCalendarCell"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCalendarBody", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatCalendarBody"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DATEPICKER_SCROLL_STRATEGY", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MAT_DATEPICKER_SCROLL_STRATEGY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerContentBase", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatDatepickerContentBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatDatepickerContentMixinBase", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["_MatDatepickerContentMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerContent", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatDatepickerContent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDatepicker", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatDatepicker"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matDatepickerAnimations", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["matDatepickerAnimations"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DATEPICKER_VALUE_ACCESSOR", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MAT_DATEPICKER_VALUE_ACCESSOR"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DATEPICKER_VALIDATORS", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MAT_DATEPICKER_VALIDATORS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerInputEvent", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatDatepickerInputEvent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerInput", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatDatepickerInput"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerIntl", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatDatepickerIntl"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerToggleIcon", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatDatepickerToggleIcon"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDatepickerToggle", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatDatepickerToggle"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatMonthView", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatMonthView"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatYearView", function() { return _angular_material_datepicker__WEBPACK_IMPORTED_MODULE_10__["MatYearView"]; });
/* harmony import */ var _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/dialog */ "./node_modules/@angular/material/esm5/dialog.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDialogModule", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MatDialogModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DIALOG_DATA", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MAT_DIALOG_DATA"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DIALOG_DEFAULT_OPTIONS", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MAT_DIALOG_DEFAULT_OPTIONS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DIALOG_SCROLL_STRATEGY", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MAT_DIALOG_SCROLL_STRATEGY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DIALOG_SCROLL_STRATEGY_FACTORY", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MAT_DIALOG_SCROLL_STRATEGY_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DIALOG_SCROLL_STRATEGY_PROVIDER", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MAT_DIALOG_SCROLL_STRATEGY_PROVIDER"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDialog", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MatDialog"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwMatDialogContentAlreadyAttachedError", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["throwMatDialogContentAlreadyAttachedError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDialogContainer", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MatDialogContainer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDialogClose", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MatDialogClose"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDialogTitle", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MatDialogTitle"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDialogContent", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MatDialogContent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDialogActions", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MatDialogActions"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDialogConfig", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MatDialogConfig"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDialogRef", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["MatDialogRef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matDialogAnimations", function() { return _angular_material_dialog__WEBPACK_IMPORTED_MODULE_11__["matDialogAnimations"]; });
/* harmony import */ var _angular_material_divider__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/material/divider */ "./node_modules/@angular/material/esm5/divider.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDivider", function() { return _angular_material_divider__WEBPACK_IMPORTED_MODULE_12__["MatDivider"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDividerModule", function() { return _angular_material_divider__WEBPACK_IMPORTED_MODULE_12__["MatDividerModule"]; });
/* harmony import */ var _angular_material_expansion__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/material/expansion */ "./node_modules/@angular/material/esm5/expansion.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatExpansionModule", function() { return _angular_material_expansion__WEBPACK_IMPORTED_MODULE_13__["MatExpansionModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatAccordion", function() { return _angular_material_expansion__WEBPACK_IMPORTED_MODULE_13__["MatAccordion"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatExpansionPanel", function() { return _angular_material_expansion__WEBPACK_IMPORTED_MODULE_13__["MatExpansionPanel"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatExpansionPanelActionRow", function() { return _angular_material_expansion__WEBPACK_IMPORTED_MODULE_13__["MatExpansionPanelActionRow"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatExpansionPanelHeader", function() { return _angular_material_expansion__WEBPACK_IMPORTED_MODULE_13__["MatExpansionPanelHeader"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatExpansionPanelDescription", function() { return _angular_material_expansion__WEBPACK_IMPORTED_MODULE_13__["MatExpansionPanelDescription"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatExpansionPanelTitle", function() { return _angular_material_expansion__WEBPACK_IMPORTED_MODULE_13__["MatExpansionPanelTitle"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatExpansionPanelContent", function() { return _angular_material_expansion__WEBPACK_IMPORTED_MODULE_13__["MatExpansionPanelContent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EXPANSION_PANEL_ANIMATION_TIMING", function() { return _angular_material_expansion__WEBPACK_IMPORTED_MODULE_13__["EXPANSION_PANEL_ANIMATION_TIMING"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matExpansionAnimations", function() { return _angular_material_expansion__WEBPACK_IMPORTED_MODULE_13__["matExpansionAnimations"]; });
/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @angular/material/form-field */ "./node_modules/@angular/material/esm5/form-field.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatFormFieldModule", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["MatFormFieldModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatError", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["MatError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatFormFieldBase", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["MatFormFieldBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatFormFieldMixinBase", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["_MatFormFieldMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_FORM_FIELD_DEFAULT_OPTIONS", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["MAT_FORM_FIELD_DEFAULT_OPTIONS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatFormField", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["MatFormField"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatFormFieldControl", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["MatFormFieldControl"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMatFormFieldPlaceholderConflictError", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["getMatFormFieldPlaceholderConflictError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMatFormFieldDuplicatedHintError", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["getMatFormFieldDuplicatedHintError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMatFormFieldMissingControlError", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["getMatFormFieldMissingControlError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatHint", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["MatHint"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatPlaceholder", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["MatPlaceholder"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatPrefix", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["MatPrefix"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSuffix", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["MatSuffix"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatLabel", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["MatLabel"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matFormFieldAnimations", function() { return _angular_material_form_field__WEBPACK_IMPORTED_MODULE_14__["matFormFieldAnimations"]; });
/* harmony import */ var _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @angular/material/grid-list */ "./node_modules/@angular/material/esm5/grid-list.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatGridListModule", function() { return _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_15__["MatGridListModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatGridList", function() { return _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_15__["MatGridList"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatGridTile", function() { return _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_15__["MatGridTile"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatGridTileText", function() { return _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_15__["MatGridTileText"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatGridAvatarCssMatStyler", function() { return _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_15__["MatGridAvatarCssMatStyler"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatGridTileHeaderCssMatStyler", function() { return _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_15__["MatGridTileHeaderCssMatStyler"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatGridTileFooterCssMatStyler", function() { return _angular_material_grid_list__WEBPACK_IMPORTED_MODULE_15__["MatGridTileFooterCssMatStyler"]; });
/* harmony import */ var _angular_material_icon__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @angular/material/icon */ "./node_modules/@angular/material/esm5/icon.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatIconModule", function() { return _angular_material_icon__WEBPACK_IMPORTED_MODULE_16__["MatIconModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatIconBase", function() { return _angular_material_icon__WEBPACK_IMPORTED_MODULE_16__["MatIconBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatIconMixinBase", function() { return _angular_material_icon__WEBPACK_IMPORTED_MODULE_16__["_MatIconMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatIcon", function() { return _angular_material_icon__WEBPACK_IMPORTED_MODULE_16__["MatIcon"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMatIconNameNotFoundError", function() { return _angular_material_icon__WEBPACK_IMPORTED_MODULE_16__["getMatIconNameNotFoundError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMatIconNoHttpProviderError", function() { return _angular_material_icon__WEBPACK_IMPORTED_MODULE_16__["getMatIconNoHttpProviderError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMatIconFailedToSanitizeUrlError", function() { return _angular_material_icon__WEBPACK_IMPORTED_MODULE_16__["getMatIconFailedToSanitizeUrlError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMatIconFailedToSanitizeLiteralError", function() { return _angular_material_icon__WEBPACK_IMPORTED_MODULE_16__["getMatIconFailedToSanitizeLiteralError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatIconRegistry", function() { return _angular_material_icon__WEBPACK_IMPORTED_MODULE_16__["MatIconRegistry"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ICON_REGISTRY_PROVIDER_FACTORY", function() { return _angular_material_icon__WEBPACK_IMPORTED_MODULE_16__["ICON_REGISTRY_PROVIDER_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ICON_REGISTRY_PROVIDER", function() { return _angular_material_icon__WEBPACK_IMPORTED_MODULE_16__["ICON_REGISTRY_PROVIDER"]; });
/* harmony import */ var _angular_material_input__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @angular/material/input */ "./node_modules/@angular/material/esm5/input.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTextareaAutosize", function() { return _angular_material_input__WEBPACK_IMPORTED_MODULE_17__["MatTextareaAutosize"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatInputBase", function() { return _angular_material_input__WEBPACK_IMPORTED_MODULE_17__["MatInputBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatInputMixinBase", function() { return _angular_material_input__WEBPACK_IMPORTED_MODULE_17__["_MatInputMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatInput", function() { return _angular_material_input__WEBPACK_IMPORTED_MODULE_17__["MatInput"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMatInputUnsupportedTypeError", function() { return _angular_material_input__WEBPACK_IMPORTED_MODULE_17__["getMatInputUnsupportedTypeError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatInputModule", function() { return _angular_material_input__WEBPACK_IMPORTED_MODULE_17__["MatInputModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_INPUT_VALUE_ACCESSOR", function() { return _angular_material_input__WEBPACK_IMPORTED_MODULE_17__["MAT_INPUT_VALUE_ACCESSOR"]; });
/* harmony import */ var _angular_material_list__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @angular/material/list */ "./node_modules/@angular/material/esm5/list.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatListModule", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatListModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatListBase", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatListBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatListMixinBase", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["_MatListMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatListItemBase", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatListItemBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatListItemMixinBase", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["_MatListItemMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatNavList", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatNavList"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatList", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatList"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatListAvatarCssMatStyler", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatListAvatarCssMatStyler"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatListIconCssMatStyler", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatListIconCssMatStyler"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatListSubheaderCssMatStyler", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatListSubheaderCssMatStyler"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatListItem", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatListItem"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSelectionListBase", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatSelectionListBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatSelectionListMixinBase", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["_MatSelectionListMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatListOptionBase", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatListOptionBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatListOptionMixinBase", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["_MatListOptionMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_SELECTION_LIST_VALUE_ACCESSOR", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MAT_SELECTION_LIST_VALUE_ACCESSOR"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSelectionListChange", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatSelectionListChange"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatListOption", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatListOption"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSelectionList", function() { return _angular_material_list__WEBPACK_IMPORTED_MODULE_18__["MatSelectionList"]; });
/* harmony import */ var _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @angular/material/menu */ "./node_modules/@angular/material/esm5/menu.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵa24", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["ɵa24"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵb24", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["ɵb24"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵc24", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["ɵc24"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵe24", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["ɵe24"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵd24", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["ɵd24"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_MENU_SCROLL_STRATEGY", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["MAT_MENU_SCROLL_STRATEGY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatMenuModule", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["MatMenuModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatMenu", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["MatMenu"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_MENU_DEFAULT_OPTIONS", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["MAT_MENU_DEFAULT_OPTIONS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatMenuItem", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["MatMenuItem"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatMenuTrigger", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["MatMenuTrigger"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matMenuAnimations", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["matMenuAnimations"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fadeInItems", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["fadeInItems"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transformMenu", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["transformMenu"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatMenuContent", function() { return _angular_material_menu__WEBPACK_IMPORTED_MODULE_19__["MatMenuContent"]; });
/* harmony import */ var _angular_material_paginator__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @angular/material/paginator */ "./node_modules/@angular/material/esm5/paginator.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatPaginatorModule", function() { return _angular_material_paginator__WEBPACK_IMPORTED_MODULE_20__["MatPaginatorModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageEvent", function() { return _angular_material_paginator__WEBPACK_IMPORTED_MODULE_20__["PageEvent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatPaginatorBase", function() { return _angular_material_paginator__WEBPACK_IMPORTED_MODULE_20__["MatPaginatorBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatPaginatorBase", function() { return _angular_material_paginator__WEBPACK_IMPORTED_MODULE_20__["_MatPaginatorBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatPaginator", function() { return _angular_material_paginator__WEBPACK_IMPORTED_MODULE_20__["MatPaginator"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatPaginatorIntl", function() { return _angular_material_paginator__WEBPACK_IMPORTED_MODULE_20__["MatPaginatorIntl"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_PAGINATOR_INTL_PROVIDER_FACTORY", function() { return _angular_material_paginator__WEBPACK_IMPORTED_MODULE_20__["MAT_PAGINATOR_INTL_PROVIDER_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_PAGINATOR_INTL_PROVIDER", function() { return _angular_material_paginator__WEBPACK_IMPORTED_MODULE_20__["MAT_PAGINATOR_INTL_PROVIDER"]; });
/* harmony import */ var _angular_material_progress_bar__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @angular/material/progress-bar */ "./node_modules/@angular/material/esm5/progress-bar.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatProgressBarModule", function() { return _angular_material_progress_bar__WEBPACK_IMPORTED_MODULE_21__["MatProgressBarModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatProgressBarBase", function() { return _angular_material_progress_bar__WEBPACK_IMPORTED_MODULE_21__["MatProgressBarBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatProgressBarMixinBase", function() { return _angular_material_progress_bar__WEBPACK_IMPORTED_MODULE_21__["_MatProgressBarMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatProgressBar", function() { return _angular_material_progress_bar__WEBPACK_IMPORTED_MODULE_21__["MatProgressBar"]; });
/* harmony import */ var _angular_material_progress_spinner__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @angular/material/progress-spinner */ "./node_modules/@angular/material/esm5/progress-spinner.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatProgressSpinnerModule", function() { return _angular_material_progress_spinner__WEBPACK_IMPORTED_MODULE_22__["MatProgressSpinnerModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatProgressSpinnerBase", function() { return _angular_material_progress_spinner__WEBPACK_IMPORTED_MODULE_22__["MatProgressSpinnerBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatProgressSpinnerMixinBase", function() { return _angular_material_progress_spinner__WEBPACK_IMPORTED_MODULE_22__["_MatProgressSpinnerMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatProgressSpinner", function() { return _angular_material_progress_spinner__WEBPACK_IMPORTED_MODULE_22__["MatProgressSpinner"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSpinner", function() { return _angular_material_progress_spinner__WEBPACK_IMPORTED_MODULE_22__["MatSpinner"]; });
/* harmony import */ var _angular_material_radio__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @angular/material/radio */ "./node_modules/@angular/material/esm5/radio.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatRadioModule", function() { return _angular_material_radio__WEBPACK_IMPORTED_MODULE_23__["MatRadioModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR", function() { return _angular_material_radio__WEBPACK_IMPORTED_MODULE_23__["MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatRadioChange", function() { return _angular_material_radio__WEBPACK_IMPORTED_MODULE_23__["MatRadioChange"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatRadioGroupBase", function() { return _angular_material_radio__WEBPACK_IMPORTED_MODULE_23__["MatRadioGroupBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatRadioGroupMixinBase", function() { return _angular_material_radio__WEBPACK_IMPORTED_MODULE_23__["_MatRadioGroupMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatRadioGroup", function() { return _angular_material_radio__WEBPACK_IMPORTED_MODULE_23__["MatRadioGroup"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatRadioButtonBase", function() { return _angular_material_radio__WEBPACK_IMPORTED_MODULE_23__["MatRadioButtonBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatRadioButtonMixinBase", function() { return _angular_material_radio__WEBPACK_IMPORTED_MODULE_23__["_MatRadioButtonMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatRadioButton", function() { return _angular_material_radio__WEBPACK_IMPORTED_MODULE_23__["MatRadioButton"]; });
/* harmony import */ var _angular_material_select__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @angular/material/select */ "./node_modules/@angular/material/esm5/select.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSelectModule", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["MatSelectModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SELECT_PANEL_MAX_HEIGHT", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["SELECT_PANEL_MAX_HEIGHT"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SELECT_PANEL_PADDING_X", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["SELECT_PANEL_PADDING_X"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SELECT_PANEL_INDENT_PADDING_X", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["SELECT_PANEL_INDENT_PADDING_X"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SELECT_ITEM_HEIGHT_EM", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["SELECT_ITEM_HEIGHT_EM"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SELECT_MULTIPLE_PANEL_PADDING_X", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["SELECT_MULTIPLE_PANEL_PADDING_X"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SELECT_PANEL_VIEWPORT_PADDING", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["SELECT_PANEL_VIEWPORT_PADDING"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_SELECT_SCROLL_STRATEGY", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["MAT_SELECT_SCROLL_STRATEGY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_SELECT_SCROLL_STRATEGY_PROVIDER", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["MAT_SELECT_SCROLL_STRATEGY_PROVIDER"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSelectChange", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["MatSelectChange"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSelectBase", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["MatSelectBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatSelectMixinBase", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["_MatSelectMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSelectTrigger", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["MatSelectTrigger"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSelect", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["MatSelect"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matSelectAnimations", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["matSelectAnimations"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transformPanel", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["transformPanel"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fadeInContent", function() { return _angular_material_select__WEBPACK_IMPORTED_MODULE_24__["fadeInContent"]; });
/* harmony import */ var _angular_material_sidenav__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @angular/material/sidenav */ "./node_modules/@angular/material/esm5/sidenav.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSidenavModule", function() { return _angular_material_sidenav__WEBPACK_IMPORTED_MODULE_25__["MatSidenavModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwMatDuplicatedDrawerError", function() { return _angular_material_sidenav__WEBPACK_IMPORTED_MODULE_25__["throwMatDuplicatedDrawerError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DRAWER_DEFAULT_AUTOSIZE", function() { return _angular_material_sidenav__WEBPACK_IMPORTED_MODULE_25__["MAT_DRAWER_DEFAULT_AUTOSIZE"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_DRAWER_DEFAULT_AUTOSIZE_FACTORY", function() { return _angular_material_sidenav__WEBPACK_IMPORTED_MODULE_25__["MAT_DRAWER_DEFAULT_AUTOSIZE_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDrawerContent", function() { return _angular_material_sidenav__WEBPACK_IMPORTED_MODULE_25__["MatDrawerContent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDrawer", function() { return _angular_material_sidenav__WEBPACK_IMPORTED_MODULE_25__["MatDrawer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatDrawerContainer", function() { return _angular_material_sidenav__WEBPACK_IMPORTED_MODULE_25__["MatDrawerContainer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSidenavContent", function() { return _angular_material_sidenav__WEBPACK_IMPORTED_MODULE_25__["MatSidenavContent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSidenav", function() { return _angular_material_sidenav__WEBPACK_IMPORTED_MODULE_25__["MatSidenav"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSidenavContainer", function() { return _angular_material_sidenav__WEBPACK_IMPORTED_MODULE_25__["MatSidenavContainer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matDrawerAnimations", function() { return _angular_material_sidenav__WEBPACK_IMPORTED_MODULE_25__["matDrawerAnimations"]; });
/* harmony import */ var _angular_material_slide_toggle__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @angular/material/slide-toggle */ "./node_modules/@angular/material/esm5/slide-toggle.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSlideToggleModule", function() { return _angular_material_slide_toggle__WEBPACK_IMPORTED_MODULE_26__["MatSlideToggleModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_SLIDE_TOGGLE_VALUE_ACCESSOR", function() { return _angular_material_slide_toggle__WEBPACK_IMPORTED_MODULE_26__["MAT_SLIDE_TOGGLE_VALUE_ACCESSOR"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSlideToggleChange", function() { return _angular_material_slide_toggle__WEBPACK_IMPORTED_MODULE_26__["MatSlideToggleChange"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSlideToggleBase", function() { return _angular_material_slide_toggle__WEBPACK_IMPORTED_MODULE_26__["MatSlideToggleBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatSlideToggleMixinBase", function() { return _angular_material_slide_toggle__WEBPACK_IMPORTED_MODULE_26__["_MatSlideToggleMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSlideToggle", function() { return _angular_material_slide_toggle__WEBPACK_IMPORTED_MODULE_26__["MatSlideToggle"]; });
/* harmony import */ var _angular_material_slider__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @angular/material/slider */ "./node_modules/@angular/material/esm5/slider.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSliderModule", function() { return _angular_material_slider__WEBPACK_IMPORTED_MODULE_27__["MatSliderModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_SLIDER_VALUE_ACCESSOR", function() { return _angular_material_slider__WEBPACK_IMPORTED_MODULE_27__["MAT_SLIDER_VALUE_ACCESSOR"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSliderChange", function() { return _angular_material_slider__WEBPACK_IMPORTED_MODULE_27__["MatSliderChange"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSliderBase", function() { return _angular_material_slider__WEBPACK_IMPORTED_MODULE_27__["MatSliderBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatSliderMixinBase", function() { return _angular_material_slider__WEBPACK_IMPORTED_MODULE_27__["_MatSliderMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSlider", function() { return _angular_material_slider__WEBPACK_IMPORTED_MODULE_27__["MatSlider"]; });
/* harmony import */ var _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @angular/material/snack-bar */ "./node_modules/@angular/material/esm5/snack-bar.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSnackBarModule", function() { return _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_28__["MatSnackBarModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_SNACK_BAR_DEFAULT_OPTIONS", function() { return _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_28__["MAT_SNACK_BAR_DEFAULT_OPTIONS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_SNACK_BAR_DEFAULT_OPTIONS_FACTORY", function() { return _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_28__["MAT_SNACK_BAR_DEFAULT_OPTIONS_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSnackBar", function() { return _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_28__["MatSnackBar"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSnackBarContainer", function() { return _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_28__["MatSnackBarContainer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_SNACK_BAR_DATA", function() { return _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_28__["MAT_SNACK_BAR_DATA"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSnackBarConfig", function() { return _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_28__["MatSnackBarConfig"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSnackBarRef", function() { return _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_28__["MatSnackBarRef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleSnackBar", function() { return _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_28__["SimpleSnackBar"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matSnackBarAnimations", function() { return _angular_material_snack_bar__WEBPACK_IMPORTED_MODULE_28__["matSnackBarAnimations"]; });
/* harmony import */ var _angular_material_sort__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @angular/material/sort */ "./node_modules/@angular/material/esm5/sort.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSortModule", function() { return _angular_material_sort__WEBPACK_IMPORTED_MODULE_29__["MatSortModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSortHeaderBase", function() { return _angular_material_sort__WEBPACK_IMPORTED_MODULE_29__["MatSortHeaderBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatSortHeaderMixinBase", function() { return _angular_material_sort__WEBPACK_IMPORTED_MODULE_29__["_MatSortHeaderMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSortHeader", function() { return _angular_material_sort__WEBPACK_IMPORTED_MODULE_29__["MatSortHeader"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSortHeaderIntl", function() { return _angular_material_sort__WEBPACK_IMPORTED_MODULE_29__["MatSortHeaderIntl"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_SORT_HEADER_INTL_PROVIDER_FACTORY", function() { return _angular_material_sort__WEBPACK_IMPORTED_MODULE_29__["MAT_SORT_HEADER_INTL_PROVIDER_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_SORT_HEADER_INTL_PROVIDER", function() { return _angular_material_sort__WEBPACK_IMPORTED_MODULE_29__["MAT_SORT_HEADER_INTL_PROVIDER"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSortBase", function() { return _angular_material_sort__WEBPACK_IMPORTED_MODULE_29__["MatSortBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatSortMixinBase", function() { return _angular_material_sort__WEBPACK_IMPORTED_MODULE_29__["_MatSortMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatSort", function() { return _angular_material_sort__WEBPACK_IMPORTED_MODULE_29__["MatSort"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matSortAnimations", function() { return _angular_material_sort__WEBPACK_IMPORTED_MODULE_29__["matSortAnimations"]; });
/* harmony import */ var _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @angular/material/stepper */ "./node_modules/@angular/material/esm5/stepper.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatStepperModule", function() { return _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__["MatStepperModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatStepLabel", function() { return _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__["MatStepLabel"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatStep", function() { return _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__["MatStep"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatStepper", function() { return _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__["MatStepper"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatHorizontalStepper", function() { return _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__["MatHorizontalStepper"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatVerticalStepper", function() { return _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__["MatVerticalStepper"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatStepperNext", function() { return _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__["MatStepperNext"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatStepperPrevious", function() { return _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__["MatStepperPrevious"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatStepHeader", function() { return _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__["MatStepHeader"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatStepperIntl", function() { return _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__["MatStepperIntl"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matStepperAnimations", function() { return _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__["matStepperAnimations"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatStepperIcon", function() { return _angular_material_stepper__WEBPACK_IMPORTED_MODULE_30__["MatStepperIcon"]; });
/* harmony import */ var _angular_material_table__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @angular/material/table */ "./node_modules/@angular/material/esm5/table.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTableModule", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatTableModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCellDef", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatCellDef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatHeaderCellDef", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatHeaderCellDef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatFooterCellDef", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatFooterCellDef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatColumnDef", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatColumnDef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatHeaderCell", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatHeaderCell"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatFooterCell", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatFooterCell"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatCell", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatCell"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTable", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatTable"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatHeaderRowDef", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatHeaderRowDef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatFooterRowDef", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatFooterRowDef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatRowDef", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatRowDef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatHeaderRow", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatHeaderRow"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatFooterRow", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatFooterRow"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatRow", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatRow"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTableDataSource", function() { return _angular_material_table__WEBPACK_IMPORTED_MODULE_31__["MatTableDataSource"]; });
/* harmony import */ var _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @angular/material/tabs */ "./node_modules/@angular/material/esm5/tabs.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵa23", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["ɵa23"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵf23", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["ɵf23"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵg23", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["ɵg23"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵb23", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["ɵb23"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵc23", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["ɵc23"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵd23", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["ɵd23"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵe23", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["ɵe23"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵj23", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["ɵj23"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵh23", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["ɵh23"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵk23", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["ɵk23"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵi23", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["ɵi23"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatInkBar", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatInkBar"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MAT_INK_BAR_POSITIONER", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["_MAT_INK_BAR_POSITIONER"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTabBody", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTabBody"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTabBodyPortal", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTabBodyPortal"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTabHeader", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTabHeader"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTabLabelWrapper", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTabLabelWrapper"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTab", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTab"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTabLabel", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTabLabel"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTabNav", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTabNav"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTabLink", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTabLink"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTabContent", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTabContent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTabsModule", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTabsModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTabChangeEvent", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTabChangeEvent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTabGroupBase", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTabGroupBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatTabGroupMixinBase", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["_MatTabGroupMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTabGroup", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["MatTabGroup"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matTabsAnimations", function() { return _angular_material_tabs__WEBPACK_IMPORTED_MODULE_32__["matTabsAnimations"]; });
/* harmony import */ var _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @angular/material/toolbar */ "./node_modules/@angular/material/esm5/toolbar.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatToolbarModule", function() { return _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_33__["MatToolbarModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatToolbarBase", function() { return _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_33__["MatToolbarBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatToolbarMixinBase", function() { return _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_33__["_MatToolbarMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatToolbarRow", function() { return _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_33__["MatToolbarRow"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatToolbar", function() { return _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_33__["MatToolbar"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwToolbarMixedModesError", function() { return _angular_material_toolbar__WEBPACK_IMPORTED_MODULE_33__["throwToolbarMixedModesError"]; });
/* harmony import */ var _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @angular/material/tooltip */ "./node_modules/@angular/material/esm5/tooltip.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTooltipModule", function() { return _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_34__["MatTooltipModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SCROLL_THROTTLE_MS", function() { return _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_34__["SCROLL_THROTTLE_MS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TOOLTIP_PANEL_CLASS", function() { return _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_34__["TOOLTIP_PANEL_CLASS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMatTooltipInvalidPositionError", function() { return _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_34__["getMatTooltipInvalidPositionError"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_TOOLTIP_SCROLL_STRATEGY", function() { return _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_34__["MAT_TOOLTIP_SCROLL_STRATEGY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY", function() { return _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_34__["MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_TOOLTIP_DEFAULT_OPTIONS", function() { return _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_34__["MAT_TOOLTIP_DEFAULT_OPTIONS"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY", function() { return _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_34__["MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTooltip", function() { return _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_34__["MatTooltip"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TooltipComponent", function() { return _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_34__["TooltipComponent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matTooltipAnimations", function() { return _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_34__["matTooltipAnimations"]; });
/* harmony import */ var _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! @angular/material/tree */ "./node_modules/@angular/material/esm5/tree.es5.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatTreeNodeMixinBase", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["_MatTreeNodeMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MatNestedTreeNodeMixinBase", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["_MatNestedTreeNodeMixinBase"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTreeNode", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["MatTreeNode"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTreeNodeDef", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["MatTreeNodeDef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatNestedTreeNode", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["MatNestedTreeNode"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTreeNodePadding", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["MatTreeNodePadding"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTree", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["MatTree"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTreeModule", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["MatTreeModule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTreeNodeToggle", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["MatTreeNodeToggle"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTreeNodeOutlet", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["MatTreeNodeOutlet"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTreeFlattener", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["MatTreeFlattener"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTreeFlatDataSource", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["MatTreeFlatDataSource"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MatTreeNestedDataSource", function() { return _angular_material_tree__WEBPACK_IMPORTED_MODULE_35__["MatTreeNestedDataSource"]; });
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Current version of Angular Material.
*/
var /** @type {?} */ VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Version"]('6.0.2');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=material.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/menu.es5.js":
/*!*********************************************************!*\
!*** ./node_modules/@angular/material/esm5/menu.es5.js ***!
\*********************************************************/
/*! exports provided: MAT_MENU_SCROLL_STRATEGY, MatMenuModule, MatMenu, MAT_MENU_DEFAULT_OPTIONS, MatMenuItem, MatMenuTrigger, matMenuAnimations, fadeInItems, transformMenu, MatMenuContent, ɵa24, ɵb24, ɵc24, ɵe24, ɵd24 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_MENU_SCROLL_STRATEGY", function() { return MAT_MENU_SCROLL_STRATEGY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatMenuModule", function() { return MatMenuModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatMenu", function() { return MatMenu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_MENU_DEFAULT_OPTIONS", function() { return MAT_MENU_DEFAULT_OPTIONS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatMenuItem", function() { return MatMenuItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatMenuTrigger", function() { return MatMenuTrigger; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matMenuAnimations", function() { return matMenuAnimations; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fadeInItems", function() { return fadeInItems; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMenu", function() { return transformMenu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatMenuContent", function() { return MatMenuContent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵa24", function() { return MAT_MENU_DEFAULT_OPTIONS_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵb24", function() { return MatMenuItemBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵc24", function() { return _MatMenuItemMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵe24", function() { return MAT_MENU_PANEL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵd24", function() { return MAT_MENU_SCROLL_STRATEGY_FACTORY; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/portal */ "./node_modules/@angular/cdk/esm5/portal.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/cdk/overlay */ "./node_modules/@angular/cdk/esm5/overlay.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Menu content that will be rendered lazily once the menu is opened.
*/
var MatMenuContent = /** @class */ (function () {
function MatMenuContent(_template, _componentFactoryResolver, _appRef, _injector, _viewContainerRef, _document) {
this._template = _template;
this._componentFactoryResolver = _componentFactoryResolver;
this._appRef = _appRef;
this._injector = _injector;
this._viewContainerRef = _viewContainerRef;
this._document = _document;
}
/**
* Attaches the content with a particular context.
* @docs-private
*/
/**
* Attaches the content with a particular context.
* \@docs-private
* @param {?=} context
* @return {?}
*/
MatMenuContent.prototype.attach = /**
* Attaches the content with a particular context.
* \@docs-private
* @param {?=} context
* @return {?}
*/
function (context) {
if (context === void 0) { context = {}; }
if (!this._portal) {
this._portal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_1__["TemplatePortal"](this._template, this._viewContainerRef);
}
this.detach();
if (!this._outlet) {
this._outlet = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_1__["DomPortalOutlet"](this._document.createElement('div'), this._componentFactoryResolver, this._appRef, this._injector);
}
var /** @type {?} */ element = this._template.elementRef.nativeElement; /** @type {?} */
((
// Because we support opening the same menu from different triggers (which in turn have their
// own `OverlayRef` panel), we have to re-insert the host element every time, otherwise we
// risk it staying attached to a pane that's no longer in the DOM.
element.parentNode)).insertBefore(this._outlet.outletElement, element);
this._portal.attach(this._outlet, context);
};
/**
* Detaches the content.
* @docs-private
*/
/**
* Detaches the content.
* \@docs-private
* @return {?}
*/
MatMenuContent.prototype.detach = /**
* Detaches the content.
* \@docs-private
* @return {?}
*/
function () {
if (this._portal.isAttached) {
this._portal.detach();
}
};
/**
* @return {?}
*/
MatMenuContent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this._outlet) {
this._outlet.dispose();
}
};
MatMenuContent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'ng-template[matMenuContent]'
},] },
];
/** @nocollapse */
MatMenuContent.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ComponentFactoryResolver"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ApplicationRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injector"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_2__["DOCUMENT"],] },] },
]; };
return MatMenuContent;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Animations used by the mat-menu component.
* Animation duration and timing values are based on:
* https://material.io/guidelines/components/menus.html#menus-usage
*/
var /** @type {?} */ matMenuAnimations = {
/**
* This animation controls the menu panel's entry and exit from the page.
*
* When the menu panel is added to the DOM, it scales in and fades in its border.
*
* When the menu panel is removed from the DOM, it simply fades out after a brief
* delay to display the ripple.
*/
transformMenu: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["trigger"])('transformMenu', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["state"])('void', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["style"])({
opacity: 0,
// This starts off from 0.01, instead of 0, because there's an issue in the Angular animations
// as of 4.2, which causes the animation to be skipped if it starts from 0.
transform: 'scale(0.01, 0.01)'
})),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["transition"])('void => enter', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["sequence"])([
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["query"])('.mat-menu-content', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["style"])({ opacity: 0 })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["animate"])('100ms linear', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["style"])({ opacity: 1, transform: 'scale(1, 0.5)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["group"])([
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["query"])('.mat-menu-content', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["animate"])('400ms cubic-bezier(0.55, 0, 0.55, 0.2)', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["style"])({ opacity: 1 }))),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["animate"])('300ms cubic-bezier(0.25, 0.8, 0.25, 1)', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["style"])({ transform: 'scale(1, 1)' })),
])
])),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["transition"])('* => void', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["animate"])('150ms 50ms linear', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["style"])({ opacity: 0 })))
]),
/**
* This animation fades in the background color and content of the menu panel
* after its containing element is scaled in.
*/
fadeInItems: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["trigger"])('fadeInItems', [
// TODO(crisbeto): this is inside the `transformMenu`
// now. Remove next time we do breaking changes.
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["state"])('showing', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["style"])({ opacity: 1 })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["transition"])('void => *', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["style"])({ opacity: 0 }),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_3__["animate"])('400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)')
])
])
};
/**
* @deprecated
* \@deletion-target 7.0.0
*/
var /** @type {?} */ fadeInItems = matMenuAnimations.fadeInItems;
/**
* @deprecated
* \@deletion-target 7.0.0
*/
var /** @type {?} */ transformMenu = matMenuAnimations.transformMenu;
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Throws an exception for the case when menu trigger doesn't have a valid mat-menu instance
* \@docs-private
* @return {?}
*/
function throwMatMenuMissingError() {
throw Error("mat-menu-trigger: must pass in an mat-menu instance.\n\n Example:\n <mat-menu #menu=\"matMenu\"></mat-menu>\n <button [matMenuTriggerFor]=\"menu\"></button>");
}
/**
* Throws an exception for the case when menu's x-position value isn't valid.
* In other words, it doesn't match 'before' or 'after'.
* \@docs-private
* @return {?}
*/
function throwMatMenuInvalidPositionX() {
throw Error("x-position value must be either 'before' or after'.\n Example: <mat-menu x-position=\"before\" #menu=\"matMenu\"></mat-menu>");
}
/**
* Throws an exception for the case when menu's y-position value isn't valid.
* In other words, it doesn't match 'above' or 'below'.
* \@docs-private
* @return {?}
*/
function throwMatMenuInvalidPositionY() {
throw Error("y-position value must be either 'above' or below'.\n Example: <mat-menu y-position=\"above\" #menu=\"matMenu\"></mat-menu>");
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token used to provide the parent menu to menu-specific components.
* \@docs-private
*/
var /** @type {?} */ MAT_MENU_PANEL = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('MAT_MENU_PANEL');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatMenuItemBase = /** @class */ (function () {
function MatMenuItemBase() {
}
return MatMenuItemBase;
}());
var /** @type {?} */ _MatMenuItemMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["mixinDisableRipple"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["mixinDisabled"])(MatMenuItemBase));
/**
* This directive is intended to be used inside an mat-menu tag.
* It exists mostly to set the role attribute.
*/
var MatMenuItem = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_4__["__extends"])(MatMenuItem, _super);
function MatMenuItem(_elementRef, document, _focusMonitor, _parentMenu) {
var _this =
// @deletion-target 7.0.0 make `_focusMonitor` and `document` required params.
_super.call(this) || this;
_this._elementRef = _elementRef;
_this._focusMonitor = _focusMonitor;
_this._parentMenu = _parentMenu;
/**
* Stream that emits when the menu item is hovered.
*/
_this._hovered = new rxjs__WEBPACK_IMPORTED_MODULE_7__["Subject"]();
/**
* Whether the menu item is highlighted.
*/
_this._highlighted = false;
/**
* Whether the menu item acts as a trigger for a sub-menu.
*/
_this._triggersSubmenu = false;
if (_focusMonitor) {
// Start monitoring the element so it gets the appropriate focused classes. We want
// to show the focus style for menu items only when the focus was not caused by a
// mouse or touch interaction.
_focusMonitor.monitor(_this._getHostElement(), false);
}
if (_parentMenu && _parentMenu.addItem) {
_parentMenu.addItem(_this);
}
_this._document = document;
return _this;
}
/** Focuses the menu item. */
/**
* Focuses the menu item.
* @param {?=} origin
* @return {?}
*/
MatMenuItem.prototype.focus = /**
* Focuses the menu item.
* @param {?=} origin
* @return {?}
*/
function (origin) {
if (origin === void 0) { origin = 'program'; }
if (this._focusMonitor) {
this._focusMonitor.focusVia(this._getHostElement(), origin);
}
else {
this._getHostElement().focus();
}
};
/**
* @return {?}
*/
MatMenuItem.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this._focusMonitor) {
this._focusMonitor.stopMonitoring(this._getHostElement());
}
if (this._parentMenu && this._parentMenu.removeItem) {
this._parentMenu.removeItem(this);
}
this._hovered.complete();
};
/** Used to set the `tabindex`. */
/**
* Used to set the `tabindex`.
* @return {?}
*/
MatMenuItem.prototype._getTabIndex = /**
* Used to set the `tabindex`.
* @return {?}
*/
function () {
return this.disabled ? '-1' : '0';
};
/** Returns the host DOM element. */
/**
* Returns the host DOM element.
* @return {?}
*/
MatMenuItem.prototype._getHostElement = /**
* Returns the host DOM element.
* @return {?}
*/
function () {
return this._elementRef.nativeElement;
};
/** Prevents the default element actions if it is disabled. */
/**
* Prevents the default element actions if it is disabled.
* @param {?} event
* @return {?}
*/
MatMenuItem.prototype._checkDisabled = /**
* Prevents the default element actions if it is disabled.
* @param {?} event
* @return {?}
*/
function (event) {
if (this.disabled) {
event.preventDefault();
event.stopPropagation();
}
};
/** Emits to the hover stream. */
/**
* Emits to the hover stream.
* @return {?}
*/
MatMenuItem.prototype._handleMouseEnter = /**
* Emits to the hover stream.
* @return {?}
*/
function () {
this._hovered.next(this);
};
/** Gets the label to be used when determining whether the option should be focused. */
/**
* Gets the label to be used when determining whether the option should be focused.
* @return {?}
*/
MatMenuItem.prototype.getLabel = /**
* Gets the label to be used when determining whether the option should be focused.
* @return {?}
*/
function () {
var /** @type {?} */ element = this._elementRef.nativeElement;
var /** @type {?} */ textNodeType = this._document ? this._document.TEXT_NODE : 3;
var /** @type {?} */ output = '';
if (element.childNodes) {
var /** @type {?} */ length_1 = element.childNodes.length;
// Go through all the top-level text nodes and extract their text.
// We skip anything that's not a text node to prevent the text from
// being thrown off by something like an icon.
for (var /** @type {?} */ i = 0; i < length_1; i++) {
if (element.childNodes[i].nodeType === textNodeType) {
output += element.childNodes[i].textContent;
}
}
}
return output.trim();
};
MatMenuItem.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: '[mat-menu-item]',
exportAs: 'matMenuItem',
inputs: ['disabled', 'disableRipple'],
host: {
'role': 'menuitem',
'class': 'mat-menu-item',
'[class.mat-menu-item-highlighted]': '_highlighted',
'[class.mat-menu-item-submenu-trigger]': '_triggersSubmenu',
'[attr.tabindex]': '_getTabIndex()',
'[attr.aria-disabled]': 'disabled.toString()',
'[attr.disabled]': 'disabled || null',
'(click)': '_checkDisabled($event)',
'(mouseenter)': '_handleMouseEnter()',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
template: "<ng-content></ng-content><div class=\"mat-menu-ripple\" matRipple [matRippleDisabled]=\"disableRipple || disabled\" [matRippleTrigger]=\"_getHostElement()\"></div>",
},] },
];
/** @nocollapse */
MatMenuItem.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_2__["DOCUMENT"],] },] },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_5__["FocusMonitor"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [MAT_MENU_PANEL,] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
return MatMenuItem;
}(_MatMenuItemMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token to be used to override the default options for `mat-menu`.
*/
var /** @type {?} */ MAT_MENU_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('mat-menu-default-options', {
providedIn: 'root',
factory: MAT_MENU_DEFAULT_OPTIONS_FACTORY
});
/**
* \@docs-private
* @return {?}
*/
function MAT_MENU_DEFAULT_OPTIONS_FACTORY() {
return {
overlapTrigger: true,
xPosition: 'after',
yPosition: 'below',
backdropClass: 'cdk-overlay-transparent-backdrop',
};
}
/**
* Start elevation for the menu panel.
* \@docs-private
*/
var /** @type {?} */ MAT_MENU_BASE_ELEVATION = 2;
var MatMenu = /** @class */ (function () {
function MatMenu(_elementRef, _ngZone, _defaultOptions) {
this._elementRef = _elementRef;
this._ngZone = _ngZone;
this._defaultOptions = _defaultOptions;
this._xPosition = this._defaultOptions.xPosition;
this._yPosition = this._defaultOptions.yPosition;
/**
* Menu items inside the current menu.
*/
this._items = [];
/**
* Emits whenever the amount of menu items changes.
*/
this._itemChanges = new rxjs__WEBPACK_IMPORTED_MODULE_7__["Subject"]();
/**
* Subscription to tab events on the menu panel
*/
this._tabSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__["Subscription"].EMPTY;
/**
* Config object to be passed into the menu's ngClass
*/
this._classList = {};
/**
* Current state of the panel animation.
*/
this._panelAnimationState = 'void';
/**
* Emits whenever an animation on the menu completes.
*/
this._animationDone = new rxjs__WEBPACK_IMPORTED_MODULE_7__["Subject"]();
/**
* Class to be added to the backdrop element.
*/
this.backdropClass = this._defaultOptions.backdropClass;
this._overlapTrigger = this._defaultOptions.overlapTrigger;
this._hasBackdrop = this._defaultOptions.hasBackdrop;
/**
* Event emitted when the menu is closed.
*/
this.closed = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when the menu is closed.
* @deprecated Switch to `closed` instead
* \@deletion-target 7.0.0
*/
this.close = this.closed;
}
Object.defineProperty(MatMenu.prototype, "xPosition", {
get: /**
* Position of the menu in the X axis.
* @return {?}
*/
function () { return this._xPosition; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (value !== 'before' && value !== 'after') {
throwMatMenuInvalidPositionX();
}
this._xPosition = value;
this.setPositionClasses();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatMenu.prototype, "yPosition", {
get: /**
* Position of the menu in the Y axis.
* @return {?}
*/
function () { return this._yPosition; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (value !== 'above' && value !== 'below') {
throwMatMenuInvalidPositionY();
}
this._yPosition = value;
this.setPositionClasses();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatMenu.prototype, "overlapTrigger", {
get: /**
* Whether the menu should overlap its trigger.
* @return {?}
*/
function () { return this._overlapTrigger; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._overlapTrigger = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_8__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatMenu.prototype, "hasBackdrop", {
get: /**
* Whether the menu has a backdrop.
* @return {?}
*/
function () { return this._hasBackdrop; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._hasBackdrop = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_8__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatMenu.prototype, "panelClass", {
set: /**
* This method takes classes set on the host mat-menu element and applies them on the
* menu template that displays in the overlay container. Otherwise, it's difficult
* to style the containing menu from outside the component.
* @param {?} classes list of class names
* @return {?}
*/
function (classes) {
if (classes && classes.length) {
this._classList = classes.split(' ').reduce(function (obj, className) {
obj[className] = true;
return obj;
}, {});
this._elementRef.nativeElement.className = '';
this.setPositionClasses();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatMenu.prototype, "classList", {
get: /**
* This method takes classes set on the host mat-menu element and applies them on the
* menu template that displays in the overlay container. Otherwise, it's difficult
* to style the containing menu from outside the component.
* @deprecated Use `panelClass` instead.
* \@deletion-target 7.0.0
* @return {?}
*/
function () { return this.panelClass; },
set: /**
* @param {?} classes
* @return {?}
*/
function (classes) { this.panelClass = classes; },
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatMenu.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this.setPositionClasses();
};
/**
* @return {?}
*/
MatMenu.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
this._keyManager = new _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_5__["FocusKeyManager"](this._items).withWrap().withTypeAhead();
this._tabSubscription = this._keyManager.tabOut.subscribe(function () { return _this.close.emit('tab'); });
};
/**
* @return {?}
*/
MatMenu.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._tabSubscription.unsubscribe();
this.closed.complete();
};
/** Stream that emits whenever the hovered menu item changes. */
/**
* Stream that emits whenever the hovered menu item changes.
* @return {?}
*/
MatMenu.prototype._hovered = /**
* Stream that emits whenever the hovered menu item changes.
* @return {?}
*/
function () {
return this._itemChanges.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["startWith"])(this._items), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["switchMap"])(function (items) { return rxjs__WEBPACK_IMPORTED_MODULE_7__["merge"].apply(void 0, items.map(function (item) { return item._hovered; })); }));
};
/** Handle a keyboard event from the menu, delegating to the appropriate action. */
/**
* Handle a keyboard event from the menu, delegating to the appropriate action.
* @param {?} event
* @return {?}
*/
MatMenu.prototype._handleKeydown = /**
* Handle a keyboard event from the menu, delegating to the appropriate action.
* @param {?} event
* @return {?}
*/
function (event) {
var /** @type {?} */ keyCode = event.keyCode;
switch (keyCode) {
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["ESCAPE"]:
this.closed.emit('keydown');
event.stopPropagation();
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["LEFT_ARROW"]:
if (this.parentMenu && this.direction === 'ltr') {
this.closed.emit('keydown');
}
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["RIGHT_ARROW"]:
if (this.parentMenu && this.direction === 'rtl') {
this.closed.emit('keydown');
}
break;
default:
if (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["UP_ARROW"] || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["DOWN_ARROW"]) {
this._keyManager.setFocusOrigin('keyboard');
}
this._keyManager.onKeydown(event);
}
};
/**
* Focus the first item in the menu.
* @param origin Action from which the focus originated. Used to set the correct styling.
*/
/**
* Focus the first item in the menu.
* @param {?=} origin Action from which the focus originated. Used to set the correct styling.
* @return {?}
*/
MatMenu.prototype.focusFirstItem = /**
* Focus the first item in the menu.
* @param {?=} origin Action from which the focus originated. Used to set the correct styling.
* @return {?}
*/
function (origin) {
var _this = this;
if (origin === void 0) { origin = 'program'; }
// When the content is rendered lazily, it takes a bit before the items are inside the DOM.
if (this.lazyContent) {
this._ngZone.onStable.asObservable()
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["take"])(1))
.subscribe(function () { return _this._keyManager.setFocusOrigin(origin).setFirstItemActive(); });
}
else {
this._keyManager.setFocusOrigin(origin).setFirstItemActive();
}
};
/**
* Resets the active item in the menu. This is used when the menu is opened, allowing
* the user to start from the first option when pressing the down arrow.
*/
/**
* Resets the active item in the menu. This is used when the menu is opened, allowing
* the user to start from the first option when pressing the down arrow.
* @return {?}
*/
MatMenu.prototype.resetActiveItem = /**
* Resets the active item in the menu. This is used when the menu is opened, allowing
* the user to start from the first option when pressing the down arrow.
* @return {?}
*/
function () {
this._keyManager.setActiveItem(-1);
};
/**
* It's necessary to set position-based classes to ensure the menu panel animation
* folds out from the correct direction.
*/
/**
* It's necessary to set position-based classes to ensure the menu panel animation
* folds out from the correct direction.
* @param {?=} posX
* @param {?=} posY
* @return {?}
*/
MatMenu.prototype.setPositionClasses = /**
* It's necessary to set position-based classes to ensure the menu panel animation
* folds out from the correct direction.
* @param {?=} posX
* @param {?=} posY
* @return {?}
*/
function (posX, posY) {
if (posX === void 0) { posX = this.xPosition; }
if (posY === void 0) { posY = this.yPosition; }
this._classList['mat-menu-before'] = posX === 'before';
this._classList['mat-menu-after'] = posX === 'after';
this._classList['mat-menu-above'] = posY === 'above';
this._classList['mat-menu-below'] = posY === 'below';
};
/**
* Sets the menu panel elevation.
* @param depth Number of parent menus that come before the menu.
*/
/**
* Sets the menu panel elevation.
* @param {?} depth Number of parent menus that come before the menu.
* @return {?}
*/
MatMenu.prototype.setElevation = /**
* Sets the menu panel elevation.
* @param {?} depth Number of parent menus that come before the menu.
* @return {?}
*/
function (depth) {
// The elevation starts at the base and increases by one for each level.
var /** @type {?} */ newElevation = "mat-elevation-z" + (MAT_MENU_BASE_ELEVATION + depth);
var /** @type {?} */ customElevation = Object.keys(this._classList).find(function (c) { return c.startsWith('mat-elevation-z'); });
if (!customElevation || customElevation === this._previousElevation) {
if (this._previousElevation) {
this._classList[this._previousElevation] = false;
}
this._classList[newElevation] = true;
this._previousElevation = newElevation;
}
};
/**
* Registers a menu item with the menu.
* @docs-private
*/
/**
* Registers a menu item with the menu.
* \@docs-private
* @param {?} item
* @return {?}
*/
MatMenu.prototype.addItem = /**
* Registers a menu item with the menu.
* \@docs-private
* @param {?} item
* @return {?}
*/
function (item) {
// We register the items through this method, rather than picking them up through
// `ContentChildren`, because we need the items to be picked up by their closest
// `mat-menu` ancestor. If we used `@ContentChildren(MatMenuItem, {descendants: true})`,
// all descendant items will bleed into the top-level menu in the case where the consumer
// has `mat-menu` instances nested inside each other.
if (this._items.indexOf(item) === -1) {
this._items.push(item);
this._itemChanges.next(this._items);
}
};
/**
* Removes an item from the menu.
* @docs-private
*/
/**
* Removes an item from the menu.
* \@docs-private
* @param {?} item
* @return {?}
*/
MatMenu.prototype.removeItem = /**
* Removes an item from the menu.
* \@docs-private
* @param {?} item
* @return {?}
*/
function (item) {
var /** @type {?} */ index = this._items.indexOf(item);
if (this._items.indexOf(item) > -1) {
this._items.splice(index, 1);
this._itemChanges.next(this._items);
}
};
/** Starts the enter animation. */
/**
* Starts the enter animation.
* @return {?}
*/
MatMenu.prototype._startAnimation = /**
* Starts the enter animation.
* @return {?}
*/
function () {
// @deletion-target 7.0.0 Combine with _resetAnimation.
this._panelAnimationState = 'enter';
};
/** Resets the panel animation to its initial state. */
/**
* Resets the panel animation to its initial state.
* @return {?}
*/
MatMenu.prototype._resetAnimation = /**
* Resets the panel animation to its initial state.
* @return {?}
*/
function () {
// @deletion-target 7.0.0 Combine with _startAnimation.
this._panelAnimationState = 'void';
};
/** Callback that is invoked when the panel animation completes. */
/**
* Callback that is invoked when the panel animation completes.
* @param {?} event
* @return {?}
*/
MatMenu.prototype._onAnimationDone = /**
* Callback that is invoked when the panel animation completes.
* @param {?} event
* @return {?}
*/
function (event) {
this._animationDone.next(event);
this._isAnimating = false;
};
MatMenu.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-menu',
template: "<ng-template><div class=\"mat-menu-panel\" [ngClass]=\"_classList\" (keydown)=\"_handleKeydown($event)\" (click)=\"closed.emit('click')\" [@transformMenu]=\"_panelAnimationState\" (@transformMenu.start)=\"_isAnimating = true\" (@transformMenu.done)=\"_onAnimationDone($event)\" tabindex=\"-1\" role=\"menu\"><div class=\"mat-menu-content\"><ng-content></ng-content></div></div></ng-template>",
styles: [".mat-menu-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;max-height:calc(100vh - 48px);border-radius:2px;outline:0}.mat-menu-panel:not([class*=mat-elevation-z]){box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mat-menu-panel.mat-menu-after.mat-menu-below{transform-origin:left top}.mat-menu-panel.mat-menu-after.mat-menu-above{transform-origin:left bottom}.mat-menu-panel.mat-menu-before.mat-menu-below{transform-origin:right top}.mat-menu-panel.mat-menu-before.mat-menu-above{transform-origin:right bottom}[dir=rtl] .mat-menu-panel.mat-menu-after.mat-menu-below{transform-origin:right top}[dir=rtl] .mat-menu-panel.mat-menu-after.mat-menu-above{transform-origin:right bottom}[dir=rtl] .mat-menu-panel.mat-menu-before.mat-menu-below{transform-origin:left top}[dir=rtl] .mat-menu-panel.mat-menu-before.mat-menu-above{transform-origin:left bottom}@media screen and (-ms-high-contrast:active){.mat-menu-panel{outline:solid 1px}}.mat-menu-content{padding-top:8px;padding-bottom:8px}.mat-menu-item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;position:relative}.mat-menu-item[disabled]{cursor:default}[dir=rtl] .mat-menu-item{text-align:right}.mat-menu-item .mat-icon{margin-right:16px;vertical-align:middle}.mat-menu-item .mat-icon svg{vertical-align:top}[dir=rtl] .mat-menu-item .mat-icon{margin-left:16px;margin-right:0}.mat-menu-item-submenu-trigger{padding-right:32px}.mat-menu-item-submenu-trigger::after{width:0;height:0;border-style:solid;border-width:5px 0 5px 5px;border-color:transparent transparent transparent currentColor;content:'';display:inline-block;position:absolute;top:50%;right:16px;transform:translateY(-50%)}[dir=rtl] .mat-menu-item-submenu-trigger{padding-right:16px;padding-left:32px}[dir=rtl] .mat-menu-item-submenu-trigger::after{right:auto;left:16px;transform:rotateY(180deg) translateY(-50%)}.mat-menu-panel.ng-animating .mat-menu-item-submenu-trigger{pointer-events:none}button.mat-menu-item{width:100%}.mat-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}"],
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
exportAs: 'matMenu',
animations: [
matMenuAnimations.transformMenu,
matMenuAnimations.fadeInItems
],
providers: [
{ provide: MAT_MENU_PANEL, useExisting: MatMenu }
]
},] },
];
/** @nocollapse */
MatMenu.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [MAT_MENU_DEFAULT_OPTIONS,] },] },
]; };
MatMenu.propDecorators = {
"backdropClass": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"xPosition": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"yPosition": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"templateRef": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"],] },],
"items": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [MatMenuItem,] },],
"lazyContent": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChild"], args: [MatMenuContent,] },],
"overlapTrigger": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"hasBackdrop": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"panelClass": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['class',] },],
"classList": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"closed": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"close": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
return MatMenu;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token that determines the scroll handling while the menu is open.
*/
var /** @type {?} */ MAT_MENU_SCROLL_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('mat-menu-scroll-strategy', {
providedIn: 'root',
factory: MAT_MENU_SCROLL_STRATEGY_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function MAT_MENU_SCROLL_STRATEGY_FACTORY() {
var /** @type {?} */ overlay = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["inject"])(_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_12__["Overlay"]);
return function () { return overlay.scrollStrategies.reposition(); };
}
/**
* Default top padding of the menu panel.
*/
var /** @type {?} */ MENU_PANEL_TOP_PADDING = 8;
/**
* This directive is intended to be used in conjunction with an mat-menu tag. It is
* responsible for toggling the display of the provided menu instance.
*/
var MatMenuTrigger = /** @class */ (function () {
function MatMenuTrigger(_overlay, _element, _viewContainerRef, _scrollStrategy, _parentMenu, _menuItemInstance, _dir, _focusMonitor) {
this._overlay = _overlay;
this._element = _element;
this._viewContainerRef = _viewContainerRef;
this._scrollStrategy = _scrollStrategy;
this._parentMenu = _parentMenu;
this._menuItemInstance = _menuItemInstance;
this._dir = _dir;
this._focusMonitor = _focusMonitor;
this._overlayRef = null;
this._menuOpen = false;
this._closeSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__["Subscription"].EMPTY;
this._hoverSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__["Subscription"].EMPTY;
this._openedByMouse = false;
/**
* Event emitted when the associated menu is opened.
*/
this.menuOpened = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when the associated menu is opened.
* @deprecated Switch to `menuOpened` instead
* \@deletion-target 7.0.0
*/
this.onMenuOpen = this.menuOpened;
/**
* Event emitted when the associated menu is closed.
*/
this.menuClosed = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when the associated menu is closed.
* @deprecated Switch to `menuClosed` instead
* \@deletion-target 7.0.0
*/
this.onMenuClose = this.menuClosed;
if (_menuItemInstance) {
_menuItemInstance._triggersSubmenu = this.triggersSubmenu();
}
}
Object.defineProperty(MatMenuTrigger.prototype, "_deprecatedMatMenuTriggerFor", {
get: /**
* @deprecated
* \@deletion-target 7.0.0
* @return {?}
*/
function () {
return this.menu;
},
set: /**
* @param {?} v
* @return {?}
*/
function (v) {
this.menu = v;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatMenuTrigger.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
this._checkMenu();
this.menu.close.subscribe(function (reason) {
_this._destroyMenu();
// If a click closed the menu, we should close the entire chain of nested menus.
if ((reason === 'click' || reason === 'tab') && _this._parentMenu) {
_this._parentMenu.closed.emit(reason);
}
});
this._handleHover();
};
/**
* @return {?}
*/
MatMenuTrigger.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this._overlayRef) {
this._overlayRef.dispose();
this._overlayRef = null;
}
this._cleanUpSubscriptions();
};
Object.defineProperty(MatMenuTrigger.prototype, "menuOpen", {
/** Whether the menu is open. */
get: /**
* Whether the menu is open.
* @return {?}
*/
function () {
return this._menuOpen;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatMenuTrigger.prototype, "dir", {
/** The text direction of the containing app. */
get: /**
* The text direction of the containing app.
* @return {?}
*/
function () {
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
},
enumerable: true,
configurable: true
});
/** Whether the menu triggers a sub-menu or a top-level one. */
/**
* Whether the menu triggers a sub-menu or a top-level one.
* @return {?}
*/
MatMenuTrigger.prototype.triggersSubmenu = /**
* Whether the menu triggers a sub-menu or a top-level one.
* @return {?}
*/
function () {
return !!(this._menuItemInstance && this._parentMenu);
};
/** Toggles the menu between the open and closed states. */
/**
* Toggles the menu between the open and closed states.
* @return {?}
*/
MatMenuTrigger.prototype.toggleMenu = /**
* Toggles the menu between the open and closed states.
* @return {?}
*/
function () {
return this._menuOpen ? this.closeMenu() : this.openMenu();
};
/** Opens the menu. */
/**
* Opens the menu.
* @return {?}
*/
MatMenuTrigger.prototype.openMenu = /**
* Opens the menu.
* @return {?}
*/
function () {
var _this = this;
if (this._menuOpen) {
return;
}
var /** @type {?} */ overlayRef = this._createOverlay();
overlayRef.setDirection(this.dir);
overlayRef.attach(this._portal);
if (this.menu.lazyContent) {
this.menu.lazyContent.attach(this.menuData);
}
this._closeSubscription = this._menuClosingActions().subscribe(function () { return _this.closeMenu(); });
this._initMenu();
if (this.menu instanceof MatMenu) {
this.menu._startAnimation();
}
};
/** Closes the menu. */
/**
* Closes the menu.
* @return {?}
*/
MatMenuTrigger.prototype.closeMenu = /**
* Closes the menu.
* @return {?}
*/
function () {
this.menu.close.emit();
};
/**
* Focuses the menu trigger.
* @param origin Source of the menu trigger's focus.
*/
/**
* Focuses the menu trigger.
* @param {?=} origin Source of the menu trigger's focus.
* @return {?}
*/
MatMenuTrigger.prototype.focus = /**
* Focuses the menu trigger.
* @param {?=} origin Source of the menu trigger's focus.
* @return {?}
*/
function (origin) {
if (origin === void 0) { origin = 'program'; }
if (this._focusMonitor) {
this._focusMonitor.focusVia(this._element.nativeElement, origin);
}
else {
this._element.nativeElement.focus();
}
};
/**
* Closes the menu and does the necessary cleanup.
* @return {?}
*/
MatMenuTrigger.prototype._destroyMenu = /**
* Closes the menu and does the necessary cleanup.
* @return {?}
*/
function () {
if (!this._overlayRef || !this.menuOpen) {
return;
}
var /** @type {?} */ menu = this.menu;
this._resetMenu();
this._closeSubscription.unsubscribe();
this._overlayRef.detach();
if (menu instanceof MatMenu) {
menu._resetAnimation();
if (menu.lazyContent) {
// Wait for the exit animation to finish before detaching the content.
menu._animationDone
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["take"])(1))
.subscribe(function () { return ((menu.lazyContent)).detach(); });
}
}
else if (menu.lazyContent) {
menu.lazyContent.detach();
}
};
/**
* This method sets the menu state to open and focuses the first item if
* the menu was opened via the keyboard.
* @return {?}
*/
MatMenuTrigger.prototype._initMenu = /**
* This method sets the menu state to open and focuses the first item if
* the menu was opened via the keyboard.
* @return {?}
*/
function () {
this.menu.parentMenu = this.triggersSubmenu() ? this._parentMenu : undefined;
this.menu.direction = this.dir;
this._setMenuElevation();
this._setIsMenuOpen(true);
this.menu.focusFirstItem(this._openedByMouse ? 'mouse' : 'program');
};
/**
* Updates the menu elevation based on the amount of parent menus that it has.
* @return {?}
*/
MatMenuTrigger.prototype._setMenuElevation = /**
* Updates the menu elevation based on the amount of parent menus that it has.
* @return {?}
*/
function () {
if (this.menu.setElevation) {
var /** @type {?} */ depth = 0;
var /** @type {?} */ parentMenu = this.menu.parentMenu;
while (parentMenu) {
depth++;
parentMenu = parentMenu.parentMenu;
}
this.menu.setElevation(depth);
}
};
/**
* This method resets the menu when it's closed, most importantly restoring
* focus to the menu trigger if the menu was opened via the keyboard.
* @return {?}
*/
MatMenuTrigger.prototype._resetMenu = /**
* This method resets the menu when it's closed, most importantly restoring
* focus to the menu trigger if the menu was opened via the keyboard.
* @return {?}
*/
function () {
this._setIsMenuOpen(false);
// We should reset focus if the user is navigating using a keyboard or
// if we have a top-level trigger which might cause focus to be lost
// when clicking on the backdrop.
if (!this._openedByMouse) {
// Note that the focus style will show up both for `program` and
// `keyboard` so we don't have to specify which one it is.
this.focus();
}
else if (!this.triggersSubmenu()) {
this.focus('mouse');
}
this._openedByMouse = false;
};
/**
* @param {?} isOpen
* @return {?}
*/
MatMenuTrigger.prototype._setIsMenuOpen = /**
* @param {?} isOpen
* @return {?}
*/
function (isOpen) {
this._menuOpen = isOpen;
this._menuOpen ? this.menuOpened.emit() : this.menuClosed.emit();
if (this.triggersSubmenu()) {
this._menuItemInstance._highlighted = isOpen;
}
};
/**
* This method checks that a valid instance of MatMenu has been passed into
* matMenuTriggerFor. If not, an exception is thrown.
* @return {?}
*/
MatMenuTrigger.prototype._checkMenu = /**
* This method checks that a valid instance of MatMenu has been passed into
* matMenuTriggerFor. If not, an exception is thrown.
* @return {?}
*/
function () {
if (!this.menu) {
throwMatMenuMissingError();
}
};
/**
* This method creates the overlay from the provided menu's template and saves its
* OverlayRef so that it can be attached to the DOM when openMenu is called.
* @return {?}
*/
MatMenuTrigger.prototype._createOverlay = /**
* This method creates the overlay from the provided menu's template and saves its
* OverlayRef so that it can be attached to the DOM when openMenu is called.
* @return {?}
*/
function () {
if (!this._overlayRef) {
this._portal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_1__["TemplatePortal"](this.menu.templateRef, this._viewContainerRef);
var /** @type {?} */ config = this._getOverlayConfig();
this._subscribeToPositions(/** @type {?} */ (config.positionStrategy));
this._overlayRef = this._overlay.create(config);
}
return this._overlayRef;
};
/**
* This method builds the configuration object needed to create the overlay, the OverlayState.
* @return {?} OverlayConfig
*/
MatMenuTrigger.prototype._getOverlayConfig = /**
* This method builds the configuration object needed to create the overlay, the OverlayState.
* @return {?} OverlayConfig
*/
function () {
return new _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_12__["OverlayConfig"]({
positionStrategy: this._getPosition(),
hasBackdrop: this.menu.hasBackdrop == null ? !this.triggersSubmenu() : this.menu.hasBackdrop,
backdropClass: this.menu.backdropClass || 'cdk-overlay-transparent-backdrop',
scrollStrategy: this._scrollStrategy()
});
};
/**
* Listens to changes in the position of the overlay and sets the correct classes
* on the menu based on the new position. This ensures the animation origin is always
* correct, even if a fallback position is used for the overlay.
* @param {?} position
* @return {?}
*/
MatMenuTrigger.prototype._subscribeToPositions = /**
* Listens to changes in the position of the overlay and sets the correct classes
* on the menu based on the new position. This ensures the animation origin is always
* correct, even if a fallback position is used for the overlay.
* @param {?} position
* @return {?}
*/
function (position) {
var _this = this;
position.positionChanges.subscribe(function (change) {
var /** @type {?} */ posX = change.connectionPair.overlayX === 'start' ? 'after' : 'before';
var /** @type {?} */ posY = change.connectionPair.overlayY === 'top' ? 'below' : 'above';
_this.menu.setPositionClasses(posX, posY);
});
};
/**
* This method builds the position strategy for the overlay, so the menu is properly connected
* to the trigger.
* @return {?} ConnectedPositionStrategy
*/
MatMenuTrigger.prototype._getPosition = /**
* This method builds the position strategy for the overlay, so the menu is properly connected
* to the trigger.
* @return {?} ConnectedPositionStrategy
*/
function () {
var _a = this.menu.xPosition === 'before' ? ['end', 'start'] : ['start', 'end'], originX = _a[0], originFallbackX = _a[1];
var _b = this.menu.yPosition === 'above' ? ['bottom', 'top'] : ['top', 'bottom'], overlayY = _b[0], overlayFallbackY = _b[1];
var _c = [overlayY, overlayFallbackY], originY = _c[0], originFallbackY = _c[1];
var _d = [originX, originFallbackX], overlayX = _d[0], overlayFallbackX = _d[1];
var /** @type {?} */ offsetY = 0;
if (this.triggersSubmenu()) {
// When the menu is a sub-menu, it should always align itself
// to the edges of the trigger, instead of overlapping it.
overlayFallbackX = originX = this.menu.xPosition === 'before' ? 'start' : 'end';
originFallbackX = overlayX = originX === 'end' ? 'start' : 'end';
offsetY = overlayY === 'bottom' ? MENU_PANEL_TOP_PADDING : -MENU_PANEL_TOP_PADDING;
}
else if (!this.menu.overlapTrigger) {
originY = overlayY === 'top' ? 'bottom' : 'top';
originFallbackY = overlayFallbackY === 'top' ? 'bottom' : 'top';
}
return this._overlay.position()
.flexibleConnectedTo(this._element)
.withPositions([
{ originX: originX, originY: originY, overlayX: overlayX, overlayY: overlayY, offsetY: offsetY },
{ originX: originFallbackX, originY: originY, overlayX: overlayFallbackX, overlayY: overlayY, offsetY: offsetY },
{
originX: originX,
originY: originFallbackY,
overlayX: overlayX,
overlayY: overlayFallbackY,
offsetY: -offsetY
},
{
originX: originFallbackX,
originY: originFallbackY,
overlayX: overlayFallbackX,
overlayY: overlayFallbackY,
offsetY: -offsetY
}
]);
};
/**
* Cleans up the active subscriptions.
* @return {?}
*/
MatMenuTrigger.prototype._cleanUpSubscriptions = /**
* Cleans up the active subscriptions.
* @return {?}
*/
function () {
this._closeSubscription.unsubscribe();
this._hoverSubscription.unsubscribe();
};
/**
* Returns a stream that emits whenever an action that should close the menu occurs.
* @return {?}
*/
MatMenuTrigger.prototype._menuClosingActions = /**
* Returns a stream that emits whenever an action that should close the menu occurs.
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ backdrop = /** @type {?} */ ((this._overlayRef)).backdropClick();
var /** @type {?} */ detachments = /** @type {?} */ ((this._overlayRef)).detachments();
var /** @type {?} */ parentClose = this._parentMenu ? this._parentMenu.close : Object(rxjs__WEBPACK_IMPORTED_MODULE_7__["of"])();
var /** @type {?} */ hover = this._parentMenu ? this._parentMenu._hovered().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["filter"])(function (active) { return active !== _this._menuItemInstance; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["filter"])(function () { return _this._menuOpen; })) : Object(rxjs__WEBPACK_IMPORTED_MODULE_7__["of"])();
return Object(rxjs__WEBPACK_IMPORTED_MODULE_7__["merge"])(backdrop, parentClose, hover, detachments);
};
/** Handles mouse presses on the trigger. */
/**
* Handles mouse presses on the trigger.
* @param {?} event
* @return {?}
*/
MatMenuTrigger.prototype._handleMousedown = /**
* Handles mouse presses on the trigger.
* @param {?} event
* @return {?}
*/
function (event) {
if (!Object(_angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_5__["isFakeMousedownFromScreenReader"])(event)) {
this._openedByMouse = true;
// Since clicking on the trigger won't close the menu if it opens a sub-menu,
// we should prevent focus from moving onto it via click to avoid the
// highlight from lingering on the menu item.
if (this.triggersSubmenu()) {
event.preventDefault();
}
}
};
/** Handles key presses on the trigger. */
/**
* Handles key presses on the trigger.
* @param {?} event
* @return {?}
*/
MatMenuTrigger.prototype._handleKeydown = /**
* Handles key presses on the trigger.
* @param {?} event
* @return {?}
*/
function (event) {
var /** @type {?} */ keyCode = event.keyCode;
if (this.triggersSubmenu() && ((keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["RIGHT_ARROW"] && this.dir === 'ltr') ||
(keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["LEFT_ARROW"] && this.dir === 'rtl'))) {
this.openMenu();
}
};
/** Handles click events on the trigger. */
/**
* Handles click events on the trigger.
* @param {?} event
* @return {?}
*/
MatMenuTrigger.prototype._handleClick = /**
* Handles click events on the trigger.
* @param {?} event
* @return {?}
*/
function (event) {
if (this.triggersSubmenu()) {
// Stop event propagation to avoid closing the parent menu.
event.stopPropagation();
this.openMenu();
}
else {
this.toggleMenu();
}
};
/**
* Handles the cases where the user hovers over the trigger.
* @return {?}
*/
MatMenuTrigger.prototype._handleHover = /**
* Handles the cases where the user hovers over the trigger.
* @return {?}
*/
function () {
var _this = this;
// Subscribe to changes in the hovered item in order to toggle the panel.
if (!this.triggersSubmenu()) {
return;
}
this._hoverSubscription = this._parentMenu._hovered()
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["filter"])(function (active) { return active === _this._menuItemInstance && !active.disabled; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["delay"])(0, rxjs__WEBPACK_IMPORTED_MODULE_7__["asapScheduler"]))
.subscribe(function () {
_this._openedByMouse = true;
// If the same menu is used between multiple triggers, it might still be animating
// while the new trigger tries to re-open it. Wait for the animation to finish
// before doing so. Also interrupt if the user moves to another item.
if (_this.menu instanceof MatMenu && _this.menu._isAnimating) {
_this.menu._animationDone
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["take"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["takeUntil"])(_this._parentMenu._hovered()))
.subscribe(function () { return _this.openMenu(); });
}
else {
_this.openMenu();
}
});
};
MatMenuTrigger.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: "[mat-menu-trigger-for], [matMenuTriggerFor]",
host: {
'aria-haspopup': 'true',
'(mousedown)': '_handleMousedown($event)',
'(keydown)': '_handleKeydown($event)',
'(click)': '_handleClick($event)',
},
exportAs: 'matMenuTrigger'
},] },
];
/** @nocollapse */
MatMenuTrigger.ctorParameters = function () { return [
{ type: _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_12__["Overlay"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [MAT_MENU_SCROLL_STRATEGY,] },] },
{ type: MatMenu, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: MatMenuItem, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] },] },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_11__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_5__["FocusMonitor"], },
]; };
MatMenuTrigger.propDecorators = {
"_deprecatedMatMenuTriggerFor": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['mat-menu-trigger-for',] },],
"menu": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matMenuTriggerFor',] },],
"menuData": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matMenuTriggerData',] },],
"menuOpened": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"onMenuOpen": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"menuClosed": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"onMenuClose": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
return MatMenuTrigger;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatMenuModule = /** @class */ (function () {
function MatMenuModule() {
}
MatMenuModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["MatCommonModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["MatRippleModule"],
_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_12__["OverlayModule"],
],
exports: [MatMenu, MatMenuItem, MatMenuTrigger, MatMenuContent, _angular_material_core__WEBPACK_IMPORTED_MODULE_6__["MatCommonModule"]],
declarations: [MatMenu, MatMenuItem, MatMenuTrigger, MatMenuContent],
},] },
];
return MatMenuModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=menu.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/paginator.es5.js":
/*!**************************************************************!*\
!*** ./node_modules/@angular/material/esm5/paginator.es5.js ***!
\**************************************************************/
/*! exports provided: MatPaginatorModule, PageEvent, MatPaginatorBase, _MatPaginatorBase, MatPaginator, MatPaginatorIntl, MAT_PAGINATOR_INTL_PROVIDER_FACTORY, MAT_PAGINATOR_INTL_PROVIDER */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatPaginatorModule", function() { return MatPaginatorModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageEvent", function() { return PageEvent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatPaginatorBase", function() { return MatPaginatorBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatPaginatorBase", function() { return _MatPaginatorBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatPaginator", function() { return MatPaginator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatPaginatorIntl", function() { return MatPaginatorIntl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_PAGINATOR_INTL_PROVIDER_FACTORY", function() { return MAT_PAGINATOR_INTL_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_PAGINATOR_INTL_PROVIDER", function() { return MAT_PAGINATOR_INTL_PROVIDER; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/button */ "./node_modules/@angular/material/esm5/button.es5.js");
/* harmony import */ var _angular_material_select__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/select */ "./node_modules/@angular/material/esm5/select.es5.js");
/* harmony import */ var _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/tooltip */ "./node_modules/@angular/material/esm5/tooltip.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* To modify the labels and text displayed, create a new instance of MatPaginatorIntl and
* include it in a custom provider
*/
var MatPaginatorIntl = /** @class */ (function () {
function MatPaginatorIntl() {
/**
* Stream that emits whenever the labels here are changed. Use this to notify
* components if the labels have changed after initialization.
*/
this.changes = new rxjs__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
/**
* A label for the page size selector.
*/
this.itemsPerPageLabel = 'Items per page:';
/**
* A label for the button that increments the current page.
*/
this.nextPageLabel = 'Next page';
/**
* A label for the button that decrements the current page.
*/
this.previousPageLabel = 'Previous page';
/**
* A label for the button that moves to the first page.
*/
this.firstPageLabel = 'First page';
/**
* A label for the button that moves to the last page.
*/
this.lastPageLabel = 'Last page';
/**
* A label for the range of items within the current page and the length of the whole list.
*/
this.getRangeLabel = function (page, pageSize, length) {
if (length == 0 || pageSize == 0) {
return "0 of " + length;
}
length = Math.max(length, 0);
var /** @type {?} */ startIndex = page * pageSize;
// If the start index exceeds the list length, do not try and fix the end index to the end.
var /** @type {?} */ endIndex = startIndex < length ?
Math.min(startIndex + pageSize, length) :
startIndex + pageSize;
return startIndex + 1 + " - " + endIndex + " of " + length;
};
}
MatPaginatorIntl.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */ MatPaginatorIntl.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["defineInjectable"])({ factory: function MatPaginatorIntl_Factory() { return new MatPaginatorIntl(); }, token: MatPaginatorIntl, providedIn: "root" });
return MatPaginatorIntl;
}());
/**
* \@docs-private
* @param {?} parentIntl
* @return {?}
*/
function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl) {
return parentIntl || new MatPaginatorIntl();
}
/**
* \@docs-private
*/
var /** @type {?} */ MAT_PAGINATOR_INTL_PROVIDER = {
// If there is already an MatPaginatorIntl available, use that. Otherwise, provide a new one.
provide: MatPaginatorIntl,
deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"](), MatPaginatorIntl]],
useFactory: MAT_PAGINATOR_INTL_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* The default page size if there is no page size and there are no provided page size options.
*/
var /** @type {?} */ DEFAULT_PAGE_SIZE = 50;
/**
* Change event object that is emitted when the user selects a
* different page size or navigates to another page.
*/
var /**
* Change event object that is emitted when the user selects a
* different page size or navigates to another page.
*/
PageEvent = /** @class */ (function () {
function PageEvent() {
}
return PageEvent;
}());
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatPaginatorBase = /** @class */ (function () {
function MatPaginatorBase() {
}
return MatPaginatorBase;
}());
var /** @type {?} */ _MatPaginatorBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_4__["mixinInitialized"])(MatPaginatorBase);
/**
* Component to provide navigation between paged information. Displays the size of the current
* page, user-selectable options to change that size, what items are being shown, and
* navigational button to go to the previous or next page.
*/
var MatPaginator = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(MatPaginator, _super);
function MatPaginator(_intl, _changeDetectorRef) {
var _this = _super.call(this) || this;
_this._intl = _intl;
_this._changeDetectorRef = _changeDetectorRef;
_this._pageIndex = 0;
_this._length = 0;
_this._pageSizeOptions = [];
_this._hidePageSize = false;
_this._showFirstLastButtons = false;
/**
* Event emitted when the paginator changes the page size or page index.
*/
_this.page = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
_this._intlChanges = _intl.changes.subscribe(function () { return _this._changeDetectorRef.markForCheck(); });
return _this;
}
Object.defineProperty(MatPaginator.prototype, "pageIndex", {
get: /**
* The zero-based page index of the displayed list of items. Defaulted to 0.
* @return {?}
*/
function () { return this._pageIndex; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._pageIndex = Math.max(Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceNumberProperty"])(value), 0);
this._changeDetectorRef.markForCheck();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatPaginator.prototype, "length", {
get: /**
* The length of the total number of items that are being paginated. Defaulted to 0.
* @return {?}
*/
function () { return this._length; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._length = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceNumberProperty"])(value);
this._changeDetectorRef.markForCheck();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatPaginator.prototype, "pageSize", {
get: /**
* Number of items to display on a page. By default set to 50.
* @return {?}
*/
function () { return this._pageSize; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._pageSize = Math.max(Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceNumberProperty"])(value), 0);
this._updateDisplayedPageSizeOptions();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatPaginator.prototype, "pageSizeOptions", {
get: /**
* The set of provided page size options to display to the user.
* @return {?}
*/
function () { return this._pageSizeOptions; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._pageSizeOptions = (value || []).map(function (p) { return Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceNumberProperty"])(p); });
this._updateDisplayedPageSizeOptions();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatPaginator.prototype, "hidePageSize", {
get: /**
* Whether to hide the page size selection UI from the user.
* @return {?}
*/
function () { return this._hidePageSize; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._hidePageSize = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatPaginator.prototype, "showFirstLastButtons", {
get: /**
* Whether to show the first/last buttons UI to the user.
* @return {?}
*/
function () { return this._showFirstLastButtons; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._showFirstLastButtons = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatPaginator.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._initialized = true;
this._updateDisplayedPageSizeOptions();
this._markInitialized();
};
/**
* @return {?}
*/
MatPaginator.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._intlChanges.unsubscribe();
};
/** Advances to the next page if it exists. */
/**
* Advances to the next page if it exists.
* @return {?}
*/
MatPaginator.prototype.nextPage = /**
* Advances to the next page if it exists.
* @return {?}
*/
function () {
if (!this.hasNextPage()) {
return;
}
var /** @type {?} */ previousPageIndex = this.pageIndex;
this.pageIndex++;
this._emitPageEvent(previousPageIndex);
};
/** Move back to the previous page if it exists. */
/**
* Move back to the previous page if it exists.
* @return {?}
*/
MatPaginator.prototype.previousPage = /**
* Move back to the previous page if it exists.
* @return {?}
*/
function () {
if (!this.hasPreviousPage()) {
return;
}
var /** @type {?} */ previousPageIndex = this.pageIndex;
this.pageIndex--;
this._emitPageEvent(previousPageIndex);
};
/** Move to the first page if not already there. */
/**
* Move to the first page if not already there.
* @return {?}
*/
MatPaginator.prototype.firstPage = /**
* Move to the first page if not already there.
* @return {?}
*/
function () {
// hasPreviousPage being false implies at the start
if (!this.hasPreviousPage()) {
return;
}
var /** @type {?} */ previousPageIndex = this.pageIndex;
this.pageIndex = 0;
this._emitPageEvent(previousPageIndex);
};
/** Move to the last page if not already there. */
/**
* Move to the last page if not already there.
* @return {?}
*/
MatPaginator.prototype.lastPage = /**
* Move to the last page if not already there.
* @return {?}
*/
function () {
// hasNextPage being false implies at the end
if (!this.hasNextPage()) {
return;
}
var /** @type {?} */ previousPageIndex = this.pageIndex;
this.pageIndex = this.getNumberOfPages();
this._emitPageEvent(previousPageIndex);
};
/** Whether there is a previous page. */
/**
* Whether there is a previous page.
* @return {?}
*/
MatPaginator.prototype.hasPreviousPage = /**
* Whether there is a previous page.
* @return {?}
*/
function () {
return this.pageIndex >= 1 && this.pageSize != 0;
};
/** Whether there is a next page. */
/**
* Whether there is a next page.
* @return {?}
*/
MatPaginator.prototype.hasNextPage = /**
* Whether there is a next page.
* @return {?}
*/
function () {
var /** @type {?} */ numberOfPages = this.getNumberOfPages();
return this.pageIndex < numberOfPages && this.pageSize != 0;
};
/** Calculate the number of pages */
/**
* Calculate the number of pages
* @return {?}
*/
MatPaginator.prototype.getNumberOfPages = /**
* Calculate the number of pages
* @return {?}
*/
function () {
return Math.ceil(this.length / this.pageSize) - 1;
};
/**
* Changes the page size so that the first item displayed on the page will still be
* displayed using the new page size.
*
* For example, if the page size is 10 and on the second page (items indexed 10-19) then
* switching so that the page size is 5 will set the third page as the current page so
* that the 10th item will still be displayed.
*/
/**
* Changes the page size so that the first item displayed on the page will still be
* displayed using the new page size.
*
* For example, if the page size is 10 and on the second page (items indexed 10-19) then
* switching so that the page size is 5 will set the third page as the current page so
* that the 10th item will still be displayed.
* @param {?} pageSize
* @return {?}
*/
MatPaginator.prototype._changePageSize = /**
* Changes the page size so that the first item displayed on the page will still be
* displayed using the new page size.
*
* For example, if the page size is 10 and on the second page (items indexed 10-19) then
* switching so that the page size is 5 will set the third page as the current page so
* that the 10th item will still be displayed.
* @param {?} pageSize
* @return {?}
*/
function (pageSize) {
// Current page needs to be updated to reflect the new page size. Navigate to the page
// containing the previous page's first item.
var /** @type {?} */ startIndex = this.pageIndex * this.pageSize;
var /** @type {?} */ previousPageIndex = this.pageIndex;
this.pageIndex = Math.floor(startIndex / pageSize) || 0;
this.pageSize = pageSize;
this._emitPageEvent(previousPageIndex);
};
/**
* Updates the list of page size options to display to the user. Includes making sure that
* the page size is an option and that the list is sorted.
* @return {?}
*/
MatPaginator.prototype._updateDisplayedPageSizeOptions = /**
* Updates the list of page size options to display to the user. Includes making sure that
* the page size is an option and that the list is sorted.
* @return {?}
*/
function () {
if (!this._initialized) {
return;
}
// If no page size is provided, use the first page size option or the default page size.
if (!this.pageSize) {
this._pageSize = this.pageSizeOptions.length != 0 ?
this.pageSizeOptions[0] :
DEFAULT_PAGE_SIZE;
}
this._displayedPageSizeOptions = this.pageSizeOptions.slice();
if (this._displayedPageSizeOptions.indexOf(this.pageSize) === -1) {
this._displayedPageSizeOptions.push(this.pageSize);
}
// Sort the numbers using a number-specific sort function.
this._displayedPageSizeOptions.sort(function (a, b) { return a - b; });
this._changeDetectorRef.markForCheck();
};
/**
* Emits an event notifying that a change of the paginator's properties has been triggered.
* @param {?} previousPageIndex
* @return {?}
*/
MatPaginator.prototype._emitPageEvent = /**
* Emits an event notifying that a change of the paginator's properties has been triggered.
* @param {?} previousPageIndex
* @return {?}
*/
function (previousPageIndex) {
this.page.emit({
previousPageIndex: previousPageIndex,
pageIndex: this.pageIndex,
pageSize: this.pageSize,
length: this.length
});
};
MatPaginator.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-paginator',
exportAs: 'matPaginator',
template: "<div class=\"mat-paginator-container\"><div class=\"mat-paginator-page-size\" *ngIf=\"!hidePageSize\"><div class=\"mat-paginator-page-size-label\">{{_intl.itemsPerPageLabel}}</div><mat-form-field *ngIf=\"_displayedPageSizeOptions.length > 1\" class=\"mat-paginator-page-size-select\"><mat-select [value]=\"pageSize\" [aria-label]=\"_intl.itemsPerPageLabel\" (selectionChange)=\"_changePageSize($event.value)\"><mat-option *ngFor=\"let pageSizeOption of _displayedPageSizeOptions\" [value]=\"pageSizeOption\">{{pageSizeOption}}</mat-option></mat-select></mat-form-field><div *ngIf=\"_displayedPageSizeOptions.length <= 1\">{{pageSize}}</div></div><div class=\"mat-paginator-range-actions\"><div class=\"mat-paginator-range-label\">{{_intl.getRangeLabel(pageIndex, pageSize, length)}}</div><button mat-icon-button type=\"button\" class=\"mat-paginator-navigation-first\" (click)=\"firstPage()\" [attr.aria-label]=\"_intl.firstPageLabel\" [matTooltip]=\"_intl.firstPageLabel\" [matTooltipPosition]=\"'above'\" [disabled]=\"!hasPreviousPage()\" *ngIf=\"showFirstLastButtons\"><svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z\"/></svg></button> <button mat-icon-button type=\"button\" class=\"mat-paginator-navigation-previous\" (click)=\"previousPage()\" [attr.aria-label]=\"_intl.previousPageLabel\" [matTooltip]=\"_intl.previousPageLabel\" [matTooltipPosition]=\"'above'\" [disabled]=\"!hasPreviousPage()\"><svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/></svg></button> <button mat-icon-button type=\"button\" class=\"mat-paginator-navigation-next\" (click)=\"nextPage()\" [attr.aria-label]=\"_intl.nextPageLabel\" [matTooltip]=\"_intl.nextPageLabel\" [matTooltipPosition]=\"'above'\" [disabled]=\"!hasNextPage()\"><svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"/></svg></button> <button mat-icon-button type=\"button\" class=\"mat-paginator-navigation-last\" (click)=\"lastPage()\" [attr.aria-label]=\"_intl.lastPageLabel\" [matTooltip]=\"_intl.lastPageLabel\" [matTooltipPosition]=\"'above'\" [disabled]=\"!hasNextPage()\" *ngIf=\"showFirstLastButtons\"><svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z\"/></svg></button></div></div>",
styles: [".mat-paginator{display:block}.mat-paginator-container{display:flex;align-items:center;justify-content:flex-end;min-height:56px;padding:0 8px;flex-wrap:wrap-reverse}.mat-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-paginator-page-size{margin-right:0;margin-left:8px}.mat-paginator-page-size-label{margin:0 4px}.mat-paginator-page-size-select{margin:6px 4px 0 4px;width:56px}.mat-paginator-range-label{margin:0 32px 0 24px}.mat-paginator-range-actions{display:flex;align-items:center;min-height:48px}.mat-paginator-icon{width:28px;fill:currentColor}[dir=rtl] .mat-paginator-icon{transform:rotate(180deg)}"],
host: {
'class': 'mat-paginator',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatPaginator.ctorParameters = function () { return [
{ type: MatPaginatorIntl, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
]; };
MatPaginator.propDecorators = {
"pageIndex": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"length": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"pageSize": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"pageSizeOptions": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"hidePageSize": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"showFirstLastButtons": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"page": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
return MatPaginator;
}(_MatPaginatorBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatPaginatorModule = /** @class */ (function () {
function MatPaginatorModule() {
}
MatPaginatorModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_5__["CommonModule"],
_angular_material_button__WEBPACK_IMPORTED_MODULE_6__["MatButtonModule"],
_angular_material_select__WEBPACK_IMPORTED_MODULE_7__["MatSelectModule"],
_angular_material_tooltip__WEBPACK_IMPORTED_MODULE_8__["MatTooltipModule"],
],
exports: [MatPaginator],
declarations: [MatPaginator],
providers: [MAT_PAGINATOR_INTL_PROVIDER],
},] },
];
return MatPaginatorModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=paginator.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/progress-bar.es5.js":
/*!*****************************************************************!*\
!*** ./node_modules/@angular/material/esm5/progress-bar.es5.js ***!
\*****************************************************************/
/*! exports provided: MatProgressBarModule, MatProgressBarBase, _MatProgressBarMixinBase, MatProgressBar */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatProgressBarModule", function() { return MatProgressBarModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatProgressBarBase", function() { return MatProgressBarBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatProgressBarMixinBase", function() { return _MatProgressBarMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatProgressBar", function() { return MatProgressBar; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatProgressBarBase = /** @class */ (function () {
function MatProgressBarBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatProgressBarBase;
}());
var /** @type {?} */ _MatProgressBarMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["mixinColor"])(MatProgressBarBase, 'primary');
/**
* Counter used to generate unique IDs for progress bars.
*/
var /** @type {?} */ progressbarId = 0;
/**
* `<mat-progress-bar>` component.
*/
var MatProgressBar = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatProgressBar, _super);
function MatProgressBar(_elementRef) {
var _this = _super.call(this, _elementRef) || this;
_this._elementRef = _elementRef;
_this._value = 0;
_this._bufferValue = 0;
/**
* Mode of the progress bar.
*
* Input must be one of these values: determinate, indeterminate, buffer, query, defaults to
* 'determinate'.
* Mirrored to mode attribute.
*/
_this.mode = 'determinate';
/**
* The id of the progress bar.
*/
_this.progressbarId = "mat-progress-bar-" + progressbarId++;
return _this;
}
Object.defineProperty(MatProgressBar.prototype, "value", {
get: /**
* Value of the progress bar. Defaults to zero. Mirrored to aria-valuenow.
* @return {?}
*/
function () { return this._value; },
set: /**
* @param {?} v
* @return {?}
*/
function (v) { this._value = clamp(v || 0); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatProgressBar.prototype, "bufferValue", {
get: /**
* Buffer value of the progress bar. Defaults to zero.
* @return {?}
*/
function () { return this._bufferValue; },
set: /**
* @param {?} v
* @return {?}
*/
function (v) { this._bufferValue = clamp(v || 0); },
enumerable: true,
configurable: true
});
/** Gets the current transform value for the progress bar's primary indicator. */
/**
* Gets the current transform value for the progress bar's primary indicator.
* @return {?}
*/
MatProgressBar.prototype._primaryTransform = /**
* Gets the current transform value for the progress bar's primary indicator.
* @return {?}
*/
function () {
var /** @type {?} */ scale = this.value / 100;
return { transform: "scaleX(" + scale + ")" };
};
/**
* Gets the current transform value for the progress bar's buffer indicator. Only used if the
* progress mode is set to buffer, otherwise returns an undefined, causing no transformation.
*/
/**
* Gets the current transform value for the progress bar's buffer indicator. Only used if the
* progress mode is set to buffer, otherwise returns an undefined, causing no transformation.
* @return {?}
*/
MatProgressBar.prototype._bufferTransform = /**
* Gets the current transform value for the progress bar's buffer indicator. Only used if the
* progress mode is set to buffer, otherwise returns an undefined, causing no transformation.
* @return {?}
*/
function () {
if (this.mode === 'buffer') {
var /** @type {?} */ scale = this.bufferValue / 100;
return { transform: "scaleX(" + scale + ")" };
}
};
MatProgressBar.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-progress-bar',
exportAs: 'matProgressBar',
host: {
'role': 'progressbar',
'aria-valuemin': '0',
'aria-valuemax': '100',
'[attr.aria-valuenow]': 'value',
'[attr.mode]': 'mode',
'class': 'mat-progress-bar',
},
inputs: ['color'],
template: "<svg width=\"100%\" height=\"5\" focusable=\"false\" class=\"mat-progress-bar-background mat-progress-bar-element\"><defs><pattern [id]=\"progressbarId\" x=\"5\" y=\"0\" width=\"10\" height=\"5\" patternUnits=\"userSpaceOnUse\"><circle cx=\"2.5\" cy=\"2.5\" r=\"2.5\"/></pattern></defs><rect [attr.fill]=\"'url(#' + progressbarId + ')'\" width=\"100%\" height=\"100%\"/></svg><div class=\"mat-progress-bar-buffer mat-progress-bar-element\" [ngStyle]=\"_bufferTransform()\"></div><div class=\"mat-progress-bar-primary mat-progress-bar-fill mat-progress-bar-element\" [ngStyle]=\"_primaryTransform()\"></div><div class=\"mat-progress-bar-secondary mat-progress-bar-fill mat-progress-bar-element\"></div>",
styles: [".mat-progress-bar{display:block;height:5px;overflow:hidden;position:relative;transition:opacity 250ms linear;width:100%}.mat-progress-bar .mat-progress-bar-element,.mat-progress-bar .mat-progress-bar-fill::after{height:100%;position:absolute;width:100%}.mat-progress-bar .mat-progress-bar-background{width:calc(100% + 10px)}.mat-progress-bar .mat-progress-bar-buffer{transform-origin:top left;transition:transform 250ms ease}.mat-progress-bar .mat-progress-bar-secondary{display:none}.mat-progress-bar .mat-progress-bar-fill{animation:none;transform-origin:top left;transition:transform 250ms ease}.mat-progress-bar .mat-progress-bar-fill::after{animation:none;content:'';display:inline-block;left:0}.mat-progress-bar[dir=rtl],[dir=rtl] .mat-progress-bar{transform:rotateY(180deg)}.mat-progress-bar[mode=query]{transform:rotateZ(180deg)}.mat-progress-bar[mode=query][dir=rtl],[dir=rtl] .mat-progress-bar[mode=query]{transform:rotateZ(180deg) rotateY(180deg)}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-fill,.mat-progress-bar[mode=query] .mat-progress-bar-fill{transition:none}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-primary,.mat-progress-bar[mode=query] .mat-progress-bar-primary{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-primary-indeterminate-translate 2s infinite linear;left:-145.166611%}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-primary.mat-progress-bar-fill::after,.mat-progress-bar[mode=query] .mat-progress-bar-primary.mat-progress-bar-fill::after{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-primary-indeterminate-scale 2s infinite linear}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-secondary,.mat-progress-bar[mode=query] .mat-progress-bar-secondary{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-secondary-indeterminate-translate 2s infinite linear;left:-54.888891%;display:block}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-secondary.mat-progress-bar-fill::after,.mat-progress-bar[mode=query] .mat-progress-bar-secondary.mat-progress-bar-fill::after{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-secondary-indeterminate-scale 2s infinite linear}.mat-progress-bar[mode=buffer] .mat-progress-bar-background{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-background-scroll 250ms infinite linear}@keyframes mat-progress-bar-primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(.5,0,.70173,.49582);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(.30244,.38135,.55,.95635);transform:translateX(83.67142%)}100%{transform:translateX(200.61106%)}}@keyframes mat-progress-bar-primary-indeterminate-scale{0%{transform:scaleX(.08)}36.65%{animation-timing-function:cubic-bezier(.33473,.12482,.78584,1);transform:scaleX(.08)}69.15%{animation-timing-function:cubic-bezier(.06,.11,.6,1);transform:scaleX(.66148)}100%{transform:scaleX(.08)}}@keyframes mat-progress-bar-secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(.15,0,.51506,.40969);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(.31033,.28406,.8,.73371);transform:translateX(37.65191%)}48.35%{animation-timing-function:cubic-bezier(.4,.62704,.6,.90203);transform:translateX(84.38617%)}100%{transform:translateX(160.27778%)}}@keyframes mat-progress-bar-secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(.15,0,.51506,.40969);transform:scaleX(.08)}19.15%{animation-timing-function:cubic-bezier(.31033,.28406,.8,.73371);transform:scaleX(.4571)}44.15%{animation-timing-function:cubic-bezier(.4,.62704,.6,.90203);transform:scaleX(.72796)}100%{transform:scaleX(.08)}}@keyframes mat-progress-bar-background-scroll{to{transform:translateX(-10px)}}"],
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatProgressBar.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
]; };
MatProgressBar.propDecorators = {
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"bufferValue": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"mode": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
};
return MatProgressBar;
}(_MatProgressBarMixinBase));
/**
* Clamps a value to be between two numbers, by default 0 and 100.
* @param {?} v
* @param {?=} min
* @param {?=} max
* @return {?}
*/
function clamp(v, min, max) {
if (min === void 0) { min = 0; }
if (max === void 0) { max = 100; }
return Math.max(min, Math.min(max, v));
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatProgressBarModule = /** @class */ (function () {
function MatProgressBarModule() {
}
MatProgressBarModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["CommonModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatCommonModule"]],
exports: [MatProgressBar, _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatCommonModule"]],
declarations: [MatProgressBar],
},] },
];
return MatProgressBarModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=progress-bar.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/progress-spinner.es5.js":
/*!*********************************************************************!*\
!*** ./node_modules/@angular/material/esm5/progress-spinner.es5.js ***!
\*********************************************************************/
/*! exports provided: MatProgressSpinnerModule, MatProgressSpinnerBase, _MatProgressSpinnerMixinBase, MatProgressSpinner, MatSpinner */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatProgressSpinnerModule", function() { return MatProgressSpinnerModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatProgressSpinnerBase", function() { return MatProgressSpinnerBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatProgressSpinnerMixinBase", function() { return _MatProgressSpinnerMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatProgressSpinner", function() { return MatProgressSpinner; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSpinner", function() { return MatSpinner; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Base reference size of the spinner.
* \@docs-private
*/
var /** @type {?} */ BASE_SIZE = 100;
/**
* Base reference stroke width of the spinner.
* \@docs-private
*/
var /** @type {?} */ BASE_STROKE_WIDTH = 10;
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatProgressSpinnerBase = /** @class */ (function () {
function MatProgressSpinnerBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatProgressSpinnerBase;
}());
var /** @type {?} */ _MatProgressSpinnerMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["mixinColor"])(MatProgressSpinnerBase, 'primary');
// .0001 percentage difference is necessary in order to avoid unwanted animation frames
// for example because the animation duration is 4 seconds, .1% accounts to 4ms
// which are enough to see the flicker described in
// https://github.com/angular/material2/issues/8984
var /** @type {?} */ INDETERMINATE_ANIMATION_TEMPLATE = "\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n";
/**
* `<mat-progress-spinner>` component.
*/
var MatProgressSpinner = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatProgressSpinner, _super);
function MatProgressSpinner(_elementRef, platform, _document) {
var _this = _super.call(this, _elementRef) || this;
_this._elementRef = _elementRef;
_this._document = _document;
_this._value = 0;
_this._fallbackAnimation = false;
_this._diameter = BASE_SIZE;
/**
* Mode of the progress circle
*/
_this.mode = 'determinate';
_this._fallbackAnimation = platform.EDGE || platform.TRIDENT;
// On IE and Edge, we can't animate the `stroke-dashoffset`
// reliably so we fall back to a non-spec animation.
var /** @type {?} */ animationClass = "mat-progress-spinner-indeterminate" + (_this._fallbackAnimation ? '-fallback' : '') + "-animation";
_elementRef.nativeElement.classList.add(animationClass);
return _this;
}
Object.defineProperty(MatProgressSpinner.prototype, "diameter", {
get: /**
* The diameter of the progress spinner (will set width and height of svg).
* @return {?}
*/
function () { return this._diameter; },
set: /**
* @param {?} size
* @return {?}
*/
function (size) {
this._diameter = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__["coerceNumberProperty"])(size);
if (!this._fallbackAnimation && !MatProgressSpinner.diameters.has(this._diameter)) {
this._attachStyleNode();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatProgressSpinner.prototype, "strokeWidth", {
get: /**
* Stroke width of the progress spinner.
* @return {?}
*/
function () {
return this._strokeWidth || this.diameter / 10;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._strokeWidth = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__["coerceNumberProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatProgressSpinner.prototype, "value", {
get: /**
* Value of the progress circle.
* @return {?}
*/
function () {
return this.mode === 'determinate' ? this._value : 0;
},
set: /**
* @param {?} newValue
* @return {?}
*/
function (newValue) {
this._value = Math.max(0, Math.min(100, Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__["coerceNumberProperty"])(newValue)));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatProgressSpinner.prototype, "_circleRadius", {
/** The radius of the spinner, adjusted for stroke width. */
get: /**
* The radius of the spinner, adjusted for stroke width.
* @return {?}
*/
function () {
return (this.diameter - BASE_STROKE_WIDTH) / 2;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatProgressSpinner.prototype, "_viewBox", {
/** The view box of the spinner's svg element. */
get: /**
* The view box of the spinner's svg element.
* @return {?}
*/
function () {
var /** @type {?} */ viewBox = this._circleRadius * 2 + this.strokeWidth;
return "0 0 " + viewBox + " " + viewBox;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatProgressSpinner.prototype, "_strokeCircumference", {
/** The stroke circumference of the svg circle. */
get: /**
* The stroke circumference of the svg circle.
* @return {?}
*/
function () {
return 2 * Math.PI * this._circleRadius;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatProgressSpinner.prototype, "_strokeDashOffset", {
/** The dash offset of the svg circle. */
get: /**
* The dash offset of the svg circle.
* @return {?}
*/
function () {
if (this.mode === 'determinate') {
return this._strokeCircumference * (100 - this._value) / 100;
}
// In fallback mode set the circle to 80% and rotate it with CSS.
if (this._fallbackAnimation && this.mode === 'indeterminate') {
return this._strokeCircumference * 0.2;
}
return null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatProgressSpinner.prototype, "_circleStrokeWidth", {
/** Stroke width of the circle in percent. */
get: /**
* Stroke width of the circle in percent.
* @return {?}
*/
function () {
return this.strokeWidth / this.diameter * 100;
},
enumerable: true,
configurable: true
});
/**
* Dynamically generates a style tag containing the correct animation for this diameter.
* @return {?}
*/
MatProgressSpinner.prototype._attachStyleNode = /**
* Dynamically generates a style tag containing the correct animation for this diameter.
* @return {?}
*/
function () {
var /** @type {?} */ styleTag = MatProgressSpinner.styleTag;
if (!styleTag) {
styleTag = this._document.createElement('style');
this._document.head.appendChild(styleTag);
MatProgressSpinner.styleTag = styleTag;
}
if (styleTag && styleTag.sheet) {
(/** @type {?} */ (styleTag.sheet)).insertRule(this._getAnimationText(), 0);
}
MatProgressSpinner.diameters.add(this.diameter);
};
/**
* Generates animation styles adjusted for the spinner's diameter.
* @return {?}
*/
MatProgressSpinner.prototype._getAnimationText = /**
* Generates animation styles adjusted for the spinner's diameter.
* @return {?}
*/
function () {
return INDETERMINATE_ANIMATION_TEMPLATE
.replace(/START_VALUE/g, "" + 0.95 * this._strokeCircumference)
.replace(/END_VALUE/g, "" + 0.2 * this._strokeCircumference)
.replace(/DIAMETER/g, "" + this.diameter);
};
/**
* Tracks diameters of existing instances to de-dupe generated styles (default d = 100)
*/
MatProgressSpinner.diameters = new Set([BASE_SIZE]);
/**
* Used for storing all of the generated keyframe animations.
* \@dynamic
*/
MatProgressSpinner.styleTag = null;
MatProgressSpinner.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-progress-spinner',
exportAs: 'matProgressSpinner',
host: {
'role': 'progressbar',
'class': 'mat-progress-spinner',
'[style.width.px]': 'diameter',
'[style.height.px]': 'diameter',
'[attr.aria-valuemin]': 'mode === "determinate" ? 0 : null',
'[attr.aria-valuemax]': 'mode === "determinate" ? 100 : null',
'[attr.aria-valuenow]': 'value',
'[attr.mode]': 'mode',
},
inputs: ['color'],
template: "<svg [style.width.px]=\"diameter\" [style.height.px]=\"diameter\" [attr.viewBox]=\"_viewBox\" preserveAspectRatio=\"xMidYMid meet\" focusable=\"false\"><circle cx=\"50%\" cy=\"50%\" [attr.r]=\"_circleRadius\" [style.animation-name]=\"'mat-progress-spinner-stroke-rotate-' + diameter\" [style.stroke-dashoffset.px]=\"_strokeDashOffset\" [style.stroke-dasharray.px]=\"_strokeCircumference\" [style.stroke-width.%]=\"_circleStrokeWidth\"></circle></svg>",
styles: [".mat-progress-spinner{display:block;position:relative}.mat-progress-spinner svg{position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center;overflow:visible}.mat-progress-spinner circle{fill:transparent;transform-origin:center;transition:stroke-dashoffset 225ms linear}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate]{animation:mat-progress-spinner-linear-rotate 2s linear infinite}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition-property:stroke;animation-duration:4s;animation-timing-function:cubic-bezier(.35,0,.25,1);animation-iteration-count:infinite}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate]{animation:mat-progress-spinner-stroke-rotate-fallback 10s cubic-bezier(.87,.03,.33,1) infinite}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}@keyframes mat-progress-spinner-linear-rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.60617px;transform:rotate(0)}12.5%{stroke-dashoffset:56.54867px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.60617px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.54867px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.60617px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.54867px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.60617px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.54867px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}"],
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatProgressSpinner.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_3__["Platform"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_4__["DOCUMENT"],] },] },
]; };
MatProgressSpinner.propDecorators = {
"diameter": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"strokeWidth": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"mode": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
};
return MatProgressSpinner;
}(_MatProgressSpinnerMixinBase));
/**
* `<mat-spinner>` component.
*
* This is a component definition to be used as a convenience reference to create an
* indeterminate `<mat-progress-spinner>` instance.
*/
var MatSpinner = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatSpinner, _super);
function MatSpinner(elementRef, platform, document) {
var _this = _super.call(this, elementRef, platform, document) || this;
_this.mode = 'indeterminate';
return _this;
}
MatSpinner.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-spinner',
host: {
'role': 'progressbar',
'mode': 'indeterminate',
'class': 'mat-spinner mat-progress-spinner',
'[style.width.px]': 'diameter',
'[style.height.px]': 'diameter',
},
inputs: ['color'],
template: "<svg [style.width.px]=\"diameter\" [style.height.px]=\"diameter\" [attr.viewBox]=\"_viewBox\" preserveAspectRatio=\"xMidYMid meet\" focusable=\"false\"><circle cx=\"50%\" cy=\"50%\" [attr.r]=\"_circleRadius\" [style.animation-name]=\"'mat-progress-spinner-stroke-rotate-' + diameter\" [style.stroke-dashoffset.px]=\"_strokeDashOffset\" [style.stroke-dasharray.px]=\"_strokeCircumference\" [style.stroke-width.%]=\"_circleStrokeWidth\"></circle></svg>",
styles: [".mat-progress-spinner{display:block;position:relative}.mat-progress-spinner svg{position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center;overflow:visible}.mat-progress-spinner circle{fill:transparent;transform-origin:center;transition:stroke-dashoffset 225ms linear}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate]{animation:mat-progress-spinner-linear-rotate 2s linear infinite}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition-property:stroke;animation-duration:4s;animation-timing-function:cubic-bezier(.35,0,.25,1);animation-iteration-count:infinite}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate]{animation:mat-progress-spinner-stroke-rotate-fallback 10s cubic-bezier(.87,.03,.33,1) infinite}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}@keyframes mat-progress-spinner-linear-rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.60617px;transform:rotate(0)}12.5%{stroke-dashoffset:56.54867px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.60617px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.54867px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.60617px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.54867px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.60617px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.54867px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}"],
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatSpinner.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_3__["Platform"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_4__["DOCUMENT"],] },] },
]; };
return MatSpinner;
}(MatProgressSpinner));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatProgressSpinnerModule = /** @class */ (function () {
function MatProgressSpinnerModule() {
}
MatProgressSpinnerModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatCommonModule"]],
exports: [
MatProgressSpinner,
MatSpinner,
_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatCommonModule"]
],
declarations: [
MatProgressSpinner,
MatSpinner
],
},] },
];
return MatProgressSpinnerModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=progress-spinner.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/radio.es5.js":
/*!**********************************************************!*\
!*** ./node_modules/@angular/material/esm5/radio.es5.js ***!
\**********************************************************/
/*! exports provided: MatRadioModule, MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, MatRadioChange, MatRadioGroupBase, _MatRadioGroupMixinBase, MatRadioGroup, MatRadioButtonBase, _MatRadioButtonMixinBase, MatRadioButton */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatRadioModule", function() { return MatRadioModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR", function() { return MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatRadioChange", function() { return MatRadioChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatRadioGroupBase", function() { return MatRadioGroupBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatRadioGroupMixinBase", function() { return _MatRadioGroupMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatRadioGroup", function() { return MatRadioGroup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatRadioButtonBase", function() { return MatRadioButtonBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatRadioButtonMixinBase", function() { return _MatRadioButtonMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatRadioButton", function() { return MatRadioButton; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm5/collections.es5.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
// Increasing integer for generating unique ids for radio components.
var /** @type {?} */ nextUniqueId = 0;
/**
* Provider Expression that allows mat-radio-group to register as a ControlValueAccessor. This
* allows it to support [(ngModel)] and ngControl.
* \@docs-private
*/
var /** @type {?} */ MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {
provide: _angular_forms__WEBPACK_IMPORTED_MODULE_5__["NG_VALUE_ACCESSOR"],
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_4__["forwardRef"])(function () { return MatRadioGroup; }),
multi: true
};
/**
* Change event object emitted by MatRadio and MatRadioGroup.
*/
var /**
* Change event object emitted by MatRadio and MatRadioGroup.
*/
MatRadioChange = /** @class */ (function () {
function MatRadioChange(source, value) {
this.source = source;
this.value = value;
}
return MatRadioChange;
}());
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatRadioGroupBase = /** @class */ (function () {
function MatRadioGroupBase() {
}
return MatRadioGroupBase;
}());
var /** @type {?} */ _MatRadioGroupMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["mixinDisabled"])(MatRadioGroupBase);
/**
* A group of radio buttons. May contain one or more `<mat-radio-button>` elements.
*/
var MatRadioGroup = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatRadioGroup, _super);
function MatRadioGroup(_changeDetector) {
var _this = _super.call(this) || this;
_this._changeDetector = _changeDetector;
/**
* Selected value for group. Should equal the value of the selected radio button if there *is*
* a corresponding radio button with a matching value. If there is *not* such a corresponding
* radio button, this value persists to be applied in case a new radio button is added with a
* matching value.
*/
_this._value = null;
/**
* The HTML name attribute applied to radio buttons in this group.
*/
_this._name = "mat-radio-group-" + nextUniqueId++;
/**
* The currently selected radio button. Should match value.
*/
_this._selected = null;
/**
* Whether the `value` has been set to its initial value.
*/
_this._isInitialized = false;
/**
* Whether the labels should appear after or before the radio-buttons. Defaults to 'after'
*/
_this._labelPosition = 'after';
/**
* Whether the radio group is disabled.
*/
_this._disabled = false;
/**
* Whether the radio group is required.
*/
_this._required = false;
/**
* The method to be called in order to update ngModel
*/
_this._controlValueAccessorChangeFn = function () { };
/**
* onTouch function registered via registerOnTouch (ControlValueAccessor).
* \@docs-private
*/
_this.onTouched = function () { };
/**
* Event emitted when the group value changes.
* Change events are only emitted when the value changes due to user interaction with
* a radio button (the same behavior as `<input type-"radio">`).
*/
_this.change = new _angular_core__WEBPACK_IMPORTED_MODULE_4__["EventEmitter"]();
return _this;
}
Object.defineProperty(MatRadioGroup.prototype, "name", {
get: /**
* Name of the radio button group. All radio buttons inside this group will use this name.
* @return {?}
*/
function () { return this._name; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._name = value;
this._updateRadioButtonNames();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatRadioGroup.prototype, "labelPosition", {
get: /**
* Whether the labels should appear after or before the radio-buttons. Defaults to 'after'
* @return {?}
*/
function () {
return this._labelPosition;
},
set: /**
* @param {?} v
* @return {?}
*/
function (v) {
this._labelPosition = v === 'before' ? 'before' : 'after';
this._markRadiosForCheck();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatRadioGroup.prototype, "value", {
get: /**
* Value of the radio button.
* @return {?}
*/
function () { return this._value; },
set: /**
* @param {?} newValue
* @return {?}
*/
function (newValue) {
if (this._value !== newValue) {
// Set this before proceeding to ensure no circular loop occurs with selection.
this._value = newValue;
this._updateSelectedRadioFromValue();
this._checkSelectedRadioButton();
}
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatRadioGroup.prototype._checkSelectedRadioButton = /**
* @return {?}
*/
function () {
if (this._selected && !this._selected.checked) {
this._selected.checked = true;
}
};
Object.defineProperty(MatRadioGroup.prototype, "selected", {
get: /**
* Whether the radio button is selected.
* @return {?}
*/
function () { return this._selected; },
set: /**
* @param {?} selected
* @return {?}
*/
function (selected) {
this._selected = selected;
this.value = selected ? selected.value : null;
this._checkSelectedRadioButton();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatRadioGroup.prototype, "disabled", {
get: /**
* Whether the radio group is disabled
* @return {?}
*/
function () { return this._disabled; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._disabled = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value);
this._markRadiosForCheck();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatRadioGroup.prototype, "required", {
get: /**
* Whether the radio group is required
* @return {?}
*/
function () { return this._required; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._required = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value);
this._markRadiosForCheck();
},
enumerable: true,
configurable: true
});
/**
* Initialize properties once content children are available.
* This allows us to propagate relevant attributes to associated buttons.
*/
/**
* Initialize properties once content children are available.
* This allows us to propagate relevant attributes to associated buttons.
* @return {?}
*/
MatRadioGroup.prototype.ngAfterContentInit = /**
* Initialize properties once content children are available.
* This allows us to propagate relevant attributes to associated buttons.
* @return {?}
*/
function () {
// Mark this component as initialized in AfterContentInit because the initial value can
// possibly be set by NgModel on MatRadioGroup, and it is possible that the OnInit of the
// NgModel occurs *after* the OnInit of the MatRadioGroup.
this._isInitialized = true;
};
/**
* Mark this group as being "touched" (for ngModel). Meant to be called by the contained
* radio buttons upon their blur.
*/
/**
* Mark this group as being "touched" (for ngModel). Meant to be called by the contained
* radio buttons upon their blur.
* @return {?}
*/
MatRadioGroup.prototype._touch = /**
* Mark this group as being "touched" (for ngModel). Meant to be called by the contained
* radio buttons upon their blur.
* @return {?}
*/
function () {
if (this.onTouched) {
this.onTouched();
}
};
/**
* @return {?}
*/
MatRadioGroup.prototype._updateRadioButtonNames = /**
* @return {?}
*/
function () {
var _this = this;
if (this._radios) {
this._radios.forEach(function (radio) {
radio.name = _this.name;
});
}
};
/**
* Updates the `selected` radio button from the internal _value state.
* @return {?}
*/
MatRadioGroup.prototype._updateSelectedRadioFromValue = /**
* Updates the `selected` radio button from the internal _value state.
* @return {?}
*/
function () {
var _this = this;
// If the value already matches the selected radio, do nothing.
var /** @type {?} */ isAlreadySelected = this._selected !== null && this._selected.value === this._value;
if (this._radios && !isAlreadySelected) {
this._selected = null;
this._radios.forEach(function (radio) {
radio.checked = _this.value === radio.value;
if (radio.checked) {
_this._selected = radio;
}
});
}
};
/** Dispatch change event with current selection and group value. */
/**
* Dispatch change event with current selection and group value.
* @return {?}
*/
MatRadioGroup.prototype._emitChangeEvent = /**
* Dispatch change event with current selection and group value.
* @return {?}
*/
function () {
if (this._isInitialized) {
this.change.emit(new MatRadioChange(/** @type {?} */ ((this._selected)), this._value));
}
};
/**
* @return {?}
*/
MatRadioGroup.prototype._markRadiosForCheck = /**
* @return {?}
*/
function () {
if (this._radios) {
this._radios.forEach(function (radio) { return radio._markForCheck(); });
}
};
/**
* Sets the model value. Implemented as part of ControlValueAccessor.
* @param value
*/
/**
* Sets the model value. Implemented as part of ControlValueAccessor.
* @param {?} value
* @return {?}
*/
MatRadioGroup.prototype.writeValue = /**
* Sets the model value. Implemented as part of ControlValueAccessor.
* @param {?} value
* @return {?}
*/
function (value) {
this.value = value;
this._changeDetector.markForCheck();
};
/**
* Registers a callback to be triggered when the model value changes.
* Implemented as part of ControlValueAccessor.
* @param fn Callback to be registered.
*/
/**
* Registers a callback to be triggered when the model value changes.
* Implemented as part of ControlValueAccessor.
* @param {?} fn Callback to be registered.
* @return {?}
*/
MatRadioGroup.prototype.registerOnChange = /**
* Registers a callback to be triggered when the model value changes.
* Implemented as part of ControlValueAccessor.
* @param {?} fn Callback to be registered.
* @return {?}
*/
function (fn) {
this._controlValueAccessorChangeFn = fn;
};
/**
* Registers a callback to be triggered when the control is touched.
* Implemented as part of ControlValueAccessor.
* @param fn Callback to be registered.
*/
/**
* Registers a callback to be triggered when the control is touched.
* Implemented as part of ControlValueAccessor.
* @param {?} fn Callback to be registered.
* @return {?}
*/
MatRadioGroup.prototype.registerOnTouched = /**
* Registers a callback to be triggered when the control is touched.
* Implemented as part of ControlValueAccessor.
* @param {?} fn Callback to be registered.
* @return {?}
*/
function (fn) {
this.onTouched = fn;
};
/**
* Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.
* @param isDisabled Whether the control should be disabled.
*/
/**
* Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.
* @param {?} isDisabled Whether the control should be disabled.
* @return {?}
*/
MatRadioGroup.prototype.setDisabledState = /**
* Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.
* @param {?} isDisabled Whether the control should be disabled.
* @return {?}
*/
function (isDisabled) {
this.disabled = isDisabled;
this._changeDetector.markForCheck();
};
MatRadioGroup.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Directive"], args: [{
selector: 'mat-radio-group',
exportAs: 'matRadioGroup',
providers: [MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR],
host: {
'role': 'radiogroup',
'class': 'mat-radio-group',
},
inputs: ['disabled'],
},] },
];
/** @nocollapse */
MatRadioGroup.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ChangeDetectorRef"], },
]; };
MatRadioGroup.propDecorators = {
"change": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Output"] },],
"_radios": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ContentChildren"], args: [Object(_angular_core__WEBPACK_IMPORTED_MODULE_4__["forwardRef"])(function () { return MatRadioButton; }), { descendants: true },] },],
"name": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"labelPosition": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"selected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"required": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
};
return MatRadioGroup;
}(_MatRadioGroupMixinBase));
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatRadioButtonBase = /** @class */ (function () {
function MatRadioButtonBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatRadioButtonBase;
}());
// As per Material design specifications the selection control radio should use the accent color
// palette by default. https://material.io/guidelines/components/selection-controls.html
var /** @type {?} */ _MatRadioButtonMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["mixinColor"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["mixinDisableRipple"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["mixinTabIndex"])(MatRadioButtonBase)), 'accent');
/**
* A Material design radio-button. Typically placed inside of `<mat-radio-group>` elements.
*/
var MatRadioButton = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatRadioButton, _super);
function MatRadioButton(radioGroup, elementRef, _changeDetector, _focusMonitor, _radioDispatcher) {
var _this = _super.call(this, elementRef) || this;
_this._changeDetector = _changeDetector;
_this._focusMonitor = _focusMonitor;
_this._radioDispatcher = _radioDispatcher;
_this._uniqueId = "mat-radio-" + ++nextUniqueId;
/**
* The unique ID for the radio button.
*/
_this.id = _this._uniqueId;
/**
* Event emitted when the checked state of this radio button changes.
* Change events are only emitted when the value changes due to user interaction with
* the radio button (the same behavior as `<input type-"radio">`).
*/
_this.change = new _angular_core__WEBPACK_IMPORTED_MODULE_4__["EventEmitter"]();
/**
* Whether this radio is checked.
*/
_this._checked = false;
/**
* Value assigned to this radio.
*/
_this._value = null;
/**
* Unregister function for _radioDispatcher
*/
_this._removeUniqueSelectionListener = function () { };
// Assertions. Ideally these should be stripped out by the compiler.
// TODO(jelbourn): Assert that there's no name binding AND a parent radio group.
// Assertions. Ideally these should be stripped out by the compiler.
// TODO(jelbourn): Assert that there's no name binding AND a parent radio group.
_this.radioGroup = radioGroup;
_this._removeUniqueSelectionListener =
_radioDispatcher.listen(function (id, name) {
if (id !== _this.id && name === _this.name) {
_this.checked = false;
}
});
return _this;
}
Object.defineProperty(MatRadioButton.prototype, "checked", {
get: /**
* Whether this radio button is checked.
* @return {?}
*/
function () { return this._checked; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ newCheckedState = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value);
if (this._checked !== newCheckedState) {
this._checked = newCheckedState;
if (newCheckedState && this.radioGroup && this.radioGroup.value !== this.value) {
this.radioGroup.selected = this;
}
else if (!newCheckedState && this.radioGroup && this.radioGroup.value === this.value) {
// When unchecking the selected radio button, update the selected radio
// property on the group.
this.radioGroup.selected = null;
}
if (newCheckedState) {
// Notify all radio buttons with the same name to un-check.
this._radioDispatcher.notify(this.id, this.name);
}
this._changeDetector.markForCheck();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatRadioButton.prototype, "value", {
get: /**
* The value of this radio button.
* @return {?}
*/
function () { return this._value; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (this._value !== value) {
this._value = value;
if (this.radioGroup !== null) {
if (!this.checked) {
// Update checked when the value changed to match the radio group's value
this.checked = this.radioGroup.value === value;
}
if (this.checked) {
this.radioGroup.selected = this;
}
}
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatRadioButton.prototype, "labelPosition", {
get: /**
* Whether the label should appear after or before the radio button. Defaults to 'after'
* @return {?}
*/
function () {
return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._labelPosition = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatRadioButton.prototype, "disabled", {
get: /**
* Whether the radio button is disabled.
* @return {?}
*/
function () {
return this._disabled || (this.radioGroup !== null && this.radioGroup.disabled);
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ newDisabledState = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value);
if (this._disabled !== newDisabledState) {
this._disabled = newDisabledState;
this._changeDetector.markForCheck();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatRadioButton.prototype, "required", {
get: /**
* Whether the radio button is required.
* @return {?}
*/
function () {
return this._required || (this.radioGroup && this.radioGroup.required);
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._required = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatRadioButton.prototype, "inputId", {
/** ID of the native input element inside `<mat-radio-button>` */
get: /**
* ID of the native input element inside `<mat-radio-button>`
* @return {?}
*/
function () { return (this.id || this._uniqueId) + "-input"; },
enumerable: true,
configurable: true
});
/** Focuses the radio button. */
/**
* Focuses the radio button.
* @return {?}
*/
MatRadioButton.prototype.focus = /**
* Focuses the radio button.
* @return {?}
*/
function () {
this._focusMonitor.focusVia(this._inputElement.nativeElement, 'keyboard');
};
/**
* Marks the radio button as needing checking for change detection.
* This method is exposed because the parent radio group will directly
* update bound properties of the radio button.
*/
/**
* Marks the radio button as needing checking for change detection.
* This method is exposed because the parent radio group will directly
* update bound properties of the radio button.
* @return {?}
*/
MatRadioButton.prototype._markForCheck = /**
* Marks the radio button as needing checking for change detection.
* This method is exposed because the parent radio group will directly
* update bound properties of the radio button.
* @return {?}
*/
function () {
// When group value changes, the button will not be notified. Use `markForCheck` to explicit
// update radio button's status
this._changeDetector.markForCheck();
};
/**
* @return {?}
*/
MatRadioButton.prototype.ngOnInit = /**
* @return {?}
*/
function () {
if (this.radioGroup) {
// If the radio is inside a radio group, determine if it should be checked
this.checked = this.radioGroup.value === this._value;
// Copy name from parent radio group
this.name = this.radioGroup.name;
}
};
/**
* @return {?}
*/
MatRadioButton.prototype.ngAfterViewInit = /**
* @return {?}
*/
function () {
var _this = this;
this._focusMonitor
.monitor(this._inputElement.nativeElement)
.subscribe(function (focusOrigin) { return _this._onInputFocusChange(focusOrigin); });
};
/**
* @return {?}
*/
MatRadioButton.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._focusMonitor.stopMonitoring(this._inputElement.nativeElement);
this._removeUniqueSelectionListener();
};
/**
* Dispatch change event with current value.
* @return {?}
*/
MatRadioButton.prototype._emitChangeEvent = /**
* Dispatch change event with current value.
* @return {?}
*/
function () {
this.change.emit(new MatRadioChange(this, this._value));
};
/**
* @return {?}
*/
MatRadioButton.prototype._isRippleDisabled = /**
* @return {?}
*/
function () {
return this.disableRipple || this.disabled;
};
/**
* @param {?} event
* @return {?}
*/
MatRadioButton.prototype._onInputClick = /**
* @param {?} event
* @return {?}
*/
function (event) {
// We have to stop propagation for click events on the visual hidden input element.
// By default, when a user clicks on a label element, a generated click event will be
// dispatched on the associated input element. Since we are using a label element as our
// root container, the click event on the `radio-button` will be executed twice.
// The real click event will bubble up, and the generated click event also tries to bubble up.
// This will lead to multiple click events.
// Preventing bubbling for the second event will solve that issue.
event.stopPropagation();
};
/**
* Triggered when the radio button received a click or the input recognized any change.
* Clicking on a label element, will trigger a change event on the associated input.
*/
/**
* Triggered when the radio button received a click or the input recognized any change.
* Clicking on a label element, will trigger a change event on the associated input.
* @param {?} event
* @return {?}
*/
MatRadioButton.prototype._onInputChange = /**
* Triggered when the radio button received a click or the input recognized any change.
* Clicking on a label element, will trigger a change event on the associated input.
* @param {?} event
* @return {?}
*/
function (event) {
// We always have to stop propagation on the change event.
// Otherwise the change event, from the input element, will bubble up and
// emit its event object to the `change` output.
event.stopPropagation();
var /** @type {?} */ groupValueChanged = this.radioGroup && this.value !== this.radioGroup.value;
this.checked = true;
this._emitChangeEvent();
if (this.radioGroup) {
this.radioGroup._controlValueAccessorChangeFn(this.value);
this.radioGroup._touch();
if (groupValueChanged) {
this.radioGroup._emitChangeEvent();
}
}
};
/**
* Function is called whenever the focus changes for the input element.
* @param {?} focusOrigin
* @return {?}
*/
MatRadioButton.prototype._onInputFocusChange = /**
* Function is called whenever the focus changes for the input element.
* @param {?} focusOrigin
* @return {?}
*/
function (focusOrigin) {
// TODO(paul): support `program`. See https://github.com/angular/material2/issues/9889
if (!this._focusRipple && focusOrigin === 'keyboard') {
this._focusRipple = this._ripple.launch(0, 0, { persistent: true });
}
else if (!focusOrigin) {
if (this.radioGroup) {
this.radioGroup._touch();
}
if (this._focusRipple) {
this._focusRipple.fadeOut();
this._focusRipple = null;
}
}
};
MatRadioButton.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Component"], args: [{selector: 'mat-radio-button',
template: "<label [attr.for]=\"inputId\" class=\"mat-radio-label\" #label><div class=\"mat-radio-container\"><div class=\"mat-radio-outer-circle\"></div><div class=\"mat-radio-inner-circle\"></div><div mat-ripple class=\"mat-radio-ripple\" [matRippleTrigger]=\"label\" [matRippleDisabled]=\"_isRippleDisabled()\" [matRippleCentered]=\"true\" [matRippleRadius]=\"23\" [matRippleAnimation]=\"{enterDuration: 150}\"></div></div><input #input class=\"mat-radio-input cdk-visually-hidden\" type=\"radio\" [id]=\"inputId\" [checked]=\"checked\" [disabled]=\"disabled\" [tabIndex]=\"tabIndex\" [attr.name]=\"name\" [required]=\"required\" [attr.aria-label]=\"ariaLabel\" [attr.aria-labelledby]=\"ariaLabelledby\" [attr.aria-describedby]=\"ariaDescribedby\" (change)=\"_onInputChange($event)\" (click)=\"_onInputClick($event)\"><div class=\"mat-radio-label-content\" [class.mat-radio-label-before]=\"labelPosition == 'before'\"><span style=\"display:none\">&nbsp;</span><ng-content></ng-content></div></label>",
styles: [".mat-radio-button{display:inline-block}.mat-radio-label{cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;height:20px;left:0;position:absolute;top:0;transition:transform ease 280ms,background-color ease 280ms;width:20px;transform:scale(.001)}.mat-radio-checked .mat-radio-inner-circle{transform:scale(.5)}@media screen and (-ms-high-contrast:active){.mat-radio-checked .mat-radio-inner-circle{border:solid 10px}}.mat-radio-label-content{display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-ripple{position:absolute;left:calc(50% - 25px);top:calc(50% - 25px);height:50px;width:50px;z-index:1;pointer-events:none}"],
inputs: ['color', 'disableRipple', 'tabIndex'],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ViewEncapsulation"].None,
exportAs: 'matRadioButton',
host: {
'class': 'mat-radio-button',
'[class.mat-radio-checked]': 'checked',
'[class.mat-radio-disabled]': 'disabled',
'[attr.id]': 'id',
// Note: under normal conditions focus shouldn't land on this element, however it may be
// programmatically set, for example inside of a focus trap, in this case we want to forward
// the focus to the native element.
'(focus)': '_inputElement.nativeElement.focus()',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatRadioButton.ctorParameters = function () { return [
{ type: MatRadioGroup, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Optional"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ChangeDetectorRef"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__["FocusMonitor"], },
{ type: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_3__["UniqueSelectionDispatcher"], },
]; };
MatRadioButton.propDecorators = {
"id": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"name": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"ariaLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"], args: ['aria-label',] },],
"ariaLabelledby": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"], args: ['aria-labelledby',] },],
"ariaDescribedby": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"], args: ['aria-describedby',] },],
"checked": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"labelPosition": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"required": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"change": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Output"] },],
"_ripple": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ViewChild"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["MatRipple"],] },],
"_inputElement": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ViewChild"], args: ['input',] },],
};
return MatRadioButton;
}(_MatRadioButtonMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatRadioModule = /** @class */ (function () {
function MatRadioModule() {
}
MatRadioModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["NgModule"], args: [{
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_7__["CommonModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_6__["MatRippleModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_6__["MatCommonModule"]],
exports: [MatRadioGroup, MatRadioButton, _angular_material_core__WEBPACK_IMPORTED_MODULE_6__["MatCommonModule"]],
declarations: [MatRadioGroup, MatRadioButton],
},] },
];
return MatRadioModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=radio.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/select.es5.js":
/*!***********************************************************!*\
!*** ./node_modules/@angular/material/esm5/select.es5.js ***!
\***********************************************************/
/*! exports provided: MatSelectModule, SELECT_PANEL_MAX_HEIGHT, SELECT_PANEL_PADDING_X, SELECT_PANEL_INDENT_PADDING_X, SELECT_ITEM_HEIGHT_EM, SELECT_MULTIPLE_PANEL_PADDING_X, SELECT_PANEL_VIEWPORT_PADDING, MAT_SELECT_SCROLL_STRATEGY, MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY, MAT_SELECT_SCROLL_STRATEGY_PROVIDER, MatSelectChange, MatSelectBase, _MatSelectMixinBase, MatSelectTrigger, MatSelect, matSelectAnimations, transformPanel, fadeInContent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSelectModule", function() { return MatSelectModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SELECT_PANEL_MAX_HEIGHT", function() { return SELECT_PANEL_MAX_HEIGHT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SELECT_PANEL_PADDING_X", function() { return SELECT_PANEL_PADDING_X; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SELECT_PANEL_INDENT_PADDING_X", function() { return SELECT_PANEL_INDENT_PADDING_X; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SELECT_ITEM_HEIGHT_EM", function() { return SELECT_ITEM_HEIGHT_EM; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SELECT_MULTIPLE_PANEL_PADDING_X", function() { return SELECT_MULTIPLE_PANEL_PADDING_X; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SELECT_PANEL_VIEWPORT_PADDING", function() { return SELECT_PANEL_VIEWPORT_PADDING; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SELECT_SCROLL_STRATEGY", function() { return MAT_SELECT_SCROLL_STRATEGY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY", function() { return MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SELECT_SCROLL_STRATEGY_PROVIDER", function() { return MAT_SELECT_SCROLL_STRATEGY_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSelectChange", function() { return MatSelectChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSelectBase", function() { return MatSelectBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatSelectMixinBase", function() { return _MatSelectMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSelectTrigger", function() { return MatSelectTrigger; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSelect", function() { return MatSelect; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matSelectAnimations", function() { return matSelectAnimations; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformPanel", function() { return transformPanel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fadeInContent", function() { return fadeInContent; });
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm5/collections.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/cdk/overlay */ "./node_modules/@angular/cdk/esm5/overlay.es5.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_material_form_field__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/form-field */ "./node_modules/@angular/material/esm5/form-field.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* The following are all the animations for the mat-select component, with each
* const containing the metadata for one animation.
*
* The values below match the implementation of the AngularJS Material mat-select animation.
*/
var /** @type {?} */ matSelectAnimations = {
/**
* This animation transforms the select's overlay panel on and off the page.
*
* When the panel is attached to the DOM, it expands its width by the amount of padding, scales it
* up to 100% on the Y axis, fades in its border, and translates slightly up and to the
* side to ensure the option text correctly overlaps the trigger text.
*
* When the panel is removed from the DOM, it simply fades out linearly.
*/
transformPanel: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["trigger"])('transformPanel', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["state"])('void', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({
transform: 'scaleY(0)',
minWidth: '100%',
opacity: 0
})),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["state"])('showing', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({
opacity: 1,
minWidth: 'calc(100% + 32px)',
// 32px = 2 * 16px padding
transform: 'scaleY(1)'
})),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["state"])('showing-multiple', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({
opacity: 1,
minWidth: 'calc(100% + 64px)',
// 64px = 48px padding on the left + 16px padding on the right
transform: 'scaleY(1)'
})),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["transition"])('void => *', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["group"])([
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["query"])('@fadeInContent', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["animateChild"])()),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["animate"])('150ms cubic-bezier(0.25, 0.8, 0.25, 1)')
])),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["transition"])('* => void', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["animate"])('250ms 100ms linear', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({ opacity: 0 }))
])
]),
/**
* This animation fades in the background color and text content of the
* select's options. It is time delayed to occur 100ms after the overlay
* panel has transformed in.
*/
fadeInContent: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["trigger"])('fadeInContent', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["state"])('showing', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({ opacity: 1 })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["transition"])('void => showing', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({ opacity: 0 }),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["animate"])('150ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)')
])
])
};
/**
* @deprecated
* \@deletion-target 7.0.0
*/
var /** @type {?} */ transformPanel = matSelectAnimations.transformPanel;
/**
* @deprecated
* \@deletion-target 7.0.0
*/
var /** @type {?} */ fadeInContent = matSelectAnimations.fadeInContent;
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Returns an exception to be thrown when attempting to change a select's `multiple` option
* after initialization.
* \@docs-private
* @return {?}
*/
function getMatSelectDynamicMultipleError() {
return Error('Cannot change `multiple` mode of select after initialization.');
}
/**
* Returns an exception to be thrown when attempting to assign a non-array value to a select
* in `multiple` mode. Note that `undefined` and `null` are still valid values to allow for
* resetting the value.
* \@docs-private
* @return {?}
*/
function getMatSelectNonArrayValueError() {
return Error('Value must be an array in multiple-selection mode.');
}
/**
* Returns an exception to be thrown when assigning a non-function value to the comparator
* used to determine if a value corresponds to an option. Note that whether the function
* actually takes two values and returns a boolean is not checked.
* @return {?}
*/
function getMatSelectNonFunctionValueError() {
return Error('`compareWith` must be a function.');
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ nextUniqueId = 0;
/**
* The max height of the select's overlay panel
*/
var /** @type {?} */ SELECT_PANEL_MAX_HEIGHT = 256;
/**
* The panel's padding on the x-axis
*/
var /** @type {?} */ SELECT_PANEL_PADDING_X = 16;
/**
* The panel's x axis padding if it is indented (e.g. there is an option group).
*/
var /** @type {?} */ SELECT_PANEL_INDENT_PADDING_X = SELECT_PANEL_PADDING_X * 2;
/**
* The height of the select items in `em` units.
*/
var /** @type {?} */ SELECT_ITEM_HEIGHT_EM = 3;
/**
* Distance between the panel edge and the option text in
* multi-selection mode.
*
* (SELECT_PANEL_PADDING_X * 1.5) + 20 = 44
* The padding is multiplied by 1.5 because the checkbox's margin is half the padding.
* The checkbox width is 20px.
*/
var /** @type {?} */ SELECT_MULTIPLE_PANEL_PADDING_X = SELECT_PANEL_PADDING_X * 1.5 + 20;
/**
* The select panel will only "fit" inside the viewport if it is positioned at
* this value or more away from the viewport boundary.
*/
var /** @type {?} */ SELECT_PANEL_VIEWPORT_PADDING = 8;
/**
* Injection token that determines the scroll handling while a select is open.
*/
var /** @type {?} */ MAT_SELECT_SCROLL_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_8__["InjectionToken"]('mat-select-scroll-strategy');
/**
* \@docs-private
* @param {?} overlay
* @return {?}
*/
function MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
return function () { return overlay.scrollStrategies.reposition(); };
}
/**
* \@docs-private
*/
var /** @type {?} */ MAT_SELECT_SCROLL_STRATEGY_PROVIDER = {
provide: MAT_SELECT_SCROLL_STRATEGY,
deps: [_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["Overlay"]],
useFactory: MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY,
};
/**
* Change event object that is emitted when the select value has changed.
*/
var /**
* Change event object that is emitted when the select value has changed.
*/
MatSelectChange = /** @class */ (function () {
function MatSelectChange(source, value) {
this.source = source;
this.value = value;
}
return MatSelectChange;
}());
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatSelectBase = /** @class */ (function () {
function MatSelectBase(_elementRef, _defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl) {
this._elementRef = _elementRef;
this._defaultErrorStateMatcher = _defaultErrorStateMatcher;
this._parentForm = _parentForm;
this._parentFormGroup = _parentFormGroup;
this.ngControl = ngControl;
}
return MatSelectBase;
}());
var /** @type {?} */ _MatSelectMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_10__["mixinDisableRipple"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_10__["mixinTabIndex"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_10__["mixinDisabled"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_10__["mixinErrorState"])(MatSelectBase))));
/**
* Allows the user to customize the trigger that is displayed when the select has a value.
*/
var MatSelectTrigger = /** @class */ (function () {
function MatSelectTrigger() {
}
MatSelectTrigger.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Directive"], args: [{
selector: 'mat-select-trigger'
},] },
];
return MatSelectTrigger;
}());
var MatSelect = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatSelect, _super);
function MatSelect(_viewportRuler, _changeDetectorRef, _ngZone, _defaultErrorStateMatcher, elementRef, _dir, _parentForm, _parentFormGroup, _parentFormField, ngControl, tabIndex, _scrollStrategyFactory) {
var _this = _super.call(this, elementRef, _defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl) || this;
_this._viewportRuler = _viewportRuler;
_this._changeDetectorRef = _changeDetectorRef;
_this._ngZone = _ngZone;
_this._dir = _dir;
_this._parentFormField = _parentFormField;
_this.ngControl = ngControl;
_this._scrollStrategyFactory = _scrollStrategyFactory;
/**
* Whether or not the overlay panel is open.
*/
_this._panelOpen = false;
/**
* Whether filling out the select is required in the form.
*/
_this._required = false;
/**
* The scroll position of the overlay panel, calculated to center the selected option.
*/
_this._scrollTop = 0;
/**
* Whether the component is in multiple selection mode.
*/
_this._multiple = false;
/**
* Comparison function to specify which option is displayed. Defaults to object equality.
*/
_this._compareWith = function (o1, o2) { return o1 === o2; };
/**
* Unique id for this input.
*/
_this._uid = "mat-select-" + nextUniqueId++;
/**
* Emits whenever the component is destroyed.
*/
_this._destroy = new rxjs__WEBPACK_IMPORTED_MODULE_12__["Subject"]();
/**
* The cached font-size of the trigger element.
*/
_this._triggerFontSize = 0;
/**
* `View -> model callback called when value changes`
*/
_this._onChange = function () { };
/**
* `View -> model callback called when select has been touched`
*/
_this._onTouched = function () { };
/**
* The IDs of child options to be passed to the aria-owns attribute.
*/
_this._optionIds = '';
/**
* The value of the select panel's transform-origin property.
*/
_this._transformOrigin = 'top';
/**
* Whether the panel's animation is done.
*/
_this._panelDoneAnimating = false;
/**
* Strategy that will be used to handle scrolling while the select panel is open.
*/
_this._scrollStrategy = _this._scrollStrategyFactory();
/**
* The y-offset of the overlay panel in relation to the trigger's top start corner.
* This must be adjusted to align the selected option text over the trigger text.
* when the panel opens. Will change based on the y-position of the selected option.
*/
_this._offsetY = 0;
/**
* This position config ensures that the top "start" corner of the overlay
* is aligned with with the top "start" of the origin by default (overlapping
* the trigger completely). If the panel cannot fit below the trigger, it
* will fall back to a position above the trigger.
*/
_this._positions = [
{
originX: 'start',
originY: 'top',
overlayX: 'start',
overlayY: 'top',
},
{
originX: 'start',
originY: 'bottom',
overlayX: 'start',
overlayY: 'bottom',
},
];
/**
* Whether the component is disabling centering of the active option over the trigger.
*/
_this._disableOptionCentering = false;
/**
* Whether the select is focused.
*/
_this.focused = false;
/**
* A name for this control that can be used by `mat-form-field`.
*/
_this.controlType = 'mat-select';
/**
* Aria label of the select. If not specified, the placeholder will be used as label.
*/
_this.ariaLabel = '';
/**
* Combined stream of all of the child options' change events.
*/
_this.optionSelectionChanges = Object(rxjs__WEBPACK_IMPORTED_MODULE_12__["defer"])(function () {
if (_this.options) {
return rxjs__WEBPACK_IMPORTED_MODULE_12__["merge"].apply(void 0, _this.options.map(function (option) { return option.onSelectionChange; }));
}
return _this._ngZone.onStable
.asObservable()
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["take"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["switchMap"])(function () { return _this.optionSelectionChanges; }));
});
/**
* Event emitted when the select panel has been toggled.
*/
_this.openedChange = new _angular_core__WEBPACK_IMPORTED_MODULE_8__["EventEmitter"]();
/**
* Event emitted when the select has been opened.
*/
_this._openedStream = _this.openedChange.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["filter"])(function (o) { return o; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["map"])(function () { }));
/**
* Event emitted when the select has been closed.
*/
_this._closedStream = _this.openedChange.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["filter"])(function (o) { return !o; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["map"])(function () { }));
/**
* Event emitted when the selected value has been changed by the user.
*/
_this.selectionChange = new _angular_core__WEBPACK_IMPORTED_MODULE_8__["EventEmitter"]();
/**
* Event that emits whenever the raw value of the select changes. This is here primarily
* to facilitate the two-way binding for the `value` input.
* \@docs-private
*/
_this.valueChange = new _angular_core__WEBPACK_IMPORTED_MODULE_8__["EventEmitter"]();
if (_this.ngControl) {
// Note: we provide the value accessor through here, instead of
// the `providers` to avoid running into a circular import.
// Note: we provide the value accessor through here, instead of
// the `providers` to avoid running into a circular import.
_this.ngControl.valueAccessor = _this;
}
_this.tabIndex = parseInt(tabIndex) || 0;
// Force setter to be called in case id was not specified.
// Force setter to be called in case id was not specified.
_this.id = _this.id;
return _this;
}
Object.defineProperty(MatSelect.prototype, "placeholder", {
get: /**
* Placeholder to be shown if no value has been selected.
* @return {?}
*/
function () { return this._placeholder; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._placeholder = value;
this.stateChanges.next();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSelect.prototype, "required", {
get: /**
* Whether the component is required.
* @return {?}
*/
function () { return this._required; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._required = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__["coerceBooleanProperty"])(value);
this.stateChanges.next();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSelect.prototype, "multiple", {
get: /**
* Whether the user should be allowed to select multiple options.
* @return {?}
*/
function () { return this._multiple; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (this._selectionModel) {
throw getMatSelectDynamicMultipleError();
}
this._multiple = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSelect.prototype, "disableOptionCentering", {
get: /**
* Whether to center the active option over the trigger.
* @return {?}
*/
function () { return this._disableOptionCentering; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._disableOptionCentering = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSelect.prototype, "compareWith", {
get: /**
* A function to compare the option values with the selected values. The first argument
* is a value from an option. The second is a value from the selection. A boolean
* should be returned.
* @return {?}
*/
function () { return this._compareWith; },
set: /**
* @param {?} fn
* @return {?}
*/
function (fn) {
if (typeof fn !== 'function') {
throw getMatSelectNonFunctionValueError();
}
this._compareWith = fn;
if (this._selectionModel) {
// A different comparator means the selection could change.
this._initializeSelection();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSelect.prototype, "value", {
get: /**
* Value of the select control.
* @return {?}
*/
function () { return this._value; },
set: /**
* @param {?} newValue
* @return {?}
*/
function (newValue) {
if (newValue !== this._value) {
this.writeValue(newValue);
this._value = newValue;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSelect.prototype, "id", {
get: /**
* Unique id of the element.
* @return {?}
*/
function () { return this._id; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._id = value || this._uid;
this.stateChanges.next();
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatSelect.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._selectionModel = new _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_5__["SelectionModel"](this.multiple, undefined, false);
this.stateChanges.next();
};
/**
* @return {?}
*/
MatSelect.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
this._initKeyManager();
this.options.changes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["startWith"])(null), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["takeUntil"])(this._destroy)).subscribe(function () {
_this._resetOptions();
_this._initializeSelection();
});
};
/**
* @return {?}
*/
MatSelect.prototype.ngDoCheck = /**
* @return {?}
*/
function () {
if (this.ngControl) {
this.updateErrorState();
}
};
/**
* @param {?} changes
* @return {?}
*/
MatSelect.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
// Updating the disabled state is handled by `mixinDisabled`, but we need to additionally let
// the parent form field know to run change detection when the disabled state changes.
if (changes["disabled"]) {
this.stateChanges.next();
}
};
/**
* @return {?}
*/
MatSelect.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._destroy.next();
this._destroy.complete();
this.stateChanges.complete();
};
/** Toggles the overlay panel open or closed. */
/**
* Toggles the overlay panel open or closed.
* @return {?}
*/
MatSelect.prototype.toggle = /**
* Toggles the overlay panel open or closed.
* @return {?}
*/
function () {
this.panelOpen ? this.close() : this.open();
};
/** Opens the overlay panel. */
/**
* Opens the overlay panel.
* @return {?}
*/
MatSelect.prototype.open = /**
* Opens the overlay panel.
* @return {?}
*/
function () {
var _this = this;
if (this.disabled || !this.options || !this.options.length || this._panelOpen) {
return;
}
this._triggerRect = this.trigger.nativeElement.getBoundingClientRect();
// Note: The computed font-size will be a string pixel value (e.g. "16px").
// `parseInt` ignores the trailing 'px' and converts this to a number.
this._triggerFontSize = parseInt(getComputedStyle(this.trigger.nativeElement)['font-size']);
this._panelOpen = true;
this._keyManager.withHorizontalOrientation(null);
this._calculateOverlayPosition();
this._highlightCorrectOption();
this._changeDetectorRef.markForCheck();
// Set the font size on the panel element once it exists.
this._ngZone.onStable.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["take"])(1)).subscribe(function () {
if (_this._triggerFontSize && _this.overlayDir.overlayRef &&
_this.overlayDir.overlayRef.overlayElement) {
_this.overlayDir.overlayRef.overlayElement.style.fontSize = _this._triggerFontSize + "px";
}
});
};
/** Closes the overlay panel and focuses the host element. */
/**
* Closes the overlay panel and focuses the host element.
* @return {?}
*/
MatSelect.prototype.close = /**
* Closes the overlay panel and focuses the host element.
* @return {?}
*/
function () {
if (this._panelOpen) {
this._panelOpen = false;
this._keyManager.withHorizontalOrientation(this._isRtl() ? 'rtl' : 'ltr');
this._changeDetectorRef.markForCheck();
this._onTouched();
}
};
/**
* Sets the select's value. Part of the ControlValueAccessor interface
* required to integrate with Angular's core forms API.
*
* @param value New value to be written to the model.
*/
/**
* Sets the select's value. Part of the ControlValueAccessor interface
* required to integrate with Angular's core forms API.
*
* @param {?} value New value to be written to the model.
* @return {?}
*/
MatSelect.prototype.writeValue = /**
* Sets the select's value. Part of the ControlValueAccessor interface
* required to integrate with Angular's core forms API.
*
* @param {?} value New value to be written to the model.
* @return {?}
*/
function (value) {
if (this.options) {
this._setSelectionByValue(value);
}
};
/**
* Saves a callback function to be invoked when the select's value
* changes from user input. Part of the ControlValueAccessor interface
* required to integrate with Angular's core forms API.
*
* @param fn Callback to be triggered when the value changes.
*/
/**
* Saves a callback function to be invoked when the select's value
* changes from user input. Part of the ControlValueAccessor interface
* required to integrate with Angular's core forms API.
*
* @param {?} fn Callback to be triggered when the value changes.
* @return {?}
*/
MatSelect.prototype.registerOnChange = /**
* Saves a callback function to be invoked when the select's value
* changes from user input. Part of the ControlValueAccessor interface
* required to integrate with Angular's core forms API.
*
* @param {?} fn Callback to be triggered when the value changes.
* @return {?}
*/
function (fn) {
this._onChange = fn;
};
/**
* Saves a callback function to be invoked when the select is blurred
* by the user. Part of the ControlValueAccessor interface required
* to integrate with Angular's core forms API.
*
* @param fn Callback to be triggered when the component has been touched.
*/
/**
* Saves a callback function to be invoked when the select is blurred
* by the user. Part of the ControlValueAccessor interface required
* to integrate with Angular's core forms API.
*
* @param {?} fn Callback to be triggered when the component has been touched.
* @return {?}
*/
MatSelect.prototype.registerOnTouched = /**
* Saves a callback function to be invoked when the select is blurred
* by the user. Part of the ControlValueAccessor interface required
* to integrate with Angular's core forms API.
*
* @param {?} fn Callback to be triggered when the component has been touched.
* @return {?}
*/
function (fn) {
this._onTouched = fn;
};
/**
* Disables the select. Part of the ControlValueAccessor interface required
* to integrate with Angular's core forms API.
*
* @param isDisabled Sets whether the component is disabled.
*/
/**
* Disables the select. Part of the ControlValueAccessor interface required
* to integrate with Angular's core forms API.
*
* @param {?} isDisabled Sets whether the component is disabled.
* @return {?}
*/
MatSelect.prototype.setDisabledState = /**
* Disables the select. Part of the ControlValueAccessor interface required
* to integrate with Angular's core forms API.
*
* @param {?} isDisabled Sets whether the component is disabled.
* @return {?}
*/
function (isDisabled) {
this.disabled = isDisabled;
this._changeDetectorRef.markForCheck();
this.stateChanges.next();
};
Object.defineProperty(MatSelect.prototype, "panelOpen", {
/** Whether or not the overlay panel is open. */
get: /**
* Whether or not the overlay panel is open.
* @return {?}
*/
function () {
return this._panelOpen;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSelect.prototype, "selected", {
/** The currently selected option. */
get: /**
* The currently selected option.
* @return {?}
*/
function () {
return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSelect.prototype, "triggerValue", {
/** The value displayed in the trigger. */
get: /**
* The value displayed in the trigger.
* @return {?}
*/
function () {
if (this.empty) {
return '';
}
if (this._multiple) {
var /** @type {?} */ selectedOptions = this._selectionModel.selected.map(function (option) { return option.viewValue; });
if (this._isRtl()) {
selectedOptions.reverse();
}
// TODO(crisbeto): delimiter should be configurable for proper localization.
return selectedOptions.join(', ');
}
return this._selectionModel.selected[0].viewValue;
},
enumerable: true,
configurable: true
});
/** Whether the element is in RTL mode. */
/**
* Whether the element is in RTL mode.
* @return {?}
*/
MatSelect.prototype._isRtl = /**
* Whether the element is in RTL mode.
* @return {?}
*/
function () {
return this._dir ? this._dir.value === 'rtl' : false;
};
/** Handles all keydown events on the select. */
/**
* Handles all keydown events on the select.
* @param {?} event
* @return {?}
*/
MatSelect.prototype._handleKeydown = /**
* Handles all keydown events on the select.
* @param {?} event
* @return {?}
*/
function (event) {
if (!this.disabled) {
this.panelOpen ? this._handleOpenKeydown(event) : this._handleClosedKeydown(event);
}
};
/**
* Handles keyboard events while the select is closed.
* @param {?} event
* @return {?}
*/
MatSelect.prototype._handleClosedKeydown = /**
* Handles keyboard events while the select is closed.
* @param {?} event
* @return {?}
*/
function (event) {
var /** @type {?} */ keyCode = event.keyCode;
var /** @type {?} */ isArrowKey = keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["DOWN_ARROW"] || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["UP_ARROW"] ||
keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["LEFT_ARROW"] || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["RIGHT_ARROW"];
var /** @type {?} */ isOpenKey = keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["ENTER"] || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["SPACE"];
// Open the select on ALT + arrow key to match the native <select>
if (isOpenKey || ((this.multiple || event.altKey) && isArrowKey)) {
event.preventDefault(); // prevents the page from scrolling down when pressing space
this.open();
}
else if (!this.multiple) {
this._keyManager.onKeydown(event);
}
};
/**
* Handles keyboard events when the selected is open.
* @param {?} event
* @return {?}
*/
MatSelect.prototype._handleOpenKeydown = /**
* Handles keyboard events when the selected is open.
* @param {?} event
* @return {?}
*/
function (event) {
var /** @type {?} */ keyCode = event.keyCode;
var /** @type {?} */ isArrowKey = keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["DOWN_ARROW"] || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["UP_ARROW"];
var /** @type {?} */ manager = this._keyManager;
if (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["HOME"] || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["END"]) {
event.preventDefault();
keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["HOME"] ? manager.setFirstItemActive() : manager.setLastItemActive();
}
else if (isArrowKey && event.altKey) {
// Close the select on ALT + arrow key to match the native <select>
event.preventDefault();
this.close();
}
else if ((keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["ENTER"] || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_6__["SPACE"]) && manager.activeItem) {
event.preventDefault();
manager.activeItem._selectViaInteraction();
}
else {
var /** @type {?} */ previouslyFocusedIndex = manager.activeItemIndex;
manager.onKeydown(event);
if (this._multiple && isArrowKey && event.shiftKey && manager.activeItem &&
manager.activeItemIndex !== previouslyFocusedIndex) {
manager.activeItem._selectViaInteraction();
}
}
};
/**
* When the panel element is finished transforming in (though not fading in), it
* emits an event and focuses an option if the panel is open.
*/
/**
* When the panel element is finished transforming in (though not fading in), it
* emits an event and focuses an option if the panel is open.
* @return {?}
*/
MatSelect.prototype._onPanelDone = /**
* When the panel element is finished transforming in (though not fading in), it
* emits an event and focuses an option if the panel is open.
* @return {?}
*/
function () {
if (this.panelOpen) {
this._scrollTop = 0;
this.openedChange.emit(true);
}
else {
this.openedChange.emit(false);
this._panelDoneAnimating = false;
this.overlayDir.offsetX = 0;
this._changeDetectorRef.markForCheck();
}
};
/**
* When the panel content is done fading in, the _panelDoneAnimating property is
* set so the proper class can be added to the panel.
*/
/**
* When the panel content is done fading in, the _panelDoneAnimating property is
* set so the proper class can be added to the panel.
* @return {?}
*/
MatSelect.prototype._onFadeInDone = /**
* When the panel content is done fading in, the _panelDoneAnimating property is
* set so the proper class can be added to the panel.
* @return {?}
*/
function () {
this._panelDoneAnimating = this.panelOpen;
this._changeDetectorRef.markForCheck();
};
/**
* @return {?}
*/
MatSelect.prototype._onFocus = /**
* @return {?}
*/
function () {
if (!this.disabled) {
this.focused = true;
this.stateChanges.next();
}
};
/**
* Calls the touched callback only if the panel is closed. Otherwise, the trigger will
* "blur" to the panel when it opens, causing a false positive.
*/
/**
* Calls the touched callback only if the panel is closed. Otherwise, the trigger will
* "blur" to the panel when it opens, causing a false positive.
* @return {?}
*/
MatSelect.prototype._onBlur = /**
* Calls the touched callback only if the panel is closed. Otherwise, the trigger will
* "blur" to the panel when it opens, causing a false positive.
* @return {?}
*/
function () {
this.focused = false;
if (!this.disabled && !this.panelOpen) {
this._onTouched();
this._changeDetectorRef.markForCheck();
this.stateChanges.next();
}
};
/**
* Callback that is invoked when the overlay panel has been attached.
*/
/**
* Callback that is invoked when the overlay panel has been attached.
* @return {?}
*/
MatSelect.prototype._onAttached = /**
* Callback that is invoked when the overlay panel has been attached.
* @return {?}
*/
function () {
var _this = this;
this.overlayDir.positionChange.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["take"])(1)).subscribe(function () {
_this._changeDetectorRef.detectChanges();
_this._calculateOverlayOffsetX();
_this.panel.nativeElement.scrollTop = _this._scrollTop;
});
};
/** Returns the theme to be used on the panel. */
/**
* Returns the theme to be used on the panel.
* @return {?}
*/
MatSelect.prototype._getPanelTheme = /**
* Returns the theme to be used on the panel.
* @return {?}
*/
function () {
return this._parentFormField ? "mat-" + this._parentFormField.color : '';
};
Object.defineProperty(MatSelect.prototype, "empty", {
/** Whether the select has a value. */
get: /**
* Whether the select has a value.
* @return {?}
*/
function () {
return !this._selectionModel || this._selectionModel.isEmpty();
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatSelect.prototype._initializeSelection = /**
* @return {?}
*/
function () {
var _this = this;
// Defer setting the value in order to avoid the "Expression
// has changed after it was checked" errors from Angular.
Promise.resolve().then(function () {
_this._setSelectionByValue(_this.ngControl ? _this.ngControl.value : _this._value);
});
};
/**
* Sets the selected option based on a value. If no option can be
* found with the designated value, the select trigger is cleared.
* @param {?} value
* @param {?=} isUserInput
* @return {?}
*/
MatSelect.prototype._setSelectionByValue = /**
* Sets the selected option based on a value. If no option can be
* found with the designated value, the select trigger is cleared.
* @param {?} value
* @param {?=} isUserInput
* @return {?}
*/
function (value, isUserInput) {
var _this = this;
if (isUserInput === void 0) { isUserInput = false; }
if (this.multiple && value) {
if (!Array.isArray(value)) {
throw getMatSelectNonArrayValueError();
}
this._clearSelection();
value.forEach(function (currentValue) { return _this._selectValue(currentValue, isUserInput); });
this._sortValues();
}
else {
this._clearSelection();
var /** @type {?} */ correspondingOption = this._selectValue(value, isUserInput);
// Shift focus to the active item. Note that we shouldn't do this in multiple
// mode, because we don't know what option the user interacted with last.
if (correspondingOption) {
this._keyManager.setActiveItem(correspondingOption);
}
}
this._changeDetectorRef.markForCheck();
};
/**
* Finds and selects and option based on its value.
* @param {?} value
* @param {?=} isUserInput
* @return {?} Option that has the corresponding value.
*/
MatSelect.prototype._selectValue = /**
* Finds and selects and option based on its value.
* @param {?} value
* @param {?=} isUserInput
* @return {?} Option that has the corresponding value.
*/
function (value, isUserInput) {
var _this = this;
if (isUserInput === void 0) { isUserInput = false; }
var /** @type {?} */ correspondingOption = this.options.find(function (option) {
try {
// Treat null as a special reset value.
return option.value != null && _this._compareWith(option.value, value);
}
catch (/** @type {?} */ error) {
if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_8__["isDevMode"])()) {
// Notify developers of errors in their comparator.
console.warn(error);
}
return false;
}
});
if (correspondingOption) {
isUserInput ? correspondingOption._selectViaInteraction() : correspondingOption.select();
this._selectionModel.select(correspondingOption);
this.stateChanges.next();
}
return correspondingOption;
};
/**
* Clears the select trigger and deselects every option in the list.
* @param {?=} skip Option that should not be deselected.
* @return {?}
*/
MatSelect.prototype._clearSelection = /**
* Clears the select trigger and deselects every option in the list.
* @param {?=} skip Option that should not be deselected.
* @return {?}
*/
function (skip) {
this._selectionModel.clear();
this.options.forEach(function (option) {
if (option !== skip) {
option.deselect();
}
});
this.stateChanges.next();
};
/**
* Sets up a key manager to listen to keyboard events on the overlay panel.
* @return {?}
*/
MatSelect.prototype._initKeyManager = /**
* Sets up a key manager to listen to keyboard events on the overlay panel.
* @return {?}
*/
function () {
var _this = this;
this._keyManager = new _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_2__["ActiveDescendantKeyManager"](this.options)
.withTypeAhead()
.withVerticalOrientation()
.withHorizontalOrientation(this._isRtl() ? 'rtl' : 'ltr');
this._keyManager.tabOut.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["takeUntil"])(this._destroy)).subscribe(function () {
// Restore focus to the trigger before closing. Ensures that the focus
// position won't be lost if the user got focus into the overlay.
// Restore focus to the trigger before closing. Ensures that the focus
// position won't be lost if the user got focus into the overlay.
_this.focus();
_this.close();
});
this._keyManager.change.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["takeUntil"])(this._destroy)).subscribe(function () {
if (_this._panelOpen && _this.panel) {
_this._scrollActiveOptionIntoView();
}
else if (!_this._panelOpen && !_this.multiple && _this._keyManager.activeItem) {
_this._keyManager.activeItem._selectViaInteraction();
}
});
};
/**
* Drops current option subscriptions and IDs and resets from scratch.
* @return {?}
*/
MatSelect.prototype._resetOptions = /**
* Drops current option subscriptions and IDs and resets from scratch.
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ changedOrDestroyed = Object(rxjs__WEBPACK_IMPORTED_MODULE_12__["merge"])(this.options.changes, this._destroy);
this.optionSelectionChanges
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["takeUntil"])(changedOrDestroyed), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["filter"])(function (event) { return event.isUserInput; }))
.subscribe(function (event) {
_this._onSelect(event.source);
if (!_this.multiple && _this._panelOpen) {
_this.close();
_this.focus();
}
});
// Listen to changes in the internal state of the options and react accordingly.
// Handles cases like the labels of the selected options changing.
rxjs__WEBPACK_IMPORTED_MODULE_12__["merge"].apply(void 0, this.options.map(function (option) { return option._stateChanges; })).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_13__["takeUntil"])(changedOrDestroyed))
.subscribe(function () {
_this._changeDetectorRef.markForCheck();
_this.stateChanges.next();
});
this._setOptionIds();
};
/**
* Invoked when an option is clicked.
* @param {?} option
* @return {?}
*/
MatSelect.prototype._onSelect = /**
* Invoked when an option is clicked.
* @param {?} option
* @return {?}
*/
function (option) {
var /** @type {?} */ wasSelected = this._selectionModel.isSelected(option);
// TODO(crisbeto): handle blank/null options inside multi-select.
if (this.multiple) {
this._selectionModel.toggle(option);
this.stateChanges.next();
wasSelected ? option.deselect() : option.select();
this._keyManager.setActiveItem(option);
this._sortValues();
// In case the user select the option with their mouse, we
// want to restore focus back to the trigger, in order to
// prevent the select keyboard controls from clashing with
// the ones from `mat-option`.
this.focus();
}
else {
this._clearSelection(option.value == null ? undefined : option);
if (option.value == null) {
this._propagateChanges(option.value);
}
else {
this._selectionModel.select(option);
this.stateChanges.next();
}
}
if (wasSelected !== this._selectionModel.isSelected(option)) {
this._propagateChanges();
}
};
/**
* Sorts the model values, ensuring that they keep the same
* order that they have in the panel.
* @return {?}
*/
MatSelect.prototype._sortValues = /**
* Sorts the model values, ensuring that they keep the same
* order that they have in the panel.
* @return {?}
*/
function () {
var _this = this;
if (this._multiple) {
this._selectionModel.clear();
this.options.forEach(function (option) {
if (option.selected) {
_this._selectionModel.select(option);
}
});
this.stateChanges.next();
}
};
/**
* Emits change event to set the model value.
* @param {?=} fallbackValue
* @return {?}
*/
MatSelect.prototype._propagateChanges = /**
* Emits change event to set the model value.
* @param {?=} fallbackValue
* @return {?}
*/
function (fallbackValue) {
var /** @type {?} */ valueToEmit = null;
if (this.multiple) {
valueToEmit = (/** @type {?} */ (this.selected)).map(function (option) { return option.value; });
}
else {
valueToEmit = this.selected ? (/** @type {?} */ (this.selected)).value : fallbackValue;
}
this._value = valueToEmit;
this.valueChange.emit(valueToEmit);
this._onChange(valueToEmit);
this.selectionChange.emit(new MatSelectChange(this, valueToEmit));
this._changeDetectorRef.markForCheck();
};
/**
* Records option IDs to pass to the aria-owns property.
* @return {?}
*/
MatSelect.prototype._setOptionIds = /**
* Records option IDs to pass to the aria-owns property.
* @return {?}
*/
function () {
this._optionIds = this.options.map(function (option) { return option.id; }).join(' ');
};
/**
* Highlights the selected item. If no option is selected, it will highlight
* the first item instead.
* @return {?}
*/
MatSelect.prototype._highlightCorrectOption = /**
* Highlights the selected item. If no option is selected, it will highlight
* the first item instead.
* @return {?}
*/
function () {
if (this._keyManager) {
if (this.empty) {
this._keyManager.setFirstItemActive();
}
else {
this._keyManager.setActiveItem(this._selectionModel.selected[0]);
}
}
};
/**
* Scrolls the active option into view.
* @return {?}
*/
MatSelect.prototype._scrollActiveOptionIntoView = /**
* Scrolls the active option into view.
* @return {?}
*/
function () {
var /** @type {?} */ activeOptionIndex = this._keyManager.activeItemIndex || 0;
var /** @type {?} */ labelCount = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_10__["_countGroupLabelsBeforeOption"])(activeOptionIndex, this.options, this.optionGroups);
this.panel.nativeElement.scrollTop = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_10__["_getOptionScrollPosition"])(activeOptionIndex + labelCount, this._getItemHeight(), this.panel.nativeElement.scrollTop, SELECT_PANEL_MAX_HEIGHT);
};
/** Focuses the select element. */
/**
* Focuses the select element.
* @return {?}
*/
MatSelect.prototype.focus = /**
* Focuses the select element.
* @return {?}
*/
function () {
this._elementRef.nativeElement.focus();
};
/**
* Gets the index of the provided option in the option list.
* @param {?} option
* @return {?}
*/
MatSelect.prototype._getOptionIndex = /**
* Gets the index of the provided option in the option list.
* @param {?} option
* @return {?}
*/
function (option) {
return this.options.reduce(function (result, current, index) {
return result === undefined ? (option === current ? index : undefined) : result;
}, undefined);
};
/**
* Calculates the scroll position and x- and y-offsets of the overlay panel.
* @return {?}
*/
MatSelect.prototype._calculateOverlayPosition = /**
* Calculates the scroll position and x- and y-offsets of the overlay panel.
* @return {?}
*/
function () {
var /** @type {?} */ itemHeight = this._getItemHeight();
var /** @type {?} */ items = this._getItemCount();
var /** @type {?} */ panelHeight = Math.min(items * itemHeight, SELECT_PANEL_MAX_HEIGHT);
var /** @type {?} */ scrollContainerHeight = items * itemHeight;
// The farthest the panel can be scrolled before it hits the bottom
var /** @type {?} */ maxScroll = scrollContainerHeight - panelHeight;
// If no value is selected we open the popup to the first item.
var /** @type {?} */ selectedOptionOffset = this.empty ? 0 : /** @type {?} */ ((this._getOptionIndex(this._selectionModel.selected[0])));
selectedOptionOffset += Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_10__["_countGroupLabelsBeforeOption"])(selectedOptionOffset, this.options, this.optionGroups);
// We must maintain a scroll buffer so the selected option will be scrolled to the
// center of the overlay panel rather than the top.
var /** @type {?} */ scrollBuffer = panelHeight / 2;
this._scrollTop = this._calculateOverlayScroll(selectedOptionOffset, scrollBuffer, maxScroll);
this._offsetY = this._calculateOverlayOffsetY(selectedOptionOffset, scrollBuffer, maxScroll);
this._checkOverlayWithinViewport(maxScroll);
};
/**
* Calculates the scroll position of the select's overlay panel.
*
* Attempts to center the selected option in the panel. If the option is
* too high or too low in the panel to be scrolled to the center, it clamps the
* scroll position to the min or max scroll positions respectively.
*/
/**
* Calculates the scroll position of the select's overlay panel.
*
* Attempts to center the selected option in the panel. If the option is
* too high or too low in the panel to be scrolled to the center, it clamps the
* scroll position to the min or max scroll positions respectively.
* @param {?} selectedIndex
* @param {?} scrollBuffer
* @param {?} maxScroll
* @return {?}
*/
MatSelect.prototype._calculateOverlayScroll = /**
* Calculates the scroll position of the select's overlay panel.
*
* Attempts to center the selected option in the panel. If the option is
* too high or too low in the panel to be scrolled to the center, it clamps the
* scroll position to the min or max scroll positions respectively.
* @param {?} selectedIndex
* @param {?} scrollBuffer
* @param {?} maxScroll
* @return {?}
*/
function (selectedIndex, scrollBuffer, maxScroll) {
var /** @type {?} */ itemHeight = this._getItemHeight();
var /** @type {?} */ optionOffsetFromScrollTop = itemHeight * selectedIndex;
var /** @type {?} */ halfOptionHeight = itemHeight / 2;
// Starts at the optionOffsetFromScrollTop, which scrolls the option to the top of the
// scroll container, then subtracts the scroll buffer to scroll the option down to
// the center of the overlay panel. Half the option height must be re-added to the
// scrollTop so the option is centered based on its middle, not its top edge.
var /** @type {?} */ optimalScrollPosition = optionOffsetFromScrollTop - scrollBuffer + halfOptionHeight;
return Math.min(Math.max(0, optimalScrollPosition), maxScroll);
};
Object.defineProperty(MatSelect.prototype, "_ariaLabel", {
/** Returns the aria-label of the select component. */
get: /**
* Returns the aria-label of the select component.
* @return {?}
*/
function () {
// If an ariaLabelledby value has been set, the select should not overwrite the
// `aria-labelledby` value by setting the ariaLabel to the placeholder.
return this.ariaLabelledby ? null : this.ariaLabel || this.placeholder;
},
enumerable: true,
configurable: true
});
/** Determines the `aria-activedescendant` to be set on the host. */
/**
* Determines the `aria-activedescendant` to be set on the host.
* @return {?}
*/
MatSelect.prototype._getAriaActiveDescendant = /**
* Determines the `aria-activedescendant` to be set on the host.
* @return {?}
*/
function () {
if (this.panelOpen && this._keyManager && this._keyManager.activeItem) {
return this._keyManager.activeItem.id;
}
return null;
};
/**
* Sets the x-offset of the overlay panel in relation to the trigger's top start corner.
* This must be adjusted to align the selected option text over the trigger text when
* the panel opens. Will change based on LTR or RTL text direction. Note that the offset
* can't be calculated until the panel has been attached, because we need to know the
* content width in order to constrain the panel within the viewport.
* @return {?}
*/
MatSelect.prototype._calculateOverlayOffsetX = /**
* Sets the x-offset of the overlay panel in relation to the trigger's top start corner.
* This must be adjusted to align the selected option text over the trigger text when
* the panel opens. Will change based on LTR or RTL text direction. Note that the offset
* can't be calculated until the panel has been attached, because we need to know the
* content width in order to constrain the panel within the viewport.
* @return {?}
*/
function () {
var /** @type {?} */ overlayRect = this.overlayDir.overlayRef.overlayElement.getBoundingClientRect();
var /** @type {?} */ viewportSize = this._viewportRuler.getViewportSize();
var /** @type {?} */ isRtl = this._isRtl();
var /** @type {?} */ paddingWidth = this.multiple ? SELECT_MULTIPLE_PANEL_PADDING_X + SELECT_PANEL_PADDING_X :
SELECT_PANEL_PADDING_X * 2;
var /** @type {?} */ offsetX;
// Adjust the offset, depending on the option padding.
if (this.multiple) {
offsetX = SELECT_MULTIPLE_PANEL_PADDING_X;
}
else {
var /** @type {?} */ selected = this._selectionModel.selected[0] || this.options.first;
offsetX = selected && selected.group ? SELECT_PANEL_INDENT_PADDING_X : SELECT_PANEL_PADDING_X;
}
// Invert the offset in LTR.
if (!isRtl) {
offsetX *= -1;
}
// Determine how much the select overflows on each side.
var /** @type {?} */ leftOverflow = 0 - (overlayRect.left + offsetX - (isRtl ? paddingWidth : 0));
var /** @type {?} */ rightOverflow = overlayRect.right + offsetX - viewportSize.width
+ (isRtl ? 0 : paddingWidth);
// If the element overflows on either side, reduce the offset to allow it to fit.
if (leftOverflow > 0) {
offsetX += leftOverflow + SELECT_PANEL_VIEWPORT_PADDING;
}
else if (rightOverflow > 0) {
offsetX -= rightOverflow + SELECT_PANEL_VIEWPORT_PADDING;
}
// Set the offset directly in order to avoid having to go through change detection and
// potentially triggering "changed after it was checked" errors.
this.overlayDir.offsetX = offsetX;
this.overlayDir.overlayRef.updatePosition();
};
/**
* Calculates the y-offset of the select's overlay panel in relation to the
* top start corner of the trigger. It has to be adjusted in order for the
* selected option to be aligned over the trigger when the panel opens.
* @param {?} selectedIndex
* @param {?} scrollBuffer
* @param {?} maxScroll
* @return {?}
*/
MatSelect.prototype._calculateOverlayOffsetY = /**
* Calculates the y-offset of the select's overlay panel in relation to the
* top start corner of the trigger. It has to be adjusted in order for the
* selected option to be aligned over the trigger when the panel opens.
* @param {?} selectedIndex
* @param {?} scrollBuffer
* @param {?} maxScroll
* @return {?}
*/
function (selectedIndex, scrollBuffer, maxScroll) {
var /** @type {?} */ itemHeight = this._getItemHeight();
var /** @type {?} */ optionHeightAdjustment = (itemHeight - this._triggerRect.height) / 2;
var /** @type {?} */ maxOptionsDisplayed = Math.floor(SELECT_PANEL_MAX_HEIGHT / itemHeight);
var /** @type {?} */ optionOffsetFromPanelTop;
// Disable offset if requested by user by returning 0 as value to offset
if (this._disableOptionCentering) {
return 0;
}
if (this._scrollTop === 0) {
optionOffsetFromPanelTop = selectedIndex * itemHeight;
}
else if (this._scrollTop === maxScroll) {
var /** @type {?} */ firstDisplayedIndex = this._getItemCount() - maxOptionsDisplayed;
var /** @type {?} */ selectedDisplayIndex = selectedIndex - firstDisplayedIndex;
// The first item is partially out of the viewport. Therefore we need to calculate what
// portion of it is shown in the viewport and account for it in our offset.
var /** @type {?} */ partialItemHeight = itemHeight - (this._getItemCount() * itemHeight - SELECT_PANEL_MAX_HEIGHT) % itemHeight;
// Because the panel height is longer than the height of the options alone,
// there is always extra padding at the top or bottom of the panel. When
// scrolled to the very bottom, this padding is at the top of the panel and
// must be added to the offset.
optionOffsetFromPanelTop = selectedDisplayIndex * itemHeight + partialItemHeight;
}
else {
// If the option was scrolled to the middle of the panel using a scroll buffer,
// its offset will be the scroll buffer minus the half height that was added to
// center it.
optionOffsetFromPanelTop = scrollBuffer - itemHeight / 2;
}
// The final offset is the option's offset from the top, adjusted for the height
// difference, multiplied by -1 to ensure that the overlay moves in the correct
// direction up the page.
return optionOffsetFromPanelTop * -1 - optionHeightAdjustment;
};
/**
* Checks that the attempted overlay position will fit within the viewport.
* If it will not fit, tries to adjust the scroll position and the associated
* y-offset so the panel can open fully on-screen. If it still won't fit,
* sets the offset back to 0 to allow the fallback position to take over.
* @param {?} maxScroll
* @return {?}
*/
MatSelect.prototype._checkOverlayWithinViewport = /**
* Checks that the attempted overlay position will fit within the viewport.
* If it will not fit, tries to adjust the scroll position and the associated
* y-offset so the panel can open fully on-screen. If it still won't fit,
* sets the offset back to 0 to allow the fallback position to take over.
* @param {?} maxScroll
* @return {?}
*/
function (maxScroll) {
var /** @type {?} */ itemHeight = this._getItemHeight();
var /** @type {?} */ viewportSize = this._viewportRuler.getViewportSize();
var /** @type {?} */ topSpaceAvailable = this._triggerRect.top - SELECT_PANEL_VIEWPORT_PADDING;
var /** @type {?} */ bottomSpaceAvailable = viewportSize.height - this._triggerRect.bottom - SELECT_PANEL_VIEWPORT_PADDING;
var /** @type {?} */ panelHeightTop = Math.abs(this._offsetY);
var /** @type {?} */ totalPanelHeight = Math.min(this._getItemCount() * itemHeight, SELECT_PANEL_MAX_HEIGHT);
var /** @type {?} */ panelHeightBottom = totalPanelHeight - panelHeightTop - this._triggerRect.height;
if (panelHeightBottom > bottomSpaceAvailable) {
this._adjustPanelUp(panelHeightBottom, bottomSpaceAvailable);
}
else if (panelHeightTop > topSpaceAvailable) {
this._adjustPanelDown(panelHeightTop, topSpaceAvailable, maxScroll);
}
else {
this._transformOrigin = this._getOriginBasedOnOption();
}
};
/**
* Adjusts the overlay panel up to fit in the viewport.
* @param {?} panelHeightBottom
* @param {?} bottomSpaceAvailable
* @return {?}
*/
MatSelect.prototype._adjustPanelUp = /**
* Adjusts the overlay panel up to fit in the viewport.
* @param {?} panelHeightBottom
* @param {?} bottomSpaceAvailable
* @return {?}
*/
function (panelHeightBottom, bottomSpaceAvailable) {
// Browsers ignore fractional scroll offsets, so we need to round.
var /** @type {?} */ distanceBelowViewport = Math.round(panelHeightBottom - bottomSpaceAvailable);
// Scrolls the panel up by the distance it was extending past the boundary, then
// adjusts the offset by that amount to move the panel up into the viewport.
this._scrollTop -= distanceBelowViewport;
this._offsetY -= distanceBelowViewport;
this._transformOrigin = this._getOriginBasedOnOption();
// If the panel is scrolled to the very top, it won't be able to fit the panel
// by scrolling, so set the offset to 0 to allow the fallback position to take
// effect.
if (this._scrollTop <= 0) {
this._scrollTop = 0;
this._offsetY = 0;
this._transformOrigin = "50% bottom 0px";
}
};
/**
* Adjusts the overlay panel down to fit in the viewport.
* @param {?} panelHeightTop
* @param {?} topSpaceAvailable
* @param {?} maxScroll
* @return {?}
*/
MatSelect.prototype._adjustPanelDown = /**
* Adjusts the overlay panel down to fit in the viewport.
* @param {?} panelHeightTop
* @param {?} topSpaceAvailable
* @param {?} maxScroll
* @return {?}
*/
function (panelHeightTop, topSpaceAvailable, maxScroll) {
// Browsers ignore fractional scroll offsets, so we need to round.
var /** @type {?} */ distanceAboveViewport = Math.round(panelHeightTop - topSpaceAvailable);
// Scrolls the panel down by the distance it was extending past the boundary, then
// adjusts the offset by that amount to move the panel down into the viewport.
this._scrollTop += distanceAboveViewport;
this._offsetY += distanceAboveViewport;
this._transformOrigin = this._getOriginBasedOnOption();
// If the panel is scrolled to the very bottom, it won't be able to fit the
// panel by scrolling, so set the offset to 0 to allow the fallback position
// to take effect.
if (this._scrollTop >= maxScroll) {
this._scrollTop = maxScroll;
this._offsetY = 0;
this._transformOrigin = "50% top 0px";
return;
}
};
/**
* Sets the transform origin point based on the selected option.
* @return {?}
*/
MatSelect.prototype._getOriginBasedOnOption = /**
* Sets the transform origin point based on the selected option.
* @return {?}
*/
function () {
var /** @type {?} */ itemHeight = this._getItemHeight();
var /** @type {?} */ optionHeightAdjustment = (itemHeight - this._triggerRect.height) / 2;
var /** @type {?} */ originY = Math.abs(this._offsetY) - optionHeightAdjustment + itemHeight / 2;
return "50% " + originY + "px 0px";
};
/**
* Calculates the amount of items in the select. This includes options and group labels.
* @return {?}
*/
MatSelect.prototype._getItemCount = /**
* Calculates the amount of items in the select. This includes options and group labels.
* @return {?}
*/
function () {
return this.options.length + this.optionGroups.length;
};
/**
* Calculates the height of the select's options.
* @return {?}
*/
MatSelect.prototype._getItemHeight = /**
* Calculates the height of the select's options.
* @return {?}
*/
function () {
return this._triggerFontSize * SELECT_ITEM_HEIGHT_EM;
};
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
/**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @param {?} ids
* @return {?}
*/
MatSelect.prototype.setDescribedByIds = /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @param {?} ids
* @return {?}
*/
function (ids) {
this._ariaDescribedby = ids.join(' ');
};
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
/**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
MatSelect.prototype.onContainerClick = /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () {
this.focus();
this.open();
};
Object.defineProperty(MatSelect.prototype, "shouldLabelFloat", {
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get: /**
* Implemented as part of MatFormFieldControl.
* \@docs-private
* @return {?}
*/
function () {
return this._panelOpen || !this.empty;
},
enumerable: true,
configurable: true
});
MatSelect.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Component"], args: [{selector: 'mat-select',
exportAs: 'matSelect',
template: "<div cdk-overlay-origin class=\"mat-select-trigger\" aria-hidden=\"true\" (click)=\"toggle()\" #origin=\"cdkOverlayOrigin\" #trigger><div class=\"mat-select-value\" [ngSwitch]=\"empty\"><span class=\"mat-select-placeholder\" *ngSwitchCase=\"true\">{{placeholder || '\u00A0'}}</span> <span class=\"mat-select-value-text\" *ngSwitchCase=\"false\" [ngSwitch]=\"!!customTrigger\"><span *ngSwitchDefault>{{triggerValue}}</span><ng-content select=\"mat-select-trigger\" *ngSwitchCase=\"true\"></ng-content></span></div><div class=\"mat-select-arrow-wrapper\"><div class=\"mat-select-arrow\"></div></div></div><ng-template cdk-connected-overlay cdkConnectedOverlayLockPosition cdkConnectedOverlayHasBackdrop cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\" [cdkConnectedOverlayScrollStrategy]=\"_scrollStrategy\" [cdkConnectedOverlayOrigin]=\"origin\" [cdkConnectedOverlayOpen]=\"panelOpen\" [cdkConnectedOverlayPositions]=\"_positions\" [cdkConnectedOverlayMinWidth]=\"_triggerRect?.width\" [cdkConnectedOverlayOffsetY]=\"_offsetY\" (backdropClick)=\"close()\" (attach)=\"_onAttached()\" (detach)=\"close()\"><div #panel class=\"mat-select-panel {{ _getPanelTheme() }}\" [ngClass]=\"panelClass\" [@transformPanel]=\"multiple ? 'showing-multiple' : 'showing'\" (@transformPanel.done)=\"_onPanelDone()\" [style.transformOrigin]=\"_transformOrigin\" [class.mat-select-panel-done-animating]=\"_panelDoneAnimating\" [style.font-size.px]=\"_triggerFontSize\" (keydown)=\"_handleKeydown($event)\"><div class=\"mat-select-content\" [@fadeInContent]=\"'showing'\" (@fadeInContent.done)=\"_onFadeInDone()\"><ng-content></ng-content></div></div></ng-template>",
styles: [".mat-select{display:inline-block;width:100%;outline:0}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper,.mat-form-field-appearance-standard .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%}.mat-select-panel:not([class*=mat-elevation-z]){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}@media screen and (-ms-high-contrast:active){.mat-select-panel{outline:solid 1px}}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;transition:none;display:block}"],
inputs: ['disabled', 'disableRipple', 'tabIndex'],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_8__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_8__["ChangeDetectionStrategy"].OnPush,
host: {
'role': 'listbox',
'[attr.id]': 'id',
'[attr.tabindex]': 'tabIndex',
'[attr.aria-label]': '_ariaLabel',
'[attr.aria-labelledby]': 'ariaLabelledby',
'[attr.aria-required]': 'required.toString()',
'[attr.aria-disabled]': 'disabled.toString()',
'[attr.aria-invalid]': 'errorState',
'[attr.aria-owns]': 'panelOpen ? _optionIds : null',
'[attr.aria-multiselectable]': 'multiple',
'[attr.aria-describedby]': '_ariaDescribedby || null',
'[attr.aria-activedescendant]': '_getAriaActiveDescendant()',
'[class.mat-select-disabled]': 'disabled',
'[class.mat-select-invalid]': 'errorState',
'[class.mat-select-required]': 'required',
'class': 'mat-select',
'(keydown)': '_handleKeydown($event)',
'(focus)': '_onFocus()',
'(blur)': '_onBlur()',
},
animations: [
matSelectAnimations.transformPanel,
matSelectAnimations.fadeInContent
],
providers: [
{ provide: _angular_material_form_field__WEBPACK_IMPORTED_MODULE_11__["MatFormFieldControl"], useExisting: MatSelect },
{ provide: _angular_material_core__WEBPACK_IMPORTED_MODULE_10__["MAT_OPTION_PARENT_COMPONENT"], useExisting: MatSelect }
],
},] },
];
/** @nocollapse */
MatSelect.ctorParameters = function () { return [
{ type: _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["ViewportRuler"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["ChangeDetectorRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["NgZone"], },
{ type: _angular_material_core__WEBPACK_IMPORTED_MODULE_10__["ErrorStateMatcher"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["ElementRef"], },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_3__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Optional"] },] },
{ type: _angular_forms__WEBPACK_IMPORTED_MODULE_9__["NgForm"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Optional"] },] },
{ type: _angular_forms__WEBPACK_IMPORTED_MODULE_9__["FormGroupDirective"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Optional"] },] },
{ type: _angular_material_form_field__WEBPACK_IMPORTED_MODULE_11__["MatFormField"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Optional"] },] },
{ type: _angular_forms__WEBPACK_IMPORTED_MODULE_9__["NgControl"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Optional"] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Attribute"], args: ['tabindex',] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Inject"], args: [MAT_SELECT_SCROLL_STRATEGY,] },] },
]; };
MatSelect.propDecorators = {
"trigger": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["ViewChild"], args: ['trigger',] },],
"panel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["ViewChild"], args: ['panel',] },],
"overlayDir": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["ViewChild"], args: [_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["CdkConnectedOverlay"],] },],
"options": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["ContentChildren"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_10__["MatOption"], { descendants: true },] },],
"optionGroups": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["ContentChildren"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_10__["MatOptgroup"],] },],
"panelClass": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Input"] },],
"customTrigger": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["ContentChild"], args: [MatSelectTrigger,] },],
"placeholder": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Input"] },],
"required": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Input"] },],
"multiple": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Input"] },],
"disableOptionCentering": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Input"] },],
"compareWith": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Input"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Input"] },],
"ariaLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Input"], args: ['aria-label',] },],
"ariaLabelledby": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Input"], args: ['aria-labelledby',] },],
"errorStateMatcher": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Input"] },],
"id": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Input"] },],
"openedChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Output"] },],
"_openedStream": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Output"], args: ['opened',] },],
"_closedStream": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Output"], args: ['closed',] },],
"selectionChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Output"] },],
"valueChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["Output"] },],
};
return MatSelect;
}(_MatSelectMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatSelectModule = /** @class */ (function () {
function MatSelectModule() {
}
MatSelectModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_8__["NgModule"], args: [{
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_14__["CommonModule"],
_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["OverlayModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_10__["MatOptionModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_10__["MatCommonModule"],
],
exports: [_angular_material_form_field__WEBPACK_IMPORTED_MODULE_11__["MatFormFieldModule"], MatSelect, MatSelectTrigger, _angular_material_core__WEBPACK_IMPORTED_MODULE_10__["MatOptionModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_10__["MatCommonModule"]],
declarations: [MatSelect, MatSelectTrigger],
providers: [MAT_SELECT_SCROLL_STRATEGY_PROVIDER]
},] },
];
return MatSelectModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=select.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/sidenav.es5.js":
/*!************************************************************!*\
!*** ./node_modules/@angular/material/esm5/sidenav.es5.js ***!
\************************************************************/
/*! exports provided: MatSidenavModule, throwMatDuplicatedDrawerError, MAT_DRAWER_DEFAULT_AUTOSIZE, MAT_DRAWER_DEFAULT_AUTOSIZE_FACTORY, MatDrawerContent, MatDrawer, MatDrawerContainer, MatSidenavContent, MatSidenav, MatSidenavContainer, matDrawerAnimations */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSidenavModule", function() { return MatSidenavModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwMatDuplicatedDrawerError", function() { return throwMatDuplicatedDrawerError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DRAWER_DEFAULT_AUTOSIZE", function() { return MAT_DRAWER_DEFAULT_AUTOSIZE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_DRAWER_DEFAULT_AUTOSIZE_FACTORY", function() { return MAT_DRAWER_DEFAULT_AUTOSIZE_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDrawerContent", function() { return MatDrawerContent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDrawer", function() { return MatDrawer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatDrawerContainer", function() { return MatDrawerContainer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSidenavContent", function() { return MatSidenavContent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSidenav", function() { return MatSidenav; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSidenavContainer", function() { return MatSidenavContainer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matDrawerAnimations", function() { return matDrawerAnimations; });
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/scrolling */ "./node_modules/@angular/cdk/esm5/scrolling.es5.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/platform-browser/animations */ "./node_modules/@angular/platform-browser/fesm5/animations.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Animations used by the Material drawers.
*/
var /** @type {?} */ matDrawerAnimations = {
/** Animation that slides a drawer in and out. */
transformDrawer: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["trigger"])('transform', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["state"])('open, open-instant', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({
'transform': 'translate3d(0, 0, 0)',
'visibility': 'visible',
})),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["state"])('void', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({
// Avoids the shadow showing up when closed in SSR.
'box-shadow': 'none',
'visibility': 'hidden',
})),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["transition"])('void => open-instant', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["animate"])('0ms')),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["transition"])('void <=> open, open-instant => void', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["animate"])('400ms cubic-bezier(0.25, 0.8, 0.25, 1)'))
])
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Throws an exception when two MatDrawer are matching the same position.
* @param {?} position
* @return {?}
*/
function throwMatDuplicatedDrawerError(position) {
throw Error("A drawer was already declared for 'position=\"" + position + "\"'");
}
/**
* Configures whether drawers should use auto sizing by default.
*/
var /** @type {?} */ MAT_DRAWER_DEFAULT_AUTOSIZE = new _angular_core__WEBPACK_IMPORTED_MODULE_7__["InjectionToken"]('MAT_DRAWER_DEFAULT_AUTOSIZE', {
providedIn: 'root',
factory: MAT_DRAWER_DEFAULT_AUTOSIZE_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function MAT_DRAWER_DEFAULT_AUTOSIZE_FACTORY() {
return false;
}
var MatDrawerContent = /** @class */ (function () {
function MatDrawerContent(_changeDetectorRef, _container) {
this._changeDetectorRef = _changeDetectorRef;
this._container = _container;
}
/**
* @return {?}
*/
MatDrawerContent.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
this._container._contentMarginChanges.subscribe(function () {
_this._changeDetectorRef.markForCheck();
});
};
MatDrawerContent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Component"], args: [{selector: 'mat-drawer-content',
template: '<ng-content></ng-content>',
host: {
'class': 'mat-drawer-content',
'[style.margin-left.px]': '_container._contentMargins.left',
'[style.margin-right.px]': '_container._contentMargins.right',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatDrawerContent.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ChangeDetectorRef"], },
{ type: MatDrawerContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Inject"], args: [Object(_angular_core__WEBPACK_IMPORTED_MODULE_7__["forwardRef"])(function () { return MatDrawerContainer; }),] },] },
]; };
return MatDrawerContent;
}());
/**
* This component corresponds to a drawer that can be opened on the drawer container.
*/
var MatDrawer = /** @class */ (function () {
function MatDrawer(_elementRef, _focusTrapFactory, _focusMonitor, _platform, _ngZone, _doc) {
var _this = this;
this._elementRef = _elementRef;
this._focusTrapFactory = _focusTrapFactory;
this._focusMonitor = _focusMonitor;
this._platform = _platform;
this._ngZone = _ngZone;
this._doc = _doc;
this._elementFocusedBeforeDrawerWasOpened = null;
/**
* Whether the drawer is initialized. Used for disabling the initial animation.
*/
this._enableAnimations = false;
this._position = 'start';
this._mode = 'over';
this._disableClose = false;
this._autoFocus = true;
/**
* Emits whenever the drawer has started animating.
*/
this._animationStarted = new _angular_core__WEBPACK_IMPORTED_MODULE_7__["EventEmitter"]();
/**
* Current state of the sidenav animation.
*/
this._animationState = 'void';
/**
* Event emitted when the drawer open state is changed.
*/
this.openedChange =
// Note this has to be async in order to avoid some issues with two-bindings (see #8872).
new _angular_core__WEBPACK_IMPORTED_MODULE_7__["EventEmitter"](/* isAsync */ /* isAsync */ true);
/**
* Event emitted when the drawer's position changes.
*/
this.onPositionChanged = new _angular_core__WEBPACK_IMPORTED_MODULE_7__["EventEmitter"]();
/**
* An observable that emits when the drawer mode changes. This is used by the drawer container to
* to know when to when the mode changes so it can adapt the margins on the content.
*/
this._modeChanged = new rxjs__WEBPACK_IMPORTED_MODULE_10__["Subject"]();
this._opened = false;
this.openedChange.subscribe(function (opened) {
if (opened) {
if (_this._doc) {
_this._elementFocusedBeforeDrawerWasOpened = /** @type {?} */ (_this._doc.activeElement);
}
if (_this._isFocusTrapEnabled && _this._focusTrap) {
_this._trapFocus();
}
}
else {
_this._restoreFocus();
}
});
/**
* Listen to `keydown` events outside the zone so that change detection is not run every
* time a key is pressed. Instead we re-enter the zone only if the `ESC` key is pressed
* and we don't have close disabled.
*/
this._ngZone.runOutsideAngular(function () {
Object(rxjs__WEBPACK_IMPORTED_MODULE_10__["fromEvent"])(_this._elementRef.nativeElement, 'keydown').pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["filter"])(function (event) { return event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["ESCAPE"] && !_this.disableClose; })).subscribe(function (event) {
return _this._ngZone.run(function () {
_this.close();
event.stopPropagation();
});
});
});
}
Object.defineProperty(MatDrawer.prototype, "position", {
get: /**
* The side that the drawer is attached to.
* @return {?}
*/
function () { return this._position; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
// Make sure we have a valid value.
value = value === 'end' ? 'end' : 'start';
if (value != this._position) {
this._position = value;
this.onPositionChanged.emit();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDrawer.prototype, "mode", {
get: /**
* Mode of the drawer; one of 'over', 'push' or 'side'.
* @return {?}
*/
function () { return this._mode; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._mode = value;
this._modeChanged.next();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDrawer.prototype, "disableClose", {
get: /**
* Whether the drawer can be closed with the escape key or by clicking on the backdrop.
* @return {?}
*/
function () { return this._disableClose; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._disableClose = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatDrawer.prototype, "autoFocus", {
get: /**
* Whether the drawer should focus the first focusable element automatically when opened.
* @return {?}
*/
function () { return this._autoFocus; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._autoFocus = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatDrawer.prototype, "_openedStream", {
get: /**
* Event emitted when the drawer has been opened.
* @return {?}
*/
function () {
return this.openedChange.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["filter"])(function (o) { return o; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["map"])(function () { }));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDrawer.prototype, "openedStart", {
get: /**
* Event emitted when the drawer has started opening.
* @return {?}
*/
function () {
return this._animationStarted.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["filter"])(function (e) { return e.fromState !== e.toState && e.toState.indexOf('open') === 0; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["map"])(function () { }));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDrawer.prototype, "_closedStream", {
get: /**
* Event emitted when the drawer has been closed.
* @return {?}
*/
function () {
return this.openedChange.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["filter"])(function (o) { return !o; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["map"])(function () { }));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDrawer.prototype, "closedStart", {
get: /**
* Event emitted when the drawer has started closing.
* @return {?}
*/
function () {
return this._animationStarted.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["filter"])(function (e) { return e.fromState !== e.toState && e.toState === 'void'; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["map"])(function () { }));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatDrawer.prototype, "_isFocusTrapEnabled", {
get: /**
* @return {?}
*/
function () {
// The focus trap is only enabled when the drawer is open in any mode other than side.
return this.opened && this.mode !== 'side';
},
enumerable: true,
configurable: true
});
/**
* Traps focus inside the drawer.
* @return {?}
*/
MatDrawer.prototype._trapFocus = /**
* Traps focus inside the drawer.
* @return {?}
*/
function () {
var _this = this;
if (!this.autoFocus) {
return;
}
this._focusTrap.focusInitialElementWhenReady().then(function (hasMovedFocus) {
// If there were no focusable elements, focus the sidenav itself so the keyboard navigation
// still works. We need to check that `focus` is a function due to Universal.
if (!hasMovedFocus && typeof _this._elementRef.nativeElement.focus === 'function') {
_this._elementRef.nativeElement.focus();
}
});
};
/**
* If focus is currently inside the drawer, restores it to where it was before the drawer
* opened.
* @return {?}
*/
MatDrawer.prototype._restoreFocus = /**
* If focus is currently inside the drawer, restores it to where it was before the drawer
* opened.
* @return {?}
*/
function () {
if (!this.autoFocus) {
return;
}
var /** @type {?} */ activeEl = this._doc && this._doc.activeElement;
if (activeEl && this._elementRef.nativeElement.contains(activeEl)) {
if (this._elementFocusedBeforeDrawerWasOpened instanceof HTMLElement) {
this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened, this._openedVia);
}
else {
this._elementRef.nativeElement.blur();
}
}
this._elementFocusedBeforeDrawerWasOpened = null;
this._openedVia = null;
};
/**
* @return {?}
*/
MatDrawer.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
this._focusTrap.enabled = this._isFocusTrapEnabled;
};
/**
* @return {?}
*/
MatDrawer.prototype.ngAfterContentChecked = /**
* @return {?}
*/
function () {
// Enable the animations after the lifecycle hooks have run, in order to avoid animating
// drawers that are open by default. When we're on the server, we shouldn't enable the
// animations, because we don't want the drawer to animate the first time the user sees
// the page.
if (this._platform.isBrowser) {
this._enableAnimations = true;
}
};
/**
* @return {?}
*/
MatDrawer.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this._focusTrap) {
this._focusTrap.destroy();
}
};
Object.defineProperty(MatDrawer.prototype, "opened", {
get: /**
* Whether the drawer is opened. We overload this because we trigger an event when it
* starts or end.
* @return {?}
*/
function () { return this._opened; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this.toggle(Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value)); },
enumerable: true,
configurable: true
});
/**
* Open the drawer.
* @param openedVia Whether the drawer was opened by a key press, mouse click or programmatically.
* Used for focus management after the sidenav is closed.
*/
/**
* Open the drawer.
* @param {?=} openedVia Whether the drawer was opened by a key press, mouse click or programmatically.
* Used for focus management after the sidenav is closed.
* @return {?}
*/
MatDrawer.prototype.open = /**
* Open the drawer.
* @param {?=} openedVia Whether the drawer was opened by a key press, mouse click or programmatically.
* Used for focus management after the sidenav is closed.
* @return {?}
*/
function (openedVia) {
return this.toggle(true, openedVia);
};
/** Close the drawer. */
/**
* Close the drawer.
* @return {?}
*/
MatDrawer.prototype.close = /**
* Close the drawer.
* @return {?}
*/
function () {
return this.toggle(false);
};
/**
* Toggle this drawer.
* @param isOpen Whether the drawer should be open.
* @param openedVia Whether the drawer was opened by a key press, mouse click or programmatically.
* Used for focus management after the sidenav is closed.
*/
/**
* Toggle this drawer.
* @param {?=} isOpen Whether the drawer should be open.
* @param {?=} openedVia Whether the drawer was opened by a key press, mouse click or programmatically.
* Used for focus management after the sidenav is closed.
* @return {?}
*/
MatDrawer.prototype.toggle = /**
* Toggle this drawer.
* @param {?=} isOpen Whether the drawer should be open.
* @param {?=} openedVia Whether the drawer was opened by a key press, mouse click or programmatically.
* Used for focus management after the sidenav is closed.
* @return {?}
*/
function (isOpen, openedVia) {
var _this = this;
if (isOpen === void 0) { isOpen = !this.opened; }
if (openedVia === void 0) { openedVia = 'program'; }
this._opened = isOpen;
if (isOpen) {
this._animationState = this._enableAnimations ? 'open' : 'open-instant';
this._openedVia = openedVia;
}
else {
this._animationState = 'void';
this._restoreFocus();
}
if (this._focusTrap) {
this._focusTrap.enabled = this._isFocusTrapEnabled;
}
return new Promise(function (resolve) {
_this.openedChange.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["take"])(1)).subscribe(function (open) { return resolve(open ? 'open' : 'close'); });
});
};
/**
* @param {?} event
* @return {?}
*/
MatDrawer.prototype._onAnimationStart = /**
* @param {?} event
* @return {?}
*/
function (event) {
this._animationStarted.emit(event);
};
/**
* @param {?} event
* @return {?}
*/
MatDrawer.prototype._onAnimationEnd = /**
* @param {?} event
* @return {?}
*/
function (event) {
var fromState = event.fromState, toState = event.toState;
if ((toState.indexOf('open') === 0 && fromState === 'void') ||
(toState === 'void' && fromState.indexOf('open') === 0)) {
this.openedChange.emit(this._opened);
}
};
Object.defineProperty(MatDrawer.prototype, "_width", {
get: /**
* @return {?}
*/
function () {
return this._elementRef.nativeElement ? (this._elementRef.nativeElement.offsetWidth || 0) : 0;
},
enumerable: true,
configurable: true
});
MatDrawer.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Component"], args: [{selector: 'mat-drawer',
exportAs: 'matDrawer',
template: '<ng-content></ng-content>',
animations: [matDrawerAnimations.transformDrawer],
host: {
'class': 'mat-drawer',
'[@transform]': '_animationState',
'(@transform.start)': '_onAnimationStart($event)',
'(@transform.done)': '_onAnimationEnd($event)',
// must prevent the browser from aligning text based on value
'[attr.align]': 'null',
'[class.mat-drawer-end]': 'position === "end"',
'[class.mat-drawer-over]': 'mode === "over"',
'[class.mat-drawer-push]': 'mode === "push"',
'[class.mat-drawer-side]': 'mode === "side"',
'tabIndex': '-1',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatDrawer.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ElementRef"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__["FocusTrapFactory"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__["FocusMonitor"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_5__["Platform"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["NgZone"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_8__["DOCUMENT"],] },] },
]; };
MatDrawer.propDecorators = {
"position": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Input"] },],
"mode": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Input"] },],
"disableClose": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Input"] },],
"autoFocus": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Input"] },],
"openedChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Output"] },],
"_openedStream": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Output"], args: ['opened',] },],
"openedStart": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Output"] },],
"_closedStream": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Output"], args: ['closed',] },],
"closedStart": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Output"] },],
"onPositionChanged": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Output"], args: ['positionChanged',] },],
"opened": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Input"] },],
};
return MatDrawer;
}());
/**
* `<mat-drawer-container>` component.
*
* This is the parent component to one or two `<mat-drawer>`s that validates the state internally
* and coordinates the backdrop and content styling.
*/
var MatDrawerContainer = /** @class */ (function () {
function MatDrawerContainer(_dir, _element, _ngZone, _changeDetectorRef, defaultAutosize, _animationMode) {
if (defaultAutosize === void 0) { defaultAutosize = false; }
var _this = this;
this._dir = _dir;
this._element = _element;
this._ngZone = _ngZone;
this._changeDetectorRef = _changeDetectorRef;
this._animationMode = _animationMode;
/**
* Event emitted when the drawer backdrop is clicked.
*/
this.backdropClick = new _angular_core__WEBPACK_IMPORTED_MODULE_7__["EventEmitter"]();
/**
* Emits when the component is destroyed.
*/
this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_10__["Subject"]();
/**
* Emits on every ngDoCheck. Used for debouncing reflows.
*/
this._doCheckSubject = new rxjs__WEBPACK_IMPORTED_MODULE_10__["Subject"]();
/**
* Margins to be applied to the content. These are used to push / shrink the drawer content when a
* drawer is open. We use margin rather than transform even for push mode because transform breaks
* fixed position elements inside of the transformed element.
*/
this._contentMargins = { left: null, right: null };
this._contentMarginChanges = new rxjs__WEBPACK_IMPORTED_MODULE_10__["Subject"]();
// If a `Dir` directive exists up the tree, listen direction changes
// and update the left/right properties to point to the proper start/end.
if (_dir) {
_dir.change.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["takeUntil"])(this._destroyed)).subscribe(function () {
_this._validateDrawers();
_this._updateContentMargins();
});
}
this._autosize = defaultAutosize;
}
Object.defineProperty(MatDrawerContainer.prototype, "start", {
/** The drawer child with the `start` position. */
get: /**
* The drawer child with the `start` position.
* @return {?}
*/
function () { return this._start; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatDrawerContainer.prototype, "end", {
/** The drawer child with the `end` position. */
get: /**
* The drawer child with the `end` position.
* @return {?}
*/
function () { return this._end; },
enumerable: true,
configurable: true
});
Object.defineProperty(MatDrawerContainer.prototype, "autosize", {
get: /**
* Whether to automatically resize the container whenever
* the size of any of its drawers changes.
*
* **Use at your own risk!** Enabling this option can cause layout thrashing by measuring
* the drawers on every change detection cycle. Can be configured globally via the
* `MAT_DRAWER_DEFAULT_AUTOSIZE` token.
* @return {?}
*/
function () { return this._autosize; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._autosize = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatDrawerContainer.prototype, "hasBackdrop", {
get: /**
* Whether the drawer container should have a backdrop while one of the sidenavs is open.
* If explicitly set to `true`, the backdrop will be enabled for drawers in the `side`
* mode as well.
* @return {?}
*/
function () {
if (this._backdropOverride == null) {
return !this._start || this._start.mode !== 'side' || !this._end || this._end.mode !== 'side';
}
return this._backdropOverride;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._backdropOverride = value == null ? null : Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatDrawerContainer.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
this._drawers.changes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["startWith"])(null)).subscribe(function () {
_this._validateDrawers();
_this._drawers.forEach(function (drawer) {
_this._watchDrawerToggle(drawer);
_this._watchDrawerPosition(drawer);
_this._watchDrawerMode(drawer);
});
if (!_this._drawers.length ||
_this._isDrawerOpen(_this._start) ||
_this._isDrawerOpen(_this._end)) {
_this._updateContentMargins();
}
_this._changeDetectorRef.markForCheck();
});
this._doCheckSubject.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["debounceTime"])(10), // Arbitrary debounce time, less than a frame at 60fps
// Arbitrary debounce time, less than a frame at 60fps
Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["takeUntil"])(this._destroyed)).subscribe(function () { return _this._updateContentMargins(); });
};
/**
* @return {?}
*/
MatDrawerContainer.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._doCheckSubject.complete();
this._destroyed.next();
this._destroyed.complete();
};
/** Calls `open` of both start and end drawers */
/**
* Calls `open` of both start and end drawers
* @return {?}
*/
MatDrawerContainer.prototype.open = /**
* Calls `open` of both start and end drawers
* @return {?}
*/
function () {
this._drawers.forEach(function (drawer) { return drawer.open(); });
};
/** Calls `close` of both start and end drawers */
/**
* Calls `close` of both start and end drawers
* @return {?}
*/
MatDrawerContainer.prototype.close = /**
* Calls `close` of both start and end drawers
* @return {?}
*/
function () {
this._drawers.forEach(function (drawer) { return drawer.close(); });
};
/**
* @return {?}
*/
MatDrawerContainer.prototype.ngDoCheck = /**
* @return {?}
*/
function () {
var _this = this;
// If users opted into autosizing, do a check every change detection cycle.
if (this._autosize && this._isPushed()) {
// Run outside the NgZone, otherwise the debouncer will throw us into an infinite loop.
this._ngZone.runOutsideAngular(function () { return _this._doCheckSubject.next(); });
}
};
/**
* Subscribes to drawer events in order to set a class on the main container element when the
* drawer is open and the backdrop is visible. This ensures any overflow on the container element
* is properly hidden.
* @param {?} drawer
* @return {?}
*/
MatDrawerContainer.prototype._watchDrawerToggle = /**
* Subscribes to drawer events in order to set a class on the main container element when the
* drawer is open and the backdrop is visible. This ensures any overflow on the container element
* is properly hidden.
* @param {?} drawer
* @return {?}
*/
function (drawer) {
var _this = this;
drawer._animationStarted.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["takeUntil"])(this._drawers.changes), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["filter"])(function (event) { return event.fromState !== event.toState; }))
.subscribe(function (event) {
// Set the transition class on the container so that the animations occur. This should not
// be set initially because animations should only be triggered via a change in state.
if (event.toState !== 'open-instant' && _this._animationMode !== 'NoopAnimations') {
_this._element.nativeElement.classList.add('mat-drawer-transition');
}
_this._updateContentMargins();
_this._changeDetectorRef.markForCheck();
});
if (drawer.mode !== 'side') {
drawer.openedChange.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["takeUntil"])(this._drawers.changes)).subscribe(function () {
return _this._setContainerClass(drawer.opened);
});
}
};
/**
* Subscribes to drawer onPositionChanged event in order to
* re-validate drawers when the position changes.
* @param {?} drawer
* @return {?}
*/
MatDrawerContainer.prototype._watchDrawerPosition = /**
* Subscribes to drawer onPositionChanged event in order to
* re-validate drawers when the position changes.
* @param {?} drawer
* @return {?}
*/
function (drawer) {
var _this = this;
if (!drawer) {
return;
}
// NOTE: We need to wait for the microtask queue to be empty before validating,
// since both drawers may be swapping positions at the same time.
drawer.onPositionChanged.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["takeUntil"])(this._drawers.changes)).subscribe(function () {
_this._ngZone.onMicrotaskEmpty.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["take"])(1)).subscribe(function () {
_this._validateDrawers();
});
});
};
/**
* Subscribes to changes in drawer mode so we can run change detection.
* @param {?} drawer
* @return {?}
*/
MatDrawerContainer.prototype._watchDrawerMode = /**
* Subscribes to changes in drawer mode so we can run change detection.
* @param {?} drawer
* @return {?}
*/
function (drawer) {
var _this = this;
if (drawer) {
drawer._modeChanged.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["takeUntil"])(Object(rxjs__WEBPACK_IMPORTED_MODULE_10__["merge"])(this._drawers.changes, this._destroyed)))
.subscribe(function () {
_this._updateContentMargins();
_this._changeDetectorRef.markForCheck();
});
}
};
/**
* Toggles the 'mat-drawer-opened' class on the main 'mat-drawer-container' element.
* @param {?} isAdd
* @return {?}
*/
MatDrawerContainer.prototype._setContainerClass = /**
* Toggles the 'mat-drawer-opened' class on the main 'mat-drawer-container' element.
* @param {?} isAdd
* @return {?}
*/
function (isAdd) {
if (isAdd) {
this._element.nativeElement.classList.add('mat-drawer-opened');
}
else {
this._element.nativeElement.classList.remove('mat-drawer-opened');
}
};
/**
* Validate the state of the drawer children components.
* @return {?}
*/
MatDrawerContainer.prototype._validateDrawers = /**
* Validate the state of the drawer children components.
* @return {?}
*/
function () {
var _this = this;
this._start = this._end = null;
// Ensure that we have at most one start and one end drawer.
this._drawers.forEach(function (drawer) {
if (drawer.position == 'end') {
if (_this._end != null) {
throwMatDuplicatedDrawerError('end');
}
_this._end = drawer;
}
else {
if (_this._start != null) {
throwMatDuplicatedDrawerError('start');
}
_this._start = drawer;
}
});
this._right = this._left = null;
// Detect if we're LTR or RTL.
if (!this._dir || this._dir.value == 'ltr') {
this._left = this._start;
this._right = this._end;
}
else {
this._left = this._end;
this._right = this._start;
}
};
/**
* Whether the container is being pushed to the side by one of the drawers.
* @return {?}
*/
MatDrawerContainer.prototype._isPushed = /**
* Whether the container is being pushed to the side by one of the drawers.
* @return {?}
*/
function () {
return (this._isDrawerOpen(this._start) && this._start.mode != 'over') ||
(this._isDrawerOpen(this._end) && this._end.mode != 'over');
};
/**
* @return {?}
*/
MatDrawerContainer.prototype._onBackdropClicked = /**
* @return {?}
*/
function () {
this.backdropClick.emit();
this._closeModalDrawer();
};
/**
* @return {?}
*/
MatDrawerContainer.prototype._closeModalDrawer = /**
* @return {?}
*/
function () {
var _this = this;
// Close all open drawers where closing is not disabled and the mode is not `side`.
[this._start, this._end]
.filter(function (drawer) { return drawer && !drawer.disableClose && _this._canHaveBackdrop(drawer); })
.forEach(function (drawer) { return ((drawer)).close(); });
};
/**
* @return {?}
*/
MatDrawerContainer.prototype._isShowingBackdrop = /**
* @return {?}
*/
function () {
return (this._isDrawerOpen(this._start) && this._canHaveBackdrop(this._start)) ||
(this._isDrawerOpen(this._end) && this._canHaveBackdrop(this._end));
};
/**
* @param {?} drawer
* @return {?}
*/
MatDrawerContainer.prototype._canHaveBackdrop = /**
* @param {?} drawer
* @return {?}
*/
function (drawer) {
return drawer.mode !== 'side' || !!this._backdropOverride;
};
/**
* @param {?} drawer
* @return {?}
*/
MatDrawerContainer.prototype._isDrawerOpen = /**
* @param {?} drawer
* @return {?}
*/
function (drawer) {
return drawer != null && drawer.opened;
};
/**
* Recalculates and updates the inline styles for the content. Note that this should be used
* sparingly, because it causes a reflow.
* @return {?}
*/
MatDrawerContainer.prototype._updateContentMargins = /**
* Recalculates and updates the inline styles for the content. Note that this should be used
* sparingly, because it causes a reflow.
* @return {?}
*/
function () {
var _this = this;
// 1. For drawers in `over` mode, they don't affect the content.
// 2. For drawers in `side` mode they should shrink the content. We do this by adding to the
// left margin (for left drawer) or right margin (for right the drawer).
// 3. For drawers in `push` mode the should shift the content without resizing it. We do this by
// adding to the left or right margin and simultaneously subtracting the same amount of
// margin from the other side.
var /** @type {?} */ left = 0;
var /** @type {?} */ right = 0;
if (this._left && this._left.opened) {
if (this._left.mode == 'side') {
left += this._left._width;
}
else if (this._left.mode == 'push') {
var /** @type {?} */ width = this._left._width;
left += width;
right -= width;
}
}
if (this._right && this._right.opened) {
if (this._right.mode == 'side') {
right += this._right._width;
}
else if (this._right.mode == 'push') {
var /** @type {?} */ width = this._right._width;
right += width;
left -= width;
}
}
if (left !== this._contentMargins.left || right !== this._contentMargins.right) {
this._contentMargins = { left: left, right: right };
// Pull back into the NgZone since in some cases we could be outside. We need to be careful
// to do it only when something changed, otherwise we can end up hitting the zone too often.
this._ngZone.run(function () { return _this._contentMarginChanges.next(_this._contentMargins); });
}
};
MatDrawerContainer.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Component"], args: [{selector: 'mat-drawer-container',
exportAs: 'matDrawerContainer',
template: "<div class=\"mat-drawer-backdrop\" (click)=\"_onBackdropClicked()\" *ngIf=\"hasBackdrop\" [class.mat-drawer-shown]=\"_isShowingBackdrop()\"></div><ng-content select=\"mat-drawer\"></ng-content><ng-content select=\"mat-drawer-content\"></ng-content><mat-drawer-content *ngIf=\"!_content\" cdkScrollable><ng-content></ng-content></mat-drawer-content>",
styles: [".mat-drawer-container{position:relative;z-index:1;box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-opened{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:background-color,visibility}@media screen and (-ms-high-contrast:active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%,0,0)}@media screen and (-ms-high-contrast:active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media screen and (-ms-high-contrast:active){.mat-drawer.mat-drawer-end,[dir=rtl] .mat-drawer{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%,0,0)}[dir=rtl] .mat-drawer{transform:translate3d(100%,0,0)}[dir=rtl] .mat-drawer.mat-drawer-end{left:0;right:auto;transform:translate3d(-100%,0,0)}.mat-drawer:not(.mat-drawer-side){box-shadow:0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12)}.mat-sidenav-fixed{position:fixed}"],
host: {
'class': 'mat-drawer-container',
'[class.mat-drawer-container-explicit-backdrop]': '_backdropOverride',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatDrawerContainer.ctorParameters = function () { return [
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_2__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Optional"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["NgZone"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ChangeDetectorRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Inject"], args: [MAT_DRAWER_DEFAULT_AUTOSIZE,] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Inject"], args: [_angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_11__["ANIMATION_MODULE_TYPE"],] },] },
]; };
MatDrawerContainer.propDecorators = {
"_drawers": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ContentChildren"], args: [MatDrawer,] },],
"_content": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ContentChild"], args: [MatDrawerContent,] },],
"autosize": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Input"] },],
"hasBackdrop": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Input"] },],
"backdropClick": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Output"] },],
"scrollable": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ViewChild"], args: [_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_6__["CdkScrollable"],] },],
};
return MatDrawerContainer;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatSidenavContent = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_12__["__extends"])(MatSidenavContent, _super);
function MatSidenavContent(changeDetectorRef, container) {
return _super.call(this, changeDetectorRef, container) || this;
}
MatSidenavContent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Component"], args: [{selector: 'mat-sidenav-content',
template: '<ng-content></ng-content>',
host: {
'class': 'mat-drawer-content mat-sidenav-content',
'[style.margin-left.px]': '_container._contentMargins.left',
'[style.margin-right.px]': '_container._contentMargins.right',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatSidenavContent.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ChangeDetectorRef"], },
{ type: MatSidenavContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Inject"], args: [Object(_angular_core__WEBPACK_IMPORTED_MODULE_7__["forwardRef"])(function () { return MatSidenavContainer; }),] },] },
]; };
return MatSidenavContent;
}(MatDrawerContent));
var MatSidenav = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_12__["__extends"])(MatSidenav, _super);
function MatSidenav() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._fixedInViewport = false;
_this._fixedTopGap = 0;
_this._fixedBottomGap = 0;
return _this;
}
Object.defineProperty(MatSidenav.prototype, "fixedInViewport", {
get: /**
* Whether the sidenav is fixed in the viewport.
* @return {?}
*/
function () { return this._fixedInViewport; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._fixedInViewport = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatSidenav.prototype, "fixedTopGap", {
get: /**
* The gap between the top of the sidenav and the top of the viewport when the sidenav is in fixed
* mode.
* @return {?}
*/
function () { return this._fixedTopGap; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._fixedTopGap = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceNumberProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatSidenav.prototype, "fixedBottomGap", {
get: /**
* The gap between the bottom of the sidenav and the bottom of the viewport when the sidenav is in
* fixed mode.
* @return {?}
*/
function () { return this._fixedBottomGap; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._fixedBottomGap = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceNumberProperty"])(value); },
enumerable: true,
configurable: true
});
MatSidenav.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Component"], args: [{selector: 'mat-sidenav',
exportAs: 'matSidenav',
template: '<ng-content></ng-content>',
animations: [matDrawerAnimations.transformDrawer],
host: {
'class': 'mat-drawer mat-sidenav',
'tabIndex': '-1',
'[@transform]': '_animationState',
'(@transform.start)': '_onAnimationStart($event)',
'(@transform.done)': '_onAnimationEnd($event)',
// must prevent the browser from aligning text based on value
'[attr.align]': 'null',
'[class.mat-drawer-end]': 'position === "end"',
'[class.mat-drawer-over]': 'mode === "over"',
'[class.mat-drawer-push]': 'mode === "push"',
'[class.mat-drawer-side]': 'mode === "side"',
'[class.mat-sidenav-fixed]': 'fixedInViewport',
'[style.top.px]': 'fixedInViewport ? fixedTopGap : null',
'[style.bottom.px]': 'fixedInViewport ? fixedBottomGap : null',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatSidenav.propDecorators = {
"fixedInViewport": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Input"] },],
"fixedTopGap": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Input"] },],
"fixedBottomGap": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Input"] },],
};
return MatSidenav;
}(MatDrawer));
var MatSidenavContainer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_12__["__extends"])(MatSidenavContainer, _super);
function MatSidenavContainer() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatSidenavContainer.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["Component"], args: [{selector: 'mat-sidenav-container',
exportAs: 'matSidenavContainer',
template: "<div class=\"mat-drawer-backdrop\" (click)=\"_onBackdropClicked()\" *ngIf=\"hasBackdrop\" [class.mat-drawer-shown]=\"_isShowingBackdrop()\"></div><ng-content select=\"mat-sidenav\"></ng-content><ng-content select=\"mat-sidenav-content\"></ng-content><mat-sidenav-content *ngIf=\"!_content\" cdkScrollable><ng-content></ng-content></mat-sidenav-content>",
styles: [".mat-drawer-container{position:relative;z-index:1;box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-opened{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:background-color,visibility}@media screen and (-ms-high-contrast:active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%,0,0)}@media screen and (-ms-high-contrast:active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media screen and (-ms-high-contrast:active){.mat-drawer.mat-drawer-end,[dir=rtl] .mat-drawer{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%,0,0)}[dir=rtl] .mat-drawer{transform:translate3d(100%,0,0)}[dir=rtl] .mat-drawer.mat-drawer-end{left:0;right:auto;transform:translate3d(-100%,0,0)}.mat-drawer:not(.mat-drawer-side){box-shadow:0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12)}.mat-sidenav-fixed{position:fixed}"],
host: {
'class': 'mat-drawer-container mat-sidenav-container',
'[class.mat-drawer-container-explicit-backdrop]': '_backdropOverride',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatSidenavContainer.propDecorators = {
"_drawers": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ContentChildren"], args: [MatSidenav,] },],
"_content": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["ContentChild"], args: [MatSidenavContent,] },],
};
return MatSidenavContainer;
}(MatDrawerContainer));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatSidenavModule = /** @class */ (function () {
function MatSidenavModule() {
}
MatSidenavModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_7__["NgModule"], args: [{
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_8__["CommonModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_13__["MatCommonModule"],
_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_6__["ScrollDispatchModule"],
_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_5__["PlatformModule"],
],
exports: [
_angular_material_core__WEBPACK_IMPORTED_MODULE_13__["MatCommonModule"],
MatDrawer,
MatDrawerContainer,
MatDrawerContent,
MatSidenav,
MatSidenavContainer,
MatSidenavContent,
],
declarations: [
MatDrawer,
MatDrawerContainer,
MatDrawerContent,
MatSidenav,
MatSidenavContainer,
MatSidenavContent,
],
},] },
];
return MatSidenavModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=sidenav.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/slide-toggle.es5.js":
/*!*****************************************************************!*\
!*** ./node_modules/@angular/material/esm5/slide-toggle.es5.js ***!
\*****************************************************************/
/*! exports provided: MatSlideToggleModule, MAT_SLIDE_TOGGLE_VALUE_ACCESSOR, MatSlideToggleChange, MatSlideToggleBase, _MatSlideToggleMixinBase, MatSlideToggle */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSlideToggleModule", function() { return MatSlideToggleModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SLIDE_TOGGLE_VALUE_ACCESSOR", function() { return MAT_SLIDE_TOGGLE_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSlideToggleChange", function() { return MatSlideToggleChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSlideToggleBase", function() { return MatSlideToggleBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatSlideToggleMixinBase", function() { return _MatSlideToggleMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSlideToggle", function() { return MatSlideToggle; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_cdk_observers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/cdk/observers */ "./node_modules/@angular/cdk/esm5/observers.es5.js");
/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/fesm5/platform-browser.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
// Increasing integer for generating unique ids for slide-toggle components.
var /** @type {?} */ nextUniqueId = 0;
var /** @type {?} */ MAT_SLIDE_TOGGLE_VALUE_ACCESSOR = {
provide: _angular_forms__WEBPACK_IMPORTED_MODULE_5__["NG_VALUE_ACCESSOR"],
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_4__["forwardRef"])(function () { return MatSlideToggle; }),
multi: true
};
/**
* Change event object emitted by a MatSlideToggle.
*/
var /**
* Change event object emitted by a MatSlideToggle.
*/
MatSlideToggleChange = /** @class */ (function () {
function MatSlideToggleChange(source, checked) {
this.source = source;
this.checked = checked;
}
return MatSlideToggleChange;
}());
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatSlideToggleBase = /** @class */ (function () {
function MatSlideToggleBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatSlideToggleBase;
}());
var /** @type {?} */ _MatSlideToggleMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["mixinTabIndex"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["mixinColor"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["mixinDisableRipple"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["mixinDisabled"])(MatSlideToggleBase)), 'accent'));
/**
* Represents a slidable "switch" toggle that can be moved between on and off.
*/
var MatSlideToggle = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatSlideToggle, _super);
function MatSlideToggle(elementRef, /**
* @deprecated The `_platform` parameter to be removed.
* @deletion-target 7.0.0
*/
/**
* @deprecated The `_platform` parameter to be removed.
* @deletion-target 7.0.0
*/
_platform, _focusMonitor, _changeDetectorRef, tabIndex, _ngZone) {
var _this = _super.call(this, elementRef) || this;
_this._focusMonitor = _focusMonitor;
_this._changeDetectorRef = _changeDetectorRef;
_this._ngZone = _ngZone;
_this.onChange = function (_) { };
_this.onTouched = function () { };
_this._uniqueId = "mat-slide-toggle-" + ++nextUniqueId;
_this._required = false;
_this._checked = false;
/**
* Whether the thumb is currently being dragged.
*/
_this._dragging = false;
/**
* Name value will be applied to the input element if present
*/
_this.name = null;
/**
* A unique id for the slide-toggle input. If none is supplied, it will be auto-generated.
*/
_this.id = _this._uniqueId;
/**
* Whether the label should appear after or before the slide-toggle. Defaults to 'after'
*/
_this.labelPosition = 'after';
/**
* Used to set the aria-label attribute on the underlying input element.
*/
_this.ariaLabel = null;
/**
* Used to set the aria-labelledby attribute on the underlying input element.
*/
_this.ariaLabelledby = null;
/**
* An event will be dispatched each time the slide-toggle changes its value.
*/
_this.change = new _angular_core__WEBPACK_IMPORTED_MODULE_4__["EventEmitter"]();
_this.tabIndex = parseInt(tabIndex) || 0;
return _this;
}
Object.defineProperty(MatSlideToggle.prototype, "required", {
get: /**
* Whether the slide-toggle is required.
* @return {?}
*/
function () { return this._required; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._required = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlideToggle.prototype, "checked", {
get: /**
* Whether the slide-toggle element is checked or not
* @return {?}
*/
function () { return this._checked; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._checked = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value);
this._changeDetectorRef.markForCheck();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlideToggle.prototype, "inputId", {
/** Returns the unique id for the visual hidden input. */
get: /**
* Returns the unique id for the visual hidden input.
* @return {?}
*/
function () { return (this.id || this._uniqueId) + "-input"; },
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatSlideToggle.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
this._focusMonitor
.monitor(this._inputElement.nativeElement)
.subscribe(function (focusOrigin) { return _this._onInputFocusChange(focusOrigin); });
};
/**
* @return {?}
*/
MatSlideToggle.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._focusMonitor.stopMonitoring(this._inputElement.nativeElement);
};
/** Method being called whenever the underlying input emits a change event. */
/**
* Method being called whenever the underlying input emits a change event.
* @param {?} event
* @return {?}
*/
MatSlideToggle.prototype._onChangeEvent = /**
* Method being called whenever the underlying input emits a change event.
* @param {?} event
* @return {?}
*/
function (event) {
// We always have to stop propagation on the change event.
// Otherwise the change event, from the input element, will bubble up and
// emit its event object to the component's `change` output.
event.stopPropagation();
// Releasing the pointer over the `<label>` element while dragging triggers another
// click event on the `<label>` element. This means that the checked state of the underlying
// input changed unintentionally and needs to be changed back.
if (this._dragging) {
this._inputElement.nativeElement.checked = this.checked;
return;
}
// Sync the value from the underlying input element with the component instance.
this.checked = this._inputElement.nativeElement.checked;
// Emit our custom change event only if the underlying input emitted one. This ensures that
// there is no change event, when the checked state changes programmatically.
this._emitChangeEvent();
};
/** Method being called whenever the slide-toggle has been clicked. */
/**
* Method being called whenever the slide-toggle has been clicked.
* @param {?} event
* @return {?}
*/
MatSlideToggle.prototype._onInputClick = /**
* Method being called whenever the slide-toggle has been clicked.
* @param {?} event
* @return {?}
*/
function (event) {
// We have to stop propagation for click events on the visual hidden input element.
// By default, when a user clicks on a label element, a generated click event will be
// dispatched on the associated input element. Since we are using a label element as our
// root container, the click event on the `slide-toggle` will be executed twice.
// The real click event will bubble up, and the generated click event also tries to bubble up.
// This will lead to multiple click events.
// Preventing bubbling for the second event will solve that issue.
event.stopPropagation();
};
/** Implemented as part of ControlValueAccessor. */
/**
* Implemented as part of ControlValueAccessor.
* @param {?} value
* @return {?}
*/
MatSlideToggle.prototype.writeValue = /**
* Implemented as part of ControlValueAccessor.
* @param {?} value
* @return {?}
*/
function (value) {
this.checked = !!value;
};
/** Implemented as part of ControlValueAccessor. */
/**
* Implemented as part of ControlValueAccessor.
* @param {?} fn
* @return {?}
*/
MatSlideToggle.prototype.registerOnChange = /**
* Implemented as part of ControlValueAccessor.
* @param {?} fn
* @return {?}
*/
function (fn) {
this.onChange = fn;
};
/** Implemented as part of ControlValueAccessor. */
/**
* Implemented as part of ControlValueAccessor.
* @param {?} fn
* @return {?}
*/
MatSlideToggle.prototype.registerOnTouched = /**
* Implemented as part of ControlValueAccessor.
* @param {?} fn
* @return {?}
*/
function (fn) {
this.onTouched = fn;
};
/** Implemented as a part of ControlValueAccessor. */
/**
* Implemented as a part of ControlValueAccessor.
* @param {?} isDisabled
* @return {?}
*/
MatSlideToggle.prototype.setDisabledState = /**
* Implemented as a part of ControlValueAccessor.
* @param {?} isDisabled
* @return {?}
*/
function (isDisabled) {
this.disabled = isDisabled;
this._changeDetectorRef.markForCheck();
};
/** Focuses the slide-toggle. */
/**
* Focuses the slide-toggle.
* @return {?}
*/
MatSlideToggle.prototype.focus = /**
* Focuses the slide-toggle.
* @return {?}
*/
function () {
this._focusMonitor.focusVia(this._inputElement.nativeElement, 'keyboard');
};
/** Toggles the checked state of the slide-toggle. */
/**
* Toggles the checked state of the slide-toggle.
* @return {?}
*/
MatSlideToggle.prototype.toggle = /**
* Toggles the checked state of the slide-toggle.
* @return {?}
*/
function () {
this.checked = !this.checked;
};
/**
* Function is called whenever the focus changes for the input element.
* @param {?} focusOrigin
* @return {?}
*/
MatSlideToggle.prototype._onInputFocusChange = /**
* Function is called whenever the focus changes for the input element.
* @param {?} focusOrigin
* @return {?}
*/
function (focusOrigin) {
// TODO(paul): support `program`. See https://github.com/angular/material2/issues/9889
if (!this._focusRipple && focusOrigin === 'keyboard') {
// For keyboard focus show a persistent ripple as focus indicator.
this._focusRipple = this._ripple.launch(0, 0, { persistent: true });
}
else if (!focusOrigin) {
this.onTouched();
// Fade out and clear the focus ripple if one is currently present.
if (this._focusRipple) {
this._focusRipple.fadeOut();
this._focusRipple = null;
}
}
};
/**
* Emits a change event on the `change` output. Also notifies the FormControl about the change.
* @return {?}
*/
MatSlideToggle.prototype._emitChangeEvent = /**
* Emits a change event on the `change` output. Also notifies the FormControl about the change.
* @return {?}
*/
function () {
this.onChange(this.checked);
this.change.emit(new MatSlideToggleChange(this, this.checked));
};
/**
* Retrieves the percentage of thumb from the moved distance. Percentage as fraction of 100.
* @param {?} distance
* @return {?}
*/
MatSlideToggle.prototype._getDragPercentage = /**
* Retrieves the percentage of thumb from the moved distance. Percentage as fraction of 100.
* @param {?} distance
* @return {?}
*/
function (distance) {
var /** @type {?} */ percentage = (distance / this._thumbBarWidth) * 100;
// When the toggle was initially checked, then we have to start the drag at the end.
if (this._previousChecked) {
percentage += 100;
}
return Math.max(0, Math.min(percentage, 100));
};
/**
* @return {?}
*/
MatSlideToggle.prototype._onDragStart = /**
* @return {?}
*/
function () {
if (!this.disabled && !this._dragging) {
var /** @type {?} */ thumbEl = this._thumbEl.nativeElement;
this._thumbBarWidth = this._thumbBarEl.nativeElement.clientWidth - thumbEl.clientWidth;
thumbEl.classList.add('mat-dragging');
this._previousChecked = this.checked;
this._dragging = true;
}
};
/**
* @param {?} event
* @return {?}
*/
MatSlideToggle.prototype._onDrag = /**
* @param {?} event
* @return {?}
*/
function (event) {
if (this._dragging) {
this._dragPercentage = this._getDragPercentage(event.deltaX);
// Calculate the moved distance based on the thumb bar width.
var /** @type {?} */ dragX = (this._dragPercentage / 100) * this._thumbBarWidth;
this._thumbEl.nativeElement.style.transform = "translate3d(" + dragX + "px, 0, 0)";
}
};
/**
* @return {?}
*/
MatSlideToggle.prototype._onDragEnd = /**
* @return {?}
*/
function () {
var _this = this;
if (this._dragging) {
var /** @type {?} */ newCheckedValue = this._dragPercentage > 50;
if (newCheckedValue !== this.checked) {
this.checked = newCheckedValue;
this._emitChangeEvent();
}
// The drag should be stopped outside of the current event handler, otherwise the
// click event will be fired before it and will revert the drag change.
this._ngZone.runOutsideAngular(function () {
return setTimeout(function () {
if (_this._dragging) {
_this._dragging = false;
_this._thumbEl.nativeElement.classList.remove('mat-dragging');
// Reset the transform because the component will take care
// of the thumb position after drag.
// Reset the transform because the component will take care
// of the thumb position after drag.
_this._thumbEl.nativeElement.style.transform = '';
}
});
});
}
};
/** Method being called whenever the label text changes. */
/**
* Method being called whenever the label text changes.
* @return {?}
*/
MatSlideToggle.prototype._onLabelTextChange = /**
* Method being called whenever the label text changes.
* @return {?}
*/
function () {
// This method is getting called whenever the label of the slide-toggle changes.
// Since the slide-toggle uses the OnPush strategy we need to notify it about the change
// that has been recognized by the cdkObserveContent directive.
this._changeDetectorRef.markForCheck();
};
MatSlideToggle.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Component"], args: [{selector: 'mat-slide-toggle',
exportAs: 'matSlideToggle',
host: {
'class': 'mat-slide-toggle',
'[id]': 'id',
'[class.mat-checked]': 'checked',
'[class.mat-disabled]': 'disabled',
'[class.mat-slide-toggle-label-before]': 'labelPosition == "before"',
},
template: "<label class=\"mat-slide-toggle-label\" #label><div #toggleBar class=\"mat-slide-toggle-bar\" [class.mat-slide-toggle-bar-no-side-margin]=\"!labelContent.textContent || !labelContent.textContent.trim()\"><input #input class=\"mat-slide-toggle-input cdk-visually-hidden\" type=\"checkbox\" [id]=\"inputId\" [required]=\"required\" [tabIndex]=\"tabIndex\" [checked]=\"checked\" [disabled]=\"disabled\" [attr.name]=\"name\" [attr.aria-label]=\"ariaLabel\" [attr.aria-labelledby]=\"ariaLabelledby\" (change)=\"_onChangeEvent($event)\" (click)=\"_onInputClick($event)\"><div class=\"mat-slide-toggle-thumb-container\" #thumbContainer (slidestart)=\"_onDragStart()\" (slide)=\"_onDrag($event)\" (slideend)=\"_onDragEnd()\"><div class=\"mat-slide-toggle-thumb\"></div><div class=\"mat-slide-toggle-ripple\" mat-ripple [matRippleTrigger]=\"label\" [matRippleDisabled]=\"disableRipple || disabled\" [matRippleCentered]=\"true\" [matRippleRadius]=\"23\" [matRippleAnimation]=\"{enterDuration: 150}\"></div></div></div><span class=\"mat-slide-toggle-content\" #labelContent (cdkObserveContent)=\"_onLabelTextChange()\"><ng-content></ng-content></span></label>",
styles: [".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:0}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px,0,0)}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}.mat-slide-toggle-bar,[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-right:8px;margin-left:0}.mat-slide-toggle-label-before .mat-slide-toggle-bar,[dir=rtl] .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0,0,0);transition:all 80ms linear;transition-property:transform;cursor:-webkit-grab;cursor:grab}.mat-slide-toggle-thumb-container.mat-dragging,.mat-slide-toggle-thumb-container:active{cursor:-webkit-grabbing;cursor:grabbing;transition-duration:0s}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12)}@media screen and (-ms-high-contrast:active){.mat-slide-toggle-thumb{background:#fff;border:solid 1px #000}}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}@media screen and (-ms-high-contrast:active){.mat-slide-toggle-bar{background:#fff}}.mat-slide-toggle-input{bottom:0;left:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}.mat-slide-toggle-ripple{position:absolute;top:calc(50% - 23px);left:calc(50% - 23px);height:46px;width:46px;z-index:1;pointer-events:none}"],
providers: [MAT_SLIDE_TOGGLE_VALUE_ACCESSOR],
inputs: ['disabled', 'disableRipple', 'color', 'tabIndex'],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatSlideToggle.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ElementRef"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_3__["Platform"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__["FocusMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ChangeDetectorRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Attribute"], args: ['tabindex',] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["NgZone"], },
]; };
MatSlideToggle.propDecorators = {
"_thumbEl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ViewChild"], args: ['thumbContainer',] },],
"_thumbBarEl": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ViewChild"], args: ['toggleBar',] },],
"name": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"id": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"labelPosition": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"ariaLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"], args: ['aria-label',] },],
"ariaLabelledby": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"], args: ['aria-labelledby',] },],
"required": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"checked": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] },],
"change": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Output"] },],
"_inputElement": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ViewChild"], args: ['input',] },],
"_ripple": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ViewChild"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["MatRipple"],] },],
};
return MatSlideToggle;
}(_MatSlideToggleMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatSlideToggleModule = /** @class */ (function () {
function MatSlideToggleModule() {
}
MatSlideToggleModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["NgModule"], args: [{
imports: [_angular_material_core__WEBPACK_IMPORTED_MODULE_6__["MatRippleModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_6__["MatCommonModule"], _angular_cdk_observers__WEBPACK_IMPORTED_MODULE_7__["ObserversModule"]],
exports: [MatSlideToggle, _angular_material_core__WEBPACK_IMPORTED_MODULE_6__["MatCommonModule"]],
declarations: [MatSlideToggle],
providers: [
{ provide: _angular_platform_browser__WEBPACK_IMPORTED_MODULE_8__["HAMMER_GESTURE_CONFIG"], useClass: _angular_material_core__WEBPACK_IMPORTED_MODULE_6__["GestureConfig"] }
],
},] },
];
return MatSlideToggleModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=slide-toggle.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/slider.es5.js":
/*!***********************************************************!*\
!*** ./node_modules/@angular/material/esm5/slider.es5.js ***!
\***********************************************************/
/*! exports provided: MatSliderModule, MAT_SLIDER_VALUE_ACCESSOR, MatSliderChange, MatSliderBase, _MatSliderMixinBase, MatSlider */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSliderModule", function() { return MatSliderModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SLIDER_VALUE_ACCESSOR", function() { return MAT_SLIDER_VALUE_ACCESSOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSliderChange", function() { return MatSliderChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSliderBase", function() { return MatSliderBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatSliderMixinBase", function() { return _MatSliderMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSlider", function() { return MatSlider; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/fesm5/platform-browser.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Visually, a 30px separation between tick marks looks best. This is very subjective but it is
* the default separation we chose.
*/
var /** @type {?} */ MIN_AUTO_TICK_SEPARATION = 30;
/**
* The thumb gap size for a disabled slider.
*/
var /** @type {?} */ DISABLED_THUMB_GAP = 7;
/**
* The thumb gap size for a non-active slider at its minimum value.
*/
var /** @type {?} */ MIN_VALUE_NONACTIVE_THUMB_GAP = 7;
/**
* The thumb gap size for an active slider at its minimum value.
*/
var /** @type {?} */ MIN_VALUE_ACTIVE_THUMB_GAP = 10;
/**
* Provider Expression that allows mat-slider to register as a ControlValueAccessor.
* This allows it to support [(ngModel)] and [formControl].
*/
var /** @type {?} */ MAT_SLIDER_VALUE_ACCESSOR = {
provide: _angular_forms__WEBPACK_IMPORTED_MODULE_6__["NG_VALUE_ACCESSOR"],
useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_5__["forwardRef"])(function () { return MatSlider; }),
multi: true
};
/**
* A simple change event emitted by the MatSlider component.
*/
var /**
* A simple change event emitted by the MatSlider component.
*/
MatSliderChange = /** @class */ (function () {
function MatSliderChange() {
}
return MatSliderChange;
}());
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatSliderBase = /** @class */ (function () {
function MatSliderBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatSliderBase;
}());
var /** @type {?} */ _MatSliderMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_7__["mixinTabIndex"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_7__["mixinColor"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_7__["mixinDisabled"])(MatSliderBase), 'accent'));
/**
* Allows users to select from a range of values by moving the slider thumb. It is similar in
* behavior to the native `<input type="range">` element.
*/
var MatSlider = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatSlider, _super);
function MatSlider(elementRef, _focusMonitor, _changeDetectorRef, _dir, tabIndex) {
var _this = _super.call(this, elementRef) || this;
_this._focusMonitor = _focusMonitor;
_this._changeDetectorRef = _changeDetectorRef;
_this._dir = _dir;
_this._invert = false;
_this._max = 100;
_this._min = 0;
_this._step = 1;
_this._thumbLabel = false;
_this._tickInterval = 0;
_this._value = null;
_this._vertical = false;
/**
* Event emitted when the slider value has changed.
*/
_this.change = new _angular_core__WEBPACK_IMPORTED_MODULE_5__["EventEmitter"]();
/**
* Event emitted when the slider thumb moves.
*/
_this.input = new _angular_core__WEBPACK_IMPORTED_MODULE_5__["EventEmitter"]();
/**
* onTouch function registered via registerOnTouch (ControlValueAccessor).
*/
_this.onTouched = function () { };
_this._percent = 0;
/**
* Whether or not the thumb is sliding.
* Used to determine if there should be a transition for the thumb and fill track.
*/
_this._isSliding = false;
/**
* Whether or not the slider is active (clicked or sliding).
* Used to shrink and grow the thumb as according to the Material Design spec.
*/
_this._isActive = false;
/**
* The size of a tick interval as a percentage of the size of the track.
*/
_this._tickIntervalPercent = 0;
/**
* The dimensions of the slider.
*/
_this._sliderDimensions = null;
_this._controlValueAccessorChangeFn = function () { };
/**
* Subscription to the Directionality change EventEmitter.
*/
_this._dirChangeSubscription = rxjs__WEBPACK_IMPORTED_MODULE_8__["Subscription"].EMPTY;
_this.tabIndex = parseInt(tabIndex) || 0;
return _this;
}
Object.defineProperty(MatSlider.prototype, "invert", {
get: /**
* Whether the slider is inverted.
* @return {?}
*/
function () { return this._invert; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._invert = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "max", {
get: /**
* The maximum value that the slider can have.
* @return {?}
*/
function () { return this._max; },
set: /**
* @param {?} v
* @return {?}
*/
function (v) {
this._max = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceNumberProperty"])(v, this._max);
this._percent = this._calculatePercentage(this._value);
// Since this also modifies the percentage, we need to let the change detection know.
this._changeDetectorRef.markForCheck();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "min", {
get: /**
* The minimum value that the slider can have.
* @return {?}
*/
function () { return this._min; },
set: /**
* @param {?} v
* @return {?}
*/
function (v) {
this._min = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceNumberProperty"])(v, this._min);
// If the value wasn't explicitly set by the user, set it to the min.
if (this._value === null) {
this.value = this._min;
}
this._percent = this._calculatePercentage(this._value);
// Since this also modifies the percentage, we need to let the change detection know.
this._changeDetectorRef.markForCheck();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "step", {
get: /**
* The values at which the thumb will snap.
* @return {?}
*/
function () { return this._step; },
set: /**
* @param {?} v
* @return {?}
*/
function (v) {
this._step = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceNumberProperty"])(v, this._step);
if (this._step % 1 !== 0) {
this._roundToDecimal = /** @type {?} */ ((this._step.toString().split('.').pop())).length;
}
// Since this could modify the label, we need to notify the change detection.
this._changeDetectorRef.markForCheck();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "thumbLabel", {
get: /**
* Whether or not to show the thumb label.
* @return {?}
*/
function () { return this._thumbLabel; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._thumbLabel = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "tickInterval", {
get: /**
* How often to show ticks. Relative to the step so that a tick always appears on a step.
* Ex: Tick interval of 4 with a step of 3 will draw a tick every 4 steps (every 12 values).
* @return {?}
*/
function () { return this._tickInterval; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (value === 'auto') {
this._tickInterval = 'auto';
}
else if (typeof value === 'number' || typeof value === 'string') {
this._tickInterval = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceNumberProperty"])(value, /** @type {?} */ (this._tickInterval));
}
else {
this._tickInterval = 0;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "value", {
get: /**
* Value of the slider.
* @return {?}
*/
function () {
// If the value needs to be read and it is still uninitialized, initialize it to the min.
if (this._value === null) {
this.value = this._min;
}
return this._value;
},
set: /**
* @param {?} v
* @return {?}
*/
function (v) {
if (v !== this._value) {
this._value = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceNumberProperty"])(v);
this._percent = this._calculatePercentage(this._value);
// Since this also modifies the percentage, we need to let the change detection know.
this._changeDetectorRef.markForCheck();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "vertical", {
get: /**
* Whether the slider is vertical.
* @return {?}
*/
function () { return this._vertical; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._vertical = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__["coerceBooleanProperty"])(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "displayValue", {
/** The value to be used for display purposes. */
get: /**
* The value to be used for display purposes.
* @return {?}
*/
function () {
if (this.displayWith) {
return this.displayWith(this.value);
}
// Note that this could be improved further by rounding something like 0.999 to 1 or
// 0.899 to 0.9, however it is very performance sensitive, because it gets called on
// every change detection cycle.
if (this._roundToDecimal && this.value && this.value % 1 !== 0) {
return this.value.toFixed(this._roundToDecimal);
}
return this.value || 0;
},
enumerable: true,
configurable: true
});
/** set focus to the host element */
/**
* set focus to the host element
* @return {?}
*/
MatSlider.prototype.focus = /**
* set focus to the host element
* @return {?}
*/
function () {
this._focusHostElement();
};
/** blur the host element */
/**
* blur the host element
* @return {?}
*/
MatSlider.prototype.blur = /**
* blur the host element
* @return {?}
*/
function () {
this._blurHostElement();
};
Object.defineProperty(MatSlider.prototype, "percent", {
/** The percentage of the slider that coincides with the value. */
get: /**
* The percentage of the slider that coincides with the value.
* @return {?}
*/
function () { return this._clamp(this._percent); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "_invertAxis", {
/**
* Whether the axis of the slider is inverted.
* (i.e. whether moving the thumb in the positive x or y direction decreases the slider's value).
*/
get: /**
* Whether the axis of the slider is inverted.
* (i.e. whether moving the thumb in the positive x or y direction decreases the slider's value).
* @return {?}
*/
function () {
// Standard non-inverted mode for a vertical slider should be dragging the thumb from bottom to
// top. However from a y-axis standpoint this is inverted.
return this.vertical ? !this.invert : this.invert;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "_isMinValue", {
/** Whether the slider is at its minimum value. */
get: /**
* Whether the slider is at its minimum value.
* @return {?}
*/
function () {
return this.percent === 0;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "_thumbGap", {
/**
* The amount of space to leave between the slider thumb and the track fill & track background
* elements.
*/
get: /**
* The amount of space to leave between the slider thumb and the track fill & track background
* elements.
* @return {?}
*/
function () {
if (this.disabled) {
return DISABLED_THUMB_GAP;
}
if (this._isMinValue && !this.thumbLabel) {
return this._isActive ? MIN_VALUE_ACTIVE_THUMB_GAP : MIN_VALUE_NONACTIVE_THUMB_GAP;
}
return 0;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "_trackBackgroundStyles", {
/** CSS styles for the track background element. */
get: /**
* CSS styles for the track background element.
* @return {?}
*/
function () {
var /** @type {?} */ axis = this.vertical ? 'Y' : 'X';
var /** @type {?} */ sign = this._invertMouseCoords ? '-' : '';
return {
'transform': "translate" + axis + "(" + sign + this._thumbGap + "px) scale" + axis + "(" + (1 - this.percent) + ")"
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "_trackFillStyles", {
/** CSS styles for the track fill element. */
get: /**
* CSS styles for the track fill element.
* @return {?}
*/
function () {
var /** @type {?} */ axis = this.vertical ? 'Y' : 'X';
var /** @type {?} */ sign = this._invertMouseCoords ? '' : '-';
return {
'transform': "translate" + axis + "(" + sign + this._thumbGap + "px) scale" + axis + "(" + this.percent + ")"
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "_ticksContainerStyles", {
/** CSS styles for the ticks container element. */
get: /**
* CSS styles for the ticks container element.
* @return {?}
*/
function () {
var /** @type {?} */ axis = this.vertical ? 'Y' : 'X';
// For a horizontal slider in RTL languages we push the ticks container off the left edge
// instead of the right edge to avoid causing a horizontal scrollbar to appear.
var /** @type {?} */ sign = !this.vertical && this._direction == 'rtl' ? '' : '-';
var /** @type {?} */ offset = this._tickIntervalPercent / 2 * 100;
return {
'transform': "translate" + axis + "(" + sign + offset + "%)"
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "_ticksStyles", {
/** CSS styles for the ticks element. */
get: /**
* CSS styles for the ticks element.
* @return {?}
*/
function () {
var /** @type {?} */ tickSize = this._tickIntervalPercent * 100;
var /** @type {?} */ backgroundSize = this.vertical ? "2px " + tickSize + "%" : tickSize + "% 2px";
var /** @type {?} */ axis = this.vertical ? 'Y' : 'X';
// Depending on the direction we pushed the ticks container, push the ticks the opposite
// direction to re-center them but clip off the end edge. In RTL languages we need to flip the
// ticks 180 degrees so we're really cutting off the end edge abd not the start.
var /** @type {?} */ sign = !this.vertical && this._direction == 'rtl' ? '-' : '';
var /** @type {?} */ rotate = !this.vertical && this._direction == 'rtl' ? ' rotate(180deg)' : '';
var /** @type {?} */ styles = {
'backgroundSize': backgroundSize,
// Without translateZ ticks sometimes jitter as the slider moves on Chrome & Firefox.
'transform': "translateZ(0) translate" + axis + "(" + sign + tickSize / 2 + "%)" + rotate
};
if (this._isMinValue && this._thumbGap) {
var /** @type {?} */ side = this.vertical ?
(this._invertAxis ? 'Bottom' : 'Top') :
(this._invertAxis ? 'Right' : 'Left');
styles["padding" + side] = this._thumbGap + "px";
}
return styles;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "_thumbContainerStyles", {
get: /**
* @return {?}
*/
function () {
var /** @type {?} */ axis = this.vertical ? 'Y' : 'X';
// For a horizontal slider in RTL languages we push the thumb container off the left edge
// instead of the right edge to avoid causing a horizontal scrollbar to appear.
var /** @type {?} */ invertOffset = (this._direction == 'rtl' && !this.vertical) ? !this._invertAxis : this._invertAxis;
var /** @type {?} */ offset = (invertOffset ? this.percent : 1 - this.percent) * 100;
return {
'transform': "translate" + axis + "(-" + offset + "%)"
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "_invertMouseCoords", {
get: /**
* Whether mouse events should be converted to a slider position by calculating their distance
* from the right or bottom edge of the slider as opposed to the top or left.
* @return {?}
*/
function () {
return (this._direction == 'rtl' && !this.vertical) ? !this._invertAxis : this._invertAxis;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSlider.prototype, "_direction", {
get: /**
* The language direction for this slider element.
* @return {?}
*/
function () {
return (this._dir && this._dir.value == 'rtl') ? 'rtl' : 'ltr';
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatSlider.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
this._focusMonitor
.monitor(this._elementRef.nativeElement, true)
.subscribe(function (origin) {
_this._isActive = !!origin && origin !== 'keyboard';
_this._changeDetectorRef.detectChanges();
});
if (this._dir) {
this._dirChangeSubscription = this._dir.change.subscribe(function () {
_this._changeDetectorRef.markForCheck();
});
}
};
/**
* @return {?}
*/
MatSlider.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._focusMonitor.stopMonitoring(this._elementRef.nativeElement);
this._dirChangeSubscription.unsubscribe();
};
/**
* @return {?}
*/
MatSlider.prototype._onMouseenter = /**
* @return {?}
*/
function () {
if (this.disabled) {
return;
}
// We save the dimensions of the slider here so we can use them to update the spacing of the
// ticks and determine where on the slider click and slide events happen.
this._sliderDimensions = this._getSliderDimensions();
this._updateTickIntervalPercent();
};
/**
* @param {?} event
* @return {?}
*/
MatSlider.prototype._onClick = /**
* @param {?} event
* @return {?}
*/
function (event) {
if (this.disabled) {
return;
}
var /** @type {?} */ oldValue = this.value;
this._isSliding = false;
this._focusHostElement();
this._updateValueFromPosition({ x: event.clientX, y: event.clientY });
// Emit a change and input event if the value changed.
if (oldValue != this.value) {
this._emitInputEvent();
this._emitChangeEvent();
}
};
/**
* @param {?} event
* @return {?}
*/
MatSlider.prototype._onSlide = /**
* @param {?} event
* @return {?}
*/
function (event) {
if (this.disabled) {
return;
}
// The slide start event sometimes fails to fire on iOS, so if we're not already in the sliding
// state, call the slide start handler manually.
if (!this._isSliding) {
this._onSlideStart(null);
}
// Prevent the slide from selecting anything else.
event.preventDefault();
var /** @type {?} */ oldValue = this.value;
this._updateValueFromPosition({ x: event.center.x, y: event.center.y });
// Native range elements always emit `input` events when the value changed while sliding.
if (oldValue != this.value) {
this._emitInputEvent();
}
};
/**
* @param {?} event
* @return {?}
*/
MatSlider.prototype._onSlideStart = /**
* @param {?} event
* @return {?}
*/
function (event) {
if (this.disabled || this._isSliding) {
return;
}
// Simulate mouseenter in case this is a mobile device.
this._onMouseenter();
this._isSliding = true;
this._focusHostElement();
this._valueOnSlideStart = this.value;
if (event) {
this._updateValueFromPosition({ x: event.center.x, y: event.center.y });
event.preventDefault();
}
};
/**
* @return {?}
*/
MatSlider.prototype._onSlideEnd = /**
* @return {?}
*/
function () {
this._isSliding = false;
if (this._valueOnSlideStart != this.value && !this.disabled) {
this._emitChangeEvent();
}
this._valueOnSlideStart = null;
};
/**
* @return {?}
*/
MatSlider.prototype._onFocus = /**
* @return {?}
*/
function () {
// We save the dimensions of the slider here so we can use them to update the spacing of the
// ticks and determine where on the slider click and slide events happen.
this._sliderDimensions = this._getSliderDimensions();
this._updateTickIntervalPercent();
};
/**
* @return {?}
*/
MatSlider.prototype._onBlur = /**
* @return {?}
*/
function () {
this.onTouched();
};
/**
* @param {?} event
* @return {?}
*/
MatSlider.prototype._onKeydown = /**
* @param {?} event
* @return {?}
*/
function (event) {
if (this.disabled) {
return;
}
var /** @type {?} */ oldValue = this.value;
switch (event.keyCode) {
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["PAGE_UP"]:
this._increment(10);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["PAGE_DOWN"]:
this._increment(-10);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["END"]:
this.value = this.max;
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["HOME"]:
this.value = this.min;
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["LEFT_ARROW"]:
// NOTE: For a sighted user it would make more sense that when they press an arrow key on an
// inverted slider the thumb moves in that direction. However for a blind user, nothing
// about the slider indicates that it is inverted. They will expect left to be decrement,
// regardless of how it appears on the screen. For speakers ofRTL languages, they probably
// expect left to mean increment. Therefore we flip the meaning of the side arrow keys for
// RTL. For inverted sliders we prefer a good a11y experience to having it "look right" for
// sighted users, therefore we do not swap the meaning.
this._increment(this._direction == 'rtl' ? 1 : -1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["UP_ARROW"]:
this._increment(1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["RIGHT_ARROW"]:
// See comment on LEFT_ARROW about the conditions under which we flip the meaning.
this._increment(this._direction == 'rtl' ? -1 : 1);
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_4__["DOWN_ARROW"]:
this._increment(-1);
break;
default:
// Return if the key is not one that we explicitly handle to avoid calling preventDefault on
// it.
return;
}
if (oldValue != this.value) {
this._emitInputEvent();
this._emitChangeEvent();
}
this._isSliding = true;
event.preventDefault();
};
/**
* @return {?}
*/
MatSlider.prototype._onKeyup = /**
* @return {?}
*/
function () {
this._isSliding = false;
};
/**
* Increments the slider by the given number of steps (negative number decrements).
* @param {?} numSteps
* @return {?}
*/
MatSlider.prototype._increment = /**
* Increments the slider by the given number of steps (negative number decrements).
* @param {?} numSteps
* @return {?}
*/
function (numSteps) {
this.value = this._clamp((this.value || 0) + this.step * numSteps, this.min, this.max);
};
/**
* Calculate the new value from the new physical location. The value will always be snapped.
* @param {?} pos
* @return {?}
*/
MatSlider.prototype._updateValueFromPosition = /**
* Calculate the new value from the new physical location. The value will always be snapped.
* @param {?} pos
* @return {?}
*/
function (pos) {
if (!this._sliderDimensions) {
return;
}
var /** @type {?} */ offset = this.vertical ? this._sliderDimensions.top : this._sliderDimensions.left;
var /** @type {?} */ size = this.vertical ? this._sliderDimensions.height : this._sliderDimensions.width;
var /** @type {?} */ posComponent = this.vertical ? pos.y : pos.x;
// The exact value is calculated from the event and used to find the closest snap value.
var /** @type {?} */ percent = this._clamp((posComponent - offset) / size);
if (this._invertMouseCoords) {
percent = 1 - percent;
}
// Since the steps may not divide cleanly into the max value, if the user
// slid to 0 or 100 percent, we jump to the min/max value. This approach
// is slightly more intuitive than using `Math.ceil` below, because it
// follows the user's pointer closer.
if (percent === 0) {
this.value = this.min;
}
else if (percent === 1) {
this.value = this.max;
}
else {
var /** @type {?} */ exactValue = this._calculateValue(percent);
// This calculation finds the closest step by finding the closest
// whole number divisible by the step relative to the min.
var /** @type {?} */ closestValue = Math.round((exactValue - this.min) / this.step) * this.step + this.min;
// If we've got a step with a decimal, we may end up with something like 33.300000000000004.
// Truncate the value to ensure that it matches the label and to make it easier to work with.
if (this._roundToDecimal) {
closestValue = parseFloat(closestValue.toFixed(this._roundToDecimal));
}
// The value needs to snap to the min and max.
this.value = this._clamp(closestValue, this.min, this.max);
}
};
/**
* Emits a change event if the current value is different from the last emitted value.
* @return {?}
*/
MatSlider.prototype._emitChangeEvent = /**
* Emits a change event if the current value is different from the last emitted value.
* @return {?}
*/
function () {
this._controlValueAccessorChangeFn(this.value);
this.change.emit(this._createChangeEvent());
};
/**
* Emits an input event when the current value is different from the last emitted value.
* @return {?}
*/
MatSlider.prototype._emitInputEvent = /**
* Emits an input event when the current value is different from the last emitted value.
* @return {?}
*/
function () {
this.input.emit(this._createChangeEvent());
};
/**
* Updates the amount of space between ticks as a percentage of the width of the slider.
* @return {?}
*/
MatSlider.prototype._updateTickIntervalPercent = /**
* Updates the amount of space between ticks as a percentage of the width of the slider.
* @return {?}
*/
function () {
if (!this.tickInterval || !this._sliderDimensions) {
return;
}
if (this.tickInterval == 'auto') {
var /** @type {?} */ trackSize = this.vertical ? this._sliderDimensions.height : this._sliderDimensions.width;
var /** @type {?} */ pixelsPerStep = trackSize * this.step / (this.max - this.min);
var /** @type {?} */ stepsPerTick = Math.ceil(MIN_AUTO_TICK_SEPARATION / pixelsPerStep);
var /** @type {?} */ pixelsPerTick = stepsPerTick * this.step;
this._tickIntervalPercent = pixelsPerTick / trackSize;
}
else {
this._tickIntervalPercent = this.tickInterval * this.step / (this.max - this.min);
}
};
/**
* Creates a slider change object from the specified value.
* @param {?=} value
* @return {?}
*/
MatSlider.prototype._createChangeEvent = /**
* Creates a slider change object from the specified value.
* @param {?=} value
* @return {?}
*/
function (value) {
if (value === void 0) { value = this.value; }
var /** @type {?} */ event = new MatSliderChange();
event.source = this;
event.value = value;
return event;
};
/**
* Calculates the percentage of the slider that a value is.
* @param {?} value
* @return {?}
*/
MatSlider.prototype._calculatePercentage = /**
* Calculates the percentage of the slider that a value is.
* @param {?} value
* @return {?}
*/
function (value) {
return ((value || 0) - this.min) / (this.max - this.min);
};
/**
* Calculates the value a percentage of the slider corresponds to.
* @param {?} percentage
* @return {?}
*/
MatSlider.prototype._calculateValue = /**
* Calculates the value a percentage of the slider corresponds to.
* @param {?} percentage
* @return {?}
*/
function (percentage) {
return this.min + percentage * (this.max - this.min);
};
/**
* Return a number between two numbers.
* @param {?} value
* @param {?=} min
* @param {?=} max
* @return {?}
*/
MatSlider.prototype._clamp = /**
* Return a number between two numbers.
* @param {?} value
* @param {?=} min
* @param {?=} max
* @return {?}
*/
function (value, min, max) {
if (min === void 0) { min = 0; }
if (max === void 0) { max = 1; }
return Math.max(min, Math.min(value, max));
};
/**
* Get the bounding client rect of the slider track element.
* The track is used rather than the native element to ignore the extra space that the thumb can
* take up.
* @return {?}
*/
MatSlider.prototype._getSliderDimensions = /**
* Get the bounding client rect of the slider track element.
* The track is used rather than the native element to ignore the extra space that the thumb can
* take up.
* @return {?}
*/
function () {
return this._sliderWrapper ? this._sliderWrapper.nativeElement.getBoundingClientRect() : null;
};
/**
* Focuses the native element.
* Currently only used to allow a blur event to fire but will be used with keyboard input later.
* @return {?}
*/
MatSlider.prototype._focusHostElement = /**
* Focuses the native element.
* Currently only used to allow a blur event to fire but will be used with keyboard input later.
* @return {?}
*/
function () {
this._elementRef.nativeElement.focus();
};
/**
* Blurs the native element.
* @return {?}
*/
MatSlider.prototype._blurHostElement = /**
* Blurs the native element.
* @return {?}
*/
function () {
this._elementRef.nativeElement.blur();
};
/**
* Sets the model value. Implemented as part of ControlValueAccessor.
* @param value
*/
/**
* Sets the model value. Implemented as part of ControlValueAccessor.
* @param {?} value
* @return {?}
*/
MatSlider.prototype.writeValue = /**
* Sets the model value. Implemented as part of ControlValueAccessor.
* @param {?} value
* @return {?}
*/
function (value) {
this.value = value;
};
/**
* Registers a callback to eb triggered when the value has changed.
* Implemented as part of ControlValueAccessor.
* @param fn Callback to be registered.
*/
/**
* Registers a callback to eb triggered when the value has changed.
* Implemented as part of ControlValueAccessor.
* @param {?} fn Callback to be registered.
* @return {?}
*/
MatSlider.prototype.registerOnChange = /**
* Registers a callback to eb triggered when the value has changed.
* Implemented as part of ControlValueAccessor.
* @param {?} fn Callback to be registered.
* @return {?}
*/
function (fn) {
this._controlValueAccessorChangeFn = fn;
};
/**
* Registers a callback to be triggered when the component is touched.
* Implemented as part of ControlValueAccessor.
* @param fn Callback to be registered.
*/
/**
* Registers a callback to be triggered when the component is touched.
* Implemented as part of ControlValueAccessor.
* @param {?} fn Callback to be registered.
* @return {?}
*/
MatSlider.prototype.registerOnTouched = /**
* Registers a callback to be triggered when the component is touched.
* Implemented as part of ControlValueAccessor.
* @param {?} fn Callback to be registered.
* @return {?}
*/
function (fn) {
this.onTouched = fn;
};
/**
* Sets whether the component should be disabled.
* Implemented as part of ControlValueAccessor.
* @param isDisabled
*/
/**
* Sets whether the component should be disabled.
* Implemented as part of ControlValueAccessor.
* @param {?} isDisabled
* @return {?}
*/
MatSlider.prototype.setDisabledState = /**
* Sets whether the component should be disabled.
* Implemented as part of ControlValueAccessor.
* @param {?} isDisabled
* @return {?}
*/
function (isDisabled) {
this.disabled = isDisabled;
};
MatSlider.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Component"], args: [{selector: 'mat-slider',
exportAs: 'matSlider',
providers: [MAT_SLIDER_VALUE_ACCESSOR],
host: {
'(focus)': '_onFocus()',
'(blur)': '_onBlur()',
'(click)': '_onClick($event)',
'(keydown)': '_onKeydown($event)',
'(keyup)': '_onKeyup()',
'(mouseenter)': '_onMouseenter()',
'(slide)': '_onSlide($event)',
'(slideend)': '_onSlideEnd()',
'(slidestart)': '_onSlideStart($event)',
'class': 'mat-slider',
'role': 'slider',
'[tabIndex]': 'tabIndex',
'[attr.aria-disabled]': 'disabled',
'[attr.aria-valuemax]': 'max',
'[attr.aria-valuemin]': 'min',
'[attr.aria-valuenow]': 'value',
'[attr.aria-orientation]': 'vertical ? "vertical" : "horizontal"',
'[class.mat-slider-disabled]': 'disabled',
'[class.mat-slider-has-ticks]': 'tickInterval',
'[class.mat-slider-horizontal]': '!vertical',
'[class.mat-slider-axis-inverted]': '_invertAxis',
'[class.mat-slider-sliding]': '_isSliding',
'[class.mat-slider-thumb-label-showing]': 'thumbLabel',
'[class.mat-slider-vertical]': 'vertical',
'[class.mat-slider-min-value]': '_isMinValue',
'[class.mat-slider-hide-last-tick]': 'disabled || _isMinValue && _thumbGap && _invertAxis',
},
template: "<div class=\"mat-slider-wrapper\" #sliderWrapper><div class=\"mat-slider-track-wrapper\"><div class=\"mat-slider-track-background\" [ngStyle]=\"_trackBackgroundStyles\"></div><div class=\"mat-slider-track-fill\" [ngStyle]=\"_trackFillStyles\"></div></div><div class=\"mat-slider-ticks-container\" [ngStyle]=\"_ticksContainerStyles\"><div class=\"mat-slider-ticks\" [ngStyle]=\"_ticksStyles\"></div></div><div class=\"mat-slider-thumb-container\" [ngStyle]=\"_thumbContainerStyles\"><div class=\"mat-slider-focus-ring\"></div><div class=\"mat-slider-thumb\"></div><div class=\"mat-slider-thumb-label\"><span class=\"mat-slider-thumb-label-text\">{{displayValue}}</span></div></div></div>",
styles: [".mat-slider{display:inline-block;position:relative;box-sizing:border-box;padding:8px;outline:0;vertical-align:middle}.mat-slider-wrapper{position:absolute}.mat-slider-track-wrapper{position:absolute;top:0;left:0;overflow:hidden}.mat-slider-track-fill{position:absolute;transform-origin:0 0;transition:transform .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1)}.mat-slider-track-background{position:absolute;transform-origin:100% 100%;transition:transform .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1)}.mat-slider-ticks-container{position:absolute;left:0;top:0;overflow:hidden}.mat-slider-ticks{background-repeat:repeat;background-clip:content-box;box-sizing:border-box;opacity:0;transition:opacity .4s cubic-bezier(.25,.8,.25,1)}.mat-slider-thumb-container{position:absolute;z-index:1;transition:transform .4s cubic-bezier(.25,.8,.25,1)}.mat-slider-focus-ring{position:absolute;width:30px;height:30px;border-radius:50%;transform:scale(0);opacity:0;transition:transform .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1),opacity .4s cubic-bezier(.25,.8,.25,1)}.cdk-keyboard-focused .mat-slider-focus-ring,.cdk-program-focused .mat-slider-focus-ring{transform:scale(1);opacity:1}.mat-slider:not(.mat-slider-disabled) .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled) .mat-slider-thumb-label{cursor:-webkit-grab;cursor:grab}.mat-slider-sliding:not(.mat-slider-disabled) .mat-slider-thumb,.mat-slider-sliding:not(.mat-slider-disabled) .mat-slider-thumb-label,.mat-slider:not(.mat-slider-disabled) .mat-slider-thumb-label:active,.mat-slider:not(.mat-slider-disabled) .mat-slider-thumb:active{cursor:-webkit-grabbing;cursor:grabbing}.mat-slider-thumb{position:absolute;right:-10px;bottom:-10px;box-sizing:border-box;width:20px;height:20px;border:3px solid transparent;border-radius:50%;transform:scale(.7);transition:transform .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1),border-color .4s cubic-bezier(.25,.8,.25,1)}.mat-slider-thumb-label{display:none;align-items:center;justify-content:center;position:absolute;width:28px;height:28px;border-radius:50%;transition:transform .4s cubic-bezier(.25,.8,.25,1),border-radius .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1)}.mat-slider-thumb-label-text{z-index:1;opacity:0;transition:opacity .4s cubic-bezier(.25,.8,.25,1)}.mat-slider-sliding .mat-slider-thumb-container,.mat-slider-sliding .mat-slider-track-background,.mat-slider-sliding .mat-slider-track-fill{transition-duration:0s}.mat-slider-has-ticks .mat-slider-wrapper::after{content:'';position:absolute;border-width:0;border-style:solid;opacity:0;transition:opacity .4s cubic-bezier(.25,.8,.25,1)}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after,.mat-slider-has-ticks:hover:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after{opacity:1}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-disabled) .mat-slider-ticks,.mat-slider-has-ticks:hover:not(.mat-slider-disabled) .mat-slider-ticks{opacity:1}.mat-slider-thumb-label-showing .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-thumb-label-showing .mat-slider-thumb-label{display:flex}.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:100% 100%}.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:0 0}.mat-slider:not(.mat-slider-disabled).cdk-focused.mat-slider-thumb-label-showing .mat-slider-thumb{transform:scale(0)}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label{border-radius:50% 50% 0}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label-text{opacity:1}.mat-slider:not(.mat-slider-disabled).cdk-mouse-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-program-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-touch-focused .mat-slider-thumb{border-width:2px;transform:scale(1)}.mat-slider-disabled .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-disabled .mat-slider-thumb{border-width:4px;transform:scale(.5)}.mat-slider-disabled .mat-slider-thumb-label{display:none}.mat-slider-horizontal{height:48px;min-width:128px}.mat-slider-horizontal .mat-slider-wrapper{height:2px;top:23px;left:8px;right:8px}.mat-slider-horizontal .mat-slider-wrapper::after{height:2px;border-left-width:2px;right:0;top:0}.mat-slider-horizontal .mat-slider-track-wrapper{height:2px;width:100%}.mat-slider-horizontal .mat-slider-track-fill{height:2px;width:100%;transform:scaleX(0)}.mat-slider-horizontal .mat-slider-track-background{height:2px;width:100%;transform:scaleX(1)}.mat-slider-horizontal .mat-slider-ticks-container{height:2px;width:100%}@media screen and (-ms-high-contrast:active){.mat-slider-horizontal .mat-slider-ticks-container{height:0;outline:solid 2px;top:1px}}.mat-slider-horizontal .mat-slider-ticks{height:2px;width:100%}.mat-slider-horizontal .mat-slider-thumb-container{width:100%;height:0;top:50%}.mat-slider-horizontal .mat-slider-focus-ring{top:-15px;right:-15px}.mat-slider-horizontal .mat-slider-thumb-label{right:-14px;top:-40px;transform:translateY(26px) scale(.01) rotate(45deg)}.mat-slider-horizontal .mat-slider-thumb-label-text{transform:rotate(-45deg)}.mat-slider-horizontal.cdk-focused .mat-slider-thumb-label{transform:rotate(45deg)}.mat-slider-vertical{width:48px;min-height:128px}.mat-slider-vertical .mat-slider-wrapper{width:2px;top:8px;bottom:8px;left:23px}.mat-slider-vertical .mat-slider-wrapper::after{width:2px;border-top-width:2px;bottom:0;left:0}.mat-slider-vertical .mat-slider-track-wrapper{height:100%;width:2px}.mat-slider-vertical .mat-slider-track-fill{height:100%;width:2px;transform:scaleY(0)}.mat-slider-vertical .mat-slider-track-background{height:100%;width:2px;transform:scaleY(1)}.mat-slider-vertical .mat-slider-ticks-container{width:2px;height:100%}@media screen and (-ms-high-contrast:active){.mat-slider-vertical .mat-slider-ticks-container{width:0;outline:solid 2px;left:1px}}.mat-slider-vertical .mat-slider-focus-ring{bottom:-15px;left:-15px}.mat-slider-vertical .mat-slider-ticks{width:2px;height:100%}.mat-slider-vertical .mat-slider-thumb-container{height:100%;width:0;left:50%}.mat-slider-vertical .mat-slider-thumb{-webkit-backface-visibility:hidden;backface-visibility:hidden}.mat-slider-vertical .mat-slider-thumb-label{bottom:-14px;left:-40px;transform:translateX(26px) scale(.01) rotate(-45deg)}.mat-slider-vertical .mat-slider-thumb-label-text{transform:rotate(45deg)}.mat-slider-vertical.cdk-focused .mat-slider-thumb-label{transform:rotate(-45deg)}[dir=rtl] .mat-slider-wrapper::after{left:0;right:auto}[dir=rtl] .mat-slider-horizontal .mat-slider-track-fill{transform-origin:100% 100%}[dir=rtl] .mat-slider-horizontal .mat-slider-track-background{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:100% 100%}"],
inputs: ['disabled', 'color', 'tabIndex'],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_5__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_5__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatSlider.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["ElementRef"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__["FocusMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["ChangeDetectorRef"], },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_2__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Optional"] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Attribute"], args: ['tabindex',] },] },
]; };
MatSlider.propDecorators = {
"invert": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Input"] },],
"max": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Input"] },],
"min": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Input"] },],
"step": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Input"] },],
"thumbLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Input"] },],
"tickInterval": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Input"] },],
"value": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Input"] },],
"displayWith": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Input"] },],
"vertical": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Input"] },],
"change": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Output"] },],
"input": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["Output"] },],
"_sliderWrapper": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["ViewChild"], args: ['sliderWrapper',] },],
};
return MatSlider;
}(_MatSliderMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatSliderModule = /** @class */ (function () {
function MatSliderModule() {
}
MatSliderModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__["NgModule"], args: [{
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_9__["CommonModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_7__["MatCommonModule"]],
exports: [MatSlider, _angular_material_core__WEBPACK_IMPORTED_MODULE_7__["MatCommonModule"]],
declarations: [MatSlider],
providers: [{ provide: _angular_platform_browser__WEBPACK_IMPORTED_MODULE_10__["HAMMER_GESTURE_CONFIG"], useClass: _angular_material_core__WEBPACK_IMPORTED_MODULE_7__["GestureConfig"] }]
},] },
];
return MatSliderModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=slider.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/snack-bar.es5.js":
/*!**************************************************************!*\
!*** ./node_modules/@angular/material/esm5/snack-bar.es5.js ***!
\**************************************************************/
/*! exports provided: MatSnackBarModule, MAT_SNACK_BAR_DEFAULT_OPTIONS, MAT_SNACK_BAR_DEFAULT_OPTIONS_FACTORY, MatSnackBar, MatSnackBarContainer, MAT_SNACK_BAR_DATA, MatSnackBarConfig, MatSnackBarRef, SimpleSnackBar, matSnackBarAnimations */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSnackBarModule", function() { return MatSnackBarModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SNACK_BAR_DEFAULT_OPTIONS", function() { return MAT_SNACK_BAR_DEFAULT_OPTIONS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SNACK_BAR_DEFAULT_OPTIONS_FACTORY", function() { return MAT_SNACK_BAR_DEFAULT_OPTIONS_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSnackBar", function() { return MatSnackBar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSnackBarContainer", function() { return MatSnackBarContainer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SNACK_BAR_DATA", function() { return MAT_SNACK_BAR_DATA; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSnackBarConfig", function() { return MatSnackBarConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSnackBarRef", function() { return MatSnackBarRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleSnackBar", function() { return SimpleSnackBar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matSnackBarAnimations", function() { return matSnackBarAnimations; });
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/portal */ "./node_modules/@angular/cdk/esm5/portal.es5.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_layout__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/cdk/layout */ "./node_modules/@angular/cdk/esm5/layout.es5.js");
/* harmony import */ var _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/cdk/overlay */ "./node_modules/@angular/cdk/esm5/overlay.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/button */ "./node_modules/@angular/material/esm5/button.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Reference to a snack bar dispatched from the snack bar service.
* @template T
*/
var /**
* Reference to a snack bar dispatched from the snack bar service.
* @template T
*/
MatSnackBarRef = /** @class */ (function () {
function MatSnackBarRef(containerInstance, _overlayRef) {
var _this = this;
this._overlayRef = _overlayRef;
/**
* Subject for notifying the user that the snack bar has been dismissed.
*/
this._afterDismissed = new rxjs__WEBPACK_IMPORTED_MODULE_0__["Subject"]();
/**
* Subject for notifying the user that the snack bar has opened and appeared.
*/
this._afterOpened = new rxjs__WEBPACK_IMPORTED_MODULE_0__["Subject"]();
/**
* Subject for notifying the user that the snack bar action was called.
*/
this._onAction = new rxjs__WEBPACK_IMPORTED_MODULE_0__["Subject"]();
/**
* Whether the snack bar was dismissed using the action button.
*/
this._dismissedByAction = false;
this.containerInstance = containerInstance;
// Dismiss snackbar on action.
this.onAction().subscribe(function () { return _this.dismiss(); });
containerInstance._onExit.subscribe(function () { return _this._finishDismiss(); });
}
/** Dismisses the snack bar. */
/**
* Dismisses the snack bar.
* @return {?}
*/
MatSnackBarRef.prototype.dismiss = /**
* Dismisses the snack bar.
* @return {?}
*/
function () {
if (!this._afterDismissed.closed) {
this.containerInstance.exit();
}
clearTimeout(this._durationTimeoutId);
};
/** Marks the snackbar action clicked. */
/**
* Marks the snackbar action clicked.
* @return {?}
*/
MatSnackBarRef.prototype.dismissWithAction = /**
* Marks the snackbar action clicked.
* @return {?}
*/
function () {
if (!this._onAction.closed) {
this._dismissedByAction = true;
this._onAction.next();
this._onAction.complete();
}
};
/**
* Marks the snackbar action clicked.
* @deprecated Use `dismissWithAction` instead.
* @deletion-target 7.0.0
*/
/**
* Marks the snackbar action clicked.
* @deprecated Use `dismissWithAction` instead.
* \@deletion-target 7.0.0
* @return {?}
*/
MatSnackBarRef.prototype.closeWithAction = /**
* Marks the snackbar action clicked.
* @deprecated Use `dismissWithAction` instead.
* \@deletion-target 7.0.0
* @return {?}
*/
function () {
this.dismissWithAction();
};
/** Dismisses the snack bar after some duration */
/**
* Dismisses the snack bar after some duration
* @param {?} duration
* @return {?}
*/
MatSnackBarRef.prototype._dismissAfter = /**
* Dismisses the snack bar after some duration
* @param {?} duration
* @return {?}
*/
function (duration) {
var _this = this;
this._durationTimeoutId = setTimeout(function () { return _this.dismiss(); }, duration);
};
/** Marks the snackbar as opened */
/**
* Marks the snackbar as opened
* @return {?}
*/
MatSnackBarRef.prototype._open = /**
* Marks the snackbar as opened
* @return {?}
*/
function () {
if (!this._afterOpened.closed) {
this._afterOpened.next();
this._afterOpened.complete();
}
};
/**
* Cleans up the DOM after closing.
* @return {?}
*/
MatSnackBarRef.prototype._finishDismiss = /**
* Cleans up the DOM after closing.
* @return {?}
*/
function () {
this._overlayRef.dispose();
if (!this._onAction.closed) {
this._onAction.complete();
}
this._afterDismissed.next({ dismissedByAction: this._dismissedByAction });
this._afterDismissed.complete();
this._dismissedByAction = false;
};
/** Gets an observable that is notified when the snack bar is finished closing. */
/**
* Gets an observable that is notified when the snack bar is finished closing.
* @return {?}
*/
MatSnackBarRef.prototype.afterDismissed = /**
* Gets an observable that is notified when the snack bar is finished closing.
* @return {?}
*/
function () {
return this._afterDismissed.asObservable();
};
/** Gets an observable that is notified when the snack bar has opened and appeared. */
/**
* Gets an observable that is notified when the snack bar has opened and appeared.
* @return {?}
*/
MatSnackBarRef.prototype.afterOpened = /**
* Gets an observable that is notified when the snack bar has opened and appeared.
* @return {?}
*/
function () {
return this.containerInstance._onEnter;
};
/** Gets an observable that is notified when the snack bar action is called. */
/**
* Gets an observable that is notified when the snack bar action is called.
* @return {?}
*/
MatSnackBarRef.prototype.onAction = /**
* Gets an observable that is notified when the snack bar action is called.
* @return {?}
*/
function () {
return this._onAction.asObservable();
};
return MatSnackBarRef;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token that can be used to access the data that was passed in to a snack bar.
*/
var /** @type {?} */ MAT_SNACK_BAR_DATA = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('MatSnackBarData');
/**
* Configuration used when opening a snack-bar.
* @template D
*/
var /**
* Configuration used when opening a snack-bar.
* @template D
*/
MatSnackBarConfig = /** @class */ (function () {
function MatSnackBarConfig() {
/**
* The politeness level for the MatAriaLiveAnnouncer announcement.
*/
this.politeness = 'assertive';
/**
* Message to be announced by the MatAriaLiveAnnouncer
*/
this.announcementMessage = '';
/**
* The length of time in milliseconds to wait before automatically dismissing the snack bar.
*/
this.duration = 0;
/**
* Data being injected into the child component.
*/
this.data = null;
/**
* The horizontal position to place the snack bar.
*/
this.horizontalPosition = 'center';
/**
* The vertical position to place the snack bar.
*/
this.verticalPosition = 'bottom';
}
return MatSnackBarConfig;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Animations used by the Material snack bar.
*/
var /** @type {?} */ matSnackBarAnimations = {
/** Animation that slides the dialog in and out of view and fades the opacity. */
contentFade: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_2__["trigger"])('contentFade', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_2__["transition"])(':enter', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_2__["style"])({ opacity: '0' }),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_2__["animate"])(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["AnimationDurations"].COMPLEX + " " + _angular_material_core__WEBPACK_IMPORTED_MODULE_3__["AnimationCurves"].STANDARD_CURVE)
])
]),
/** Animation that shows and hides a snack bar. */
snackBarState: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_2__["trigger"])('state', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_2__["state"])('visible-top, visible-bottom', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_2__["style"])({ transform: 'translateY(0%)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_2__["transition"])('visible-top => hidden-top, visible-bottom => hidden-bottom', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_2__["animate"])(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["AnimationDurations"].EXITING + " " + _angular_material_core__WEBPACK_IMPORTED_MODULE_3__["AnimationCurves"].ACCELERATION_CURVE)),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_2__["transition"])('void => visible-top, void => visible-bottom', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_2__["animate"])(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["AnimationDurations"].ENTERING + " " + _angular_material_core__WEBPACK_IMPORTED_MODULE_3__["AnimationCurves"].DECELERATION_CURVE)),
])
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* A component used to open as the default snack bar, matching material spec.
* This should only be used internally by the snack bar service.
*/
var SimpleSnackBar = /** @class */ (function () {
function SimpleSnackBar(snackBarRef, data) {
this.snackBarRef = snackBarRef;
this.data = data;
}
/** Performs the action on the snack bar. */
/**
* Performs the action on the snack bar.
* @return {?}
*/
SimpleSnackBar.prototype.action = /**
* Performs the action on the snack bar.
* @return {?}
*/
function () {
this.snackBarRef.dismissWithAction();
};
Object.defineProperty(SimpleSnackBar.prototype, "hasAction", {
/** If the action button should be shown. */
get: /**
* If the action button should be shown.
* @return {?}
*/
function () {
return !!this.data.action;
},
enumerable: true,
configurable: true
});
SimpleSnackBar.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'simple-snack-bar',
template: "{{data.message}}<div class=\"mat-simple-snackbar-action\" *ngIf=\"hasAction\"><button mat-button (click)=\"action()\">{{data.action}}</button></div>",
styles: [".mat-simple-snackbar{display:flex;justify-content:space-between;line-height:20px;opacity:1}.mat-simple-snackbar-action{display:flex;flex-direction:column;flex-shrink:0;justify-content:space-around;margin:-8px 0 -8px 8px}.mat-simple-snackbar-action button{flex:1;max-height:36px}[dir=rtl] .mat-simple-snackbar-action{margin-left:0;margin-right:8px}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
animations: [matSnackBarAnimations.contentFade],
host: {
'[@contentFade]': '',
'class': 'mat-simple-snackbar',
}
},] },
];
/** @nocollapse */
SimpleSnackBar.ctorParameters = function () { return [
{ type: MatSnackBarRef, },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [MAT_SNACK_BAR_DATA,] },] },
]; };
return SimpleSnackBar;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Internal component that wraps user-provided snack bar content.
* \@docs-private
*/
var MatSnackBarContainer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_4__["__extends"])(MatSnackBarContainer, _super);
function MatSnackBarContainer(_ngZone, _elementRef, _changeDetectorRef) {
var _this = _super.call(this) || this;
_this._ngZone = _ngZone;
_this._elementRef = _elementRef;
_this._changeDetectorRef = _changeDetectorRef;
/**
* Whether the component has been destroyed.
*/
_this._destroyed = false;
/**
* Subject for notifying that the snack bar has exited from view.
*/
_this._onExit = new rxjs__WEBPACK_IMPORTED_MODULE_0__["Subject"]();
/**
* Subject for notifying that the snack bar has finished entering the view.
*/
_this._onEnter = new rxjs__WEBPACK_IMPORTED_MODULE_0__["Subject"]();
/**
* The state of the snack bar animations.
*/
_this._animationState = 'void';
return _this;
}
/** Attach a component portal as content to this snack bar container. */
/**
* Attach a component portal as content to this snack bar container.
* @template T
* @param {?} portal
* @return {?}
*/
MatSnackBarContainer.prototype.attachComponentPortal = /**
* Attach a component portal as content to this snack bar container.
* @template T
* @param {?} portal
* @return {?}
*/
function (portal) {
this._assertNotAttached();
this._applySnackBarClasses();
return this._portalOutlet.attachComponentPortal(portal);
};
/** Attach a template portal as content to this snack bar container. */
/**
* Attach a template portal as content to this snack bar container.
* @template C
* @param {?} portal
* @return {?}
*/
MatSnackBarContainer.prototype.attachTemplatePortal = /**
* Attach a template portal as content to this snack bar container.
* @template C
* @param {?} portal
* @return {?}
*/
function (portal) {
this._assertNotAttached();
this._applySnackBarClasses();
return this._portalOutlet.attachTemplatePortal(portal);
};
/** Handle end of animations, updating the state of the snackbar. */
/**
* Handle end of animations, updating the state of the snackbar.
* @param {?} event
* @return {?}
*/
MatSnackBarContainer.prototype.onAnimationEnd = /**
* Handle end of animations, updating the state of the snackbar.
* @param {?} event
* @return {?}
*/
function (event) {
var fromState = event.fromState, toState = event.toState;
if ((toState === 'void' && fromState !== 'void') || toState.startsWith('hidden')) {
this._completeExit();
}
if (toState.startsWith('visible')) {
// Note: we shouldn't use `this` inside the zone callback,
// because it can cause a memory leak.
var /** @type {?} */ onEnter_1 = this._onEnter;
this._ngZone.run(function () {
onEnter_1.next();
onEnter_1.complete();
});
}
};
/** Begin animation of snack bar entrance into view. */
/**
* Begin animation of snack bar entrance into view.
* @return {?}
*/
MatSnackBarContainer.prototype.enter = /**
* Begin animation of snack bar entrance into view.
* @return {?}
*/
function () {
if (!this._destroyed) {
this._animationState = "visible-" + this.snackBarConfig.verticalPosition;
this._changeDetectorRef.detectChanges();
}
};
/** Begin animation of the snack bar exiting from view. */
/**
* Begin animation of the snack bar exiting from view.
* @return {?}
*/
MatSnackBarContainer.prototype.exit = /**
* Begin animation of the snack bar exiting from view.
* @return {?}
*/
function () {
this._animationState = "hidden-" + this.snackBarConfig.verticalPosition;
return this._onExit;
};
/** Makes sure the exit callbacks have been invoked when the element is destroyed. */
/**
* Makes sure the exit callbacks have been invoked when the element is destroyed.
* @return {?}
*/
MatSnackBarContainer.prototype.ngOnDestroy = /**
* Makes sure the exit callbacks have been invoked when the element is destroyed.
* @return {?}
*/
function () {
this._destroyed = true;
this._completeExit();
};
/**
* Waits for the zone to settle before removing the element. Helps prevent
* errors where we end up removing an element which is in the middle of an animation.
* @return {?}
*/
MatSnackBarContainer.prototype._completeExit = /**
* Waits for the zone to settle before removing the element. Helps prevent
* errors where we end up removing an element which is in the middle of an animation.
* @return {?}
*/
function () {
var _this = this;
this._ngZone.onMicrotaskEmpty.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["take"])(1)).subscribe(function () {
_this._onExit.next();
_this._onExit.complete();
});
};
/**
* Applies the various positioning and user-configured CSS classes to the snack bar.
* @return {?}
*/
MatSnackBarContainer.prototype._applySnackBarClasses = /**
* Applies the various positioning and user-configured CSS classes to the snack bar.
* @return {?}
*/
function () {
var /** @type {?} */ element = this._elementRef.nativeElement;
var /** @type {?} */ panelClasses = this.snackBarConfig.panelClass;
if (panelClasses) {
if (Array.isArray(panelClasses)) {
// Note that we can't use a spread here, because IE doesn't support multiple arguments.
panelClasses.forEach(function (cssClass) { return element.classList.add(cssClass); });
}
else {
element.classList.add(panelClasses);
}
}
if (this.snackBarConfig.horizontalPosition === 'center') {
element.classList.add('mat-snack-bar-center');
}
if (this.snackBarConfig.verticalPosition === 'top') {
element.classList.add('mat-snack-bar-top');
}
};
/**
* Asserts that no content is already attached to the container.
* @return {?}
*/
MatSnackBarContainer.prototype._assertNotAttached = /**
* Asserts that no content is already attached to the container.
* @return {?}
*/
function () {
if (this._portalOutlet.hasAttached()) {
throw Error('Attempting to attach snack bar content after content is already attached');
}
};
MatSnackBarContainer.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'snack-bar-container',
template: "<ng-template cdkPortalOutlet></ng-template>",
styles: [".mat-snack-bar-container{border-radius:2px;box-sizing:border-box;display:block;margin:24px;max-width:568px;min-width:288px;padding:14px 24px;transform:translateY(100%) translateY(24px)}.mat-snack-bar-container.mat-snack-bar-center{margin:0;transform:translateY(100%)}.mat-snack-bar-container.mat-snack-bar-top{transform:translateY(-100%) translateY(-24px)}.mat-snack-bar-container.mat-snack-bar-top.mat-snack-bar-center{transform:translateY(-100%)}@media screen and (-ms-high-contrast:active){.mat-snack-bar-container{border:solid 1px}}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:0;max-width:inherit;width:100%}"],
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
animations: [matSnackBarAnimations.snackBarState],
host: {
'role': 'alert',
'class': 'mat-snack-bar-container',
'[@state]': '_animationState',
'(@state.done)': 'onAnimationEnd($event)'
},
},] },
];
/** @nocollapse */
MatSnackBarContainer.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"], },
]; };
MatSnackBarContainer.propDecorators = {
"_portalOutlet": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: [_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_5__["CdkPortalOutlet"],] },],
};
return MatSnackBarContainer;
}(_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_5__["BasePortalOutlet"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token that can be used to specify default snack bar.
*/
var /** @type {?} */ MAT_SNACK_BAR_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('mat-snack-bar-default-options', {
providedIn: 'root',
factory: MAT_SNACK_BAR_DEFAULT_OPTIONS_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function MAT_SNACK_BAR_DEFAULT_OPTIONS_FACTORY() {
return new MatSnackBarConfig();
}
/**
* Service to dispatch Material Design snack bar messages.
*/
var MatSnackBar = /** @class */ (function () {
function MatSnackBar(_overlay, _live, _injector, _breakpointObserver, _parentSnackBar, _defaultConfig) {
this._overlay = _overlay;
this._live = _live;
this._injector = _injector;
this._breakpointObserver = _breakpointObserver;
this._parentSnackBar = _parentSnackBar;
this._defaultConfig = _defaultConfig;
/**
* Reference to the current snack bar in the view *at this level* (in the Angular injector tree).
* If there is a parent snack-bar service, all operations should delegate to that parent
* via `_openedSnackBarRef`.
*/
this._snackBarRefAtThisLevel = null;
}
Object.defineProperty(MatSnackBar.prototype, "_openedSnackBarRef", {
/** Reference to the currently opened snackbar at *any* level. */
get: /**
* Reference to the currently opened snackbar at *any* level.
* @return {?}
*/
function () {
var /** @type {?} */ parent = this._parentSnackBar;
return parent ? parent._openedSnackBarRef : this._snackBarRefAtThisLevel;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (this._parentSnackBar) {
this._parentSnackBar._openedSnackBarRef = value;
}
else {
this._snackBarRefAtThisLevel = value;
}
},
enumerable: true,
configurable: true
});
/**
* Creates and dispatches a snack bar with a custom component for the content, removing any
* currently opened snack bars.
*
* @param component Component to be instantiated.
* @param config Extra configuration for the snack bar.
*/
/**
* Creates and dispatches a snack bar with a custom component for the content, removing any
* currently opened snack bars.
*
* @template T
* @param {?} component Component to be instantiated.
* @param {?=} config Extra configuration for the snack bar.
* @return {?}
*/
MatSnackBar.prototype.openFromComponent = /**
* Creates and dispatches a snack bar with a custom component for the content, removing any
* currently opened snack bars.
*
* @template T
* @param {?} component Component to be instantiated.
* @param {?=} config Extra configuration for the snack bar.
* @return {?}
*/
function (component, config) {
return /** @type {?} */ (this._attach(component, config));
};
/**
* Creates and dispatches a snack bar with a custom template for the content, removing any
* currently opened snack bars.
*
* @param template Template to be instantiated.
* @param config Extra configuration for the snack bar.
*/
/**
* Creates and dispatches a snack bar with a custom template for the content, removing any
* currently opened snack bars.
*
* @param {?} template Template to be instantiated.
* @param {?=} config Extra configuration for the snack bar.
* @return {?}
*/
MatSnackBar.prototype.openFromTemplate = /**
* Creates and dispatches a snack bar with a custom template for the content, removing any
* currently opened snack bars.
*
* @param {?} template Template to be instantiated.
* @param {?=} config Extra configuration for the snack bar.
* @return {?}
*/
function (template, config) {
return this._attach(template, config);
};
/**
* Opens a snackbar with a message and an optional action.
* @param message The message to show in the snackbar.
* @param action The label for the snackbar action.
* @param config Additional configuration options for the snackbar.
*/
/**
* Opens a snackbar with a message and an optional action.
* @param {?} message The message to show in the snackbar.
* @param {?=} action The label for the snackbar action.
* @param {?=} config Additional configuration options for the snackbar.
* @return {?}
*/
MatSnackBar.prototype.open = /**
* Opens a snackbar with a message and an optional action.
* @param {?} message The message to show in the snackbar.
* @param {?=} action The label for the snackbar action.
* @param {?=} config Additional configuration options for the snackbar.
* @return {?}
*/
function (message, action, config) {
if (action === void 0) { action = ''; }
var /** @type {?} */ _config = Object(tslib__WEBPACK_IMPORTED_MODULE_4__["__assign"])({}, this._defaultConfig, config);
// Since the user doesn't have access to the component, we can
// override the data to pass in our own message and action.
_config.data = { message: message, action: action };
_config.announcementMessage = message;
return this.openFromComponent(SimpleSnackBar, _config);
};
/**
* Dismisses the currently-visible snack bar.
*/
/**
* Dismisses the currently-visible snack bar.
* @return {?}
*/
MatSnackBar.prototype.dismiss = /**
* Dismisses the currently-visible snack bar.
* @return {?}
*/
function () {
if (this._openedSnackBarRef) {
this._openedSnackBarRef.dismiss();
}
};
/**
* Attaches the snack bar container component to the overlay.
* @param {?} overlayRef
* @param {?} config
* @return {?}
*/
MatSnackBar.prototype._attachSnackBarContainer = /**
* Attaches the snack bar container component to the overlay.
* @param {?} overlayRef
* @param {?} config
* @return {?}
*/
function (overlayRef, config) {
var /** @type {?} */ containerPortal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_5__["ComponentPortal"](MatSnackBarContainer, config.viewContainerRef);
var /** @type {?} */ containerRef = overlayRef.attach(containerPortal);
containerRef.instance.snackBarConfig = config;
return containerRef.instance;
};
/**
* Places a new component or a template as the content of the snack bar container.
* @template T
* @param {?} content
* @param {?=} userConfig
* @return {?}
*/
MatSnackBar.prototype._attach = /**
* Places a new component or a template as the content of the snack bar container.
* @template T
* @param {?} content
* @param {?=} userConfig
* @return {?}
*/
function (content, userConfig) {
var /** @type {?} */ config = Object(tslib__WEBPACK_IMPORTED_MODULE_4__["__assign"])({}, this._defaultConfig, userConfig);
var /** @type {?} */ overlayRef = this._createOverlay(config);
var /** @type {?} */ container = this._attachSnackBarContainer(overlayRef, config);
var /** @type {?} */ snackBarRef = new MatSnackBarRef(container, overlayRef);
if (content instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"]) {
var /** @type {?} */ portal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_5__["TemplatePortal"](content, /** @type {?} */ ((null)), /** @type {?} */ ({
$implicit: config.data,
snackBarRef: snackBarRef
}));
snackBarRef.instance = container.attachTemplatePortal(portal);
}
else {
var /** @type {?} */ injector = this._createInjector(config, snackBarRef);
var /** @type {?} */ portal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_5__["ComponentPortal"](content, undefined, injector);
var /** @type {?} */ contentRef = container.attachComponentPortal(portal);
// We can't pass this via the injector, because the injector is created earlier.
snackBarRef.instance = contentRef.instance;
}
// Subscribe to the breakpoint observer and attach the mat-snack-bar-handset class as
// appropriate. This class is applied to the overlay element because the overlay must expand to
// fill the width of the screen for full width snackbars.
this._breakpointObserver.observe(_angular_cdk_layout__WEBPACK_IMPORTED_MODULE_8__["Breakpoints"].Handset).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["takeUntil"])(overlayRef.detachments().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["take"])(1)))).subscribe(function (state$$1) {
if (state$$1.matches) {
overlayRef.overlayElement.classList.add('mat-snack-bar-handset');
}
else {
overlayRef.overlayElement.classList.remove('mat-snack-bar-handset');
}
});
this._animateSnackBar(snackBarRef, config);
this._openedSnackBarRef = snackBarRef;
return this._openedSnackBarRef;
};
/**
* Animates the old snack bar out and the new one in.
* @param {?} snackBarRef
* @param {?} config
* @return {?}
*/
MatSnackBar.prototype._animateSnackBar = /**
* Animates the old snack bar out and the new one in.
* @param {?} snackBarRef
* @param {?} config
* @return {?}
*/
function (snackBarRef, config) {
var _this = this;
// When the snackbar is dismissed, clear the reference to it.
snackBarRef.afterDismissed().subscribe(function () {
// Clear the snackbar ref if it hasn't already been replaced by a newer snackbar.
if (_this._openedSnackBarRef == snackBarRef) {
_this._openedSnackBarRef = null;
}
});
if (this._openedSnackBarRef) {
// If a snack bar is already in view, dismiss it and enter the
// new snack bar after exit animation is complete.
this._openedSnackBarRef.afterDismissed().subscribe(function () {
snackBarRef.containerInstance.enter();
});
this._openedSnackBarRef.dismiss();
}
else {
// If no snack bar is in view, enter the new snack bar.
snackBarRef.containerInstance.enter();
}
// If a dismiss timeout is provided, set up dismiss based on after the snackbar is opened.
if (config.duration && config.duration > 0) {
snackBarRef.afterOpened().subscribe(function () { return snackBarRef._dismissAfter(/** @type {?} */ ((config.duration))); });
}
if (config.announcementMessage) {
this._live.announce(config.announcementMessage, config.politeness);
}
};
/**
* Creates a new overlay and places it in the correct location.
* @param {?} config The user-specified snack bar config.
* @return {?}
*/
MatSnackBar.prototype._createOverlay = /**
* Creates a new overlay and places it in the correct location.
* @param {?} config The user-specified snack bar config.
* @return {?}
*/
function (config) {
var /** @type {?} */ overlayConfig = new _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_9__["OverlayConfig"]();
overlayConfig.direction = config.direction;
var /** @type {?} */ positionStrategy = this._overlay.position().global();
// Set horizontal position.
var /** @type {?} */ isRtl = config.direction === 'rtl';
var /** @type {?} */ isLeft = (config.horizontalPosition === 'left' ||
(config.horizontalPosition === 'start' && !isRtl) ||
(config.horizontalPosition === 'end' && isRtl));
var /** @type {?} */ isRight = !isLeft && config.horizontalPosition !== 'center';
if (isLeft) {
positionStrategy.left('0');
}
else if (isRight) {
positionStrategy.right('0');
}
else {
positionStrategy.centerHorizontally();
}
// Set horizontal position.
if (config.verticalPosition === 'top') {
positionStrategy.top('0');
}
else {
positionStrategy.bottom('0');
}
overlayConfig.positionStrategy = positionStrategy;
return this._overlay.create(overlayConfig);
};
/**
* Creates an injector to be used inside of a snack bar component.
* @template T
* @param {?} config Config that was used to create the snack bar.
* @param {?} snackBarRef Reference to the snack bar.
* @return {?}
*/
MatSnackBar.prototype._createInjector = /**
* Creates an injector to be used inside of a snack bar component.
* @template T
* @param {?} config Config that was used to create the snack bar.
* @param {?} snackBarRef Reference to the snack bar.
* @return {?}
*/
function (config, snackBarRef) {
var /** @type {?} */ userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
var /** @type {?} */ injectionTokens = new WeakMap();
injectionTokens.set(MatSnackBarRef, snackBarRef);
injectionTokens.set(MAT_SNACK_BAR_DATA, config.data);
return new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_5__["PortalInjector"](userInjector || this._injector, injectionTokens);
};
MatSnackBar.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] },
];
/** @nocollapse */
MatSnackBar.ctorParameters = function () { return [
{ type: _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_9__["Overlay"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_7__["LiveAnnouncer"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"], },
{ type: _angular_cdk_layout__WEBPACK_IMPORTED_MODULE_8__["BreakpointObserver"], },
{ type: MatSnackBar, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"] },] },
{ type: MatSnackBarConfig, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [MAT_SNACK_BAR_DEFAULT_OPTIONS,] },] },
]; };
return MatSnackBar;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatSnackBarModule = /** @class */ (function () {
function MatSnackBarModule() {
}
MatSnackBarModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [
_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_9__["OverlayModule"],
_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_5__["PortalModule"],
_angular_common__WEBPACK_IMPORTED_MODULE_10__["CommonModule"],
_angular_material_button__WEBPACK_IMPORTED_MODULE_11__["MatButtonModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["MatCommonModule"],
],
exports: [MatSnackBarContainer, _angular_material_core__WEBPACK_IMPORTED_MODULE_3__["MatCommonModule"]],
declarations: [MatSnackBarContainer, SimpleSnackBar],
entryComponents: [MatSnackBarContainer, SimpleSnackBar],
providers: [MatSnackBar]
},] },
];
return MatSnackBarModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=snack-bar.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/sort.es5.js":
/*!*********************************************************!*\
!*** ./node_modules/@angular/material/esm5/sort.es5.js ***!
\*********************************************************/
/*! exports provided: MatSortModule, MatSortHeaderBase, _MatSortHeaderMixinBase, MatSortHeader, MatSortHeaderIntl, MAT_SORT_HEADER_INTL_PROVIDER_FACTORY, MAT_SORT_HEADER_INTL_PROVIDER, MatSortBase, _MatSortMixinBase, MatSort, matSortAnimations */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSortModule", function() { return MatSortModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSortHeaderBase", function() { return MatSortHeaderBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatSortHeaderMixinBase", function() { return _MatSortHeaderMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSortHeader", function() { return MatSortHeader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSortHeaderIntl", function() { return MatSortHeaderIntl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SORT_HEADER_INTL_PROVIDER_FACTORY", function() { return MAT_SORT_HEADER_INTL_PROVIDER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SORT_HEADER_INTL_PROVIDER", function() { return MAT_SORT_HEADER_INTL_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSortBase", function() { return MatSortBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatSortMixinBase", function() { return _MatSortMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSort", function() { return MatSort; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matSortAnimations", function() { return matSortAnimations; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var _angular_cdk_table__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/table */ "./node_modules/@angular/cdk/esm5/table.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
* @param {?} id
* @return {?}
*/
function getSortDuplicateSortableIdError(id) {
return Error("Cannot have two MatSortables with the same id (" + id + ").");
}
/**
* \@docs-private
* @return {?}
*/
function getSortHeaderNotContainedWithinSortError() {
return Error("MatSortHeader must be placed within a parent element with the MatSort directive.");
}
/**
* \@docs-private
* @return {?}
*/
function getSortHeaderMissingIdError() {
return Error("MatSortHeader must be provided with a unique id.");
}
/**
* \@docs-private
* @param {?} direction
* @return {?}
*/
function getSortInvalidDirectionError(direction) {
return Error(direction + " is not a valid sort direction ('asc' or 'desc').");
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatSortBase = /** @class */ (function () {
function MatSortBase() {
}
return MatSortBase;
}());
var /** @type {?} */ _MatSortMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinInitialized"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisabled"])(MatSortBase));
/**
* Container for MatSortables to manage the sort state and provide default sort parameters.
*/
var MatSort = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatSort, _super);
function MatSort() {
var _this = _super !== null && _super.apply(this, arguments) || this;
/**
* Collection of all registered sortables that this directive manages.
*/
_this.sortables = new Map();
/**
* Used to notify any child components listening to state changes.
*/
_this._stateChanges = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
/**
* The direction to set when an MatSortable is initially sorted.
* May be overriden by the MatSortable's sort start.
*/
_this.start = 'asc';
_this._direction = '';
/**
* Event emitted when the user changes either the active sort or sort direction.
*/
_this.sortChange = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
return _this;
}
Object.defineProperty(MatSort.prototype, "direction", {
get: /**
* The sort direction of the currently active MatSortable.
* @return {?}
*/
function () { return this._direction; },
set: /**
* @param {?} direction
* @return {?}
*/
function (direction) {
if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["isDevMode"])() && direction && direction !== 'asc' && direction !== 'desc') {
throw getSortInvalidDirectionError(direction);
}
this._direction = direction;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatSort.prototype, "disableClear", {
get: /**
* Whether to disable the user from clearing the sort by finishing the sort direction cycle.
* May be overriden by the MatSortable's disable clear input.
* @return {?}
*/
function () { return this._disableClear; },
set: /**
* @param {?} v
* @return {?}
*/
function (v) { this._disableClear = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(v); },
enumerable: true,
configurable: true
});
/**
* Register function to be used by the contained MatSortables. Adds the MatSortable to the
* collection of MatSortables.
*/
/**
* Register function to be used by the contained MatSortables. Adds the MatSortable to the
* collection of MatSortables.
* @param {?} sortable
* @return {?}
*/
MatSort.prototype.register = /**
* Register function to be used by the contained MatSortables. Adds the MatSortable to the
* collection of MatSortables.
* @param {?} sortable
* @return {?}
*/
function (sortable) {
if (!sortable.id) {
throw getSortHeaderMissingIdError();
}
if (this.sortables.has(sortable.id)) {
throw getSortDuplicateSortableIdError(sortable.id);
}
this.sortables.set(sortable.id, sortable);
};
/**
* Unregister function to be used by the contained MatSortables. Removes the MatSortable from the
* collection of contained MatSortables.
*/
/**
* Unregister function to be used by the contained MatSortables. Removes the MatSortable from the
* collection of contained MatSortables.
* @param {?} sortable
* @return {?}
*/
MatSort.prototype.deregister = /**
* Unregister function to be used by the contained MatSortables. Removes the MatSortable from the
* collection of contained MatSortables.
* @param {?} sortable
* @return {?}
*/
function (sortable) {
this.sortables.delete(sortable.id);
};
/** Sets the active sort id and determines the new sort direction. */
/**
* Sets the active sort id and determines the new sort direction.
* @param {?} sortable
* @return {?}
*/
MatSort.prototype.sort = /**
* Sets the active sort id and determines the new sort direction.
* @param {?} sortable
* @return {?}
*/
function (sortable) {
if (this.active != sortable.id) {
this.active = sortable.id;
this.direction = sortable.start ? sortable.start : this.start;
}
else {
this.direction = this.getNextSortDirection(sortable);
}
this.sortChange.emit({ active: this.active, direction: this.direction });
};
/** Returns the next sort direction of the active sortable, checking for potential overrides. */
/**
* Returns the next sort direction of the active sortable, checking for potential overrides.
* @param {?} sortable
* @return {?}
*/
MatSort.prototype.getNextSortDirection = /**
* Returns the next sort direction of the active sortable, checking for potential overrides.
* @param {?} sortable
* @return {?}
*/
function (sortable) {
if (!sortable) {
return '';
}
// Get the sort direction cycle with the potential sortable overrides.
var /** @type {?} */ disableClear = sortable.disableClear != null ? sortable.disableClear : this.disableClear;
var /** @type {?} */ sortDirectionCycle = getSortDirectionCycle(sortable.start || this.start, disableClear);
// Get and return the next direction in the cycle
var /** @type {?} */ nextDirectionIndex = sortDirectionCycle.indexOf(this.direction) + 1;
if (nextDirectionIndex >= sortDirectionCycle.length) {
nextDirectionIndex = 0;
}
return sortDirectionCycle[nextDirectionIndex];
};
/**
* @return {?}
*/
MatSort.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._markInitialized();
};
/**
* @return {?}
*/
MatSort.prototype.ngOnChanges = /**
* @return {?}
*/
function () {
this._stateChanges.next();
};
/**
* @return {?}
*/
MatSort.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._stateChanges.complete();
};
MatSort.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[matSort]',
exportAs: 'matSort',
inputs: ['disabled: matSortDisabled']
},] },
];
/** @nocollapse */
MatSort.propDecorators = {
"active": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matSortActive',] },],
"start": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matSortStart',] },],
"direction": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matSortDirection',] },],
"disableClear": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matSortDisableClear',] },],
"sortChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"], args: ['matSortChange',] },],
};
return MatSort;
}(_MatSortMixinBase));
/**
* Returns the sort direction cycle to use given the provided parameters of order and clear.
* @param {?} start
* @param {?} disableClear
* @return {?}
*/
function getSortDirectionCycle(start, disableClear) {
var /** @type {?} */ sortOrder = ['asc', 'desc'];
if (start == 'desc') {
sortOrder.reverse();
}
if (!disableClear) {
sortOrder.push('');
}
return sortOrder;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ SORT_ANIMATION_TRANSITION = _angular_material_core__WEBPACK_IMPORTED_MODULE_3__["AnimationDurations"].ENTERING + ' ' +
_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["AnimationCurves"].STANDARD_CURVE;
/**
* Animations used by MatSort.
*/
var /** @type {?} */ matSortAnimations = {
/** Animation that moves the sort indicator. */
indicator: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["trigger"])('indicator', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('active-asc, asc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(0px)' })),
// 10px is the height of the sort indicator, minus the width of the pointers
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('active-desc, desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(10px)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('active-asc <=> active-desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])(SORT_ANIMATION_TRANSITION))
]),
/** Animation that rotates the left pointer of the indicator based on the sorting direction. */
leftPointer: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["trigger"])('leftPointer', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('active-asc, asc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'rotate(-45deg)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('active-desc, desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'rotate(45deg)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('active-asc <=> active-desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])(SORT_ANIMATION_TRANSITION))
]),
/** Animation that rotates the right pointer of the indicator based on the sorting direction. */
rightPointer: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["trigger"])('rightPointer', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('active-asc, asc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'rotate(45deg)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('active-desc, desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'rotate(-45deg)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('active-asc <=> active-desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])(SORT_ANIMATION_TRANSITION))
]),
/** Animation that controls the arrow opacity. */
arrowOpacity: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["trigger"])('arrowOpacity', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('desc-to-active, asc-to-active, active', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ opacity: 1 })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('desc-to-hint, asc-to-hint, hint', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ opacity: .54 })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('hint-to-desc, active-to-desc, desc, hint-to-asc, active-to-asc, asc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ opacity: 0 })),
// Transition between all states except for immediate transitions
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('* => asc, * => desc, * => active, * => hint', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])('0ms')),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('* <=> *', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])(SORT_ANIMATION_TRANSITION))
]),
/**
* Animation for the translation of the arrow as a whole. States are separated into two
* groups: ones with animations and others that are immediate. Immediate states are asc, desc,
* peek, and active. The other states define a specific animation (source-to-destination)
* and are determined as a function of their prev user-perceived state and what the next state
* should be.
*/
arrowPosition: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["trigger"])('arrowPosition', [
// Hidden Above => Hint Center
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('* => desc-to-hint, * => desc-to-active', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])(SORT_ANIMATION_TRANSITION, Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["keyframes"])([
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(-25%)' }),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(0)' })
]))),
// Hint Center => Hidden Below
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('* => hint-to-desc, * => active-to-desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])(SORT_ANIMATION_TRANSITION, Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["keyframes"])([
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(0)' }),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(25%)' })
]))),
// Hidden Below => Hint Center
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('* => asc-to-hint, * => asc-to-active', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])(SORT_ANIMATION_TRANSITION, Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["keyframes"])([
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(25%)' }),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(0)' })
]))),
// Hint Center => Hidden Above
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('* => hint-to-asc, * => active-to-asc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])(SORT_ANIMATION_TRANSITION, Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["keyframes"])([
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(0)' }),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(-25%)' })
]))),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('desc-to-hint, asc-to-hint, hint, desc-to-active, asc-to-active, active', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(0)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('hint-to-desc, active-to-desc, desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(-25%)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('hint-to-asc, active-to-asc, asc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translateY(25%)' })),
]),
/** Necessary trigger that calls animate on children animations. */
allowChildren: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["trigger"])('allowChildren', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('* <=> *', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["query"])('@*', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animateChild"])(), { optional: true })
])
]),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* To modify the labels and text displayed, create a new instance of MatSortHeaderIntl and
* include it in a custom provider.
*/
var MatSortHeaderIntl = /** @class */ (function () {
function MatSortHeaderIntl() {
/**
* Stream that emits whenever the labels here are changed. Use this to notify
* components if the labels have changed after initialization.
*/
this.changes = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
/**
* ARIA label for the sorting button.
*/
this.sortButtonLabel = function (id) {
return "Change sorting for " + id;
};
}
MatSortHeaderIntl.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */ MatSortHeaderIntl.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function MatSortHeaderIntl_Factory() { return new MatSortHeaderIntl(); }, token: MatSortHeaderIntl, providedIn: "root" });
return MatSortHeaderIntl;
}());
/**
* \@docs-private
* @param {?} parentIntl
* @return {?}
*/
function MAT_SORT_HEADER_INTL_PROVIDER_FACTORY(parentIntl) {
return parentIntl || new MatSortHeaderIntl();
}
/**
* \@docs-private
*/
var /** @type {?} */ MAT_SORT_HEADER_INTL_PROVIDER = {
// If there is already an MatSortHeaderIntl available, use that. Otherwise, provide a new one.
provide: MatSortHeaderIntl,
deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"](), MatSortHeaderIntl]],
useFactory: MAT_SORT_HEADER_INTL_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatSortHeaderBase = /** @class */ (function () {
function MatSortHeaderBase() {
}
return MatSortHeaderBase;
}());
var /** @type {?} */ _MatSortHeaderMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisabled"])(MatSortHeaderBase);
/**
* Applies sorting behavior (click to change sort) and styles to an element, including an
* arrow to display the current sort direction.
*
* Must be provided with an id and contained within a parent MatSort directive.
*
* If used on header cells in a CdkTable, it will automatically default its id from its containing
* column definition.
*/
var MatSortHeader = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatSortHeader, _super);
function MatSortHeader(_intl, changeDetectorRef, _sort, _cdkColumnDef) {
var _this = _super.call(this) || this;
_this._intl = _intl;
_this._sort = _sort;
_this._cdkColumnDef = _cdkColumnDef;
/**
* Flag set to true when the indicator should be displayed while the sort is not active. Used to
* provide an affordance that the header is sortable by showing on focus and hover.
*/
_this._showIndicatorHint = false;
/**
* The direction the arrow should be facing according to the current state.
*/
_this._arrowDirection = '';
/**
* Whether the view state animation should show the transition between the `from` and `to` states.
*/
_this._disableViewStateAnimation = false;
/**
* Sets the position of the arrow that displays when sorted.
*/
_this.arrowPosition = 'after';
if (!_sort) {
throw getSortHeaderNotContainedWithinSortError();
}
_this._rerenderSubscription = Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["merge"])(_sort.sortChange, _sort._stateChanges, _intl.changes)
.subscribe(function () {
if (_this._isSorted()) {
_this._updateArrowDirection();
}
// If this header was recently active and now no longer sorted, animate away the arrow.
if (!_this._isSorted() && _this._viewState && _this._viewState.toState === 'active') {
_this._disableViewStateAnimation = false;
_this._setAnimationTransitionState({ fromState: 'active', toState: _this._arrowDirection });
}
changeDetectorRef.markForCheck();
});
return _this;
}
Object.defineProperty(MatSortHeader.prototype, "disableClear", {
get: /**
* Overrides the disable clear value of the containing MatSort for this MatSortable.
* @return {?}
*/
function () { return this._disableClear; },
set: /**
* @param {?} v
* @return {?}
*/
function (v) { this._disableClear = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(v); },
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatSortHeader.prototype.ngOnInit = /**
* @return {?}
*/
function () {
if (!this.id && this._cdkColumnDef) {
this.id = this._cdkColumnDef.name;
}
// Initialize the direction of the arrow and set the view state to be immediately that state.
this._updateArrowDirection();
this._setAnimationTransitionState({ toState: this._isSorted() ? 'active' : this._arrowDirection });
this._sort.register(this);
};
/**
* @return {?}
*/
MatSortHeader.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._sort.deregister(this);
this._rerenderSubscription.unsubscribe();
};
/**
* Sets the "hint" state such that the arrow will be semi-transparently displayed as a hint to the
* user showing what the active sort will become. If set to false, the arrow will fade away.
*/
/**
* Sets the "hint" state such that the arrow will be semi-transparently displayed as a hint to the
* user showing what the active sort will become. If set to false, the arrow will fade away.
* @param {?} visible
* @return {?}
*/
MatSortHeader.prototype._setIndicatorHintVisible = /**
* Sets the "hint" state such that the arrow will be semi-transparently displayed as a hint to the
* user showing what the active sort will become. If set to false, the arrow will fade away.
* @param {?} visible
* @return {?}
*/
function (visible) {
// No-op if the sort header is disabled - should not make the hint visible.
if (this._isDisabled() && visible) {
return;
}
this._showIndicatorHint = visible;
if (!this._isSorted()) {
this._updateArrowDirection();
if (this._showIndicatorHint) {
this._setAnimationTransitionState({ fromState: this._arrowDirection, toState: 'hint' });
}
else {
this._setAnimationTransitionState({ fromState: 'hint', toState: this._arrowDirection });
}
}
};
/**
* Sets the animation transition view state for the arrow's position and opacity. If the
* `disableViewStateAnimation` flag is set to true, the `fromState` will be ignored so that
* no animation appears.
*/
/**
* Sets the animation transition view state for the arrow's position and opacity. If the
* `disableViewStateAnimation` flag is set to true, the `fromState` will be ignored so that
* no animation appears.
* @param {?} viewState
* @return {?}
*/
MatSortHeader.prototype._setAnimationTransitionState = /**
* Sets the animation transition view state for the arrow's position and opacity. If the
* `disableViewStateAnimation` flag is set to true, the `fromState` will be ignored so that
* no animation appears.
* @param {?} viewState
* @return {?}
*/
function (viewState) {
this._viewState = viewState;
// If the animation for arrow position state (opacity/translation) should be disabled,
// remove the fromState so that it jumps right to the toState.
if (this._disableViewStateAnimation) {
this._viewState = { toState: viewState.toState };
}
};
/** Triggers the sort on this sort header and removes the indicator hint. */
/**
* Triggers the sort on this sort header and removes the indicator hint.
* @return {?}
*/
MatSortHeader.prototype._handleClick = /**
* Triggers the sort on this sort header and removes the indicator hint.
* @return {?}
*/
function () {
if (this._isDisabled()) {
return;
}
this._sort.sort(this);
// Do not show the animation if the header was already shown in the right position.
if (this._viewState.toState === 'hint' || this._viewState.toState === 'active') {
this._disableViewStateAnimation = true;
}
// If the arrow is now sorted, animate the arrow into place. Otherwise, animate it away into
// the direction it is facing.
var /** @type {?} */ viewState = this._isSorted() ?
{ fromState: this._arrowDirection, toState: 'active' } :
{ fromState: 'active', toState: this._arrowDirection };
this._setAnimationTransitionState(viewState);
this._showIndicatorHint = false;
};
/** Whether this MatSortHeader is currently sorted in either ascending or descending order. */
/**
* Whether this MatSortHeader is currently sorted in either ascending or descending order.
* @return {?}
*/
MatSortHeader.prototype._isSorted = /**
* Whether this MatSortHeader is currently sorted in either ascending or descending order.
* @return {?}
*/
function () {
return this._sort.active == this.id &&
(this._sort.direction === 'asc' || this._sort.direction === 'desc');
};
/** Returns the animation state for the arrow direction (indicator and pointers). */
/**
* Returns the animation state for the arrow direction (indicator and pointers).
* @return {?}
*/
MatSortHeader.prototype._getArrowDirectionState = /**
* Returns the animation state for the arrow direction (indicator and pointers).
* @return {?}
*/
function () {
return "" + (this._isSorted() ? 'active-' : '') + this._arrowDirection;
};
/** Returns the arrow position state (opacity, translation). */
/**
* Returns the arrow position state (opacity, translation).
* @return {?}
*/
MatSortHeader.prototype._getArrowViewState = /**
* Returns the arrow position state (opacity, translation).
* @return {?}
*/
function () {
var /** @type {?} */ fromState = this._viewState.fromState;
return (fromState ? fromState + "-to-" : '') + this._viewState.toState;
};
/**
* Updates the direction the arrow should be pointing. If it is not sorted, the arrow should be
* facing the start direction. Otherwise if it is sorted, the arrow should point in the currently
* active sorted direction. The reason this is updated through a function is because the direction
* should only be changed at specific times - when deactivated but the hint is displayed and when
* the sort is active and the direction changes. Otherwise the arrow's direction should linger
* in cases such as the sort becoming deactivated but we want to animate the arrow away while
* preserving its direction, even though the next sort direction is actually different and should
* only be changed once the arrow displays again (hint or activation).
*/
/**
* Updates the direction the arrow should be pointing. If it is not sorted, the arrow should be
* facing the start direction. Otherwise if it is sorted, the arrow should point in the currently
* active sorted direction. The reason this is updated through a function is because the direction
* should only be changed at specific times - when deactivated but the hint is displayed and when
* the sort is active and the direction changes. Otherwise the arrow's direction should linger
* in cases such as the sort becoming deactivated but we want to animate the arrow away while
* preserving its direction, even though the next sort direction is actually different and should
* only be changed once the arrow displays again (hint or activation).
* @return {?}
*/
MatSortHeader.prototype._updateArrowDirection = /**
* Updates the direction the arrow should be pointing. If it is not sorted, the arrow should be
* facing the start direction. Otherwise if it is sorted, the arrow should point in the currently
* active sorted direction. The reason this is updated through a function is because the direction
* should only be changed at specific times - when deactivated but the hint is displayed and when
* the sort is active and the direction changes. Otherwise the arrow's direction should linger
* in cases such as the sort becoming deactivated but we want to animate the arrow away while
* preserving its direction, even though the next sort direction is actually different and should
* only be changed once the arrow displays again (hint or activation).
* @return {?}
*/
function () {
this._arrowDirection = this._isSorted() ?
this._sort.direction :
(this.start || this._sort.start);
};
/**
* @return {?}
*/
MatSortHeader.prototype._isDisabled = /**
* @return {?}
*/
function () {
return this._sort.disabled || this.disabled;
};
/**
* Gets the aria-sort attribute that should be applied to this sort header. If this header
* is not sorted, returns null so that the attribute is removed from the host element. Aria spec
* says that the aria-sort property should only be present on one header at a time, so removing
* ensures this is true.
*/
/**
* Gets the aria-sort attribute that should be applied to this sort header. If this header
* is not sorted, returns null so that the attribute is removed from the host element. Aria spec
* says that the aria-sort property should only be present on one header at a time, so removing
* ensures this is true.
* @return {?}
*/
MatSortHeader.prototype._getAriaSortAttribute = /**
* Gets the aria-sort attribute that should be applied to this sort header. If this header
* is not sorted, returns null so that the attribute is removed from the host element. Aria spec
* says that the aria-sort property should only be present on one header at a time, so removing
* ensures this is true.
* @return {?}
*/
function () {
if (!this._isSorted()) {
return null;
}
return this._sort.direction == 'asc' ? 'ascending' : 'descending';
};
MatSortHeader.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: '[mat-sort-header]',
exportAs: 'matSortHeader',
template: "<div class=\"mat-sort-header-container\" [class.mat-sort-header-sorted]=\"_isSorted()\" [class.mat-sort-header-position-before]=\"arrowPosition == 'before'\"><button class=\"mat-sort-header-button\" type=\"button\" [attr.disabled]=\"_isDisabled() || null\" [attr.aria-label]=\"_intl.sortButtonLabel(id)\" (focus)=\"_setIndicatorHintVisible(true)\" (blur)=\"_setIndicatorHintVisible(false)\"><ng-content></ng-content></button><div class=\"mat-sort-header-arrow\" [@arrowOpacity]=\"_getArrowViewState()\" [@arrowPosition]=\"_getArrowViewState()\" [@allowChildren]=\"_getArrowDirectionState()\" (@arrowPosition.start)=\"_disableViewStateAnimation = true\" (@arrowPosition.done)=\"_disableViewStateAnimation = false\"><div class=\"mat-sort-header-stem\"></div><div class=\"mat-sort-header-indicator\" [@indicator]=\"_getArrowDirectionState()\"><div class=\"mat-sort-header-pointer-left\" [@leftPointer]=\"_getArrowDirectionState()\"></div><div class=\"mat-sort-header-pointer-right\" [@rightPointer]=\"_getArrowDirectionState()\"></div><div class=\"mat-sort-header-pointer-middle\"></div></div></div></div>",
styles: [".mat-sort-header-container{display:flex;cursor:pointer;align-items:center}.mat-sort-header-disabled .mat-sort-header-container{cursor:default}.mat-sort-header-position-before{flex-direction:row-reverse}.mat-sort-header-button{border:none;background:0 0;display:flex;align-items:center;padding:0;cursor:inherit;outline:0;font:inherit;color:currentColor}.mat-sort-header-arrow{height:12px;width:12px;min-width:12px;position:relative;display:flex}.mat-sort-header-arrow,[dir=rtl] .mat-sort-header-position-before .mat-sort-header-arrow{margin:0 0 0 6px}.mat-sort-header-position-before .mat-sort-header-arrow,[dir=rtl] .mat-sort-header-arrow{margin:0 6px 0 0}.mat-sort-header-stem{background:currentColor;height:10px;width:2px;margin:auto;display:flex;align-items:center}.mat-sort-header-indicator{width:100%;height:2px;display:flex;align-items:center;position:absolute;top:0;left:0}.mat-sort-header-pointer-middle{margin:auto;height:2px;width:2px;background:currentColor;transform:rotate(45deg)}.mat-sort-header-pointer-left,.mat-sort-header-pointer-right{background:currentColor;width:6px;height:2px;position:absolute;top:0}.mat-sort-header-pointer-left{transform-origin:right;left:0}.mat-sort-header-pointer-right{transform-origin:left;right:0}"],
host: {
'(click)': '_handleClick()',
'(mouseenter)': '_setIndicatorHintVisible(true)',
'(longpress)': '_setIndicatorHintVisible(true)',
'(mouseleave)': '_setIndicatorHintVisible(false)',
'[attr.aria-sort]': '_getAriaSortAttribute()',
'[class.mat-sort-header-disabled]': '_isDisabled()',
},
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
inputs: ['disabled'],
animations: [
matSortAnimations.indicator,
matSortAnimations.leftPointer,
matSortAnimations.rightPointer,
matSortAnimations.arrowOpacity,
matSortAnimations.arrowPosition,
matSortAnimations.allowChildren,
]
},] },
];
/** @nocollapse */
MatSortHeader.ctorParameters = function () { return [
{ type: MatSortHeaderIntl, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"], },
{ type: MatSort, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] },] },
{ type: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_6__["CdkColumnDef"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] },] },
]; };
MatSortHeader.propDecorators = {
"id": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['mat-sort-header',] },],
"arrowPosition": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"start": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"disableClear": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
};
return MatSortHeader;
}(_MatSortHeaderMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatSortModule = /** @class */ (function () {
function MatSortModule() {
}
MatSortModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_7__["CommonModule"]],
exports: [MatSort, MatSortHeader],
declarations: [MatSort, MatSortHeader],
providers: [MAT_SORT_HEADER_INTL_PROVIDER]
},] },
];
return MatSortModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=sort.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/stepper.es5.js":
/*!************************************************************!*\
!*** ./node_modules/@angular/material/esm5/stepper.es5.js ***!
\************************************************************/
/*! exports provided: MatStepperModule, MatStepLabel, MatStep, MatStepper, MatHorizontalStepper, MatVerticalStepper, MatStepperNext, MatStepperPrevious, MatStepHeader, MatStepperIntl, matStepperAnimations, MatStepperIcon */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatStepperModule", function() { return MatStepperModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatStepLabel", function() { return MatStepLabel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatStep", function() { return MatStep; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatStepper", function() { return MatStepper; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatHorizontalStepper", function() { return MatHorizontalStepper; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatVerticalStepper", function() { return MatVerticalStepper; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatStepperNext", function() { return MatStepperNext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatStepperPrevious", function() { return MatStepperPrevious; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatStepHeader", function() { return MatStepHeader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatStepperIntl", function() { return MatStepperIntl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matStepperAnimations", function() { return matStepperAnimations; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatStepperIcon", function() { return MatStepperIcon; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_stepper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/stepper */ "./node_modules/@angular/cdk/esm5/stepper.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/cdk/portal */ "./node_modules/@angular/cdk/esm5/portal.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/material/button */ "./node_modules/@angular/material/esm5/button.es5.js");
/* harmony import */ var _angular_material_icon__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/material/icon */ "./node_modules/@angular/material/esm5/icon.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatStepLabel = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatStepLabel, _super);
function MatStepLabel(template) {
return _super.call(this, template) || this;
}
MatStepLabel.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[matStepLabel]',
},] },
];
/** @nocollapse */
MatStepLabel.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
]; };
return MatStepLabel;
}(_angular_cdk_stepper__WEBPACK_IMPORTED_MODULE_2__["CdkStepLabel"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Stepper data that is required for internationalization.
*/
var MatStepperIntl = /** @class */ (function () {
function MatStepperIntl() {
/**
* Stream that emits whenever the labels here are changed. Use this to notify
* components if the labels have changed after initialization.
*/
this.changes = new rxjs__WEBPACK_IMPORTED_MODULE_3__["Subject"]();
/**
* Label that is rendered below optional steps.
*/
this.optionalLabel = 'Optional';
}
MatStepperIntl.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] },
];
/** @nocollapse */ MatStepperIntl.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["defineInjectable"])({ factory: function MatStepperIntl_Factory() { return new MatStepperIntl(); }, token: MatStepperIntl, providedIn: "root" });
return MatStepperIntl;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatStepHeader = /** @class */ (function () {
function MatStepHeader(_intl, _focusMonitor, _element, changeDetectorRef) {
this._intl = _intl;
this._focusMonitor = _focusMonitor;
this._element = _element;
_focusMonitor.monitor(_element.nativeElement, true);
this._intlSubscription = _intl.changes.subscribe(function () { return changeDetectorRef.markForCheck(); });
}
/**
* @return {?}
*/
MatStepHeader.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._intlSubscription.unsubscribe();
this._focusMonitor.stopMonitoring(this._element.nativeElement);
};
/** Returns string label of given step if it is a text label. */
/**
* Returns string label of given step if it is a text label.
* @return {?}
*/
MatStepHeader.prototype._stringLabel = /**
* Returns string label of given step if it is a text label.
* @return {?}
*/
function () {
return this.label instanceof MatStepLabel ? null : this.label;
};
/** Returns MatStepLabel if the label of given step is a template label. */
/**
* Returns MatStepLabel if the label of given step is a template label.
* @return {?}
*/
MatStepHeader.prototype._templateLabel = /**
* Returns MatStepLabel if the label of given step is a template label.
* @return {?}
*/
function () {
return this.label instanceof MatStepLabel ? this.label : null;
};
/** Returns the host HTML element. */
/**
* Returns the host HTML element.
* @return {?}
*/
MatStepHeader.prototype._getHostElement = /**
* Returns the host HTML element.
* @return {?}
*/
function () {
return this._element.nativeElement;
};
/** Template context variables that are exposed to the `matStepperIcon` instances. */
/**
* Template context variables that are exposed to the `matStepperIcon` instances.
* @return {?}
*/
MatStepHeader.prototype._getIconContext = /**
* Template context variables that are exposed to the `matStepperIcon` instances.
* @return {?}
*/
function () {
return {
index: this.index,
active: this.active,
optional: this.optional
};
};
/**
* @return {?}
*/
MatStepHeader.prototype.focus = /**
* @return {?}
*/
function () {
this._getHostElement().focus();
};
MatStepHeader.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-step-header',
template: "<div class=\"mat-step-header-ripple\" mat-ripple [matRippleTrigger]=\"_getHostElement()\"></div><div [class.mat-step-icon]=\"state !== 'number' || selected\" [class.mat-step-icon-not-touched]=\"state == 'number' && !selected\" [ngSwitch]=\"state\"><ng-container *ngSwitchCase=\"'number'\" [ngSwitch]=\"!!(iconOverrides && iconOverrides.number)\"><ng-container *ngSwitchCase=\"true\" [ngTemplateOutlet]=\"iconOverrides.number\" [ngTemplateOutletContext]=\"_getIconContext()\"></ng-container><span *ngSwitchDefault>{{index + 1}}</span></ng-container><ng-container *ngSwitchCase=\"'edit'\" [ngSwitch]=\"!!(iconOverrides && iconOverrides.edit)\"><ng-container *ngSwitchCase=\"true\" [ngTemplateOutlet]=\"iconOverrides.edit\" [ngTemplateOutletContext]=\"_getIconContext()\"></ng-container><mat-icon *ngSwitchDefault>create</mat-icon></ng-container><ng-container *ngSwitchCase=\"'done'\" [ngSwitch]=\"!!(iconOverrides && iconOverrides.done)\"><ng-container *ngSwitchCase=\"true\" [ngTemplateOutlet]=\"iconOverrides.done\" [ngTemplateOutletContext]=\"_getIconContext()\"></ng-container><mat-icon *ngSwitchDefault>done</mat-icon></ng-container></div><div class=\"mat-step-label\" [class.mat-step-label-active]=\"active\" [class.mat-step-label-selected]=\"selected\"><ng-container *ngIf=\"_templateLabel()\" [ngTemplateOutlet]=\"_templateLabel()!.template\"></ng-container><div class=\"mat-step-text-label\" *ngIf=\"_stringLabel()\">{{label}}</div><div class=\"mat-step-optional\" *ngIf=\"optional\">{{_intl.optionalLabel}}</div></div>",
styles: [".mat-step-header{overflow:hidden;outline:0;cursor:pointer;position:relative;box-sizing:content-box}.mat-step-optional{font-size:12px}.mat-step-icon,.mat-step-icon-not-touched{border-radius:50%;height:24px;width:24px;align-items:center;justify-content:center;display:flex;flex-shrink:0}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}"],
host: {
'class': 'mat-step-header',
'role': 'tab',
},
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatStepHeader.ctorParameters = function () { return [
{ type: MatStepperIntl, },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_4__["FocusMonitor"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"], },
]; };
MatStepHeader.propDecorators = {
"state": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"label": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"iconOverrides": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"index": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"selected": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"active": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
"optional": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] },],
};
return MatStepHeader;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Animations used by the Material steppers.
*/
var /** @type {?} */ matStepperAnimations = {
/** Animation that transitions the step along the X axis in a horizontal stepper. */
horizontalStepTransition: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["trigger"])('stepTransition', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('previous', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translate3d(-100%, 0, 0)', visibility: 'hidden' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('current', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'none', visibility: 'visible' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('next', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translate3d(100%, 0, 0)', visibility: 'hidden' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('* => *', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])('500ms cubic-bezier(0.35, 0, 0.25, 1)'))
]),
/** Animation that transitions the step along the Y axis in a vertical stepper. */
verticalStepTransition: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["trigger"])('stepTransition', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('previous', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ height: '0px', visibility: 'hidden' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('next', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ height: '0px', visibility: 'hidden' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('current', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ height: '*', visibility: 'visible' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('* <=> current', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))
])
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Template to be used to override the icons inside the step header.
*/
var MatStepperIcon = /** @class */ (function () {
function MatStepperIcon(templateRef) {
this.templateRef = templateRef;
}
MatStepperIcon.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'ng-template[matStepperIcon]',
},] },
];
/** @nocollapse */
MatStepperIcon.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
]; };
MatStepperIcon.propDecorators = {
"name": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matStepperIcon',] },],
};
return MatStepperIcon;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatStep = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatStep, _super);
function MatStep(stepper, _errorStateMatcher) {
var _this = _super.call(this, stepper) || this;
_this._errorStateMatcher = _errorStateMatcher;
return _this;
}
/** Custom error state matcher that additionally checks for validity of interacted form. */
/**
* Custom error state matcher that additionally checks for validity of interacted form.
* @param {?} control
* @param {?} form
* @return {?}
*/
MatStep.prototype.isErrorState = /**
* Custom error state matcher that additionally checks for validity of interacted form.
* @param {?} control
* @param {?} form
* @return {?}
*/
function (control, form) {
var /** @type {?} */ originalErrorState = this._errorStateMatcher.isErrorState(control, form);
// Custom error state checks for the validity of form that is not submitted or touched
// since user can trigger a form change by calling for another step without directly
// interacting with the current form.
var /** @type {?} */ customErrorState = !!(control && control.invalid && this.interacted);
return originalErrorState || customErrorState;
};
MatStep.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-step',
template: "<ng-template><ng-content></ng-content></ng-template>",
providers: [{ provide: _angular_material_core__WEBPACK_IMPORTED_MODULE_7__["ErrorStateMatcher"], useExisting: MatStep }],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
exportAs: 'matStep',
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatStep.ctorParameters = function () { return [
{ type: MatStepper, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(function () { return MatStepper; }),] },] },
{ type: _angular_material_core__WEBPACK_IMPORTED_MODULE_7__["ErrorStateMatcher"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"] },] },
]; };
MatStep.propDecorators = {
"stepLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChild"], args: [MatStepLabel,] },],
};
return MatStep;
}(_angular_cdk_stepper__WEBPACK_IMPORTED_MODULE_2__["CdkStep"]));
var MatStepper = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatStepper, _super);
function MatStepper() {
var _this = _super !== null && _super.apply(this, arguments) || this;
/**
* Event emitted when the current step is done transitioning in.
*/
_this.animationDone = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
/**
* Consumer-specified template-refs to be used to override the header icons.
*/
_this._iconOverrides = {};
return _this;
}
/**
* @return {?}
*/
MatStepper.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ icons = this._icons.toArray();
['edit', 'done', 'number'].forEach(function (name) {
var /** @type {?} */ override = icons.find(function (icon) { return icon.name === name; });
if (override) {
_this._iconOverrides[name] = override.templateRef;
}
});
// Mark the component for change detection whenever the content children query changes
this._steps.changes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["takeUntil"])(this._destroyed)).subscribe(function () { return _this._stateChanged(); });
};
/**
* @param {?} event
* @return {?}
*/
MatStepper.prototype._animationDone = /**
* @param {?} event
* @return {?}
*/
function (event) {
if ((/** @type {?} */ (event.toState)) === 'current') {
this.animationDone.emit();
}
};
MatStepper.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[matStepper]'
},] },
];
/** @nocollapse */
MatStepper.propDecorators = {
"_stepHeader": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChildren"], args: [MatStepHeader,] },],
"_steps": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [MatStep,] },],
"_icons": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [MatStepperIcon,] },],
"animationDone": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] },],
};
return MatStepper;
}(_angular_cdk_stepper__WEBPACK_IMPORTED_MODULE_2__["CdkStepper"]));
var MatHorizontalStepper = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatHorizontalStepper, _super);
function MatHorizontalStepper() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatHorizontalStepper.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-horizontal-stepper',
exportAs: 'matHorizontalStepper',
template: "<div class=\"mat-horizontal-stepper-header-container\"><ng-container *ngFor=\"let step of _steps; let i = index; let isLast = last\"><mat-step-header class=\"mat-horizontal-stepper-header\" (click)=\"step.select()\" (keydown)=\"_onKeydown($event)\" [tabIndex]=\"_getFocusIndex() === i ? 0 : -1\" [id]=\"_getStepLabelId(i)\" [attr.aria-controls]=\"_getStepContentId(i)\" [attr.aria-selected]=\"selectedIndex == i\" [index]=\"i\" [state]=\"_getIndicatorType(i)\" [label]=\"step.stepLabel || step.label\" [selected]=\"selectedIndex === i\" [active]=\"step.completed || selectedIndex === i || !linear\" [optional]=\"step.optional\" [iconOverrides]=\"_iconOverrides\"></mat-step-header><div *ngIf=\"!isLast\" class=\"mat-stepper-horizontal-line\"></div></ng-container></div><div class=\"mat-horizontal-content-container\"><div *ngFor=\"let step of _steps; let i = index\" class=\"mat-horizontal-stepper-content\" role=\"tabpanel\" [@stepTransition]=\"_getAnimationDirection(i)\" (@stepTransition.done)=\"_animationDone($event)\" [id]=\"_getStepContentId(i)\" [attr.aria-labelledby]=\"_getStepLabelId(i)\" [attr.aria-expanded]=\"selectedIndex === i\"><ng-container [ngTemplateOutlet]=\"step.content\"></ng-container></div></div>",
styles: [".mat-stepper-horizontal,.mat-stepper-vertical{display:block}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px}.mat-horizontal-stepper-header{display:flex;height:72px;overflow:hidden;align-items:center;padding:0 24px}.mat-horizontal-stepper-header .mat-step-icon,.mat-horizontal-stepper-header .mat-step-icon-not-touched{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon,[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon-not-touched{margin-right:0;margin-left:8px}.mat-vertical-stepper-header{display:flex;align-items:center;padding:24px;max-height:24px}.mat-vertical-stepper-header .mat-step-icon,.mat-vertical-stepper-header .mat-step-icon-not-touched{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon,[dir=rtl] .mat-vertical-stepper-header .mat-step-icon-not-touched{margin-right:0;margin-left:12px}.mat-horizontal-stepper-content[aria-expanded=false]{height:0;overflow:hidden}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:'';position:absolute;top:-16px;bottom:-16px;left:0;border-left-width:1px;border-left-style:solid}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden}.mat-vertical-content{padding:0 24px 24px 24px}.mat-step:last-child .mat-vertical-content-container{border:none}"],
inputs: ['selectedIndex'],
host: {
'class': 'mat-stepper-horizontal',
'aria-orientation': 'horizontal',
'role': 'tablist',
},
animations: [matStepperAnimations.horizontalStepTransition],
providers: [{ provide: MatStepper, useExisting: MatHorizontalStepper }],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
},] },
];
return MatHorizontalStepper;
}(MatStepper));
var MatVerticalStepper = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatVerticalStepper, _super);
function MatVerticalStepper(dir, changeDetectorRef) {
var _this = _super.call(this, dir, changeDetectorRef) || this;
_this._orientation = 'vertical';
return _this;
}
MatVerticalStepper.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-vertical-stepper',
exportAs: 'matVerticalStepper',
template: "<div class=\"mat-step\" *ngFor=\"let step of _steps; let i = index; let isLast = last\"><mat-step-header class=\"mat-vertical-stepper-header\" (click)=\"step.select()\" (keydown)=\"_onKeydown($event)\" [tabIndex]=\"_getFocusIndex() == i ? 0 : -1\" [id]=\"_getStepLabelId(i)\" [attr.aria-controls]=\"_getStepContentId(i)\" [attr.aria-selected]=\"selectedIndex === i\" [index]=\"i\" [state]=\"_getIndicatorType(i)\" [label]=\"step.stepLabel || step.label\" [selected]=\"selectedIndex === i\" [active]=\"step.completed || selectedIndex === i || !linear\" [optional]=\"step.optional\" [iconOverrides]=\"_iconOverrides\"></mat-step-header><div class=\"mat-vertical-content-container\" [class.mat-stepper-vertical-line]=\"!isLast\"><div class=\"mat-vertical-stepper-content\" role=\"tabpanel\" [@stepTransition]=\"_getAnimationDirection(i)\" (@stepTransition.done)=\"_animationDone($event)\" [id]=\"_getStepContentId(i)\" [attr.aria-labelledby]=\"_getStepLabelId(i)\" [attr.aria-expanded]=\"selectedIndex === i\"><div class=\"mat-vertical-content\"><ng-container [ngTemplateOutlet]=\"step.content\"></ng-container></div></div></div></div>",
styles: [".mat-stepper-horizontal,.mat-stepper-vertical{display:block}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px}.mat-horizontal-stepper-header{display:flex;height:72px;overflow:hidden;align-items:center;padding:0 24px}.mat-horizontal-stepper-header .mat-step-icon,.mat-horizontal-stepper-header .mat-step-icon-not-touched{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon,[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon-not-touched{margin-right:0;margin-left:8px}.mat-vertical-stepper-header{display:flex;align-items:center;padding:24px;max-height:24px}.mat-vertical-stepper-header .mat-step-icon,.mat-vertical-stepper-header .mat-step-icon-not-touched{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon,[dir=rtl] .mat-vertical-stepper-header .mat-step-icon-not-touched{margin-right:0;margin-left:12px}.mat-horizontal-stepper-content[aria-expanded=false]{height:0;overflow:hidden}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:'';position:absolute;top:-16px;bottom:-16px;left:0;border-left-width:1px;border-left-style:solid}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden}.mat-vertical-content{padding:0 24px 24px 24px}.mat-step:last-child .mat-vertical-content-container{border:none}"],
inputs: ['selectedIndex'],
host: {
'class': 'mat-stepper-vertical',
'aria-orientation': 'vertical',
'role': 'tablist',
},
animations: [matStepperAnimations.verticalStepTransition],
providers: [{ provide: MatStepper, useExisting: MatVerticalStepper }],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatVerticalStepper.ctorParameters = function () { return [
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_6__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"], },
]; };
return MatVerticalStepper;
}(MatStepper));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Button that moves to the next step in a stepper workflow.
*/
var MatStepperNext = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatStepperNext, _super);
function MatStepperNext() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatStepperNext.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'button[matStepperNext]',
host: {
'(click)': '_stepper.next()',
'[type]': 'type',
},
inputs: ['type'],
providers: [{ provide: _angular_cdk_stepper__WEBPACK_IMPORTED_MODULE_2__["CdkStepper"], useExisting: MatStepper }]
},] },
];
return MatStepperNext;
}(_angular_cdk_stepper__WEBPACK_IMPORTED_MODULE_2__["CdkStepperNext"]));
/**
* Button that moves to the previous step in a stepper workflow.
*/
var MatStepperPrevious = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatStepperPrevious, _super);
function MatStepperPrevious() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatStepperPrevious.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'button[matStepperPrevious]',
host: {
'(click)': '_stepper.previous()',
'[type]': 'type',
},
inputs: ['type'],
providers: [{ provide: _angular_cdk_stepper__WEBPACK_IMPORTED_MODULE_2__["CdkStepper"], useExisting: MatStepper }]
},] },
];
return MatStepperPrevious;
}(_angular_cdk_stepper__WEBPACK_IMPORTED_MODULE_2__["CdkStepperPrevious"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatStepperModule = /** @class */ (function () {
function MatStepperModule() {
}
MatStepperModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [
_angular_material_core__WEBPACK_IMPORTED_MODULE_7__["MatCommonModule"],
_angular_common__WEBPACK_IMPORTED_MODULE_10__["CommonModule"],
_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_9__["PortalModule"],
_angular_material_button__WEBPACK_IMPORTED_MODULE_11__["MatButtonModule"],
_angular_cdk_stepper__WEBPACK_IMPORTED_MODULE_2__["CdkStepperModule"],
_angular_material_icon__WEBPACK_IMPORTED_MODULE_12__["MatIconModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_7__["MatRippleModule"],
],
exports: [
_angular_material_core__WEBPACK_IMPORTED_MODULE_7__["MatCommonModule"],
MatHorizontalStepper,
MatVerticalStepper,
MatStep,
MatStepLabel,
MatStepper,
MatStepperNext,
MatStepperPrevious,
MatStepHeader,
MatStepperIcon,
],
declarations: [
MatHorizontalStepper,
MatVerticalStepper,
MatStep,
MatStepLabel,
MatStepper,
MatStepperNext,
MatStepperPrevious,
MatStepHeader,
MatStepperIcon,
],
providers: [MatStepperIntl, _angular_material_core__WEBPACK_IMPORTED_MODULE_7__["ErrorStateMatcher"]],
},] },
];
return MatStepperModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=stepper.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/table.es5.js":
/*!**********************************************************!*\
!*** ./node_modules/@angular/material/esm5/table.es5.js ***!
\**********************************************************/
/*! exports provided: MatTableModule, MatCellDef, MatHeaderCellDef, MatFooterCellDef, MatColumnDef, MatHeaderCell, MatFooterCell, MatCell, MatTable, MatHeaderRowDef, MatFooterRowDef, MatRowDef, MatHeaderRow, MatFooterRow, MatRow, MatTableDataSource */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTableModule", function() { return MatTableModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCellDef", function() { return MatCellDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatHeaderCellDef", function() { return MatHeaderCellDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatFooterCellDef", function() { return MatFooterCellDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatColumnDef", function() { return MatColumnDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatHeaderCell", function() { return MatHeaderCell; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatFooterCell", function() { return MatFooterCell; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCell", function() { return MatCell; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTable", function() { return MatTable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatHeaderRowDef", function() { return MatHeaderRowDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatFooterRowDef", function() { return MatFooterRowDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatRowDef", function() { return MatRowDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatHeaderRow", function() { return MatHeaderRow; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatFooterRow", function() { return MatFooterRow; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatRow", function() { return MatRow; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTableDataSource", function() { return MatTableDataSource; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/table */ "./node_modules/@angular/cdk/esm5/table.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Wrapper for the CdkTable with Material design styles.
* @template T
*/
var MatTable = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatTable, _super);
// TODO(andrewseguin): Remove this explicitly set constructor when the compiler knows how to
// properly build the es6 version of the class. Currently sets ctorParameters to empty due to a
// fixed bug.
// https://github.com/angular/tsickle/pull/760 - tsickle PR that fixed this
// https://github.com/angular/angular/pull/23531 - updates compiler-cli to fixed version
function MatTable(_differs, _changeDetectorRef, _elementRef, role) {
var _this = _super.call(this, _differs, _changeDetectorRef, _elementRef, role) || this;
_this._differs = _differs;
_this._changeDetectorRef = _changeDetectorRef;
_this._elementRef = _elementRef;
return _this;
}
MatTable.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-table, table[mat-table]',
exportAs: 'matTable',
template: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CDK_TABLE_TEMPLATE"],
styles: ["mat-table{display:block}mat-header-row{min-height:56px}mat-footer-row,mat-row{min-height:48px}mat-footer-row,mat-header-row,mat-row{display:flex;border-width:0;border-bottom-width:1px;border-style:solid;align-items:center;box-sizing:border-box}mat-footer-row::after,mat-header-row::after,mat-row::after{display:inline-block;min-height:inherit;content:''}mat-cell:first-child,mat-footer-cell:first-child,mat-header-cell:first-child{padding-left:24px}[dir=rtl] mat-cell:first-child,[dir=rtl] mat-footer-cell:first-child,[dir=rtl] mat-header-cell:first-child{padding-left:0;padding-right:24px}mat-cell:last-child,mat-footer-cell:last-child,mat-header-cell:last-child{padding-right:24px}[dir=rtl] mat-cell:last-child,[dir=rtl] mat-footer-cell:last-child,[dir=rtl] mat-header-cell:last-child{padding-right:0;padding-left:24px}mat-cell,mat-footer-cell,mat-header-cell{flex:1;display:flex;align-items:center;overflow:hidden;word-wrap:break-word;min-height:inherit}table.mat-table{border-spacing:0}tr.mat-header-row{height:56px}tr.mat-footer-row,tr.mat-row{height:48px}th.mat-header-cell{text-align:left}td.mat-cell,td.mat-footer-cell,th.mat-header-cell{padding:0;border-bottom-width:1px;border-bottom-style:solid}td.mat-cell:first-child,td.mat-footer-cell:first-child,th.mat-header-cell:first-child{padding-left:24px}td.mat-cell:last-child,td.mat-footer-cell:last-child,th.mat-header-cell:last-child{padding-right:24px}"],
host: {
'class': 'mat-table',
},
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatTable.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Attribute"], args: ['role',] },] },
]; };
return MatTable;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkTable"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Cell definition for the mat-table.
* Captures the template of a column's data row cell as well as cell-specific properties.
*/
var MatCellDef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatCellDef, _super);
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
function MatCellDef(template) {
var _this = _super.call(this, template) || this;
_this.template = template;
return _this;
}
MatCellDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[matCellDef]',
providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkCellDef"], useExisting: MatCellDef }]
},] },
];
/** @nocollapse */
MatCellDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
]; };
return MatCellDef;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkCellDef"]));
/**
* Header cell definition for the mat-table.
* Captures the template of a column's header cell and as well as cell-specific properties.
*/
var MatHeaderCellDef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatHeaderCellDef, _super);
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
function MatHeaderCellDef(template) {
var _this = _super.call(this, template) || this;
_this.template = template;
return _this;
}
MatHeaderCellDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[matHeaderCellDef]',
providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkHeaderCellDef"], useExisting: MatHeaderCellDef }]
},] },
];
/** @nocollapse */
MatHeaderCellDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
]; };
return MatHeaderCellDef;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkHeaderCellDef"]));
/**
* Footer cell definition for the mat-table.
* Captures the template of a column's footer cell and as well as cell-specific properties.
*/
var MatFooterCellDef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatFooterCellDef, _super);
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
function MatFooterCellDef(template) {
var _this = _super.call(this, template) || this;
_this.template = template;
return _this;
}
MatFooterCellDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[matFooterCellDef]',
providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkFooterCellDef"], useExisting: MatFooterCellDef }]
},] },
];
/** @nocollapse */
MatFooterCellDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
]; };
return MatFooterCellDef;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkFooterCellDef"]));
/**
* Column definition for the mat-table.
* Defines a set of cells available for a table column.
*/
var MatColumnDef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatColumnDef, _super);
function MatColumnDef() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatColumnDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[matColumnDef]',
providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkColumnDef"], useExisting: MatColumnDef }],
},] },
];
/** @nocollapse */
MatColumnDef.propDecorators = {
"name": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matColumnDef',] },],
};
return MatColumnDef;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkColumnDef"]));
/**
* Header cell template container that adds the right classes and role.
*/
var MatHeaderCell = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatHeaderCell, _super);
function MatHeaderCell(columnDef, elementRef) {
var _this = _super.call(this, columnDef, elementRef) || this;
elementRef.nativeElement.classList.add("mat-column-" + columnDef.cssClassFriendlyName);
return _this;
}
MatHeaderCell.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'mat-header-cell, th[mat-header-cell]',
host: {
'class': 'mat-header-cell',
'role': 'columnheader',
},
},] },
];
/** @nocollapse */
MatHeaderCell.ctorParameters = function () { return [
{ type: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkColumnDef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
]; };
return MatHeaderCell;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkHeaderCell"]));
/**
* Footer cell template container that adds the right classes and role.
*/
var MatFooterCell = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatFooterCell, _super);
function MatFooterCell(columnDef, elementRef) {
var _this = _super.call(this, columnDef, elementRef) || this;
elementRef.nativeElement.classList.add("mat-column-" + columnDef.cssClassFriendlyName);
return _this;
}
MatFooterCell.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'mat-footer-cell, td[mat-footer-cell]',
host: {
'class': 'mat-footer-cell',
'role': 'gridcell',
},
},] },
];
/** @nocollapse */
MatFooterCell.ctorParameters = function () { return [
{ type: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkColumnDef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
]; };
return MatFooterCell;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkFooterCell"]));
/**
* Cell template container that adds the right classes and role.
*/
var MatCell = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatCell, _super);
function MatCell(columnDef, elementRef) {
var _this = _super.call(this, columnDef, elementRef) || this;
elementRef.nativeElement.classList.add("mat-column-" + columnDef.cssClassFriendlyName);
return _this;
}
MatCell.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'mat-cell, td[mat-cell]',
host: {
'class': 'mat-cell',
'role': 'gridcell',
},
},] },
];
/** @nocollapse */
MatCell.ctorParameters = function () { return [
{ type: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkColumnDef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
]; };
return MatCell;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkCell"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Header row definition for the mat-table.
* Captures the header row's template and other header properties such as the columns to display.
*/
var MatHeaderRowDef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatHeaderRowDef, _super);
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
function MatHeaderRowDef(template, _differs) {
return _super.call(this, template, _differs) || this;
}
MatHeaderRowDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[matHeaderRowDef]',
providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkHeaderRowDef"], useExisting: MatHeaderRowDef }],
inputs: ['columns: matHeaderRowDef'],
},] },
];
/** @nocollapse */
MatHeaderRowDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"], },
]; };
return MatHeaderRowDef;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkHeaderRowDef"]));
/**
* Footer row definition for the mat-table.
* Captures the footer row's template and other footer properties such as the columns to display.
*/
var MatFooterRowDef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatFooterRowDef, _super);
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
function MatFooterRowDef(template, _differs) {
return _super.call(this, template, _differs) || this;
}
MatFooterRowDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[matFooterRowDef]',
providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkFooterRowDef"], useExisting: MatFooterRowDef }],
inputs: ['columns: matFooterRowDef'],
},] },
];
/** @nocollapse */
MatFooterRowDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"], },
]; };
return MatFooterRowDef;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkFooterRowDef"]));
/**
* Data row definition for the mat-table.
* Captures the footer row's template and other footer properties such as the columns to display and
* a when predicate that describes when this row should be used.
* @template T
*/
var MatRowDef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatRowDef, _super);
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
function MatRowDef(template, _differs) {
return _super.call(this, template, _differs) || this;
}
MatRowDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[matRowDef]',
providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkRowDef"], useExisting: MatRowDef }],
inputs: ['columns: matRowDefColumns', 'when: matRowDefWhen'],
},] },
];
/** @nocollapse */
MatRowDef.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"], },
]; };
return MatRowDef;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkRowDef"]));
/**
* Footer template container that contains the cell outlet. Adds the right class and role.
*/
var MatHeaderRow = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatHeaderRow, _super);
function MatHeaderRow() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatHeaderRow.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-header-row, tr[mat-header-row]',
template: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CDK_ROW_TEMPLATE"],
host: {
'class': 'mat-header-row',
'role': 'row',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
exportAs: 'matHeaderRow',
},] },
];
return MatHeaderRow;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkHeaderRow"]));
/**
* Footer template container that contains the cell outlet. Adds the right class and role.
*/
var MatFooterRow = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatFooterRow, _super);
function MatFooterRow() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatFooterRow.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-footer-row, tr[mat-footer-row]',
template: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CDK_ROW_TEMPLATE"],
host: {
'class': 'mat-footer-row',
'role': 'row',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
exportAs: 'matFooterRow',
},] },
];
return MatFooterRow;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkFooterRow"]));
/**
* Data row template container that contains the cell outlet. Adds the right class and role.
*/
var MatRow = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatRow, _super);
function MatRow() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatRow.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-row, tr[mat-row]',
template: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CDK_ROW_TEMPLATE"],
host: {
'class': 'mat-row',
'role': 'row',
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
exportAs: 'matRow',
},] },
];
return MatRow;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkRow"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ EXPORTED_DECLARATIONS = [
MatTable,
MatHeaderCellDef,
MatHeaderRowDef,
MatColumnDef,
MatCellDef,
MatRowDef,
MatFooterCellDef,
MatFooterRowDef,
MatHeaderCell,
MatCell,
MatFooterCell,
MatHeaderRow,
MatRow,
MatFooterRow,
];
var MatTableModule = /** @class */ (function () {
function MatTableModule() {
}
MatTableModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["CdkTableModule"], _angular_common__WEBPACK_IMPORTED_MODULE_3__["CommonModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_4__["MatCommonModule"]],
exports: EXPORTED_DECLARATIONS,
declarations: EXPORTED_DECLARATIONS,
},] },
];
return MatTableModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Data source that accepts a client-side data array and includes native support of filtering,
* sorting (using MatSort), and pagination (using MatPaginator).
*
* Allows for sort customization by overriding sortingDataAccessor, which defines how data
* properties are accessed. Also allows for filter customization by overriding filterTermAccessor,
* which defines how row data is converted to a string for filter matching.
* @template T
*/
var /**
* Data source that accepts a client-side data array and includes native support of filtering,
* sorting (using MatSort), and pagination (using MatPaginator).
*
* Allows for sort customization by overriding sortingDataAccessor, which defines how data
* properties are accessed. Also allows for filter customization by overriding filterTermAccessor,
* which defines how row data is converted to a string for filter matching.
* @template T
*/
MatTableDataSource = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatTableDataSource, _super);
function MatTableDataSource(initialData) {
if (initialData === void 0) { initialData = []; }
var _this = _super.call(this) || this;
/**
* Stream emitting render data to the table (depends on ordered data changes).
*/
_this._renderData = new rxjs__WEBPACK_IMPORTED_MODULE_6__["BehaviorSubject"]([]);
/**
* Stream that emits when a new filter string is set on the data source.
*/
_this._filter = new rxjs__WEBPACK_IMPORTED_MODULE_6__["BehaviorSubject"]('');
/**
* Data accessor function that is used for accessing data properties for sorting through
* the default sortData function.
* This default function assumes that the sort header IDs (which defaults to the column name)
* matches the data's properties (e.g. column Xyz represents data['Xyz']).
* May be set to a custom function for different behavior.
* @param data Data object that is being accessed.
* @param sortHeaderId The name of the column that represents the data.
*/
_this.sortingDataAccessor = function (data, sortHeaderId) {
var /** @type {?} */ value = data[sortHeaderId];
return Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__["_isNumberValue"])(value) ? Number(value) : value;
};
/**
* Gets a sorted copy of the data array based on the state of the MatSort. Called
* after changes are made to the filtered data or when sort changes are emitted from MatSort.
* By default, the function retrieves the active sort and its direction and compares data
* by retrieving data using the sortingDataAccessor. May be overridden for a custom implementation
* of data ordering.
* @param data The array of data that should be sorted.
* @param sort The connected MatSort that holds the current sort state.
*/
_this.sortData = function (data, sort) {
var /** @type {?} */ active = sort.active;
var /** @type {?} */ direction = sort.direction;
if (!active || direction == '') {
return data;
}
return data.sort(function (a, b) {
var /** @type {?} */ valueA = _this.sortingDataAccessor(a, active);
var /** @type {?} */ valueB = _this.sortingDataAccessor(b, active);
// If both valueA and valueB exist (truthy), then compare the two. Otherwise, check if
// one value exists while the other doesn't. In this case, existing value should come first.
// This avoids inconsistent results when comparing values to undefined/null.
// If neither value exists, return 0 (equal).
var /** @type {?} */ comparatorResult = 0;
if (valueA != null && valueB != null) {
// Check if one value is greater than the other; if equal, comparatorResult should remain 0.
if (valueA > valueB) {
comparatorResult = 1;
}
else if (valueA < valueB) {
comparatorResult = -1;
}
}
else if (valueA != null) {
comparatorResult = 1;
}
else if (valueB != null) {
comparatorResult = -1;
}
return comparatorResult * (direction == 'asc' ? 1 : -1);
});
};
/**
* Checks if a data object matches the data source's filter string. By default, each data object
* is converted to a string of its properties and returns true if the filter has
* at least one occurrence in that string. By default, the filter string has its whitespace
* trimmed and the match is case-insensitive. May be overridden for a custom implementation of
* filter matching.
* @param data Data object used to check against the filter.
* @param filter Filter string that has been set on the data source.
* @return Whether the filter matches against the data
*/
_this.filterPredicate = function (data, filter) {
// Transform the data into a lowercase string of all property values.
var /** @type {?} */ accumulator = function (currentTerm, key) { return currentTerm + data[key]; };
var /** @type {?} */ dataStr = Object.keys(data).reduce(accumulator, '').toLowerCase();
// Transform the filter by converting it to lowercase and removing whitespace.
var /** @type {?} */ transformedFilter = filter.trim().toLowerCase();
return dataStr.indexOf(transformedFilter) != -1;
};
_this._data = new rxjs__WEBPACK_IMPORTED_MODULE_6__["BehaviorSubject"](initialData);
_this._updateChangeSubscription();
return _this;
}
Object.defineProperty(MatTableDataSource.prototype, "data", {
/** Array of data that should be rendered by the table, where each object represents one row. */
get: /**
* Array of data that should be rendered by the table, where each object represents one row.
* @return {?}
*/
function () { return this._data.value; },
set: /**
* @param {?} data
* @return {?}
*/
function (data) { this._data.next(data); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatTableDataSource.prototype, "filter", {
/**
* Filter term that should be used to filter out objects from the data array. To override how
* data objects match to this filter string, provide a custom function for filterPredicate.
*/
get: /**
* Filter term that should be used to filter out objects from the data array. To override how
* data objects match to this filter string, provide a custom function for filterPredicate.
* @return {?}
*/
function () { return this._filter.value; },
set: /**
* @param {?} filter
* @return {?}
*/
function (filter) { this._filter.next(filter); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatTableDataSource.prototype, "sort", {
/**
* Instance of the MatSort directive used by the table to control its sorting. Sort changes
* emitted by the MatSort will trigger an update to the table's rendered data.
*/
get: /**
* Instance of the MatSort directive used by the table to control its sorting. Sort changes
* emitted by the MatSort will trigger an update to the table's rendered data.
* @return {?}
*/
function () { return this._sort; },
set: /**
* @param {?} sort
* @return {?}
*/
function (sort) {
this._sort = sort;
this._updateChangeSubscription();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatTableDataSource.prototype, "paginator", {
/**
* Instance of the MatPaginator component used by the table to control what page of the data is
* displayed. Page changes emitted by the MatPaginator will trigger an update to the
* table's rendered data.
*
* Note that the data source uses the paginator's properties to calculate which page of data
* should be displayed. If the paginator receives its properties as template inputs,
* e.g. `[pageLength]=100` or `[pageIndex]=1`, then be sure that the paginator's view has been
* initialized before assigning it to this data source.
*/
get: /**
* Instance of the MatPaginator component used by the table to control what page of the data is
* displayed. Page changes emitted by the MatPaginator will trigger an update to the
* table's rendered data.
*
* Note that the data source uses the paginator's properties to calculate which page of data
* should be displayed. If the paginator receives its properties as template inputs,
* e.g. `[pageLength]=100` or `[pageIndex]=1`, then be sure that the paginator's view has been
* initialized before assigning it to this data source.
* @return {?}
*/
function () { return this._paginator; },
set: /**
* @param {?} paginator
* @return {?}
*/
function (paginator) {
this._paginator = paginator;
this._updateChangeSubscription();
},
enumerable: true,
configurable: true
});
/**
* Subscribe to changes that should trigger an update to the table's rendered rows. When the
* changes occur, process the current state of the filter, sort, and pagination along with
* the provided base data and send it to the table for rendering.
*/
/**
* Subscribe to changes that should trigger an update to the table's rendered rows. When the
* changes occur, process the current state of the filter, sort, and pagination along with
* the provided base data and send it to the table for rendering.
* @return {?}
*/
MatTableDataSource.prototype._updateChangeSubscription = /**
* Subscribe to changes that should trigger an update to the table's rendered rows. When the
* changes occur, process the current state of the filter, sort, and pagination along with
* the provided base data and send it to the table for rendering.
* @return {?}
*/
function () {
var _this = this;
// Sorting and/or pagination should be watched if MatSort and/or MatPaginator are provided.
// The events should emit whenever the component emits a change or initializes, or if no
// component is provided, a stream with just a null event should be provided.
// The `sortChange` and `pageChange` acts as a signal to the combineLatests below so that the
// pipeline can progress to the next step. Note that the value from these streams are not used,
// they purely act as a signal to progress in the pipeline.
var /** @type {?} */ sortChange = this._sort ?
Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["merge"])(this._sort.sortChange, this._sort.initialized) :
Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["of"])(null);
var /** @type {?} */ pageChange = this._paginator ?
Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["merge"])(this._paginator.page, this._paginator.initialized) :
Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["of"])(null);
if (this._renderChangesSubscription) {
this._renderChangesSubscription.unsubscribe();
}
var /** @type {?} */ dataStream = this._data;
// Watch for base data or filter changes to provide a filtered set of data.
var /** @type {?} */ filteredData = Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["combineLatest"])(dataStream, this._filter)
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["map"])(function (_a) {
var data = _a[0];
return _this._filterData(data);
}));
// Watch for filtered data or sort changes to provide an ordered set of data.
var /** @type {?} */ orderedData = Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["combineLatest"])(filteredData, sortChange)
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["map"])(function (_a) {
var data = _a[0];
return _this._orderData(data);
}));
// Watch for ordered data or page changes to provide a paged set of data.
var /** @type {?} */ paginatedData = Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["combineLatest"])(orderedData, pageChange)
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["map"])(function (_a) {
var data = _a[0];
return _this._pageData(data);
}));
// Watched for paged data changes and send the result to the table to render.
paginatedData.subscribe(function (data) { return _this._renderData.next(data); });
};
/**
* Returns a filtered data array where each filter object contains the filter string within
* the result of the filterTermAccessor function. If no filter is set, returns the data array
* as provided.
*/
/**
* Returns a filtered data array where each filter object contains the filter string within
* the result of the filterTermAccessor function. If no filter is set, returns the data array
* as provided.
* @param {?} data
* @return {?}
*/
MatTableDataSource.prototype._filterData = /**
* Returns a filtered data array where each filter object contains the filter string within
* the result of the filterTermAccessor function. If no filter is set, returns the data array
* as provided.
* @param {?} data
* @return {?}
*/
function (data) {
var _this = this;
// If there is a filter string, filter out data that does not contain it.
// Each data object is converted to a string using the function defined by filterTermAccessor.
// May be overridden for customization.
this.filteredData =
!this.filter ? data : data.filter(function (obj) { return _this.filterPredicate(obj, _this.filter); });
if (this.paginator) {
this._updatePaginator(this.filteredData.length);
}
return this.filteredData;
};
/**
* Returns a sorted copy of the data if MatSort has a sort applied, otherwise just returns the
* data array as provided. Uses the default data accessor for data lookup, unless a
* sortDataAccessor function is defined.
*/
/**
* Returns a sorted copy of the data if MatSort has a sort applied, otherwise just returns the
* data array as provided. Uses the default data accessor for data lookup, unless a
* sortDataAccessor function is defined.
* @param {?} data
* @return {?}
*/
MatTableDataSource.prototype._orderData = /**
* Returns a sorted copy of the data if MatSort has a sort applied, otherwise just returns the
* data array as provided. Uses the default data accessor for data lookup, unless a
* sortDataAccessor function is defined.
* @param {?} data
* @return {?}
*/
function (data) {
// If there is no active sort or direction, return the data without trying to sort.
if (!this.sort) {
return data;
}
return this.sortData(data.slice(), this.sort);
};
/**
* Returns a paged splice of the provided data array according to the provided MatPaginator's page
* index and length. If there is no paginator provided, returns the data array as provided.
*/
/**
* Returns a paged splice of the provided data array according to the provided MatPaginator's page
* index and length. If there is no paginator provided, returns the data array as provided.
* @param {?} data
* @return {?}
*/
MatTableDataSource.prototype._pageData = /**
* Returns a paged splice of the provided data array according to the provided MatPaginator's page
* index and length. If there is no paginator provided, returns the data array as provided.
* @param {?} data
* @return {?}
*/
function (data) {
if (!this.paginator) {
return data;
}
var /** @type {?} */ startIndex = this.paginator.pageIndex * this.paginator.pageSize;
return data.slice().splice(startIndex, this.paginator.pageSize);
};
/**
* Updates the paginator to reflect the length of the filtered data, and makes sure that the page
* index does not exceed the paginator's last page. Values are changed in a resolved promise to
* guard against making property changes within a round of change detection.
*/
/**
* Updates the paginator to reflect the length of the filtered data, and makes sure that the page
* index does not exceed the paginator's last page. Values are changed in a resolved promise to
* guard against making property changes within a round of change detection.
* @param {?} filteredDataLength
* @return {?}
*/
MatTableDataSource.prototype._updatePaginator = /**
* Updates the paginator to reflect the length of the filtered data, and makes sure that the page
* index does not exceed the paginator's last page. Values are changed in a resolved promise to
* guard against making property changes within a round of change detection.
* @param {?} filteredDataLength
* @return {?}
*/
function (filteredDataLength) {
var _this = this;
Promise.resolve().then(function () {
if (!_this.paginator) {
return;
}
_this.paginator.length = filteredDataLength;
// If the page index is set beyond the page, reduce it to the last page.
if (_this.paginator.pageIndex > 0) {
var /** @type {?} */ lastPageIndex = Math.ceil(_this.paginator.length / _this.paginator.pageSize) - 1 || 0;
_this.paginator.pageIndex = Math.min(_this.paginator.pageIndex, lastPageIndex);
}
});
};
/**
* Used by the MatTable. Called when it connects to the data source.
* @docs-private
*/
/**
* Used by the MatTable. Called when it connects to the data source.
* \@docs-private
* @return {?}
*/
MatTableDataSource.prototype.connect = /**
* Used by the MatTable. Called when it connects to the data source.
* \@docs-private
* @return {?}
*/
function () { return this._renderData; };
/**
* Used by the MatTable. Called when it is destroyed. No-op.
* @docs-private
*/
/**
* Used by the MatTable. Called when it is destroyed. No-op.
* \@docs-private
* @return {?}
*/
MatTableDataSource.prototype.disconnect = /**
* Used by the MatTable. Called when it is destroyed. No-op.
* \@docs-private
* @return {?}
*/
function () { };
return MatTableDataSource;
}(_angular_cdk_table__WEBPACK_IMPORTED_MODULE_2__["DataSource"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=table.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/tabs.es5.js":
/*!*********************************************************!*\
!*** ./node_modules/@angular/material/esm5/tabs.es5.js ***!
\*********************************************************/
/*! exports provided: MatInkBar, _MAT_INK_BAR_POSITIONER, MatTabBody, MatTabBodyPortal, MatTabHeader, MatTabLabelWrapper, MatTab, MatTabLabel, MatTabNav, MatTabLink, MatTabContent, MatTabsModule, MatTabChangeEvent, MatTabGroupBase, _MatTabGroupMixinBase, MatTabGroup, matTabsAnimations, ɵa23, ɵf23, ɵg23, ɵb23, ɵc23, ɵd23, ɵe23, ɵj23, ɵh23, ɵk23, ɵi23 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatInkBar", function() { return MatInkBar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MAT_INK_BAR_POSITIONER", function() { return _MAT_INK_BAR_POSITIONER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTabBody", function() { return MatTabBody; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTabBodyPortal", function() { return MatTabBodyPortal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTabHeader", function() { return MatTabHeader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTabLabelWrapper", function() { return MatTabLabelWrapper; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTab", function() { return MatTab; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTabLabel", function() { return MatTabLabel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTabNav", function() { return MatTabNav; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTabLink", function() { return MatTabLink; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTabContent", function() { return MatTabContent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTabsModule", function() { return MatTabsModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTabChangeEvent", function() { return MatTabChangeEvent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTabGroupBase", function() { return MatTabGroupBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatTabGroupMixinBase", function() { return _MatTabGroupMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTabGroup", function() { return MatTabGroup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matTabsAnimations", function() { return matTabsAnimations; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵa23", function() { return _MAT_INK_BAR_POSITIONER_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵf23", function() { return MatTabBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵg23", function() { return _MatTabMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵb23", function() { return MatTabHeaderBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵc23", function() { return _MatTabHeaderMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵd23", function() { return MatTabLabelWrapperBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵe23", function() { return _MatTabLabelWrapperMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵj23", function() { return MatTabLinkBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵh23", function() { return MatTabNavBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵk23", function() { return _MatTabLinkMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵi23", function() { return _MatTabNavMixinBase; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/portal */ "./node_modules/@angular/cdk/esm5/portal.es5.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/cdk/scrolling */ "./node_modules/@angular/cdk/esm5/scrolling.es5.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_cdk_observers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/cdk/observers */ "./node_modules/@angular/cdk/esm5/observers.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Injection token for the MatInkBar's Positioner.
*/
var /** @type {?} */ _MAT_INK_BAR_POSITIONER = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('MatInkBarPositioner', {
providedIn: 'root',
factory: _MAT_INK_BAR_POSITIONER_FACTORY
});
/**
* The default positioner function for the MatInkBar.
* \@docs-private
* @return {?}
*/
function _MAT_INK_BAR_POSITIONER_FACTORY() {
var /** @type {?} */ method = function (element) {
return ({
left: element ? (element.offsetLeft || 0) + 'px' : '0',
width: element ? (element.offsetWidth || 0) + 'px' : '0',
});
};
return method;
}
/**
* The ink-bar is used to display and animate the line underneath the current active tab label.
* \@docs-private
*/
var MatInkBar = /** @class */ (function () {
function MatInkBar(_elementRef, _ngZone, _inkBarPositioner) {
this._elementRef = _elementRef;
this._ngZone = _ngZone;
this._inkBarPositioner = _inkBarPositioner;
}
/**
* Calculates the styles from the provided element in order to align the ink-bar to that element.
* Shows the ink bar if previously set as hidden.
* @param element
*/
/**
* Calculates the styles from the provided element in order to align the ink-bar to that element.
* Shows the ink bar if previously set as hidden.
* @param {?} element
* @return {?}
*/
MatInkBar.prototype.alignToElement = /**
* Calculates the styles from the provided element in order to align the ink-bar to that element.
* Shows the ink bar if previously set as hidden.
* @param {?} element
* @return {?}
*/
function (element) {
var _this = this;
this.show();
if (typeof requestAnimationFrame !== 'undefined') {
this._ngZone.runOutsideAngular(function () {
requestAnimationFrame(function () { return _this._setStyles(element); });
});
}
else {
this._setStyles(element);
}
};
/** Shows the ink bar. */
/**
* Shows the ink bar.
* @return {?}
*/
MatInkBar.prototype.show = /**
* Shows the ink bar.
* @return {?}
*/
function () {
this._elementRef.nativeElement.style.visibility = 'visible';
};
/** Hides the ink bar. */
/**
* Hides the ink bar.
* @return {?}
*/
MatInkBar.prototype.hide = /**
* Hides the ink bar.
* @return {?}
*/
function () {
this._elementRef.nativeElement.style.visibility = 'hidden';
};
/**
* Sets the proper styles to the ink bar element.
* @param {?} element
* @return {?}
*/
MatInkBar.prototype._setStyles = /**
* Sets the proper styles to the ink bar element.
* @param {?} element
* @return {?}
*/
function (element) {
var /** @type {?} */ positions = this._inkBarPositioner(element);
var /** @type {?} */ inkBar = this._elementRef.nativeElement;
inkBar.style.left = positions.left;
inkBar.style.width = positions.width;
};
MatInkBar.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'mat-ink-bar',
host: {
'class': 'mat-ink-bar',
},
},] },
];
/** @nocollapse */
MatInkBar.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_MAT_INK_BAR_POSITIONER,] },] },
]; };
return MatInkBar;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Used to flag tab labels for use with the portal directive
*/
var MatTabLabel = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTabLabel, _super);
function MatTabLabel(templateRef, viewContainerRef) {
return _super.call(this, templateRef, viewContainerRef) || this;
}
MatTabLabel.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[mat-tab-label], [matTabLabel]',
},] },
];
/** @nocollapse */
MatTabLabel.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"], },
]; };
return MatTabLabel;
}(_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_2__["CdkPortal"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Decorates the `ng-template` tags and reads out the template from it.
*/
var MatTabContent = /** @class */ (function () {
function MatTabContent(template) {
this.template = template;
}
MatTabContent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[matTabContent]' },] },
];
/** @nocollapse */
MatTabContent.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"], },
]; };
return MatTabContent;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatTabBase = /** @class */ (function () {
function MatTabBase() {
}
return MatTabBase;
}());
var /** @type {?} */ _MatTabMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisabled"])(MatTabBase);
var MatTab = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTab, _super);
function MatTab(_viewContainerRef) {
var _this = _super.call(this) || this;
_this._viewContainerRef = _viewContainerRef;
/**
* The plain text label for the tab, used when there is no template label.
*/
_this.textLabel = '';
/**
* The portal that will be the hosted content of the tab
*/
_this._contentPortal = null;
/**
* Emits whenever the label changes.
*/
_this._labelChange = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
/**
* Emits whenever the disable changes
*/
_this._disableChange = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
/**
* The relatively indexed position where 0 represents the center, negative is left, and positive
* represents the right.
*/
_this.position = null;
/**
* The initial relatively index origin of the tab if it was created and selected after there
* was already a selected tab. Provides context of what position the tab should originate from.
*/
_this.origin = null;
/**
* Whether the tab is currently active.
*/
_this.isActive = false;
return _this;
}
Object.defineProperty(MatTab.prototype, "content", {
/** @docs-private */
get: /**
* \@docs-private
* @return {?}
*/
function () {
return this._contentPortal;
},
enumerable: true,
configurable: true
});
/**
* @param {?} changes
* @return {?}
*/
MatTab.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes.hasOwnProperty('textLabel')) {
this._labelChange.next();
}
if (changes.hasOwnProperty('disabled')) {
this._disableChange.next();
}
};
/**
* @return {?}
*/
MatTab.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._disableChange.complete();
this._labelChange.complete();
};
/**
* @return {?}
*/
MatTab.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._contentPortal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_2__["TemplatePortal"](this._explicitContent || this._implicitContent, this._viewContainerRef);
};
MatTab.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-tab',
template: "<ng-template><ng-content></ng-content></ng-template>",
inputs: ['disabled'],
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
exportAs: 'matTab',
},] },
];
/** @nocollapse */
MatTab.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"], },
]; };
MatTab.propDecorators = {
"templateLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChild"], args: [MatTabLabel,] },],
"_explicitContent": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChild"], args: [MatTabContent, { read: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] },] },],
"_implicitContent": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"],] },],
"textLabel": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['label',] },],
};
return MatTab;
}(_MatTabMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Animations used by the Material tabs.
*/
var /** @type {?} */ matTabsAnimations = {
/** Animation translates a tab along the X axis. */
translateTab: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["trigger"])('translateTab', [
// Note: transitions to `none` instead of 0, because some browsers might blur the content.
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('center, void, left-origin-center, right-origin-center', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'none' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('left', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translate3d(-100%, 0, 0)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["state"])('right', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translate3d(100%, 0, 0)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('* => left, * => right, left => center, right => center', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])('500ms cubic-bezier(0.35, 0, 0.25, 1)')),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('void => left-origin-center', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translate3d(-100%, 0, 0)' }),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])('500ms cubic-bezier(0.35, 0, 0.25, 1)')
]),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["transition"])('void => right-origin-center', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["style"])({ transform: 'translate3d(100%, 0, 0)' }),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_5__["animate"])('500ms cubic-bezier(0.35, 0, 0.25, 1)')
])
])
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* The portal host directive for the contents of the tab.
* \@docs-private
*/
var MatTabBodyPortal = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTabBodyPortal, _super);
function MatTabBodyPortal(componentFactoryResolver, viewContainerRef, _host) {
var _this = _super.call(this, componentFactoryResolver, viewContainerRef) || this;
_this._host = _host;
/**
* Subscription to events for when the tab body begins centering.
*/
_this._centeringSub = rxjs__WEBPACK_IMPORTED_MODULE_4__["Subscription"].EMPTY;
/**
* Subscription to events for when the tab body finishes leaving from center position.
*/
_this._leavingSub = rxjs__WEBPACK_IMPORTED_MODULE_4__["Subscription"].EMPTY;
return _this;
}
/** Set initial visibility or set up subscription for changing visibility. */
/**
* Set initial visibility or set up subscription for changing visibility.
* @return {?}
*/
MatTabBodyPortal.prototype.ngOnInit = /**
* Set initial visibility or set up subscription for changing visibility.
* @return {?}
*/
function () {
var _this = this;
_super.prototype.ngOnInit.call(this);
this._centeringSub = this._host._beforeCentering
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["startWith"])(this._host._isCenterPosition(this._host._position)))
.subscribe(function (isCentering) {
if (isCentering && !_this.hasAttached()) {
_this.attach(_this._host._content);
}
});
this._leavingSub = this._host._afterLeavingCenter.subscribe(function () {
_this.detach();
});
};
/** Clean up centering subscription. */
/**
* Clean up centering subscription.
* @return {?}
*/
MatTabBodyPortal.prototype.ngOnDestroy = /**
* Clean up centering subscription.
* @return {?}
*/
function () {
_super.prototype.ngOnDestroy.call(this);
this._centeringSub.unsubscribe();
this._leavingSub.unsubscribe();
};
MatTabBodyPortal.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[matTabBodyHost]'
},] },
];
/** @nocollapse */
MatTabBodyPortal.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ComponentFactoryResolver"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"], },
{ type: MatTabBody, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(function () { return MatTabBody; }),] },] },
]; };
return MatTabBodyPortal;
}(_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_2__["CdkPortalOutlet"]));
/**
* Wrapper for the contents of a tab.
* \@docs-private
*/
var MatTabBody = /** @class */ (function () {
function MatTabBody(_elementRef, _dir) {
this._elementRef = _elementRef;
this._dir = _dir;
/**
* Event emitted when the tab begins to animate towards the center as the active tab.
*/
this._onCentering = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted before the centering of the tab begins.
*/
this._beforeCentering = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted before the centering of the tab begins.
*/
this._afterLeavingCenter = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when the tab completes its animation towards the center.
*/
this._onCentered = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"](true);
}
Object.defineProperty(MatTabBody.prototype, "position", {
set: /**
* The shifted index position of the tab body, where zero represents the active center tab.
* @param {?} position
* @return {?}
*/
function (position) {
if (position < 0) {
this._position = this._getLayoutDirection() == 'ltr' ? 'left' : 'right';
}
else if (position > 0) {
this._position = this._getLayoutDirection() == 'ltr' ? 'right' : 'left';
}
else {
this._position = 'center';
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatTabBody.prototype, "origin", {
set: /**
* The origin position from which this tab should appear when it is centered into view.
* @param {?} origin
* @return {?}
*/
function (origin) {
if (origin == null) {
return;
}
var /** @type {?} */ dir = this._getLayoutDirection();
if ((dir == 'ltr' && origin <= 0) || (dir == 'rtl' && origin > 0)) {
this._origin = 'left';
}
else {
this._origin = 'right';
}
},
enumerable: true,
configurable: true
});
/**
* After initialized, check if the content is centered and has an origin. If so, set the
* special position states that transition the tab from the left or right before centering.
*/
/**
* After initialized, check if the content is centered and has an origin. If so, set the
* special position states that transition the tab from the left or right before centering.
* @return {?}
*/
MatTabBody.prototype.ngOnInit = /**
* After initialized, check if the content is centered and has an origin. If so, set the
* special position states that transition the tab from the left or right before centering.
* @return {?}
*/
function () {
if (this._position == 'center' && this._origin) {
this._position = this._origin == 'left' ? 'left-origin-center' : 'right-origin-center';
}
};
/**
* @param {?} e
* @return {?}
*/
MatTabBody.prototype._onTranslateTabStarted = /**
* @param {?} e
* @return {?}
*/
function (e) {
var /** @type {?} */ isCentering = this._isCenterPosition(e.toState);
this._beforeCentering.emit(isCentering);
if (isCentering) {
this._onCentering.emit(this._elementRef.nativeElement.clientHeight);
}
};
/**
* @param {?} e
* @return {?}
*/
MatTabBody.prototype._onTranslateTabComplete = /**
* @param {?} e
* @return {?}
*/
function (e) {
// If the transition to the center is complete, emit an event.
if (this._isCenterPosition(e.toState) && this._isCenterPosition(this._position)) {
this._onCentered.emit();
}
if (this._isCenterPosition(e.fromState) && !this._isCenterPosition(this._position)) {
this._afterLeavingCenter.emit();
}
};
/** The text direction of the containing app. */
/**
* The text direction of the containing app.
* @return {?}
*/
MatTabBody.prototype._getLayoutDirection = /**
* The text direction of the containing app.
* @return {?}
*/
function () {
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
};
/** Whether the provided position state is considered center, regardless of origin. */
/**
* Whether the provided position state is considered center, regardless of origin.
* @param {?} position
* @return {?}
*/
MatTabBody.prototype._isCenterPosition = /**
* Whether the provided position state is considered center, regardless of origin.
* @param {?} position
* @return {?}
*/
function (position) {
return position == 'center' ||
position == 'left-origin-center' ||
position == 'right-origin-center';
};
MatTabBody.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-tab-body',
template: "<div class=\"mat-tab-body-content\" #content [@translateTab]=\"_position\" (@translateTab.start)=\"_onTranslateTabStarted($event)\" (@translateTab.done)=\"_onTranslateTabComplete($event)\"><ng-template matTabBodyHost></ng-template></div>",
styles: [".mat-tab-body-content{height:100%;overflow:auto}.mat-tab-group-dynamic-height .mat-tab-body-content{overflow:hidden}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
animations: [matTabsAnimations.translateTab],
host: {
'class': 'mat-tab-body',
},
},] },
];
/** @nocollapse */
MatTabBody.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_6__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
MatTabBody.propDecorators = {
"_onCentering": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"_beforeCentering": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"_afterLeavingCenter": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"_onCentered": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"_portalHost": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_2__["PortalHostDirective"],] },],
"_content": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['content',] },],
"position": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"origin": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatTabBody;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatTabLabelWrapperBase = /** @class */ (function () {
function MatTabLabelWrapperBase() {
}
return MatTabLabelWrapperBase;
}());
var /** @type {?} */ _MatTabLabelWrapperMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisabled"])(MatTabLabelWrapperBase);
/**
* Used in the `mat-tab-group` view to display tab labels.
* \@docs-private
*/
var MatTabLabelWrapper = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTabLabelWrapper, _super);
function MatTabLabelWrapper(elementRef) {
var _this = _super.call(this) || this;
_this.elementRef = elementRef;
return _this;
}
/** Sets focus on the wrapper element */
/**
* Sets focus on the wrapper element
* @return {?}
*/
MatTabLabelWrapper.prototype.focus = /**
* Sets focus on the wrapper element
* @return {?}
*/
function () {
this.elementRef.nativeElement.focus();
};
/**
* @return {?}
*/
MatTabLabelWrapper.prototype.getOffsetLeft = /**
* @return {?}
*/
function () {
return this.elementRef.nativeElement.offsetLeft;
};
/**
* @return {?}
*/
MatTabLabelWrapper.prototype.getOffsetWidth = /**
* @return {?}
*/
function () {
return this.elementRef.nativeElement.offsetWidth;
};
MatTabLabelWrapper.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[matTabLabelWrapper]',
inputs: ['disabled'],
host: {
'[class.mat-tab-disabled]': 'disabled'
}
},] },
];
/** @nocollapse */
MatTabLabelWrapper.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
]; };
return MatTabLabelWrapper;
}(_MatTabLabelWrapperMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* The distance in pixels that will be overshot when scrolling a tab label into view. This helps
* provide a small affordance to the label next to it.
*/
var /** @type {?} */ EXAGGERATED_OVERSCROLL = 60;
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatTabHeaderBase = /** @class */ (function () {
function MatTabHeaderBase() {
}
return MatTabHeaderBase;
}());
var /** @type {?} */ _MatTabHeaderMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisableRipple"])(MatTabHeaderBase);
/**
* The header of the tab group which displays a list of all the tabs in the tab group. Includes
* an ink bar that follows the currently selected tab. When the tabs list's width exceeds the
* width of the header container, then arrows will be displayed to allow the user to scroll
* left and right across the header.
* \@docs-private
*/
var MatTabHeader = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTabHeader, _super);
function MatTabHeader(_elementRef, _changeDetectorRef, _viewportRuler, _dir) {
var _this = _super.call(this) || this;
_this._elementRef = _elementRef;
_this._changeDetectorRef = _changeDetectorRef;
_this._viewportRuler = _viewportRuler;
_this._dir = _dir;
/**
* The tab index that is focused.
*/
_this._focusIndex = 0;
/**
* The distance in pixels that the tab labels should be translated to the left.
*/
_this._scrollDistance = 0;
/**
* Whether the header should scroll to the selected index after the view has been checked.
*/
_this._selectedIndexChanged = false;
/**
* Combines listeners that will re-align the ink bar whenever they're invoked.
*/
_this._realignInkBar = rxjs__WEBPACK_IMPORTED_MODULE_4__["Subscription"].EMPTY;
/**
* Whether the controls for pagination should be displayed
*/
_this._showPaginationControls = false;
/**
* Whether the tab list can be scrolled more towards the end of the tab label list.
*/
_this._disableScrollAfter = true;
/**
* Whether the tab list can be scrolled more towards the beginning of the tab label list.
*/
_this._disableScrollBefore = true;
_this._selectedIndex = 0;
/**
* Event emitted when the option is selected.
*/
_this.selectFocusedIndex = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when a label is focused.
*/
_this.indexFocused = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
return _this;
}
Object.defineProperty(MatTabHeader.prototype, "selectedIndex", {
get: /**
* The index of the active tab.
* @return {?}
*/
function () { return this._selectedIndex; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
value = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_8__["coerceNumberProperty"])(value);
this._selectedIndexChanged = this._selectedIndex != value;
this._selectedIndex = value;
this._focusIndex = value;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatTabHeader.prototype.ngAfterContentChecked = /**
* @return {?}
*/
function () {
// If the number of tab labels have changed, check if scrolling should be enabled
if (this._tabLabelCount != this._labelWrappers.length) {
this._updatePagination();
this._tabLabelCount = this._labelWrappers.length;
this._changeDetectorRef.markForCheck();
}
// If the selected index has changed, scroll to the label and check if the scrolling controls
// should be disabled.
if (this._selectedIndexChanged) {
this._scrollToLabel(this._selectedIndex);
this._checkScrollingControls();
this._alignInkBarToSelectedTab();
this._selectedIndexChanged = false;
this._changeDetectorRef.markForCheck();
}
// If the scroll distance has been changed (tab selected, focused, scroll controls activated),
// then translate the header to reflect this.
if (this._scrollDistanceChanged) {
this._updateTabScrollPosition();
this._scrollDistanceChanged = false;
this._changeDetectorRef.markForCheck();
}
};
/**
* @param {?} event
* @return {?}
*/
MatTabHeader.prototype._handleKeydown = /**
* @param {?} event
* @return {?}
*/
function (event) {
switch (event.keyCode) {
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["RIGHT_ARROW"]:
this._focusNextTab();
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["LEFT_ARROW"]:
this._focusPreviousTab();
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["HOME"]:
this._focusFirstTab();
event.preventDefault();
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["END"]:
this._focusLastTab();
event.preventDefault();
break;
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["ENTER"]:
case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__["SPACE"]:
this.selectFocusedIndex.emit(this.focusIndex);
event.preventDefault();
break;
}
};
/**
* Aligns the ink bar to the selected tab on load.
*/
/**
* Aligns the ink bar to the selected tab on load.
* @return {?}
*/
MatTabHeader.prototype.ngAfterContentInit = /**
* Aligns the ink bar to the selected tab on load.
* @return {?}
*/
function () {
var _this = this;
var /** @type {?} */ dirChange = this._dir ? this._dir.change : Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["of"])(null);
var /** @type {?} */ resize = this._viewportRuler.change(150);
var /** @type {?} */ realign = function () {
_this._updatePagination();
_this._alignInkBarToSelectedTab();
};
// Defer the first call in order to allow for slower browsers to lay out the elements.
// This helps in cases where the user lands directly on a page with paginated tabs.
typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(realign) : realign();
this._realignInkBar = Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["merge"])(dirChange, resize).subscribe(realign);
};
/**
* @return {?}
*/
MatTabHeader.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._realignInkBar.unsubscribe();
};
/**
* Callback for when the MutationObserver detects that the content has changed.
*/
/**
* Callback for when the MutationObserver detects that the content has changed.
* @return {?}
*/
MatTabHeader.prototype._onContentChanges = /**
* Callback for when the MutationObserver detects that the content has changed.
* @return {?}
*/
function () {
this._updatePagination();
this._alignInkBarToSelectedTab();
this._changeDetectorRef.markForCheck();
};
/**
* Updating the view whether pagination should be enabled or not
*/
/**
* Updating the view whether pagination should be enabled or not
* @return {?}
*/
MatTabHeader.prototype._updatePagination = /**
* Updating the view whether pagination should be enabled or not
* @return {?}
*/
function () {
this._checkPaginationEnabled();
this._checkScrollingControls();
this._updateTabScrollPosition();
};
Object.defineProperty(MatTabHeader.prototype, "focusIndex", {
/** Tracks which element has focus; used for keyboard navigation */
get: /**
* Tracks which element has focus; used for keyboard navigation
* @return {?}
*/
function () { return this._focusIndex; },
/** When the focus index is set, we must manually send focus to the correct label */
set: /**
* When the focus index is set, we must manually send focus to the correct label
* @param {?} value
* @return {?}
*/
function (value) {
if (!this._isValidIndex(value) || this._focusIndex == value) {
return;
}
this._focusIndex = value;
this.indexFocused.emit(value);
this._setTabFocus(value);
},
enumerable: true,
configurable: true
});
/**
* Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
* providing a valid index and return true.
*/
/**
* Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
* providing a valid index and return true.
* @param {?} index
* @return {?}
*/
MatTabHeader.prototype._isValidIndex = /**
* Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
* providing a valid index and return true.
* @param {?} index
* @return {?}
*/
function (index) {
if (!this._labelWrappers) {
return true;
}
var /** @type {?} */ tab = this._labelWrappers ? this._labelWrappers.toArray()[index] : null;
return !!tab && !tab.disabled;
};
/**
* Sets focus on the HTML element for the label wrapper and scrolls it into the view if
* scrolling is enabled.
*/
/**
* Sets focus on the HTML element for the label wrapper and scrolls it into the view if
* scrolling is enabled.
* @param {?} tabIndex
* @return {?}
*/
MatTabHeader.prototype._setTabFocus = /**
* Sets focus on the HTML element for the label wrapper and scrolls it into the view if
* scrolling is enabled.
* @param {?} tabIndex
* @return {?}
*/
function (tabIndex) {
if (this._showPaginationControls) {
this._scrollToLabel(tabIndex);
}
if (this._labelWrappers && this._labelWrappers.length) {
this._labelWrappers.toArray()[tabIndex].focus();
// Do not let the browser manage scrolling to focus the element, this will be handled
// by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width
// should be the full width minus the offset width.
var /** @type {?} */ containerEl = this._tabListContainer.nativeElement;
var /** @type {?} */ dir = this._getLayoutDirection();
if (dir == 'ltr') {
containerEl.scrollLeft = 0;
}
else {
containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;
}
}
};
/**
* Moves the focus towards the beginning or the end of the list depending on the offset provided.
* Valid offsets are 1 and -1.
*/
/**
* Moves the focus towards the beginning or the end of the list depending on the offset provided.
* Valid offsets are 1 and -1.
* @param {?} offset
* @return {?}
*/
MatTabHeader.prototype._moveFocus = /**
* Moves the focus towards the beginning or the end of the list depending on the offset provided.
* Valid offsets are 1 and -1.
* @param {?} offset
* @return {?}
*/
function (offset) {
if (this._labelWrappers) {
var /** @type {?} */ tabs = this._labelWrappers.toArray();
for (var /** @type {?} */ i = this.focusIndex + offset; i < tabs.length && i >= 0; i += offset) {
if (this._isValidIndex(i)) {
this.focusIndex = i;
return;
}
}
}
};
/** Increment the focus index by 1 until a valid tab is found. */
/**
* Increment the focus index by 1 until a valid tab is found.
* @return {?}
*/
MatTabHeader.prototype._focusNextTab = /**
* Increment the focus index by 1 until a valid tab is found.
* @return {?}
*/
function () {
this._moveFocus(this._getLayoutDirection() == 'ltr' ? 1 : -1);
};
/** Decrement the focus index by 1 until a valid tab is found. */
/**
* Decrement the focus index by 1 until a valid tab is found.
* @return {?}
*/
MatTabHeader.prototype._focusPreviousTab = /**
* Decrement the focus index by 1 until a valid tab is found.
* @return {?}
*/
function () {
this._moveFocus(this._getLayoutDirection() == 'ltr' ? -1 : 1);
};
/**
* Focuses the first tab.
* @return {?}
*/
MatTabHeader.prototype._focusFirstTab = /**
* Focuses the first tab.
* @return {?}
*/
function () {
for (var /** @type {?} */ i = 0; i < this._labelWrappers.length; i++) {
if (this._isValidIndex(i)) {
this.focusIndex = i;
break;
}
}
};
/**
* Focuses the last tab.
* @return {?}
*/
MatTabHeader.prototype._focusLastTab = /**
* Focuses the last tab.
* @return {?}
*/
function () {
for (var /** @type {?} */ i = this._labelWrappers.length - 1; i > -1; i--) {
if (this._isValidIndex(i)) {
this.focusIndex = i;
break;
}
}
};
/** The layout direction of the containing app. */
/**
* The layout direction of the containing app.
* @return {?}
*/
MatTabHeader.prototype._getLayoutDirection = /**
* The layout direction of the containing app.
* @return {?}
*/
function () {
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
};
/** Performs the CSS transformation on the tab list that will cause the list to scroll. */
/**
* Performs the CSS transformation on the tab list that will cause the list to scroll.
* @return {?}
*/
MatTabHeader.prototype._updateTabScrollPosition = /**
* Performs the CSS transformation on the tab list that will cause the list to scroll.
* @return {?}
*/
function () {
var /** @type {?} */ scrollDistance = this.scrollDistance;
var /** @type {?} */ translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
this._tabList.nativeElement.style.transform = "translate3d(" + translateX + "px, 0, 0)";
};
Object.defineProperty(MatTabHeader.prototype, "scrollDistance", {
/** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
get: /**
* Sets the distance in pixels that the tab header should be transformed in the X-axis.
* @return {?}
*/
function () { return this._scrollDistance; },
set: /**
* @param {?} v
* @return {?}
*/
function (v) {
this._scrollDistance = Math.max(0, Math.min(this._getMaxScrollDistance(), v));
// Mark that the scroll distance has changed so that after the view is checked, the CSS
// transformation can move the header.
this._scrollDistanceChanged = true;
this._checkScrollingControls();
},
enumerable: true,
configurable: true
});
/**
* Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
* the end of the list, respectively). The distance to scroll is computed to be a third of the
* length of the tab list view window.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
*/
/**
* Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
* the end of the list, respectively). The distance to scroll is computed to be a third of the
* length of the tab list view window.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
* @param {?} scrollDir
* @return {?}
*/
MatTabHeader.prototype._scrollHeader = /**
* Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
* the end of the list, respectively). The distance to scroll is computed to be a third of the
* length of the tab list view window.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
* @param {?} scrollDir
* @return {?}
*/
function (scrollDir) {
var /** @type {?} */ viewLength = this._tabListContainer.nativeElement.offsetWidth;
// Move the scroll distance one-third the length of the tab list's viewport.
this.scrollDistance += (scrollDir == 'before' ? -1 : 1) * viewLength / 3;
};
/**
* Moves the tab list such that the desired tab label (marked by index) is moved into view.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
*/
/**
* Moves the tab list such that the desired tab label (marked by index) is moved into view.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
* @param {?} labelIndex
* @return {?}
*/
MatTabHeader.prototype._scrollToLabel = /**
* Moves the tab list such that the desired tab label (marked by index) is moved into view.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
* @param {?} labelIndex
* @return {?}
*/
function (labelIndex) {
var /** @type {?} */ selectedLabel = this._labelWrappers ? this._labelWrappers.toArray()[labelIndex] : null;
if (!selectedLabel) {
return;
}
// The view length is the visible width of the tab labels.
var /** @type {?} */ viewLength = this._tabListContainer.nativeElement.offsetWidth;
var /** @type {?} */ labelBeforePos, /** @type {?} */ labelAfterPos;
if (this._getLayoutDirection() == 'ltr') {
labelBeforePos = selectedLabel.getOffsetLeft();
labelAfterPos = labelBeforePos + selectedLabel.getOffsetWidth();
}
else {
labelAfterPos = this._tabList.nativeElement.offsetWidth - selectedLabel.getOffsetLeft();
labelBeforePos = labelAfterPos - selectedLabel.getOffsetWidth();
}
var /** @type {?} */ beforeVisiblePos = this.scrollDistance;
var /** @type {?} */ afterVisiblePos = this.scrollDistance + viewLength;
if (labelBeforePos < beforeVisiblePos) {
// Scroll header to move label to the before direction
this.scrollDistance -= beforeVisiblePos - labelBeforePos + EXAGGERATED_OVERSCROLL;
}
else if (labelAfterPos > afterVisiblePos) {
// Scroll header to move label to the after direction
this.scrollDistance += labelAfterPos - afterVisiblePos + EXAGGERATED_OVERSCROLL;
}
};
/**
* Evaluate whether the pagination controls should be displayed. If the scroll width of the
* tab list is wider than the size of the header container, then the pagination controls should
* be shown.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
*/
/**
* Evaluate whether the pagination controls should be displayed. If the scroll width of the
* tab list is wider than the size of the header container, then the pagination controls should
* be shown.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
* @return {?}
*/
MatTabHeader.prototype._checkPaginationEnabled = /**
* Evaluate whether the pagination controls should be displayed. If the scroll width of the
* tab list is wider than the size of the header container, then the pagination controls should
* be shown.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
* @return {?}
*/
function () {
var /** @type {?} */ isEnabled = this._tabList.nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;
if (!isEnabled) {
this.scrollDistance = 0;
}
if (isEnabled !== this._showPaginationControls) {
this._changeDetectorRef.markForCheck();
}
this._showPaginationControls = isEnabled;
};
/**
* Evaluate whether the before and after controls should be enabled or disabled.
* If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
* before button. If the header is at the end of the list (scroll distance is equal to the
* maximum distance we can scroll), then disable the after button.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
*/
/**
* Evaluate whether the before and after controls should be enabled or disabled.
* If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
* before button. If the header is at the end of the list (scroll distance is equal to the
* maximum distance we can scroll), then disable the after button.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
* @return {?}
*/
MatTabHeader.prototype._checkScrollingControls = /**
* Evaluate whether the before and after controls should be enabled or disabled.
* If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
* before button. If the header is at the end of the list (scroll distance is equal to the
* maximum distance we can scroll), then disable the after button.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
* @return {?}
*/
function () {
// Check if the pagination arrows should be activated.
this._disableScrollBefore = this.scrollDistance == 0;
this._disableScrollAfter = this.scrollDistance == this._getMaxScrollDistance();
this._changeDetectorRef.markForCheck();
};
/**
* Determines what is the maximum length in pixels that can be set for the scroll distance. This
* is equal to the difference in width between the tab list container and tab header container.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
*/
/**
* Determines what is the maximum length in pixels that can be set for the scroll distance. This
* is equal to the difference in width between the tab list container and tab header container.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
* @return {?}
*/
MatTabHeader.prototype._getMaxScrollDistance = /**
* Determines what is the maximum length in pixels that can be set for the scroll distance. This
* is equal to the difference in width between the tab list container and tab header container.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
* @return {?}
*/
function () {
var /** @type {?} */ lengthOfTabList = this._tabList.nativeElement.scrollWidth;
var /** @type {?} */ viewLength = this._tabListContainer.nativeElement.offsetWidth;
return (lengthOfTabList - viewLength) || 0;
};
/** Tells the ink-bar to align itself to the current label wrapper */
/**
* Tells the ink-bar to align itself to the current label wrapper
* @return {?}
*/
MatTabHeader.prototype._alignInkBarToSelectedTab = /**
* Tells the ink-bar to align itself to the current label wrapper
* @return {?}
*/
function () {
var /** @type {?} */ selectedLabelWrapper = this._labelWrappers && this._labelWrappers.length ?
this._labelWrappers.toArray()[this.selectedIndex].elementRef.nativeElement :
null;
this._inkBar.alignToElement(selectedLabelWrapper);
};
MatTabHeader.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-tab-header',
template: "<div class=\"mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4\" aria-hidden=\"true\" mat-ripple [matRippleDisabled]=\"_disableScrollBefore || disableRipple\" [class.mat-tab-header-pagination-disabled]=\"_disableScrollBefore\" (click)=\"_scrollHeader('before')\"><div class=\"mat-tab-header-pagination-chevron\"></div></div><div class=\"mat-tab-label-container\" #tabListContainer (keydown)=\"_handleKeydown($event)\"><div class=\"mat-tab-list\" #tabList role=\"tablist\" (cdkObserveContent)=\"_onContentChanges()\"><div class=\"mat-tab-labels\"><ng-content></ng-content></div><mat-ink-bar></mat-ink-bar></div></div><div class=\"mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4\" aria-hidden=\"true\" mat-ripple [matRippleDisabled]=\"_disableScrollAfter || disableRipple\" [class.mat-tab-header-pagination-disabled]=\"_disableScrollAfter\" (click)=\"_scrollHeader('after')\"><div class=\"mat-tab-header-pagination-chevron\"></div></div>",
styles: [".mat-tab-header{display:flex;overflow:hidden;position:relative;flex-shrink:0}.mat-tab-label{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;position:relative}.mat-tab-label:focus{outline:0}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}.mat-tab-label.mat-tab-disabled{cursor:default}.mat-tab-label.mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}@media (max-width:599px){.mat-tab-label{min-width:72px}}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:.5s cubic-bezier(.35,0,.25,1)}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}@media screen and (-ms-high-contrast:active){.mat-ink-bar{outline:solid 2px;height:0}}.mat-tab-header-pagination{position:relative;display:none;justify-content:center;align-items:center;min-width:32px;cursor:pointer;z-index:2}.mat-tab-header-pagination-controls-enabled .mat-tab-header-pagination{display:flex}.mat-tab-header-pagination-before,.mat-tab-header-rtl .mat-tab-header-pagination-after{padding-left:4px}.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(-135deg)}.mat-tab-header-pagination-after,.mat-tab-header-rtl .mat-tab-header-pagination-before{padding-right:4px}.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-before .mat-tab-header-pagination-chevron{transform:rotate(45deg)}.mat-tab-header-pagination-chevron{border-style:solid;border-width:2px 2px 0 0;content:'';height:8px;width:8px}.mat-tab-header-pagination-disabled{box-shadow:none;cursor:default}.mat-tab-label-container{display:flex;flex-grow:1;overflow:hidden;z-index:1}.mat-tab-list{flex-grow:1;position:relative;transition:transform .5s cubic-bezier(.35,0,.25,1)}.mat-tab-labels{display:flex}"],
inputs: ['disableRipple'],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
host: {
'class': 'mat-tab-header',
'[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',
'[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'",
},
},] },
];
/** @nocollapse */
MatTabHeader.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
{ type: _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_10__["ViewportRuler"], },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_6__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
]; };
MatTabHeader.propDecorators = {
"_labelWrappers": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [MatTabLabelWrapper,] },],
"_inkBar": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [MatInkBar,] },],
"_tabListContainer": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: ['tabListContainer',] },],
"_tabList": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: ['tabList',] },],
"selectedIndex": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selectFocusedIndex": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"indexFocused": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
return MatTabHeader;
}(_MatTabHeaderMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Used to generate unique ID's for each tab component
*/
var /** @type {?} */ nextId = 0;
/**
* A simple change event emitted on focus or selection changes.
*/
var /**
* A simple change event emitted on focus or selection changes.
*/
MatTabChangeEvent = /** @class */ (function () {
function MatTabChangeEvent() {
}
return MatTabChangeEvent;
}());
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatTabGroupBase = /** @class */ (function () {
function MatTabGroupBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatTabGroupBase;
}());
var /** @type {?} */ _MatTabGroupMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinColor"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisableRipple"])(MatTabGroupBase), 'primary');
/**
* Material design tab-group component. Supports basic tab pairs (label + content) and includes
* animated ink-bar, keyboard navigation, and screen reader.
* See: https://material.io/design/components/tabs.html
*/
var MatTabGroup = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTabGroup, _super);
function MatTabGroup(elementRef, _changeDetectorRef) {
var _this = _super.call(this, elementRef) || this;
_this._changeDetectorRef = _changeDetectorRef;
/**
* The tab index that should be selected after the content has been checked.
*/
_this._indexToSelect = 0;
/**
* Snapshot of the height of the tab body wrapper before another tab is activated.
*/
_this._tabBodyWrapperHeight = 0;
/**
* Subscription to tabs being added/removed.
*/
_this._tabsSubscription = rxjs__WEBPACK_IMPORTED_MODULE_4__["Subscription"].EMPTY;
/**
* Subscription to changes in the tab labels.
*/
_this._tabLabelSubscription = rxjs__WEBPACK_IMPORTED_MODULE_4__["Subscription"].EMPTY;
_this._dynamicHeight = false;
_this._selectedIndex = null;
/**
* Position of the tab header.
*/
_this.headerPosition = 'above';
/**
* Output to enable support for two-way binding on `[(selectedIndex)]`
*/
_this.selectedIndexChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when focus has changed within a tab group.
*/
_this.focusChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when the body animation has completed
*/
_this.animationDone = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/**
* Event emitted when the tab selection has changed.
*/
_this.selectedTabChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"](true);
_this._groupId = nextId++;
return _this;
}
Object.defineProperty(MatTabGroup.prototype, "dynamicHeight", {
get: /**
* Whether the tab group should grow to the size of the active tab.
* @return {?}
*/
function () { return this._dynamicHeight; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._dynamicHeight = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_8__["coerceBooleanProperty"])(value); },
enumerable: true,
configurable: true
});
Object.defineProperty(MatTabGroup.prototype, "selectedIndex", {
get: /**
* The index of the active tab.
* @return {?}
*/
function () { return this._selectedIndex; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._indexToSelect = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_8__["coerceNumberProperty"])(value, null);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatTabGroup.prototype, "backgroundColor", {
get: /**
* Background color of the tab group.
* @return {?}
*/
function () { return this._backgroundColor; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ nativeElement = this._elementRef.nativeElement;
nativeElement.classList.remove("mat-background-" + this.backgroundColor);
if (value) {
nativeElement.classList.add("mat-background-" + value);
}
this._backgroundColor = value;
},
enumerable: true,
configurable: true
});
/**
* After the content is checked, this component knows what tabs have been defined
* and what the selected index should be. This is where we can know exactly what position
* each tab should be in according to the new selected index, and additionally we know how
* a new selected tab should transition in (from the left or right).
*/
/**
* After the content is checked, this component knows what tabs have been defined
* and what the selected index should be. This is where we can know exactly what position
* each tab should be in according to the new selected index, and additionally we know how
* a new selected tab should transition in (from the left or right).
* @return {?}
*/
MatTabGroup.prototype.ngAfterContentChecked = /**
* After the content is checked, this component knows what tabs have been defined
* and what the selected index should be. This is where we can know exactly what position
* each tab should be in according to the new selected index, and additionally we know how
* a new selected tab should transition in (from the left or right).
* @return {?}
*/
function () {
var _this = this;
// Clamp the next selected index to the boundsof 0 and the tabs length.
// Note the `|| 0`, which ensures that values like NaN can't get through
// and which would otherwise throw the component into an infinite loop
// (since Math.max(NaN, 0) === NaN).
var /** @type {?} */ indexToSelect = this._indexToSelect =
Math.min(this._tabs.length - 1, Math.max(this._indexToSelect || 0, 0));
// If there is a change in selected index, emit a change event. Should not trigger if
// the selected index has not yet been initialized.
if (this._selectedIndex != indexToSelect && this._selectedIndex != null) {
var /** @type {?} */ tabChangeEvent = this._createChangeEvent(indexToSelect);
this.selectedTabChange.emit(tabChangeEvent);
// Emitting this value after change detection has run
// since the checked content may contain this variable'
Promise.resolve().then(function () { return _this.selectedIndexChange.emit(indexToSelect); });
}
// Setup the position for each tab and optionally setup an origin on the next selected tab.
this._tabs.forEach(function (tab, index) {
tab.position = index - indexToSelect;
tab.isActive = index === indexToSelect;
// If there is already a selected tab, then set up an origin for the next selected tab
// if it doesn't have one already.
if (_this._selectedIndex != null && tab.position == 0 && !tab.origin) {
tab.origin = indexToSelect - _this._selectedIndex;
}
});
if (this._selectedIndex !== indexToSelect) {
this._selectedIndex = indexToSelect;
this._changeDetectorRef.markForCheck();
}
};
/**
* @return {?}
*/
MatTabGroup.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
this._subscribeToTabLabels();
// Subscribe to changes in the amount of tabs, in order to be
// able to re-render the content as new tabs are added or removed.
this._tabsSubscription = this._tabs.changes.subscribe(function () {
_this._subscribeToTabLabels();
_this._changeDetectorRef.markForCheck();
});
};
/**
* @return {?}
*/
MatTabGroup.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._tabsSubscription.unsubscribe();
this._tabLabelSubscription.unsubscribe();
};
/** Re-aligns the ink bar to the selected tab element. */
/**
* Re-aligns the ink bar to the selected tab element.
* @return {?}
*/
MatTabGroup.prototype.realignInkBar = /**
* Re-aligns the ink bar to the selected tab element.
* @return {?}
*/
function () {
if (this._tabHeader) {
this._tabHeader._alignInkBarToSelectedTab();
}
};
/**
* @param {?} index
* @return {?}
*/
MatTabGroup.prototype._focusChanged = /**
* @param {?} index
* @return {?}
*/
function (index) {
this.focusChange.emit(this._createChangeEvent(index));
};
/**
* @param {?} index
* @return {?}
*/
MatTabGroup.prototype._createChangeEvent = /**
* @param {?} index
* @return {?}
*/
function (index) {
var /** @type {?} */ event = new MatTabChangeEvent;
event.index = index;
if (this._tabs && this._tabs.length) {
event.tab = this._tabs.toArray()[index];
}
return event;
};
/**
* Subscribes to changes in the tab labels. This is needed, because the \@Input for the label is
* on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
* binding to be updated, we need to subscribe to changes in it and trigger change detection
* manually.
* @return {?}
*/
MatTabGroup.prototype._subscribeToTabLabels = /**
* Subscribes to changes in the tab labels. This is needed, because the \@Input for the label is
* on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
* binding to be updated, we need to subscribe to changes in it and trigger change detection
* manually.
* @return {?}
*/
function () {
var _this = this;
if (this._tabLabelSubscription) {
this._tabLabelSubscription.unsubscribe();
}
this._tabLabelSubscription = rxjs__WEBPACK_IMPORTED_MODULE_4__["merge"].apply(void 0, this._tabs.map(function (tab) { return tab._disableChange; }).concat(this._tabs.map(function (tab) { return tab._labelChange; }))).subscribe(function () {
_this._changeDetectorRef.markForCheck();
});
};
/** Returns a unique id for each tab label element */
/**
* Returns a unique id for each tab label element
* @param {?} i
* @return {?}
*/
MatTabGroup.prototype._getTabLabelId = /**
* Returns a unique id for each tab label element
* @param {?} i
* @return {?}
*/
function (i) {
return "mat-tab-label-" + this._groupId + "-" + i;
};
/** Returns a unique id for each tab content element */
/**
* Returns a unique id for each tab content element
* @param {?} i
* @return {?}
*/
MatTabGroup.prototype._getTabContentId = /**
* Returns a unique id for each tab content element
* @param {?} i
* @return {?}
*/
function (i) {
return "mat-tab-content-" + this._groupId + "-" + i;
};
/**
* Sets the height of the body wrapper to the height of the activating tab if dynamic
* height property is true.
*/
/**
* Sets the height of the body wrapper to the height of the activating tab if dynamic
* height property is true.
* @param {?} tabHeight
* @return {?}
*/
MatTabGroup.prototype._setTabBodyWrapperHeight = /**
* Sets the height of the body wrapper to the height of the activating tab if dynamic
* height property is true.
* @param {?} tabHeight
* @return {?}
*/
function (tabHeight) {
if (!this._dynamicHeight || !this._tabBodyWrapperHeight) {
return;
}
var /** @type {?} */ wrapper = this._tabBodyWrapper.nativeElement;
wrapper.style.height = this._tabBodyWrapperHeight + 'px';
// This conditional forces the browser to paint the height so that
// the animation to the new height can have an origin.
if (this._tabBodyWrapper.nativeElement.offsetHeight) {
wrapper.style.height = tabHeight + 'px';
}
};
/** Removes the height of the tab body wrapper. */
/**
* Removes the height of the tab body wrapper.
* @return {?}
*/
MatTabGroup.prototype._removeTabBodyWrapperHeight = /**
* Removes the height of the tab body wrapper.
* @return {?}
*/
function () {
this._tabBodyWrapperHeight = this._tabBodyWrapper.nativeElement.clientHeight;
this._tabBodyWrapper.nativeElement.style.height = '';
this.animationDone.emit();
};
/** Handle click events, setting new selected index if appropriate. */
/**
* Handle click events, setting new selected index if appropriate.
* @param {?} tab
* @param {?} tabHeader
* @param {?} idx
* @return {?}
*/
MatTabGroup.prototype._handleClick = /**
* Handle click events, setting new selected index if appropriate.
* @param {?} tab
* @param {?} tabHeader
* @param {?} idx
* @return {?}
*/
function (tab, tabHeader, idx) {
if (!tab.disabled) {
this.selectedIndex = tabHeader.focusIndex = idx;
}
};
/** Retrieves the tabindex for the tab. */
/**
* Retrieves the tabindex for the tab.
* @param {?} tab
* @param {?} idx
* @return {?}
*/
MatTabGroup.prototype._getTabIndex = /**
* Retrieves the tabindex for the tab.
* @param {?} tab
* @param {?} idx
* @return {?}
*/
function (tab, idx) {
if (tab.disabled) {
return null;
}
return this.selectedIndex === idx ? 0 : -1;
};
MatTabGroup.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-tab-group',
exportAs: 'matTabGroup',
template: "<mat-tab-header #tabHeader [selectedIndex]=\"selectedIndex\" [disableRipple]=\"disableRipple\" (indexFocused)=\"_focusChanged($event)\" (selectFocusedIndex)=\"selectedIndex = $event\"><div class=\"mat-tab-label\" role=\"tab\" matTabLabelWrapper mat-ripple *ngFor=\"let tab of _tabs; let i = index\" [id]=\"_getTabLabelId(i)\" [attr.tabIndex]=\"_getTabIndex(tab, i)\" [attr.aria-controls]=\"_getTabContentId(i)\" [attr.aria-selected]=\"selectedIndex == i\" [class.mat-tab-label-active]=\"selectedIndex == i\" [disabled]=\"tab.disabled\" [matRippleDisabled]=\"tab.disabled || disableRipple\" (click)=\"_handleClick(tab, tabHeader, i)\"><div class=\"mat-tab-label-content\"><ng-template [ngIf]=\"tab.templateLabel\"><ng-template [cdkPortalOutlet]=\"tab.templateLabel\"></ng-template></ng-template><ng-template [ngIf]=\"!tab.templateLabel\">{{tab.textLabel}}</ng-template></div></div></mat-tab-header><div class=\"mat-tab-body-wrapper\" #tabBodyWrapper><mat-tab-body role=\"tabpanel\" *ngFor=\"let tab of _tabs; let i = index\" [id]=\"_getTabContentId(i)\" [attr.aria-labelledby]=\"_getTabLabelId(i)\" [class.mat-tab-body-active]=\"selectedIndex == i\" [content]=\"tab.content\" [position]=\"tab.position\" [origin]=\"tab.origin\" (_onCentered)=\"_removeTabBodyWrapperHeight()\" (_onCentering)=\"_setTabBodyWrapperHeight($event)\"></mat-tab-body></div>",
styles: [".mat-tab-group{display:flex;flex-direction:column}.mat-tab-group.mat-tab-group-inverted-header{flex-direction:column-reverse}.mat-tab-label{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;position:relative}.mat-tab-label:focus{outline:0}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}.mat-tab-label.mat-tab-disabled{cursor:default}.mat-tab-label.mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}@media (max-width:599px){.mat-tab-label{padding:0 12px}}@media (max-width:959px){.mat-tab-label{padding:0 12px}}.mat-tab-group[mat-stretch-tabs] .mat-tab-label{flex-basis:0;flex-grow:1}.mat-tab-body-wrapper{position:relative;overflow:hidden;display:flex;transition:height .5s cubic-bezier(.35,0,.25,1)}.mat-tab-body{top:0;left:0;right:0;bottom:0;position:absolute;display:block;overflow:hidden;flex-basis:100%}.mat-tab-body.mat-tab-body-active{position:relative;overflow-x:hidden;overflow-y:auto;z-index:1;flex-grow:1}.mat-tab-group.mat-tab-group-dynamic-height .mat-tab-body.mat-tab-body-active{overflow-y:hidden}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
inputs: ['color', 'disableRipple'],
host: {
'class': 'mat-tab-group',
'[class.mat-tab-group-dynamic-height]': 'dynamicHeight',
'[class.mat-tab-group-inverted-header]': 'headerPosition === "below"',
},
},] },
];
/** @nocollapse */
MatTabGroup.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
]; };
MatTabGroup.propDecorators = {
"_tabs": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [MatTab,] },],
"_tabBodyWrapper": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: ['tabBodyWrapper',] },],
"_tabHeader": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: ['tabHeader',] },],
"dynamicHeight": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selectedIndex": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"headerPosition": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"backgroundColor": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"selectedIndexChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"focusChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"animationDone": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
"selectedTabChange": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] },],
};
return MatTabGroup;
}(_MatTabGroupMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatTabNavBase = /** @class */ (function () {
function MatTabNavBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatTabNavBase;
}());
var /** @type {?} */ _MatTabNavMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisableRipple"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinColor"])(MatTabNavBase, 'primary'));
/**
* Navigation component matching the styles of the tab group header.
* Provides anchored navigation with animated ink bar.
*/
var MatTabNav = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTabNav, _super);
function MatTabNav(elementRef, _dir, _ngZone, _changeDetectorRef, _viewportRuler) {
var _this = _super.call(this, elementRef) || this;
_this._dir = _dir;
_this._ngZone = _ngZone;
_this._changeDetectorRef = _changeDetectorRef;
_this._viewportRuler = _viewportRuler;
/**
* Subject that emits when the component has been destroyed.
*/
_this._onDestroy = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
return _this;
}
Object.defineProperty(MatTabNav.prototype, "backgroundColor", {
get: /**
* Background color of the tab nav.
* @return {?}
*/
function () { return this._backgroundColor; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
var /** @type {?} */ nativeElement = this._elementRef.nativeElement;
nativeElement.classList.remove("mat-background-" + this.backgroundColor);
if (value) {
nativeElement.classList.add("mat-background-" + value);
}
this._backgroundColor = value;
},
enumerable: true,
configurable: true
});
/**
* Notifies the component that the active link has been changed.
* @deletion-target 7.0.0 `element` parameter to be removed.
*/
/**
* Notifies the component that the active link has been changed.
* \@deletion-target 7.0.0 `element` parameter to be removed.
* @param {?} element
* @return {?}
*/
MatTabNav.prototype.updateActiveLink = /**
* Notifies the component that the active link has been changed.
* \@deletion-target 7.0.0 `element` parameter to be removed.
* @param {?} element
* @return {?}
*/
function (element) {
// Note: keeping the `element` for backwards-compat, but isn't being used for anything.
// @deletion-target 7.0.0
this._activeLinkChanged = !!element;
this._changeDetectorRef.markForCheck();
};
/**
* @return {?}
*/
MatTabNav.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
var _this = this;
this._ngZone.runOutsideAngular(function () {
var /** @type {?} */ dirChange = _this._dir ? _this._dir.change : Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["of"])(null);
return Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["merge"])(dirChange, _this._viewportRuler.change(10))
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["takeUntil"])(_this._onDestroy))
.subscribe(function () { return _this._alignInkBar(); });
});
};
/** Checks if the active link has been changed and, if so, will update the ink bar. */
/**
* Checks if the active link has been changed and, if so, will update the ink bar.
* @return {?}
*/
MatTabNav.prototype.ngAfterContentChecked = /**
* Checks if the active link has been changed and, if so, will update the ink bar.
* @return {?}
*/
function () {
if (this._activeLinkChanged) {
var /** @type {?} */ activeTab = this._tabLinks.find(function (tab) { return tab.active; });
this._activeLinkElement = activeTab ? activeTab._elementRef : null;
this._alignInkBar();
this._activeLinkChanged = false;
}
};
/**
* @return {?}
*/
MatTabNav.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._onDestroy.next();
this._onDestroy.complete();
};
/** Aligns the ink bar to the active link. */
/**
* Aligns the ink bar to the active link.
* @return {?}
*/
MatTabNav.prototype._alignInkBar = /**
* Aligns the ink bar to the active link.
* @return {?}
*/
function () {
if (this._activeLinkElement) {
this._inkBar.show();
this._inkBar.alignToElement(this._activeLinkElement.nativeElement);
}
else {
this._inkBar.hide();
}
};
MatTabNav.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: '[mat-tab-nav-bar]',
exportAs: 'matTabNavBar, matTabNav',
inputs: ['color', 'disableRipple'],
template: "<div class=\"mat-tab-links\" (cdkObserveContent)=\"_alignInkBar()\"><ng-content></ng-content><mat-ink-bar></mat-ink-bar></div>",
styles: [".mat-tab-nav-bar{overflow:hidden;position:relative;flex-shrink:0}.mat-tab-links{position:relative;display:flex}.mat-tab-link{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;vertical-align:top;text-decoration:none;position:relative;overflow:hidden}.mat-tab-link:focus{outline:0}.mat-tab-link:focus:not(.mat-tab-disabled){opacity:1}.mat-tab-link.mat-tab-disabled{cursor:default}.mat-tab-link.mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}[mat-stretch-tabs] .mat-tab-link{flex-basis:0;flex-grow:1}@media (max-width:599px){.mat-tab-link{min-width:72px}}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:.5s cubic-bezier(.35,0,.25,1)}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}@media screen and (-ms-high-contrast:active){.mat-ink-bar{outline:solid 2px;height:0}}"],
host: { 'class': 'mat-tab-nav-bar' },
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
},] },
];
/** @nocollapse */
MatTabNav.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_6__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] },] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
{ type: _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_10__["ViewportRuler"], },
]; };
MatTabNav.propDecorators = {
"_inkBar": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [MatInkBar,] },],
"_tabLinks": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(function () { return MatTabLink; }), { descendants: true },] },],
"backgroundColor": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatTabNav;
}(_MatTabNavMixinBase));
var MatTabLinkBase = /** @class */ (function () {
function MatTabLinkBase() {
}
return MatTabLinkBase;
}());
var /** @type {?} */ _MatTabLinkMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinTabIndex"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisableRipple"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisabled"])(MatTabLinkBase)));
/**
* Link inside of a `mat-tab-nav-bar`.
*/
var MatTabLink = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTabLink, _super);
function MatTabLink(_tabNavBar, _elementRef, ngZone, platform, globalOptions, tabIndex) {
var _this = _super.call(this) || this;
_this._tabNavBar = _tabNavBar;
_this._elementRef = _elementRef;
/**
* Whether the tab link is active or not.
*/
_this._isActive = false;
/**
* Ripple configuration for ripples that are launched on pointer down.
* \@docs-private
*/
_this.rippleConfig = {};
_this._tabLinkRipple = new _angular_material_core__WEBPACK_IMPORTED_MODULE_3__["RippleRenderer"](_this, ngZone, _elementRef, platform);
_this._tabLinkRipple.setupTriggerEvents(_elementRef.nativeElement);
_this.tabIndex = parseInt(tabIndex) || 0;
if (globalOptions) {
_this.rippleConfig = {
terminateOnPointerUp: globalOptions.terminateOnPointerUp,
speedFactor: globalOptions.baseSpeedFactor,
animation: globalOptions.animation,
};
}
return _this;
}
Object.defineProperty(MatTabLink.prototype, "active", {
get: /**
* Whether the link is active.
* @return {?}
*/
function () { return this._isActive; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (value !== this._isActive) {
this._isActive = value;
this._tabNavBar.updateActiveLink(this._elementRef);
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatTabLink.prototype, "rippleDisabled", {
/**
* Whether ripples are disabled on interaction
* @docs-private
*/
get: /**
* Whether ripples are disabled on interaction
* \@docs-private
* @return {?}
*/
function () {
return this.disabled || this.disableRipple || this._tabNavBar.disableRipple;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
MatTabLink.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._tabLinkRipple._removeTriggerEvents();
};
/**
* Handles the click event, preventing default navigation if the tab link is disabled.
*/
/**
* Handles the click event, preventing default navigation if the tab link is disabled.
* @param {?} event
* @return {?}
*/
MatTabLink.prototype._handleClick = /**
* Handles the click event, preventing default navigation if the tab link is disabled.
* @param {?} event
* @return {?}
*/
function (event) {
if (this.disabled) {
event.preventDefault();
}
};
MatTabLink.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[mat-tab-link], [matTabLink]',
exportAs: 'matTabLink',
inputs: ['disabled', 'disableRipple', 'tabIndex'],
host: {
'class': 'mat-tab-link',
'[attr.aria-disabled]': 'disabled.toString()',
'[attr.tabIndex]': 'tabIndex',
'[class.mat-tab-disabled]': 'disabled',
'[class.mat-tab-label-active]': 'active',
'(click)': '_handleClick($event)'
}
},] },
];
/** @nocollapse */
MatTabLink.ctorParameters = function () { return [
{ type: MatTabNav, },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_11__["Platform"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["MAT_RIPPLE_GLOBAL_OPTIONS"],] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Attribute"], args: ['tabindex',] },] },
]; };
MatTabLink.propDecorators = {
"active": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatTabLink;
}(_MatTabLinkMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatTabsModule = /** @class */ (function () {
function MatTabsModule() {
}
MatTabsModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_13__["CommonModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["MatCommonModule"],
_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_2__["PortalModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["MatRippleModule"],
_angular_cdk_observers__WEBPACK_IMPORTED_MODULE_12__["ObserversModule"],
],
// Don't export all components because some are only to be used internally.
exports: [
_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["MatCommonModule"],
MatTabGroup,
MatTabLabel,
MatTab,
MatTabNav,
MatTabLink,
MatTabContent,
],
declarations: [
MatTabGroup,
MatTabLabel,
MatTab,
MatInkBar,
MatTabLabelWrapper,
MatTabNav,
MatTabLink,
MatTabBody,
MatTabBodyPortal,
MatTabHeader,
MatTabContent,
],
},] },
];
return MatTabsModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=tabs.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/toolbar.es5.js":
/*!************************************************************!*\
!*** ./node_modules/@angular/material/esm5/toolbar.es5.js ***!
\************************************************************/
/*! exports provided: MatToolbarModule, MatToolbarBase, _MatToolbarMixinBase, MatToolbarRow, MatToolbar, throwToolbarMixedModesError */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatToolbarModule", function() { return MatToolbarModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatToolbarBase", function() { return MatToolbarBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatToolbarMixinBase", function() { return _MatToolbarMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatToolbarRow", function() { return MatToolbarRow; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatToolbar", function() { return MatToolbar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwToolbarMixedModesError", function() { return throwToolbarMixedModesError; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/
MatToolbarBase = /** @class */ (function () {
function MatToolbarBase(_elementRef) {
this._elementRef = _elementRef;
}
return MatToolbarBase;
}());
var /** @type {?} */ _MatToolbarMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["mixinColor"])(MatToolbarBase);
var MatToolbarRow = /** @class */ (function () {
function MatToolbarRow() {
}
MatToolbarRow.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: 'mat-toolbar-row',
exportAs: 'matToolbarRow',
host: { 'class': 'mat-toolbar-row' },
},] },
];
return MatToolbarRow;
}());
var MatToolbar = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MatToolbar, _super);
function MatToolbar(elementRef, _platform, document) {
var _this = _super.call(this, elementRef) || this;
_this._platform = _platform;
// TODO: make the document a required param when doing breaking changes.
// TODO: make the document a required param when doing breaking changes.
_this._document = document;
return _this;
}
/**
* @return {?}
*/
MatToolbar.prototype.ngAfterViewInit = /**
* @return {?}
*/
function () {
var _this = this;
if (!Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["isDevMode"])() || !this._platform.isBrowser) {
return;
}
this._checkToolbarMixedModes();
this._toolbarRows.changes.subscribe(function () { return _this._checkToolbarMixedModes(); });
};
/**
* Throws an exception when developers are attempting to combine the different toolbar row modes.
* @return {?}
*/
MatToolbar.prototype._checkToolbarMixedModes = /**
* Throws an exception when developers are attempting to combine the different toolbar row modes.
* @return {?}
*/
function () {
var _this = this;
if (!this._toolbarRows.length) {
return;
}
// Check if there are any other DOM nodes that can display content but aren't inside of
// a <mat-toolbar-row> element.
var /** @type {?} */ isCombinedUsage = [].slice.call(this._elementRef.nativeElement.childNodes)
.filter(function (node) { return !(node.classList && node.classList.contains('mat-toolbar-row')); })
.filter(function (node) { return node.nodeType !== (_this._document ? _this._document.COMMENT_NODE : 8); })
.some(function (node) { return node.textContent.trim(); });
if (isCombinedUsage) {
throwToolbarMixedModesError();
}
};
MatToolbar.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-toolbar',
exportAs: 'matToolbar',
template: "<ng-content></ng-content><ng-content select=\"mat-toolbar-row\"></ng-content>",
styles: ["@media screen and (-ms-high-contrast:active){.mat-toolbar{outline:solid 1px}}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%}.mat-toolbar-multiple-rows{min-height:64px}.mat-toolbar-row,.mat-toolbar-single-row{height:64px}@media (max-width:599px){.mat-toolbar-multiple-rows{min-height:56px}.mat-toolbar-row,.mat-toolbar-single-row{height:56px}}"],
inputs: ['color'],
host: {
'class': 'mat-toolbar',
'[class.mat-toolbar-multiple-rows]': 'this._toolbarRows.length',
'[class.mat-toolbar-single-row]': '!this._toolbarRows.length'
},
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush,
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
},] },
];
/** @nocollapse */
MatToolbar.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_3__["Platform"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_4__["DOCUMENT"],] },] },
]; };
MatToolbar.propDecorators = {
"_toolbarRows": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [MatToolbarRow,] },],
};
return MatToolbar;
}(_MatToolbarMixinBase));
/**
* Throws an exception when attempting to combine the different toolbar row modes.
* \@docs-private
* @return {?}
*/
function throwToolbarMixedModesError() {
throw Error('MatToolbar: Attempting to combine different toolbar modes. ' +
'Either specify multiple `<mat-toolbar-row>` elements explicitly or just place content ' +
'inside of a `<mat-toolbar>` for a single row.');
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatToolbarModule = /** @class */ (function () {
function MatToolbarModule() {
}
MatToolbarModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
imports: [_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatCommonModule"]],
exports: [MatToolbar, MatToolbarRow, _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["MatCommonModule"]],
declarations: [MatToolbar, MatToolbarRow],
},] },
];
return MatToolbarModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=toolbar.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/tooltip.es5.js":
/*!************************************************************!*\
!*** ./node_modules/@angular/material/esm5/tooltip.es5.js ***!
\************************************************************/
/*! exports provided: MatTooltipModule, SCROLL_THROTTLE_MS, TOOLTIP_PANEL_CLASS, getMatTooltipInvalidPositionError, MAT_TOOLTIP_SCROLL_STRATEGY, MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY, MAT_TOOLTIP_DEFAULT_OPTIONS, MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY, MatTooltip, TooltipComponent, matTooltipAnimations */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTooltipModule", function() { return MatTooltipModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCROLL_THROTTLE_MS", function() { return SCROLL_THROTTLE_MS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TOOLTIP_PANEL_CLASS", function() { return TOOLTIP_PANEL_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatTooltipInvalidPositionError", function() { return getMatTooltipInvalidPositionError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_TOOLTIP_SCROLL_STRATEGY", function() { return MAT_TOOLTIP_SCROLL_STRATEGY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY", function() { return MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_TOOLTIP_DEFAULT_OPTIONS", function() { return MAT_TOOLTIP_DEFAULT_OPTIONS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY", function() { return MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTooltip", function() { return MatTooltip; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TooltipComponent", function() { return TooltipComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matTooltipAnimations", function() { return matTooltipAnimations; });
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js");
/* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js");
/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js");
/* harmony import */ var _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/keycodes */ "./node_modules/@angular/cdk/esm5/keycodes.es5.js");
/* harmony import */ var _angular_cdk_layout__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/layout */ "./node_modules/@angular/cdk/esm5/layout.es5.js");
/* harmony import */ var _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/cdk/overlay */ "./node_modules/@angular/cdk/esm5/overlay.es5.js");
/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm5/platform.es5.js");
/* harmony import */ var _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/cdk/portal */ "./node_modules/@angular/cdk/esm5/portal.es5.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Animations used by MatTooltip.
*/
var /** @type {?} */ matTooltipAnimations = {
/** Animation that transitions a tooltip in and out. */
tooltipState: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["trigger"])('state', [
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["state"])('initial, void, hidden', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({ transform: 'scale(0)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["state"])('visible', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["style"])({ transform: 'scale(1)' })),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["transition"])('* => visible', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["animate"])('150ms cubic-bezier(0.0, 0.0, 0.2, 1)')),
Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["transition"])('* => hidden', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_0__["animate"])('150ms cubic-bezier(0.4, 0.0, 1, 1)')),
])
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Time in ms to throttle repositioning after scroll events.
*/
var /** @type {?} */ SCROLL_THROTTLE_MS = 20;
/**
* CSS class that will be attached to the overlay panel.
*/
var /** @type {?} */ TOOLTIP_PANEL_CLASS = 'mat-tooltip-panel';
/**
* Creates an error to be thrown if the user supplied an invalid tooltip position.
* @param {?} position
* @return {?}
*/
function getMatTooltipInvalidPositionError(position) {
return Error("Tooltip position \"" + position + "\" is invalid.");
}
/**
* Injection token that determines the scroll handling while a tooltip is visible.
*/
var /** @type {?} */ MAT_TOOLTIP_SCROLL_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_11__["InjectionToken"]('mat-tooltip-scroll-strategy', {
providedIn: 'root',
factory: MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY,
});
/**
* \@docs-private
* @return {?}
*/
function MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY() {
var /** @type {?} */ overlay = Object(_angular_core__WEBPACK_IMPORTED_MODULE_11__["inject"])(_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["Overlay"]);
return function () { return overlay.scrollStrategies.reposition({ scrollThrottle: SCROLL_THROTTLE_MS }); };
}
/**
* Injection token to be used to override the default options for `matTooltip`.
*/
var /** @type {?} */ MAT_TOOLTIP_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_11__["InjectionToken"]('mat-tooltip-default-options', {
providedIn: 'root',
factory: MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY
});
/**
* @return {?}
*/
function MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY() {
return {
showDelay: 0,
hideDelay: 0,
touchendHideDelay: 1500,
};
}
/**
* Directive that attaches a material design tooltip to the host element. Animates the showing and
* hiding of a tooltip provided position (defaults to below the element).
*
* https://material.google.com/components/tooltips.html
*/
var MatTooltip = /** @class */ (function () {
function MatTooltip(_overlay, _elementRef, _scrollDispatcher, _viewContainerRef, _ngZone, _platform, _ariaDescriber, _focusMonitor, _scrollStrategy, _dir, _defaultOptions) {
var _this = this;
this._overlay = _overlay;
this._elementRef = _elementRef;
this._scrollDispatcher = _scrollDispatcher;
this._viewContainerRef = _viewContainerRef;
this._ngZone = _ngZone;
this._platform = _platform;
this._ariaDescriber = _ariaDescriber;
this._focusMonitor = _focusMonitor;
this._scrollStrategy = _scrollStrategy;
this._dir = _dir;
this._defaultOptions = _defaultOptions;
this._position = 'below';
this._disabled = false;
/**
* The default delay in ms before showing the tooltip after show is called
*/
this.showDelay = this._defaultOptions.showDelay;
/**
* The default delay in ms before hiding the tooltip after hide is called
*/
this.hideDelay = this._defaultOptions.hideDelay;
this._message = '';
this._manualListeners = new Map();
/**
* Emits when the component is destroyed.
*/
this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_12__["Subject"]();
var /** @type {?} */ element = _elementRef.nativeElement;
// The mouse events shouldn't be bound on iOS devices, because
// they can prevent the first tap from firing its click event.
if (!_platform.IOS) {
this._manualListeners.set('mouseenter', function () { return _this.show(); });
this._manualListeners.set('mouseleave', function () { return _this.hide(); });
this._manualListeners
.forEach(function (listener, event) { return _elementRef.nativeElement.addEventListener(event, listener); });
}
else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
// When we bind a gesture event on an element (in this case `longpress`), HammerJS
// will add some inline styles by default, including `user-select: none`. This is
// problematic on iOS, because it will prevent users from typing in inputs. If
// we're on iOS and the tooltip is attached on an input or textarea, we clear
// the `user-select` to avoid these issues.
element.style.webkitUserSelect = element.style.userSelect = '';
}
_focusMonitor.monitor(element).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["takeUntil"])(this._destroyed)).subscribe(function (origin) {
// Note that the focus monitor runs outside the Angular zone.
if (!origin) {
_ngZone.run(function () { return _this.hide(0); });
}
else if (origin !== 'program') {
_ngZone.run(function () { return _this.show(); });
}
});
}
Object.defineProperty(MatTooltip.prototype, "position", {
get: /**
* Allows the user to define the position of the tooltip relative to the parent element
* @return {?}
*/
function () { return this._position; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (value !== this._position) {
this._position = value;
if (this._overlayRef) {
this._updatePosition();
if (this._tooltipInstance) {
/** @type {?} */ ((this._tooltipInstance)).show(value, 0);
}
this._overlayRef.updatePosition();
}
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatTooltip.prototype, "disabled", {
get: /**
* Disables the display of the tooltip.
* @return {?}
*/
function () { return this._disabled; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._disabled = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__["coerceBooleanProperty"])(value);
// If tooltip is disabled, hide immediately.
if (this._disabled) {
this.hide(0);
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatTooltip.prototype, "message", {
get: /**
* The message to be displayed in the tooltip
* @return {?}
*/
function () { return this._message; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this._message);
// If the message is not a string (e.g. number), convert it to a string and trim it.
this._message = value != null ? ("" + value).trim() : '';
if (!this._message && this._isTooltipVisible()) {
this.hide(0);
}
else {
this._updateTooltipMessage();
this._ariaDescriber.describe(this._elementRef.nativeElement, this.message);
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(MatTooltip.prototype, "tooltipClass", {
get: /**
* Classes to be passed to the tooltip. Supports the same syntax as `ngClass`.
* @return {?}
*/
function () { return this._tooltipClass; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._tooltipClass = value;
if (this._tooltipInstance) {
this._setTooltipClass(this._tooltipClass);
}
},
enumerable: true,
configurable: true
});
/**
* Dispose the tooltip when destroyed.
*/
/**
* Dispose the tooltip when destroyed.
* @return {?}
*/
MatTooltip.prototype.ngOnDestroy = /**
* Dispose the tooltip when destroyed.
* @return {?}
*/
function () {
var _this = this;
if (this._overlayRef) {
this._overlayRef.dispose();
this._tooltipInstance = null;
}
// Clean up the event listeners set in the constructor
if (!this._platform.IOS) {
this._manualListeners.forEach(function (listener, event) {
return _this._elementRef.nativeElement.removeEventListener(event, listener);
});
this._manualListeners.clear();
}
this._destroyed.next();
this._destroyed.complete();
this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this.message);
this._focusMonitor.stopMonitoring(this._elementRef.nativeElement);
};
/** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */
/**
* Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input
* @param {?=} delay
* @return {?}
*/
MatTooltip.prototype.show = /**
* Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input
* @param {?=} delay
* @return {?}
*/
function (delay) {
var _this = this;
if (delay === void 0) { delay = this.showDelay; }
if (this.disabled || !this.message) {
return;
}
var /** @type {?} */ overlayRef = this._createOverlay();
this._detach();
this._portal = this._portal || new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_9__["ComponentPortal"](TooltipComponent, this._viewContainerRef);
this._tooltipInstance = overlayRef.attach(this._portal).instance;
this._tooltipInstance.afterHidden()
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["takeUntil"])(this._destroyed))
.subscribe(function () { return _this._detach(); });
this._setTooltipClass(this._tooltipClass);
this._updateTooltipMessage(); /** @type {?} */
((this._tooltipInstance)).show(this._position, delay);
};
/** Hides the tooltip after the delay in ms, defaults to tooltip-delay-hide or 0ms if no input */
/**
* Hides the tooltip after the delay in ms, defaults to tooltip-delay-hide or 0ms if no input
* @param {?=} delay
* @return {?}
*/
MatTooltip.prototype.hide = /**
* Hides the tooltip after the delay in ms, defaults to tooltip-delay-hide or 0ms if no input
* @param {?=} delay
* @return {?}
*/
function (delay) {
if (delay === void 0) { delay = this.hideDelay; }
if (this._tooltipInstance) {
this._tooltipInstance.hide(delay);
}
};
/** Shows/hides the tooltip */
/**
* Shows/hides the tooltip
* @return {?}
*/
MatTooltip.prototype.toggle = /**
* Shows/hides the tooltip
* @return {?}
*/
function () {
this._isTooltipVisible() ? this.hide() : this.show();
};
/** Returns true if the tooltip is currently visible to the user */
/**
* Returns true if the tooltip is currently visible to the user
* @return {?}
*/
MatTooltip.prototype._isTooltipVisible = /**
* Returns true if the tooltip is currently visible to the user
* @return {?}
*/
function () {
return !!this._tooltipInstance && this._tooltipInstance.isVisible();
};
/** Handles the keydown events on the host element. */
/**
* Handles the keydown events on the host element.
* @param {?} e
* @return {?}
*/
MatTooltip.prototype._handleKeydown = /**
* Handles the keydown events on the host element.
* @param {?} e
* @return {?}
*/
function (e) {
if (this._isTooltipVisible() && e.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_5__["ESCAPE"]) {
e.stopPropagation();
this.hide(0);
}
};
/** Handles the touchend events on the host element. */
/**
* Handles the touchend events on the host element.
* @return {?}
*/
MatTooltip.prototype._handleTouchend = /**
* Handles the touchend events on the host element.
* @return {?}
*/
function () {
this.hide(this._defaultOptions.touchendHideDelay);
};
/**
* Create the overlay config and position strategy
* @return {?}
*/
MatTooltip.prototype._createOverlay = /**
* Create the overlay config and position strategy
* @return {?}
*/
function () {
var _this = this;
if (this._overlayRef) {
return this._overlayRef;
}
var /** @type {?} */ origin = this._getOrigin();
var /** @type {?} */ overlay = this._getOverlayPosition();
var /** @type {?} */ direction = this._dir ? this._dir.value : 'ltr';
// Create connected position strategy that listens for scroll events to reposition.
var /** @type {?} */ strategy = this._overlay.position()
.flexibleConnectedTo(this._elementRef)
.withFlexibleDimensions(false)
.withViewportMargin(8)
.withPositions([
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__assign"])({}, origin.main, overlay.main),
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__assign"])({}, origin.fallback, overlay.fallback)
]);
var /** @type {?} */ scrollableAncestors = this._scrollDispatcher
.getAncestorScrollContainers(this._elementRef);
strategy.withScrollableContainers(scrollableAncestors);
strategy.positionChanges.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["takeUntil"])(this._destroyed)).subscribe(function (change) {
if (_this._tooltipInstance) {
if (change.scrollableViewProperties.isOverlayClipped && _this._tooltipInstance.isVisible()) {
// After position changes occur and the overlay is clipped by
// a parent scrollable then close the tooltip.
// After position changes occur and the overlay is clipped by
// a parent scrollable then close the tooltip.
_this._ngZone.run(function () { return _this.hide(0); });
}
else {
// Otherwise recalculate the origin based on the new position.
// Otherwise recalculate the origin based on the new position.
_this._tooltipInstance._setTransformOrigin(change.connectionPair, direction);
}
}
});
this._overlayRef = this._overlay.create({
direction: direction,
positionStrategy: strategy,
panelClass: TOOLTIP_PANEL_CLASS,
scrollStrategy: this._scrollStrategy()
});
this._overlayRef.detachments()
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["takeUntil"])(this._destroyed))
.subscribe(function () { return _this._detach(); });
return this._overlayRef;
};
/**
* Detaches the currently-attached tooltip.
* @return {?}
*/
MatTooltip.prototype._detach = /**
* Detaches the currently-attached tooltip.
* @return {?}
*/
function () {
if (this._overlayRef && this._overlayRef.hasAttached()) {
this._overlayRef.detach();
}
this._tooltipInstance = null;
};
/**
* Updates the position of the current tooltip.
* @return {?}
*/
MatTooltip.prototype._updatePosition = /**
* Updates the position of the current tooltip.
* @return {?}
*/
function () {
var /** @type {?} */ position = /** @type {?} */ (((this._overlayRef)).getConfig().positionStrategy);
var /** @type {?} */ origin = this._getOrigin();
var /** @type {?} */ overlay = this._getOverlayPosition();
position
.withPositions([
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__assign"])({}, origin.main, overlay.main),
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__assign"])({}, origin.fallback, overlay.fallback)
]);
};
/**
* Returns the origin position and a fallback position based on the user's position preference.
* The fallback position is the inverse of the origin (e.g. `'below' -> 'above'`).
*/
/**
* Returns the origin position and a fallback position based on the user's position preference.
* The fallback position is the inverse of the origin (e.g. `'below' -> 'above'`).
* @return {?}
*/
MatTooltip.prototype._getOrigin = /**
* Returns the origin position and a fallback position based on the user's position preference.
* The fallback position is the inverse of the origin (e.g. `'below' -> 'above'`).
* @return {?}
*/
function () {
var /** @type {?} */ isLtr = !this._dir || this._dir.value == 'ltr';
var /** @type {?} */ position = this.position;
var /** @type {?} */ originPosition;
if (position == 'above' || position == 'below') {
originPosition = { originX: 'center', originY: position == 'above' ? 'top' : 'bottom' };
}
else if (position == 'before' ||
(position == 'left' && isLtr) ||
(position == 'right' && !isLtr)) {
originPosition = { originX: 'start', originY: 'center' };
}
else if (position == 'after' ||
(position == 'right' && isLtr) ||
(position == 'left' && !isLtr)) {
originPosition = { originX: 'end', originY: 'center' };
}
else {
throw getMatTooltipInvalidPositionError(position);
}
var _a = this._invertPosition(originPosition.originX, originPosition.originY), x = _a.x, y = _a.y;
return {
main: originPosition,
fallback: { originX: x, originY: y }
};
};
/** Returns the overlay position and a fallback position based on the user's preference */
/**
* Returns the overlay position and a fallback position based on the user's preference
* @return {?}
*/
MatTooltip.prototype._getOverlayPosition = /**
* Returns the overlay position and a fallback position based on the user's preference
* @return {?}
*/
function () {
var /** @type {?} */ isLtr = !this._dir || this._dir.value == 'ltr';
var /** @type {?} */ position = this.position;
var /** @type {?} */ overlayPosition;
if (position == 'above') {
overlayPosition = { overlayX: 'center', overlayY: 'bottom' };
}
else if (position == 'below') {
overlayPosition = { overlayX: 'center', overlayY: 'top' };
}
else if (position == 'before' ||
(position == 'left' && isLtr) ||
(position == 'right' && !isLtr)) {
overlayPosition = { overlayX: 'end', overlayY: 'center' };
}
else if (position == 'after' ||
(position == 'right' && isLtr) ||
(position == 'left' && !isLtr)) {
overlayPosition = { overlayX: 'start', overlayY: 'center' };
}
else {
throw getMatTooltipInvalidPositionError(position);
}
var _a = this._invertPosition(overlayPosition.overlayX, overlayPosition.overlayY), x = _a.x, y = _a.y;
return {
main: overlayPosition,
fallback: { overlayX: x, overlayY: y }
};
};
/**
* Updates the tooltip message and repositions the overlay according to the new message length
* @return {?}
*/
MatTooltip.prototype._updateTooltipMessage = /**
* Updates the tooltip message and repositions the overlay according to the new message length
* @return {?}
*/
function () {
var _this = this;
// Must wait for the message to be painted to the tooltip so that the overlay can properly
// calculate the correct positioning based on the size of the text.
if (this._tooltipInstance) {
this._tooltipInstance.message = this.message;
this._tooltipInstance._markForCheck();
this._ngZone.onMicrotaskEmpty.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["take"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["takeUntil"])(this._destroyed)).subscribe(function () {
if (_this._tooltipInstance) {
/** @type {?} */ ((_this._overlayRef)).updatePosition();
}
});
}
};
/**
* Updates the tooltip class
* @param {?} tooltipClass
* @return {?}
*/
MatTooltip.prototype._setTooltipClass = /**
* Updates the tooltip class
* @param {?} tooltipClass
* @return {?}
*/
function (tooltipClass) {
if (this._tooltipInstance) {
this._tooltipInstance.tooltipClass = tooltipClass;
this._tooltipInstance._markForCheck();
}
};
/**
* Inverts an overlay position.
* @param {?} x
* @param {?} y
* @return {?}
*/
MatTooltip.prototype._invertPosition = /**
* Inverts an overlay position.
* @param {?} x
* @param {?} y
* @return {?}
*/
function (x, y) {
if (this.position === 'above' || this.position === 'below') {
if (y === 'top') {
y = 'bottom';
}
else if (y === 'bottom') {
y = 'top';
}
}
else {
if (x === 'end') {
x = 'start';
}
else if (x === 'start') {
x = 'end';
}
}
return { x: x, y: y };
};
MatTooltip.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["Directive"], args: [{
selector: '[matTooltip]',
exportAs: 'matTooltip',
host: {
'(longpress)': 'show()',
'(keydown)': '_handleKeydown($event)',
'(touchend)': '_handleTouchend()',
},
},] },
];
/** @nocollapse */
MatTooltip.ctorParameters = function () { return [
{ type: _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["Overlay"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["ElementRef"], },
{ type: _angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["ScrollDispatcher"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["ViewContainerRef"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["NgZone"], },
{ type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_8__["Platform"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_2__["AriaDescriber"], },
{ type: _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_2__["FocusMonitor"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["Inject"], args: [MAT_TOOLTIP_SCROLL_STRATEGY,] },] },
{ type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_3__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["Optional"] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["Inject"], args: [MAT_TOOLTIP_DEFAULT_OPTIONS,] },] },
]; };
MatTooltip.propDecorators = {
"position": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["Input"], args: ['matTooltipPosition',] },],
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["Input"], args: ['matTooltipDisabled',] },],
"showDelay": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["Input"], args: ['matTooltipShowDelay',] },],
"hideDelay": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["Input"], args: ['matTooltipHideDelay',] },],
"message": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["Input"], args: ['matTooltip',] },],
"tooltipClass": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["Input"], args: ['matTooltipClass',] },],
};
return MatTooltip;
}());
/**
* Internal component that wraps the tooltip's content.
* \@docs-private
*/
var TooltipComponent = /** @class */ (function () {
function TooltipComponent(_changeDetectorRef, _breakpointObserver) {
this._changeDetectorRef = _changeDetectorRef;
this._breakpointObserver = _breakpointObserver;
/**
* Property watched by the animation framework to show or hide the tooltip
*/
this._visibility = 'initial';
/**
* Whether interactions on the page should close the tooltip
*/
this._closeOnInteraction = false;
/**
* The transform origin used in the animation for showing and hiding the tooltip
*/
this._transformOrigin = 'bottom';
/**
* Subject for notifying that the tooltip has been hidden from the view
*/
this._onHide = new rxjs__WEBPACK_IMPORTED_MODULE_12__["Subject"]();
/**
* Stream that emits whether the user has a handset-sized display.
*/
this._isHandset = this._breakpointObserver.observe(_angular_cdk_layout__WEBPACK_IMPORTED_MODULE_6__["Breakpoints"].Handset);
}
/**
* Shows the tooltip with an animation originating from the provided origin
* @param position Position of the tooltip.
* @param delay Amount of milliseconds to the delay showing the tooltip.
*/
/**
* Shows the tooltip with an animation originating from the provided origin
* @param {?} position Position of the tooltip.
* @param {?} delay Amount of milliseconds to the delay showing the tooltip.
* @return {?}
*/
TooltipComponent.prototype.show = /**
* Shows the tooltip with an animation originating from the provided origin
* @param {?} position Position of the tooltip.
* @param {?} delay Amount of milliseconds to the delay showing the tooltip.
* @return {?}
*/
function (position, delay) {
var _this = this;
// Cancel the delayed hide if it is scheduled
if (this._hideTimeoutId) {
clearTimeout(this._hideTimeoutId);
}
// Body interactions should cancel the tooltip if there is a delay in showing.
this._closeOnInteraction = true;
this._position = position;
this._showTimeoutId = setTimeout(function () {
_this._visibility = 'visible';
// Mark for check so if any parent component has set the
// ChangeDetectionStrategy to OnPush it will be checked anyways
// Mark for check so if any parent component has set the
// ChangeDetectionStrategy to OnPush it will be checked anyways
_this._markForCheck();
}, delay);
};
/**
* Begins the animation to hide the tooltip after the provided delay in ms.
* @param delay Amount of milliseconds to delay showing the tooltip.
*/
/**
* Begins the animation to hide the tooltip after the provided delay in ms.
* @param {?} delay Amount of milliseconds to delay showing the tooltip.
* @return {?}
*/
TooltipComponent.prototype.hide = /**
* Begins the animation to hide the tooltip after the provided delay in ms.
* @param {?} delay Amount of milliseconds to delay showing the tooltip.
* @return {?}
*/
function (delay) {
var _this = this;
// Cancel the delayed show if it is scheduled
if (this._showTimeoutId) {
clearTimeout(this._showTimeoutId);
}
this._hideTimeoutId = setTimeout(function () {
_this._visibility = 'hidden';
// Mark for check so if any parent component has set the
// ChangeDetectionStrategy to OnPush it will be checked anyways
// Mark for check so if any parent component has set the
// ChangeDetectionStrategy to OnPush it will be checked anyways
_this._markForCheck();
}, delay);
};
/** Returns an observable that notifies when the tooltip has been hidden from view. */
/**
* Returns an observable that notifies when the tooltip has been hidden from view.
* @return {?}
*/
TooltipComponent.prototype.afterHidden = /**
* Returns an observable that notifies when the tooltip has been hidden from view.
* @return {?}
*/
function () {
return this._onHide.asObservable();
};
/** Whether the tooltip is being displayed. */
/**
* Whether the tooltip is being displayed.
* @return {?}
*/
TooltipComponent.prototype.isVisible = /**
* Whether the tooltip is being displayed.
* @return {?}
*/
function () {
return this._visibility === 'visible';
};
/** Sets the tooltip transform origin according to the position of the tooltip overlay. */
/**
* Sets the tooltip transform origin according to the position of the tooltip overlay.
* @param {?} overlayPosition
* @param {?} direction
* @return {?}
*/
TooltipComponent.prototype._setTransformOrigin = /**
* Sets the tooltip transform origin according to the position of the tooltip overlay.
* @param {?} overlayPosition
* @param {?} direction
* @return {?}
*/
function (overlayPosition, direction) {
var /** @type {?} */ axis = (this._position === 'above' || this._position === 'below') ? 'Y' : 'X';
var /** @type {?} */ position = axis == 'X' ? overlayPosition.overlayX : overlayPosition.overlayY;
if (position === 'top' || position === 'bottom') {
this._transformOrigin = position;
}
else if (position === 'start') {
this._transformOrigin = direction === 'ltr' ? 'left' : 'right';
}
else if (position === 'end') {
this._transformOrigin = direction === 'ltr' ? 'right' : 'left';
}
else {
throw getMatTooltipInvalidPositionError(this._position);
}
};
/**
* @return {?}
*/
TooltipComponent.prototype._animationStart = /**
* @return {?}
*/
function () {
this._closeOnInteraction = false;
};
/**
* @param {?} event
* @return {?}
*/
TooltipComponent.prototype._animationDone = /**
* @param {?} event
* @return {?}
*/
function (event) {
var /** @type {?} */ toState = /** @type {?} */ (event.toState);
if (toState === 'hidden' && !this.isVisible()) {
this._onHide.next();
}
if (toState === 'visible' || toState === 'hidden') {
this._closeOnInteraction = true;
}
};
/**
* Interactions on the HTML body should close the tooltip immediately as defined in the
* material design spec.
* https://material.google.com/components/tooltips.html#tooltips-interaction
*/
/**
* Interactions on the HTML body should close the tooltip immediately as defined in the
* material design spec.
* https://material.google.com/components/tooltips.html#tooltips-interaction
* @return {?}
*/
TooltipComponent.prototype._handleBodyInteraction = /**
* Interactions on the HTML body should close the tooltip immediately as defined in the
* material design spec.
* https://material.google.com/components/tooltips.html#tooltips-interaction
* @return {?}
*/
function () {
if (this._closeOnInteraction) {
this.hide(0);
}
};
/**
* Marks that the tooltip needs to be checked in the next change detection run.
* Mainly used for rendering the initial text before positioning a tooltip, which
* can be problematic in components with OnPush change detection.
*/
/**
* Marks that the tooltip needs to be checked in the next change detection run.
* Mainly used for rendering the initial text before positioning a tooltip, which
* can be problematic in components with OnPush change detection.
* @return {?}
*/
TooltipComponent.prototype._markForCheck = /**
* Marks that the tooltip needs to be checked in the next change detection run.
* Mainly used for rendering the initial text before positioning a tooltip, which
* can be problematic in components with OnPush change detection.
* @return {?}
*/
function () {
this._changeDetectorRef.markForCheck();
};
TooltipComponent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["Component"], args: [{selector: 'mat-tooltip-component',
template: "<div class=\"mat-tooltip\" [ngClass]=\"tooltipClass\" [class.mat-tooltip-handset]=\"(_isHandset | async)!.matches\" [style.transform-origin]=\"_transformOrigin\" [@state]=\"_visibility\" (@state.start)=\"_animationStart()\" (@state.done)=\"_animationDone($event)\">{{message}}</div>",
styles: [".mat-tooltip-panel{pointer-events:none!important}.mat-tooltip{color:#fff;border-radius:2px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px}@media screen and (-ms-high-contrast:active){.mat-tooltip{outline:solid 1px}}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_11__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_11__["ChangeDetectionStrategy"].OnPush,
animations: [matTooltipAnimations.tooltipState],
host: {
// Forces the element to have a layout in IE and Edge. This fixes issues where the element
// won't be rendered if the animations are disabled or there is no web animations polyfill.
'[style.zoom]': '_visibility === "visible" ? 1 : null',
'(body:click)': 'this._handleBodyInteraction()',
'aria-hidden': 'true',
}
},] },
];
/** @nocollapse */
TooltipComponent.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["ChangeDetectorRef"], },
{ type: _angular_cdk_layout__WEBPACK_IMPORTED_MODULE_6__["BreakpointObserver"], },
]; };
return TooltipComponent;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var MatTooltipModule = /** @class */ (function () {
function MatTooltipModule() {
}
MatTooltipModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_11__["NgModule"], args: [{
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_13__["CommonModule"],
_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_7__["OverlayModule"],
_angular_material_core__WEBPACK_IMPORTED_MODULE_14__["MatCommonModule"],
],
exports: [MatTooltip, TooltipComponent, _angular_material_core__WEBPACK_IMPORTED_MODULE_14__["MatCommonModule"]],
declarations: [MatTooltip, TooltipComponent],
entryComponents: [TooltipComponent],
},] },
];
return MatTooltipModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=tooltip.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/material/esm5/tree.es5.js":
/*!*********************************************************!*\
!*** ./node_modules/@angular/material/esm5/tree.es5.js ***!
\*********************************************************/
/*! exports provided: _MatTreeNodeMixinBase, _MatNestedTreeNodeMixinBase, MatTreeNode, MatTreeNodeDef, MatNestedTreeNode, MatTreeNodePadding, MatTree, MatTreeModule, MatTreeNodeToggle, MatTreeNodeOutlet, MatTreeFlattener, MatTreeFlatDataSource, MatTreeNestedDataSource */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatTreeNodeMixinBase", function() { return _MatTreeNodeMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_MatNestedTreeNodeMixinBase", function() { return _MatNestedTreeNodeMixinBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeNode", function() { return MatTreeNode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeNodeDef", function() { return MatTreeNodeDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatNestedTreeNode", function() { return MatNestedTreeNode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeNodePadding", function() { return MatTreeNodePadding; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTree", function() { return MatTree; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeModule", function() { return MatTreeModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeNodeToggle", function() { return MatTreeNodeToggle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeNodeOutlet", function() { return MatTreeNodeOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeFlattener", function() { return MatTreeFlattener; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeFlatDataSource", function() { return MatTreeFlatDataSource; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeNestedDataSource", function() { return MatTreeNestedDataSource; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/tree */ "./node_modules/@angular/cdk/esm5/tree.es5.js");
/* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm5/collections.es5.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/**
* @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
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Outlet for nested CdkNode. Put `[matTreeNodeOutlet]` on a tag to place children dataNodes
* inside the outlet.
*/
var MatTreeNodeOutlet = /** @class */ (function () {
function MatTreeNodeOutlet(viewContainer) {
this.viewContainer = viewContainer;
}
MatTreeNodeOutlet.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[matTreeNodeOutlet]'
},] },
];
/** @nocollapse */
MatTreeNodeOutlet.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"], },
]; };
return MatTreeNodeOutlet;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ _MatTreeNodeMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinTabIndex"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisabled"])(_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTreeNode"]));
var /** @type {?} */ _MatNestedTreeNodeMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinTabIndex"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisabled"])(_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkNestedTreeNode"]));
/**
* Wrapper for the CdkTree node with Material design styles.
* @template T
*/
var MatTreeNode = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTreeNode, _super);
function MatTreeNode(_elementRef, _tree, tabIndex) {
var _this = _super.call(this, _elementRef, _tree) || this;
_this._elementRef = _elementRef;
_this._tree = _tree;
_this.role = 'treeitem';
_this.tabIndex = Number(tabIndex) || 0;
return _this;
}
MatTreeNode.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'mat-tree-node',
exportAs: 'matTreeNode',
inputs: ['disabled', 'tabIndex'],
host: {
'[attr.aria-expanded]': 'isExpanded',
'[attr.aria-level]': 'role === "treeitem" ? level : null',
'[attr.role]': 'role',
'class': 'mat-tree-node'
},
providers: [{ provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTreeNode"], useExisting: MatTreeNode }]
},] },
];
/** @nocollapse */
MatTreeNode.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTree"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Attribute"], args: ['tabindex',] },] },
]; };
MatTreeNode.propDecorators = {
"role": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
};
return MatTreeNode;
}(_MatTreeNodeMixinBase));
/**
* Wrapper for the CdkTree node definition with Material design styles.
* @template T
*/
var MatTreeNodeDef = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTreeNodeDef, _super);
function MatTreeNodeDef() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatTreeNodeDef.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[matTreeNodeDef]',
inputs: [
'when: matTreeNodeDefWhen'
],
providers: [{ provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTreeNodeDef"], useExisting: MatTreeNodeDef }]
},] },
];
/** @nocollapse */
MatTreeNodeDef.propDecorators = {
"data": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matTreeNode',] },],
};
return MatTreeNodeDef;
}(_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTreeNodeDef"]));
/**
* Wrapper for the CdkTree nested node with Material design styles.
* @template T
*/
var MatNestedTreeNode = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatNestedTreeNode, _super);
function MatNestedTreeNode(_elementRef, _tree, _differs, tabIndex) {
var _this = _super.call(this, _elementRef, _tree, _differs) || this;
_this._elementRef = _elementRef;
_this._tree = _tree;
_this._differs = _differs;
_this.tabIndex = Number(tabIndex) || 0;
return _this;
}
// This is a workaround for https://github.com/angular/angular/issues/23091
// In aot mode, the lifecycle hooks from parent class are not called.
// TODO(tinayuangao): Remove when the angular issue #23091 is fixed
/**
* @return {?}
*/
MatNestedTreeNode.prototype.ngAfterContentInit = /**
* @return {?}
*/
function () {
_super.prototype.ngAfterContentInit.call(this);
};
/**
* @return {?}
*/
MatNestedTreeNode.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
_super.prototype.ngOnDestroy.call(this);
};
MatNestedTreeNode.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: 'mat-nested-tree-node',
exportAs: 'matNestedTreeNode',
host: {
'[attr.aria-expanded]': 'isExpanded',
'[attr.role]': 'role',
'class': 'mat-nested-tree-node',
},
inputs: ['disabled', 'tabIndex'],
providers: [
{ provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkNestedTreeNode"], useExisting: MatNestedTreeNode },
{ provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTreeNode"], useExisting: MatNestedTreeNode }
]
},] },
];
/** @nocollapse */
MatNestedTreeNode.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTree"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"], },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Attribute"], args: ['tabindex',] },] },
]; };
MatNestedTreeNode.propDecorators = {
"node": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matNestedTreeNode',] },],
"nodeOutlet": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ContentChildren"], args: [MatTreeNodeOutlet,] },],
};
return MatNestedTreeNode;
}(_MatNestedTreeNodeMixinBase));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Wrapper for the CdkTree padding with Material design styles.
* @template T
*/
var MatTreeNodePadding = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTreeNodePadding, _super);
function MatTreeNodePadding() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatTreeNodePadding.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[matTreeNodePadding]',
providers: [{ provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTreeNodePadding"], useExisting: MatTreeNodePadding }]
},] },
];
/** @nocollapse */
MatTreeNodePadding.propDecorators = {
"level": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matTreeNodePadding',] },],
"indent": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matTreeNodePaddingIndent',] },],
};
return MatTreeNodePadding;
}(_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTreeNodePadding"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Wrapper for the CdkTable with Material design styles.
* @template T
*/
var MatTree = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTree, _super);
function MatTree() {
return _super !== null && _super.apply(this, arguments) || this;
}
MatTree.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-tree',
exportAs: 'matTree',
template: "<ng-container matTreeNodeOutlet></ng-container>",
host: {
'class': 'mat-tree',
'role': 'tree',
},
styles: [".mat-tree{display:block}.mat-tree-node{display:flex;align-items:center;min-height:48px;flex:1;overflow:hidden;word-wrap:break-word}.mat-nested-tree-ndoe{border-bottom-width:0}"],
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
providers: [{ provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTree"], useExisting: MatTree }]
},] },
];
/** @nocollapse */
MatTree.propDecorators = {
"_nodeOutlet": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [MatTreeNodeOutlet,] },],
};
return MatTree;
}(_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTree"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Wrapper for the CdkTree's toggle with Material design styles.
* @template T
*/
var MatTreeNodeToggle = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTreeNodeToggle, _super);
function MatTreeNodeToggle() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.recursive = false;
return _this;
}
MatTreeNodeToggle.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[matTreeNodeToggle]',
host: {
'(click)': '_toggle($event)',
},
providers: [{ provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTreeNodeToggle"], useExisting: MatTreeNodeToggle }]
},] },
];
/** @nocollapse */
MatTreeNodeToggle.propDecorators = {
"recursive": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['matTreeNodeToggleRecursive',] },],
};
return MatTreeNodeToggle;
}(_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTreeNodeToggle"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ MAT_TREE_DIRECTIVES = [
MatNestedTreeNode,
MatTreeNodeDef,
MatTreeNodePadding,
MatTreeNodeToggle,
MatTree,
MatTreeNode,
MatTreeNodeOutlet
];
var MatTreeModule = /** @class */ (function () {
function MatTreeModule() {
}
MatTreeModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_2__["CdkTreeModule"], _angular_common__WEBPACK_IMPORTED_MODULE_4__["CommonModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_3__["MatCommonModule"]],
exports: MAT_TREE_DIRECTIVES,
declarations: MAT_TREE_DIRECTIVES,
},] },
];
return MatTreeModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Tree flattener to convert a normal type of node to node with children & level information.
* Transform nested nodes of type `T` to flattened nodes of type `F`.
*
* For example, the input data of type `T` is nested, and contains its children data:
* SomeNode: {
* key: 'Fruits',
* children: [
* NodeOne: {
* key: 'Apple',
* },
* NodeTwo: {
* key: 'Pear',
* }
* ]
* }
* After flattener flatten the tree, the structure will become
* SomeNode: {
* key: 'Fruits',
* expandable: true,
* level: 1
* },
* NodeOne: {
* key: 'Apple',
* expandable: false,
* level: 2
* },
* NodeTwo: {
* key: 'Pear',
* expandable: false,
* level: 2
* }
* and the output flattened type is `F` with additional information.
* @template T, F
*/
var /**
* Tree flattener to convert a normal type of node to node with children & level information.
* Transform nested nodes of type `T` to flattened nodes of type `F`.
*
* For example, the input data of type `T` is nested, and contains its children data:
* SomeNode: {
* key: 'Fruits',
* children: [
* NodeOne: {
* key: 'Apple',
* },
* NodeTwo: {
* key: 'Pear',
* }
* ]
* }
* After flattener flatten the tree, the structure will become
* SomeNode: {
* key: 'Fruits',
* expandable: true,
* level: 1
* },
* NodeOne: {
* key: 'Apple',
* expandable: false,
* level: 2
* },
* NodeTwo: {
* key: 'Pear',
* expandable: false,
* level: 2
* }
* and the output flattened type is `F` with additional information.
* @template T, F
*/
MatTreeFlattener = /** @class */ (function () {
function MatTreeFlattener(transformFunction, getLevel, isExpandable, getChildren) {
this.transformFunction = transformFunction;
this.getLevel = getLevel;
this.isExpandable = isExpandable;
this.getChildren = getChildren;
}
/**
* @param {?} node
* @param {?} level
* @param {?} resultNodes
* @param {?} parentMap
* @return {?}
*/
MatTreeFlattener.prototype._flattenNode = /**
* @param {?} node
* @param {?} level
* @param {?} resultNodes
* @param {?} parentMap
* @return {?}
*/
function (node, level, resultNodes, parentMap) {
var _this = this;
var /** @type {?} */ flatNode = this.transformFunction(node, level);
resultNodes.push(flatNode);
if (this.isExpandable(flatNode)) {
this.getChildren(node).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["take"])(1)).subscribe(function (children) {
children.forEach(function (child, index) {
var /** @type {?} */ childParentMap = parentMap.slice();
childParentMap.push(index != children.length - 1);
_this._flattenNode(child, level + 1, resultNodes, childParentMap);
});
});
}
return resultNodes;
};
/**
* Flatten a list of node type T to flattened version of node F.
* Please note that type T may be nested, and the length of `structuredData` may be different
* from that of returned list `F[]`.
*/
/**
* Flatten a list of node type T to flattened version of node F.
* Please note that type T may be nested, and the length of `structuredData` may be different
* from that of returned list `F[]`.
* @param {?} structuredData
* @return {?}
*/
MatTreeFlattener.prototype.flattenNodes = /**
* Flatten a list of node type T to flattened version of node F.
* Please note that type T may be nested, and the length of `structuredData` may be different
* from that of returned list `F[]`.
* @param {?} structuredData
* @return {?}
*/
function (structuredData) {
var _this = this;
var /** @type {?} */ resultNodes = [];
structuredData.forEach(function (node) { return _this._flattenNode(node, 0, resultNodes, []); });
return resultNodes;
};
/**
* Expand flattened node with current expansion status.
* The returned list may have different length.
*/
/**
* Expand flattened node with current expansion status.
* The returned list may have different length.
* @param {?} nodes
* @param {?} treeControl
* @return {?}
*/
MatTreeFlattener.prototype.expandFlattenedNodes = /**
* Expand flattened node with current expansion status.
* The returned list may have different length.
* @param {?} nodes
* @param {?} treeControl
* @return {?}
*/
function (nodes, treeControl) {
var _this = this;
var /** @type {?} */ results = [];
var /** @type {?} */ currentExpand = [];
currentExpand[0] = true;
nodes.forEach(function (node) {
var /** @type {?} */ expand = true;
for (var /** @type {?} */ i = 0; i <= _this.getLevel(node); i++) {
expand = expand && currentExpand[i];
}
if (expand) {
results.push(node);
}
if (_this.isExpandable(node)) {
currentExpand[_this.getLevel(node) + 1] = treeControl.isExpanded(node);
}
});
return results;
};
return MatTreeFlattener;
}());
/**
* Data source for flat tree.
* The data source need to handle expansion/collapsion of the tree node and change the data feed
* to `MatTree`.
* The nested tree nodes of type `T` are flattened through `MatTreeFlattener`, and converted
* to type `F` for `MatTree` to consume.
* @template T, F
*/
var /**
* Data source for flat tree.
* The data source need to handle expansion/collapsion of the tree node and change the data feed
* to `MatTree`.
* The nested tree nodes of type `T` are flattened through `MatTreeFlattener`, and converted
* to type `F` for `MatTree` to consume.
* @template T, F
*/
MatTreeFlatDataSource = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTreeFlatDataSource, _super);
function MatTreeFlatDataSource(treeControl, treeFlattener, initialData) {
if (initialData === void 0) { initialData = []; }
var _this = _super.call(this) || this;
_this.treeControl = treeControl;
_this.treeFlattener = treeFlattener;
_this._flattenedData = new rxjs__WEBPACK_IMPORTED_MODULE_6__["BehaviorSubject"]([]);
_this._expandedData = new rxjs__WEBPACK_IMPORTED_MODULE_6__["BehaviorSubject"]([]);
_this._data = new rxjs__WEBPACK_IMPORTED_MODULE_6__["BehaviorSubject"](initialData);
return _this;
}
Object.defineProperty(MatTreeFlatDataSource.prototype, "data", {
get: /**
* @return {?}
*/
function () { return this._data.value; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this._data.next(value);
this._flattenedData.next(this.treeFlattener.flattenNodes(this.data));
this.treeControl.dataNodes = this._flattenedData.value;
},
enumerable: true,
configurable: true
});
/**
* @param {?} collectionViewer
* @return {?}
*/
MatTreeFlatDataSource.prototype.connect = /**
* @param {?} collectionViewer
* @return {?}
*/
function (collectionViewer) {
var _this = this;
var /** @type {?} */ changes = [
collectionViewer.viewChange,
/** @type {?} */ ((this.treeControl.expansionModel.onChange)),
this._flattenedData
];
return rxjs__WEBPACK_IMPORTED_MODULE_6__["merge"].apply(void 0, changes).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["map"])(function () {
_this._expandedData.next(_this.treeFlattener.expandFlattenedNodes(_this._flattenedData.value, _this.treeControl));
return _this._expandedData.value;
}));
};
/**
* @return {?}
*/
MatTreeFlatDataSource.prototype.disconnect = /**
* @return {?}
*/
function () {
// no op
};
return MatTreeFlatDataSource;
}(_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_5__["DataSource"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* Data source for nested tree.
*
* The data source for nested tree doesn't have to consider node flattener, or the way to expand
* or collapse. The expansion/collapsion will be handled by TreeControl and each non-leaf node.
* @template T
*/
var /**
* Data source for nested tree.
*
* The data source for nested tree doesn't have to consider node flattener, or the way to expand
* or collapse. The expansion/collapsion will be handled by TreeControl and each non-leaf node.
* @template T
*/
MatTreeNestedDataSource = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(MatTreeNestedDataSource, _super);
function MatTreeNestedDataSource() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._data = new rxjs__WEBPACK_IMPORTED_MODULE_6__["BehaviorSubject"]([]);
return _this;
}
Object.defineProperty(MatTreeNestedDataSource.prototype, "data", {
/**
* Data for the nested treee
*/
get: /**
* Data for the nested treee
* @return {?}
*/
function () { return this._data.value; },
set: /**
* @param {?} value
* @return {?}
*/
function (value) { this._data.next(value); },
enumerable: true,
configurable: true
});
/**
* @param {?} collectionViewer
* @return {?}
*/
MatTreeNestedDataSource.prototype.connect = /**
* @param {?} collectionViewer
* @return {?}
*/
function (collectionViewer) {
var _this = this;
return rxjs__WEBPACK_IMPORTED_MODULE_6__["merge"].apply(void 0, [collectionViewer.viewChange, this._data]).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["map"])(function () {
return _this.data;
}));
};
/**
* @return {?}
*/
MatTreeNestedDataSource.prototype.disconnect = /**
* @return {?}
*/
function () {
// no op
};
return MatTreeNestedDataSource;
}(_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_5__["DataSource"]));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=tree.es5.js.map
/***/ }),
/***/ "./node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js":
/*!******************************************************************************************!*\
!*** ./node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js ***!
\******************************************************************************************/
/*! exports provided: ɵangular_packages_platform_browser_dynamic_platform_browser_dynamic_a, RESOURCE_CACHE_PROVIDER, platformBrowserDynamic, VERSION, JitCompilerFactory, ɵCompilerImpl, ɵplatformCoreDynamic, ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, ɵResourceLoaderImpl */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_dynamic_platform_browser_dynamic_a", function() { return CachedResourceLoader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_CACHE_PROVIDER", function() { return RESOURCE_CACHE_PROVIDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "platformBrowserDynamic", function() { return platformBrowserDynamic; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JitCompilerFactory", function() { return JitCompilerFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCompilerImpl", function() { return CompilerImpl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵplatformCoreDynamic", function() { return platformCoreDynamic; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS", function() { return INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵResourceLoaderImpl", function() { return ResourceLoaderImpl; });
/* harmony import */ var _angular_compiler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/compiler */ "./node_modules/@angular/compiler/fesm5/compiler.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/fesm5/platform-browser.js");
/**
* @license Angular v6.0.9
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
/**
* @license
* Copyright Google Inc. 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 MODULE_SUFFIX = '';
var builtinExternalReferences = createBuiltinExternalReferencesMap();
var JitReflector = /** @class */ (function () {
function JitReflector() {
this.builtinExternalReferences = new Map();
this.reflectionCapabilities = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵReflectionCapabilities"]();
}
JitReflector.prototype.componentModuleUrl = function (type, cmpMetadata) {
var moduleId = cmpMetadata.moduleId;
if (typeof moduleId === 'string') {
var scheme = Object(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["getUrlScheme"])(moduleId);
return scheme ? moduleId : "package:" + moduleId + MODULE_SUFFIX;
}
else if (moduleId !== null && moduleId !== void 0) {
throw Object(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["syntaxError"])("moduleId should be a string in \"" + Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵstringify"])(type) + "\". See https://goo.gl/wIDDiL for more information.\n" +
"If you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.");
}
return "./" + Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵstringify"])(type);
};
JitReflector.prototype.parameters = function (typeOrFunc) {
return this.reflectionCapabilities.parameters(typeOrFunc);
};
JitReflector.prototype.tryAnnotations = function (typeOrFunc) { return this.annotations(typeOrFunc); };
JitReflector.prototype.annotations = function (typeOrFunc) {
return this.reflectionCapabilities.annotations(typeOrFunc);
};
JitReflector.prototype.shallowAnnotations = function (typeOrFunc) {
throw new Error('Not supported in JIT mode');
};
JitReflector.prototype.propMetadata = function (typeOrFunc) {
return this.reflectionCapabilities.propMetadata(typeOrFunc);
};
JitReflector.prototype.hasLifecycleHook = function (type, lcProperty) {
return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);
};
JitReflector.prototype.guards = function (type) { return this.reflectionCapabilities.guards(type); };
JitReflector.prototype.resolveExternalReference = function (ref) {
return builtinExternalReferences.get(ref) || ref.runtime;
};
return JitReflector;
}());
function createBuiltinExternalReferencesMap() {
var map = new Map();
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].ANALYZE_FOR_ENTRY_COMPONENTS, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ANALYZE_FOR_ENTRY_COMPONENTS"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].ElementRef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].NgModuleRef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleRef"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].ViewContainerRef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].ChangeDetectorRef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].QueryList, _angular_core__WEBPACK_IMPORTED_MODULE_1__["QueryList"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].TemplateRef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].CodegenComponentFactoryResolver, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵCodegenComponentFactoryResolver"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].ComponentFactoryResolver, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactoryResolver"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].ComponentFactory, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactory"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].ComponentRef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentRef"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].NgModuleFactory, _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactory"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].createModuleFactory, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵcmf"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].moduleDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵmod"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].moduleProviderDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵmpd"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].RegisterModuleFactoryFn, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵregisterModuleFactory"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].Injector, _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].ViewEncapsulation, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].ChangeDetectionStrategy, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].SecurityContext, _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].LOCALE_ID, _angular_core__WEBPACK_IMPORTED_MODULE_1__["LOCALE_ID"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].TRANSLATIONS_FORMAT, _angular_core__WEBPACK_IMPORTED_MODULE_1__["TRANSLATIONS_FORMAT"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].inlineInterpolate, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵinlineInterpolate"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].interpolate, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵinterpolate"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].EMPTY_ARRAY, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵEMPTY_ARRAY"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].EMPTY_MAP, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵEMPTY_MAP"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].Renderer, _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].viewDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵvid"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].elementDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵeld"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].anchorDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵand"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].textDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵted"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].directiveDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵdid"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].providerDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵprd"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].queryDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵqud"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].pureArrayDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵpad"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].pureObjectDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵpod"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].purePipeDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵppd"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].pipeDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵpid"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].nodeValue, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵnov"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].ngContentDef, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵncd"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].unwrapValue, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunv"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].createRendererType2, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵcrt"]);
map.set(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Identifiers"].createComponentFactory, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵccf"]);
return map;
}
/**
* @license
* Copyright Google Inc. 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 ERROR_COLLECTOR_TOKEN = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('ErrorCollector');
/**
* A default provider for {@link PACKAGE_ROOT_URL} that maps to '/'.
*/
var DEFAULT_PACKAGE_URL_PROVIDER = {
provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["PACKAGE_ROOT_URL"],
useValue: '/'
};
var _NO_RESOURCE_LOADER = {
get: function (url) {
throw new Error("No ResourceLoader implementation has been provided. Can't read the url \"" + url + "\"");
}
};
var baseHtmlParser = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('HtmlParser');
var CompilerImpl = /** @class */ (function () {
function CompilerImpl(injector, _metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, compilerConfig, console) {
this._metadataResolver = _metadataResolver;
this._delegate = new _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["JitCompiler"](_metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, compilerConfig, console, this.getExtraNgModuleProviders.bind(this));
this.injector = injector;
}
CompilerImpl.prototype.getExtraNgModuleProviders = function () {
return [this._metadataResolver.getProviderMetadata(new _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["ProviderMeta"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["Compiler"], { useValue: this }))];
};
CompilerImpl.prototype.compileModuleSync = function (moduleType) {
return this._delegate.compileModuleSync(moduleType);
};
CompilerImpl.prototype.compileModuleAsync = function (moduleType) {
return this._delegate.compileModuleAsync(moduleType);
};
CompilerImpl.prototype.compileModuleAndAllComponentsSync = function (moduleType) {
var result = this._delegate.compileModuleAndAllComponentsSync(moduleType);
return {
ngModuleFactory: result.ngModuleFactory,
componentFactories: result.componentFactories,
};
};
CompilerImpl.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {
return this._delegate.compileModuleAndAllComponentsAsync(moduleType)
.then(function (result) { return ({
ngModuleFactory: result.ngModuleFactory,
componentFactories: result.componentFactories,
}); });
};
CompilerImpl.prototype.loadAotSummaries = function (summaries) { this._delegate.loadAotSummaries(summaries); };
CompilerImpl.prototype.hasAotSummary = function (ref) { return this._delegate.hasAotSummary(ref); };
CompilerImpl.prototype.getComponentFactory = function (component) {
return this._delegate.getComponentFactory(component);
};
CompilerImpl.prototype.clearCache = function () { this._delegate.clearCache(); };
CompilerImpl.prototype.clearCacheFor = function (type) { this._delegate.clearCacheFor(type); };
return CompilerImpl;
}());
/**
* A set of providers that provide `JitCompiler` and its dependencies to use for
* template compilation.
*/
var COMPILER_PROVIDERS = [
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompileReflector"], useValue: new JitReflector() },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["ResourceLoader"], useValue: _NO_RESOURCE_LOADER },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["JitSummaryResolver"], deps: [] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["SummaryResolver"], useExisting: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["JitSummaryResolver"] },
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"], deps: [] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Lexer"], deps: [] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Parser"], deps: [_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Lexer"]] },
{
provide: baseHtmlParser,
useClass: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["HtmlParser"],
deps: [],
},
{
provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["I18NHtmlParser"],
useFactory: function (parser, translations, format, config, console) {
translations = translations || '';
var missingTranslation = translations ? config.missingTranslation : _angular_core__WEBPACK_IMPORTED_MODULE_1__["MissingTranslationStrategy"].Ignore;
return new _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["I18NHtmlParser"](parser, translations, format, missingTranslation, console);
},
deps: [
baseHtmlParser,
[new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["TRANSLATIONS"])],
[new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["TRANSLATIONS_FORMAT"])],
[_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompilerConfig"]],
[_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"]],
]
},
{
provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["HtmlParser"],
useExisting: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["I18NHtmlParser"],
},
{
provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["TemplateParser"], deps: [_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompilerConfig"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompileReflector"],
_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["Parser"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["ElementSchemaRegistry"],
_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["I18NHtmlParser"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"]]
},
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["DirectiveNormalizer"], deps: [_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["ResourceLoader"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["UrlResolver"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["HtmlParser"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompilerConfig"]] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompileMetadataResolver"], deps: [_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompilerConfig"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["HtmlParser"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["NgModuleResolver"],
_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["DirectiveResolver"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["PipeResolver"],
_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["SummaryResolver"],
_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["ElementSchemaRegistry"],
_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["DirectiveNormalizer"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"],
[_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["StaticSymbolCache"]],
_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompileReflector"],
[_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"], ERROR_COLLECTOR_TOKEN]] },
DEFAULT_PACKAGE_URL_PROVIDER,
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["StyleCompiler"], deps: [_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["UrlResolver"]] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["ViewCompiler"], deps: [_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompileReflector"]] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["NgModuleCompiler"], deps: [_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompileReflector"]] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompilerConfig"], useValue: new _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompilerConfig"]() },
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Compiler"], useClass: CompilerImpl, deps: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompileMetadataResolver"],
_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["TemplateParser"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["StyleCompiler"],
_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["ViewCompiler"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["NgModuleCompiler"],
_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["SummaryResolver"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompileReflector"], _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompilerConfig"],
_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"]] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["DomElementSchemaRegistry"], deps: [] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["ElementSchemaRegistry"], useExisting: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["DomElementSchemaRegistry"] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["UrlResolver"], deps: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["PACKAGE_ROOT_URL"]] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["DirectiveResolver"], deps: [_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompileReflector"]] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["PipeResolver"], deps: [_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompileReflector"]] },
{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["NgModuleResolver"], deps: [_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompileReflector"]] },
];
/**
* @experimental
*/
var JitCompilerFactory = /** @class */ (function () {
/* @internal */
function JitCompilerFactory(defaultOptions) {
var compilerOptions = {
useJit: true,
defaultEncapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].Emulated,
missingTranslation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["MissingTranslationStrategy"].Warning,
};
this._defaultOptions = Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__spread"])([compilerOptions], defaultOptions);
}
JitCompilerFactory.prototype.createCompiler = function (options) {
if (options === void 0) { options = []; }
var opts = _mergeOptions(this._defaultOptions.concat(options));
var injector = _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"].create([
COMPILER_PROVIDERS, {
provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompilerConfig"],
useFactory: function () {
return new _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["CompilerConfig"]({
// let explicit values from the compiler options overwrite options
// from the app providers
useJit: opts.useJit,
jitDevMode: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["isDevMode"])(),
// let explicit values from the compiler options overwrite options
// from the app providers
defaultEncapsulation: opts.defaultEncapsulation,
missingTranslation: opts.missingTranslation,
preserveWhitespaces: opts.preserveWhitespaces,
});
},
deps: []
},
opts.providers
]);
return injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Compiler"]);
};
return JitCompilerFactory;
}());
function _mergeOptions(optionsArr) {
return {
useJit: _lastDefined(optionsArr.map(function (options) { return options.useJit; })),
defaultEncapsulation: _lastDefined(optionsArr.map(function (options) { return options.defaultEncapsulation; })),
providers: _mergeArrays(optionsArr.map(function (options) { return options.providers; })),
missingTranslation: _lastDefined(optionsArr.map(function (options) { return options.missingTranslation; })),
preserveWhitespaces: _lastDefined(optionsArr.map(function (options) { return options.preserveWhitespaces; })),
};
}
function _lastDefined(args) {
for (var i = args.length - 1; i >= 0; i--) {
if (args[i] !== undefined) {
return args[i];
}
}
return undefined;
}
function _mergeArrays(parts) {
var result = [];
parts.forEach(function (part) { return part && result.push.apply(result, Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__spread"])(part)); });
return result;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A platform that included corePlatform and the compiler.
*
* @experimental
*/
var platformCoreDynamic = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["createPlatformFactory"])(_angular_core__WEBPACK_IMPORTED_MODULE_1__["platformCore"], 'coreDynamic', [
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["COMPILER_OPTIONS"], useValue: {}, multi: true },
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["CompilerFactory"], useClass: JitCompilerFactory, deps: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["COMPILER_OPTIONS"]] },
]);
var ResourceLoaderImpl = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(ResourceLoaderImpl, _super);
function ResourceLoaderImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
ResourceLoaderImpl.prototype.get = function (url) {
var resolve;
var reject;
var promise = new Promise(function (res, rej) {
resolve = res;
reject = rej;
});
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'text';
xhr.onload = function () {
// responseText is the old-school way of retrieving response (supported by IE8 & 9)
// response/responseType properties were introduced in ResourceLoader Level2 spec (supported
// by IE10)
var response = xhr.response || xhr.responseText;
// normalize IE9 bug (http://bugs.jquery.com/ticket/1450)
var status = xhr.status === 1223 ? 204 : xhr.status;
// fix status code when it is 0 (0 status is undocumented).
// Occurs when accessing file resources or on Android 4.1 stock browser
// while retrieving files from application cache.
if (status === 0) {
status = response ? 200 : 0;
}
if (200 <= status && status <= 300) {
resolve(response);
}
else {
reject("Failed to load " + url);
}
};
xhr.onerror = function () { reject("Failed to load " + url); };
xhr.send();
return promise;
};
ResourceLoaderImpl.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
return ResourceLoaderImpl;
}(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["ResourceLoader"]));
/**
* @license
* Copyright Google Inc. 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 INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = [
_angular_platform_browser__WEBPACK_IMPORTED_MODULE_4__["ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS"],
{
provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["COMPILER_OPTIONS"],
useValue: { providers: [{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["ResourceLoader"], useClass: ResourceLoaderImpl, deps: [] }] },
multi: true
},
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"], useValue: _angular_common__WEBPACK_IMPORTED_MODULE_3__["ɵPLATFORM_BROWSER_ID"] },
];
/**
* @license
* Copyright Google Inc. 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
*/
/**
* An implementation of ResourceLoader that uses a template cache to avoid doing an actual
* ResourceLoader.
*
* The template cache needs to be built and loaded into window.$templateCache
* via a separate mechanism.
*/
var CachedResourceLoader = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(CachedResourceLoader, _super);
function CachedResourceLoader() {
var _this = _super.call(this) || this;
_this._cache = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"].$templateCache;
if (_this._cache == null) {
throw new Error('CachedResourceLoader: Template cache was not found in $templateCache.');
}
return _this;
}
CachedResourceLoader.prototype.get = function (url) {
if (this._cache.hasOwnProperty(url)) {
return Promise.resolve(this._cache[url]);
}
else {
return Promise.reject('CachedResourceLoader: Did not find cached template for ' + url);
}
};
return CachedResourceLoader;
}(_angular_compiler__WEBPACK_IMPORTED_MODULE_0__["ResourceLoader"]));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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 VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Version"]('6.0.9');
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @experimental
*/
var RESOURCE_CACHE_PROVIDER = [{ provide: _angular_compiler__WEBPACK_IMPORTED_MODULE_0__["ResourceLoader"], useClass: CachedResourceLoader, deps: [] }];
var platformBrowserDynamic = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["createPlatformFactory"])(platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);
/**
* @license
* Copyright Google Inc. 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
*/
// This file only reexports content of the `src` folder. Keep it that way.
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Generated bundle index. Do not edit.
*/
//# sourceMappingURL=platform-browser-dynamic.js.map
/***/ }),
/***/ "./node_modules/@angular/platform-browser/fesm5/animations.js":
/*!********************************************************************!*\
!*** ./node_modules/@angular/platform-browser/fesm5/animations.js ***!
\********************************************************************/
/*! exports provided: ɵangular_packages_platform_browser_animations_animations_g, ɵangular_packages_platform_browser_animations_animations_e, ɵangular_packages_platform_browser_animations_animations_f, ɵangular_packages_platform_browser_animations_animations_a, ɵangular_packages_platform_browser_animations_animations_c, ɵangular_packages_platform_browser_animations_animations_d, ɵangular_packages_platform_browser_animations_animations_b, BrowserAnimationsModule, NoopAnimationsModule, ANIMATION_MODULE_TYPE, ɵBrowserAnimationBuilder, ɵBrowserAnimationFactory, ɵAnimationRenderer, ɵAnimationRendererFactory */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_animations_animations_g", function() { return BaseAnimationRenderer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_animations_animations_e", function() { return BROWSER_ANIMATIONS_PROVIDERS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_animations_animations_f", function() { return BROWSER_NOOP_ANIMATIONS_PROVIDERS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_animations_animations_a", function() { return InjectableAnimationEngine; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_animations_animations_c", function() { return instantiateDefaultStyleNormalizer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_animations_animations_d", function() { return instantiateRendererFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_animations_animations_b", function() { return instantiateSupportedAnimationDriver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserAnimationsModule", function() { return BrowserAnimationsModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoopAnimationsModule", function() { return NoopAnimationsModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ANIMATION_MODULE_TYPE", function() { return ANIMATION_MODULE_TYPE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBrowserAnimationBuilder", function() { return BrowserAnimationBuilder; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBrowserAnimationFactory", function() { return BrowserAnimationFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵAnimationRenderer", function() { return AnimationRenderer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵAnimationRendererFactory", function() { return AnimationRendererFactory; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm5/animations.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/fesm5/platform-browser.js");
/* harmony import */ var _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/animations/browser */ "./node_modules/@angular/animations/fesm5/browser.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @license Angular v6.0.9
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
var BrowserAnimationBuilder = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BrowserAnimationBuilder, _super);
function BrowserAnimationBuilder(rootRenderer, doc) {
var _this = _super.call(this) || this;
_this._nextAnimationId = 0;
var typeData = {
id: '0',
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewEncapsulation"].None,
styles: [],
data: { animation: [] }
};
_this._renderer = rootRenderer.createRenderer(doc.body, typeData);
return _this;
}
BrowserAnimationBuilder.prototype.build = function (animation) {
var id = this._nextAnimationId.toString();
this._nextAnimationId++;
var entry = Array.isArray(animation) ? Object(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["sequence"])(animation) : animation;
issueAnimationCommand(this._renderer, null, id, 'register', [entry]);
return new BrowserAnimationFactory(id, this._renderer);
};
BrowserAnimationBuilder.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
BrowserAnimationBuilder.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["RendererFactory2"] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"],] }] }
]; };
return BrowserAnimationBuilder;
}(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["AnimationBuilder"]));
var BrowserAnimationFactory = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BrowserAnimationFactory, _super);
function BrowserAnimationFactory(_id, _renderer) {
var _this = _super.call(this) || this;
_this._id = _id;
_this._renderer = _renderer;
return _this;
}
BrowserAnimationFactory.prototype.create = function (element, options) {
return new RendererAnimationPlayer(this._id, element, options || {}, this._renderer);
};
return BrowserAnimationFactory;
}(_angular_animations__WEBPACK_IMPORTED_MODULE_1__["AnimationFactory"]));
var RendererAnimationPlayer = /** @class */ (function () {
function RendererAnimationPlayer(id, element, options, _renderer) {
this.id = id;
this.element = element;
this._renderer = _renderer;
this.parentPlayer = null;
this._started = false;
this.totalTime = 0;
this._command('create', options);
}
RendererAnimationPlayer.prototype._listen = function (eventName, callback) {
return this._renderer.listen(this.element, "@@" + this.id + ":" + eventName, callback);
};
RendererAnimationPlayer.prototype._command = function (command) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
return issueAnimationCommand(this._renderer, this.element, this.id, command, args);
};
RendererAnimationPlayer.prototype.onDone = function (fn) { this._listen('done', fn); };
RendererAnimationPlayer.prototype.onStart = function (fn) { this._listen('start', fn); };
RendererAnimationPlayer.prototype.onDestroy = function (fn) { this._listen('destroy', fn); };
RendererAnimationPlayer.prototype.init = function () { this._command('init'); };
RendererAnimationPlayer.prototype.hasStarted = function () { return this._started; };
RendererAnimationPlayer.prototype.play = function () {
this._command('play');
this._started = true;
};
RendererAnimationPlayer.prototype.pause = function () { this._command('pause'); };
RendererAnimationPlayer.prototype.restart = function () { this._command('restart'); };
RendererAnimationPlayer.prototype.finish = function () { this._command('finish'); };
RendererAnimationPlayer.prototype.destroy = function () { this._command('destroy'); };
RendererAnimationPlayer.prototype.reset = function () { this._command('reset'); };
RendererAnimationPlayer.prototype.setPosition = function (p) { this._command('setPosition', p); };
RendererAnimationPlayer.prototype.getPosition = function () { return 0; };
return RendererAnimationPlayer;
}());
function issueAnimationCommand(renderer, element, id, command, args) {
return renderer.setProperty(element, "@@" + id + ":" + command, args);
}
var ANIMATION_PREFIX = '@';
var DISABLE_ANIMATIONS_FLAG = '@.disabled';
var AnimationRendererFactory = /** @class */ (function () {
function AnimationRendererFactory(delegate, engine, _zone) {
this.delegate = delegate;
this.engine = engine;
this._zone = _zone;
this._currentId = 0;
this._microtaskId = 1;
this._animationCallbacksBuffer = [];
this._rendererCache = new Map();
this._cdRecurDepth = 0;
this.promise = Promise.resolve(0);
engine.onRemovalComplete = function (element, delegate) {
// Note: if an component element has a leave animation, and the component
// a host leave animation, the view engine will call `removeChild` for the parent
// component renderer as well as for the child component renderer.
// Therefore, we need to check if we already removed the element.
if (delegate && delegate.parentNode(element)) {
delegate.removeChild(element.parentNode, element);
}
};
}
AnimationRendererFactory.prototype.createRenderer = function (hostElement, type) {
var _this = this;
var EMPTY_NAMESPACE_ID = '';
// cache the delegates to find out which cached delegate can
// be used by which cached renderer
var delegate = this.delegate.createRenderer(hostElement, type);
if (!hostElement || !type || !type.data || !type.data['animation']) {
var renderer = this._rendererCache.get(delegate);
if (!renderer) {
renderer = new BaseAnimationRenderer(EMPTY_NAMESPACE_ID, delegate, this.engine);
// only cache this result when the base renderer is used
this._rendererCache.set(delegate, renderer);
}
return renderer;
}
var componentId = type.id;
var namespaceId = type.id + '-' + this._currentId;
this._currentId++;
this.engine.register(namespaceId, hostElement);
var animationTriggers = type.data['animation'];
animationTriggers.forEach(function (trigger) { return _this.engine.registerTrigger(componentId, namespaceId, hostElement, trigger.name, trigger); });
return new AnimationRenderer(this, namespaceId, delegate, this.engine);
};
AnimationRendererFactory.prototype.begin = function () {
this._cdRecurDepth++;
if (this.delegate.begin) {
this.delegate.begin();
}
};
AnimationRendererFactory.prototype._scheduleCountTask = function () {
var _this = this;
// always use promise to schedule microtask instead of use Zone
this.promise.then(function () { _this._microtaskId++; });
};
/* @internal */
AnimationRendererFactory.prototype.scheduleListenerCallback = function (count, fn, data) {
var _this = this;
if (count >= 0 && count < this._microtaskId) {
this._zone.run(function () { return fn(data); });
return;
}
if (this._animationCallbacksBuffer.length == 0) {
Promise.resolve(null).then(function () {
_this._zone.run(function () {
_this._animationCallbacksBuffer.forEach(function (tuple) {
var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(tuple, 2), fn = _a[0], data = _a[1];
fn(data);
});
_this._animationCallbacksBuffer = [];
});
});
}
this._animationCallbacksBuffer.push([fn, data]);
};
AnimationRendererFactory.prototype.end = function () {
var _this = this;
this._cdRecurDepth--;
// this is to prevent animations from running twice when an inner
// component does CD when a parent component insted has inserted it
if (this._cdRecurDepth == 0) {
this._zone.runOutsideAngular(function () {
_this._scheduleCountTask();
_this.engine.flush(_this._microtaskId);
});
}
if (this.delegate.end) {
this.delegate.end();
}
};
AnimationRendererFactory.prototype.whenRenderingDone = function () { return this.engine.whenRenderingDone(); };
AnimationRendererFactory.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
AnimationRendererFactory.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["RendererFactory2"] },
{ type: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["ɵAnimationEngine"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgZone"] }
]; };
return AnimationRendererFactory;
}());
var BaseAnimationRenderer = /** @class */ (function () {
function BaseAnimationRenderer(namespaceId, delegate, engine) {
this.namespaceId = namespaceId;
this.delegate = delegate;
this.engine = engine;
this.destroyNode = this.delegate.destroyNode ? function (n) { return delegate.destroyNode(n); } : null;
}
Object.defineProperty(BaseAnimationRenderer.prototype, "data", {
get: function () { return this.delegate.data; },
enumerable: true,
configurable: true
});
BaseAnimationRenderer.prototype.destroy = function () {
this.engine.destroy(this.namespaceId, this.delegate);
this.delegate.destroy();
};
BaseAnimationRenderer.prototype.createElement = function (name, namespace) {
return this.delegate.createElement(name, namespace);
};
BaseAnimationRenderer.prototype.createComment = function (value) { return this.delegate.createComment(value); };
BaseAnimationRenderer.prototype.createText = function (value) { return this.delegate.createText(value); };
BaseAnimationRenderer.prototype.appendChild = function (parent, newChild) {
this.delegate.appendChild(parent, newChild);
this.engine.onInsert(this.namespaceId, newChild, parent, false);
};
BaseAnimationRenderer.prototype.insertBefore = function (parent, newChild, refChild) {
this.delegate.insertBefore(parent, newChild, refChild);
this.engine.onInsert(this.namespaceId, newChild, parent, true);
};
BaseAnimationRenderer.prototype.removeChild = function (parent, oldChild) {
this.engine.onRemove(this.namespaceId, oldChild, this.delegate);
};
BaseAnimationRenderer.prototype.selectRootElement = function (selectorOrNode) { return this.delegate.selectRootElement(selectorOrNode); };
BaseAnimationRenderer.prototype.parentNode = function (node) { return this.delegate.parentNode(node); };
BaseAnimationRenderer.prototype.nextSibling = function (node) { return this.delegate.nextSibling(node); };
BaseAnimationRenderer.prototype.setAttribute = function (el, name, value, namespace) {
this.delegate.setAttribute(el, name, value, namespace);
};
BaseAnimationRenderer.prototype.removeAttribute = function (el, name, namespace) {
this.delegate.removeAttribute(el, name, namespace);
};
BaseAnimationRenderer.prototype.addClass = function (el, name) { this.delegate.addClass(el, name); };
BaseAnimationRenderer.prototype.removeClass = function (el, name) { this.delegate.removeClass(el, name); };
BaseAnimationRenderer.prototype.setStyle = function (el, style, value, flags) {
this.delegate.setStyle(el, style, value, flags);
};
BaseAnimationRenderer.prototype.removeStyle = function (el, style, flags) {
this.delegate.removeStyle(el, style, flags);
};
BaseAnimationRenderer.prototype.setProperty = function (el, name, value) {
if (name.charAt(0) == ANIMATION_PREFIX && name == DISABLE_ANIMATIONS_FLAG) {
this.disableAnimations(el, !!value);
}
else {
this.delegate.setProperty(el, name, value);
}
};
BaseAnimationRenderer.prototype.setValue = function (node, value) { this.delegate.setValue(node, value); };
BaseAnimationRenderer.prototype.listen = function (target, eventName, callback) {
return this.delegate.listen(target, eventName, callback);
};
BaseAnimationRenderer.prototype.disableAnimations = function (element, value) {
this.engine.disableAnimations(element, value);
};
return BaseAnimationRenderer;
}());
var AnimationRenderer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(AnimationRenderer, _super);
function AnimationRenderer(factory, namespaceId, delegate, engine) {
var _this = _super.call(this, namespaceId, delegate, engine) || this;
_this.factory = factory;
_this.namespaceId = namespaceId;
return _this;
}
AnimationRenderer.prototype.setProperty = function (el, name, value) {
if (name.charAt(0) == ANIMATION_PREFIX) {
if (name.charAt(1) == '.' && name == DISABLE_ANIMATIONS_FLAG) {
value = value === undefined ? true : !!value;
this.disableAnimations(el, value);
}
else {
this.engine.process(this.namespaceId, el, name.substr(1), value);
}
}
else {
this.delegate.setProperty(el, name, value);
}
};
AnimationRenderer.prototype.listen = function (target, eventName, callback) {
var _this = this;
if (eventName.charAt(0) == ANIMATION_PREFIX) {
var element = resolveElementFromTarget(target);
var name_1 = eventName.substr(1);
var phase = '';
// @listener.phase is for trigger animation callbacks
// @@listener is for animation builder callbacks
if (name_1.charAt(0) != ANIMATION_PREFIX) {
_a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(parseTriggerCallbackName(name_1), 2), name_1 = _a[0], phase = _a[1];
}
return this.engine.listen(this.namespaceId, element, name_1, phase, function (event) {
var countId = event['_data'] || -1;
_this.factory.scheduleListenerCallback(countId, callback, event);
});
}
return this.delegate.listen(target, eventName, callback);
var _a;
};
return AnimationRenderer;
}(BaseAnimationRenderer));
function resolveElementFromTarget(target) {
switch (target) {
case 'body':
return document.body;
case 'document':
return document;
case 'window':
return window;
default:
return target;
}
}
function parseTriggerCallbackName(triggerName) {
var dotIndex = triggerName.indexOf('.');
var trigger = triggerName.substring(0, dotIndex);
var phase = triggerName.substr(dotIndex + 1);
return [trigger, phase];
}
/**
* @license
* Copyright Google Inc. 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 InjectableAnimationEngine = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(InjectableAnimationEngine, _super);
function InjectableAnimationEngine(doc, driver, normalizer) {
return _super.call(this, doc.body, driver, normalizer) || this;
}
InjectableAnimationEngine.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
InjectableAnimationEngine.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_5__["DOCUMENT"],] }] },
{ type: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["AnimationDriver"] },
{ type: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["ɵAnimationStyleNormalizer"] }
]; };
return InjectableAnimationEngine;
}(_angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["ɵAnimationEngine"]));
function instantiateSupportedAnimationDriver() {
return Object(_angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["ɵsupportsWebAnimations"])() ? new _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["ɵWebAnimationsDriver"]() : new _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["ɵCssKeyframesDriver"]();
}
function instantiateDefaultStyleNormalizer() {
return new _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["ɵWebAnimationsStyleNormalizer"]();
}
function instantiateRendererFactory(renderer, engine, zone) {
return new AnimationRendererFactory(renderer, engine, zone);
}
/**
* @experimental Animation support is experimental.
*/
var ANIMATION_MODULE_TYPE = new _angular_core__WEBPACK_IMPORTED_MODULE_2__["InjectionToken"]('AnimationModuleType');
var SHARED_ANIMATION_PROVIDERS = [
{ provide: _angular_animations__WEBPACK_IMPORTED_MODULE_1__["AnimationBuilder"], useClass: BrowserAnimationBuilder },
{ provide: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["ɵAnimationStyleNormalizer"], useFactory: instantiateDefaultStyleNormalizer },
{ provide: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["ɵAnimationEngine"], useClass: InjectableAnimationEngine }, {
provide: _angular_core__WEBPACK_IMPORTED_MODULE_2__["RendererFactory2"],
useFactory: instantiateRendererFactory,
deps: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__["ɵDomRendererFactory2"], _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["ɵAnimationEngine"], _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgZone"]]
}
];
/**
* Separate providers from the actual module so that we can do a local modification in Google3 to
* include them in the BrowserModule.
*/
var BROWSER_ANIMATIONS_PROVIDERS = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([
{ provide: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["AnimationDriver"], useFactory: instantiateSupportedAnimationDriver },
{ provide: ANIMATION_MODULE_TYPE, useValue: 'BrowserAnimations' }
], SHARED_ANIMATION_PROVIDERS);
/**
* Separate providers from the actual module so that we can do a local modification in Google3 to
* include them in the BrowserTestingModule.
*/
var BROWSER_NOOP_ANIMATIONS_PROVIDERS = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([
{ provide: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["AnimationDriver"], useClass: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_4__["ɵNoopAnimationDriver"] },
{ provide: ANIMATION_MODULE_TYPE, useValue: 'NoopAnimations' }
], SHARED_ANIMATION_PROVIDERS);
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @experimental Animation support is experimental.
*/
var BrowserAnimationsModule = /** @class */ (function () {
function BrowserAnimationsModule() {
}
BrowserAnimationsModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgModule"], args: [{
exports: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__["BrowserModule"]],
providers: BROWSER_ANIMATIONS_PROVIDERS,
},] }
];
return BrowserAnimationsModule;
}());
/**
* @experimental Animation support is experimental.
*/
var NoopAnimationsModule = /** @class */ (function () {
function NoopAnimationsModule() {
}
NoopAnimationsModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgModule"], args: [{
exports: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__["BrowserModule"]],
providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS,
},] }
];
return NoopAnimationsModule;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Generated bundle index. Do not edit.
*/
//# sourceMappingURL=animations.js.map
/***/ }),
/***/ "./node_modules/@angular/platform-browser/fesm5/platform-browser.js":
/*!**************************************************************************!*\
!*** ./node_modules/@angular/platform-browser/fesm5/platform-browser.js ***!
\**************************************************************************/
/*! exports provided: ɵangular_packages_platform_browser_platform_browser_b, ɵangular_packages_platform_browser_platform_browser_a, ɵangular_packages_platform_browser_platform_browser_i, ɵangular_packages_platform_browser_platform_browser_g, ɵangular_packages_platform_browser_platform_browser_f, ɵangular_packages_platform_browser_platform_browser_c, ɵangular_packages_platform_browser_platform_browser_h, ɵangular_packages_platform_browser_platform_browser_d, ɵangular_packages_platform_browser_platform_browser_e, BrowserModule, platformBrowser, Meta, Title, disableDebugTools, enableDebugTools, BrowserTransferStateModule, TransferState, makeStateKey, By, DOCUMENT, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HammerGestureConfig, DomSanitizer, VERSION, ɵBROWSER_SANITIZATION_PROVIDERS, ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, ɵinitDomAdapter, ɵBrowserDomAdapter, ɵBrowserPlatformLocation, ɵTRANSITION_ID, ɵBrowserGetTestability, ɵescapeHtml, ɵELEMENT_PROBE_PROVIDERS, ɵDomAdapter, ɵgetDOM, ɵsetRootDomAdapter, ɵDomRendererFactory2, ɵNAMESPACE_URIS, ɵflattenStyles, ɵshimContentAttribute, ɵshimHostAttribute, ɵDomEventsPlugin, ɵHammerGesturesPlugin, ɵKeyEventsPlugin, ɵDomSharedStylesHost, ɵSharedStylesHost */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_b", function() { return _document; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_a", function() { return errorHandler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_i", function() { return GenericBrowserDomAdapter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_g", function() { return SERVER_TRANSITION_PROVIDERS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_f", function() { return appInitializerFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_c", function() { return initTransferState; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_h", function() { return _createNgProbe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_d", function() { return EventManagerPlugin; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_e", function() { return DomSanitizerImpl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserModule", function() { return BrowserModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "platformBrowser", function() { return platformBrowser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Meta", function() { return Meta; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Title", function() { return Title; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disableDebugTools", function() { return disableDebugTools; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableDebugTools", function() { return enableDebugTools; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserTransferStateModule", function() { return BrowserTransferStateModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TransferState", function() { return TransferState; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeStateKey", function() { return makeStateKey; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "By", function() { return By; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOCUMENT", function() { return DOCUMENT$1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_MANAGER_PLUGINS", function() { return EVENT_MANAGER_PLUGINS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventManager", function() { return EventManager; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HAMMER_GESTURE_CONFIG", function() { return HAMMER_GESTURE_CONFIG; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HammerGestureConfig", function() { return HammerGestureConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DomSanitizer", function() { return DomSanitizer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBROWSER_SANITIZATION_PROVIDERS", function() { return BROWSER_SANITIZATION_PROVIDERS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS", function() { return INTERNAL_BROWSER_PLATFORM_PROVIDERS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinitDomAdapter", function() { return initDomAdapter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBrowserDomAdapter", function() { return BrowserDomAdapter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBrowserPlatformLocation", function() { return BrowserPlatformLocation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵTRANSITION_ID", function() { return TRANSITION_ID; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBrowserGetTestability", function() { return BrowserGetTestability; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵescapeHtml", function() { return escapeHtml; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵELEMENT_PROBE_PROVIDERS", function() { return ELEMENT_PROBE_PROVIDERS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomAdapter", function() { return DomAdapter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetDOM", function() { return getDOM; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsetRootDomAdapter", function() { return setRootDomAdapter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomRendererFactory2", function() { return DomRendererFactory2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNAMESPACE_URIS", function() { return NAMESPACE_URIS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵflattenStyles", function() { return flattenStyles; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵshimContentAttribute", function() { return shimContentAttribute; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵshimHostAttribute", function() { return shimHostAttribute; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomEventsPlugin", function() { return DomEventsPlugin; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵHammerGesturesPlugin", function() { return HammerGesturesPlugin; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵKeyEventsPlugin", function() { return KeyEventsPlugin; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomSharedStylesHost", function() { return DomSharedStylesHost; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSharedStylesHost", function() { return SharedStylesHost; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/**
* @license Angular v6.0.9
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
/**
* @license
* Copyright Google Inc. 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 _DOM = null;
function getDOM() {
return _DOM;
}
function setRootDomAdapter(adapter) {
if (!_DOM) {
_DOM = adapter;
}
}
/* tslint:disable:requireParameterType */
/**
* Provides DOM operations in an environment-agnostic way.
*
* @security Tread carefully! Interacting with the DOM directly is dangerous and
* can introduce XSS risks.
*/
var DomAdapter = /** @class */ (function () {
function DomAdapter() {
this.resourceLoaderType = null;
}
Object.defineProperty(DomAdapter.prototype, "attrToPropMap", {
/**
* Maps attribute names to their corresponding property names for cases
* where attribute name doesn't match property name.
*/
get: function () { return this._attrToPropMap; },
set: function (value) { this._attrToPropMap = value; },
enumerable: true,
configurable: true
});
return DomAdapter;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Provides DOM operations in any browser environment.
*
* @security Tread carefully! Interacting with the DOM directly is dangerous and
* can introduce XSS risks.
*/
var GenericBrowserDomAdapter = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GenericBrowserDomAdapter, _super);
function GenericBrowserDomAdapter() {
var _this = _super.call(this) || this;
_this._animationPrefix = null;
_this._transitionEnd = null;
try {
var element_1 = _this.createElement('div', document);
if (_this.getStyle(element_1, 'animationName') != null) {
_this._animationPrefix = '';
}
else {
var domPrefixes = ['Webkit', 'Moz', 'O', 'ms'];
for (var i = 0; i < domPrefixes.length; i++) {
if (_this.getStyle(element_1, domPrefixes[i] + 'AnimationName') != null) {
_this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-';
break;
}
}
}
var transEndEventNames_1 = {
WebkitTransition: 'webkitTransitionEnd',
MozTransition: 'transitionend',
OTransition: 'oTransitionEnd otransitionend',
transition: 'transitionend'
};
Object.keys(transEndEventNames_1).forEach(function (key) {
if (_this.getStyle(element_1, key) != null) {
_this._transitionEnd = transEndEventNames_1[key];
}
});
}
catch (e) {
_this._animationPrefix = null;
_this._transitionEnd = null;
}
return _this;
}
GenericBrowserDomAdapter.prototype.getDistributedNodes = function (el) { return el.getDistributedNodes(); };
GenericBrowserDomAdapter.prototype.resolveAndSetHref = function (el, baseUrl, href) {
el.href = href == null ? baseUrl : baseUrl + '/../' + href;
};
GenericBrowserDomAdapter.prototype.supportsDOMEvents = function () { return true; };
GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = function () {
return typeof document.body.createShadowRoot === 'function';
};
GenericBrowserDomAdapter.prototype.getAnimationPrefix = function () { return this._animationPrefix ? this._animationPrefix : ''; };
GenericBrowserDomAdapter.prototype.getTransitionEnd = function () { return this._transitionEnd ? this._transitionEnd : ''; };
GenericBrowserDomAdapter.prototype.supportsAnimation = function () {
return this._animationPrefix != null && this._transitionEnd != null;
};
return GenericBrowserDomAdapter;
}(DomAdapter));
/**
* @license
* Copyright Google Inc. 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 _attrToPropMap = {
'class': 'className',
'innerHtml': 'innerHTML',
'readonly': 'readOnly',
'tabindex': 'tabIndex',
};
var DOM_KEY_LOCATION_NUMPAD = 3;
// Map to convert some key or keyIdentifier values to what will be returned by getEventKey
var _keyMap = {
// The following values are here for cross-browser compatibility and to match the W3C standard
// cf http://www.w3.org/TR/DOM-Level-3-Events-key/
'\b': 'Backspace',
'\t': 'Tab',
'\x7F': 'Delete',
'\x1B': 'Escape',
'Del': 'Delete',
'Esc': 'Escape',
'Left': 'ArrowLeft',
'Right': 'ArrowRight',
'Up': 'ArrowUp',
'Down': 'ArrowDown',
'Menu': 'ContextMenu',
'Scroll': 'ScrollLock',
'Win': 'OS'
};
// There is a bug in Chrome for numeric keypad keys:
// https://code.google.com/p/chromium/issues/detail?id=155654
// 1, 2, 3 ... are reported as A, B, C ...
var _chromeNumKeyPadMap = {
'A': '1',
'B': '2',
'C': '3',
'D': '4',
'E': '5',
'F': '6',
'G': '7',
'H': '8',
'I': '9',
'J': '*',
'K': '+',
'M': '-',
'N': '.',
'O': '/',
'\x60': '0',
'\x90': 'NumLock'
};
var nodeContains;
if (_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵglobal"]['Node']) {
nodeContains = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵglobal"]['Node'].prototype.contains || function (node) {
return !!(this.compareDocumentPosition(node) & 16);
};
}
/**
* A `DomAdapter` powered by full browser DOM APIs.
*
* @security Tread carefully! Interacting with the DOM directly is dangerous and
* can introduce XSS risks.
*/
/* tslint:disable:requireParameterType no-console */
var BrowserDomAdapter = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BrowserDomAdapter, _super);
function BrowserDomAdapter() {
return _super !== null && _super.apply(this, arguments) || this;
}
BrowserDomAdapter.prototype.parse = function (templateHtml) { throw new Error('parse not implemented'); };
BrowserDomAdapter.makeCurrent = function () { setRootDomAdapter(new BrowserDomAdapter()); };
BrowserDomAdapter.prototype.hasProperty = function (element, name) { return name in element; };
BrowserDomAdapter.prototype.setProperty = function (el, name, value) { el[name] = value; };
BrowserDomAdapter.prototype.getProperty = function (el, name) { return el[name]; };
BrowserDomAdapter.prototype.invoke = function (el, methodName, args) {
(_a = el)[methodName].apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(args));
var _a;
};
// TODO(tbosch): move this into a separate environment class once we have it
BrowserDomAdapter.prototype.logError = function (error) {
if (window.console) {
if (console.error) {
console.error(error);
}
else {
console.log(error);
}
}
};
BrowserDomAdapter.prototype.log = function (error) {
if (window.console) {
window.console.log && window.console.log(error);
}
};
BrowserDomAdapter.prototype.logGroup = function (error) {
if (window.console) {
window.console.group && window.console.group(error);
}
};
BrowserDomAdapter.prototype.logGroupEnd = function () {
if (window.console) {
window.console.groupEnd && window.console.groupEnd();
}
};
Object.defineProperty(BrowserDomAdapter.prototype, "attrToPropMap", {
get: function () { return _attrToPropMap; },
enumerable: true,
configurable: true
});
BrowserDomAdapter.prototype.contains = function (nodeA, nodeB) { return nodeContains.call(nodeA, nodeB); };
BrowserDomAdapter.prototype.querySelector = function (el, selector) { return el.querySelector(selector); };
BrowserDomAdapter.prototype.querySelectorAll = function (el, selector) { return el.querySelectorAll(selector); };
BrowserDomAdapter.prototype.on = function (el, evt, listener) { el.addEventListener(evt, listener, false); };
BrowserDomAdapter.prototype.onAndCancel = function (el, evt, listener) {
el.addEventListener(evt, listener, false);
// Needed to follow Dart's subscription semantic, until fix of
// https://code.google.com/p/dart/issues/detail?id=17406
return function () { el.removeEventListener(evt, listener, false); };
};
BrowserDomAdapter.prototype.dispatchEvent = function (el, evt) { el.dispatchEvent(evt); };
BrowserDomAdapter.prototype.createMouseEvent = function (eventType) {
var evt = this.getDefaultDocument().createEvent('MouseEvent');
evt.initEvent(eventType, true, true);
return evt;
};
BrowserDomAdapter.prototype.createEvent = function (eventType) {
var evt = this.getDefaultDocument().createEvent('Event');
evt.initEvent(eventType, true, true);
return evt;
};
BrowserDomAdapter.prototype.preventDefault = function (evt) {
evt.preventDefault();
evt.returnValue = false;
};
BrowserDomAdapter.prototype.isPrevented = function (evt) {
return evt.defaultPrevented || evt.returnValue != null && !evt.returnValue;
};
BrowserDomAdapter.prototype.getInnerHTML = function (el) { return el.innerHTML; };
BrowserDomAdapter.prototype.getTemplateContent = function (el) {
return 'content' in el && this.isTemplateElement(el) ? el.content : null;
};
BrowserDomAdapter.prototype.getOuterHTML = function (el) { return el.outerHTML; };
BrowserDomAdapter.prototype.nodeName = function (node) { return node.nodeName; };
BrowserDomAdapter.prototype.nodeValue = function (node) { return node.nodeValue; };
BrowserDomAdapter.prototype.type = function (node) { return node.type; };
BrowserDomAdapter.prototype.content = function (node) {
if (this.hasProperty(node, 'content')) {
return node.content;
}
else {
return node;
}
};
BrowserDomAdapter.prototype.firstChild = function (el) { return el.firstChild; };
BrowserDomAdapter.prototype.nextSibling = function (el) { return el.nextSibling; };
BrowserDomAdapter.prototype.parentElement = function (el) { return el.parentNode; };
BrowserDomAdapter.prototype.childNodes = function (el) { return el.childNodes; };
BrowserDomAdapter.prototype.childNodesAsList = function (el) {
var childNodes = el.childNodes;
var res = new Array(childNodes.length);
for (var i = 0; i < childNodes.length; i++) {
res[i] = childNodes[i];
}
return res;
};
BrowserDomAdapter.prototype.clearNodes = function (el) {
while (el.firstChild) {
el.removeChild(el.firstChild);
}
};
BrowserDomAdapter.prototype.appendChild = function (el, node) { el.appendChild(node); };
BrowserDomAdapter.prototype.removeChild = function (el, node) { el.removeChild(node); };
BrowserDomAdapter.prototype.replaceChild = function (el, newChild, oldChild) { el.replaceChild(newChild, oldChild); };
BrowserDomAdapter.prototype.remove = function (node) {
if (node.parentNode) {
node.parentNode.removeChild(node);
}
return node;
};
BrowserDomAdapter.prototype.insertBefore = function (parent, ref, node) { parent.insertBefore(node, ref); };
BrowserDomAdapter.prototype.insertAllBefore = function (parent, ref, nodes) {
nodes.forEach(function (n) { return parent.insertBefore(n, ref); });
};
BrowserDomAdapter.prototype.insertAfter = function (parent, ref, node) { parent.insertBefore(node, ref.nextSibling); };
BrowserDomAdapter.prototype.setInnerHTML = function (el, value) { el.innerHTML = value; };
BrowserDomAdapter.prototype.getText = function (el) { return el.textContent; };
BrowserDomAdapter.prototype.setText = function (el, value) { el.textContent = value; };
BrowserDomAdapter.prototype.getValue = function (el) { return el.value; };
BrowserDomAdapter.prototype.setValue = function (el, value) { el.value = value; };
BrowserDomAdapter.prototype.getChecked = function (el) { return el.checked; };
BrowserDomAdapter.prototype.setChecked = function (el, value) { el.checked = value; };
BrowserDomAdapter.prototype.createComment = function (text) { return this.getDefaultDocument().createComment(text); };
BrowserDomAdapter.prototype.createTemplate = function (html) {
var t = this.getDefaultDocument().createElement('template');
t.innerHTML = html;
return t;
};
BrowserDomAdapter.prototype.createElement = function (tagName, doc) {
doc = doc || this.getDefaultDocument();
return doc.createElement(tagName);
};
BrowserDomAdapter.prototype.createElementNS = function (ns, tagName, doc) {
doc = doc || this.getDefaultDocument();
return doc.createElementNS(ns, tagName);
};
BrowserDomAdapter.prototype.createTextNode = function (text, doc) {
doc = doc || this.getDefaultDocument();
return doc.createTextNode(text);
};
BrowserDomAdapter.prototype.createScriptTag = function (attrName, attrValue, doc) {
doc = doc || this.getDefaultDocument();
var el = doc.createElement('SCRIPT');
el.setAttribute(attrName, attrValue);
return el;
};
BrowserDomAdapter.prototype.createStyleElement = function (css, doc) {
doc = doc || this.getDefaultDocument();
var style = doc.createElement('style');
this.appendChild(style, this.createTextNode(css, doc));
return style;
};
BrowserDomAdapter.prototype.createShadowRoot = function (el) { return el.createShadowRoot(); };
BrowserDomAdapter.prototype.getShadowRoot = function (el) { return el.shadowRoot; };
BrowserDomAdapter.prototype.getHost = function (el) { return el.host; };
BrowserDomAdapter.prototype.clone = function (node) { return node.cloneNode(true); };
BrowserDomAdapter.prototype.getElementsByClassName = function (element, name) {
return element.getElementsByClassName(name);
};
BrowserDomAdapter.prototype.getElementsByTagName = function (element, name) {
return element.getElementsByTagName(name);
};
BrowserDomAdapter.prototype.classList = function (element) { return Array.prototype.slice.call(element.classList, 0); };
BrowserDomAdapter.prototype.addClass = function (element, className) { element.classList.add(className); };
BrowserDomAdapter.prototype.removeClass = function (element, className) { element.classList.remove(className); };
BrowserDomAdapter.prototype.hasClass = function (element, className) {
return element.classList.contains(className);
};
BrowserDomAdapter.prototype.setStyle = function (element, styleName, styleValue) {
element.style[styleName] = styleValue;
};
BrowserDomAdapter.prototype.removeStyle = function (element, stylename) {
// IE requires '' instead of null
// see https://github.com/angular/angular/issues/7916
element.style[stylename] = '';
};
BrowserDomAdapter.prototype.getStyle = function (element, stylename) { return element.style[stylename]; };
BrowserDomAdapter.prototype.hasStyle = function (element, styleName, styleValue) {
var value = this.getStyle(element, styleName) || '';
return styleValue ? value == styleValue : value.length > 0;
};
BrowserDomAdapter.prototype.tagName = function (element) { return element.tagName; };
BrowserDomAdapter.prototype.attributeMap = function (element) {
var res = new Map();
var elAttrs = element.attributes;
for (var i = 0; i < elAttrs.length; i++) {
var attrib = elAttrs.item(i);
res.set(attrib.name, attrib.value);
}
return res;
};
BrowserDomAdapter.prototype.hasAttribute = function (element, attribute) {
return element.hasAttribute(attribute);
};
BrowserDomAdapter.prototype.hasAttributeNS = function (element, ns, attribute) {
return element.hasAttributeNS(ns, attribute);
};
BrowserDomAdapter.prototype.getAttribute = function (element, attribute) {
return element.getAttribute(attribute);
};
BrowserDomAdapter.prototype.getAttributeNS = function (element, ns, name) {
return element.getAttributeNS(ns, name);
};
BrowserDomAdapter.prototype.setAttribute = function (element, name, value) { element.setAttribute(name, value); };
BrowserDomAdapter.prototype.setAttributeNS = function (element, ns, name, value) {
element.setAttributeNS(ns, name, value);
};
BrowserDomAdapter.prototype.removeAttribute = function (element, attribute) { element.removeAttribute(attribute); };
BrowserDomAdapter.prototype.removeAttributeNS = function (element, ns, name) {
element.removeAttributeNS(ns, name);
};
BrowserDomAdapter.prototype.templateAwareRoot = function (el) { return this.isTemplateElement(el) ? this.content(el) : el; };
BrowserDomAdapter.prototype.createHtmlDocument = function () {
return document.implementation.createHTMLDocument('fakeTitle');
};
BrowserDomAdapter.prototype.getDefaultDocument = function () { return document; };
BrowserDomAdapter.prototype.getBoundingClientRect = function (el) {
try {
return el.getBoundingClientRect();
}
catch (e) {
return { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 };
}
};
BrowserDomAdapter.prototype.getTitle = function (doc) { return doc.title; };
BrowserDomAdapter.prototype.setTitle = function (doc, newTitle) { doc.title = newTitle || ''; };
BrowserDomAdapter.prototype.elementMatches = function (n, selector) {
if (this.isElementNode(n)) {
return n.matches && n.matches(selector) ||
n.msMatchesSelector && n.msMatchesSelector(selector) ||
n.webkitMatchesSelector && n.webkitMatchesSelector(selector);
}
return false;
};
BrowserDomAdapter.prototype.isTemplateElement = function (el) {
return this.isElementNode(el) && el.nodeName === 'TEMPLATE';
};
BrowserDomAdapter.prototype.isTextNode = function (node) { return node.nodeType === Node.TEXT_NODE; };
BrowserDomAdapter.prototype.isCommentNode = function (node) { return node.nodeType === Node.COMMENT_NODE; };
BrowserDomAdapter.prototype.isElementNode = function (node) { return node.nodeType === Node.ELEMENT_NODE; };
BrowserDomAdapter.prototype.hasShadowRoot = function (node) {
return node.shadowRoot != null && node instanceof HTMLElement;
};
BrowserDomAdapter.prototype.isShadowRoot = function (node) { return node instanceof DocumentFragment; };
BrowserDomAdapter.prototype.importIntoDoc = function (node) { return document.importNode(this.templateAwareRoot(node), true); };
BrowserDomAdapter.prototype.adoptNode = function (node) { return document.adoptNode(node); };
BrowserDomAdapter.prototype.getHref = function (el) { return el.getAttribute('href'); };
BrowserDomAdapter.prototype.getEventKey = function (event) {
var key = event.key;
if (key == null) {
key = event.keyIdentifier;
// keyIdentifier is defined in the old draft of DOM Level 3 Events implemented by Chrome and
// Safari cf
// http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-KeyboardEvents-Interfaces
if (key == null) {
return 'Unidentified';
}
if (key.startsWith('U+')) {
key = String.fromCharCode(parseInt(key.substring(2), 16));
if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) {
// There is a bug in Chrome for numeric keypad keys:
// https://code.google.com/p/chromium/issues/detail?id=155654
// 1, 2, 3 ... are reported as A, B, C ...
key = _chromeNumKeyPadMap[key];
}
}
}
return _keyMap[key] || key;
};
BrowserDomAdapter.prototype.getGlobalEventTarget = function (doc, target) {
if (target === 'window') {
return window;
}
if (target === 'document') {
return doc;
}
if (target === 'body') {
return doc.body;
}
return null;
};
BrowserDomAdapter.prototype.getHistory = function () { return window.history; };
BrowserDomAdapter.prototype.getLocation = function () { return window.location; };
BrowserDomAdapter.prototype.getBaseHref = function (doc) {
var href = getBaseElementHref();
return href == null ? null : relativePath(href);
};
BrowserDomAdapter.prototype.resetBaseElement = function () { baseElement = null; };
BrowserDomAdapter.prototype.getUserAgent = function () { return window.navigator.userAgent; };
BrowserDomAdapter.prototype.setData = function (element, name, value) {
this.setAttribute(element, 'data-' + name, value);
};
BrowserDomAdapter.prototype.getData = function (element, name) {
return this.getAttribute(element, 'data-' + name);
};
BrowserDomAdapter.prototype.getComputedStyle = function (element) { return getComputedStyle(element); };
// TODO(tbosch): move this into a separate environment class once we have it
BrowserDomAdapter.prototype.supportsWebAnimation = function () {
return typeof Element.prototype['animate'] === 'function';
};
BrowserDomAdapter.prototype.performanceNow = function () {
// performance.now() is not available in all browsers, see
// http://caniuse.com/#search=performance.now
return window.performance && window.performance.now ? window.performance.now() :
new Date().getTime();
};
BrowserDomAdapter.prototype.supportsCookies = function () { return true; };
BrowserDomAdapter.prototype.getCookie = function (name) { return Object(_angular_common__WEBPACK_IMPORTED_MODULE_1__["ɵparseCookieValue"])(document.cookie, name); };
BrowserDomAdapter.prototype.setCookie = function (name, value) {
// document.cookie is magical, assigning into it assigns/overrides one cookie value, but does
// not clear other cookies.
document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value);
};
return BrowserDomAdapter;
}(GenericBrowserDomAdapter));
var baseElement = null;
function getBaseElementHref() {
if (!baseElement) {
baseElement = document.querySelector('base');
if (!baseElement) {
return null;
}
}
return baseElement.getAttribute('href');
}
// based on urlUtils.js in AngularJS 1
var urlParsingNode;
function relativePath(url) {
if (!urlParsingNode) {
urlParsingNode = document.createElement('a');
}
urlParsingNode.setAttribute('href', url);
return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname :
'/' + urlParsingNode.pathname;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A DI Token representing the main rendering context. In a browser this is the DOM Document.
*
* Note: Document might not be available in the Application Context when Application and Rendering
* Contexts are not the same (e.g. when running the application into a Web Worker).
*
* @deprecated import from `@angular/common` instead.
*/
var DOCUMENT$1 = _angular_common__WEBPACK_IMPORTED_MODULE_1__["DOCUMENT"];
/**
* @license
* Copyright Google Inc. 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
*/
function supportsState() {
return !!window.history.pushState;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* `PlatformLocation` encapsulates all of the direct calls to platform APIs.
* This class should not be used directly by an application developer. Instead, use
* {@link Location}.
*/
var BrowserPlatformLocation = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BrowserPlatformLocation, _super);
function BrowserPlatformLocation(_doc) {
var _this = _super.call(this) || this;
_this._doc = _doc;
_this._init();
return _this;
}
// This is moved to its own method so that `MockPlatformLocationStrategy` can overwrite it
/** @internal */
BrowserPlatformLocation.prototype._init = function () {
this.location = getDOM().getLocation();
this._history = getDOM().getHistory();
};
BrowserPlatformLocation.prototype.getBaseHrefFromDOM = function () { return getDOM().getBaseHref(this._doc); };
BrowserPlatformLocation.prototype.onPopState = function (fn) {
getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('popstate', fn, false);
};
BrowserPlatformLocation.prototype.onHashChange = function (fn) {
getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('hashchange', fn, false);
};
Object.defineProperty(BrowserPlatformLocation.prototype, "pathname", {
get: function () { return this.location.pathname; },
set: function (newPath) { this.location.pathname = newPath; },
enumerable: true,
configurable: true
});
Object.defineProperty(BrowserPlatformLocation.prototype, "search", {
get: function () { return this.location.search; },
enumerable: true,
configurable: true
});
Object.defineProperty(BrowserPlatformLocation.prototype, "hash", {
get: function () { return this.location.hash; },
enumerable: true,
configurable: true
});
BrowserPlatformLocation.prototype.pushState = function (state, title, url) {
if (supportsState()) {
this._history.pushState(state, title, url);
}
else {
this.location.hash = url;
}
};
BrowserPlatformLocation.prototype.replaceState = function (state, title, url) {
if (supportsState()) {
this._history.replaceState(state, title, url);
}
else {
this.location.hash = url;
}
};
BrowserPlatformLocation.prototype.forward = function () { this._history.forward(); };
BrowserPlatformLocation.prototype.back = function () { this._history.back(); };
BrowserPlatformLocation.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
BrowserPlatformLocation.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [DOCUMENT$1,] }] }
]; };
return BrowserPlatformLocation;
}(_angular_common__WEBPACK_IMPORTED_MODULE_1__["PlatformLocation"]));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A service that can be used to get and add meta tags.
*
* @experimental
*/
var Meta = /** @class */ (function () {
function Meta(_doc) {
this._doc = _doc;
this._dom = getDOM();
}
Meta.prototype.addTag = function (tag, forceCreation) {
if (forceCreation === void 0) { forceCreation = false; }
if (!tag)
return null;
return this._getOrCreateElement(tag, forceCreation);
};
Meta.prototype.addTags = function (tags, forceCreation) {
var _this = this;
if (forceCreation === void 0) { forceCreation = false; }
if (!tags)
return [];
return tags.reduce(function (result, tag) {
if (tag) {
result.push(_this._getOrCreateElement(tag, forceCreation));
}
return result;
}, []);
};
Meta.prototype.getTag = function (attrSelector) {
if (!attrSelector)
return null;
return this._dom.querySelector(this._doc, "meta[" + attrSelector + "]") || null;
};
Meta.prototype.getTags = function (attrSelector) {
if (!attrSelector)
return [];
var list /*NodeList*/ = this._dom.querySelectorAll(this._doc, "meta[" + attrSelector + "]");
return list ? [].slice.call(list) : [];
};
Meta.prototype.updateTag = function (tag, selector) {
if (!tag)
return null;
selector = selector || this._parseSelector(tag);
var meta = this.getTag(selector);
if (meta) {
return this._setMetaElementAttributes(tag, meta);
}
return this._getOrCreateElement(tag, true);
};
Meta.prototype.removeTag = function (attrSelector) { this.removeTagElement(this.getTag(attrSelector)); };
Meta.prototype.removeTagElement = function (meta) {
if (meta) {
this._dom.remove(meta);
}
};
Meta.prototype._getOrCreateElement = function (meta, forceCreation) {
if (forceCreation === void 0) { forceCreation = false; }
if (!forceCreation) {
var selector = this._parseSelector(meta);
var elem = this.getTag(selector);
// It's allowed to have multiple elements with the same name so it's not enough to
// just check that element with the same name already present on the page. We also need to
// check if element has tag attributes
if (elem && this._containsAttributes(meta, elem))
return elem;
}
var element = this._dom.createElement('meta');
this._setMetaElementAttributes(meta, element);
var head = this._dom.getElementsByTagName(this._doc, 'head')[0];
this._dom.appendChild(head, element);
return element;
};
Meta.prototype._setMetaElementAttributes = function (tag, el) {
var _this = this;
Object.keys(tag).forEach(function (prop) { return _this._dom.setAttribute(el, prop, tag[prop]); });
return el;
};
Meta.prototype._parseSelector = function (tag) {
var attr = tag.name ? 'name' : 'property';
return attr + "=\"" + tag[attr] + "\"";
};
Meta.prototype._containsAttributes = function (tag, elem) {
var _this = this;
return Object.keys(tag).every(function (key) { return _this._dom.getAttribute(elem, key) === tag[key]; });
};
Meta.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
Meta.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [DOCUMENT$1,] }] }
]; };
return Meta;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* An id that identifies a particular application being bootstrapped, that should
* match across the client/server boundary.
*/
var TRANSITION_ID = new _angular_core__WEBPACK_IMPORTED_MODULE_2__["InjectionToken"]('TRANSITION_ID');
function appInitializerFactory(transitionId, document, injector) {
return function () {
// Wait for all application initializers to be completed before removing the styles set by
// the server.
injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ApplicationInitStatus"]).donePromise.then(function () {
var dom = getDOM();
var styles = Array.prototype.slice.apply(dom.querySelectorAll(document, "style[ng-transition]"));
styles.filter(function (el) { return dom.getAttribute(el, 'ng-transition') === transitionId; })
.forEach(function (el) { return dom.remove(el); });
});
};
}
var SERVER_TRANSITION_PROVIDERS = [
{
provide: _angular_core__WEBPACK_IMPORTED_MODULE_2__["APP_INITIALIZER"],
useFactory: appInitializerFactory,
deps: [TRANSITION_ID, DOCUMENT$1, _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injector"]],
multi: true
},
];
/**
* @license
* Copyright Google Inc. 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 BrowserGetTestability = /** @class */ (function () {
function BrowserGetTestability() {
}
BrowserGetTestability.init = function () { Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["setTestabilityGetter"])(new BrowserGetTestability()); };
BrowserGetTestability.prototype.addToWindow = function (registry) {
_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵglobal"]['getAngularTestability'] = function (elem, findInAncestors) {
if (findInAncestors === void 0) { findInAncestors = true; }
var testability = registry.findTestabilityInTree(elem, findInAncestors);
if (testability == null) {
throw new Error('Could not find testability for element.');
}
return testability;
};
_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵglobal"]['getAllAngularTestabilities'] = function () { return registry.getAllTestabilities(); };
_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵglobal"]['getAllAngularRootElements'] = function () { return registry.getAllRootElements(); };
var whenAllStable = function (callback /** TODO #9100 */) {
var testabilities = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵglobal"]['getAllAngularTestabilities']();
var count = testabilities.length;
var didWork = false;
var decrement = function (didWork_ /** TODO #9100 */) {
didWork = didWork || didWork_;
count--;
if (count == 0) {
callback(didWork);
}
};
testabilities.forEach(function (testability /** TODO #9100 */) {
testability.whenStable(decrement);
});
};
if (!_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵglobal"]['frameworkStabilizers']) {
_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵglobal"]['frameworkStabilizers'] = [];
}
_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵglobal"]['frameworkStabilizers'].push(whenAllStable);
};
BrowserGetTestability.prototype.findTestabilityInTree = function (registry, elem, findInAncestors) {
if (elem == null) {
return null;
}
var t = registry.getTestability(elem);
if (t != null) {
return t;
}
else if (!findInAncestors) {
return null;
}
if (getDOM().isShadowRoot(elem)) {
return this.findTestabilityInTree(registry, getDOM().getHost(elem), true);
}
return this.findTestabilityInTree(registry, getDOM().parentElement(elem), true);
};
return BrowserGetTestability;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* A service that can be used to get and set the title of a current HTML document.
*
* Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)
* it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
* (representing the `<title>` tag). Instead, this service can be used to set and get the current
* title value.
*
* @experimental
*/
var Title = /** @class */ (function () {
function Title(_doc) {
this._doc = _doc;
}
/**
* Get the title of the current HTML document.
*/
Title.prototype.getTitle = function () { return getDOM().getTitle(this._doc); };
/**
* Set the title of the current HTML document.
* @param newTitle
*/
Title.prototype.setTitle = function (newTitle) { getDOM().setTitle(this._doc, newTitle); };
Title.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
Title.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [DOCUMENT$1,] }] }
]; };
return Title;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if
* `name` is `'probe'`.
* @param name Name under which it will be exported. Keep in mind this will be a property of the
* global `ng` object.
* @param value The value to export.
*/
function exportNgVar(name, value) {
if (typeof COMPILED === 'undefined' || !COMPILED) {
// Note: we can't export `ng` when using closure enhanced optimization as:
// - closure declares globals itself for minified names, which sometimes clobber our `ng` global
// - we can't declare a closure extern as the namespace `ng` is already used within Google
// for typings for angularJS (via `goog.provide('ng....')`).
var ng = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵglobal"]['ng'] = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵglobal"]['ng'] || {};
ng[name] = value;
}
}
/**
* @license
* Copyright Google Inc. 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 CORE_TOKENS = {
'ApplicationRef': _angular_core__WEBPACK_IMPORTED_MODULE_2__["ApplicationRef"],
'NgZone': _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgZone"],
};
var INSPECT_GLOBAL_NAME = 'probe';
var CORE_TOKENS_GLOBAL_NAME = 'coreTokens';
/**
* Returns a {@link DebugElement} for the given native DOM element, or
* null if the given native element does not have an Angular view associated
* with it.
*/
function inspectNativeElement(element) {
return Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["getDebugNode"])(element);
}
function _createNgProbe(coreTokens) {
exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElement);
exportNgVar(CORE_TOKENS_GLOBAL_NAME, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, CORE_TOKENS, _ngProbeTokensToMap(coreTokens || [])));
return function () { return inspectNativeElement; };
}
function _ngProbeTokensToMap(tokens) {
return tokens.reduce(function (prev, t) { return (prev[t.name] = t.token, prev); }, {});
}
/**
* Providers which support debugging Angular applications (e.g. via `ng.probe`).
*/
var ELEMENT_PROBE_PROVIDERS = [
{
provide: _angular_core__WEBPACK_IMPORTED_MODULE_2__["APP_INITIALIZER"],
useFactory: _createNgProbe,
deps: [
[_angular_core__WEBPACK_IMPORTED_MODULE_2__["NgProbeToken"], new _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"]()],
],
multi: true,
},
];
/**
* @license
* Copyright Google Inc. 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
*/
/**
* The injection token for the event-manager plug-in service.
*/
var EVENT_MANAGER_PLUGINS = new _angular_core__WEBPACK_IMPORTED_MODULE_2__["InjectionToken"]('EventManagerPlugins');
/**
* An injectable service that provides event management for Angular
* through a browser plug-in.
*/
var EventManager = /** @class */ (function () {
/**
* Initializes an instance of the event-manager service.
*/
function EventManager(plugins, _zone) {
var _this = this;
this._zone = _zone;
this._eventNameToPlugin = new Map();
plugins.forEach(function (p) { return p.manager = _this; });
this._plugins = plugins.slice().reverse();
}
/**
* Registers a handler for a specific element and event.
*
* @param element The HTML element to receive event notifications.
* @param eventName The name of the event to listen for.
* @param handler A function to call when the notification occurs. Receives the
* event object as an argument.
* @returns A callback function that can be used to remove the handler.
*/
EventManager.prototype.addEventListener = function (element, eventName, handler) {
var plugin = this._findPluginFor(eventName);
return plugin.addEventListener(element, eventName, handler);
};
/**
* Registers a global handler for an event in a target view.
*
* @param target A target for global event notifications. One of "window", "document", or "body".
* @param eventName The name of the event to listen for.
* @param handler A function to call when the notification occurs. Receives the
* event object as an argument.
* @returns A callback function that can be used to remove the handler.
*/
EventManager.prototype.addGlobalEventListener = function (target, eventName, handler) {
var plugin = this._findPluginFor(eventName);
return plugin.addGlobalEventListener(target, eventName, handler);
};
/**
* Retrieves the compilation zone in which event listeners are registered.
*/
EventManager.prototype.getZone = function () { return this._zone; };
/** @internal */
EventManager.prototype._findPluginFor = function (eventName) {
var plugin = this._eventNameToPlugin.get(eventName);
if (plugin) {
return plugin;
}
var plugins = this._plugins;
for (var i = 0; i < plugins.length; i++) {
var plugin_1 = plugins[i];
if (plugin_1.supports(eventName)) {
this._eventNameToPlugin.set(eventName, plugin_1);
return plugin_1;
}
}
throw new Error("No event manager plugin found for event " + eventName);
};
EventManager.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
EventManager.ctorParameters = function () { return [
{ type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [EVENT_MANAGER_PLUGINS,] }] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgZone"] }
]; };
return EventManager;
}());
var EventManagerPlugin = /** @class */ (function () {
function EventManagerPlugin(_doc) {
this._doc = _doc;
}
EventManagerPlugin.prototype.addGlobalEventListener = function (element, eventName, handler) {
var target = getDOM().getGlobalEventTarget(this._doc, element);
if (!target) {
throw new Error("Unsupported event target " + target + " for event " + eventName);
}
return this.addEventListener(target, eventName, handler);
};
return EventManagerPlugin;
}());
/**
* @license
* Copyright Google Inc. 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 SharedStylesHost = /** @class */ (function () {
function SharedStylesHost() {
/** @internal */
this._stylesSet = new Set();
}
SharedStylesHost.prototype.addStyles = function (styles) {
var _this = this;
var additions = new Set();
styles.forEach(function (style) {
if (!_this._stylesSet.has(style)) {
_this._stylesSet.add(style);
additions.add(style);
}
});
this.onStylesAdded(additions);
};
SharedStylesHost.prototype.onStylesAdded = function (additions) { };
SharedStylesHost.prototype.getAllStyles = function () { return Array.from(this._stylesSet); };
SharedStylesHost.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
return SharedStylesHost;
}());
var DomSharedStylesHost = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(DomSharedStylesHost, _super);
function DomSharedStylesHost(_doc) {
var _this = _super.call(this) || this;
_this._doc = _doc;
_this._hostNodes = new Set();
_this._styleNodes = new Set();
_this._hostNodes.add(_doc.head);
return _this;
}
DomSharedStylesHost.prototype._addStylesToHost = function (styles, host) {
var _this = this;
styles.forEach(function (style) {
var styleEl = _this._doc.createElement('style');
styleEl.textContent = style;
_this._styleNodes.add(host.appendChild(styleEl));
});
};
DomSharedStylesHost.prototype.addHost = function (hostNode) {
this._addStylesToHost(this._stylesSet, hostNode);
this._hostNodes.add(hostNode);
};
DomSharedStylesHost.prototype.removeHost = function (hostNode) { this._hostNodes.delete(hostNode); };
DomSharedStylesHost.prototype.onStylesAdded = function (additions) {
var _this = this;
this._hostNodes.forEach(function (hostNode) { return _this._addStylesToHost(additions, hostNode); });
};
DomSharedStylesHost.prototype.ngOnDestroy = function () { this._styleNodes.forEach(function (styleNode) { return getDOM().remove(styleNode); }); };
DomSharedStylesHost.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
DomSharedStylesHost.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [DOCUMENT$1,] }] }
]; };
return DomSharedStylesHost;
}(SharedStylesHost));
/**
* @license
* Copyright Google Inc. 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 NAMESPACE_URIS = {
'svg': 'http://www.w3.org/2000/svg',
'xhtml': 'http://www.w3.org/1999/xhtml',
'xlink': 'http://www.w3.org/1999/xlink',
'xml': 'http://www.w3.org/XML/1998/namespace',
'xmlns': 'http://www.w3.org/2000/xmlns/',
};
var COMPONENT_REGEX = /%COMP%/g;
var COMPONENT_VARIABLE = '%COMP%';
var HOST_ATTR = "_nghost-" + COMPONENT_VARIABLE;
var CONTENT_ATTR = "_ngcontent-" + COMPONENT_VARIABLE;
function shimContentAttribute(componentShortId) {
return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);
}
function shimHostAttribute(componentShortId) {
return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
}
function flattenStyles(compId, styles, target) {
for (var i = 0; i < styles.length; i++) {
var style = styles[i];
if (Array.isArray(style)) {
flattenStyles(compId, style, target);
}
else {
style = style.replace(COMPONENT_REGEX, compId);
target.push(style);
}
}
return target;
}
function decoratePreventDefault(eventHandler) {
return function (event) {
var allowDefaultBehavior = eventHandler(event);
if (allowDefaultBehavior === false) {
// TODO(tbosch): move preventDefault into event plugins...
event.preventDefault();
event.returnValue = false;
}
};
}
var DomRendererFactory2 = /** @class */ (function () {
function DomRendererFactory2(eventManager, sharedStylesHost) {
this.eventManager = eventManager;
this.sharedStylesHost = sharedStylesHost;
this.rendererByCompId = new Map();
this.defaultRenderer = new DefaultDomRenderer2(eventManager);
}
DomRendererFactory2.prototype.createRenderer = function (element, type) {
if (!element || !type) {
return this.defaultRenderer;
}
switch (type.encapsulation) {
case _angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewEncapsulation"].Emulated: {
var renderer = this.rendererByCompId.get(type.id);
if (!renderer) {
renderer =
new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type);
this.rendererByCompId.set(type.id, renderer);
}
renderer.applyToHost(element);
return renderer;
}
case _angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewEncapsulation"].Native:
case _angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewEncapsulation"].ShadowDom:
return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type);
default: {
if (!this.rendererByCompId.has(type.id)) {
var styles = flattenStyles(type.id, type.styles, []);
this.sharedStylesHost.addStyles(styles);
this.rendererByCompId.set(type.id, this.defaultRenderer);
}
return this.defaultRenderer;
}
}
};
DomRendererFactory2.prototype.begin = function () { };
DomRendererFactory2.prototype.end = function () { };
DomRendererFactory2.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
DomRendererFactory2.ctorParameters = function () { return [
{ type: EventManager },
{ type: DomSharedStylesHost }
]; };
return DomRendererFactory2;
}());
var DefaultDomRenderer2 = /** @class */ (function () {
function DefaultDomRenderer2(eventManager) {
this.eventManager = eventManager;
this.data = Object.create(null);
}
DefaultDomRenderer2.prototype.destroy = function () { };
DefaultDomRenderer2.prototype.createElement = function (name, namespace) {
if (namespace) {
return document.createElementNS(NAMESPACE_URIS[namespace], name);
}
return document.createElement(name);
};
DefaultDomRenderer2.prototype.createComment = function (value) { return document.createComment(value); };
DefaultDomRenderer2.prototype.createText = function (value) { return document.createTextNode(value); };
DefaultDomRenderer2.prototype.appendChild = function (parent, newChild) { parent.appendChild(newChild); };
DefaultDomRenderer2.prototype.insertBefore = function (parent, newChild, refChild) {
if (parent) {
parent.insertBefore(newChild, refChild);
}
};
DefaultDomRenderer2.prototype.removeChild = function (parent, oldChild) {
if (parent) {
parent.removeChild(oldChild);
}
};
DefaultDomRenderer2.prototype.selectRootElement = function (selectorOrNode) {
var el = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) :
selectorOrNode;
if (!el) {
throw new Error("The selector \"" + selectorOrNode + "\" did not match any elements");
}
el.textContent = '';
return el;
};
DefaultDomRenderer2.prototype.parentNode = function (node) { return node.parentNode; };
DefaultDomRenderer2.prototype.nextSibling = function (node) { return node.nextSibling; };
DefaultDomRenderer2.prototype.setAttribute = function (el, name, value, namespace) {
if (namespace) {
name = namespace + ":" + name;
var namespaceUri = NAMESPACE_URIS[namespace];
if (namespaceUri) {
el.setAttributeNS(namespaceUri, name, value);
}
else {
el.setAttribute(name, value);
}
}
else {
el.setAttribute(name, value);
}
};
DefaultDomRenderer2.prototype.removeAttribute = function (el, name, namespace) {
if (namespace) {
var namespaceUri = NAMESPACE_URIS[namespace];
if (namespaceUri) {
el.removeAttributeNS(namespaceUri, name);
}
else {
el.removeAttribute(namespace + ":" + name);
}
}
else {
el.removeAttribute(name);
}
};
DefaultDomRenderer2.prototype.addClass = function (el, name) { el.classList.add(name); };
DefaultDomRenderer2.prototype.removeClass = function (el, name) { el.classList.remove(name); };
DefaultDomRenderer2.prototype.setStyle = function (el, style, value, flags) {
if (flags & _angular_core__WEBPACK_IMPORTED_MODULE_2__["RendererStyleFlags2"].DashCase) {
el.style.setProperty(style, value, !!(flags & _angular_core__WEBPACK_IMPORTED_MODULE_2__["RendererStyleFlags2"].Important) ? 'important' : '');
}
else {
el.style[style] = value;
}
};
DefaultDomRenderer2.prototype.removeStyle = function (el, style, flags) {
if (flags & _angular_core__WEBPACK_IMPORTED_MODULE_2__["RendererStyleFlags2"].DashCase) {
el.style.removeProperty(style);
}
else {
// IE requires '' instead of null
// see https://github.com/angular/angular/issues/7916
el.style[style] = '';
}
};
DefaultDomRenderer2.prototype.setProperty = function (el, name, value) {
checkNoSyntheticProp(name, 'property');
el[name] = value;
};
DefaultDomRenderer2.prototype.setValue = function (node, value) { node.nodeValue = value; };
DefaultDomRenderer2.prototype.listen = function (target, event, callback) {
checkNoSyntheticProp(event, 'listener');
if (typeof target === 'string') {
return this.eventManager.addGlobalEventListener(target, event, decoratePreventDefault(callback));
}
return this.eventManager.addEventListener(target, event, decoratePreventDefault(callback));
};
return DefaultDomRenderer2;
}());
var AT_CHARCODE = '@'.charCodeAt(0);
function checkNoSyntheticProp(name, nameKind) {
if (name.charCodeAt(0) === AT_CHARCODE) {
throw new Error("Found the synthetic " + nameKind + " " + name + ". Please include either \"BrowserAnimationsModule\" or \"NoopAnimationsModule\" in your application.");
}
}
var EmulatedEncapsulationDomRenderer2 = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(EmulatedEncapsulationDomRenderer2, _super);
function EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, component) {
var _this = _super.call(this, eventManager) || this;
_this.component = component;
var styles = flattenStyles(component.id, component.styles, []);
sharedStylesHost.addStyles(styles);
_this.contentAttr = shimContentAttribute(component.id);
_this.hostAttr = shimHostAttribute(component.id);
return _this;
}
EmulatedEncapsulationDomRenderer2.prototype.applyToHost = function (element) { _super.prototype.setAttribute.call(this, element, this.hostAttr, ''); };
EmulatedEncapsulationDomRenderer2.prototype.createElement = function (parent, name) {
var el = _super.prototype.createElement.call(this, parent, name);
_super.prototype.setAttribute.call(this, el, this.contentAttr, '');
return el;
};
return EmulatedEncapsulationDomRenderer2;
}(DefaultDomRenderer2));
var ShadowDomRenderer = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ShadowDomRenderer, _super);
function ShadowDomRenderer(eventManager, sharedStylesHost, hostEl, component) {
var _this = _super.call(this, eventManager) || this;
_this.sharedStylesHost = sharedStylesHost;
_this.hostEl = hostEl;
_this.component = component;
if (component.encapsulation === _angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewEncapsulation"].ShadowDom) {
_this.shadowRoot = hostEl.attachShadow({ mode: 'open' });
}
else {
_this.shadowRoot = hostEl.createShadowRoot();
}
_this.sharedStylesHost.addHost(_this.shadowRoot);
var styles = flattenStyles(component.id, component.styles, []);
for (var i = 0; i < styles.length; i++) {
var styleEl = document.createElement('style');
styleEl.textContent = styles[i];
_this.shadowRoot.appendChild(styleEl);
}
return _this;
}
ShadowDomRenderer.prototype.nodeOrShadowRoot = function (node) { return node === this.hostEl ? this.shadowRoot : node; };
ShadowDomRenderer.prototype.destroy = function () { this.sharedStylesHost.removeHost(this.shadowRoot); };
ShadowDomRenderer.prototype.appendChild = function (parent, newChild) {
return _super.prototype.appendChild.call(this, this.nodeOrShadowRoot(parent), newChild);
};
ShadowDomRenderer.prototype.insertBefore = function (parent, newChild, refChild) {
return _super.prototype.insertBefore.call(this, this.nodeOrShadowRoot(parent), newChild, refChild);
};
ShadowDomRenderer.prototype.removeChild = function (parent, oldChild) {
return _super.prototype.removeChild.call(this, this.nodeOrShadowRoot(parent), oldChild);
};
ShadowDomRenderer.prototype.parentNode = function (node) {
return this.nodeOrShadowRoot(_super.prototype.parentNode.call(this, this.nodeOrShadowRoot(node)));
};
return ShadowDomRenderer;
}(DefaultDomRenderer2));
/**
* @license
* Copyright Google Inc. 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 ɵ0 = function (v) {
return '__zone_symbol__' + v;
};
/**
* Detect if Zone is present. If it is then use simple zone aware 'addEventListener'
* since Angular can do much more
* efficient bookkeeping than Zone can, because we have additional information. This speeds up
* addEventListener by 3x.
*/
var __symbol__ = (typeof Zone !== 'undefined') && Zone['__symbol__'] || ɵ0;
var ADD_EVENT_LISTENER = __symbol__('addEventListener');
var REMOVE_EVENT_LISTENER = __symbol__('removeEventListener');
var symbolNames = {};
var FALSE = 'FALSE';
var ANGULAR = 'ANGULAR';
var NATIVE_ADD_LISTENER = 'addEventListener';
var NATIVE_REMOVE_LISTENER = 'removeEventListener';
// use the same symbol string which is used in zone.js
var stopSymbol = '__zone_symbol__propagationStopped';
var stopMethodSymbol = '__zone_symbol__stopImmediatePropagation';
var blackListedEvents = (typeof Zone !== 'undefined') && Zone[__symbol__('BLACK_LISTED_EVENTS')];
var blackListedMap;
if (blackListedEvents) {
blackListedMap = {};
blackListedEvents.forEach(function (eventName) { blackListedMap[eventName] = eventName; });
}
var isBlackListedEvent = function (eventName) {
if (!blackListedMap) {
return false;
}
return blackListedMap.hasOwnProperty(eventName);
};
// a global listener to handle all dom event,
// so we do not need to create a closure every time
var globalListener = function (event) {
var symbolName = symbolNames[event.type];
if (!symbolName) {
return;
}
var taskDatas = this[symbolName];
if (!taskDatas) {
return;
}
var args = [event];
if (taskDatas.length === 1) {
// if taskDatas only have one element, just invoke it
var taskData = taskDatas[0];
if (taskData.zone !== Zone.current) {
// only use Zone.run when Zone.current not equals to stored zone
return taskData.zone.run(taskData.handler, this, args);
}
else {
return taskData.handler.apply(this, args);
}
}
else {
// copy tasks as a snapshot to avoid event handlers remove
// itself or others
var copiedTasks = taskDatas.slice();
for (var i = 0; i < copiedTasks.length; i++) {
// if other listener call event.stopImmediatePropagation
// just break
if (event[stopSymbol] === true) {
break;
}
var taskData = copiedTasks[i];
if (taskData.zone !== Zone.current) {
// only use Zone.run when Zone.current not equals to stored zone
taskData.zone.run(taskData.handler, this, args);
}
else {
taskData.handler.apply(this, args);
}
}
}
};
var DomEventsPlugin = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(DomEventsPlugin, _super);
function DomEventsPlugin(doc, ngZone, platformId) {
var _this = _super.call(this, doc) || this;
_this.ngZone = ngZone;
if (!platformId || !Object(_angular_common__WEBPACK_IMPORTED_MODULE_1__["isPlatformServer"])(platformId)) {
_this.patchEvent();
}
return _this;
}
DomEventsPlugin.prototype.patchEvent = function () {
if (typeof Event === 'undefined' || !Event || !Event.prototype) {
return;
}
if (Event.prototype[stopMethodSymbol]) {
// already patched by zone.js
return;
}
var delegate = Event.prototype[stopMethodSymbol] =
Event.prototype.stopImmediatePropagation;
Event.prototype.stopImmediatePropagation = function () {
if (this) {
this[stopSymbol] = true;
}
// should call native delegate in case
// in some environment part of the application
// will not use the patched Event
delegate && delegate.apply(this, arguments);
};
};
// This plugin should come last in the list of plugins, because it accepts all
// events.
DomEventsPlugin.prototype.supports = function (eventName) { return true; };
DomEventsPlugin.prototype.addEventListener = function (element, eventName, handler) {
var _this = this;
var zoneJsLoaded = element[ADD_EVENT_LISTENER];
var callback = handler;
// if zonejs is loaded and current zone is not ngZone
// we keep Zone.current on target for later restoration.
if (zoneJsLoaded && (!_angular_core__WEBPACK_IMPORTED_MODULE_2__["NgZone"].isInAngularZone() || isBlackListedEvent(eventName))) {
var symbolName = symbolNames[eventName];
if (!symbolName) {
symbolName = symbolNames[eventName] = __symbol__(ANGULAR + eventName + FALSE);
}
var taskDatas = element[symbolName];
var globalListenerRegistered = taskDatas && taskDatas.length > 0;
if (!taskDatas) {
taskDatas = element[symbolName] = [];
}
var zone = isBlackListedEvent(eventName) ? Zone.root : Zone.current;
if (taskDatas.length === 0) {
taskDatas.push({ zone: zone, handler: callback });
}
else {
var callbackRegistered = false;
for (var i = 0; i < taskDatas.length; i++) {
if (taskDatas[i].handler === callback) {
callbackRegistered = true;
break;
}
}
if (!callbackRegistered) {
taskDatas.push({ zone: zone, handler: callback });
}
}
if (!globalListenerRegistered) {
element[ADD_EVENT_LISTENER](eventName, globalListener, false);
}
}
else {
element[NATIVE_ADD_LISTENER](eventName, callback, false);
}
return function () { return _this.removeEventListener(element, eventName, callback); };
};
DomEventsPlugin.prototype.removeEventListener = function (target, eventName, callback) {
var underlyingRemove = target[REMOVE_EVENT_LISTENER];
// zone.js not loaded, use native removeEventListener
if (!underlyingRemove) {
return target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);
}
var symbolName = symbolNames[eventName];
var taskDatas = symbolName && target[symbolName];
if (!taskDatas) {
// addEventListener not using patched version
// just call native removeEventListener
return target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);
}
// fix issue 20532, should be able to remove
// listener which was added inside of ngZone
var found = false;
for (var i = 0; i < taskDatas.length; i++) {
// remove listener from taskDatas if the callback equals
if (taskDatas[i].handler === callback) {
found = true;
taskDatas.splice(i, 1);
break;
}
}
if (found) {
if (taskDatas.length === 0) {
// all listeners are removed, we can remove the globalListener from target
underlyingRemove.apply(target, [eventName, globalListener, false]);
}
}
else {
// not found in taskDatas, the callback may be added inside of ngZone
// use native remove listener to remove the callback
target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);
}
};
DomEventsPlugin.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
DomEventsPlugin.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [DOCUMENT$1,] }] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgZone"] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["PLATFORM_ID"],] }] }
]; };
return DomEventsPlugin;
}(EventManagerPlugin));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Supported HammerJS recognizer event names.
*/
var EVENT_NAMES = {
// pan
'pan': true,
'panstart': true,
'panmove': true,
'panend': true,
'pancancel': true,
'panleft': true,
'panright': true,
'panup': true,
'pandown': true,
// pinch
'pinch': true,
'pinchstart': true,
'pinchmove': true,
'pinchend': true,
'pinchcancel': true,
'pinchin': true,
'pinchout': true,
// press
'press': true,
'pressup': true,
// rotate
'rotate': true,
'rotatestart': true,
'rotatemove': true,
'rotateend': true,
'rotatecancel': true,
// swipe
'swipe': true,
'swipeleft': true,
'swiperight': true,
'swipeup': true,
'swipedown': true,
// tap
'tap': true,
};
/**
* DI token for providing [HammerJS](http://hammerjs.github.io/) support to Angular.
* @see `HammerGestureConfig`
*
* @experimental
*/
var HAMMER_GESTURE_CONFIG = new _angular_core__WEBPACK_IMPORTED_MODULE_2__["InjectionToken"]('HammerGestureConfig');
/**
* An injectable [HammerJS Manager](http://hammerjs.github.io/api/#hammer.manager)
* for gesture recognition. Configures specific event recognition.
* @experimental
*/
var HammerGestureConfig = /** @class */ (function () {
function HammerGestureConfig() {
/**
* A set of supported event names for gestures to be used in Angular.
* Angular supports all built-in recognizers, as listed in
* [HammerJS documentation](http://hammerjs.github.io/).
*/
this.events = [];
/**
* Maps gesture event names to a set of configuration options
* that specify overrides to the default values for specific properties.
*
* The key is a supported event name to be configured,
* and the options object contains a set of properties, with override values
* to be applied to the named recognizer event.
* For example, to disable recognition of the rotate event, specify
* `{"rotate": {"enable": false}}`.
*
* Properties that are not present take the HammerJS default values.
* For information about which properties are supported for which events,
* and their allowed and default values, see
* [HammerJS documentation](http://hammerjs.github.io/).
*
*/
this.overrides = {};
}
/**
* Creates a [HammerJS Manager](http://hammerjs.github.io/api/#hammer.manager)
* and attaches it to a given HTML element.
* @param element The element that will recognize gestures.
* @returns A HammerJS event-manager object.
*/
HammerGestureConfig.prototype.buildHammer = function (element) {
var mc = new Hammer(element, this.options);
mc.get('pinch').set({ enable: true });
mc.get('rotate').set({ enable: true });
for (var eventName in this.overrides) {
mc.get(eventName).set(this.overrides[eventName]);
}
return mc;
};
HammerGestureConfig.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
return HammerGestureConfig;
}());
var HammerGesturesPlugin = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(HammerGesturesPlugin, _super);
function HammerGesturesPlugin(doc, _config, console) {
var _this = _super.call(this, doc) || this;
_this._config = _config;
_this.console = console;
return _this;
}
HammerGesturesPlugin.prototype.supports = function (eventName) {
if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
return false;
}
if (!window.Hammer) {
this.console.warn("Hammer.js is not loaded, can not bind '" + eventName + "' event.");
return false;
}
return true;
};
HammerGesturesPlugin.prototype.addEventListener = function (element, eventName, handler) {
var _this = this;
var zone = this.manager.getZone();
eventName = eventName.toLowerCase();
return zone.runOutsideAngular(function () {
// Creating the manager bind events, must be done outside of angular
var mc = _this._config.buildHammer(element);
var callback = function (eventObj) {
zone.runGuarded(function () { handler(eventObj); });
};
mc.on(eventName, callback);
return function () { return mc.off(eventName, callback); };
});
};
HammerGesturesPlugin.prototype.isCustomEvent = function (eventName) { return this._config.events.indexOf(eventName) > -1; };
HammerGesturesPlugin.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
HammerGesturesPlugin.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [DOCUMENT$1,] }] },
{ type: HammerGestureConfig, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [HAMMER_GESTURE_CONFIG,] }] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵConsole"] }
]; };
return HammerGesturesPlugin;
}(EventManagerPlugin));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Defines supported modifiers for key events.
*/
var MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];
var ɵ0$1 = function (event) { return event.altKey; }, ɵ1$1 = function (event) { return event.ctrlKey; }, ɵ2$1 = function (event) { return event.metaKey; }, ɵ3 = function (event) { return event.shiftKey; };
/**
* Retrieves modifiers from key-event objects.
*/
var MODIFIER_KEY_GETTERS = {
'alt': ɵ0$1,
'control': ɵ1$1,
'meta': ɵ2$1,
'shift': ɵ3
};
/**
* @experimental
* A browser plug-in that provides support for handling of key events in Angular.
*/
var KeyEventsPlugin = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(KeyEventsPlugin, _super);
/**
* Initializes an instance of the browser plug-in.
* @param doc The document in which key events will be detected.
*/
function KeyEventsPlugin(doc) {
return _super.call(this, doc) || this;
}
/**
* Reports whether a named key event is supported.
* @param eventName The event name to query.
* @return True if the named key event is supported.
*/
KeyEventsPlugin.prototype.supports = function (eventName) { return KeyEventsPlugin.parseEventName(eventName) != null; };
/**
* Registers a handler for a specific element and key event.
* @param element The HTML element to receive event notifications.
* @param eventName The name of the key event to listen for.
* @param handler A function to call when the notification occurs. Receives the
* event object as an argument.
* @returns The key event that was registered.
*/
KeyEventsPlugin.prototype.addEventListener = function (element, eventName, handler) {
var parsedEvent = KeyEventsPlugin.parseEventName(eventName);
var outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());
return this.manager.getZone().runOutsideAngular(function () {
return getDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);
});
};
KeyEventsPlugin.parseEventName = function (eventName) {
var parts = eventName.toLowerCase().split('.');
var domEventName = parts.shift();
if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) {
return null;
}
var key = KeyEventsPlugin._normalizeKey(parts.pop());
var fullKey = '';
MODIFIER_KEYS.forEach(function (modifierName) {
var index = parts.indexOf(modifierName);
if (index > -1) {
parts.splice(index, 1);
fullKey += modifierName + '.';
}
});
fullKey += key;
if (parts.length != 0 || key.length === 0) {
// returning null instead of throwing to let another plugin process the event
return null;
}
var result = {};
result['domEventName'] = domEventName;
result['fullKey'] = fullKey;
return result;
};
KeyEventsPlugin.getEventFullKey = function (event) {
var fullKey = '';
var key = getDOM().getEventKey(event);
key = key.toLowerCase();
if (key === ' ') {
key = 'space'; // for readability
}
else if (key === '.') {
key = 'dot'; // because '.' is used as a separator in event names
}
MODIFIER_KEYS.forEach(function (modifierName) {
if (modifierName != key) {
var modifierGetter = MODIFIER_KEY_GETTERS[modifierName];
if (modifierGetter(event)) {
fullKey += modifierName + '.';
}
}
});
fullKey += key;
return fullKey;
};
/**
* Configures a handler callback for a key event.
* @param fullKey The event name that combines all simultaneous keystrokes.
* @param handler The function that responds to the key event.
* @param zone The zone in which the event occurred.
* @returns A callback function.
*/
KeyEventsPlugin.eventCallback = function (fullKey, handler, zone) {
return function (event /** TODO #9100 */) {
if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {
zone.runGuarded(function () { return handler(event); });
}
};
};
/** @internal */
KeyEventsPlugin._normalizeKey = function (keyName) {
// TODO: switch to a Map if the mapping grows too much
switch (keyName) {
case 'esc':
return 'escape';
default:
return keyName;
}
};
KeyEventsPlugin.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
KeyEventsPlugin.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [DOCUMENT$1,] }] }
]; };
return KeyEventsPlugin;
}(EventManagerPlugin));
/**
* @license
* Copyright Google Inc. 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
*/
/**
* DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
* values to be safe to use in the different DOM contexts.
*
* For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
* sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
* the website.
*
* In specific situations, it might be necessary to disable sanitization, for example if the
* application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
* Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
* methods, and then binding to that value from the template.
*
* These situations should be very rare, and extraordinary care must be taken to avoid creating a
* Cross Site Scripting (XSS) security bug!
*
* When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
* close as possible to the source of the value, to make it easy to verify no security bug is
* created by its use.
*
* It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
* does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
* code. The sanitizer leaves safe values intact.
*
* @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
* sanitization for the value passed in. Carefully check and audit all values and code paths going
* into this call. Make sure any user data is appropriately escaped for this security context.
* For more detail, see the [Security Guide](http://g.co/ng/security).
*
*
*/
var DomSanitizer = /** @class */ (function () {
function DomSanitizer() {
}
return DomSanitizer;
}());
var DomSanitizerImpl = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(DomSanitizerImpl, _super);
function DomSanitizerImpl(_doc) {
var _this = _super.call(this) || this;
_this._doc = _doc;
return _this;
}
DomSanitizerImpl.prototype.sanitize = function (ctx, value) {
if (value == null)
return null;
switch (ctx) {
case _angular_core__WEBPACK_IMPORTED_MODULE_2__["SecurityContext"].NONE:
return value;
case _angular_core__WEBPACK_IMPORTED_MODULE_2__["SecurityContext"].HTML:
if (value instanceof SafeHtmlImpl)
return value.changingThisBreaksApplicationSecurity;
this.checkNotSafeValue(value, 'HTML');
return Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵ_sanitizeHtml"])(this._doc, String(value));
case _angular_core__WEBPACK_IMPORTED_MODULE_2__["SecurityContext"].STYLE:
if (value instanceof SafeStyleImpl)
return value.changingThisBreaksApplicationSecurity;
this.checkNotSafeValue(value, 'Style');
return Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵ_sanitizeStyle"])(value);
case _angular_core__WEBPACK_IMPORTED_MODULE_2__["SecurityContext"].SCRIPT:
if (value instanceof SafeScriptImpl)
return value.changingThisBreaksApplicationSecurity;
this.checkNotSafeValue(value, 'Script');
throw new Error('unsafe value used in a script context');
case _angular_core__WEBPACK_IMPORTED_MODULE_2__["SecurityContext"].URL:
if (value instanceof SafeResourceUrlImpl || value instanceof SafeUrlImpl) {
// Allow resource URLs in URL contexts, they are strictly more trusted.
return value.changingThisBreaksApplicationSecurity;
}
this.checkNotSafeValue(value, 'URL');
return Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵ_sanitizeUrl"])(String(value));
case _angular_core__WEBPACK_IMPORTED_MODULE_2__["SecurityContext"].RESOURCE_URL:
if (value instanceof SafeResourceUrlImpl) {
return value.changingThisBreaksApplicationSecurity;
}
this.checkNotSafeValue(value, 'ResourceURL');
throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)');
default:
throw new Error("Unexpected SecurityContext " + ctx + " (see http://g.co/ng/security#xss)");
}
};
DomSanitizerImpl.prototype.checkNotSafeValue = function (value, expectedType) {
if (value instanceof SafeValueImpl) {
throw new Error("Required a safe " + expectedType + ", got a " + value.getTypeName() + " " +
"(see http://g.co/ng/security#xss)");
}
};
DomSanitizerImpl.prototype.bypassSecurityTrustHtml = function (value) { return new SafeHtmlImpl(value); };
DomSanitizerImpl.prototype.bypassSecurityTrustStyle = function (value) { return new SafeStyleImpl(value); };
DomSanitizerImpl.prototype.bypassSecurityTrustScript = function (value) { return new SafeScriptImpl(value); };
DomSanitizerImpl.prototype.bypassSecurityTrustUrl = function (value) { return new SafeUrlImpl(value); };
DomSanitizerImpl.prototype.bypassSecurityTrustResourceUrl = function (value) {
return new SafeResourceUrlImpl(value);
};
DomSanitizerImpl.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
/** @nocollapse */
DomSanitizerImpl.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Inject"], args: [DOCUMENT$1,] }] }
]; };
return DomSanitizerImpl;
}(DomSanitizer));
var SafeValueImpl = /** @class */ (function () {
function SafeValueImpl(changingThisBreaksApplicationSecurity) {
this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;
// empty
}
SafeValueImpl.prototype.toString = function () {
return "SafeValue must use [property]=binding: " + this.changingThisBreaksApplicationSecurity +
" (see http://g.co/ng/security#xss)";
};
return SafeValueImpl;
}());
var SafeHtmlImpl = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SafeHtmlImpl, _super);
function SafeHtmlImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
SafeHtmlImpl.prototype.getTypeName = function () { return 'HTML'; };
return SafeHtmlImpl;
}(SafeValueImpl));
var SafeStyleImpl = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SafeStyleImpl, _super);
function SafeStyleImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
SafeStyleImpl.prototype.getTypeName = function () { return 'Style'; };
return SafeStyleImpl;
}(SafeValueImpl));
var SafeScriptImpl = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SafeScriptImpl, _super);
function SafeScriptImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
SafeScriptImpl.prototype.getTypeName = function () { return 'Script'; };
return SafeScriptImpl;
}(SafeValueImpl));
var SafeUrlImpl = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SafeUrlImpl, _super);
function SafeUrlImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
SafeUrlImpl.prototype.getTypeName = function () { return 'URL'; };
return SafeUrlImpl;
}(SafeValueImpl));
var SafeResourceUrlImpl = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SafeResourceUrlImpl, _super);
function SafeResourceUrlImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
SafeResourceUrlImpl.prototype.getTypeName = function () { return 'ResourceURL'; };
return SafeResourceUrlImpl;
}(SafeValueImpl));
/**
* @license
* Copyright Google Inc. 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 INTERNAL_BROWSER_PLATFORM_PROVIDERS = [
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_2__["PLATFORM_ID"], useValue: _angular_common__WEBPACK_IMPORTED_MODULE_1__["ɵPLATFORM_BROWSER_ID"] },
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_2__["PLATFORM_INITIALIZER"], useValue: initDomAdapter, multi: true },
{ provide: _angular_common__WEBPACK_IMPORTED_MODULE_1__["PlatformLocation"], useClass: BrowserPlatformLocation, deps: [DOCUMENT$1] },
{ provide: DOCUMENT$1, useFactory: _document, deps: [] },
];
/**
* @security Replacing built-in sanitization providers exposes the application to XSS risks.
* Attacker-controlled data introduced by an unsanitized provider could expose your
* application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).
* @experimental
*/
var BROWSER_SANITIZATION_PROVIDERS = [
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Sanitizer"], useExisting: DomSanitizer },
{ provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [DOCUMENT$1] },
];
var platformBrowser = Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["createPlatformFactory"])(_angular_core__WEBPACK_IMPORTED_MODULE_2__["platformCore"], 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
function initDomAdapter() {
BrowserDomAdapter.makeCurrent();
BrowserGetTestability.init();
}
function errorHandler() {
return new _angular_core__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"]();
}
function _document() {
return document;
}
/**
* The ng module for the browser.
*
*
*/
var BrowserModule = /** @class */ (function () {
function BrowserModule(parentModule) {
if (parentModule) {
throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.");
}
}
/**
* Configures a browser-based application to transition from a server-rendered app, if
* one is present on the page. The specified parameters must include an application id,
* which must match between the client and server applications.
*
* @experimental
*/
BrowserModule.withServerTransition = function (params) {
return {
ngModule: BrowserModule,
providers: [
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_2__["APP_ID"], useValue: params.appId },
{ provide: TRANSITION_ID, useExisting: _angular_core__WEBPACK_IMPORTED_MODULE_2__["APP_ID"] },
SERVER_TRANSITION_PROVIDERS,
],
};
};
BrowserModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgModule"], args: [{
providers: [
BROWSER_SANITIZATION_PROVIDERS,
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵAPP_ROOT"], useValue: true },
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"], useFactory: errorHandler, deps: [] },
{ provide: EVENT_MANAGER_PLUGINS, useClass: DomEventsPlugin, multi: true },
{ provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true },
{ provide: EVENT_MANAGER_PLUGINS, useClass: HammerGesturesPlugin, multi: true },
{ provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig },
DomRendererFactory2,
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_2__["RendererFactory2"], useExisting: DomRendererFactory2 },
{ provide: SharedStylesHost, useExisting: DomSharedStylesHost },
DomSharedStylesHost,
_angular_core__WEBPACK_IMPORTED_MODULE_2__["Testability"],
EventManager,
ELEMENT_PROBE_PROVIDERS,
Meta,
Title,
],
exports: [_angular_common__WEBPACK_IMPORTED_MODULE_1__["CommonModule"], _angular_core__WEBPACK_IMPORTED_MODULE_2__["ApplicationModule"]]
},] }
];
/** @nocollapse */
BrowserModule.ctorParameters = function () { return [
{ type: BrowserModule, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["SkipSelf"] }] }
]; };
return BrowserModule;
}());
/**
* @license
* Copyright Google Inc. 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 win = typeof window !== 'undefined' && window || {};
/**
* @license
* Copyright Google Inc. 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 ChangeDetectionPerfRecord = /** @class */ (function () {
function ChangeDetectionPerfRecord(msPerTick, numTicks) {
this.msPerTick = msPerTick;
this.numTicks = numTicks;
}
return ChangeDetectionPerfRecord;
}());
/**
* Entry point for all Angular profiling-related debug tools. This object
* corresponds to the `ng.profiler` in the dev console.
*/
var AngularProfiler = /** @class */ (function () {
function AngularProfiler(ref) {
this.appRef = ref.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ApplicationRef"]);
}
// tslint:disable:no-console
/**
* Exercises change detection in a loop and then prints the average amount of
* time in milliseconds how long a single round of change detection takes for
* the current state of the UI. It runs a minimum of 5 rounds for a minimum
* of 500 milliseconds.
*
* Optionally, a user may pass a `config` parameter containing a map of
* options. Supported options are:
*
* `record` (boolean) - causes the profiler to record a CPU profile while
* it exercises the change detector. Example:
*
* ```
* ng.profiler.timeChangeDetection({record: true})
* ```
*/
AngularProfiler.prototype.timeChangeDetection = function (config) {
var record = config && config['record'];
var profileName = 'Change Detection';
// Profiler is not available in Android browsers, nor in IE 9 without dev tools opened
var isProfilerAvailable = win.console.profile != null;
if (record && isProfilerAvailable) {
win.console.profile(profileName);
}
var start = getDOM().performanceNow();
var numTicks = 0;
while (numTicks < 5 || (getDOM().performanceNow() - start) < 500) {
this.appRef.tick();
numTicks++;
}
var end = getDOM().performanceNow();
if (record && isProfilerAvailable) {
// need to cast to <any> because type checker thinks there's no argument
// while in fact there is:
//
// https://developer.mozilla.org/en-US/docs/Web/API/Console/profileEnd
win.console.profileEnd(profileName);
}
var msPerTick = (end - start) / numTicks;
win.console.log("ran " + numTicks + " change detection cycles");
win.console.log(msPerTick.toFixed(2) + " ms per check");
return new ChangeDetectionPerfRecord(msPerTick, numTicks);
};
return AngularProfiler;
}());
/**
* @license
* Copyright Google Inc. 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 PROFILER_GLOBAL_NAME = 'profiler';
/**
* Enabled Angular debug tools that are accessible via your browser's
* developer console.
*
* Usage:
*
* 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)
* 1. Type `ng.` (usually the console will show auto-complete suggestion)
* 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
* then hit Enter.
*
* @experimental All debugging apis are currently experimental.
*/
function enableDebugTools(ref) {
exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));
return ref;
}
/**
* Disables Angular tools.
*
* @experimental All debugging apis are currently experimental.
*/
function disableDebugTools() {
exportNgVar(PROFILER_GLOBAL_NAME, null);
}
/**
* @license
* Copyright Google Inc. 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
*/
function escapeHtml(text) {
var escapedText = {
'&': '&a;',
'"': '&q;',
'\'': '&s;',
'<': '&l;',
'>': '&g;',
};
return text.replace(/[&"'<>]/g, function (s) { return escapedText[s]; });
}
function unescapeHtml(text) {
var unescapedText = {
'&a;': '&',
'&q;': '"',
'&s;': '\'',
'&l;': '<',
'&g;': '>',
};
return text.replace(/&[^;]+;/g, function (s) { return unescapedText[s]; });
}
/**
* Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
*
* Example:
*
* ```
* const COUNTER_KEY = makeStateKey<number>('counter');
* let value = 10;
*
* transferState.set(COUNTER_KEY, value);
* ```
*
* @experimental
*/
function makeStateKey(key) {
return key;
}
/**
* A key value store that is transferred from the application on the server side to the application
* on the client side.
*
* `TransferState` will be available as an injectable token. To use it import
* `ServerTransferStateModule` on the server and `BrowserTransferStateModule` on the client.
*
* The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
* boolean, number, string, null and non-class objects will be serialized and deserialzied in a
* non-lossy manner.
*
* @experimental
*/
var TransferState = /** @class */ (function () {
function TransferState() {
this.store = {};
this.onSerializeCallbacks = {};
}
/** @internal */
TransferState.init = function (initState) {
var transferState = new TransferState();
transferState.store = initState;
return transferState;
};
/**
* Get the value corresponding to a key. Return `defaultValue` if key is not found.
*/
TransferState.prototype.get = function (key, defaultValue) {
return this.store[key] !== undefined ? this.store[key] : defaultValue;
};
/**
* Set the value corresponding to a key.
*/
TransferState.prototype.set = function (key, value) { this.store[key] = value; };
/**
* Remove a key from the store.
*/
TransferState.prototype.remove = function (key) { delete this.store[key]; };
/**
* Test whether a key exists in the store.
*/
TransferState.prototype.hasKey = function (key) { return this.store.hasOwnProperty(key); };
/**
* Register a callback to provide the value for a key when `toJson` is called.
*/
TransferState.prototype.onSerialize = function (key, callback) {
this.onSerializeCallbacks[key] = callback;
};
/**
* Serialize the current state of the store to JSON.
*/
TransferState.prototype.toJson = function () {
// Call the onSerialize callbacks and put those values into the store.
for (var key in this.onSerializeCallbacks) {
if (this.onSerializeCallbacks.hasOwnProperty(key)) {
try {
this.store[key] = this.onSerializeCallbacks[key]();
}
catch (e) {
console.warn('Exception in onSerialize callback: ', e);
}
}
}
return JSON.stringify(this.store);
};
TransferState.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"] }
];
return TransferState;
}());
function initTransferState(doc, appId) {
// Locate the script tag with the JSON data transferred from the server.
// The id of the script tag is set to the Angular appId + 'state'.
var script = doc.getElementById(appId + '-state');
var initialState = {};
if (script && script.textContent) {
try {
initialState = JSON.parse(unescapeHtml(script.textContent));
}
catch (e) {
console.warn('Exception while restoring TransferState for app ' + appId, e);
}
}
return TransferState.init(initialState);
}
/**
* NgModule to install on the client side while using the `TransferState` to transfer state from
* server to client.
*
* @experimental
*/
var BrowserTransferStateModule = /** @class */ (function () {
function BrowserTransferStateModule() {
}
BrowserTransferStateModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__["NgModule"], args: [{
providers: [{ provide: TransferState, useFactory: initTransferState, deps: [DOCUMENT$1, _angular_core__WEBPACK_IMPORTED_MODULE_2__["APP_ID"]] }],
},] }
];
return BrowserTransferStateModule;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Predicates for use with {@link DebugElement}'s query functions.
*
* @experimental All debugging apis are currently experimental.
*/
var By = /** @class */ (function () {
function By() {
}
/**
* Match all elements.
*
* ## Example
*
* {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}
*/
By.all = function () { return function (debugElement) { return true; }; };
/**
* Match elements by the given CSS selector.
*
* ## Example
*
* {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}
*/
By.css = function (selector) {
return function (debugElement) {
return debugElement.nativeElement != null ?
getDOM().elementMatches(debugElement.nativeElement, selector) :
false;
};
};
/**
* Match elements that have the given directive present.
*
* ## Example
*
* {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
*/
By.directive = function (type) {
return function (debugElement) { return debugElement.providerTokens.indexOf(type) !== -1; };
};
return By;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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 VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_2__["Version"]('6.0.9');
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
// This file only reexports content of the `src` folder. Keep it that way.
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Generated bundle index. Do not edit.
*/
//# sourceMappingURL=platform-browser.js.map
/***/ }),
/***/ "./node_modules/@angular/router/fesm5/router.js":
/*!******************************************************!*\
!*** ./node_modules/@angular/router/fesm5/router.js ***!
\******************************************************/
/*! exports provided: ɵangular_packages_router_router_a, ɵangular_packages_router_router_g, ɵangular_packages_router_router_h, ɵangular_packages_router_router_i, ɵangular_packages_router_router_d, ɵangular_packages_router_router_c, ɵangular_packages_router_router_j, ɵangular_packages_router_router_f, ɵangular_packages_router_router_b, ɵangular_packages_router_router_e, ɵangular_packages_router_router_k, ɵangular_packages_router_router_l, RouterLink, RouterLinkWithHref, RouterLinkActive, RouterOutlet, ActivationEnd, ActivationStart, ChildActivationEnd, ChildActivationStart, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouterEvent, RoutesRecognized, RouteReuseStrategy, Router, ROUTES, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, RouterModule, provideRoutes, ChildrenOutletContexts, OutletContext, NoPreloading, PreloadAllModules, PreloadingStrategy, RouterPreloader, ActivatedRoute, ActivatedRouteSnapshot, RouterState, RouterStateSnapshot, PRIMARY_OUTLET, convertToParamMap, UrlHandlingStrategy, DefaultUrlSerializer, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, ɵEmptyOutletComponent, ɵROUTER_PROVIDERS, ɵflatten */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_a", function() { return ROUTER_FORROOT_GUARD; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_g", function() { return RouterInitializer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_h", function() { return getAppInitializer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_i", function() { return getBootstrapListener; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_d", function() { return provideForRootGuard; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_c", function() { return provideLocationStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_j", function() { return provideRouterInitializer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_f", function() { return rootRoute; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_b", function() { return routerNgProbeToken; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_e", function() { return setupRouter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_k", function() { return Tree; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_l", function() { return TreeNode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterLink", function() { return RouterLink; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterLinkWithHref", function() { return RouterLinkWithHref; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterLinkActive", function() { return RouterLinkActive; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterOutlet", function() { return RouterOutlet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActivationEnd", function() { return ActivationEnd; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActivationStart", function() { return ActivationStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChildActivationEnd", function() { return ChildActivationEnd; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChildActivationStart", function() { return ChildActivationStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GuardsCheckEnd", function() { return GuardsCheckEnd; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GuardsCheckStart", function() { return GuardsCheckStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavigationCancel", function() { return NavigationCancel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavigationEnd", function() { return NavigationEnd; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavigationError", function() { return NavigationError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavigationStart", function() { return NavigationStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolveEnd", function() { return ResolveEnd; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolveStart", function() { return ResolveStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouteConfigLoadEnd", function() { return RouteConfigLoadEnd; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouteConfigLoadStart", function() { return RouteConfigLoadStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterEvent", function() { return RouterEvent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RoutesRecognized", function() { return RoutesRecognized; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouteReuseStrategy", function() { return RouteReuseStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return Router; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ROUTES", function() { return ROUTES; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ROUTER_CONFIGURATION", function() { return ROUTER_CONFIGURATION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ROUTER_INITIALIZER", function() { return ROUTER_INITIALIZER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterModule", function() { return RouterModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "provideRoutes", function() { return provideRoutes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChildrenOutletContexts", function() { return ChildrenOutletContexts; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutletContext", function() { return OutletContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoPreloading", function() { return NoPreloading; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreloadAllModules", function() { return PreloadAllModules; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreloadingStrategy", function() { return PreloadingStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterPreloader", function() { return RouterPreloader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActivatedRoute", function() { return ActivatedRoute; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActivatedRouteSnapshot", function() { return ActivatedRouteSnapshot; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterState", function() { return RouterState; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterStateSnapshot", function() { return RouterStateSnapshot; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PRIMARY_OUTLET", function() { return PRIMARY_OUTLET; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToParamMap", function() { return convertToParamMap; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlHandlingStrategy", function() { return UrlHandlingStrategy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultUrlSerializer", function() { return DefaultUrlSerializer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlSegment", function() { return UrlSegment; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlSegmentGroup", function() { return UrlSegmentGroup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlSerializer", function() { return UrlSerializer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlTree", function() { return UrlTree; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵEmptyOutletComponent", function() { return EmptyOutletComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵROUTER_PROVIDERS", function() { return ROUTER_PROVIDERS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵflatten", function() { return flatten; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/fesm5/platform-browser.js");
/**
* @license Angular v6.0.9
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
*
* Base for events the Router goes through, as opposed to events tied to a specific
* Route. `RouterEvent`s will only be fired one time for any given navigation.
*
* Example:
*
* ```
* class MyService {
* constructor(public router: Router, logger: Logger) {
* router.events.filter(e => e instanceof RouterEvent).subscribe(e => {
* logger.log(e.id, e.url);
* });
* }
* }
* ```
*
* @experimental
*/
var RouterEvent = /** @class */ (function () {
function RouterEvent(
/** @docsNotRequired */
id,
/** @docsNotRequired */
url) {
this.id = id;
this.url = url;
}
return RouterEvent;
}());
/**
* @description
*
* Represents an event triggered when a navigation starts.
*
*
*/
var NavigationStart = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NavigationStart, _super);
function NavigationStart(
/** @docsNotRequired */
id,
/** @docsNotRequired */
url,
/** @docsNotRequired */
navigationTrigger,
/** @docsNotRequired */
restoredState) {
/** @docsNotRequired */
if (navigationTrigger === void 0) { navigationTrigger = 'imperative'; }
/** @docsNotRequired */
if (restoredState === void 0) { restoredState = null; }
var _this = _super.call(this, id, url) || this;
_this.navigationTrigger = navigationTrigger;
_this.restoredState = restoredState;
return _this;
}
/** @docsNotRequired */
NavigationStart.prototype.toString = function () { return "NavigationStart(id: " + this.id + ", url: '" + this.url + "')"; };
return NavigationStart;
}(RouterEvent));
/**
* @description
*
* Represents an event triggered when a navigation ends successfully.
*
*
*/
var NavigationEnd = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NavigationEnd, _super);
function NavigationEnd(
/** @docsNotRequired */
id,
/** @docsNotRequired */
url,
/** @docsNotRequired */
urlAfterRedirects) {
var _this = _super.call(this, id, url) || this;
_this.urlAfterRedirects = urlAfterRedirects;
return _this;
}
/** @docsNotRequired */
NavigationEnd.prototype.toString = function () {
return "NavigationEnd(id: " + this.id + ", url: '" + this.url + "', urlAfterRedirects: '" + this.urlAfterRedirects + "')";
};
return NavigationEnd;
}(RouterEvent));
/**
* @description
*
* Represents an event triggered when a navigation is canceled.
*
*
*/
var NavigationCancel = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NavigationCancel, _super);
function NavigationCancel(
/** @docsNotRequired */
id,
/** @docsNotRequired */
url,
/** @docsNotRequired */
reason) {
var _this = _super.call(this, id, url) || this;
_this.reason = reason;
return _this;
}
/** @docsNotRequired */
NavigationCancel.prototype.toString = function () { return "NavigationCancel(id: " + this.id + ", url: '" + this.url + "')"; };
return NavigationCancel;
}(RouterEvent));
/**
* @description
*
* Represents an event triggered when a navigation fails due to an unexpected error.
*
*
*/
var NavigationError = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NavigationError, _super);
function NavigationError(
/** @docsNotRequired */
id,
/** @docsNotRequired */
url,
/** @docsNotRequired */
error) {
var _this = _super.call(this, id, url) || this;
_this.error = error;
return _this;
}
/** @docsNotRequired */
NavigationError.prototype.toString = function () {
return "NavigationError(id: " + this.id + ", url: '" + this.url + "', error: " + this.error + ")";
};
return NavigationError;
}(RouterEvent));
/**
* @description
*
* Represents an event triggered when routes are recognized.
*
*
*/
var RoutesRecognized = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(RoutesRecognized, _super);
function RoutesRecognized(
/** @docsNotRequired */
id,
/** @docsNotRequired */
url,
/** @docsNotRequired */
urlAfterRedirects,
/** @docsNotRequired */
state) {
var _this = _super.call(this, id, url) || this;
_this.urlAfterRedirects = urlAfterRedirects;
_this.state = state;
return _this;
}
/** @docsNotRequired */
RoutesRecognized.prototype.toString = function () {
return "RoutesRecognized(id: " + this.id + ", url: '" + this.url + "', urlAfterRedirects: '" + this.urlAfterRedirects + "', state: " + this.state + ")";
};
return RoutesRecognized;
}(RouterEvent));
/**
* @description
*
* Represents the start of the Guard phase of routing.
*
* @experimental
*/
var GuardsCheckStart = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GuardsCheckStart, _super);
function GuardsCheckStart(
/** @docsNotRequired */
id,
/** @docsNotRequired */
url,
/** @docsNotRequired */
urlAfterRedirects,
/** @docsNotRequired */
state) {
var _this = _super.call(this, id, url) || this;
_this.urlAfterRedirects = urlAfterRedirects;
_this.state = state;
return _this;
}
GuardsCheckStart.prototype.toString = function () {
return "GuardsCheckStart(id: " + this.id + ", url: '" + this.url + "', urlAfterRedirects: '" + this.urlAfterRedirects + "', state: " + this.state + ")";
};
return GuardsCheckStart;
}(RouterEvent));
/**
* @description
*
* Represents the end of the Guard phase of routing.
*
* @experimental
*/
var GuardsCheckEnd = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GuardsCheckEnd, _super);
function GuardsCheckEnd(
/** @docsNotRequired */
id,
/** @docsNotRequired */
url,
/** @docsNotRequired */
urlAfterRedirects,
/** @docsNotRequired */
state,
/** @docsNotRequired */
shouldActivate) {
var _this = _super.call(this, id, url) || this;
_this.urlAfterRedirects = urlAfterRedirects;
_this.state = state;
_this.shouldActivate = shouldActivate;
return _this;
}
GuardsCheckEnd.prototype.toString = function () {
return "GuardsCheckEnd(id: " + this.id + ", url: '" + this.url + "', urlAfterRedirects: '" + this.urlAfterRedirects + "', state: " + this.state + ", shouldActivate: " + this.shouldActivate + ")";
};
return GuardsCheckEnd;
}(RouterEvent));
/**
* @description
*
* Represents the start of the Resolve phase of routing. The timing of this
* event may change, thus it's experimental. In the current iteration it will run
* in the "resolve" phase whether there's things to resolve or not. In the future this
* behavior may change to only run when there are things to be resolved.
*
* @experimental
*/
var ResolveStart = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ResolveStart, _super);
function ResolveStart(
/** @docsNotRequired */
id,
/** @docsNotRequired */
url,
/** @docsNotRequired */
urlAfterRedirects,
/** @docsNotRequired */
state) {
var _this = _super.call(this, id, url) || this;
_this.urlAfterRedirects = urlAfterRedirects;
_this.state = state;
return _this;
}
ResolveStart.prototype.toString = function () {
return "ResolveStart(id: " + this.id + ", url: '" + this.url + "', urlAfterRedirects: '" + this.urlAfterRedirects + "', state: " + this.state + ")";
};
return ResolveStart;
}(RouterEvent));
/**
* @description
*
* Represents the end of the Resolve phase of routing. See note on
* `ResolveStart` for use of this experimental API.
*
* @experimental
*/
var ResolveEnd = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ResolveEnd, _super);
function ResolveEnd(
/** @docsNotRequired */
id,
/** @docsNotRequired */
url,
/** @docsNotRequired */
urlAfterRedirects,
/** @docsNotRequired */
state) {
var _this = _super.call(this, id, url) || this;
_this.urlAfterRedirects = urlAfterRedirects;
_this.state = state;
return _this;
}
ResolveEnd.prototype.toString = function () {
return "ResolveEnd(id: " + this.id + ", url: '" + this.url + "', urlAfterRedirects: '" + this.urlAfterRedirects + "', state: " + this.state + ")";
};
return ResolveEnd;
}(RouterEvent));
/**
* @description
*
* Represents an event triggered before lazy loading a route config.
*
* @experimental
*/
var RouteConfigLoadStart = /** @class */ (function () {
function RouteConfigLoadStart(
/** @docsNotRequired */
route) {
this.route = route;
}
RouteConfigLoadStart.prototype.toString = function () { return "RouteConfigLoadStart(path: " + this.route.path + ")"; };
return RouteConfigLoadStart;
}());
/**
* @description
*
* Represents an event triggered when a route has been lazy loaded.
*
* @experimental
*/
var RouteConfigLoadEnd = /** @class */ (function () {
function RouteConfigLoadEnd(
/** @docsNotRequired */
route) {
this.route = route;
}
RouteConfigLoadEnd.prototype.toString = function () { return "RouteConfigLoadEnd(path: " + this.route.path + ")"; };
return RouteConfigLoadEnd;
}());
/**
* @description
*
* Represents the start of end of the Resolve phase of routing. See note on
* `ChildActivationEnd` for use of this experimental API.
*
* @experimental
*/
var ChildActivationStart = /** @class */ (function () {
function ChildActivationStart(
/** @docsNotRequired */
snapshot) {
this.snapshot = snapshot;
}
ChildActivationStart.prototype.toString = function () {
var path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';
return "ChildActivationStart(path: '" + path + "')";
};
return ChildActivationStart;
}());
/**
* @description
*
* Represents the start of end of the Resolve phase of routing. See note on
* `ChildActivationStart` for use of this experimental API.
*
* @experimental
*/
var ChildActivationEnd = /** @class */ (function () {
function ChildActivationEnd(
/** @docsNotRequired */
snapshot) {
this.snapshot = snapshot;
}
ChildActivationEnd.prototype.toString = function () {
var path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';
return "ChildActivationEnd(path: '" + path + "')";
};
return ChildActivationEnd;
}());
/**
* @description
*
* Represents the start of end of the Resolve phase of routing. See note on
* `ActivationEnd` for use of this experimental API.
*
* @experimental
*/
var ActivationStart = /** @class */ (function () {
function ActivationStart(
/** @docsNotRequired */
snapshot) {
this.snapshot = snapshot;
}
ActivationStart.prototype.toString = function () {
var path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';
return "ActivationStart(path: '" + path + "')";
};
return ActivationStart;
}());
/**
* @description
*
* Represents the start of end of the Resolve phase of routing. See note on
* `ActivationStart` for use of this experimental API.
*
* @experimental
*/
var ActivationEnd = /** @class */ (function () {
function ActivationEnd(
/** @docsNotRequired */
snapshot) {
this.snapshot = snapshot;
}
ActivationEnd.prototype.toString = function () {
var path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';
return "ActivationEnd(path: '" + path + "')";
};
return ActivationEnd;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* This component is used internally within the router to be a placeholder when an empty
* router-outlet is needed. For example, with a config such as:
*
* `{path: 'parent', outlet: 'nav', children: [...]}`
*
* In order to render, there needs to be a component on this config, which will default
* to this `EmptyOutletComponent`.
*/
var EmptyOutletComponent = /** @class */ (function () {
function EmptyOutletComponent() {
}
EmptyOutletComponent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{ template: "<router-outlet></router-outlet>" }] }
];
return EmptyOutletComponent;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
*
* Name of the primary outlet.
*
*
*/
var PRIMARY_OUTLET = 'primary';
var ParamsAsMap = /** @class */ (function () {
function ParamsAsMap(params) {
this.params = params || {};
}
ParamsAsMap.prototype.has = function (name) { return this.params.hasOwnProperty(name); };
ParamsAsMap.prototype.get = function (name) {
if (this.has(name)) {
var v = this.params[name];
return Array.isArray(v) ? v[0] : v;
}
return null;
};
ParamsAsMap.prototype.getAll = function (name) {
if (this.has(name)) {
var v = this.params[name];
return Array.isArray(v) ? v : [v];
}
return [];
};
Object.defineProperty(ParamsAsMap.prototype, "keys", {
get: function () { return Object.keys(this.params); },
enumerable: true,
configurable: true
});
return ParamsAsMap;
}());
/**
* Convert a `Params` instance to a `ParamMap`.
*
*
*/
function convertToParamMap(params) {
return new ParamsAsMap(params);
}
var NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
function navigationCancelingError(message) {
var error = Error('NavigationCancelingError: ' + message);
error[NAVIGATION_CANCELING_ERROR] = true;
return error;
}
function isNavigationCancelingError(error) {
return error && error[NAVIGATION_CANCELING_ERROR];
}
// Matches the route configuration (`route`) against the actual URL (`segments`).
function defaultUrlMatcher(segments, segmentGroup, route) {
var parts = route.path.split('/');
if (parts.length > segments.length) {
// The actual URL is shorter than the config, no match
return null;
}
if (route.pathMatch === 'full' &&
(segmentGroup.hasChildren() || parts.length < segments.length)) {
// The config is longer than the actual URL but we are looking for a full match, return null
return null;
}
var posParams = {};
// Check each config part against the actual URL
for (var index = 0; index < parts.length; index++) {
var part = parts[index];
var segment = segments[index];
var isParameter = part.startsWith(':');
if (isParameter) {
posParams[part.substring(1)] = segment;
}
else if (part !== segment.path) {
// The actual URL part does not match the config, no match
return null;
}
}
return { consumed: segments.slice(0, parts.length), posParams: posParams };
}
/**
* @license
* Copyright Google Inc. 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 LoadedRouterConfig = /** @class */ (function () {
function LoadedRouterConfig(routes, module) {
this.routes = routes;
this.module = module;
}
return LoadedRouterConfig;
}());
function validateConfig(config, parentPath) {
if (parentPath === void 0) { parentPath = ''; }
// forEach doesn't iterate undefined values
for (var i = 0; i < config.length; i++) {
var route = config[i];
var fullPath = getFullPath(parentPath, route);
validateNode(route, fullPath);
}
}
function validateNode(route, fullPath) {
if (!route) {
throw new Error("\n Invalid configuration of route '" + fullPath + "': Encountered undefined route.\n The reason might be an extra comma.\n\n Example:\n const routes: Routes = [\n { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n { path: 'dashboard', component: DashboardComponent },, << two commas\n { path: 'detail/:id', component: HeroDetailComponent }\n ];\n ");
}
if (Array.isArray(route)) {
throw new Error("Invalid configuration of route '" + fullPath + "': Array cannot be specified");
}
if (!route.component && !route.children && !route.loadChildren &&
(route.outlet && route.outlet !== PRIMARY_OUTLET)) {
throw new Error("Invalid configuration of route '" + fullPath + "': a componentless route without children or loadChildren cannot have a named outlet set");
}
if (route.redirectTo && route.children) {
throw new Error("Invalid configuration of route '" + fullPath + "': redirectTo and children cannot be used together");
}
if (route.redirectTo && route.loadChildren) {
throw new Error("Invalid configuration of route '" + fullPath + "': redirectTo and loadChildren cannot be used together");
}
if (route.children && route.loadChildren) {
throw new Error("Invalid configuration of route '" + fullPath + "': children and loadChildren cannot be used together");
}
if (route.redirectTo && route.component) {
throw new Error("Invalid configuration of route '" + fullPath + "': redirectTo and component cannot be used together");
}
if (route.path && route.matcher) {
throw new Error("Invalid configuration of route '" + fullPath + "': path and matcher cannot be used together");
}
if (route.redirectTo === void 0 && !route.component && !route.children && !route.loadChildren) {
throw new Error("Invalid configuration of route '" + fullPath + "'. One of the following must be provided: component, redirectTo, children or loadChildren");
}
if (route.path === void 0 && route.matcher === void 0) {
throw new Error("Invalid configuration of route '" + fullPath + "': routes must have either a path or a matcher specified");
}
if (typeof route.path === 'string' && route.path.charAt(0) === '/') {
throw new Error("Invalid configuration of route '" + fullPath + "': path cannot start with a slash");
}
if (route.path === '' && route.redirectTo !== void 0 && route.pathMatch === void 0) {
var exp = "The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.";
throw new Error("Invalid configuration of route '{path: \"" + fullPath + "\", redirectTo: \"" + route.redirectTo + "\"}': please provide 'pathMatch'. " + exp);
}
if (route.pathMatch !== void 0 && route.pathMatch !== 'full' && route.pathMatch !== 'prefix') {
throw new Error("Invalid configuration of route '" + fullPath + "': pathMatch can only be set to 'prefix' or 'full'");
}
if (route.children) {
validateConfig(route.children, fullPath);
}
}
function getFullPath(parentPath, currentRoute) {
if (!currentRoute) {
return parentPath;
}
if (!parentPath && !currentRoute.path) {
return '';
}
else if (parentPath && !currentRoute.path) {
return parentPath + "/";
}
else if (!parentPath && currentRoute.path) {
return currentRoute.path;
}
else {
return parentPath + "/" + currentRoute.path;
}
}
/**
* Makes a copy of the config and adds any default required properties.
*/
function standardizeConfig(r) {
var children = r.children && r.children.map(standardizeConfig);
var c = children ? Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, r, { children: children }) : Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, r);
if (!c.component && (children || c.loadChildren) && (c.outlet && c.outlet !== PRIMARY_OUTLET)) {
c.component = EmptyOutletComponent;
}
return c;
}
/**
* @license
* Copyright Google Inc. 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
*/
function shallowEqualArrays(a, b) {
if (a.length !== b.length)
return false;
for (var i = 0; i < a.length; ++i) {
if (!shallowEqual(a[i], b[i]))
return false;
}
return true;
}
function shallowEqual(a, b) {
var k1 = Object.keys(a);
var k2 = Object.keys(b);
if (k1.length != k2.length) {
return false;
}
var key;
for (var i = 0; i < k1.length; i++) {
key = k1[i];
if (a[key] !== b[key]) {
return false;
}
}
return true;
}
/**
* Flattens single-level nested arrays.
*/
function flatten(arr) {
return Array.prototype.concat.apply([], arr);
}
/**
* Return the last element of an array.
*/
function last$1(a) {
return a.length > 0 ? a[a.length - 1] : null;
}
function forEach(map$$1, callback) {
for (var prop in map$$1) {
if (map$$1.hasOwnProperty(prop)) {
callback(map$$1[prop], prop);
}
}
}
function waitForMap(obj, fn) {
if (Object.keys(obj).length === 0) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])({});
}
var waitHead = [];
var waitTail = [];
var res = {};
forEach(obj, function (a, k) {
var mapped = fn(k, a).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (r) { return res[k] = r; }));
if (k === PRIMARY_OUTLET) {
waitHead.push(mapped);
}
else {
waitTail.push(mapped);
}
});
// Closure compiler has problem with using spread operator here. So just using Array.concat.
return rxjs__WEBPACK_IMPORTED_MODULE_2__["of"].apply(null, waitHead.concat(waitTail)).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["concatAll"])(), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["last"])(), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function () { return res; }));
}
/**
* ANDs Observables by merging all input observables, reducing to an Observable verifying all
* input Observables return `true`.
*/
function andObservables(observables) {
return observables.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeAll"])(), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["every"])(function (result) { return result === true; }));
}
function wrapIntoObservable(value) {
if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵisObservable"])(value)) {
return value;
}
if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵisPromise"])(value)) {
// Use `Promise.resolve()` to wrap promise-like instances.
// Required ie when a Resolver returns a AngularJS `$q` promise to correctly trigger the
// change detection.
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(Promise.resolve(value));
}
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(value);
}
/**
* @license
* Copyright Google Inc. 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
*/
function createEmptyUrlTree() {
return new UrlTree(new UrlSegmentGroup([], {}), {}, null);
}
function containsTree(container, containee, exact) {
if (exact) {
return equalQueryParams(container.queryParams, containee.queryParams) &&
equalSegmentGroups(container.root, containee.root);
}
return containsQueryParams(container.queryParams, containee.queryParams) &&
containsSegmentGroup(container.root, containee.root);
}
function equalQueryParams(container, containee) {
return shallowEqual(container, containee);
}
function equalSegmentGroups(container, containee) {
if (!equalPath(container.segments, containee.segments))
return false;
if (container.numberOfChildren !== containee.numberOfChildren)
return false;
for (var c in containee.children) {
if (!container.children[c])
return false;
if (!equalSegmentGroups(container.children[c], containee.children[c]))
return false;
}
return true;
}
function containsQueryParams(container, containee) {
return Object.keys(containee).length <= Object.keys(container).length &&
Object.keys(containee).every(function (key) { return containee[key] === container[key]; });
}
function containsSegmentGroup(container, containee) {
return containsSegmentGroupHelper(container, containee, containee.segments);
}
function containsSegmentGroupHelper(container, containee, containeePaths) {
if (container.segments.length > containeePaths.length) {
var current = container.segments.slice(0, containeePaths.length);
if (!equalPath(current, containeePaths))
return false;
if (containee.hasChildren())
return false;
return true;
}
else if (container.segments.length === containeePaths.length) {
if (!equalPath(container.segments, containeePaths))
return false;
for (var c in containee.children) {
if (!container.children[c])
return false;
if (!containsSegmentGroup(container.children[c], containee.children[c]))
return false;
}
return true;
}
else {
var current = containeePaths.slice(0, container.segments.length);
var next = containeePaths.slice(container.segments.length);
if (!equalPath(container.segments, current))
return false;
if (!container.children[PRIMARY_OUTLET])
return false;
return containsSegmentGroupHelper(container.children[PRIMARY_OUTLET], containee, next);
}
}
/**
* @description
*
* Represents the parsed URL.
*
* Since a router state is a tree, and the URL is nothing but a serialized state, the URL is a
* serialized tree.
* UrlTree is a data structure that provides a lot of affordances in dealing with URLs
*
* ### Example
*
* ```
* @Component({templateUrl:'template.html'})
* class MyComponent {
* constructor(router: Router) {
* const tree: UrlTree =
* router.parseUrl('/team/33/(user/victor//support:help)?debug=true#fragment');
* const f = tree.fragment; // return 'fragment'
* const q = tree.queryParams; // returns {debug: 'true'}
* const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];
* const s: UrlSegment[] = g.segments; // returns 2 segments 'team' and '33'
* g.children[PRIMARY_OUTLET].segments; // returns 2 segments 'user' and 'victor'
* g.children['support'].segments; // return 1 segment 'help'
* }
* }
* ```
*
*
*/
var UrlTree = /** @class */ (function () {
/** @internal */
function UrlTree(
/** The root segment group of the URL tree */
root,
/** The query params of the URL */
queryParams,
/** The fragment of the URL */
fragment) {
this.root = root;
this.queryParams = queryParams;
this.fragment = fragment;
}
Object.defineProperty(UrlTree.prototype, "queryParamMap", {
get: function () {
if (!this._queryParamMap) {
this._queryParamMap = convertToParamMap(this.queryParams);
}
return this._queryParamMap;
},
enumerable: true,
configurable: true
});
/** @docsNotRequired */
UrlTree.prototype.toString = function () { return DEFAULT_SERIALIZER.serialize(this); };
return UrlTree;
}());
/**
* @description
*
* Represents the parsed URL segment group.
*
* See `UrlTree` for more information.
*
*
*/
var UrlSegmentGroup = /** @class */ (function () {
function UrlSegmentGroup(
/** The URL segments of this group. See `UrlSegment` for more information */
segments,
/** The list of children of this group */
children) {
var _this = this;
this.segments = segments;
this.children = children;
/** The parent node in the url tree */
this.parent = null;
forEach(children, function (v, k) { return v.parent = _this; });
}
/** Whether the segment has child segments */
UrlSegmentGroup.prototype.hasChildren = function () { return this.numberOfChildren > 0; };
Object.defineProperty(UrlSegmentGroup.prototype, "numberOfChildren", {
/** Number of child segments */
get: function () { return Object.keys(this.children).length; },
enumerable: true,
configurable: true
});
/** @docsNotRequired */
UrlSegmentGroup.prototype.toString = function () { return serializePaths(this); };
return UrlSegmentGroup;
}());
/**
* @description
*
* Represents a single URL segment.
*
* A UrlSegment is a part of a URL between the two slashes. It contains a path and the matrix
* parameters associated with the segment.
*
* ## Example
*
* ```
* @Component({templateUrl:'template.html'})
* class MyComponent {
* constructor(router: Router) {
* const tree: UrlTree = router.parseUrl('/team;id=33');
* const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];
* const s: UrlSegment[] = g.segments;
* s[0].path; // returns 'team'
* s[0].parameters; // returns {id: 33}
* }
* }
* ```
*
*
*/
var UrlSegment = /** @class */ (function () {
function UrlSegment(
/** The path part of a URL segment */
path,
/** The matrix parameters associated with a segment */
parameters) {
this.path = path;
this.parameters = parameters;
}
Object.defineProperty(UrlSegment.prototype, "parameterMap", {
get: function () {
if (!this._parameterMap) {
this._parameterMap = convertToParamMap(this.parameters);
}
return this._parameterMap;
},
enumerable: true,
configurable: true
});
/** @docsNotRequired */
UrlSegment.prototype.toString = function () { return serializePath(this); };
return UrlSegment;
}());
function equalSegments(as, bs) {
return equalPath(as, bs) && as.every(function (a, i) { return shallowEqual(a.parameters, bs[i].parameters); });
}
function equalPath(as, bs) {
if (as.length !== bs.length)
return false;
return as.every(function (a, i) { return a.path === bs[i].path; });
}
function mapChildrenIntoArray(segment, fn) {
var res = [];
forEach(segment.children, function (child, childOutlet) {
if (childOutlet === PRIMARY_OUTLET) {
res = res.concat(fn(child, childOutlet));
}
});
forEach(segment.children, function (child, childOutlet) {
if (childOutlet !== PRIMARY_OUTLET) {
res = res.concat(fn(child, childOutlet));
}
});
return res;
}
/**
* @description
*
* Serializes and deserializes a URL string into a URL tree.
*
* The url serialization strategy is customizable. You can
* make all URLs case insensitive by providing a custom UrlSerializer.
*
* See `DefaultUrlSerializer` for an example of a URL serializer.
*
*
*/
var UrlSerializer = /** @class */ (function () {
function UrlSerializer() {
}
return UrlSerializer;
}());
/**
* @description
*
* A default implementation of the `UrlSerializer`.
*
* Example URLs:
*
* ```
* /inbox/33(popup:compose)
* /inbox/33;open=true/messages/44
* ```
*
* DefaultUrlSerializer uses parentheses to serialize secondary segments (e.g., popup:compose), the
* colon syntax to specify the outlet, and the ';parameter=value' syntax (e.g., open=true) to
* specify route specific parameters.
*
*
*/
var DefaultUrlSerializer = /** @class */ (function () {
function DefaultUrlSerializer() {
}
/** Parses a url into a `UrlTree` */
DefaultUrlSerializer.prototype.parse = function (url) {
var p = new UrlParser(url);
return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());
};
/** Converts a `UrlTree` into a url */
DefaultUrlSerializer.prototype.serialize = function (tree) {
var segment = "/" + serializeSegment(tree.root, true);
var query = serializeQueryParams(tree.queryParams);
var fragment = typeof tree.fragment === "string" ? "#" + encodeUriFragment(tree.fragment) : '';
return "" + segment + query + fragment;
};
return DefaultUrlSerializer;
}());
var DEFAULT_SERIALIZER = new DefaultUrlSerializer();
function serializePaths(segment) {
return segment.segments.map(function (p) { return serializePath(p); }).join('/');
}
function serializeSegment(segment, root) {
if (!segment.hasChildren()) {
return serializePaths(segment);
}
if (root) {
var primary = segment.children[PRIMARY_OUTLET] ?
serializeSegment(segment.children[PRIMARY_OUTLET], false) :
'';
var children_1 = [];
forEach(segment.children, function (v, k) {
if (k !== PRIMARY_OUTLET) {
children_1.push(k + ":" + serializeSegment(v, false));
}
});
return children_1.length > 0 ? primary + "(" + children_1.join('//') + ")" : primary;
}
else {
var children = mapChildrenIntoArray(segment, function (v, k) {
if (k === PRIMARY_OUTLET) {
return [serializeSegment(segment.children[PRIMARY_OUTLET], false)];
}
return [k + ":" + serializeSegment(v, false)];
});
return serializePaths(segment) + "/(" + children.join('//') + ")";
}
}
/**
* Encodes a URI string with the default encoding. This function will only ever be called from
* `encodeUriQuery` or `encodeUriSegment` as it's the base set of encodings to be used. We need
* a custom encoding because encodeURIComponent is too aggressive and encodes stuff that doesn't
* have to be encoded per https://url.spec.whatwg.org.
*/
function encodeUriString(s) {
return encodeURIComponent(s)
.replace(/%40/g, '@')
.replace(/%3A/gi, ':')
.replace(/%24/g, '$')
.replace(/%2C/gi, ',');
}
/**
* This function should be used to encode both keys and values in a query string key/value. In
* the following URL, you need to call encodeUriQuery on "k" and "v":
*
* http://www.site.org/html;mk=mv?k=v#f
*/
function encodeUriQuery(s) {
return encodeUriString(s).replace(/%3B/gi, ';');
}
/**
* This function should be used to encode a URL fragment. In the following URL, you need to call
* encodeUriFragment on "f":
*
* http://www.site.org/html;mk=mv?k=v#f
*/
function encodeUriFragment(s) {
return encodeURI(s);
}
/**
* This function should be run on any URI segment as well as the key and value in a key/value
* pair for matrix params. In the following URL, you need to call encodeUriSegment on "html",
* "mk", and "mv":
*
* http://www.site.org/html;mk=mv?k=v#f
*/
function encodeUriSegment(s) {
return encodeUriString(s).replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/%26/gi, '&');
}
function decode(s) {
return decodeURIComponent(s);
}
// Query keys/values should have the "+" replaced first, as "+" in a query string is " ".
// decodeURIComponent function will not decode "+" as a space.
function decodeQuery(s) {
return decode(s.replace(/\+/g, '%20'));
}
function serializePath(path) {
return "" + encodeUriSegment(path.path) + serializeMatrixParams(path.parameters);
}
function serializeMatrixParams(params) {
return Object.keys(params)
.map(function (key) { return ";" + encodeUriSegment(key) + "=" + encodeUriSegment(params[key]); })
.join('');
}
function serializeQueryParams(params) {
var strParams = Object.keys(params).map(function (name) {
var value = params[name];
return Array.isArray(value) ?
value.map(function (v) { return encodeUriQuery(name) + "=" + encodeUriQuery(v); }).join('&') :
encodeUriQuery(name) + "=" + encodeUriQuery(value);
});
return strParams.length ? "?" + strParams.join("&") : '';
}
var SEGMENT_RE = /^[^\/()?;=#]+/;
function matchSegments(str) {
var match = str.match(SEGMENT_RE);
return match ? match[0] : '';
}
var QUERY_PARAM_RE = /^[^=?&#]+/;
// Return the name of the query param at the start of the string or an empty string
function matchQueryParams(str) {
var match = str.match(QUERY_PARAM_RE);
return match ? match[0] : '';
}
var QUERY_PARAM_VALUE_RE = /^[^?&#]+/;
// Return the value of the query param at the start of the string or an empty string
function matchUrlQueryParamValue(str) {
var match = str.match(QUERY_PARAM_VALUE_RE);
return match ? match[0] : '';
}
var UrlParser = /** @class */ (function () {
function UrlParser(url) {
this.url = url;
this.remaining = url;
}
UrlParser.prototype.parseRootSegment = function () {
this.consumeOptional('/');
if (this.remaining === '' || this.peekStartsWith('?') || this.peekStartsWith('#')) {
return new UrlSegmentGroup([], {});
}
// The root segment group never has segments
return new UrlSegmentGroup([], this.parseChildren());
};
UrlParser.prototype.parseQueryParams = function () {
var params = {};
if (this.consumeOptional('?')) {
do {
this.parseQueryParam(params);
} while (this.consumeOptional('&'));
}
return params;
};
UrlParser.prototype.parseFragment = function () {
return this.consumeOptional('#') ? decodeURIComponent(this.remaining) : null;
};
UrlParser.prototype.parseChildren = function () {
if (this.remaining === '') {
return {};
}
this.consumeOptional('/');
var segments = [];
if (!this.peekStartsWith('(')) {
segments.push(this.parseSegment());
}
while (this.peekStartsWith('/') && !this.peekStartsWith('//') && !this.peekStartsWith('/(')) {
this.capture('/');
segments.push(this.parseSegment());
}
var children = {};
if (this.peekStartsWith('/(')) {
this.capture('/');
children = this.parseParens(true);
}
var res = {};
if (this.peekStartsWith('(')) {
res = this.parseParens(false);
}
if (segments.length > 0 || Object.keys(children).length > 0) {
res[PRIMARY_OUTLET] = new UrlSegmentGroup(segments, children);
}
return res;
};
// parse a segment with its matrix parameters
// ie `name;k1=v1;k2`
UrlParser.prototype.parseSegment = function () {
var path = matchSegments(this.remaining);
if (path === '' && this.peekStartsWith(';')) {
throw new Error("Empty path url segment cannot have parameters: '" + this.remaining + "'.");
}
this.capture(path);
return new UrlSegment(decode(path), this.parseMatrixParams());
};
UrlParser.prototype.parseMatrixParams = function () {
var params = {};
while (this.consumeOptional(';')) {
this.parseParam(params);
}
return params;
};
UrlParser.prototype.parseParam = function (params) {
var key = matchSegments(this.remaining);
if (!key) {
return;
}
this.capture(key);
var value = '';
if (this.consumeOptional('=')) {
var valueMatch = matchSegments(this.remaining);
if (valueMatch) {
value = valueMatch;
this.capture(value);
}
}
params[decode(key)] = decode(value);
};
// Parse a single query parameter `name[=value]`
UrlParser.prototype.parseQueryParam = function (params) {
var key = matchQueryParams(this.remaining);
if (!key) {
return;
}
this.capture(key);
var value = '';
if (this.consumeOptional('=')) {
var valueMatch = matchUrlQueryParamValue(this.remaining);
if (valueMatch) {
value = valueMatch;
this.capture(value);
}
}
var decodedKey = decodeQuery(key);
var decodedVal = decodeQuery(value);
if (params.hasOwnProperty(decodedKey)) {
// Append to existing values
var currentVal = params[decodedKey];
if (!Array.isArray(currentVal)) {
currentVal = [currentVal];
params[decodedKey] = currentVal;
}
currentVal.push(decodedVal);
}
else {
// Create a new value
params[decodedKey] = decodedVal;
}
};
// parse `(a/b//outlet_name:c/d)`
UrlParser.prototype.parseParens = function (allowPrimary) {
var segments = {};
this.capture('(');
while (!this.consumeOptional(')') && this.remaining.length > 0) {
var path = matchSegments(this.remaining);
var next = this.remaining[path.length];
// if is is not one of these characters, then the segment was unescaped
// or the group was not closed
if (next !== '/' && next !== ')' && next !== ';') {
throw new Error("Cannot parse url '" + this.url + "'");
}
var outletName = undefined;
if (path.indexOf(':') > -1) {
outletName = path.substr(0, path.indexOf(':'));
this.capture(outletName);
this.capture(':');
}
else if (allowPrimary) {
outletName = PRIMARY_OUTLET;
}
var children = this.parseChildren();
segments[outletName] = Object.keys(children).length === 1 ? children[PRIMARY_OUTLET] :
new UrlSegmentGroup([], children);
this.consumeOptional('//');
}
return segments;
};
UrlParser.prototype.peekStartsWith = function (str) { return this.remaining.startsWith(str); };
// Consumes the prefix when it is present and returns whether it has been consumed
UrlParser.prototype.consumeOptional = function (str) {
if (this.peekStartsWith(str)) {
this.remaining = this.remaining.substring(str.length);
return true;
}
return false;
};
UrlParser.prototype.capture = function (str) {
if (!this.consumeOptional(str)) {
throw new Error("Expected \"" + str + "\".");
}
};
return UrlParser;
}());
/**
* @license
* Copyright Google Inc. 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 NoMatch = /** @class */ (function () {
function NoMatch(segmentGroup) {
this.segmentGroup = segmentGroup || null;
}
return NoMatch;
}());
var AbsoluteRedirect = /** @class */ (function () {
function AbsoluteRedirect(urlTree) {
this.urlTree = urlTree;
}
return AbsoluteRedirect;
}());
function noMatch(segmentGroup) {
return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](function (obs) { return obs.error(new NoMatch(segmentGroup)); });
}
function absoluteRedirect(newTree) {
return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](function (obs) { return obs.error(new AbsoluteRedirect(newTree)); });
}
function namedOutletsRedirect(redirectTo) {
return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](function (obs) { return obs.error(new Error("Only absolute redirects can have named outlets. redirectTo: '" + redirectTo + "'")); });
}
function canLoadFails(route) {
return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](function (obs) { return obs.error(navigationCancelingError("Cannot load children because the guard of the route \"path: '" + route.path + "'\" returned false")); });
}
/**
* Returns the `UrlTree` with the redirection applied.
*
* Lazy modules are loaded along the way.
*/
function applyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config) {
return new ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config).apply();
}
var ApplyRedirects = /** @class */ (function () {
function ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config) {
this.configLoader = configLoader;
this.urlSerializer = urlSerializer;
this.urlTree = urlTree;
this.config = config;
this.allowRedirects = true;
this.ngModule = moduleInjector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleRef"]);
}
ApplyRedirects.prototype.apply = function () {
var _this = this;
var expanded$ = this.expandSegmentGroup(this.ngModule, this.config, this.urlTree.root, PRIMARY_OUTLET);
var urlTrees$ = expanded$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (rootSegmentGroup) { return _this.createUrlTree(rootSegmentGroup, _this.urlTree.queryParams, _this.urlTree.fragment); }));
return urlTrees$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(function (e) {
if (e instanceof AbsoluteRedirect) {
// after an absolute redirect we do not apply any more redirects!
_this.allowRedirects = false;
// we need to run matching, so we can fetch all lazy-loaded modules
return _this.match(e.urlTree);
}
if (e instanceof NoMatch) {
throw _this.noMatchError(e);
}
throw e;
}));
};
ApplyRedirects.prototype.match = function (tree) {
var _this = this;
var expanded$ = this.expandSegmentGroup(this.ngModule, this.config, tree.root, PRIMARY_OUTLET);
var mapped$ = expanded$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (rootSegmentGroup) {
return _this.createUrlTree(rootSegmentGroup, tree.queryParams, tree.fragment);
}));
return mapped$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(function (e) {
if (e instanceof NoMatch) {
throw _this.noMatchError(e);
}
throw e;
}));
};
ApplyRedirects.prototype.noMatchError = function (e) {
return new Error("Cannot match any routes. URL Segment: '" + e.segmentGroup + "'");
};
ApplyRedirects.prototype.createUrlTree = function (rootCandidate, queryParams, fragment) {
var root = rootCandidate.segments.length > 0 ?
new UrlSegmentGroup([], (_a = {}, _a[PRIMARY_OUTLET] = rootCandidate, _a)) :
rootCandidate;
return new UrlTree(root, queryParams, fragment);
var _a;
};
ApplyRedirects.prototype.expandSegmentGroup = function (ngModule, routes, segmentGroup, outlet) {
if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {
return this.expandChildren(ngModule, routes, segmentGroup)
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (children) { return new UrlSegmentGroup([], children); }));
}
return this.expandSegment(ngModule, segmentGroup, routes, segmentGroup.segments, outlet, true);
};
// Recursively expand segment groups for all the child outlets
ApplyRedirects.prototype.expandChildren = function (ngModule, routes, segmentGroup) {
var _this = this;
return waitForMap(segmentGroup.children, function (childOutlet, child) { return _this.expandSegmentGroup(ngModule, routes, child, childOutlet); });
};
ApplyRedirects.prototype.expandSegment = function (ngModule, segmentGroup, routes, segments, outlet, allowRedirects) {
var _this = this;
return rxjs__WEBPACK_IMPORTED_MODULE_2__["of"].apply(void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(routes)).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (r) {
var expanded$ = _this.expandSegmentAgainstRoute(ngModule, segmentGroup, routes, r, segments, outlet, allowRedirects);
return expanded$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(function (e) {
if (e instanceof NoMatch) {
// TODO(i): this return type doesn't match the declared Observable<UrlSegmentGroup> -
// talk to Jason
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null);
}
throw e;
}));
}), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["concatAll"])(), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["first"])(function (s) { return !!s; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(function (e, _) {
if (e instanceof rxjs__WEBPACK_IMPORTED_MODULE_2__["EmptyError"] || e.name === 'EmptyError') {
if (_this.noLeftoversInUrl(segmentGroup, segments, outlet)) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(new UrlSegmentGroup([], {}));
}
throw new NoMatch(segmentGroup);
}
throw e;
}));
};
ApplyRedirects.prototype.noLeftoversInUrl = function (segmentGroup, segments, outlet) {
return segments.length === 0 && !segmentGroup.children[outlet];
};
ApplyRedirects.prototype.expandSegmentAgainstRoute = function (ngModule, segmentGroup, routes, route, paths, outlet, allowRedirects) {
if (getOutlet(route) !== outlet) {
return noMatch(segmentGroup);
}
if (route.redirectTo === undefined) {
return this.matchSegmentAgainstRoute(ngModule, segmentGroup, route, paths);
}
if (allowRedirects && this.allowRedirects) {
return this.expandSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, paths, outlet);
}
return noMatch(segmentGroup);
};
ApplyRedirects.prototype.expandSegmentAgainstRouteUsingRedirect = function (ngModule, segmentGroup, routes, route, segments, outlet) {
if (route.path === '**') {
return this.expandWildCardWithParamsAgainstRouteUsingRedirect(ngModule, routes, route, outlet);
}
return this.expandRegularSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet);
};
ApplyRedirects.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect = function (ngModule, routes, route, outlet) {
var _this = this;
var newTree = this.applyRedirectCommands([], route.redirectTo, {});
if (route.redirectTo.startsWith('/')) {
return absoluteRedirect(newTree);
}
return this.lineralizeSegments(route, newTree).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (newSegments) {
var group = new UrlSegmentGroup(newSegments, {});
return _this.expandSegment(ngModule, group, routes, newSegments, outlet, false);
}));
};
ApplyRedirects.prototype.expandRegularSegmentAgainstRouteUsingRedirect = function (ngModule, segmentGroup, routes, route, segments, outlet) {
var _this = this;
var _a = match(segmentGroup, route, segments), matched = _a.matched, consumedSegments = _a.consumedSegments, lastChild = _a.lastChild, positionalParamSegments = _a.positionalParamSegments;
if (!matched)
return noMatch(segmentGroup);
var newTree = this.applyRedirectCommands(consumedSegments, route.redirectTo, positionalParamSegments);
if (route.redirectTo.startsWith('/')) {
return absoluteRedirect(newTree);
}
return this.lineralizeSegments(route, newTree).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (newSegments) {
return _this.expandSegment(ngModule, segmentGroup, routes, newSegments.concat(segments.slice(lastChild)), outlet, false);
}));
};
ApplyRedirects.prototype.matchSegmentAgainstRoute = function (ngModule, rawSegmentGroup, route, segments) {
var _this = this;
if (route.path === '**') {
if (route.loadChildren) {
return this.configLoader.load(ngModule.injector, route)
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (cfg) {
route._loadedConfig = cfg;
return new UrlSegmentGroup(segments, {});
}));
}
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(new UrlSegmentGroup(segments, {}));
}
var _a = match(rawSegmentGroup, route, segments), matched = _a.matched, consumedSegments = _a.consumedSegments, lastChild = _a.lastChild;
if (!matched)
return noMatch(rawSegmentGroup);
var rawSlicedSegments = segments.slice(lastChild);
var childConfig$ = this.getChildConfig(ngModule, route);
return childConfig$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (routerConfig) {
var childModule = routerConfig.module;
var childConfig = routerConfig.routes;
var _a = split(rawSegmentGroup, consumedSegments, rawSlicedSegments, childConfig), segmentGroup = _a.segmentGroup, slicedSegments = _a.slicedSegments;
if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {
var expanded$_1 = _this.expandChildren(childModule, childConfig, segmentGroup);
return expanded$_1.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (children) { return new UrlSegmentGroup(consumedSegments, children); }));
}
if (childConfig.length === 0 && slicedSegments.length === 0) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(new UrlSegmentGroup(consumedSegments, {}));
}
var expanded$ = _this.expandSegment(childModule, segmentGroup, childConfig, slicedSegments, PRIMARY_OUTLET, true);
return expanded$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (cs) {
return new UrlSegmentGroup(consumedSegments.concat(cs.segments), cs.children);
}));
}));
};
ApplyRedirects.prototype.getChildConfig = function (ngModule, route) {
var _this = this;
if (route.children) {
// The children belong to the same module
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(new LoadedRouterConfig(route.children, ngModule));
}
if (route.loadChildren) {
// lazy children belong to the loaded module
if (route._loadedConfig !== undefined) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(route._loadedConfig);
}
return runCanLoadGuard(ngModule.injector, route).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (shouldLoad) {
if (shouldLoad) {
return _this.configLoader.load(ngModule.injector, route)
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (cfg) {
route._loadedConfig = cfg;
return cfg;
}));
}
return canLoadFails(route);
}));
}
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(new LoadedRouterConfig([], ngModule));
};
ApplyRedirects.prototype.lineralizeSegments = function (route, urlTree) {
var res = [];
var c = urlTree.root;
while (true) {
res = res.concat(c.segments);
if (c.numberOfChildren === 0) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(res);
}
if (c.numberOfChildren > 1 || !c.children[PRIMARY_OUTLET]) {
return namedOutletsRedirect(route.redirectTo);
}
c = c.children[PRIMARY_OUTLET];
}
};
ApplyRedirects.prototype.applyRedirectCommands = function (segments, redirectTo, posParams) {
return this.applyRedirectCreatreUrlTree(redirectTo, this.urlSerializer.parse(redirectTo), segments, posParams);
};
ApplyRedirects.prototype.applyRedirectCreatreUrlTree = function (redirectTo, urlTree, segments, posParams) {
var newRoot = this.createSegmentGroup(redirectTo, urlTree.root, segments, posParams);
return new UrlTree(newRoot, this.createQueryParams(urlTree.queryParams, this.urlTree.queryParams), urlTree.fragment);
};
ApplyRedirects.prototype.createQueryParams = function (redirectToParams, actualParams) {
var res = {};
forEach(redirectToParams, function (v, k) {
var copySourceValue = typeof v === 'string' && v.startsWith(':');
if (copySourceValue) {
var sourceName = v.substring(1);
res[k] = actualParams[sourceName];
}
else {
res[k] = v;
}
});
return res;
};
ApplyRedirects.prototype.createSegmentGroup = function (redirectTo, group, segments, posParams) {
var _this = this;
var updatedSegments = this.createSegments(redirectTo, group.segments, segments, posParams);
var children = {};
forEach(group.children, function (child, name) {
children[name] = _this.createSegmentGroup(redirectTo, child, segments, posParams);
});
return new UrlSegmentGroup(updatedSegments, children);
};
ApplyRedirects.prototype.createSegments = function (redirectTo, redirectToSegments, actualSegments, posParams) {
var _this = this;
return redirectToSegments.map(function (s) { return s.path.startsWith(':') ? _this.findPosParam(redirectTo, s, posParams) :
_this.findOrReturn(s, actualSegments); });
};
ApplyRedirects.prototype.findPosParam = function (redirectTo, redirectToUrlSegment, posParams) {
var pos = posParams[redirectToUrlSegment.path.substring(1)];
if (!pos)
throw new Error("Cannot redirect to '" + redirectTo + "'. Cannot find '" + redirectToUrlSegment.path + "'.");
return pos;
};
ApplyRedirects.prototype.findOrReturn = function (redirectToUrlSegment, actualSegments) {
var idx = 0;
try {
for (var actualSegments_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(actualSegments), actualSegments_1_1 = actualSegments_1.next(); !actualSegments_1_1.done; actualSegments_1_1 = actualSegments_1.next()) {
var s = actualSegments_1_1.value;
if (s.path === redirectToUrlSegment.path) {
actualSegments.splice(idx);
return s;
}
idx++;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (actualSegments_1_1 && !actualSegments_1_1.done && (_a = actualSegments_1.return)) _a.call(actualSegments_1);
}
finally { if (e_1) throw e_1.error; }
}
return redirectToUrlSegment;
var e_1, _a;
};
return ApplyRedirects;
}());
function runCanLoadGuard(moduleInjector, route) {
var canLoad = route.canLoad;
if (!canLoad || canLoad.length === 0)
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(true);
var obs = Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(canLoad).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (injectionToken) {
var guard = moduleInjector.get(injectionToken);
return wrapIntoObservable(guard.canLoad ? guard.canLoad(route) : guard(route));
}));
return andObservables(obs);
}
function match(segmentGroup, route, segments) {
if (route.path === '') {
if ((route.pathMatch === 'full') && (segmentGroup.hasChildren() || segments.length > 0)) {
return { matched: false, consumedSegments: [], lastChild: 0, positionalParamSegments: {} };
}
return { matched: true, consumedSegments: [], lastChild: 0, positionalParamSegments: {} };
}
var matcher = route.matcher || defaultUrlMatcher;
var res = matcher(segments, segmentGroup, route);
if (!res) {
return {
matched: false,
consumedSegments: [],
lastChild: 0,
positionalParamSegments: {},
};
}
return {
matched: true,
consumedSegments: res.consumed,
lastChild: res.consumed.length,
positionalParamSegments: res.posParams,
};
}
function split(segmentGroup, consumedSegments, slicedSegments, config) {
if (slicedSegments.length > 0 &&
containsEmptyPathRedirectsWithNamedOutlets(segmentGroup, slicedSegments, config)) {
var s = new UrlSegmentGroup(consumedSegments, createChildrenForEmptySegments(config, new UrlSegmentGroup(slicedSegments, segmentGroup.children)));
return { segmentGroup: mergeTrivialChildren(s), slicedSegments: [] };
}
if (slicedSegments.length === 0 &&
containsEmptyPathRedirects(segmentGroup, slicedSegments, config)) {
var s = new UrlSegmentGroup(segmentGroup.segments, addEmptySegmentsToChildrenIfNeeded(segmentGroup, slicedSegments, config, segmentGroup.children));
return { segmentGroup: mergeTrivialChildren(s), slicedSegments: slicedSegments };
}
return { segmentGroup: segmentGroup, slicedSegments: slicedSegments };
}
function mergeTrivialChildren(s) {
if (s.numberOfChildren === 1 && s.children[PRIMARY_OUTLET]) {
var c = s.children[PRIMARY_OUTLET];
return new UrlSegmentGroup(s.segments.concat(c.segments), c.children);
}
return s;
}
function addEmptySegmentsToChildrenIfNeeded(segmentGroup, slicedSegments, routes, children) {
var res = {};
try {
for (var routes_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(routes), routes_1_1 = routes_1.next(); !routes_1_1.done; routes_1_1 = routes_1.next()) {
var r = routes_1_1.value;
if (isEmptyPathRedirect(segmentGroup, slicedSegments, r) && !children[getOutlet(r)]) {
res[getOutlet(r)] = new UrlSegmentGroup([], {});
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (routes_1_1 && !routes_1_1.done && (_a = routes_1.return)) _a.call(routes_1);
}
finally { if (e_2) throw e_2.error; }
}
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, children, res);
var e_2, _a;
}
function createChildrenForEmptySegments(routes, primarySegmentGroup) {
var res = {};
res[PRIMARY_OUTLET] = primarySegmentGroup;
try {
for (var routes_2 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(routes), routes_2_1 = routes_2.next(); !routes_2_1.done; routes_2_1 = routes_2.next()) {
var r = routes_2_1.value;
if (r.path === '' && getOutlet(r) !== PRIMARY_OUTLET) {
res[getOutlet(r)] = new UrlSegmentGroup([], {});
}
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (routes_2_1 && !routes_2_1.done && (_a = routes_2.return)) _a.call(routes_2);
}
finally { if (e_3) throw e_3.error; }
}
return res;
var e_3, _a;
}
function containsEmptyPathRedirectsWithNamedOutlets(segmentGroup, segments, routes) {
return routes.some(function (r) { return isEmptyPathRedirect(segmentGroup, segments, r) && getOutlet(r) !== PRIMARY_OUTLET; });
}
function containsEmptyPathRedirects(segmentGroup, segments, routes) {
return routes.some(function (r) { return isEmptyPathRedirect(segmentGroup, segments, r); });
}
function isEmptyPathRedirect(segmentGroup, segments, r) {
if ((segmentGroup.hasChildren() || segments.length > 0) && r.pathMatch === 'full') {
return false;
}
return r.path === '' && r.redirectTo !== undefined;
}
function getOutlet(route) {
return route.outlet || PRIMARY_OUTLET;
}
/**
* @license
* Copyright Google Inc. 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 Tree = /** @class */ (function () {
function Tree(root) {
this._root = root;
}
Object.defineProperty(Tree.prototype, "root", {
get: function () { return this._root.value; },
enumerable: true,
configurable: true
});
/**
* @internal
*/
Tree.prototype.parent = function (t) {
var p = this.pathFromRoot(t);
return p.length > 1 ? p[p.length - 2] : null;
};
/**
* @internal
*/
Tree.prototype.children = function (t) {
var n = findNode(t, this._root);
return n ? n.children.map(function (t) { return t.value; }) : [];
};
/**
* @internal
*/
Tree.prototype.firstChild = function (t) {
var n = findNode(t, this._root);
return n && n.children.length > 0 ? n.children[0].value : null;
};
/**
* @internal
*/
Tree.prototype.siblings = function (t) {
var p = findPath(t, this._root);
if (p.length < 2)
return [];
var c = p[p.length - 2].children.map(function (c) { return c.value; });
return c.filter(function (cc) { return cc !== t; });
};
/**
* @internal
*/
Tree.prototype.pathFromRoot = function (t) { return findPath(t, this._root).map(function (s) { return s.value; }); };
return Tree;
}());
// DFS for the node matching the value
function findNode(value, node) {
if (value === node.value)
return node;
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(node.children), _b = _a.next(); !_b.done; _b = _a.next()) {
var child = _b.value;
var node_1 = findNode(value, child);
if (node_1)
return node_1;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_1) throw e_1.error; }
}
return null;
var e_1, _c;
}
// Return the path to the node with the given value using DFS
function findPath(value, node) {
if (value === node.value)
return [node];
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(node.children), _b = _a.next(); !_b.done; _b = _a.next()) {
var child = _b.value;
var path = findPath(value, child);
if (path.length) {
path.unshift(node);
return path;
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_2) throw e_2.error; }
}
return [];
var e_2, _c;
}
var TreeNode = /** @class */ (function () {
function TreeNode(value, children) {
this.value = value;
this.children = children;
}
TreeNode.prototype.toString = function () { return "TreeNode(" + this.value + ")"; };
return TreeNode;
}());
// Return the list of T indexed by outlet name
function nodeChildrenAsMap(node) {
var map$$1 = {};
if (node) {
node.children.forEach(function (child) { return map$$1[child.value.outlet] = child; });
}
return map$$1;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
*
* Represents the state of the router.
*
* RouterState is a tree of activated routes. Every node in this tree knows about the "consumed" URL
* segments, the extracted parameters, and the resolved data.
*
* ### Example
*
* ```
* @Component({templateUrl:'template.html'})
* class MyComponent {
* constructor(router: Router) {
* const state: RouterState = router.routerState;
* const root: ActivatedRoute = state.root;
* const child = root.firstChild;
* const id: Observable<string> = child.params.map(p => p.id);
* //...
* }
* }
* ```
*
* See `ActivatedRoute` for more information.
*
*
*/
var RouterState = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(RouterState, _super);
/** @internal */
function RouterState(root,
/** The current snapshot of the router state */
snapshot) {
var _this = _super.call(this, root) || this;
_this.snapshot = snapshot;
setRouterState(_this, root);
return _this;
}
RouterState.prototype.toString = function () { return this.snapshot.toString(); };
return RouterState;
}(Tree));
function createEmptyState(urlTree, rootComponent) {
var snapshot = createEmptyStateSnapshot(urlTree, rootComponent);
var emptyUrl = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"]([new UrlSegment('', {})]);
var emptyParams = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"]({});
var emptyData = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"]({});
var emptyQueryParams = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"]({});
var fragment = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"]('');
var activated = new ActivatedRoute(emptyUrl, emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, snapshot.root);
activated.snapshot = snapshot.root;
return new RouterState(new TreeNode(activated, []), snapshot);
}
function createEmptyStateSnapshot(urlTree, rootComponent) {
var emptyParams = {};
var emptyData = {};
var emptyQueryParams = {};
var fragment = '';
var activated = new ActivatedRouteSnapshot([], emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, null, urlTree.root, -1, {});
return new RouterStateSnapshot('', new TreeNode(activated, []));
}
/**
* @description
*
* Contains the information about a route associated with a component loaded in an
* outlet. An `ActivatedRoute` can also be used to traverse the router state tree.
*
* ```
* @Component({...})
* class MyComponent {
* constructor(route: ActivatedRoute) {
* const id: Observable<string> = route.params.map(p => p.id);
* const url: Observable<string> = route.url.map(segments => segments.join(''));
* // route.data includes both `data` and `resolve`
* const user = route.data.map(d => d.user);
* }
* }
* ```
*
*
*/
var ActivatedRoute = /** @class */ (function () {
/** @internal */
function ActivatedRoute(
/** An observable of the URL segments matched by this route */
url,
/** An observable of the matrix parameters scoped to this route */
params,
/** An observable of the query parameters shared by all the routes */
queryParams,
/** An observable of the URL fragment shared by all the routes */
fragment,
/** An observable of the static and resolved data of this route. */
data,
/** The outlet name of the route. It's a constant */
outlet,
/** The component of the route. It's a constant */
// TODO(vsavkin): remove |string
component, futureSnapshot) {
this.url = url;
this.params = params;
this.queryParams = queryParams;
this.fragment = fragment;
this.data = data;
this.outlet = outlet;
this.component = component;
this._futureSnapshot = futureSnapshot;
}
Object.defineProperty(ActivatedRoute.prototype, "routeConfig", {
/** The configuration used to match this route */
get: function () { return this._futureSnapshot.routeConfig; },
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRoute.prototype, "root", {
/** The root of the router state */
get: function () { return this._routerState.root; },
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRoute.prototype, "parent", {
/** The parent of this route in the router state tree */
get: function () { return this._routerState.parent(this); },
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRoute.prototype, "firstChild", {
/** The first child of this route in the router state tree */
get: function () { return this._routerState.firstChild(this); },
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRoute.prototype, "children", {
/** The children of this route in the router state tree */
get: function () { return this._routerState.children(this); },
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRoute.prototype, "pathFromRoot", {
/** The path from the root of the router state tree to this route */
get: function () { return this._routerState.pathFromRoot(this); },
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRoute.prototype, "paramMap", {
get: function () {
if (!this._paramMap) {
this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (p) { return convertToParamMap(p); }));
}
return this._paramMap;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRoute.prototype, "queryParamMap", {
get: function () {
if (!this._queryParamMap) {
this._queryParamMap =
this.queryParams.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (p) { return convertToParamMap(p); }));
}
return this._queryParamMap;
},
enumerable: true,
configurable: true
});
ActivatedRoute.prototype.toString = function () {
return this.snapshot ? this.snapshot.toString() : "Future(" + this._futureSnapshot + ")";
};
return ActivatedRoute;
}());
/**
* Returns the inherited params, data, and resolve for a given route.
* By default, this only inherits values up to the nearest path-less or component-less route.
* @internal
*/
function inheritedParamsDataResolve(route, paramsInheritanceStrategy) {
if (paramsInheritanceStrategy === void 0) { paramsInheritanceStrategy = 'emptyOnly'; }
var pathFromRoot = route.pathFromRoot;
var inheritingStartingFrom = 0;
if (paramsInheritanceStrategy !== 'always') {
inheritingStartingFrom = pathFromRoot.length - 1;
while (inheritingStartingFrom >= 1) {
var current = pathFromRoot[inheritingStartingFrom];
var parent_1 = pathFromRoot[inheritingStartingFrom - 1];
// current route is an empty path => inherits its parent's params and data
if (current.routeConfig && current.routeConfig.path === '') {
inheritingStartingFrom--;
// parent is componentless => current route should inherit its params and data
}
else if (!parent_1.component) {
inheritingStartingFrom--;
}
else {
break;
}
}
}
return flattenInherited(pathFromRoot.slice(inheritingStartingFrom));
}
/** @internal */
function flattenInherited(pathFromRoot) {
return pathFromRoot.reduce(function (res, curr) {
var params = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, res.params, curr.params);
var data = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, res.data, curr.data);
var resolve = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, res.resolve, curr._resolvedData);
return { params: params, data: data, resolve: resolve };
}, { params: {}, data: {}, resolve: {} });
}
/**
* @description
*
* Contains the information about a route associated with a component loaded in an
* outlet at a particular moment in time. ActivatedRouteSnapshot can also be used to
* traverse the router state tree.
*
* ```
* @Component({templateUrl:'./my-component.html'})
* class MyComponent {
* constructor(route: ActivatedRoute) {
* const id: string = route.snapshot.params.id;
* const url: string = route.snapshot.url.join('');
* const user = route.snapshot.data.user;
* }
* }
* ```
*
*
*/
var ActivatedRouteSnapshot = /** @class */ (function () {
/** @internal */
function ActivatedRouteSnapshot(
/** The URL segments matched by this route */
url,
/** The matrix parameters scoped to this route */
params,
/** The query parameters shared by all the routes */
queryParams,
/** The URL fragment shared by all the routes */
fragment,
/** The static and resolved data of this route */
data,
/** The outlet name of the route */
outlet,
/** The component of the route */
component, routeConfig, urlSegment, lastPathIndex, resolve) {
this.url = url;
this.params = params;
this.queryParams = queryParams;
this.fragment = fragment;
this.data = data;
this.outlet = outlet;
this.component = component;
this.routeConfig = routeConfig;
this._urlSegment = urlSegment;
this._lastPathIndex = lastPathIndex;
this._resolve = resolve;
}
Object.defineProperty(ActivatedRouteSnapshot.prototype, "root", {
/** The root of the router state */
get: function () { return this._routerState.root; },
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRouteSnapshot.prototype, "parent", {
/** The parent of this route in the router state tree */
get: function () { return this._routerState.parent(this); },
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRouteSnapshot.prototype, "firstChild", {
/** The first child of this route in the router state tree */
get: function () { return this._routerState.firstChild(this); },
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRouteSnapshot.prototype, "children", {
/** The children of this route in the router state tree */
get: function () { return this._routerState.children(this); },
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRouteSnapshot.prototype, "pathFromRoot", {
/** The path from the root of the router state tree to this route */
get: function () { return this._routerState.pathFromRoot(this); },
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRouteSnapshot.prototype, "paramMap", {
get: function () {
if (!this._paramMap) {
this._paramMap = convertToParamMap(this.params);
}
return this._paramMap;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActivatedRouteSnapshot.prototype, "queryParamMap", {
get: function () {
if (!this._queryParamMap) {
this._queryParamMap = convertToParamMap(this.queryParams);
}
return this._queryParamMap;
},
enumerable: true,
configurable: true
});
ActivatedRouteSnapshot.prototype.toString = function () {
var url = this.url.map(function (segment) { return segment.toString(); }).join('/');
var matched = this.routeConfig ? this.routeConfig.path : '';
return "Route(url:'" + url + "', path:'" + matched + "')";
};
return ActivatedRouteSnapshot;
}());
/**
* @description
*
* Represents the state of the router at a moment in time.
*
* This is a tree of activated route snapshots. Every node in this tree knows about
* the "consumed" URL segments, the extracted parameters, and the resolved data.
*
* ### Example
*
* ```
* @Component({templateUrl:'template.html'})
* class MyComponent {
* constructor(router: Router) {
* const state: RouterState = router.routerState;
* const snapshot: RouterStateSnapshot = state.snapshot;
* const root: ActivatedRouteSnapshot = snapshot.root;
* const child = root.firstChild;
* const id: Observable<string> = child.params.map(p => p.id);
* //...
* }
* }
* ```
*
*
*/
var RouterStateSnapshot = /** @class */ (function (_super) {
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(RouterStateSnapshot, _super);
/** @internal */
function RouterStateSnapshot(
/** The url from which this snapshot was created */
url, root) {
var _this = _super.call(this, root) || this;
_this.url = url;
setRouterState(_this, root);
return _this;
}
RouterStateSnapshot.prototype.toString = function () { return serializeNode(this._root); };
return RouterStateSnapshot;
}(Tree));
function setRouterState(state, node) {
node.value._routerState = state;
node.children.forEach(function (c) { return setRouterState(state, c); });
}
function serializeNode(node) {
var c = node.children.length > 0 ? " { " + node.children.map(serializeNode).join(', ') + " } " : '';
return "" + node.value + c;
}
/**
* The expectation is that the activate route is created with the right set of parameters.
* So we push new values into the observables only when they are not the initial values.
* And we detect that by checking if the snapshot field is set.
*/
function advanceActivatedRoute(route) {
if (route.snapshot) {
var currentSnapshot = route.snapshot;
var nextSnapshot = route._futureSnapshot;
route.snapshot = nextSnapshot;
if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) {
route.queryParams.next(nextSnapshot.queryParams);
}
if (currentSnapshot.fragment !== nextSnapshot.fragment) {
route.fragment.next(nextSnapshot.fragment);
}
if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) {
route.params.next(nextSnapshot.params);
}
if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) {
route.url.next(nextSnapshot.url);
}
if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) {
route.data.next(nextSnapshot.data);
}
}
else {
route.snapshot = route._futureSnapshot;
// this is for resolved data
route.data.next(route._futureSnapshot.data);
}
}
function equalParamsAndUrlSegments(a, b) {
var equalUrlParams = shallowEqual(a.params, b.params) && equalSegments(a.url, b.url);
var parentsMismatch = !a.parent !== !b.parent;
return equalUrlParams && !parentsMismatch &&
(!a.parent || equalParamsAndUrlSegments(a.parent, b.parent));
}
/**
* @license
* Copyright Google Inc. 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
*/
function createRouterState(routeReuseStrategy, curr, prevState) {
var root = createNode(routeReuseStrategy, curr._root, prevState ? prevState._root : undefined);
return new RouterState(root, curr);
}
function createNode(routeReuseStrategy, curr, prevState) {
// reuse an activated route that is currently displayed on the screen
if (prevState && routeReuseStrategy.shouldReuseRoute(curr.value, prevState.value.snapshot)) {
var value = prevState.value;
value._futureSnapshot = curr.value;
var children = createOrReuseChildren(routeReuseStrategy, curr, prevState);
return new TreeNode(value, children);
// retrieve an activated route that is used to be displayed, but is not currently displayed
}
else {
var detachedRouteHandle = routeReuseStrategy.retrieve(curr.value);
if (detachedRouteHandle) {
var tree = detachedRouteHandle.route;
setFutureSnapshotsOfActivatedRoutes(curr, tree);
return tree;
}
else {
var value = createActivatedRoute(curr.value);
var children = curr.children.map(function (c) { return createNode(routeReuseStrategy, c); });
return new TreeNode(value, children);
}
}
}
function setFutureSnapshotsOfActivatedRoutes(curr, result) {
if (curr.value.routeConfig !== result.value.routeConfig) {
throw new Error('Cannot reattach ActivatedRouteSnapshot created from a different route');
}
if (curr.children.length !== result.children.length) {
throw new Error('Cannot reattach ActivatedRouteSnapshot with a different number of children');
}
result.value._futureSnapshot = curr.value;
for (var i = 0; i < curr.children.length; ++i) {
setFutureSnapshotsOfActivatedRoutes(curr.children[i], result.children[i]);
}
}
function createOrReuseChildren(routeReuseStrategy, curr, prevState) {
return curr.children.map(function (child) {
try {
for (var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(prevState.children), _b = _a.next(); !_b.done; _b = _a.next()) {
var p = _b.value;
if (routeReuseStrategy.shouldReuseRoute(p.value.snapshot, child.value)) {
return createNode(routeReuseStrategy, child, p);
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_1) throw e_1.error; }
}
return createNode(routeReuseStrategy, child);
var e_1, _c;
});
}
function createActivatedRoute(c) {
return new ActivatedRoute(new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](c.url), new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](c.params), new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](c.queryParams), new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](c.fragment), new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](c.data), c.outlet, c.component, c);
}
/**
* @license
* Copyright Google Inc. 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
*/
function createUrlTree(route, urlTree, commands, queryParams, fragment) {
if (commands.length === 0) {
return tree(urlTree.root, urlTree.root, urlTree, queryParams, fragment);
}
var nav = computeNavigation(commands);
if (nav.toRoot()) {
return tree(urlTree.root, new UrlSegmentGroup([], {}), urlTree, queryParams, fragment);
}
var startingPosition = findStartingPosition(nav, urlTree, route);
var segmentGroup = startingPosition.processChildren ?
updateSegmentGroupChildren(startingPosition.segmentGroup, startingPosition.index, nav.commands) :
updateSegmentGroup(startingPosition.segmentGroup, startingPosition.index, nav.commands);
return tree(startingPosition.segmentGroup, segmentGroup, urlTree, queryParams, fragment);
}
function isMatrixParams(command) {
return typeof command === 'object' && command != null && !command.outlets && !command.segmentPath;
}
function tree(oldSegmentGroup, newSegmentGroup, urlTree, queryParams, fragment) {
var qp = {};
if (queryParams) {
forEach(queryParams, function (value, name) {
qp[name] = Array.isArray(value) ? value.map(function (v) { return "" + v; }) : "" + value;
});
}
if (urlTree.root === oldSegmentGroup) {
return new UrlTree(newSegmentGroup, qp, fragment);
}
return new UrlTree(replaceSegment(urlTree.root, oldSegmentGroup, newSegmentGroup), qp, fragment);
}
function replaceSegment(current, oldSegment, newSegment) {
var children = {};
forEach(current.children, function (c, outletName) {
if (c === oldSegment) {
children[outletName] = newSegment;
}
else {
children[outletName] = replaceSegment(c, oldSegment, newSegment);
}
});
return new UrlSegmentGroup(current.segments, children);
}
var Navigation = /** @class */ (function () {
function Navigation(isAbsolute, numberOfDoubleDots, commands) {
this.isAbsolute = isAbsolute;
this.numberOfDoubleDots = numberOfDoubleDots;
this.commands = commands;
if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {
throw new Error('Root segment cannot have matrix parameters');
}
var cmdWithOutlet = commands.find(function (c) { return typeof c === 'object' && c != null && c.outlets; });
if (cmdWithOutlet && cmdWithOutlet !== last$1(commands)) {
throw new Error('{outlets:{}} has to be the last command');
}
}
Navigation.prototype.toRoot = function () {
return this.isAbsolute && this.commands.length === 1 && this.commands[0] == '/';
};
return Navigation;
}());
/** Transforms commands to a normalized `Navigation` */
function computeNavigation(commands) {
if ((typeof commands[0] === 'string') && commands.length === 1 && commands[0] === '/') {
return new Navigation(true, 0, commands);
}
var numberOfDoubleDots = 0;
var isAbsolute = false;
var res = commands.reduce(function (res, cmd, cmdIdx) {
if (typeof cmd === 'object' && cmd != null) {
if (cmd.outlets) {
var outlets_1 = {};
forEach(cmd.outlets, function (commands, name) {
outlets_1[name] = typeof commands === 'string' ? commands.split('/') : commands;
});
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(res, [{ outlets: outlets_1 }]);
}
if (cmd.segmentPath) {
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(res, [cmd.segmentPath]);
}
}
if (!(typeof cmd === 'string')) {
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(res, [cmd]);
}
if (cmdIdx === 0) {
cmd.split('/').forEach(function (urlPart, partIndex) {
if (partIndex == 0 && urlPart === '.') ;
else if (partIndex == 0 && urlPart === '') {
isAbsolute = true;
}
else if (urlPart === '..') {
numberOfDoubleDots++;
}
else if (urlPart != '') {
res.push(urlPart);
}
});
return res;
}
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(res, [cmd]);
}, []);
return new Navigation(isAbsolute, numberOfDoubleDots, res);
}
var Position = /** @class */ (function () {
function Position(segmentGroup, processChildren, index) {
this.segmentGroup = segmentGroup;
this.processChildren = processChildren;
this.index = index;
}
return Position;
}());
function findStartingPosition(nav, tree, route) {
if (nav.isAbsolute) {
return new Position(tree.root, true, 0);
}
if (route.snapshot._lastPathIndex === -1) {
return new Position(route.snapshot._urlSegment, true, 0);
}
var modifier = isMatrixParams(nav.commands[0]) ? 0 : 1;
var index = route.snapshot._lastPathIndex + modifier;
return createPositionApplyingDoubleDots(route.snapshot._urlSegment, index, nav.numberOfDoubleDots);
}
function createPositionApplyingDoubleDots(group, index, numberOfDoubleDots) {
var g = group;
var ci = index;
var dd = numberOfDoubleDots;
while (dd > ci) {
dd -= ci;
g = g.parent;
if (!g) {
throw new Error('Invalid number of \'../\'');
}
ci = g.segments.length;
}
return new Position(g, false, ci - dd);
}
function getPath(command) {
if (typeof command === 'object' && command != null && command.outlets) {
return command.outlets[PRIMARY_OUTLET];
}
return "" + command;
}
function getOutlets(commands) {
if (!(typeof commands[0] === 'object'))
return _a = {}, _a[PRIMARY_OUTLET] = commands, _a;
if (commands[0].outlets === undefined)
return _b = {}, _b[PRIMARY_OUTLET] = commands, _b;
return commands[0].outlets;
var _a, _b;
}
function updateSegmentGroup(segmentGroup, startIndex, commands) {
if (!segmentGroup) {
segmentGroup = new UrlSegmentGroup([], {});
}
if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {
return updateSegmentGroupChildren(segmentGroup, startIndex, commands);
}
var m = prefixedWith(segmentGroup, startIndex, commands);
var slicedCommands = commands.slice(m.commandIndex);
if (m.match && m.pathIndex < segmentGroup.segments.length) {
var g = new UrlSegmentGroup(segmentGroup.segments.slice(0, m.pathIndex), {});
g.children[PRIMARY_OUTLET] =
new UrlSegmentGroup(segmentGroup.segments.slice(m.pathIndex), segmentGroup.children);
return updateSegmentGroupChildren(g, 0, slicedCommands);
}
else if (m.match && slicedCommands.length === 0) {
return new UrlSegmentGroup(segmentGroup.segments, {});
}
else if (m.match && !segmentGroup.hasChildren()) {
return createNewSegmentGroup(segmentGroup, startIndex, commands);
}
else if (m.match) {
return updateSegmentGroupChildren(segmentGroup, 0, slicedCommands);
}
else {
return createNewSegmentGroup(segmentGroup, startIndex, commands);
}
}
function updateSegmentGroupChildren(segmentGroup, startIndex, commands) {
if (commands.length === 0) {
return new UrlSegmentGroup(segmentGroup.segments, {});
}
else {
var outlets_2 = getOutlets(commands);
var children_1 = {};
forEach(outlets_2, function (commands, outlet) {
if (commands !== null) {
children_1[outlet] = updateSegmentGroup(segmentGroup.children[outlet], startIndex, commands);
}
});
forEach(segmentGroup.children, function (child, childOutlet) {
if (outlets_2[childOutlet] === undefined) {
children_1[childOutlet] = child;
}
});
return new UrlSegmentGroup(segmentGroup.segments, children_1);
}
}
function prefixedWith(segmentGroup, startIndex, commands) {
var currentCommandIndex = 0;
var currentPathIndex = startIndex;
var noMatch = { match: false, pathIndex: 0, commandIndex: 0 };
while (currentPathIndex < segmentGroup.segments.length) {
if (currentCommandIndex >= commands.length)
return noMatch;
var path = segmentGroup.segments[currentPathIndex];
var curr = getPath(commands[currentCommandIndex]);
var next = currentCommandIndex < commands.length - 1 ? commands[currentCommandIndex + 1] : null;
if (currentPathIndex > 0 && curr === undefined)
break;
if (curr && next && (typeof next === 'object') && next.outlets === undefined) {
if (!compare(curr, next, path))
return noMatch;
currentCommandIndex += 2;
}
else {
if (!compare(curr, {}, path))
return noMatch;
currentCommandIndex++;
}
currentPathIndex++;
}
return { match: true, pathIndex: currentPathIndex, commandIndex: currentCommandIndex };
}
function createNewSegmentGroup(segmentGroup, startIndex, commands) {
var paths = segmentGroup.segments.slice(0, startIndex);
var i = 0;
while (i < commands.length) {
if (typeof commands[i] === 'object' && commands[i].outlets !== undefined) {
var children = createNewSegmentChildren(commands[i].outlets);
return new UrlSegmentGroup(paths, children);
}
// if we start with an object literal, we need to reuse the path part from the segment
if (i === 0 && isMatrixParams(commands[0])) {
var p = segmentGroup.segments[startIndex];
paths.push(new UrlSegment(p.path, commands[0]));
i++;
continue;
}
var curr = getPath(commands[i]);
var next = (i < commands.length - 1) ? commands[i + 1] : null;
if (curr && next && isMatrixParams(next)) {
paths.push(new UrlSegment(curr, stringify(next)));
i += 2;
}
else {
paths.push(new UrlSegment(curr, {}));
i++;
}
}
return new UrlSegmentGroup(paths, {});
}
function createNewSegmentChildren(outlets) {
var children = {};
forEach(outlets, function (commands, outlet) {
if (commands !== null) {
children[outlet] = createNewSegmentGroup(new UrlSegmentGroup([], {}), 0, commands);
}
});
return children;
}
function stringify(params) {
var res = {};
forEach(params, function (v, k) { return res[k] = "" + v; });
return res;
}
function compare(path, params, segment) {
return path == segment.path && shallowEqual(params, segment.parameters);
}
/**
* @license
* Copyright Google Inc. 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 CanActivate = /** @class */ (function () {
function CanActivate(path) {
this.path = path;
this.route = this.path[this.path.length - 1];
}
return CanActivate;
}());
var CanDeactivate = /** @class */ (function () {
function CanDeactivate(component, route) {
this.component = component;
this.route = route;
}
return CanDeactivate;
}());
/**
* This class bundles the actions involved in preactivation of a route.
*/
var PreActivation = /** @class */ (function () {
function PreActivation(future, curr, moduleInjector, forwardEvent) {
this.future = future;
this.curr = curr;
this.moduleInjector = moduleInjector;
this.forwardEvent = forwardEvent;
this.canActivateChecks = [];
this.canDeactivateChecks = [];
}
PreActivation.prototype.initialize = function (parentContexts) {
var futureRoot = this.future._root;
var currRoot = this.curr ? this.curr._root : null;
this.setupChildRouteGuards(futureRoot, currRoot, parentContexts, [futureRoot.value]);
};
PreActivation.prototype.checkGuards = function () {
var _this = this;
if (!this.isDeactivating() && !this.isActivating()) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(true);
}
var canDeactivate$ = this.runCanDeactivateChecks();
return canDeactivate$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (canDeactivate) { return canDeactivate ? _this.runCanActivateChecks() : Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(false); }));
};
PreActivation.prototype.resolveData = function (paramsInheritanceStrategy) {
var _this = this;
if (!this.isActivating())
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null);
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(this.canActivateChecks)
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["concatMap"])(function (check) { return _this.runResolve(check.route, paramsInheritanceStrategy); }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["reduce"])(function (_, __) { return _; }));
};
PreActivation.prototype.isDeactivating = function () { return this.canDeactivateChecks.length !== 0; };
PreActivation.prototype.isActivating = function () { return this.canActivateChecks.length !== 0; };
/**
* Iterates over child routes and calls recursive `setupRouteGuards` to get `this` instance in
* proper state to run `checkGuards()` method.
*/
PreActivation.prototype.setupChildRouteGuards = function (futureNode, currNode, contexts, futurePath) {
var _this = this;
var prevChildren = nodeChildrenAsMap(currNode);
// Process the children of the future route
futureNode.children.forEach(function (c) {
_this.setupRouteGuards(c, prevChildren[c.value.outlet], contexts, futurePath.concat([c.value]));
delete prevChildren[c.value.outlet];
});
// Process any children left from the current route (not active for the future route)
forEach(prevChildren, function (v, k) {
return _this.deactivateRouteAndItsChildren(v, contexts.getContext(k));
});
};
/**
* Iterates over child routes and calls recursive `setupRouteGuards` to get `this` instance in
* proper state to run `checkGuards()` method.
*/
PreActivation.prototype.setupRouteGuards = function (futureNode, currNode, parentContexts, futurePath) {
var future = futureNode.value;
var curr = currNode ? currNode.value : null;
var context = parentContexts ? parentContexts.getContext(futureNode.value.outlet) : null;
// reusing the node
if (curr && future.routeConfig === curr.routeConfig) {
var shouldRunGuardsAndResolvers = this.shouldRunGuardsAndResolvers(curr, future, future.routeConfig.runGuardsAndResolvers);
if (shouldRunGuardsAndResolvers) {
this.canActivateChecks.push(new CanActivate(futurePath));
}
else {
// we need to set the data
future.data = curr.data;
future._resolvedData = curr._resolvedData;
}
// If we have a component, we need to go through an outlet.
if (future.component) {
this.setupChildRouteGuards(futureNode, currNode, context ? context.children : null, futurePath);
// if we have a componentless route, we recurse but keep the same outlet map.
}
else {
this.setupChildRouteGuards(futureNode, currNode, parentContexts, futurePath);
}
if (shouldRunGuardsAndResolvers) {
var outlet = context.outlet;
this.canDeactivateChecks.push(new CanDeactivate(outlet.component, curr));
}
}
else {
if (curr) {
this.deactivateRouteAndItsChildren(currNode, context);
}
this.canActivateChecks.push(new CanActivate(futurePath));
// If we have a component, we need to go through an outlet.
if (future.component) {
this.setupChildRouteGuards(futureNode, null, context ? context.children : null, futurePath);
// if we have a componentless route, we recurse but keep the same outlet map.
}
else {
this.setupChildRouteGuards(futureNode, null, parentContexts, futurePath);
}
}
};
PreActivation.prototype.shouldRunGuardsAndResolvers = function (curr, future, mode) {
switch (mode) {
case 'always':
return true;
case 'paramsOrQueryParamsChange':
return !equalParamsAndUrlSegments(curr, future) ||
!shallowEqual(curr.queryParams, future.queryParams);
case 'paramsChange':
default:
return !equalParamsAndUrlSegments(curr, future);
}
};
PreActivation.prototype.deactivateRouteAndItsChildren = function (route, context) {
var _this = this;
var children = nodeChildrenAsMap(route);
var r = route.value;
forEach(children, function (node, childName) {
if (!r.component) {
_this.deactivateRouteAndItsChildren(node, context);
}
else if (context) {
_this.deactivateRouteAndItsChildren(node, context.children.getContext(childName));
}
else {
_this.deactivateRouteAndItsChildren(node, null);
}
});
if (!r.component) {
this.canDeactivateChecks.push(new CanDeactivate(null, r));
}
else if (context && context.outlet && context.outlet.isActivated) {
this.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, r));
}
else {
this.canDeactivateChecks.push(new CanDeactivate(null, r));
}
};
PreActivation.prototype.runCanDeactivateChecks = function () {
var _this = this;
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(this.canDeactivateChecks)
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (check) { return _this.runCanDeactivate(check.component, check.route); }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["every"])(function (result) { return result === true; }));
};
PreActivation.prototype.runCanActivateChecks = function () {
var _this = this;
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(this.canActivateChecks)
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["concatMap"])(function (check) { return andObservables(Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])([
_this.fireChildActivationStart(check.route.parent),
_this.fireActivationStart(check.route), _this.runCanActivateChild(check.path),
_this.runCanActivate(check.route)
])); }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["every"])(function (result) { return result === true; }));
// this.fireChildActivationStart(check.path),
};
/**
* This should fire off `ActivationStart` events for each route being activated at this
* level.
* In other words, if you're activating `a` and `b` below, `path` will contain the
* `ActivatedRouteSnapshot`s for both and we will fire `ActivationStart` for both. Always
* return
* `true` so checks continue to run.
*/
PreActivation.prototype.fireActivationStart = function (snapshot) {
if (snapshot !== null && this.forwardEvent) {
this.forwardEvent(new ActivationStart(snapshot));
}
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(true);
};
/**
* This should fire off `ChildActivationStart` events for each route being activated at this
* level.
* In other words, if you're activating `a` and `b` below, `path` will contain the
* `ActivatedRouteSnapshot`s for both and we will fire `ChildActivationStart` for both. Always
* return
* `true` so checks continue to run.
*/
PreActivation.prototype.fireChildActivationStart = function (snapshot) {
if (snapshot !== null && this.forwardEvent) {
this.forwardEvent(new ChildActivationStart(snapshot));
}
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(true);
};
PreActivation.prototype.runCanActivate = function (future) {
var _this = this;
var canActivate = future.routeConfig ? future.routeConfig.canActivate : null;
if (!canActivate || canActivate.length === 0)
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(true);
var obs = Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(canActivate).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (c) {
var guard = _this.getToken(c, future);
var observable;
if (guard.canActivate) {
observable = wrapIntoObservable(guard.canActivate(future, _this.future));
}
else {
observable = wrapIntoObservable(guard(future, _this.future));
}
return observable.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["first"])());
}));
return andObservables(obs);
};
PreActivation.prototype.runCanActivateChild = function (path) {
var _this = this;
var future = path[path.length - 1];
var canActivateChildGuards = path.slice(0, path.length - 1)
.reverse()
.map(function (p) { return _this.extractCanActivateChild(p); })
.filter(function (_) { return _ !== null; });
return andObservables(Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(canActivateChildGuards).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (d) {
var obs = Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(d.guards).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (c) {
var guard = _this.getToken(c, d.node);
var observable;
if (guard.canActivateChild) {
observable = wrapIntoObservable(guard.canActivateChild(future, _this.future));
}
else {
observable = wrapIntoObservable(guard(future, _this.future));
}
return observable.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["first"])());
}));
return andObservables(obs);
})));
};
PreActivation.prototype.extractCanActivateChild = function (p) {
var canActivateChild = p.routeConfig ? p.routeConfig.canActivateChild : null;
if (!canActivateChild || canActivateChild.length === 0)
return null;
return { node: p, guards: canActivateChild };
};
PreActivation.prototype.runCanDeactivate = function (component, curr) {
var _this = this;
var canDeactivate = curr && curr.routeConfig ? curr.routeConfig.canDeactivate : null;
if (!canDeactivate || canDeactivate.length === 0)
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(true);
var canDeactivate$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(canDeactivate).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (c) {
var guard = _this.getToken(c, curr);
var observable;
if (guard.canDeactivate) {
observable =
wrapIntoObservable(guard.canDeactivate(component, curr, _this.curr, _this.future));
}
else {
observable = wrapIntoObservable(guard(component, curr, _this.curr, _this.future));
}
return observable.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["first"])());
}));
return canDeactivate$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["every"])(function (result) { return result === true; }));
};
PreActivation.prototype.runResolve = function (future, paramsInheritanceStrategy) {
var resolve = future._resolve;
return this.resolveNode(resolve, future).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (resolvedData) {
future._resolvedData = resolvedData;
future.data = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, future.data, inheritedParamsDataResolve(future, paramsInheritanceStrategy).resolve);
return null;
}));
};
PreActivation.prototype.resolveNode = function (resolve, future) {
var _this = this;
var keys = Object.keys(resolve);
if (keys.length === 0) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])({});
}
if (keys.length === 1) {
var key_1 = keys[0];
return this.getResolver(resolve[key_1], future).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (value) {
return _a = {}, _a[key_1] = value, _a;
var _a;
}));
}
var data = {};
var runningResolvers$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(keys).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (key) {
return _this.getResolver(resolve[key], future).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (value) {
data[key] = value;
return value;
}));
}));
return runningResolvers$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["last"])(), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function () { return data; }));
};
PreActivation.prototype.getResolver = function (injectionToken, future) {
var resolver = this.getToken(injectionToken, future);
return resolver.resolve ? wrapIntoObservable(resolver.resolve(future, this.future)) :
wrapIntoObservable(resolver(future, this.future));
};
PreActivation.prototype.getToken = function (token, snapshot) {
var config = closestLoadedConfig(snapshot);
var injector = config ? config.module.injector : this.moduleInjector;
return injector.get(token);
};
return PreActivation;
}());
function closestLoadedConfig(snapshot) {
if (!snapshot)
return null;
for (var s = snapshot.parent; s; s = s.parent) {
var route = s.routeConfig;
if (route && route._loadedConfig)
return route._loadedConfig;
}
return null;
}
/**
* @license
* Copyright Google Inc. 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 NoMatch$1 = /** @class */ (function () {
function NoMatch() {
}
return NoMatch;
}());
function recognize(rootComponentType, config, urlTree, url, paramsInheritanceStrategy) {
if (paramsInheritanceStrategy === void 0) { paramsInheritanceStrategy = 'emptyOnly'; }
return new Recognizer(rootComponentType, config, urlTree, url, paramsInheritanceStrategy)
.recognize();
}
var Recognizer = /** @class */ (function () {
function Recognizer(rootComponentType, config, urlTree, url, paramsInheritanceStrategy) {
this.rootComponentType = rootComponentType;
this.config = config;
this.urlTree = urlTree;
this.url = url;
this.paramsInheritanceStrategy = paramsInheritanceStrategy;
}
Recognizer.prototype.recognize = function () {
try {
var rootSegmentGroup = split$1(this.urlTree.root, [], [], this.config).segmentGroup;
var children = this.processSegmentGroup(this.config, rootSegmentGroup, PRIMARY_OUTLET);
var root = new ActivatedRouteSnapshot([], Object.freeze({}), Object.freeze(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, this.urlTree.queryParams)), this.urlTree.fragment, {}, PRIMARY_OUTLET, this.rootComponentType, null, this.urlTree.root, -1, {});
var rootNode = new TreeNode(root, children);
var routeState = new RouterStateSnapshot(this.url, rootNode);
this.inheritParamsAndData(routeState._root);
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(routeState);
}
catch (e) {
return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](function (obs) { return obs.error(e); });
}
};
Recognizer.prototype.inheritParamsAndData = function (routeNode) {
var _this = this;
var route = routeNode.value;
var i = inheritedParamsDataResolve(route, this.paramsInheritanceStrategy);
route.params = Object.freeze(i.params);
route.data = Object.freeze(i.data);
routeNode.children.forEach(function (n) { return _this.inheritParamsAndData(n); });
};
Recognizer.prototype.processSegmentGroup = function (config, segmentGroup, outlet) {
if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {
return this.processChildren(config, segmentGroup);
}
return this.processSegment(config, segmentGroup, segmentGroup.segments, outlet);
};
Recognizer.prototype.processChildren = function (config, segmentGroup) {
var _this = this;
var children = mapChildrenIntoArray(segmentGroup, function (child, childOutlet) { return _this.processSegmentGroup(config, child, childOutlet); });
checkOutletNameUniqueness(children);
sortActivatedRouteSnapshots(children);
return children;
};
Recognizer.prototype.processSegment = function (config, segmentGroup, segments, outlet) {
try {
for (var config_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(config), config_1_1 = config_1.next(); !config_1_1.done; config_1_1 = config_1.next()) {
var r = config_1_1.value;
try {
return this.processSegmentAgainstRoute(r, segmentGroup, segments, outlet);
}
catch (e) {
if (!(e instanceof NoMatch$1))
throw e;
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (config_1_1 && !config_1_1.done && (_a = config_1.return)) _a.call(config_1);
}
finally { if (e_1) throw e_1.error; }
}
if (this.noLeftoversInUrl(segmentGroup, segments, outlet)) {
return [];
}
throw new NoMatch$1();
var e_1, _a;
};
Recognizer.prototype.noLeftoversInUrl = function (segmentGroup, segments, outlet) {
return segments.length === 0 && !segmentGroup.children[outlet];
};
Recognizer.prototype.processSegmentAgainstRoute = function (route, rawSegment, segments, outlet) {
if (route.redirectTo)
throw new NoMatch$1();
if ((route.outlet || PRIMARY_OUTLET) !== outlet)
throw new NoMatch$1();
var snapshot;
var consumedSegments = [];
var rawSlicedSegments = [];
if (route.path === '**') {
var params = segments.length > 0 ? last$1(segments).parameters : {};
snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), outlet, route.component, route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + segments.length, getResolve(route));
}
else {
var result = match$1(rawSegment, route, segments);
consumedSegments = result.consumedSegments;
rawSlicedSegments = segments.slice(result.lastChild);
snapshot = new ActivatedRouteSnapshot(consumedSegments, result.parameters, Object.freeze(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), outlet, route.component, route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + consumedSegments.length, getResolve(route));
}
var childConfig = getChildConfig(route);
var _a = split$1(rawSegment, consumedSegments, rawSlicedSegments, childConfig), segmentGroup = _a.segmentGroup, slicedSegments = _a.slicedSegments;
if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {
var children_1 = this.processChildren(childConfig, segmentGroup);
return [new TreeNode(snapshot, children_1)];
}
if (childConfig.length === 0 && slicedSegments.length === 0) {
return [new TreeNode(snapshot, [])];
}
var children = this.processSegment(childConfig, segmentGroup, slicedSegments, PRIMARY_OUTLET);
return [new TreeNode(snapshot, children)];
};
return Recognizer;
}());
function sortActivatedRouteSnapshots(nodes) {
nodes.sort(function (a, b) {
if (a.value.outlet === PRIMARY_OUTLET)
return -1;
if (b.value.outlet === PRIMARY_OUTLET)
return 1;
return a.value.outlet.localeCompare(b.value.outlet);
});
}
function getChildConfig(route) {
if (route.children) {
return route.children;
}
if (route.loadChildren) {
return route._loadedConfig.routes;
}
return [];
}
function match$1(segmentGroup, route, segments) {
if (route.path === '') {
if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || segments.length > 0)) {
throw new NoMatch$1();
}
return { consumedSegments: [], lastChild: 0, parameters: {} };
}
var matcher = route.matcher || defaultUrlMatcher;
var res = matcher(segments, segmentGroup, route);
if (!res)
throw new NoMatch$1();
var posParams = {};
forEach(res.posParams, function (v, k) { posParams[k] = v.path; });
var parameters = res.consumed.length > 0 ? Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, posParams, res.consumed[res.consumed.length - 1].parameters) :
posParams;
return { consumedSegments: res.consumed, lastChild: res.consumed.length, parameters: parameters };
}
function checkOutletNameUniqueness(nodes) {
var names = {};
nodes.forEach(function (n) {
var routeWithSameOutletName = names[n.value.outlet];
if (routeWithSameOutletName) {
var p = routeWithSameOutletName.url.map(function (s) { return s.toString(); }).join('/');
var c = n.value.url.map(function (s) { return s.toString(); }).join('/');
throw new Error("Two segments cannot have the same outlet name: '" + p + "' and '" + c + "'.");
}
names[n.value.outlet] = n.value;
});
}
function getSourceSegmentGroup(segmentGroup) {
var s = segmentGroup;
while (s._sourceSegment) {
s = s._sourceSegment;
}
return s;
}
function getPathIndexShift(segmentGroup) {
var s = segmentGroup;
var res = (s._segmentIndexShift ? s._segmentIndexShift : 0);
while (s._sourceSegment) {
s = s._sourceSegment;
res += (s._segmentIndexShift ? s._segmentIndexShift : 0);
}
return res - 1;
}
function split$1(segmentGroup, consumedSegments, slicedSegments, config) {
if (slicedSegments.length > 0 &&
containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, config)) {
var s_1 = new UrlSegmentGroup(consumedSegments, createChildrenForEmptyPaths(segmentGroup, consumedSegments, config, new UrlSegmentGroup(slicedSegments, segmentGroup.children)));
s_1._sourceSegment = segmentGroup;
s_1._segmentIndexShift = consumedSegments.length;
return { segmentGroup: s_1, slicedSegments: [] };
}
if (slicedSegments.length === 0 &&
containsEmptyPathMatches(segmentGroup, slicedSegments, config)) {
var s_2 = new UrlSegmentGroup(segmentGroup.segments, addEmptyPathsToChildrenIfNeeded(segmentGroup, slicedSegments, config, segmentGroup.children));
s_2._sourceSegment = segmentGroup;
s_2._segmentIndexShift = consumedSegments.length;
return { segmentGroup: s_2, slicedSegments: slicedSegments };
}
var s = new UrlSegmentGroup(segmentGroup.segments, segmentGroup.children);
s._sourceSegment = segmentGroup;
s._segmentIndexShift = consumedSegments.length;
return { segmentGroup: s, slicedSegments: slicedSegments };
}
function addEmptyPathsToChildrenIfNeeded(segmentGroup, slicedSegments, routes, children) {
var res = {};
try {
for (var routes_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(routes), routes_1_1 = routes_1.next(); !routes_1_1.done; routes_1_1 = routes_1.next()) {
var r = routes_1_1.value;
if (emptyPathMatch(segmentGroup, slicedSegments, r) && !children[getOutlet$1(r)]) {
var s = new UrlSegmentGroup([], {});
s._sourceSegment = segmentGroup;
s._segmentIndexShift = segmentGroup.segments.length;
res[getOutlet$1(r)] = s;
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (routes_1_1 && !routes_1_1.done && (_a = routes_1.return)) _a.call(routes_1);
}
finally { if (e_2) throw e_2.error; }
}
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, children, res);
var e_2, _a;
}
function createChildrenForEmptyPaths(segmentGroup, consumedSegments, routes, primarySegment) {
var res = {};
res[PRIMARY_OUTLET] = primarySegment;
primarySegment._sourceSegment = segmentGroup;
primarySegment._segmentIndexShift = consumedSegments.length;
try {
for (var routes_2 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(routes), routes_2_1 = routes_2.next(); !routes_2_1.done; routes_2_1 = routes_2.next()) {
var r = routes_2_1.value;
if (r.path === '' && getOutlet$1(r) !== PRIMARY_OUTLET) {
var s = new UrlSegmentGroup([], {});
s._sourceSegment = segmentGroup;
s._segmentIndexShift = consumedSegments.length;
res[getOutlet$1(r)] = s;
}
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (routes_2_1 && !routes_2_1.done && (_a = routes_2.return)) _a.call(routes_2);
}
finally { if (e_3) throw e_3.error; }
}
return res;
var e_3, _a;
}
function containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, routes) {
return routes.some(function (r) { return emptyPathMatch(segmentGroup, slicedSegments, r) && getOutlet$1(r) !== PRIMARY_OUTLET; });
}
function containsEmptyPathMatches(segmentGroup, slicedSegments, routes) {
return routes.some(function (r) { return emptyPathMatch(segmentGroup, slicedSegments, r); });
}
function emptyPathMatch(segmentGroup, slicedSegments, r) {
if ((segmentGroup.hasChildren() || slicedSegments.length > 0) && r.pathMatch === 'full') {
return false;
}
return r.path === '' && r.redirectTo === undefined;
}
function getOutlet$1(route) {
return route.outlet || PRIMARY_OUTLET;
}
function getData(route) {
return route.data || {};
}
function getResolve(route) {
return route.resolve || {};
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
*
* Provides a way to customize when activated routes get reused.
*
* @experimental
*/
var RouteReuseStrategy = /** @class */ (function () {
function RouteReuseStrategy() {
}
return RouteReuseStrategy;
}());
/**
* Does not detach any subtrees. Reuses routes as long as their route config is the same.
*/
var DefaultRouteReuseStrategy = /** @class */ (function () {
function DefaultRouteReuseStrategy() {
}
DefaultRouteReuseStrategy.prototype.shouldDetach = function (route) { return false; };
DefaultRouteReuseStrategy.prototype.store = function (route, detachedTree) { };
DefaultRouteReuseStrategy.prototype.shouldAttach = function (route) { return false; };
DefaultRouteReuseStrategy.prototype.retrieve = function (route) { return null; };
DefaultRouteReuseStrategy.prototype.shouldReuseRoute = function (future, curr) {
return future.routeConfig === curr.routeConfig;
};
return DefaultRouteReuseStrategy;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @docsNotRequired
* @experimental
*/
var ROUTES = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('ROUTES');
var RouterConfigLoader = /** @class */ (function () {
function RouterConfigLoader(loader, compiler, onLoadStartListener, onLoadEndListener) {
this.loader = loader;
this.compiler = compiler;
this.onLoadStartListener = onLoadStartListener;
this.onLoadEndListener = onLoadEndListener;
}
RouterConfigLoader.prototype.load = function (parentInjector, route) {
var _this = this;
if (this.onLoadStartListener) {
this.onLoadStartListener(route);
}
var moduleFactory$ = this.loadModuleFactory(route.loadChildren);
return moduleFactory$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (factory) {
if (_this.onLoadEndListener) {
_this.onLoadEndListener(route);
}
var module = factory.create(parentInjector);
return new LoadedRouterConfig(flatten(module.injector.get(ROUTES)).map(standardizeConfig), module);
}));
};
RouterConfigLoader.prototype.loadModuleFactory = function (loadChildren) {
var _this = this;
if (typeof loadChildren === 'string') {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(this.loader.load(loadChildren));
}
else {
return wrapIntoObservable(loadChildren()).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (t) {
if (t instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactory"]) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(t);
}
else {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(_this.compiler.compileModuleAsync(t));
}
}));
}
};
return RouterConfigLoader;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
*
* Provides a way to migrate AngularJS applications to Angular.
*
* @experimental
*/
var UrlHandlingStrategy = /** @class */ (function () {
function UrlHandlingStrategy() {
}
return UrlHandlingStrategy;
}());
/**
* @experimental
*/
var DefaultUrlHandlingStrategy = /** @class */ (function () {
function DefaultUrlHandlingStrategy() {
}
DefaultUrlHandlingStrategy.prototype.shouldProcessUrl = function (url) { return true; };
DefaultUrlHandlingStrategy.prototype.extract = function (url) { return url; };
DefaultUrlHandlingStrategy.prototype.merge = function (newUrlPart, wholeUrl) { return newUrlPart; };
return DefaultUrlHandlingStrategy;
}());
/**
* @license
* Copyright Google Inc. 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
*/
function defaultErrorHandler(error) {
throw error;
}
function defaultMalformedUriErrorHandler(error, urlSerializer, url) {
return urlSerializer.parse('/');
}
/**
* @internal
*/
function defaultRouterHook(snapshot) {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null);
}
/**
* @description
*
* Provides the navigation and url manipulation capabilities.
*
* See `Routes` for more details and examples.
*
* @ngModule RouterModule
*
*
*/
var Router = /** @class */ (function () {
/**
* Creates the router service.
*/
// TODO: vsavkin make internal after the final is out.
function Router(rootComponentType, urlSerializer, rootContexts, location, injector, loader, compiler, config) {
var _this = this;
this.rootComponentType = rootComponentType;
this.urlSerializer = urlSerializer;
this.rootContexts = rootContexts;
this.location = location;
this.config = config;
this.navigations = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](null);
this.navigationId = 0;
this.events = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
/**
* Error handler that is invoked when a navigation errors.
*
* See `ErrorHandler` for more information.
*/
this.errorHandler = defaultErrorHandler;
/**
* Malformed uri error handler is invoked when `Router.parseUrl(url)` throws an
* error due to containing an invalid character. The most common case would be a `%` sign
* that's not encoded and is not part of a percent encoded sequence.
*/
this.malformedUriErrorHandler = defaultMalformedUriErrorHandler;
/**
* Indicates if at least one navigation happened.
*/
this.navigated = false;
this.lastSuccessfulId = -1;
/**
* Used by RouterModule. This allows us to
* pause the navigation either before preactivation or after it.
* @internal
*/
this.hooks = {
beforePreactivation: defaultRouterHook,
afterPreactivation: defaultRouterHook
};
/**
* Extracts and merges URLs. Used for AngularJS to Angular migrations.
*/
this.urlHandlingStrategy = new DefaultUrlHandlingStrategy();
this.routeReuseStrategy = new DefaultRouteReuseStrategy();
/**
* Define what the router should do if it receives a navigation request to the current URL.
* By default, the router will ignore this navigation. However, this prevents features such
* as a "refresh" button. Use this option to configure the behavior when navigating to the
* current URL. Default is 'ignore'.
*/
this.onSameUrlNavigation = 'ignore';
/**
* Defines how the router merges params, data and resolved data from parent to child
* routes. Available options are:
*
* - `'emptyOnly'`, the default, only inherits parent params for path-less or component-less
* routes.
* - `'always'`, enables unconditional inheritance of parent params.
*/
this.paramsInheritanceStrategy = 'emptyOnly';
var onLoadStart = function (r) { return _this.triggerEvent(new RouteConfigLoadStart(r)); };
var onLoadEnd = function (r) { return _this.triggerEvent(new RouteConfigLoadEnd(r)); };
this.ngModule = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleRef"]);
this.resetConfig(config);
this.currentUrlTree = createEmptyUrlTree();
this.rawUrlTree = this.currentUrlTree;
this.configLoader = new RouterConfigLoader(loader, compiler, onLoadStart, onLoadEnd);
this.routerState = createEmptyState(this.currentUrlTree, this.rootComponentType);
this.processNavigations();
}
/**
* @internal
* TODO: this should be removed once the constructor of the router made internal
*/
Router.prototype.resetRootComponentType = function (rootComponentType) {
this.rootComponentType = rootComponentType;
// TODO: vsavkin router 4.0 should make the root component set to null
// this will simplify the lifecycle of the router.
this.routerState.root.component = this.rootComponentType;
};
/**
* Sets up the location change listener and performs the initial navigation.
*/
Router.prototype.initialNavigation = function () {
this.setUpLocationChangeListener();
if (this.navigationId === 0) {
this.navigateByUrl(this.location.path(true), { replaceUrl: true });
}
};
/**
* Sets up the location change listener.
*/
Router.prototype.setUpLocationChangeListener = function () {
var _this = this;
// Don't need to use Zone.wrap any more, because zone.js
// already patch onPopState, so location change callback will
// run into ngZone
if (!this.locationSubscription) {
this.locationSubscription = this.location.subscribe(function (change) {
var rawUrlTree = _this.parseUrl(change['url']);
var source = change['type'] === 'popstate' ? 'popstate' : 'hashchange';
var state = change.state && change.state.navigationId ?
{ navigationId: change.state.navigationId } :
null;
setTimeout(function () { _this.scheduleNavigation(rawUrlTree, source, state, { replaceUrl: true }); }, 0);
});
}
};
Object.defineProperty(Router.prototype, "url", {
/** The current url */
get: function () { return this.serializeUrl(this.currentUrlTree); },
enumerable: true,
configurable: true
});
/** @internal */
Router.prototype.triggerEvent = function (e) { this.events.next(e); };
/**
* Resets the configuration used for navigation and generating links.
*
* ### Usage
*
* ```
* router.resetConfig([
* { path: 'team/:id', component: TeamCmp, children: [
* { path: 'simple', component: SimpleCmp },
* { path: 'user/:name', component: UserCmp }
* ]}
* ]);
* ```
*/
Router.prototype.resetConfig = function (config) {
validateConfig(config);
this.config = config.map(standardizeConfig);
this.navigated = false;
this.lastSuccessfulId = -1;
};
/** @docsNotRequired */
Router.prototype.ngOnDestroy = function () { this.dispose(); };
/** Disposes of the router */
Router.prototype.dispose = function () {
if (this.locationSubscription) {
this.locationSubscription.unsubscribe();
this.locationSubscription = null;
}
};
/**
* Applies an array of commands to the current url tree and creates a new url tree.
*
* When given an activate route, applies the given commands starting from the route.
* When not given a route, applies the given command starting from the root.
*
* ### Usage
*
* ```
* // create /team/33/user/11
* router.createUrlTree(['/team', 33, 'user', 11]);
*
* // create /team/33;expand=true/user/11
* router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);
*
* // you can collapse static segments like this (this works only with the first passed-in value):
* router.createUrlTree(['/team/33/user', userId]);
*
* // If the first segment can contain slashes, and you do not want the router to split it, you
* // can do the following:
*
* router.createUrlTree([{segmentPath: '/one/two'}]);
*
* // create /team/33/(user/11//right:chat)
* router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);
*
* // remove the right secondary node
* router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);
*
* // assuming the current url is `/team/33/user/11` and the route points to `user/11`
*
* // navigate to /team/33/user/11/details
* router.createUrlTree(['details'], {relativeTo: route});
*
* // navigate to /team/33/user/22
* router.createUrlTree(['../22'], {relativeTo: route});
*
* // navigate to /team/44/user/22
* router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});
* ```
*/
Router.prototype.createUrlTree = function (commands, navigationExtras) {
if (navigationExtras === void 0) { navigationExtras = {}; }
var relativeTo = navigationExtras.relativeTo, queryParams = navigationExtras.queryParams, fragment = navigationExtras.fragment, preserveQueryParams = navigationExtras.preserveQueryParams, queryParamsHandling = navigationExtras.queryParamsHandling, preserveFragment = navigationExtras.preserveFragment;
if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["isDevMode"])() && preserveQueryParams && console && console.warn) {
console.warn('preserveQueryParams is deprecated, use queryParamsHandling instead.');
}
var a = relativeTo || this.routerState.root;
var f = preserveFragment ? this.currentUrlTree.fragment : fragment;
var q = null;
if (queryParamsHandling) {
switch (queryParamsHandling) {
case 'merge':
q = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, this.currentUrlTree.queryParams, queryParams);
break;
case 'preserve':
q = this.currentUrlTree.queryParams;
break;
default:
q = queryParams || null;
}
}
else {
q = preserveQueryParams ? this.currentUrlTree.queryParams : queryParams || null;
}
if (q !== null) {
q = this.removeEmptyProps(q);
}
return createUrlTree(a, this.currentUrlTree, commands, q, f);
};
/**
* Navigate based on the provided url. This navigation is always absolute.
*
* Returns a promise that:
* - resolves to 'true' when navigation succeeds,
* - resolves to 'false' when navigation fails,
* - is rejected when an error happens.
*
* ### Usage
*
* ```
* router.navigateByUrl("/team/33/user/11");
*
* // Navigate without updating the URL
* router.navigateByUrl("/team/33/user/11", { skipLocationChange: true });
* ```
*
* In opposite to `navigate`, `navigateByUrl` takes a whole URL
* and does not apply any delta to the current one.
*/
Router.prototype.navigateByUrl = function (url, extras) {
if (extras === void 0) { extras = { skipLocationChange: false }; }
var urlTree = url instanceof UrlTree ? url : this.parseUrl(url);
var mergedTree = this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree);
return this.scheduleNavigation(mergedTree, 'imperative', null, extras);
};
/**
* Navigate based on the provided array of commands and a starting point.
* If no starting route is provided, the navigation is absolute.
*
* Returns a promise that:
* - resolves to 'true' when navigation succeeds,
* - resolves to 'false' when navigation fails,
* - is rejected when an error happens.
*
* ### Usage
*
* ```
* router.navigate(['team', 33, 'user', 11], {relativeTo: route});
*
* // Navigate without updating the URL
* router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});
* ```
*
* In opposite to `navigateByUrl`, `navigate` always takes a delta that is applied to the current
* URL.
*/
Router.prototype.navigate = function (commands, extras) {
if (extras === void 0) { extras = { skipLocationChange: false }; }
validateCommands(commands);
return this.navigateByUrl(this.createUrlTree(commands, extras), extras);
};
/** Serializes a `UrlTree` into a string */
Router.prototype.serializeUrl = function (url) { return this.urlSerializer.serialize(url); };
/** Parses a string into a `UrlTree` */
Router.prototype.parseUrl = function (url) {
var urlTree;
try {
urlTree = this.urlSerializer.parse(url);
}
catch (e) {
urlTree = this.malformedUriErrorHandler(e, this.urlSerializer, url);
}
return urlTree;
};
/** Returns whether the url is activated */
Router.prototype.isActive = function (url, exact) {
if (url instanceof UrlTree) {
return containsTree(this.currentUrlTree, url, exact);
}
var urlTree = this.parseUrl(url);
return containsTree(this.currentUrlTree, urlTree, exact);
};
Router.prototype.removeEmptyProps = function (params) {
return Object.keys(params).reduce(function (result, key) {
var value = params[key];
if (value !== null && value !== undefined) {
result[key] = value;
}
return result;
}, {});
};
Router.prototype.processNavigations = function () {
var _this = this;
this.navigations
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["concatMap"])(function (nav) {
if (nav) {
_this.executeScheduledNavigation(nav);
// a failed navigation should not stop the router from processing
// further navigations => the catch
return nav.promise.catch(function () { });
}
else {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null);
}
}))
.subscribe(function () { });
};
Router.prototype.scheduleNavigation = function (rawUrl, source, state, extras) {
var lastNavigation = this.navigations.value;
// If the user triggers a navigation imperatively (e.g., by using navigateByUrl),
// and that navigation results in 'replaceState' that leads to the same URL,
// we should skip those.
if (lastNavigation && source !== 'imperative' && lastNavigation.source === 'imperative' &&
lastNavigation.rawUrl.toString() === rawUrl.toString()) {
return Promise.resolve(true); // return value is not used
}
// Because of a bug in IE and Edge, the location class fires two events (popstate and
// hashchange) every single time. The second one should be ignored. Otherwise, the URL will
// flicker. Handles the case when a popstate was emitted first.
if (lastNavigation && source == 'hashchange' && lastNavigation.source === 'popstate' &&
lastNavigation.rawUrl.toString() === rawUrl.toString()) {
return Promise.resolve(true); // return value is not used
}
// Because of a bug in IE and Edge, the location class fires two events (popstate and
// hashchange) every single time. The second one should be ignored. Otherwise, the URL will
// flicker. Handles the case when a hashchange was emitted first.
if (lastNavigation && source == 'popstate' && lastNavigation.source === 'hashchange' &&
lastNavigation.rawUrl.toString() === rawUrl.toString()) {
return Promise.resolve(true); // return value is not used
}
var resolve = null;
var reject = null;
var promise = new Promise(function (res, rej) {
resolve = res;
reject = rej;
});
var id = ++this.navigationId;
this.navigations.next({ id: id, source: source, state: state, rawUrl: rawUrl, extras: extras, resolve: resolve, reject: reject, promise: promise });
// Make sure that the error is propagated even though `processNavigations` catch
// handler does not rethrow
return promise.catch(function (e) { return Promise.reject(e); });
};
Router.prototype.executeScheduledNavigation = function (_a) {
var _this = this;
var id = _a.id, rawUrl = _a.rawUrl, extras = _a.extras, resolve = _a.resolve, reject = _a.reject, source = _a.source, state = _a.state;
var url = this.urlHandlingStrategy.extract(rawUrl);
var urlTransition = !this.navigated || url.toString() !== this.currentUrlTree.toString();
if ((this.onSameUrlNavigation === 'reload' ? true : urlTransition) &&
this.urlHandlingStrategy.shouldProcessUrl(rawUrl)) {
this.events
.next(new NavigationStart(id, this.serializeUrl(url), source, state));
Promise.resolve()
.then(function (_) { return _this.runNavigate(url, rawUrl, !!extras.skipLocationChange, !!extras.replaceUrl, id, null); })
.then(resolve, reject);
// we cannot process the current URL, but we could process the previous one =>
// we need to do some cleanup
}
else if (urlTransition && this.rawUrlTree &&
this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)) {
this.events
.next(new NavigationStart(id, this.serializeUrl(url), source, state));
Promise.resolve()
.then(function (_) { return _this.runNavigate(url, rawUrl, false, false, id, createEmptyState(url, _this.rootComponentType).snapshot); })
.then(resolve, reject);
}
else {
this.rawUrlTree = rawUrl;
resolve(null);
}
};
Router.prototype.runNavigate = function (url, rawUrl, skipLocationChange, replaceUrl, id, precreatedState) {
var _this = this;
if (id !== this.navigationId) {
this.events
.next(new NavigationCancel(id, this.serializeUrl(url), "Navigation ID " + id + " is not equal to the current navigation id " + this.navigationId));
return Promise.resolve(false);
}
return new Promise(function (resolvePromise, rejectPromise) {
// create an observable of the url and route state snapshot
// this operation do not result in any side effects
var urlAndSnapshot$;
if (!precreatedState) {
var moduleInjector = _this.ngModule.injector;
var redirectsApplied$ = applyRedirects(moduleInjector, _this.configLoader, _this.urlSerializer, url, _this.config);
urlAndSnapshot$ = redirectsApplied$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (appliedUrl) {
return recognize(_this.rootComponentType, _this.config, appliedUrl, _this.serializeUrl(appliedUrl), _this.paramsInheritanceStrategy)
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (snapshot) {
_this.events
.next(new RoutesRecognized(id, _this.serializeUrl(url), _this.serializeUrl(appliedUrl), snapshot));
return { appliedUrl: appliedUrl, snapshot: snapshot };
}));
}));
}
else {
urlAndSnapshot$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])({ appliedUrl: url, snapshot: precreatedState });
}
var beforePreactivationDone$ = urlAndSnapshot$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (p) {
if (typeof p === 'boolean')
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(p);
return _this.hooks.beforePreactivation(p.snapshot).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function () { return p; }));
}));
// run preactivation: guards and data resolvers
var preActivation;
var preactivationSetup$ = beforePreactivationDone$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (p) {
if (typeof p === 'boolean')
return p;
var appliedUrl = p.appliedUrl, snapshot = p.snapshot;
var moduleInjector = _this.ngModule.injector;
preActivation = new PreActivation(snapshot, _this.routerState.snapshot, moduleInjector, function (evt) { return _this.triggerEvent(evt); });
preActivation.initialize(_this.rootContexts);
return { appliedUrl: appliedUrl, snapshot: snapshot };
}));
var preactivationCheckGuards$ = preactivationSetup$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (p) {
if (typeof p === 'boolean' || _this.navigationId !== id)
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(false);
var appliedUrl = p.appliedUrl, snapshot = p.snapshot;
_this.triggerEvent(new GuardsCheckStart(id, _this.serializeUrl(url), _this.serializeUrl(appliedUrl), snapshot));
return preActivation.checkGuards().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (shouldActivate) {
_this.triggerEvent(new GuardsCheckEnd(id, _this.serializeUrl(url), _this.serializeUrl(appliedUrl), snapshot, shouldActivate));
return { appliedUrl: appliedUrl, snapshot: snapshot, shouldActivate: shouldActivate };
}));
}));
var preactivationResolveData$ = preactivationCheckGuards$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (p) {
if (typeof p === 'boolean' || _this.navigationId !== id)
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(false);
if (p.shouldActivate && preActivation.isActivating()) {
_this.triggerEvent(new ResolveStart(id, _this.serializeUrl(url), _this.serializeUrl(p.appliedUrl), p.snapshot));
return preActivation.resolveData(_this.paramsInheritanceStrategy).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function () {
_this.triggerEvent(new ResolveEnd(id, _this.serializeUrl(url), _this.serializeUrl(p.appliedUrl), p.snapshot));
return p;
}));
}
else {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(p);
}
}));
var preactivationDone$ = preactivationResolveData$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (p) {
if (typeof p === 'boolean' || _this.navigationId !== id)
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(false);
return _this.hooks.afterPreactivation(p.snapshot).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function () { return p; }));
}));
// create router state
// this operation has side effects => route state is being affected
var routerState$ = preactivationDone$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (p) {
if (typeof p === 'boolean' || _this.navigationId !== id)
return false;
var appliedUrl = p.appliedUrl, snapshot = p.snapshot, shouldActivate = p.shouldActivate;
if (shouldActivate) {
var state = createRouterState(_this.routeReuseStrategy, snapshot, _this.routerState);
return { appliedUrl: appliedUrl, state: state, shouldActivate: shouldActivate };
}
else {
return { appliedUrl: appliedUrl, state: null, shouldActivate: shouldActivate };
}
}));
_this.activateRoutes(routerState$, _this.routerState, _this.currentUrlTree, id, url, rawUrl, skipLocationChange, replaceUrl, resolvePromise, rejectPromise);
});
};
/**
* Performs the logic of activating routes. This is a synchronous process by default. While this
* is a private method, it could be overridden to make activation asynchronous.
*/
Router.prototype.activateRoutes = function (state, storedState, storedUrl, id, url, rawUrl, skipLocationChange, replaceUrl, resolvePromise, rejectPromise) {
var _this = this;
// applied the new router state
// this operation has side effects
var navigationIsSuccessful;
state
.forEach(function (p) {
if (typeof p === 'boolean' || !p.shouldActivate || id !== _this.navigationId || !p.state) {
navigationIsSuccessful = false;
return;
}
var appliedUrl = p.appliedUrl, state = p.state;
_this.currentUrlTree = appliedUrl;
_this.rawUrlTree = _this.urlHandlingStrategy.merge(_this.currentUrlTree, rawUrl);
_this.routerState = state;
if (!skipLocationChange) {
var path = _this.urlSerializer.serialize(_this.rawUrlTree);
if (_this.location.isCurrentPathEqualTo(path) || replaceUrl) {
_this.location.replaceState(path, '', { navigationId: id });
}
else {
_this.location.go(path, '', { navigationId: id });
}
}
new ActivateRoutes(_this.routeReuseStrategy, state, storedState, function (evt) { return _this.triggerEvent(evt); })
.activate(_this.rootContexts);
navigationIsSuccessful = true;
})
.then(function () {
if (navigationIsSuccessful) {
_this.navigated = true;
_this.lastSuccessfulId = id;
_this.events
.next(new NavigationEnd(id, _this.serializeUrl(url), _this.serializeUrl(_this.currentUrlTree)));
resolvePromise(true);
}
else {
_this.resetUrlToCurrentUrlTree();
_this.events
.next(new NavigationCancel(id, _this.serializeUrl(url), ''));
resolvePromise(false);
}
}, function (e) {
if (isNavigationCancelingError(e)) {
_this.navigated = true;
_this.resetStateAndUrl(storedState, storedUrl, rawUrl);
_this.events
.next(new NavigationCancel(id, _this.serializeUrl(url), e.message));
resolvePromise(false);
}
else {
_this.resetStateAndUrl(storedState, storedUrl, rawUrl);
_this.events
.next(new NavigationError(id, _this.serializeUrl(url), e));
try {
resolvePromise(_this.errorHandler(e));
}
catch (ee) {
rejectPromise(ee);
}
}
});
};
Router.prototype.resetStateAndUrl = function (storedState, storedUrl, rawUrl) {
this.routerState = storedState;
this.currentUrlTree = storedUrl;
this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, rawUrl);
this.resetUrlToCurrentUrlTree();
};
Router.prototype.resetUrlToCurrentUrlTree = function () {
this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree), '', { navigationId: this.lastSuccessfulId });
};
return Router;
}());
var ActivateRoutes = /** @class */ (function () {
function ActivateRoutes(routeReuseStrategy, futureState, currState, forwardEvent) {
this.routeReuseStrategy = routeReuseStrategy;
this.futureState = futureState;
this.currState = currState;
this.forwardEvent = forwardEvent;
}
ActivateRoutes.prototype.activate = function (parentContexts) {
var futureRoot = this.futureState._root;
var currRoot = this.currState ? this.currState._root : null;
this.deactivateChildRoutes(futureRoot, currRoot, parentContexts);
advanceActivatedRoute(this.futureState.root);
this.activateChildRoutes(futureRoot, currRoot, parentContexts);
};
// De-activate the child route that are not re-used for the future state
ActivateRoutes.prototype.deactivateChildRoutes = function (futureNode, currNode, contexts) {
var _this = this;
var children = nodeChildrenAsMap(currNode);
// Recurse on the routes active in the future state to de-activate deeper children
futureNode.children.forEach(function (futureChild) {
var childOutletName = futureChild.value.outlet;
_this.deactivateRoutes(futureChild, children[childOutletName], contexts);
delete children[childOutletName];
});
// De-activate the routes that will not be re-used
forEach(children, function (v, childName) {
_this.deactivateRouteAndItsChildren(v, contexts);
});
};
ActivateRoutes.prototype.deactivateRoutes = function (futureNode, currNode, parentContext) {
var future = futureNode.value;
var curr = currNode ? currNode.value : null;
if (future === curr) {
// Reusing the node, check to see if the children need to be de-activated
if (future.component) {
// If we have a normal route, we need to go through an outlet.
var context = parentContext.getContext(future.outlet);
if (context) {
this.deactivateChildRoutes(futureNode, currNode, context.children);
}
}
else {
// if we have a componentless route, we recurse but keep the same outlet map.
this.deactivateChildRoutes(futureNode, currNode, parentContext);
}
}
else {
if (curr) {
// Deactivate the current route which will not be re-used
this.deactivateRouteAndItsChildren(currNode, parentContext);
}
}
};
ActivateRoutes.prototype.deactivateRouteAndItsChildren = function (route, parentContexts) {
if (this.routeReuseStrategy.shouldDetach(route.value.snapshot)) {
this.detachAndStoreRouteSubtree(route, parentContexts);
}
else {
this.deactivateRouteAndOutlet(route, parentContexts);
}
};
ActivateRoutes.prototype.detachAndStoreRouteSubtree = function (route, parentContexts) {
var context = parentContexts.getContext(route.value.outlet);
if (context && context.outlet) {
var componentRef = context.outlet.detach();
var contexts = context.children.onOutletDeactivated();
this.routeReuseStrategy.store(route.value.snapshot, { componentRef: componentRef, route: route, contexts: contexts });
}
};
ActivateRoutes.prototype.deactivateRouteAndOutlet = function (route, parentContexts) {
var _this = this;
var context = parentContexts.getContext(route.value.outlet);
if (context) {
var children = nodeChildrenAsMap(route);
var contexts_1 = route.value.component ? context.children : parentContexts;
forEach(children, function (v, k) { return _this.deactivateRouteAndItsChildren(v, contexts_1); });
if (context.outlet) {
// Destroy the component
context.outlet.deactivate();
// Destroy the contexts for all the outlets that were in the component
context.children.onOutletDeactivated();
}
}
};
ActivateRoutes.prototype.activateChildRoutes = function (futureNode, currNode, contexts) {
var _this = this;
var children = nodeChildrenAsMap(currNode);
futureNode.children.forEach(function (c) {
_this.activateRoutes(c, children[c.value.outlet], contexts);
_this.forwardEvent(new ActivationEnd(c.value.snapshot));
});
if (futureNode.children.length) {
this.forwardEvent(new ChildActivationEnd(futureNode.value.snapshot));
}
};
ActivateRoutes.prototype.activateRoutes = function (futureNode, currNode, parentContexts) {
var future = futureNode.value;
var curr = currNode ? currNode.value : null;
advanceActivatedRoute(future);
// reusing the node
if (future === curr) {
if (future.component) {
// If we have a normal route, we need to go through an outlet.
var context = parentContexts.getOrCreateContext(future.outlet);
this.activateChildRoutes(futureNode, currNode, context.children);
}
else {
// if we have a componentless route, we recurse but keep the same outlet map.
this.activateChildRoutes(futureNode, currNode, parentContexts);
}
}
else {
if (future.component) {
// if we have a normal route, we need to place the component into the outlet and recurse.
var context = parentContexts.getOrCreateContext(future.outlet);
if (this.routeReuseStrategy.shouldAttach(future.snapshot)) {
var stored = this.routeReuseStrategy.retrieve(future.snapshot);
this.routeReuseStrategy.store(future.snapshot, null);
context.children.onOutletReAttached(stored.contexts);
context.attachRef = stored.componentRef;
context.route = stored.route.value;
if (context.outlet) {
// Attach right away when the outlet has already been instantiated
// Otherwise attach from `RouterOutlet.ngOnInit` when it is instantiated
context.outlet.attach(stored.componentRef, stored.route.value);
}
advanceActivatedRouteNodeAndItsChildren(stored.route);
}
else {
var config = parentLoadedConfig(future.snapshot);
var cmpFactoryResolver = config ? config.module.componentFactoryResolver : null;
context.route = future;
context.resolver = cmpFactoryResolver;
if (context.outlet) {
// Activate the outlet when it has already been instantiated
// Otherwise it will get activated from its `ngOnInit` when instantiated
context.outlet.activateWith(future, cmpFactoryResolver);
}
this.activateChildRoutes(futureNode, null, context.children);
}
}
else {
// if we have a componentless route, we recurse but keep the same outlet map.
this.activateChildRoutes(futureNode, null, parentContexts);
}
}
};
return ActivateRoutes;
}());
function advanceActivatedRouteNodeAndItsChildren(node) {
advanceActivatedRoute(node.value);
node.children.forEach(advanceActivatedRouteNodeAndItsChildren);
}
function parentLoadedConfig(snapshot) {
for (var s = snapshot.parent; s; s = s.parent) {
var route = s.routeConfig;
if (route && route._loadedConfig)
return route._loadedConfig;
if (route && route.component)
return null;
}
return null;
}
function validateCommands(commands) {
for (var i = 0; i < commands.length; i++) {
var cmd = commands[i];
if (cmd == null) {
throw new Error("The requested path contains " + cmd + " segment at index " + i);
}
}
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
*
* Lets you link to specific routes in your app.
*
* Consider the following route configuration:
* `[{ path: 'user/:name', component: UserCmp }]`.
* When linking to this `user/:name` route, you use the `RouterLink` directive.
*
* If the link is static, you can use the directive as follows:
* `<a routerLink="/user/bob">link to user component</a>`
*
* If you use dynamic values to generate the link, you can pass an array of path
* segments, followed by the params for each segment.
*
* For instance `['/team', teamId, 'user', userName, {details: true}]`
* means that we want to generate a link to `/team/11/user/bob;details=true`.
*
* Multiple static segments can be merged into one
* (e.g., `['/team/11/user', userName, {details: true}]`).
*
* The first segment name can be prepended with `/`, `./`, or `../`:
* * If the first segment begins with `/`, the router will look up the route from the root of the
* app.
* * If the first segment begins with `./`, or doesn't begin with a slash, the router will
* instead look in the children of the current activated route.
* * And if the first segment begins with `../`, the router will go up one level.
*
* You can set query params and fragment as follows:
*
* ```
* <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" fragment="education">
* link to user component
* </a>
* ```
* RouterLink will use these to generate this link: `/user/bob#education?debug=true`.
*
* (Deprecated in v4.0.0 use `queryParamsHandling` instead) You can also tell the
* directive to preserve the current query params and fragment:
*
* ```
* <a [routerLink]="['/user/bob']" preserveQueryParams preserveFragment>
* link to user component
* </a>
* ```
*
* You can tell the directive to how to handle queryParams, available options are:
* - `'merge'`: merge the queryParams into the current queryParams
* - `'preserve'`: preserve the current queryParams
* - default/`''`: use the queryParams only
*
* Same options for {@link NavigationExtras#queryParamsHandling
* NavigationExtras#queryParamsHandling}.
*
* ```
* <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" queryParamsHandling="merge">
* link to user component
* </a>
* ```
*
* The router link directive always treats the provided input as a delta to the current url.
*
* For instance, if the current url is `/user/(box//aux:team)`.
*
* Then the following link `<a [routerLink]="['/user/jim']">Jim</a>` will generate the link
* `/user/(jim//aux:team)`.
*
* See {@link Router#createUrlTree createUrlTree} for more information.
*
* @ngModule RouterModule
*
*
*/
var RouterLink = /** @class */ (function () {
function RouterLink(router, route, tabIndex, renderer, el) {
this.router = router;
this.route = route;
this.commands = [];
if (tabIndex == null) {
renderer.setAttribute(el.nativeElement, 'tabindex', '0');
}
}
Object.defineProperty(RouterLink.prototype, "routerLink", {
set: function (commands) {
if (commands != null) {
this.commands = Array.isArray(commands) ? commands : [commands];
}
else {
this.commands = [];
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(RouterLink.prototype, "preserveQueryParams", {
/**
* @deprecated 4.0.0 use `queryParamsHandling` instead.
*/
set: function (value) {
if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["isDevMode"])() && console && console.warn) {
console.warn('preserveQueryParams is deprecated!, use queryParamsHandling instead.');
}
this.preserve = value;
},
enumerable: true,
configurable: true
});
RouterLink.prototype.onClick = function () {
var extras = {
skipLocationChange: attrBoolValue(this.skipLocationChange),
replaceUrl: attrBoolValue(this.replaceUrl),
};
this.router.navigateByUrl(this.urlTree, extras);
return true;
};
Object.defineProperty(RouterLink.prototype, "urlTree", {
get: function () {
return this.router.createUrlTree(this.commands, {
relativeTo: this.route,
queryParams: this.queryParams,
fragment: this.fragment,
preserveQueryParams: attrBoolValue(this.preserve),
queryParamsHandling: this.queryParamsHandling,
preserveFragment: attrBoolValue(this.preserveFragment),
});
},
enumerable: true,
configurable: true
});
RouterLink.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: ':not(a)[routerLink]' },] }
];
/** @nocollapse */
RouterLink.ctorParameters = function () { return [
{ type: Router },
{ type: ActivatedRoute },
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Attribute"], args: ['tabindex',] }] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }
]; };
RouterLink.propDecorators = {
queryParams: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
fragment: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
queryParamsHandling: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
preserveFragment: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
skipLocationChange: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
replaceUrl: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
routerLink: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
preserveQueryParams: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
onClick: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostListener"], args: ['click',] }]
};
return RouterLink;
}());
/**
* @description
*
* Lets you link to specific routes in your app.
*
* See `RouterLink` for more information.
*
* @ngModule RouterModule
*
*
*/
var RouterLinkWithHref = /** @class */ (function () {
function RouterLinkWithHref(router, route, locationStrategy) {
var _this = this;
this.router = router;
this.route = route;
this.locationStrategy = locationStrategy;
this.commands = [];
this.subscription = router.events.subscribe(function (s) {
if (s instanceof NavigationEnd) {
_this.updateTargetUrlAndHref();
}
});
}
Object.defineProperty(RouterLinkWithHref.prototype, "routerLink", {
set: function (commands) {
if (commands != null) {
this.commands = Array.isArray(commands) ? commands : [commands];
}
else {
this.commands = [];
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(RouterLinkWithHref.prototype, "preserveQueryParams", {
set: function (value) {
if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["isDevMode"])() && console && console.warn) {
console.warn('preserveQueryParams is deprecated, use queryParamsHandling instead.');
}
this.preserve = value;
},
enumerable: true,
configurable: true
});
RouterLinkWithHref.prototype.ngOnChanges = function (changes) { this.updateTargetUrlAndHref(); };
RouterLinkWithHref.prototype.ngOnDestroy = function () { this.subscription.unsubscribe(); };
RouterLinkWithHref.prototype.onClick = function (button, ctrlKey, metaKey, shiftKey) {
if (button !== 0 || ctrlKey || metaKey || shiftKey) {
return true;
}
if (typeof this.target === 'string' && this.target != '_self') {
return true;
}
var extras = {
skipLocationChange: attrBoolValue(this.skipLocationChange),
replaceUrl: attrBoolValue(this.replaceUrl),
};
this.router.navigateByUrl(this.urlTree, extras);
return false;
};
RouterLinkWithHref.prototype.updateTargetUrlAndHref = function () {
this.href = this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree));
};
Object.defineProperty(RouterLinkWithHref.prototype, "urlTree", {
get: function () {
return this.router.createUrlTree(this.commands, {
relativeTo: this.route,
queryParams: this.queryParams,
fragment: this.fragment,
preserveQueryParams: attrBoolValue(this.preserve),
queryParamsHandling: this.queryParamsHandling,
preserveFragment: attrBoolValue(this.preserveFragment),
});
},
enumerable: true,
configurable: true
});
RouterLinkWithHref.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: 'a[routerLink]' },] }
];
/** @nocollapse */
RouterLinkWithHref.ctorParameters = function () { return [
{ type: Router },
{ type: ActivatedRoute },
{ type: _angular_common__WEBPACK_IMPORTED_MODULE_4__["LocationStrategy"] }
]; };
RouterLinkWithHref.propDecorators = {
target: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostBinding"], args: ['attr.target',] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
queryParams: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
fragment: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
queryParamsHandling: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
preserveFragment: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
skipLocationChange: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
replaceUrl: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
href: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostBinding"] }],
routerLink: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
preserveQueryParams: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
onClick: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostListener"], args: ['click', ['$event.button', '$event.ctrlKey', '$event.metaKey', '$event.shiftKey'],] }]
};
return RouterLinkWithHref;
}());
function attrBoolValue(s) {
return s === '' || !!s;
}
/**
* @license
* Copyright Google Inc. 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
*/
/**
*
* @description
*
* Lets you add a CSS class to an element when the link's route becomes active.
*
* This directive lets you add a CSS class to an element when the link's route
* becomes active.
*
* Consider the following example:
*
* ```
* <a routerLink="/user/bob" routerLinkActive="active-link">Bob</a>
* ```
*
* When the url is either '/user' or '/user/bob', the active-link class will
* be added to the `a` tag. If the url changes, the class will be removed.
*
* You can set more than one class, as follows:
*
* ```
* <a routerLink="/user/bob" routerLinkActive="class1 class2">Bob</a>
* <a routerLink="/user/bob" [routerLinkActive]="['class1', 'class2']">Bob</a>
* ```
*
* You can configure RouterLinkActive by passing `exact: true`. This will add the classes
* only when the url matches the link exactly.
*
* ```
* <a routerLink="/user/bob" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact:
* true}">Bob</a>
* ```
*
* You can assign the RouterLinkActive instance to a template variable and directly check
* the `isActive` status.
* ```
* <a routerLink="/user/bob" routerLinkActive #rla="routerLinkActive">
* Bob {{ rla.isActive ? '(already open)' : ''}}
* </a>
* ```
*
* Finally, you can apply the RouterLinkActive directive to an ancestor of a RouterLink.
*
* ```
* <div routerLinkActive="active-link" [routerLinkActiveOptions]="{exact: true}">
* <a routerLink="/user/jim">Jim</a>
* <a routerLink="/user/bob">Bob</a>
* </div>
* ```
*
* This will set the active-link class on the div tag if the url is either '/user/jim' or
* '/user/bob'.
*
* @ngModule RouterModule
*
*
*/
var RouterLinkActive = /** @class */ (function () {
function RouterLinkActive(router, element, renderer, cdr) {
var _this = this;
this.router = router;
this.element = element;
this.renderer = renderer;
this.cdr = cdr;
this.classes = [];
this.isActive = false;
this.routerLinkActiveOptions = { exact: false };
this.subscription = router.events.subscribe(function (s) {
if (s instanceof NavigationEnd) {
_this.update();
}
});
}
RouterLinkActive.prototype.ngAfterContentInit = function () {
var _this = this;
this.links.changes.subscribe(function (_) { return _this.update(); });
this.linksWithHrefs.changes.subscribe(function (_) { return _this.update(); });
this.update();
};
Object.defineProperty(RouterLinkActive.prototype, "routerLinkActive", {
set: function (data) {
var classes = Array.isArray(data) ? data : data.split(' ');
this.classes = classes.filter(function (c) { return !!c; });
},
enumerable: true,
configurable: true
});
RouterLinkActive.prototype.ngOnChanges = function (changes) { this.update(); };
RouterLinkActive.prototype.ngOnDestroy = function () { this.subscription.unsubscribe(); };
RouterLinkActive.prototype.update = function () {
var _this = this;
if (!this.links || !this.linksWithHrefs || !this.router.navigated)
return;
Promise.resolve().then(function () {
var hasActiveLinks = _this.hasActiveLinks();
if (_this.isActive !== hasActiveLinks) {
_this.isActive = hasActiveLinks;
_this.classes.forEach(function (c) {
if (hasActiveLinks) {
_this.renderer.addClass(_this.element.nativeElement, c);
}
else {
_this.renderer.removeClass(_this.element.nativeElement, c);
}
});
}
});
};
RouterLinkActive.prototype.isLinkActive = function (router) {
var _this = this;
return function (link) {
return router.isActive(link.urlTree, _this.routerLinkActiveOptions.exact);
};
};
RouterLinkActive.prototype.hasActiveLinks = function () {
return this.links.some(this.isLinkActive(this.router)) ||
this.linksWithHrefs.some(this.isLinkActive(this.router));
};
RouterLinkActive.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{
selector: '[routerLinkActive]',
exportAs: 'routerLinkActive',
},] }
];
/** @nocollapse */
RouterLinkActive.ctorParameters = function () { return [
{ type: Router },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"] }
]; };
RouterLinkActive.propDecorators = {
links: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [RouterLink, { descendants: true },] }],
linksWithHrefs: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [RouterLinkWithHref, { descendants: true },] }],
routerLinkActiveOptions: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
routerLinkActive: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }]
};
return RouterLinkActive;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Store contextual information about a `RouterOutlet`
*
*
*/
var OutletContext = /** @class */ (function () {
function OutletContext() {
this.outlet = null;
this.route = null;
this.resolver = null;
this.children = new ChildrenOutletContexts();
this.attachRef = null;
}
return OutletContext;
}());
/**
* Store contextual information about the children (= nested) `RouterOutlet`
*
*
*/
var ChildrenOutletContexts = /** @class */ (function () {
function ChildrenOutletContexts() {
// contexts for child outlets, by name.
this.contexts = new Map();
}
/** Called when a `RouterOutlet` directive is instantiated */
ChildrenOutletContexts.prototype.onChildOutletCreated = function (childName, outlet) {
var context = this.getOrCreateContext(childName);
context.outlet = outlet;
this.contexts.set(childName, context);
};
/**
* Called when a `RouterOutlet` directive is destroyed.
* We need to keep the context as the outlet could be destroyed inside a NgIf and might be
* re-created later.
*/
ChildrenOutletContexts.prototype.onChildOutletDestroyed = function (childName) {
var context = this.getContext(childName);
if (context) {
context.outlet = null;
}
};
/**
* Called when the corresponding route is deactivated during navigation.
* Because the component get destroyed, all children outlet are destroyed.
*/
ChildrenOutletContexts.prototype.onOutletDeactivated = function () {
var contexts = this.contexts;
this.contexts = new Map();
return contexts;
};
ChildrenOutletContexts.prototype.onOutletReAttached = function (contexts) { this.contexts = contexts; };
ChildrenOutletContexts.prototype.getOrCreateContext = function (childName) {
var context = this.getContext(childName);
if (!context) {
context = new OutletContext();
this.contexts.set(childName, context);
}
return context;
};
ChildrenOutletContexts.prototype.getContext = function (childName) { return this.contexts.get(childName) || null; };
return ChildrenOutletContexts;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
*
* Acts as a placeholder that Angular dynamically fills based on the current router state.
*
* ```
* <router-outlet></router-outlet>
* <router-outlet name='left'></router-outlet>
* <router-outlet name='right'></router-outlet>
* ```
*
* A router outlet will emit an activate event any time a new component is being instantiated,
* and a deactivate event when it is being destroyed.
*
* ```
* <router-outlet
* (activate)='onActivate($event)'
* (deactivate)='onDeactivate($event)'></router-outlet>
* ```
* @ngModule RouterModule
*
*
*/
var RouterOutlet = /** @class */ (function () {
function RouterOutlet(parentContexts, location, resolver, name, changeDetector) {
this.parentContexts = parentContexts;
this.location = location;
this.resolver = resolver;
this.changeDetector = changeDetector;
this.activated = null;
this._activatedRoute = null;
this.activateEvents = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
this.deactivateEvents = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
this.name = name || PRIMARY_OUTLET;
parentContexts.onChildOutletCreated(this.name, this);
}
RouterOutlet.prototype.ngOnDestroy = function () { this.parentContexts.onChildOutletDestroyed(this.name); };
RouterOutlet.prototype.ngOnInit = function () {
if (!this.activated) {
// If the outlet was not instantiated at the time the route got activated we need to populate
// the outlet when it is initialized (ie inside a NgIf)
var context = this.parentContexts.getContext(this.name);
if (context && context.route) {
if (context.attachRef) {
// `attachRef` is populated when there is an existing component to mount
this.attach(context.attachRef, context.route);
}
else {
// otherwise the component defined in the configuration is created
this.activateWith(context.route, context.resolver || null);
}
}
}
};
Object.defineProperty(RouterOutlet.prototype, "isActivated", {
get: function () { return !!this.activated; },
enumerable: true,
configurable: true
});
Object.defineProperty(RouterOutlet.prototype, "component", {
get: function () {
if (!this.activated)
throw new Error('Outlet is not activated');
return this.activated.instance;
},
enumerable: true,
configurable: true
});
Object.defineProperty(RouterOutlet.prototype, "activatedRoute", {
get: function () {
if (!this.activated)
throw new Error('Outlet is not activated');
return this._activatedRoute;
},
enumerable: true,
configurable: true
});
Object.defineProperty(RouterOutlet.prototype, "activatedRouteData", {
get: function () {
if (this._activatedRoute) {
return this._activatedRoute.snapshot.data;
}
return {};
},
enumerable: true,
configurable: true
});
/**
* Called when the `RouteReuseStrategy` instructs to detach the subtree
*/
RouterOutlet.prototype.detach = function () {
if (!this.activated)
throw new Error('Outlet is not activated');
this.location.detach();
var cmp = this.activated;
this.activated = null;
this._activatedRoute = null;
return cmp;
};
/**
* Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree
*/
RouterOutlet.prototype.attach = function (ref, activatedRoute) {
this.activated = ref;
this._activatedRoute = activatedRoute;
this.location.insert(ref.hostView);
};
RouterOutlet.prototype.deactivate = function () {
if (this.activated) {
var c = this.component;
this.activated.destroy();
this.activated = null;
this._activatedRoute = null;
this.deactivateEvents.emit(c);
}
};
RouterOutlet.prototype.activateWith = function (activatedRoute, resolver) {
if (this.isActivated) {
throw new Error('Cannot activate an already activated outlet');
}
this._activatedRoute = activatedRoute;
var snapshot = activatedRoute._futureSnapshot;
var component = snapshot.routeConfig.component;
resolver = resolver || this.resolver;
var factory = resolver.resolveComponentFactory(component);
var childContexts = this.parentContexts.getOrCreateContext(this.name).children;
var injector = new OutletInjector(activatedRoute, childContexts, this.location.injector);
this.activated = this.location.createComponent(factory, this.location.length, injector);
// Calling `markForCheck` to make sure we will run the change detection when the
// `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component.
this.changeDetector.markForCheck();
this.activateEvents.emit(this.activated.instance);
};
RouterOutlet.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: 'router-outlet', exportAs: 'outlet' },] }
];
/** @nocollapse */
RouterOutlet.ctorParameters = function () { return [
{ type: ChildrenOutletContexts },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactoryResolver"] },
{ type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Attribute"], args: ['name',] }] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"] }
]; };
RouterOutlet.propDecorators = {
activateEvents: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"], args: ['activate',] }],
deactivateEvents: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"], args: ['deactivate',] }]
};
return RouterOutlet;
}());
var OutletInjector = /** @class */ (function () {
function OutletInjector(route, childContexts, parent) {
this.route = route;
this.childContexts = childContexts;
this.parent = parent;
}
OutletInjector.prototype.get = function (token, notFoundValue) {
if (token === ActivatedRoute) {
return this.route;
}
if (token === ChildrenOutletContexts) {
return this.childContexts;
}
return this.parent.get(token, notFoundValue);
};
return OutletInjector;
}());
/**
*@license
*Copyright Google Inc. 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
*/
/**
* @description
*
* Provides a preloading strategy.
*
* @experimental
*/
var PreloadingStrategy = /** @class */ (function () {
function PreloadingStrategy() {
}
return PreloadingStrategy;
}());
/**
* @description
*
* Provides a preloading strategy that preloads all modules as quickly as possible.
*
* ```
* RouteModule.forRoot(ROUTES, {preloadingStrategy: PreloadAllModules})
* ```
*
* @experimental
*/
var PreloadAllModules = /** @class */ (function () {
function PreloadAllModules() {
}
PreloadAllModules.prototype.preload = function (route, fn) {
return fn().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(function () { return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null); }));
};
return PreloadAllModules;
}());
/**
* @description
*
* Provides a preloading strategy that does not preload any modules.
*
* This strategy is enabled by default.
*
* @experimental
*/
var NoPreloading = /** @class */ (function () {
function NoPreloading() {
}
NoPreloading.prototype.preload = function (route, fn) { return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null); };
return NoPreloading;
}());
/**
* The preloader optimistically loads all router configurations to
* make navigations into lazily-loaded sections of the application faster.
*
* The preloader runs in the background. When the router bootstraps, the preloader
* starts listening to all navigation events. After every such event, the preloader
* will check if any configurations can be loaded lazily.
*
* If a route is protected by `canLoad` guards, the preloaded will not load it.
*
*
*/
var RouterPreloader = /** @class */ (function () {
function RouterPreloader(router, moduleLoader, compiler, injector, preloadingStrategy) {
this.router = router;
this.injector = injector;
this.preloadingStrategy = preloadingStrategy;
var onStartLoad = function (r) { return router.triggerEvent(new RouteConfigLoadStart(r)); };
var onEndLoad = function (r) { return router.triggerEvent(new RouteConfigLoadEnd(r)); };
this.loader = new RouterConfigLoader(moduleLoader, compiler, onStartLoad, onEndLoad);
}
RouterPreloader.prototype.setUpPreloading = function () {
var _this = this;
this.subscription =
this.router.events
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])(function (e) { return e instanceof NavigationEnd; }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["concatMap"])(function () { return _this.preload(); }))
.subscribe(function () { });
};
RouterPreloader.prototype.preload = function () {
var ngModule = this.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleRef"]);
return this.processRoutes(ngModule, this.router.config);
};
// TODO(jasonaden): This class relies on code external to the class to call setUpPreloading. If
// this hasn't been done, ngOnDestroy will fail as this.subscription will be undefined. This
// should be refactored.
RouterPreloader.prototype.ngOnDestroy = function () { this.subscription.unsubscribe(); };
RouterPreloader.prototype.processRoutes = function (ngModule, routes) {
var res = [];
try {
for (var routes_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(routes), routes_1_1 = routes_1.next(); !routes_1_1.done; routes_1_1 = routes_1.next()) {
var route = routes_1_1.value;
// we already have the config loaded, just recurse
if (route.loadChildren && !route.canLoad && route._loadedConfig) {
var childConfig = route._loadedConfig;
res.push(this.processRoutes(childConfig.module, childConfig.routes));
// no config loaded, fetch the config
}
else if (route.loadChildren && !route.canLoad) {
res.push(this.preloadConfig(ngModule, route));
// recurse into children
}
else if (route.children) {
res.push(this.processRoutes(ngModule, route.children));
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (routes_1_1 && !routes_1_1.done && (_a = routes_1.return)) _a.call(routes_1);
}
finally { if (e_1) throw e_1.error; }
}
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(res).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeAll"])(), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(function (_) { return void 0; }));
var e_1, _a;
};
RouterPreloader.prototype.preloadConfig = function (ngModule, route) {
var _this = this;
return this.preloadingStrategy.preload(route, function () {
var loaded$ = _this.loader.load(ngModule.injector, route);
return loaded$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(function (config) {
route._loadedConfig = config;
return _this.processRoutes(config.module, config.routes);
}));
});
};
RouterPreloader.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
/** @nocollapse */
RouterPreloader.ctorParameters = function () { return [
{ type: Router },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactoryLoader"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Compiler"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"] },
{ type: PreloadingStrategy }
]; };
return RouterPreloader;
}());
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @description
*
* Contains a list of directives
*
*
*/
var ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, EmptyOutletComponent];
/**
* @description
*
* Is used in DI to configure the router.
*
*
*/
var ROUTER_CONFIGURATION = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('ROUTER_CONFIGURATION');
/**
* @docsNotRequired
*/
var ROUTER_FORROOT_GUARD = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('ROUTER_FORROOT_GUARD');
var ROUTER_PROVIDERS = [
_angular_common__WEBPACK_IMPORTED_MODULE_4__["Location"],
{ provide: UrlSerializer, useClass: DefaultUrlSerializer },
{
provide: Router,
useFactory: setupRouter,
deps: [
_angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationRef"], UrlSerializer, ChildrenOutletContexts, _angular_common__WEBPACK_IMPORTED_MODULE_4__["Location"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"],
_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactoryLoader"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["Compiler"], ROUTES, ROUTER_CONFIGURATION,
[UrlHandlingStrategy, new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]()], [RouteReuseStrategy, new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]()]
]
},
ChildrenOutletContexts,
{ provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactoryLoader"], useClass: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SystemJsNgModuleLoader"] },
RouterPreloader,
NoPreloading,
PreloadAllModules,
{ provide: ROUTER_CONFIGURATION, useValue: { enableTracing: false } },
];
function routerNgProbeToken() {
return new _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgProbeToken"]('Router', Router);
}
/**
* @usageNotes
*
* RouterModule can be imported multiple times: once per lazily-loaded bundle.
* Since the router deals with a global shared resource--location, we cannot have
* more than one router service active.
*
* That is why there are two ways to create the module: `RouterModule.forRoot` and
* `RouterModule.forChild`.
*
* * `forRoot` creates a module that contains all the directives, the given routes, and the router
* service itself.
* * `forChild` creates a module that contains all the directives and the given routes, but does not
* include the router service.
*
* When registered at the root, the module should be used as follows
*
* ```
* @NgModule({
* imports: [RouterModule.forRoot(ROUTES)]
* })
* class MyNgModule {}
* ```
*
* For submodules and lazy loaded submodules the module should be used as follows:
*
* ```
* @NgModule({
* imports: [RouterModule.forChild(ROUTES)]
* })
* class MyNgModule {}
* ```
*
* @description
*
* Adds router directives and providers.
*
* Managing state transitions is one of the hardest parts of building applications. This is
* especially true on the web, where you also need to ensure that the state is reflected in the URL.
* In addition, we often want to split applications into multiple bundles and load them on demand.
* Doing this transparently is not trivial.
*
* The Angular router solves these problems. Using the router, you can declaratively specify
* application states, manage state transitions while taking care of the URL, and load bundles on
* demand.
*
* [Read this developer guide](https://angular.io/docs/ts/latest/guide/router.html) to get an
* overview of how the router should be used.
*
*
*/
var RouterModule = /** @class */ (function () {
// Note: We are injecting the Router so it gets created eagerly...
function RouterModule(guard, router) {
}
/**
* Creates a module with all the router providers and directives. It also optionally sets up an
* application listener to perform an initial navigation.
*
* Options (see `ExtraOptions`):
* * `enableTracing` makes the router log all its internal events to the console.
* * `useHash` enables the location strategy that uses the URL fragment instead of the history
* API.
* * `initialNavigation` disables the initial navigation.
* * `errorHandler` provides a custom error handler.
* * `preloadingStrategy` configures a preloading strategy (see `PreloadAllModules`).
* * `onSameUrlNavigation` configures how the router handles navigation to the current URL. See
* `ExtraOptions` for more details.
* * `paramsInheritanceStrategy` defines how the router merges params, data and resolved data
* from parent to child routes.
*/
RouterModule.forRoot = function (routes, config) {
return {
ngModule: RouterModule,
providers: [
ROUTER_PROVIDERS,
provideRoutes(routes),
{
provide: ROUTER_FORROOT_GUARD,
useFactory: provideForRootGuard,
deps: [[Router, new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"]()]]
},
{ provide: ROUTER_CONFIGURATION, useValue: config ? config : {} },
{
provide: _angular_common__WEBPACK_IMPORTED_MODULE_4__["LocationStrategy"],
useFactory: provideLocationStrategy,
deps: [
_angular_common__WEBPACK_IMPORTED_MODULE_4__["PlatformLocation"], [new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"](_angular_common__WEBPACK_IMPORTED_MODULE_4__["APP_BASE_HREF"]), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]()], ROUTER_CONFIGURATION
]
},
{
provide: PreloadingStrategy,
useExisting: config && config.preloadingStrategy ? config.preloadingStrategy :
NoPreloading
},
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgProbeToken"], multi: true, useFactory: routerNgProbeToken },
provideRouterInitializer(),
],
};
};
/**
* Creates a module with all the router directives and a provider registering routes.
*/
RouterModule.forChild = function (routes) {
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
};
RouterModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{
declarations: ROUTER_DIRECTIVES,
exports: ROUTER_DIRECTIVES,
entryComponents: [EmptyOutletComponent]
},] }
];
/** @nocollapse */
RouterModule.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [ROUTER_FORROOT_GUARD,] }] },
{ type: Router, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }] }
]; };
return RouterModule;
}());
function provideLocationStrategy(platformLocationStrategy, baseHref, options) {
if (options === void 0) { options = {}; }
return options.useHash ? new _angular_common__WEBPACK_IMPORTED_MODULE_4__["HashLocationStrategy"](platformLocationStrategy, baseHref) :
new _angular_common__WEBPACK_IMPORTED_MODULE_4__["PathLocationStrategy"](platformLocationStrategy, baseHref);
}
function provideForRootGuard(router) {
if (router) {
throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");
}
return 'guarded';
}
/**
* @description
*
* Registers routes.
*
* ### Example
*
* ```
* @NgModule({
* imports: [RouterModule.forChild(ROUTES)],
* providers: [provideRoutes(EXTRA_ROUTES)]
* })
* class MyNgModule {}
* ```
*
*
*/
function provideRoutes(routes) {
return [
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ANALYZE_FOR_ENTRY_COMPONENTS"], multi: true, useValue: routes },
{ provide: ROUTES, multi: true, useValue: routes },
];
}
function setupRouter(ref, urlSerializer, contexts, location, injector, loader, compiler, config, opts, urlHandlingStrategy, routeReuseStrategy) {
if (opts === void 0) { opts = {}; }
var router = new Router(null, urlSerializer, contexts, location, injector, loader, compiler, flatten(config));
if (urlHandlingStrategy) {
router.urlHandlingStrategy = urlHandlingStrategy;
}
if (routeReuseStrategy) {
router.routeReuseStrategy = routeReuseStrategy;
}
if (opts.errorHandler) {
router.errorHandler = opts.errorHandler;
}
if (opts.malformedUriErrorHandler) {
router.malformedUriErrorHandler = opts.malformedUriErrorHandler;
}
if (opts.enableTracing) {
var dom_1 = Object(_angular_platform_browser__WEBPACK_IMPORTED_MODULE_5__["ɵgetDOM"])();
router.events.subscribe(function (e) {
dom_1.logGroup("Router Event: " + e.constructor.name);
dom_1.log(e.toString());
dom_1.log(e);
dom_1.logGroupEnd();
});
}
if (opts.onSameUrlNavigation) {
router.onSameUrlNavigation = opts.onSameUrlNavigation;
}
if (opts.paramsInheritanceStrategy) {
router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;
}
return router;
}
function rootRoute(router) {
return router.routerState.root;
}
/**
* To initialize the router properly we need to do in two steps:
*
* We need to start the navigation in a APP_INITIALIZER to block the bootstrap if
* a resolver or a guards executes asynchronously. Second, we need to actually run
* activation in a BOOTSTRAP_LISTENER. We utilize the afterPreactivation
* hook provided by the router to do that.
*
* The router navigation starts, reaches the point when preactivation is done, and then
* pauses. It waits for the hook to be resolved. We then resolve it only in a bootstrap listener.
*/
var RouterInitializer = /** @class */ (function () {
function RouterInitializer(injector) {
this.injector = injector;
this.initNavigation = false;
this.resultOfPreactivationDone = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
}
RouterInitializer.prototype.appInitializer = function () {
var _this = this;
var p = this.injector.get(_angular_common__WEBPACK_IMPORTED_MODULE_4__["LOCATION_INITIALIZED"], Promise.resolve(null));
return p.then(function () {
var resolve = null;
var res = new Promise(function (r) { return resolve = r; });
var router = _this.injector.get(Router);
var opts = _this.injector.get(ROUTER_CONFIGURATION);
if (_this.isLegacyDisabled(opts) || _this.isLegacyEnabled(opts)) {
resolve(true);
}
else if (opts.initialNavigation === 'disabled') {
router.setUpLocationChangeListener();
resolve(true);
}
else if (opts.initialNavigation === 'enabled') {
router.hooks.afterPreactivation = function () {
// only the initial navigation should be delayed
if (!_this.initNavigation) {
_this.initNavigation = true;
resolve(true);
return _this.resultOfPreactivationDone;
// subsequent navigations should not be delayed
}
else {
return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null);
}
};
router.initialNavigation();
}
else {
throw new Error("Invalid initialNavigation options: '" + opts.initialNavigation + "'");
}
return res;
});
};
RouterInitializer.prototype.bootstrapListener = function (bootstrappedComponentRef) {
var opts = this.injector.get(ROUTER_CONFIGURATION);
var preloader = this.injector.get(RouterPreloader);
var router = this.injector.get(Router);
var ref = this.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationRef"]);
if (bootstrappedComponentRef !== ref.components[0]) {
return;
}
if (this.isLegacyEnabled(opts)) {
router.initialNavigation();
}
else if (this.isLegacyDisabled(opts)) {
router.setUpLocationChangeListener();
}
preloader.setUpPreloading();
router.resetRootComponentType(ref.componentTypes[0]);
this.resultOfPreactivationDone.next(null);
this.resultOfPreactivationDone.complete();
};
RouterInitializer.prototype.isLegacyEnabled = function (opts) {
return opts.initialNavigation === 'legacy_enabled' || opts.initialNavigation === true ||
opts.initialNavigation === undefined;
};
RouterInitializer.prototype.isLegacyDisabled = function (opts) {
return opts.initialNavigation === 'legacy_disabled' || opts.initialNavigation === false;
};
RouterInitializer.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] }
];
/** @nocollapse */
RouterInitializer.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"] }
]; };
return RouterInitializer;
}());
function getAppInitializer(r) {
return r.appInitializer.bind(r);
}
function getBootstrapListener(r) {
return r.bootstrapListener.bind(r);
}
/**
* A token for the router initializer that will be called after the app is bootstrapped.
*
* @experimental
*/
var ROUTER_INITIALIZER = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('Router Initializer');
function provideRouterInitializer() {
return [
RouterInitializer,
{
provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_INITIALIZER"],
multi: true,
useFactory: getAppInitializer,
deps: [RouterInitializer]
},
{ provide: ROUTER_INITIALIZER, useFactory: getBootstrapListener, deps: [RouterInitializer] },
{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_BOOTSTRAP_LISTENER"], multi: true, useExisting: ROUTER_INITIALIZER },
];
}
/**
* @license
* Copyright Google Inc. 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 VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Version"]('6.0.9');
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @license
* Copyright Google Inc. 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
*/
// This file only reexports content of the `src` folder. Keep it that way.
/**
* @license
* Copyright Google Inc. 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
*/
/**
* Generated bundle index. Do not edit.
*/
//# sourceMappingURL=router.js.map
/***/ }),
/***/ "./node_modules/hammerjs/hammer.js":
/*!*****************************************!*\
!*** ./node_modules/hammerjs/hammer.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */
(function(window, document, exportName, undefined) {
'use strict';
var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
var TEST_ELEMENT = document.createElement('div');
var TYPE_FUNCTION = 'function';
var round = Math.round;
var abs = Math.abs;
var now = Date.now;
/**
* set a timeout with a given scope
* @param {Function} fn
* @param {Number} timeout
* @param {Object} context
* @returns {number}
*/
function setTimeoutContext(fn, timeout, context) {
return setTimeout(bindFn(fn, context), timeout);
}
/**
* if the argument is an array, we want to execute the fn on each entry
* if it aint an array we don't want to do a thing.
* this is used by all the methods that accept a single and array argument.
* @param {*|Array} arg
* @param {String} fn
* @param {Object} [context]
* @returns {Boolean}
*/
function invokeArrayArg(arg, fn, context) {
if (Array.isArray(arg)) {
each(arg, context[fn], context);
return true;
}
return false;
}
/**
* walk objects and arrays
* @param {Object} obj
* @param {Function} iterator
* @param {Object} context
*/
function each(obj, iterator, context) {
var i;
if (!obj) {
return;
}
if (obj.forEach) {
obj.forEach(iterator, context);
} else if (obj.length !== undefined) {
i = 0;
while (i < obj.length) {
iterator.call(context, obj[i], i, obj);
i++;
}
} else {
for (i in obj) {
obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
}
}
}
/**
* wrap a method with a deprecation warning and stack trace
* @param {Function} method
* @param {String} name
* @param {String} message
* @returns {Function} A new function wrapping the supplied method.
*/
function deprecate(method, name, message) {
var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n';
return function() {
var e = new Error('get-stack-trace');
var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '')
.replace(/^\s+at\s+/gm, '')
.replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
var log = window.console && (window.console.warn || window.console.log);
if (log) {
log.call(window.console, deprecationMessage, stack);
}
return method.apply(this, arguments);
};
}
/**
* extend object.
* means that properties in dest will be overwritten by the ones in src.
* @param {Object} target
* @param {...Object} objects_to_assign
* @returns {Object} target
*/
var assign;
if (typeof Object.assign !== 'function') {
assign = function assign(target) {
if (target === undefined || target === null) {
throw new TypeError('Cannot convert undefined or null to object');
}
var output = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source !== undefined && source !== null) {
for (var nextKey in source) {
if (source.hasOwnProperty(nextKey)) {
output[nextKey] = source[nextKey];
}
}
}
}
return output;
};
} else {
assign = Object.assign;
}
/**
* extend object.
* means that properties in dest will be overwritten by the ones in src.
* @param {Object} dest
* @param {Object} src
* @param {Boolean} [merge=false]
* @returns {Object} dest
*/
var extend = deprecate(function extend(dest, src, merge) {
var keys = Object.keys(src);
var i = 0;
while (i < keys.length) {
if (!merge || (merge && dest[keys[i]] === undefined)) {
dest[keys[i]] = src[keys[i]];
}
i++;
}
return dest;
}, 'extend', 'Use `assign`.');
/**
* merge the values from src in the dest.
* means that properties that exist in dest will not be overwritten by src
* @param {Object} dest
* @param {Object} src
* @returns {Object} dest
*/
var merge = deprecate(function merge(dest, src) {
return extend(dest, src, true);
}, 'merge', 'Use `assign`.');
/**
* simple class inheritance
* @param {Function} child
* @param {Function} base
* @param {Object} [properties]
*/
function inherit(child, base, properties) {
var baseP = base.prototype,
childP;
childP = child.prototype = Object.create(baseP);
childP.constructor = child;
childP._super = baseP;
if (properties) {
assign(childP, properties);
}
}
/**
* simple function bind
* @param {Function} fn
* @param {Object} context
* @returns {Function}
*/
function bindFn(fn, context) {
return function boundFn() {
return fn.apply(context, arguments);
};
}
/**
* let a boolean value also be a function that must return a boolean
* this first item in args will be used as the context
* @param {Boolean|Function} val
* @param {Array} [args]
* @returns {Boolean}
*/
function boolOrFn(val, args) {
if (typeof val == TYPE_FUNCTION) {
return val.apply(args ? args[0] || undefined : undefined, args);
}
return val;
}
/**
* use the val2 when val1 is undefined
* @param {*} val1
* @param {*} val2
* @returns {*}
*/
function ifUndefined(val1, val2) {
return (val1 === undefined) ? val2 : val1;
}
/**
* addEventListener with multiple events at once
* @param {EventTarget} target
* @param {String} types
* @param {Function} handler
*/
function addEventListeners(target, types, handler) {
each(splitStr(types), function(type) {
target.addEventListener(type, handler, false);
});
}
/**
* removeEventListener with multiple events at once
* @param {EventTarget} target
* @param {String} types
* @param {Function} handler
*/
function removeEventListeners(target, types, handler) {
each(splitStr(types), function(type) {
target.removeEventListener(type, handler, false);
});
}
/**
* find if a node is in the given parent
* @method hasParent
* @param {HTMLElement} node
* @param {HTMLElement} parent
* @return {Boolean} found
*/
function hasParent(node, parent) {
while (node) {
if (node == parent) {
return true;
}
node = node.parentNode;
}
return false;
}
/**
* small indexOf wrapper
* @param {String} str
* @param {String} find
* @returns {Boolean} found
*/
function inStr(str, find) {
return str.indexOf(find) > -1;
}
/**
* split string on whitespace
* @param {String} str
* @returns {Array} words
*/
function splitStr(str) {
return str.trim().split(/\s+/g);
}
/**
* find if a array contains the object using indexOf or a simple polyFill
* @param {Array} src
* @param {String} find
* @param {String} [findByKey]
* @return {Boolean|Number} false when not found, or the index
*/
function inArray(src, find, findByKey) {
if (src.indexOf && !findByKey) {
return src.indexOf(find);
} else {
var i = 0;
while (i < src.length) {
if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
return i;
}
i++;
}
return -1;
}
}
/**
* convert array-like objects to real arrays
* @param {Object} obj
* @returns {Array}
*/
function toArray(obj) {
return Array.prototype.slice.call(obj, 0);
}
/**
* unique array with objects based on a key (like 'id') or just by the array's value
* @param {Array} src [{id:1},{id:2},{id:1}]
* @param {String} [key]
* @param {Boolean} [sort=False]
* @returns {Array} [{id:1},{id:2}]
*/
function uniqueArray(src, key, sort) {
var results = [];
var values = [];
var i = 0;
while (i < src.length) {
var val = key ? src[i][key] : src[i];
if (inArray(values, val) < 0) {
results.push(src[i]);
}
values[i] = val;
i++;
}
if (sort) {
if (!key) {
results = results.sort();
} else {
results = results.sort(function sortUniqueArray(a, b) {
return a[key] > b[key];
});
}
}
return results;
}
/**
* get the prefixed property
* @param {Object} obj
* @param {String} property
* @returns {String|Undefined} prefixed
*/
function prefixed(obj, property) {
var prefix, prop;
var camelProp = property[0].toUpperCase() + property.slice(1);
var i = 0;
while (i < VENDOR_PREFIXES.length) {
prefix = VENDOR_PREFIXES[i];
prop = (prefix) ? prefix + camelProp : property;
if (prop in obj) {
return prop;
}
i++;
}
return undefined;
}
/**
* get a unique id
* @returns {number} uniqueId
*/
var _uniqueId = 1;
function uniqueId() {
return _uniqueId++;
}
/**
* get the window object of an element
* @param {HTMLElement} element
* @returns {DocumentView|Window}
*/
function getWindowForElement(element) {
var doc = element.ownerDocument || element;
return (doc.defaultView || doc.parentWindow || window);
}
var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
var SUPPORT_TOUCH = ('ontouchstart' in window);
var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
var INPUT_TYPE_TOUCH = 'touch';
var INPUT_TYPE_PEN = 'pen';
var INPUT_TYPE_MOUSE = 'mouse';
var INPUT_TYPE_KINECT = 'kinect';
var COMPUTE_INTERVAL = 25;
var INPUT_START = 1;
var INPUT_MOVE = 2;
var INPUT_END = 4;
var INPUT_CANCEL = 8;
var DIRECTION_NONE = 1;
var DIRECTION_LEFT = 2;
var DIRECTION_RIGHT = 4;
var DIRECTION_UP = 8;
var DIRECTION_DOWN = 16;
var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
var PROPS_XY = ['x', 'y'];
var PROPS_CLIENT_XY = ['clientX', 'clientY'];
/**
* create new input type manager
* @param {Manager} manager
* @param {Function} callback
* @returns {Input}
* @constructor
*/
function Input(manager, callback) {
var self = this;
this.manager = manager;
this.callback = callback;
this.element = manager.element;
this.target = manager.options.inputTarget;
// smaller wrapper around the handler, for the scope and the enabled state of the manager,
// so when disabled the input events are completely bypassed.
this.domHandler = function(ev) {
if (boolOrFn(manager.options.enable, [manager])) {
self.handler(ev);
}
};
this.init();
}
Input.prototype = {
/**
* should handle the inputEvent data and trigger the callback
* @virtual
*/
handler: function() { },
/**
* bind the events
*/
init: function() {
this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
},
/**
* unbind the events
*/
destroy: function() {
this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
}
};
/**
* create new input type manager
* called by the Manager constructor
* @param {Hammer} manager
* @returns {Input}
*/
function createInputInstance(manager) {
var Type;
var inputClass = manager.options.inputClass;
if (inputClass) {
Type = inputClass;
} else if (SUPPORT_POINTER_EVENTS) {
Type = PointerEventInput;
} else if (SUPPORT_ONLY_TOUCH) {
Type = TouchInput;
} else if (!SUPPORT_TOUCH) {
Type = MouseInput;
} else {
Type = TouchMouseInput;
}
return new (Type)(manager, inputHandler);
}
/**
* handle input events
* @param {Manager} manager
* @param {String} eventType
* @param {Object} input
*/
function inputHandler(manager, eventType, input) {
var pointersLen = input.pointers.length;
var changedPointersLen = input.changedPointers.length;
var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
input.isFirst = !!isFirst;
input.isFinal = !!isFinal;
if (isFirst) {
manager.session = {};
}
// source event is the normalized value of the domEvents
// like 'touchstart, mouseup, pointerdown'
input.eventType = eventType;
// compute scale, rotation etc
computeInputData(manager, input);
// emit secret event
manager.emit('hammer.input', input);
manager.recognize(input);
manager.session.prevInput = input;
}
/**
* extend the data with some usable properties like scale, rotate, velocity etc
* @param {Object} manager
* @param {Object} input
*/
function computeInputData(manager, input) {
var session = manager.session;
var pointers = input.pointers;
var pointersLength = pointers.length;
// store the first input to calculate the distance and direction
if (!session.firstInput) {
session.firstInput = simpleCloneInputData(input);
}
// to compute scale and rotation we need to store the multiple touches
if (pointersLength > 1 && !session.firstMultiple) {
session.firstMultiple = simpleCloneInputData(input);
} else if (pointersLength === 1) {
session.firstMultiple = false;
}
var firstInput = session.firstInput;
var firstMultiple = session.firstMultiple;
var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
var center = input.center = getCenter(pointers);
input.timeStamp = now();
input.deltaTime = input.timeStamp - firstInput.timeStamp;
input.angle = getAngle(offsetCenter, center);
input.distance = getDistance(offsetCenter, center);
computeDeltaXY(session, input);
input.offsetDirection = getDirection(input.deltaX, input.deltaY);
var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
input.overallVelocityX = overallVelocity.x;
input.overallVelocityY = overallVelocity.y;
input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;
input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >
session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);
computeIntervalInputData(session, input);
// find the correct target
var target = manager.element;
if (hasParent(input.srcEvent.target, target)) {
target = input.srcEvent.target;
}
input.target = target;
}
function computeDeltaXY(session, input) {
var center = input.center;
var offset = session.offsetDelta || {};
var prevDelta = session.prevDelta || {};
var prevInput = session.prevInput || {};
if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
prevDelta = session.prevDelta = {
x: prevInput.deltaX || 0,
y: prevInput.deltaY || 0
};
offset = session.offsetDelta = {
x: center.x,
y: center.y
};
}
input.deltaX = prevDelta.x + (center.x - offset.x);
input.deltaY = prevDelta.y + (center.y - offset.y);
}
/**
* velocity is calculated every x ms
* @param {Object} session
* @param {Object} input
*/
function computeIntervalInputData(session, input) {
var last = session.lastInterval || input,
deltaTime = input.timeStamp - last.timeStamp,
velocity, velocityX, velocityY, direction;
if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
var deltaX = input.deltaX - last.deltaX;
var deltaY = input.deltaY - last.deltaY;
var v = getVelocity(deltaTime, deltaX, deltaY);
velocityX = v.x;
velocityY = v.y;
velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
direction = getDirection(deltaX, deltaY);
session.lastInterval = input;
} else {
// use latest velocity info if it doesn't overtake a minimum period
velocity = last.velocity;
velocityX = last.velocityX;
velocityY = last.velocityY;
direction = last.direction;
}
input.velocity = velocity;
input.velocityX = velocityX;
input.velocityY = velocityY;
input.direction = direction;
}
/**
* create a simple clone from the input used for storage of firstInput and firstMultiple
* @param {Object} input
* @returns {Object} clonedInputData
*/
function simpleCloneInputData(input) {
// make a simple copy of the pointers because we will get a reference if we don't
// we only need clientXY for the calculations
var pointers = [];
var i = 0;
while (i < input.pointers.length) {
pointers[i] = {
clientX: round(input.pointers[i].clientX),
clientY: round(input.pointers[i].clientY)
};
i++;
}
return {
timeStamp: now(),
pointers: pointers,
center: getCenter(pointers),
deltaX: input.deltaX,
deltaY: input.deltaY
};
}
/**
* get the center of all the pointers
* @param {Array} pointers
* @return {Object} center contains `x` and `y` properties
*/
function getCenter(pointers) {
var pointersLength = pointers.length;
// no need to loop when only one touch
if (pointersLength === 1) {
return {
x: round(pointers[0].clientX),
y: round(pointers[0].clientY)
};
}
var x = 0, y = 0, i = 0;
while (i < pointersLength) {
x += pointers[i].clientX;
y += pointers[i].clientY;
i++;
}
return {
x: round(x / pointersLength),
y: round(y / pointersLength)
};
}
/**
* calculate the velocity between two points. unit is in px per ms.
* @param {Number} deltaTime
* @param {Number} x
* @param {Number} y
* @return {Object} velocity `x` and `y`
*/
function getVelocity(deltaTime, x, y) {
return {
x: x / deltaTime || 0,
y: y / deltaTime || 0
};
}
/**
* get the direction between two points
* @param {Number} x
* @param {Number} y
* @return {Number} direction
*/
function getDirection(x, y) {
if (x === y) {
return DIRECTION_NONE;
}
if (abs(x) >= abs(y)) {
return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
}
return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
}
/**
* calculate the absolute distance between two points
* @param {Object} p1 {x, y}
* @param {Object} p2 {x, y}
* @param {Array} [props] containing x and y keys
* @return {Number} distance
*/
function getDistance(p1, p2, props) {
if (!props) {
props = PROPS_XY;
}
var x = p2[props[0]] - p1[props[0]],
y = p2[props[1]] - p1[props[1]];
return Math.sqrt((x * x) + (y * y));
}
/**
* calculate the angle between two coordinates
* @param {Object} p1
* @param {Object} p2
* @param {Array} [props] containing x and y keys
* @return {Number} angle
*/
function getAngle(p1, p2, props) {
if (!props) {
props = PROPS_XY;
}
var x = p2[props[0]] - p1[props[0]],
y = p2[props[1]] - p1[props[1]];
return Math.atan2(y, x) * 180 / Math.PI;
}
/**
* calculate the rotation degrees between two pointersets
* @param {Array} start array of pointers
* @param {Array} end array of pointers
* @return {Number} rotation
*/
function getRotation(start, end) {
return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
}
/**
* calculate the scale factor between two pointersets
* no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
* @param {Array} start array of pointers
* @param {Array} end array of pointers
* @return {Number} scale
*/
function getScale(start, end) {
return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
}
var MOUSE_INPUT_MAP = {
mousedown: INPUT_START,
mousemove: INPUT_MOVE,
mouseup: INPUT_END
};
var MOUSE_ELEMENT_EVENTS = 'mousedown';
var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
/**
* Mouse events input
* @constructor
* @extends Input
*/
function MouseInput() {
this.evEl = MOUSE_ELEMENT_EVENTS;
this.evWin = MOUSE_WINDOW_EVENTS;
this.pressed = false; // mousedown state
Input.apply(this, arguments);
}
inherit(MouseInput, Input, {
/**
* handle mouse events
* @param {Object} ev
*/
handler: function MEhandler(ev) {
var eventType = MOUSE_INPUT_MAP[ev.type];
// on start we want to have the left mouse button down
if (eventType & INPUT_START && ev.button === 0) {
this.pressed = true;
}
if (eventType & INPUT_MOVE && ev.which !== 1) {
eventType = INPUT_END;
}
// mouse must be down
if (!this.pressed) {
return;
}
if (eventType & INPUT_END) {
this.pressed = false;
}
this.callback(this.manager, eventType, {
pointers: [ev],
changedPointers: [ev],
pointerType: INPUT_TYPE_MOUSE,
srcEvent: ev
});
}
});
var POINTER_INPUT_MAP = {
pointerdown: INPUT_START,
pointermove: INPUT_MOVE,
pointerup: INPUT_END,
pointercancel: INPUT_CANCEL,
pointerout: INPUT_CANCEL
};
// in IE10 the pointer types is defined as an enum
var IE10_POINTER_TYPE_ENUM = {
2: INPUT_TYPE_TOUCH,
3: INPUT_TYPE_PEN,
4: INPUT_TYPE_MOUSE,
5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
};
var POINTER_ELEMENT_EVENTS = 'pointerdown';
var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
// IE10 has prefixed support, and case-sensitive
if (window.MSPointerEvent && !window.PointerEvent) {
POINTER_ELEMENT_EVENTS = 'MSPointerDown';
POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
}
/**
* Pointer events input
* @constructor
* @extends Input
*/
function PointerEventInput() {
this.evEl = POINTER_ELEMENT_EVENTS;
this.evWin = POINTER_WINDOW_EVENTS;
Input.apply(this, arguments);
this.store = (this.manager.session.pointerEvents = []);
}
inherit(PointerEventInput, Input, {
/**
* handle mouse events
* @param {Object} ev
*/
handler: function PEhandler(ev) {
var store = this.store;
var removePointer = false;
var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
var isTouch = (pointerType == INPUT_TYPE_TOUCH);
// get index of the event in the store
var storeIndex = inArray(store, ev.pointerId, 'pointerId');
// start and mouse must be down
if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
if (storeIndex < 0) {
store.push(ev);
storeIndex = store.length - 1;
}
} else if (eventType & (INPUT_END | INPUT_CANCEL)) {
removePointer = true;
}
// it not found, so the pointer hasn't been down (so it's probably a hover)
if (storeIndex < 0) {
return;
}
// update the event in the store
store[storeIndex] = ev;
this.callback(this.manager, eventType, {
pointers: store,
changedPointers: [ev],
pointerType: pointerType,
srcEvent: ev
});
if (removePointer) {
// remove from the store
store.splice(storeIndex, 1);
}
}
});
var SINGLE_TOUCH_INPUT_MAP = {
touchstart: INPUT_START,
touchmove: INPUT_MOVE,
touchend: INPUT_END,
touchcancel: INPUT_CANCEL
};
var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
/**
* Touch events input
* @constructor
* @extends Input
*/
function SingleTouchInput() {
this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
this.started = false;
Input.apply(this, arguments);
}
inherit(SingleTouchInput, Input, {
handler: function TEhandler(ev) {
var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
// should we handle the touch events?
if (type === INPUT_START) {
this.started = true;
}
if (!this.started) {
return;
}
var touches = normalizeSingleTouches.call(this, ev, type);
// when done, reset the started state
if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
this.started = false;
}
this.callback(this.manager, type, {
pointers: touches[0],
changedPointers: touches[1],
pointerType: INPUT_TYPE_TOUCH,
srcEvent: ev
});
}
});
/**
* @this {TouchInput}
* @param {Object} ev
* @param {Number} type flag
* @returns {undefined|Array} [all, changed]
*/
function normalizeSingleTouches(ev, type) {
var all = toArray(ev.touches);
var changed = toArray(ev.changedTouches);
if (type & (INPUT_END | INPUT_CANCEL)) {
all = uniqueArray(all.concat(changed), 'identifier', true);
}
return [all, changed];
}
var TOUCH_INPUT_MAP = {
touchstart: INPUT_START,
touchmove: INPUT_MOVE,
touchend: INPUT_END,
touchcancel: INPUT_CANCEL
};
var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
/**
* Multi-user touch events input
* @constructor
* @extends Input
*/
function TouchInput() {
this.evTarget = TOUCH_TARGET_EVENTS;
this.targetIds = {};
Input.apply(this, arguments);
}
inherit(TouchInput, Input, {
handler: function MTEhandler(ev) {
var type = TOUCH_INPUT_MAP[ev.type];
var touches = getTouches.call(this, ev, type);
if (!touches) {
return;
}
this.callback(this.manager, type, {
pointers: touches[0],
changedPointers: touches[1],
pointerType: INPUT_TYPE_TOUCH,
srcEvent: ev
});
}
});
/**
* @this {TouchInput}
* @param {Object} ev
* @param {Number} type flag
* @returns {undefined|Array} [all, changed]
*/
function getTouches(ev, type) {
var allTouches = toArray(ev.touches);
var targetIds = this.targetIds;
// when there is only one touch, the process can be simplified
if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
targetIds[allTouches[0].identifier] = true;
return [allTouches, allTouches];
}
var i,
targetTouches,
changedTouches = toArray(ev.changedTouches),
changedTargetTouches = [],
target = this.target;
// get target touches from touches
targetTouches = allTouches.filter(function(touch) {
return hasParent(touch.target, target);
});
// collect touches
if (type === INPUT_START) {
i = 0;
while (i < targetTouches.length) {
targetIds[targetTouches[i].identifier] = true;
i++;
}
}
// filter changed touches to only contain touches that exist in the collected target ids
i = 0;
while (i < changedTouches.length) {
if (targetIds[changedTouches[i].identifier]) {
changedTargetTouches.push(changedTouches[i]);
}
// cleanup removed touches
if (type & (INPUT_END | INPUT_CANCEL)) {
delete targetIds[changedTouches[i].identifier];
}
i++;
}
if (!changedTargetTouches.length) {
return;
}
return [
// merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
changedTargetTouches
];
}
/**
* Combined touch and mouse input
*
* Touch has a higher priority then mouse, and while touching no mouse events are allowed.
* This because touch devices also emit mouse events while doing a touch.
*
* @constructor
* @extends Input
*/
var DEDUP_TIMEOUT = 2500;
var DEDUP_DISTANCE = 25;
function TouchMouseInput() {
Input.apply(this, arguments);
var handler = bindFn(this.handler, this);
this.touch = new TouchInput(this.manager, handler);
this.mouse = new MouseInput(this.manager, handler);
this.primaryTouch = null;
this.lastTouches = [];
}
inherit(TouchMouseInput, Input, {
/**
* handle mouse and touch events
* @param {Hammer} manager
* @param {String} inputEvent
* @param {Object} inputData
*/
handler: function TMEhandler(manager, inputEvent, inputData) {
var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
return;
}
// when we're in a touch event, record touches to de-dupe synthetic mouse event
if (isTouch) {
recordTouches.call(this, inputEvent, inputData);
} else if (isMouse && isSyntheticEvent.call(this, inputData)) {
return;
}
this.callback(manager, inputEvent, inputData);
},
/**
* remove the event listeners
*/
destroy: function destroy() {
this.touch.destroy();
this.mouse.destroy();
}
});
function recordTouches(eventType, eventData) {
if (eventType & INPUT_START) {
this.primaryTouch = eventData.changedPointers[0].identifier;
setLastTouch.call(this, eventData);
} else if (eventType & (INPUT_END | INPUT_CANCEL)) {
setLastTouch.call(this, eventData);
}
}
function setLastTouch(eventData) {
var touch = eventData.changedPointers[0];
if (touch.identifier === this.primaryTouch) {
var lastTouch = {x: touch.clientX, y: touch.clientY};
this.lastTouches.push(lastTouch);
var lts = this.lastTouches;
var removeLastTouch = function() {
var i = lts.indexOf(lastTouch);
if (i > -1) {
lts.splice(i, 1);
}
};
setTimeout(removeLastTouch, DEDUP_TIMEOUT);
}
}
function isSyntheticEvent(eventData) {
var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;
for (var i = 0; i < this.lastTouches.length; i++) {
var t = this.lastTouches[i];
var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);
if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
return true;
}
}
return false;
}
var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
// magical touchAction value
var TOUCH_ACTION_COMPUTE = 'compute';
var TOUCH_ACTION_AUTO = 'auto';
var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
var TOUCH_ACTION_NONE = 'none';
var TOUCH_ACTION_PAN_X = 'pan-x';
var TOUCH_ACTION_PAN_Y = 'pan-y';
var TOUCH_ACTION_MAP = getTouchActionProps();
/**
* Touch Action
* sets the touchAction property or uses the js alternative
* @param {Manager} manager
* @param {String} value
* @constructor
*/
function TouchAction(manager, value) {
this.manager = manager;
this.set(value);
}
TouchAction.prototype = {
/**
* set the touchAction value on the element or enable the polyfill
* @param {String} value
*/
set: function(value) {
// find out the touch-action by the event handlers
if (value == TOUCH_ACTION_COMPUTE) {
value = this.compute();
}
if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
}
this.actions = value.toLowerCase().trim();
},
/**
* just re-set the touchAction value
*/
update: function() {
this.set(this.manager.options.touchAction);
},
/**
* compute the value for the touchAction property based on the recognizer's settings
* @returns {String} value
*/
compute: function() {
var actions = [];
each(this.manager.recognizers, function(recognizer) {
if (boolOrFn(recognizer.options.enable, [recognizer])) {
actions = actions.concat(recognizer.getTouchAction());
}
});
return cleanTouchActions(actions.join(' '));
},
/**
* this method is called on each input cycle and provides the preventing of the browser behavior
* @param {Object} input
*/
preventDefaults: function(input) {
var srcEvent = input.srcEvent;
var direction = input.offsetDirection;
// if the touch action did prevented once this session
if (this.manager.session.prevented) {
srcEvent.preventDefault();
return;
}
var actions = this.actions;
var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
if (hasNone) {
//do not prevent defaults if this is a tap gesture
var isTapPointer = input.pointers.length === 1;
var isTapMovement = input.distance < 2;
var isTapTouchTime = input.deltaTime < 250;
if (isTapPointer && isTapMovement && isTapTouchTime) {
return;
}
}
if (hasPanX && hasPanY) {
// `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
return;
}
if (hasNone ||
(hasPanY && direction & DIRECTION_HORIZONTAL) ||
(hasPanX && direction & DIRECTION_VERTICAL)) {
return this.preventSrc(srcEvent);
}
},
/**
* call preventDefault to prevent the browser's default behavior (scrolling in most cases)
* @param {Object} srcEvent
*/
preventSrc: function(srcEvent) {
this.manager.session.prevented = true;
srcEvent.preventDefault();
}
};
/**
* when the touchActions are collected they are not a valid value, so we need to clean things up. *
* @param {String} actions
* @returns {*}
*/
function cleanTouchActions(actions) {
// none
if (inStr(actions, TOUCH_ACTION_NONE)) {
return TOUCH_ACTION_NONE;
}
var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
// if both pan-x and pan-y are set (different recognizers
// for different directions, e.g. horizontal pan but vertical swipe?)
// we need none (as otherwise with pan-x pan-y combined none of these
// recognizers will work, since the browser would handle all panning
if (hasPanX && hasPanY) {
return TOUCH_ACTION_NONE;
}
// pan-x OR pan-y
if (hasPanX || hasPanY) {
return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
}
// manipulation
if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
return TOUCH_ACTION_MANIPULATION;
}
return TOUCH_ACTION_AUTO;
}
function getTouchActionProps() {
if (!NATIVE_TOUCH_ACTION) {
return false;
}
var touchMap = {};
var cssSupports = window.CSS && window.CSS.supports;
['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {
// If css.supports is not supported but there is native touch-action assume it supports
// all values. This is the case for IE 10 and 11.
touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;
});
return touchMap;
}
/**
* Recognizer flow explained; *
* All recognizers have the initial state of POSSIBLE when a input session starts.
* The definition of a input session is from the first input until the last input, with all it's movement in it. *
* Example session for mouse-input: mousedown -> mousemove -> mouseup
*
* On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
* which determines with state it should be.
*
* If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
* POSSIBLE to give it another change on the next cycle.
*
* Possible
* |
* +-----+---------------+
* | |
* +-----+-----+ |
* | | |
* Failed Cancelled |
* +-------+------+
* | |
* Recognized Began
* |
* Changed
* |
* Ended/Recognized
*/
var STATE_POSSIBLE = 1;
var STATE_BEGAN = 2;
var STATE_CHANGED = 4;
var STATE_ENDED = 8;
var STATE_RECOGNIZED = STATE_ENDED;
var STATE_CANCELLED = 16;
var STATE_FAILED = 32;
/**
* Recognizer
* Every recognizer needs to extend from this class.
* @constructor
* @param {Object} options
*/
function Recognizer(options) {
this.options = assign({}, this.defaults, options || {});
this.id = uniqueId();
this.manager = null;
// default is enable true
this.options.enable = ifUndefined(this.options.enable, true);
this.state = STATE_POSSIBLE;
this.simultaneous = {};
this.requireFail = [];
}
Recognizer.prototype = {
/**
* @virtual
* @type {Object}
*/
defaults: {},
/**
* set options
* @param {Object} options
* @return {Recognizer}
*/
set: function(options) {
assign(this.options, options);
// also update the touchAction, in case something changed about the directions/enabled state
this.manager && this.manager.touchAction.update();
return this;
},
/**
* recognize simultaneous with an other recognizer.
* @param {Recognizer} otherRecognizer
* @returns {Recognizer} this
*/
recognizeWith: function(otherRecognizer) {
if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
return this;
}
var simultaneous = this.simultaneous;
otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
if (!simultaneous[otherRecognizer.id]) {
simultaneous[otherRecognizer.id] = otherRecognizer;
otherRecognizer.recognizeWith(this);
}
return this;
},
/**
* drop the simultaneous link. it doesnt remove the link on the other recognizer.
* @param {Recognizer} otherRecognizer
* @returns {Recognizer} this
*/
dropRecognizeWith: function(otherRecognizer) {
if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
return this;
}
otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
delete this.simultaneous[otherRecognizer.id];
return this;
},
/**
* recognizer can only run when an other is failing
* @param {Recognizer} otherRecognizer
* @returns {Recognizer} this
*/
requireFailure: function(otherRecognizer) {
if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
return this;
}
var requireFail = this.requireFail;
otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
if (inArray(requireFail, otherRecognizer) === -1) {
requireFail.push(otherRecognizer);
otherRecognizer.requireFailure(this);
}
return this;
},
/**
* drop the requireFailure link. it does not remove the link on the other recognizer.
* @param {Recognizer} otherRecognizer
* @returns {Recognizer} this
*/
dropRequireFailure: function(otherRecognizer) {
if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
return this;
}
otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
var index = inArray(this.requireFail, otherRecognizer);
if (index > -1) {
this.requireFail.splice(index, 1);
}
return this;
},
/**
* has require failures boolean
* @returns {boolean}
*/
hasRequireFailures: function() {
return this.requireFail.length > 0;
},
/**
* if the recognizer can recognize simultaneous with an other recognizer
* @param {Recognizer} otherRecognizer
* @returns {Boolean}
*/
canRecognizeWith: function(otherRecognizer) {
return !!this.simultaneous[otherRecognizer.id];
},
/**
* You should use `tryEmit` instead of `emit` directly to check
* that all the needed recognizers has failed before emitting.
* @param {Object} input
*/
emit: function(input) {
var self = this;
var state = this.state;
function emit(event) {
self.manager.emit(event, input);
}
// 'panstart' and 'panmove'
if (state < STATE_ENDED) {
emit(self.options.event + stateStr(state));
}
emit(self.options.event); // simple 'eventName' events
if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)
emit(input.additionalEvent);
}
// panend and pancancel
if (state >= STATE_ENDED) {
emit(self.options.event + stateStr(state));
}
},
/**
* Check that all the require failure recognizers has failed,
* if true, it emits a gesture event,
* otherwise, setup the state to FAILED.
* @param {Object} input
*/
tryEmit: function(input) {
if (this.canEmit()) {
return this.emit(input);
}
// it's failing anyway
this.state = STATE_FAILED;
},
/**
* can we emit?
* @returns {boolean}
*/
canEmit: function() {
var i = 0;
while (i < this.requireFail.length) {
if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
return false;
}
i++;
}
return true;
},
/**
* update the recognizer
* @param {Object} inputData
*/
recognize: function(inputData) {
// make a new copy of the inputData
// so we can change the inputData without messing up the other recognizers
var inputDataClone = assign({}, inputData);
// is is enabled and allow recognizing?
if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
this.reset();
this.state = STATE_FAILED;
return;
}
// reset when we've reached the end
if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
this.state = STATE_POSSIBLE;
}
this.state = this.process(inputDataClone);
// the recognizer has recognized a gesture
// so trigger an event
if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
this.tryEmit(inputDataClone);
}
},
/**
* return the state of the recognizer
* the actual recognizing happens in this method
* @virtual
* @param {Object} inputData
* @returns {Const} STATE
*/
process: function(inputData) { }, // jshint ignore:line
/**
* return the preferred touch-action
* @virtual
* @returns {Array}
*/
getTouchAction: function() { },
/**
* called when the gesture isn't allowed to recognize
* like when another is being recognized or it is disabled
* @virtual
*/
reset: function() { }
};
/**
* get a usable string, used as event postfix
* @param {Const} state
* @returns {String} state
*/
function stateStr(state) {
if (state & STATE_CANCELLED) {
return 'cancel';
} else if (state & STATE_ENDED) {
return 'end';
} else if (state & STATE_CHANGED) {
return 'move';
} else if (state & STATE_BEGAN) {
return 'start';
}
return '';
}
/**
* direction cons to string
* @param {Const} direction
* @returns {String}
*/
function directionStr(direction) {
if (direction == DIRECTION_DOWN) {
return 'down';
} else if (direction == DIRECTION_UP) {
return 'up';
} else if (direction == DIRECTION_LEFT) {
return 'left';
} else if (direction == DIRECTION_RIGHT) {
return 'right';
}
return '';
}
/**
* get a recognizer by name if it is bound to a manager
* @param {Recognizer|String} otherRecognizer
* @param {Recognizer} recognizer
* @returns {Recognizer}
*/
function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
var manager = recognizer.manager;
if (manager) {
return manager.get(otherRecognizer);
}
return otherRecognizer;
}
/**
* This recognizer is just used as a base for the simple attribute recognizers.
* @constructor
* @extends Recognizer
*/
function AttrRecognizer() {
Recognizer.apply(this, arguments);
}
inherit(AttrRecognizer, Recognizer, {
/**
* @namespace
* @memberof AttrRecognizer
*/
defaults: {
/**
* @type {Number}
* @default 1
*/
pointers: 1
},
/**
* Used to check if it the recognizer receives valid input, like input.distance > 10.
* @memberof AttrRecognizer
* @param {Object} input
* @returns {Boolean} recognized
*/
attrTest: function(input) {
var optionPointers = this.options.pointers;
return optionPointers === 0 || input.pointers.length === optionPointers;
},
/**
* Process the input and return the state for the recognizer
* @memberof AttrRecognizer
* @param {Object} input
* @returns {*} State
*/
process: function(input) {
var state = this.state;
var eventType = input.eventType;
var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
var isValid = this.attrTest(input);
// on cancel input and we've recognized before, return STATE_CANCELLED
if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
return state | STATE_CANCELLED;
} else if (isRecognized || isValid) {
if (eventType & INPUT_END) {
return state | STATE_ENDED;
} else if (!(state & STATE_BEGAN)) {
return STATE_BEGAN;
}
return state | STATE_CHANGED;
}
return STATE_FAILED;
}
});
/**
* Pan
* Recognized when the pointer is down and moved in the allowed direction.
* @constructor
* @extends AttrRecognizer
*/
function PanRecognizer() {
AttrRecognizer.apply(this, arguments);
this.pX = null;
this.pY = null;
}
inherit(PanRecognizer, AttrRecognizer, {
/**
* @namespace
* @memberof PanRecognizer
*/
defaults: {
event: 'pan',
threshold: 10,
pointers: 1,
direction: DIRECTION_ALL
},
getTouchAction: function() {
var direction = this.options.direction;
var actions = [];
if (direction & DIRECTION_HORIZONTAL) {
actions.push(TOUCH_ACTION_PAN_Y);
}
if (direction & DIRECTION_VERTICAL) {
actions.push(TOUCH_ACTION_PAN_X);
}
return actions;
},
directionTest: function(input) {
var options = this.options;
var hasMoved = true;
var distance = input.distance;
var direction = input.direction;
var x = input.deltaX;
var y = input.deltaY;
// lock to axis?
if (!(direction & options.direction)) {
if (options.direction & DIRECTION_HORIZONTAL) {
direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
hasMoved = x != this.pX;
distance = Math.abs(input.deltaX);
} else {
direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
hasMoved = y != this.pY;
distance = Math.abs(input.deltaY);
}
}
input.direction = direction;
return hasMoved && distance > options.threshold && direction & options.direction;
},
attrTest: function(input) {
return AttrRecognizer.prototype.attrTest.call(this, input) &&
(this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
},
emit: function(input) {
this.pX = input.deltaX;
this.pY = input.deltaY;
var direction = directionStr(input.direction);
if (direction) {
input.additionalEvent = this.options.event + direction;
}
this._super.emit.call(this, input);
}
});
/**
* Pinch
* Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
* @constructor
* @extends AttrRecognizer
*/
function PinchRecognizer() {
AttrRecognizer.apply(this, arguments);
}
inherit(PinchRecognizer, AttrRecognizer, {
/**
* @namespace
* @memberof PinchRecognizer
*/
defaults: {
event: 'pinch',
threshold: 0,
pointers: 2
},
getTouchAction: function() {
return [TOUCH_ACTION_NONE];
},
attrTest: function(input) {
return this._super.attrTest.call(this, input) &&
(Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
},
emit: function(input) {
if (input.scale !== 1) {
var inOut = input.scale < 1 ? 'in' : 'out';
input.additionalEvent = this.options.event + inOut;
}
this._super.emit.call(this, input);
}
});
/**
* Press
* Recognized when the pointer is down for x ms without any movement.
* @constructor
* @extends Recognizer
*/
function PressRecognizer() {
Recognizer.apply(this, arguments);
this._timer = null;
this._input = null;
}
inherit(PressRecognizer, Recognizer, {
/**
* @namespace
* @memberof PressRecognizer
*/
defaults: {
event: 'press',
pointers: 1,
time: 251, // minimal time of the pointer to be pressed
threshold: 9 // a minimal movement is ok, but keep it low
},
getTouchAction: function() {
return [TOUCH_ACTION_AUTO];
},
process: function(input) {
var options = this.options;
var validPointers = input.pointers.length === options.pointers;
var validMovement = input.distance < options.threshold;
var validTime = input.deltaTime > options.time;
this._input = input;
// we only allow little movement
// and we've reached an end event, so a tap is possible
if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
this.reset();
} else if (input.eventType & INPUT_START) {
this.reset();
this._timer = setTimeoutContext(function() {
this.state = STATE_RECOGNIZED;
this.tryEmit();
}, options.time, this);
} else if (input.eventType & INPUT_END) {
return STATE_RECOGNIZED;
}
return STATE_FAILED;
},
reset: function() {
clearTimeout(this._timer);
},
emit: function(input) {
if (this.state !== STATE_RECOGNIZED) {
return;
}
if (input && (input.eventType & INPUT_END)) {
this.manager.emit(this.options.event + 'up', input);
} else {
this._input.timeStamp = now();
this.manager.emit(this.options.event, this._input);
}
}
});
/**
* Rotate
* Recognized when two or more pointer are moving in a circular motion.
* @constructor
* @extends AttrRecognizer
*/
function RotateRecognizer() {
AttrRecognizer.apply(this, arguments);
}
inherit(RotateRecognizer, AttrRecognizer, {
/**
* @namespace
* @memberof RotateRecognizer
*/
defaults: {
event: 'rotate',
threshold: 0,
pointers: 2
},
getTouchAction: function() {
return [TOUCH_ACTION_NONE];
},
attrTest: function(input) {
return this._super.attrTest.call(this, input) &&
(Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
}
});
/**
* Swipe
* Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
* @constructor
* @extends AttrRecognizer
*/
function SwipeRecognizer() {
AttrRecognizer.apply(this, arguments);
}
inherit(SwipeRecognizer, AttrRecognizer, {
/**
* @namespace
* @memberof SwipeRecognizer
*/
defaults: {
event: 'swipe',
threshold: 10,
velocity: 0.3,
direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
pointers: 1
},
getTouchAction: function() {
return PanRecognizer.prototype.getTouchAction.call(this);
},
attrTest: function(input) {
var direction = this.options.direction;
var velocity;
if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
velocity = input.overallVelocity;
} else if (direction & DIRECTION_HORIZONTAL) {
velocity = input.overallVelocityX;
} else if (direction & DIRECTION_VERTICAL) {
velocity = input.overallVelocityY;
}
return this._super.attrTest.call(this, input) &&
direction & input.offsetDirection &&
input.distance > this.options.threshold &&
input.maxPointers == this.options.pointers &&
abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
},
emit: function(input) {
var direction = directionStr(input.offsetDirection);
if (direction) {
this.manager.emit(this.options.event + direction, input);
}
this.manager.emit(this.options.event, input);
}
});
/**
* A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
* between the given interval and position. The delay option can be used to recognize multi-taps without firing
* a single tap.
*
* The eventData from the emitted event contains the property `tapCount`, which contains the amount of
* multi-taps being recognized.
* @constructor
* @extends Recognizer
*/
function TapRecognizer() {
Recognizer.apply(this, arguments);
// previous time and center,
// used for tap counting
this.pTime = false;
this.pCenter = false;
this._timer = null;
this._input = null;
this.count = 0;
}
inherit(TapRecognizer, Recognizer, {
/**
* @namespace
* @memberof PinchRecognizer
*/
defaults: {
event: 'tap',
pointers: 1,
taps: 1,
interval: 300, // max time between the multi-tap taps
time: 250, // max time of the pointer to be down (like finger on the screen)
threshold: 9, // a minimal movement is ok, but keep it low
posThreshold: 10 // a multi-tap can be a bit off the initial position
},
getTouchAction: function() {
return [TOUCH_ACTION_MANIPULATION];
},
process: function(input) {
var options = this.options;
var validPointers = input.pointers.length === options.pointers;
var validMovement = input.distance < options.threshold;
var validTouchTime = input.deltaTime < options.time;
this.reset();
if ((input.eventType & INPUT_START) && (this.count === 0)) {
return this.failTimeout();
}
// we only allow little movement
// and we've reached an end event, so a tap is possible
if (validMovement && validTouchTime && validPointers) {
if (input.eventType != INPUT_END) {
return this.failTimeout();
}
var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
this.pTime = input.timeStamp;
this.pCenter = input.center;
if (!validMultiTap || !validInterval) {
this.count = 1;
} else {
this.count += 1;
}
this._input = input;
// if tap count matches we have recognized it,
// else it has began recognizing...
var tapCount = this.count % options.taps;
if (tapCount === 0) {
// no failing requirements, immediately trigger the tap event
// or wait as long as the multitap interval to trigger
if (!this.hasRequireFailures()) {
return STATE_RECOGNIZED;
} else {
this._timer = setTimeoutContext(function() {
this.state = STATE_RECOGNIZED;
this.tryEmit();
}, options.interval, this);
return STATE_BEGAN;
}
}
}
return STATE_FAILED;
},
failTimeout: function() {
this._timer = setTimeoutContext(function() {
this.state = STATE_FAILED;
}, this.options.interval, this);
return STATE_FAILED;
},
reset: function() {
clearTimeout(this._timer);
},
emit: function() {
if (this.state == STATE_RECOGNIZED) {
this._input.tapCount = this.count;
this.manager.emit(this.options.event, this._input);
}
}
});
/**
* Simple way to create a manager with a default set of recognizers.
* @param {HTMLElement} element
* @param {Object} [options]
* @constructor
*/
function Hammer(element, options) {
options = options || {};
options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
return new Manager(element, options);
}
/**
* @const {string}
*/
Hammer.VERSION = '2.0.7';
/**
* default settings
* @namespace
*/
Hammer.defaults = {
/**
* set if DOM events are being triggered.
* But this is slower and unused by simple implementations, so disabled by default.
* @type {Boolean}
* @default false
*/
domEvents: false,
/**
* The value for the touchAction property/fallback.
* When set to `compute` it will magically set the correct value based on the added recognizers.
* @type {String}
* @default compute
*/
touchAction: TOUCH_ACTION_COMPUTE,
/**
* @type {Boolean}
* @default true
*/
enable: true,
/**
* EXPERIMENTAL FEATURE -- can be removed/changed
* Change the parent input target element.
* If Null, then it is being set the to main element.
* @type {Null|EventTarget}
* @default null
*/
inputTarget: null,
/**
* force an input class
* @type {Null|Function}
* @default null
*/
inputClass: null,
/**
* Default recognizer setup when calling `Hammer()`
* When creating a new Manager these will be skipped.
* @type {Array}
*/
preset: [
// RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
[RotateRecognizer, {enable: false}],
[PinchRecognizer, {enable: false}, ['rotate']],
[SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],
[PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],
[TapRecognizer],
[TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],
[PressRecognizer]
],
/**
* Some CSS properties can be used to improve the working of Hammer.
* Add them to this method and they will be set when creating a new Manager.
* @namespace
*/
cssProps: {
/**
* Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
* @type {String}
* @default 'none'
*/
userSelect: 'none',
/**
* Disable the Windows Phone grippers when pressing an element.
* @type {String}
* @default 'none'
*/
touchSelect: 'none',
/**
* Disables the default callout shown when you touch and hold a touch target.
* On iOS, when you touch and hold a touch target such as a link, Safari displays
* a callout containing information about the link. This property allows you to disable that callout.
* @type {String}
* @default 'none'
*/
touchCallout: 'none',
/**
* Specifies whether zooming is enabled. Used by IE10>
* @type {String}
* @default 'none'
*/
contentZooming: 'none',
/**
* Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
* @type {String}
* @default 'none'
*/
userDrag: 'none',
/**
* Overrides the highlight color shown when the user taps a link or a JavaScript
* clickable element in iOS. This property obeys the alpha value, if specified.
* @type {String}
* @default 'rgba(0,0,0,0)'
*/
tapHighlightColor: 'rgba(0,0,0,0)'
}
};
var STOP = 1;
var FORCED_STOP = 2;
/**
* Manager
* @param {HTMLElement} element
* @param {Object} [options]
* @constructor
*/
function Manager(element, options) {
this.options = assign({}, Hammer.defaults, options || {});
this.options.inputTarget = this.options.inputTarget || element;
this.handlers = {};
this.session = {};
this.recognizers = [];
this.oldCssProps = {};
this.element = element;
this.input = createInputInstance(this);
this.touchAction = new TouchAction(this, this.options.touchAction);
toggleCssProps(this, true);
each(this.options.recognizers, function(item) {
var recognizer = this.add(new (item[0])(item[1]));
item[2] && recognizer.recognizeWith(item[2]);
item[3] && recognizer.requireFailure(item[3]);
}, this);
}
Manager.prototype = {
/**
* set options
* @param {Object} options
* @returns {Manager}
*/
set: function(options) {
assign(this.options, options);
// Options that need a little more setup
if (options.touchAction) {
this.touchAction.update();
}
if (options.inputTarget) {
// Clean up existing event listeners and reinitialize
this.input.destroy();
this.input.target = options.inputTarget;
this.input.init();
}
return this;
},
/**
* stop recognizing for this session.
* This session will be discarded, when a new [input]start event is fired.
* When forced, the recognizer cycle is stopped immediately.
* @param {Boolean} [force]
*/
stop: function(force) {
this.session.stopped = force ? FORCED_STOP : STOP;
},
/**
* run the recognizers!
* called by the inputHandler function on every movement of the pointers (touches)
* it walks through all the recognizers and tries to detect the gesture that is being made
* @param {Object} inputData
*/
recognize: function(inputData) {
var session = this.session;
if (session.stopped) {
return;
}
// run the touch-action polyfill
this.touchAction.preventDefaults(inputData);
var recognizer;
var recognizers = this.recognizers;
// this holds the recognizer that is being recognized.
// so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
// if no recognizer is detecting a thing, it is set to `null`
var curRecognizer = session.curRecognizer;
// reset when the last recognizer is recognized
// or when we're in a new session
if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
curRecognizer = session.curRecognizer = null;
}
var i = 0;
while (i < recognizers.length) {
recognizer = recognizers[i];
// find out if we are allowed try to recognize the input for this one.
// 1. allow if the session is NOT forced stopped (see the .stop() method)
// 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
// that is being recognized.
// 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
// this can be setup with the `recognizeWith()` method on the recognizer.
if (session.stopped !== FORCED_STOP && ( // 1
!curRecognizer || recognizer == curRecognizer || // 2
recognizer.canRecognizeWith(curRecognizer))) { // 3
recognizer.recognize(inputData);
} else {
recognizer.reset();
}
// if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
// current active recognizer. but only if we don't already have an active recognizer
if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
curRecognizer = session.curRecognizer = recognizer;
}
i++;
}
},
/**
* get a recognizer by its event name.
* @param {Recognizer|String} recognizer
* @returns {Recognizer|Null}
*/
get: function(recognizer) {
if (recognizer instanceof Recognizer) {
return recognizer;
}
var recognizers = this.recognizers;
for (var i = 0; i < recognizers.length; i++) {
if (recognizers[i].options.event == recognizer) {
return recognizers[i];
}
}
return null;
},
/**
* add a recognizer to the manager
* existing recognizers with the same event name will be removed
* @param {Recognizer} recognizer
* @returns {Recognizer|Manager}
*/
add: function(recognizer) {
if (invokeArrayArg(recognizer, 'add', this)) {
return this;
}
// remove existing
var existing = this.get(recognizer.options.event);
if (existing) {
this.remove(existing);
}
this.recognizers.push(recognizer);
recognizer.manager = this;
this.touchAction.update();
return recognizer;
},
/**
* remove a recognizer by name or instance
* @param {Recognizer|String} recognizer
* @returns {Manager}
*/
remove: function(recognizer) {
if (invokeArrayArg(recognizer, 'remove', this)) {
return this;
}
recognizer = this.get(recognizer);
// let's make sure this recognizer exists
if (recognizer) {
var recognizers = this.recognizers;
var index = inArray(recognizers, recognizer);
if (index !== -1) {
recognizers.splice(index, 1);
this.touchAction.update();
}
}
return this;
},
/**
* bind event
* @param {String} events
* @param {Function} handler
* @returns {EventEmitter} this
*/
on: function(events, handler) {
if (events === undefined) {
return;
}
if (handler === undefined) {
return;
}
var handlers = this.handlers;
each(splitStr(events), function(event) {
handlers[event] = handlers[event] || [];
handlers[event].push(handler);
});
return this;
},
/**
* unbind event, leave emit blank to remove all handlers
* @param {String} events
* @param {Function} [handler]
* @returns {EventEmitter} this
*/
off: function(events, handler) {
if (events === undefined) {
return;
}
var handlers = this.handlers;
each(splitStr(events), function(event) {
if (!handler) {
delete handlers[event];
} else {
handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
}
});
return this;
},
/**
* emit event to the listeners
* @param {String} event
* @param {Object} data
*/
emit: function(event, data) {
// we also want to trigger dom events
if (this.options.domEvents) {
triggerDomEvent(event, data);
}
// no handlers, so skip it all
var handlers = this.handlers[event] && this.handlers[event].slice();
if (!handlers || !handlers.length) {
return;
}
data.type = event;
data.preventDefault = function() {
data.srcEvent.preventDefault();
};
var i = 0;
while (i < handlers.length) {
handlers[i](data);
i++;
}
},
/**
* destroy the manager and unbinds all events
* it doesn't unbind dom events, that is the user own responsibility
*/
destroy: function() {
this.element && toggleCssProps(this, false);
this.handlers = {};
this.session = {};
this.input.destroy();
this.element = null;
}
};
/**
* add/remove the css properties as defined in manager.options.cssProps
* @param {Manager} manager
* @param {Boolean} add
*/
function toggleCssProps(manager, add) {
var element = manager.element;
if (!element.style) {
return;
}
var prop;
each(manager.options.cssProps, function(value, name) {
prop = prefixed(element.style, name);
if (add) {
manager.oldCssProps[prop] = element.style[prop];
element.style[prop] = value;
} else {
element.style[prop] = manager.oldCssProps[prop] || '';
}
});
if (!add) {
manager.oldCssProps = {};
}
}
/**
* trigger dom event
* @param {String} event
* @param {Object} data
*/
function triggerDomEvent(event, data) {
var gestureEvent = document.createEvent('Event');
gestureEvent.initEvent(event, true, true);
gestureEvent.gesture = data;
data.target.dispatchEvent(gestureEvent);
}
assign(Hammer, {
INPUT_START: INPUT_START,
INPUT_MOVE: INPUT_MOVE,
INPUT_END: INPUT_END,
INPUT_CANCEL: INPUT_CANCEL,
STATE_POSSIBLE: STATE_POSSIBLE,
STATE_BEGAN: STATE_BEGAN,
STATE_CHANGED: STATE_CHANGED,
STATE_ENDED: STATE_ENDED,
STATE_RECOGNIZED: STATE_RECOGNIZED,
STATE_CANCELLED: STATE_CANCELLED,
STATE_FAILED: STATE_FAILED,
DIRECTION_NONE: DIRECTION_NONE,
DIRECTION_LEFT: DIRECTION_LEFT,
DIRECTION_RIGHT: DIRECTION_RIGHT,
DIRECTION_UP: DIRECTION_UP,
DIRECTION_DOWN: DIRECTION_DOWN,
DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
DIRECTION_VERTICAL: DIRECTION_VERTICAL,
DIRECTION_ALL: DIRECTION_ALL,
Manager: Manager,
Input: Input,
TouchAction: TouchAction,
TouchInput: TouchInput,
MouseInput: MouseInput,
PointerEventInput: PointerEventInput,
TouchMouseInput: TouchMouseInput,
SingleTouchInput: SingleTouchInput,
Recognizer: Recognizer,
AttrRecognizer: AttrRecognizer,
Tap: TapRecognizer,
Pan: PanRecognizer,
Swipe: SwipeRecognizer,
Pinch: PinchRecognizer,
Rotate: RotateRecognizer,
Press: PressRecognizer,
on: addEventListeners,
off: removeEventListeners,
each: each,
merge: merge,
extend: extend,
assign: assign,
inherit: inherit,
bindFn: bindFn,
prefixed: prefixed
});
// this prevents errors when Hammer is loaded in the presence of an AMD
// style loader but by script tag, not by the loader.
var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line
freeGlobal.Hammer = Hammer;
if (true) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
return Hammer;
}).call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
})(window, document, 'Hammer');
/***/ }),
/***/ "./node_modules/ngx-perfect-scrollbar/dist/ngx-perfect-scrollbar.es5.js":
/*!******************************************************************************!*\
!*** ./node_modules/ngx-perfect-scrollbar/dist/ngx-perfect-scrollbar.es5.js ***!
\******************************************************************************/
/*! exports provided: PerfectScrollbarComponent, PerfectScrollbarDirective, Geometry, Position, PERFECT_SCROLLBAR_CONFIG, PerfectScrollbarConfig, PerfectScrollbarModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PerfectScrollbarComponent", function() { return PerfectScrollbarComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PerfectScrollbarDirective", function() { return PerfectScrollbarDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Geometry", function() { return Geometry; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PERFECT_SCROLLBAR_CONFIG", function() { return PERFECT_SCROLLBAR_CONFIG; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PerfectScrollbarConfig", function() { return PerfectScrollbarConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PerfectScrollbarModule", function() { return PerfectScrollbarModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var perfect_scrollbar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! perfect-scrollbar */ "./node_modules/perfect-scrollbar/dist/perfect-scrollbar.esm.js");
/* harmony import */ var resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! resize-observer-polyfill */ "./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ PERFECT_SCROLLBAR_CONFIG = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('PERFECT_SCROLLBAR_CONFIG');
var Geometry = /** @class */ (function () {
function Geometry(x, y, w, h) {
this.x = x;
this.y = y;
this.w = w;
this.h = h;
}
return Geometry;
}());
var Position = /** @class */ (function () {
function Position(x, y) {
this.x = x;
this.y = y;
}
return Position;
}());
var /** @type {?} */ PerfectScrollbarEvents = [
'psScrollY',
'psScrollX',
'psScrollUp',
'psScrollDown',
'psScrollLeft',
'psScrollRight',
'psYReachEnd',
'psYReachStart',
'psXReachEnd',
'psXReachStart'
];
var PerfectScrollbarConfig = /** @class */ (function () {
function PerfectScrollbarConfig(config) {
if (config === void 0) { config = {}; }
this.assign(config);
}
/**
* @param {?=} config
* @return {?}
*/
PerfectScrollbarConfig.prototype.assign = /**
* @param {?=} config
* @return {?}
*/
function (config) {
if (config === void 0) { config = {}; }
for (var /** @type {?} */ key in config) {
this[key] = config[key];
}
};
return PerfectScrollbarConfig;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var PerfectScrollbarDirective = /** @class */ (function () {
function PerfectScrollbarDirective(zone, differs, elementRef, platformId, defaults) {
this.zone = zone;
this.differs = differs;
this.elementRef = elementRef;
this.platformId = platformId;
this.defaults = defaults;
this.ngDestroy = new rxjs__WEBPACK_IMPORTED_MODULE_3__["Subject"]();
this.disabled = false;
this.PS_SCROLL_Y = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_SCROLL_X = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_SCROLL_UP = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_SCROLL_DOWN = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_SCROLL_LEFT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_SCROLL_RIGHT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_Y_REACH_END = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_Y_REACH_START = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_X_REACH_END = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_X_REACH_START = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
}
/**
* @param {?} event
* @return {?}
*/
PerfectScrollbarDirective.prototype.emit = /**
* @param {?} event
* @return {?}
*/
function (event) { this[event.type.replace(/-/g, '_').toUpperCase()].emit(event); };
/**
* @return {?}
*/
PerfectScrollbarDirective.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
if (!this.disabled && Object(_angular_common__WEBPACK_IMPORTED_MODULE_5__["isPlatformBrowser"])(this.platformId)) {
var /** @type {?} */ config_1 = new PerfectScrollbarConfig(this.defaults);
config_1.assign(this.config); // Custom configuration
this.zone.runOutsideAngular(function () {
_this.instance = new perfect_scrollbar__WEBPACK_IMPORTED_MODULE_1__["default"](_this.elementRef.nativeElement, config_1);
});
if (!this.configDiff) {
this.configDiff = this.differs.find(this.config || {}).create();
this.configDiff.diff(this.config || {});
}
this.zone.runOutsideAngular(function () {
_this.ro = new resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_2__["default"](function (entries, observer) {
_this.update();
});
if (_this.elementRef.nativeElement.children[0]) {
_this.ro.observe(_this.elementRef.nativeElement.children[0]);
}
_this.ro.observe(_this.elementRef.nativeElement);
});
this.zone.runOutsideAngular(function () {
PerfectScrollbarEvents.forEach(function (eventName) {
var /** @type {?} */ eventType = eventName.replace(/([A-Z])/g, function (c) { return "-" + c.toLowerCase(); });
Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["fromEvent"])(_this.elementRef.nativeElement, eventType)
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["debounceTime"])(20), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["takeUntil"])(_this.ngDestroy))
.subscribe(function (event) { return _this.emit(event); });
});
});
}
};
/**
* @return {?}
*/
PerfectScrollbarDirective.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
var _this = this;
if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_5__["isPlatformBrowser"])(this.platformId)) {
this.ngDestroy.next();
this.ngDestroy.complete();
if (this.ro) {
this.ro.disconnect();
}
if (this.timeout && typeof window !== 'undefined') {
window.clearTimeout(this.timeout);
}
if (this.instance) {
this.zone.runOutsideAngular(function () {
_this.instance.destroy();
});
this.instance = null;
}
}
};
/**
* @return {?}
*/
PerfectScrollbarDirective.prototype.ngDoCheck = /**
* @return {?}
*/
function () {
if (!this.disabled && this.configDiff && Object(_angular_common__WEBPACK_IMPORTED_MODULE_5__["isPlatformBrowser"])(this.platformId)) {
var /** @type {?} */ changes = this.configDiff.diff(this.config || {});
if (changes) {
this.ngOnDestroy();
this.ngOnInit();
}
}
};
/**
* @param {?} changes
* @return {?}
*/
PerfectScrollbarDirective.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes['disabled'] && !changes['disabled'].isFirstChange() && Object(_angular_common__WEBPACK_IMPORTED_MODULE_5__["isPlatformBrowser"])(this.platformId)) {
if (changes['disabled'].currentValue !== changes['disabled'].previousValue) {
if (changes['disabled'].currentValue === true) {
this.ngOnDestroy();
}
else if (changes['disabled'].currentValue === false) {
this.ngOnInit();
}
}
}
};
/**
* @return {?}
*/
PerfectScrollbarDirective.prototype.ps = /**
* @return {?}
*/
function () {
return this.instance;
};
/**
* @return {?}
*/
PerfectScrollbarDirective.prototype.update = /**
* @return {?}
*/
function () {
var _this = this;
if (typeof window !== 'undefined') {
if (this.timeout) {
window.clearTimeout(this.timeout);
}
this.timeout = window.setTimeout(function () {
if (!_this.disabled && _this.configDiff) {
try {
_this.zone.runOutsideAngular(function () {
if (_this.instance) {
_this.instance.update();
}
});
}
catch (/** @type {?} */ error) {
// Update can be finished after destroy so catch errors
}
}
}, 0);
}
};
/**
* @param {?=} prefix
* @return {?}
*/
PerfectScrollbarDirective.prototype.geometry = /**
* @param {?=} prefix
* @return {?}
*/
function (prefix) {
if (prefix === void 0) { prefix = 'scroll'; }
return new Geometry(this.elementRef.nativeElement[prefix + 'Left'], this.elementRef.nativeElement[prefix + 'Top'], this.elementRef.nativeElement[prefix + 'Width'], this.elementRef.nativeElement[prefix + 'Height']);
};
/**
* @param {?=} absolute
* @return {?}
*/
PerfectScrollbarDirective.prototype.position = /**
* @param {?=} absolute
* @return {?}
*/
function (absolute) {
if (absolute === void 0) { absolute = false; }
if (!absolute) {
return new Position(this.instance.reach.x, this.instance.reach.y);
}
else {
return new Position(this.elementRef.nativeElement.scrollLeft, this.elementRef.nativeElement.scrollTop);
}
};
/**
* @param {?=} direction
* @return {?}
*/
PerfectScrollbarDirective.prototype.scrollable = /**
* @param {?=} direction
* @return {?}
*/
function (direction) {
if (direction === void 0) { direction = 'any'; }
var /** @type {?} */ element = this.elementRef.nativeElement;
if (direction === 'any') {
return element.classList.contains('ps--active-x') ||
element.classList.contains('ps--active-y');
}
else if (direction === 'both') {
return element.classList.contains('ps--active-x') &&
element.classList.contains('ps--active-y');
}
else {
return element.classList.contains('ps--active-' + direction);
}
};
/**
* @param {?} x
* @param {?=} y
* @param {?=} speed
* @return {?}
*/
PerfectScrollbarDirective.prototype.scrollTo = /**
* @param {?} x
* @param {?=} y
* @param {?=} speed
* @return {?}
*/
function (x, y, speed) {
if (!this.disabled) {
if (y == null && speed == null) {
this.animateScrolling('scrollTop', x, speed);
}
else {
if (x != null) {
this.animateScrolling('scrollLeft', x, speed);
}
if (y != null) {
this.animateScrolling('scrollTop', y, speed);
}
}
}
};
/**
* @param {?} x
* @param {?=} speed
* @return {?}
*/
PerfectScrollbarDirective.prototype.scrollToX = /**
* @param {?} x
* @param {?=} speed
* @return {?}
*/
function (x, speed) {
this.animateScrolling('scrollLeft', x, speed);
};
/**
* @param {?} y
* @param {?=} speed
* @return {?}
*/
PerfectScrollbarDirective.prototype.scrollToY = /**
* @param {?} y
* @param {?=} speed
* @return {?}
*/
function (y, speed) {
this.animateScrolling('scrollTop', y, speed);
};
/**
* @param {?=} offset
* @param {?=} speed
* @return {?}
*/
PerfectScrollbarDirective.prototype.scrollToTop = /**
* @param {?=} offset
* @param {?=} speed
* @return {?}
*/
function (offset, speed) {
this.animateScrolling('scrollTop', (offset || 0), speed);
};
/**
* @param {?=} offset
* @param {?=} speed
* @return {?}
*/
PerfectScrollbarDirective.prototype.scrollToLeft = /**
* @param {?=} offset
* @param {?=} speed
* @return {?}
*/
function (offset, speed) {
this.animateScrolling('scrollLeft', (offset || 0), speed);
};
/**
* @param {?=} offset
* @param {?=} speed
* @return {?}
*/
PerfectScrollbarDirective.prototype.scrollToRight = /**
* @param {?=} offset
* @param {?=} speed
* @return {?}
*/
function (offset, speed) {
var /** @type {?} */ left = this.elementRef.nativeElement.scrollWidth -
this.elementRef.nativeElement.clientWidth;
this.animateScrolling('scrollLeft', left - (offset || 0), speed);
};
/**
* @param {?=} offset
* @param {?=} speed
* @return {?}
*/
PerfectScrollbarDirective.prototype.scrollToBottom = /**
* @param {?=} offset
* @param {?=} speed
* @return {?}
*/
function (offset, speed) {
var /** @type {?} */ top = this.elementRef.nativeElement.scrollHeight -
this.elementRef.nativeElement.clientHeight;
this.animateScrolling('scrollTop', top - (offset || 0), speed);
};
/**
* @param {?} qs
* @param {?=} offset
* @param {?=} speed
* @return {?}
*/
PerfectScrollbarDirective.prototype.scrollToElement = /**
* @param {?} qs
* @param {?=} offset
* @param {?=} speed
* @return {?}
*/
function (qs, offset, speed) {
var /** @type {?} */ element = this.elementRef.nativeElement.querySelector(qs);
if (element) {
var /** @type {?} */ elementPos = element.getBoundingClientRect();
var /** @type {?} */ scrollerPos = this.elementRef.nativeElement.getBoundingClientRect();
if (this.elementRef.nativeElement.classList.contains('ps--active-x')) {
var /** @type {?} */ currentPos = this.elementRef.nativeElement['scrollLeft'];
var /** @type {?} */ position = elementPos.left - scrollerPos.left + currentPos;
this.animateScrolling('scrollLeft', position + (offset || 0), speed);
}
if (this.elementRef.nativeElement.classList.contains('ps--active-y')) {
var /** @type {?} */ currentPos = this.elementRef.nativeElement['scrollTop'];
var /** @type {?} */ position = elementPos.top - scrollerPos.top + currentPos;
this.animateScrolling('scrollTop', position + (offset || 0), speed);
}
}
};
/**
* @param {?} target
* @param {?} value
* @param {?=} speed
* @return {?}
*/
PerfectScrollbarDirective.prototype.animateScrolling = /**
* @param {?} target
* @param {?} value
* @param {?=} speed
* @return {?}
*/
function (target, value, speed) {
var _this = this;
if (!speed || typeof window === 'undefined') {
var /** @type {?} */ oldValue = this.elementRef.nativeElement[target];
this.elementRef.nativeElement[target] = value;
if (this.instance && value !== oldValue) {
this.instance.update();
}
}
else if (value !== this.elementRef.nativeElement[target]) {
var /** @type {?} */ newValue_1 = 0;
var /** @type {?} */ scrollCount_1 = 0;
var /** @type {?} */ oldTimestamp_1 = performance.now();
var /** @type {?} */ oldValue_1 = this.elementRef.nativeElement[target];
var /** @type {?} */ cosParameter_1 = (oldValue_1 - value) / 2;
var /** @type {?} */ step_1 = function (newTimestamp) {
scrollCount_1 += Math.PI / (speed / (newTimestamp - oldTimestamp_1));
newValue_1 = Math.round(value + cosParameter_1 + cosParameter_1 * Math.cos(scrollCount_1));
// Only continue animation if scroll position has not changed
if (_this.elementRef.nativeElement[target] === oldValue_1) {
if (scrollCount_1 >= Math.PI) {
_this.animateScrolling(target, value, 0);
}
else {
_this.elementRef.nativeElement[target] = newValue_1;
// On a zoomed out page the resulting offset may differ
// On a zoomed out page the resulting offset may differ
oldValue_1 = _this.elementRef.nativeElement[target];
if (_this.instance) {
_this.instance.update();
}
oldTimestamp_1 = newTimestamp;
window.requestAnimationFrame(step_1);
}
}
};
window.requestAnimationFrame(step_1);
}
};
PerfectScrollbarDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{
selector: '[perfectScrollbar]',
exportAs: 'ngxPerfectScrollbar'
},] }
];
/** @nocollapse */
PerfectScrollbarDirective.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"], },
{ type: Object, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"],] },] },
{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [PERFECT_SCROLLBAR_CONFIG,] },] },
]; };
PerfectScrollbarDirective.propDecorators = {
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"config": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['perfectScrollbar',] },],
"PS_SCROLL_Y": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psScrollY',] },],
"PS_SCROLL_X": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psScrollX',] },],
"PS_SCROLL_UP": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psScrollUp',] },],
"PS_SCROLL_DOWN": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psScrollDown',] },],
"PS_SCROLL_LEFT": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psScrollLeft',] },],
"PS_SCROLL_RIGHT": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psScrollRight',] },],
"PS_Y_REACH_END": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psYReachEnd',] },],
"PS_Y_REACH_START": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psYReachStart',] },],
"PS_X_REACH_END": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psXReachEnd',] },],
"PS_X_REACH_START": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psXReachStart',] },],
};
return PerfectScrollbarDirective;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var PerfectScrollbarComponent = /** @class */ (function () {
function PerfectScrollbarComponent(zone, cdRef, platformId) {
this.zone = zone;
this.cdRef = cdRef;
this.platformId = platformId;
this.states = {};
this.indicatorX = false;
this.indicatorY = false;
this.interaction = false;
this.stateTimeout = null;
this.scrollPositionX = null;
this.scrollPositionY = null;
this.scrollDirectionX = null;
this.scrollDirectionY = null;
this.usePropagationX = false;
this.usePropagationY = false;
this.allowPropagationX = false;
this.allowPropagationY = false;
this.ngDestroy = new rxjs__WEBPACK_IMPORTED_MODULE_3__["Subject"]();
this.stateUpdate = new rxjs__WEBPACK_IMPORTED_MODULE_3__["Subject"]();
this.disabled = false;
this.usePSClass = true;
this.autoPropagation = false;
this.scrollIndicators = false;
this.PS_SCROLL_Y = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_SCROLL_X = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_SCROLL_UP = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_SCROLL_DOWN = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_SCROLL_LEFT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_SCROLL_RIGHT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_Y_REACH_END = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_Y_REACH_START = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_X_REACH_END = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.PS_X_REACH_START = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
}
/**
* @return {?}
*/
PerfectScrollbarComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_5__["isPlatformBrowser"])(this.platformId)) {
this.stateUpdate
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["takeUntil"])(this.ngDestroy), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["distinctUntilChanged"])(function (a, b) { return (a === b && !_this.stateTimeout); }))
.subscribe(function (state) {
if (_this.stateTimeout && typeof window !== 'undefined') {
window.clearTimeout(_this.stateTimeout);
_this.stateTimeout = null;
}
if (state === 'x' || state === 'y') {
_this.interaction = false;
if (state === 'x') {
_this.indicatorX = false;
_this.states.left = false;
_this.states.right = false;
if (_this.autoPropagation && _this.usePropagationX) {
_this.allowPropagationX = false;
}
}
else if (state === 'y') {
_this.indicatorY = false;
_this.states.top = false;
_this.states.bottom = false;
if (_this.autoPropagation && _this.usePropagationY) {
_this.allowPropagationY = false;
}
}
}
else {
if (state === 'left' || state === 'right') {
_this.states.left = false;
_this.states.right = false;
_this.states[state] = true;
if (_this.autoPropagation && _this.usePropagationX) {
_this.indicatorX = true;
}
}
else if (state === 'top' || state === 'bottom') {
_this.states.top = false;
_this.states.bottom = false;
_this.states[state] = true;
if (_this.autoPropagation && _this.usePropagationY) {
_this.indicatorY = true;
}
}
if (_this.autoPropagation && typeof window !== 'undefined') {
_this.stateTimeout = window.setTimeout(function () {
_this.indicatorX = false;
_this.indicatorY = false;
_this.stateTimeout = null;
if (_this.interaction && (_this.states.left || _this.states.right)) {
_this.allowPropagationX = true;
}
if (_this.interaction && (_this.states.top || _this.states.bottom)) {
_this.allowPropagationY = true;
}
_this.cdRef.markForCheck();
}, 500);
}
}
_this.cdRef.markForCheck();
_this.cdRef.detectChanges();
});
this.zone.runOutsideAngular(function () {
var /** @type {?} */ element = _this.directiveRef.elementRef.nativeElement;
Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["fromEvent"])(element, 'wheel')
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["takeUntil"])(_this.ngDestroy))
.subscribe(function (event) {
if (!_this.disabled && _this.autoPropagation) {
var /** @type {?} */ scrollDeltaX = event.deltaX;
var /** @type {?} */ scrollDeltaY = event.deltaY;
_this.checkPropagation(event, scrollDeltaX, scrollDeltaY);
}
});
Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["fromEvent"])(element, 'touchmove')
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["takeUntil"])(_this.ngDestroy))
.subscribe(function (event) {
if (!_this.disabled && _this.autoPropagation) {
var /** @type {?} */ scrollPositionX = event.touches[0].clientX;
var /** @type {?} */ scrollPositionY = event.touches[0].clientY;
var /** @type {?} */ scrollDeltaX = scrollPositionX - _this.scrollPositionX;
var /** @type {?} */ scrollDeltaY = scrollPositionY - _this.scrollPositionY;
_this.checkPropagation(event, scrollDeltaX, scrollDeltaY);
_this.scrollPositionX = scrollPositionX;
_this.scrollPositionY = scrollPositionY;
}
});
Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["merge"])(Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["fromEvent"])(element, 'ps-scroll-x')
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])(function (event) { return event.state = 'x'; })), Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["fromEvent"])(element, 'ps-scroll-y')
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])(function (event) { return event.state = 'y'; })), Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["fromEvent"])(element, 'ps-x-reach-end')
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])(function (event) { return event.state = 'right'; })), Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["fromEvent"])(element, 'ps-y-reach-end')
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])(function (event) { return event.state = 'bottom'; })), Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["fromEvent"])(element, 'ps-x-reach-start')
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])(function (event) { return event.state = 'left'; })), Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["fromEvent"])(element, 'ps-y-reach-start')
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])(function (event) { return event.state = 'top'; })))
.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["takeUntil"])(_this.ngDestroy))
.subscribe(function (event) {
if (!_this.disabled && (_this.autoPropagation || _this.scrollIndicators)) {
_this.stateUpdate.next(event.state);
}
});
});
window.setTimeout(function () {
if (_this.directiveRef) {
PerfectScrollbarEvents.forEach(function (eventName) {
eventName = eventName.replace(/([A-Z])/g, function (c) { return "_" + c; }).toUpperCase();
_this.directiveRef[eventName] = _this[eventName];
});
}
}, 0);
}
};
/**
* @return {?}
*/
PerfectScrollbarComponent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_5__["isPlatformBrowser"])(this.platformId)) {
this.ngDestroy.next();
this.ngDestroy.unsubscribe();
if (this.stateTimeout && typeof window !== 'undefined') {
window.clearTimeout(this.stateTimeout);
}
}
};
/**
* @return {?}
*/
PerfectScrollbarComponent.prototype.ngDoCheck = /**
* @return {?}
*/
function () {
if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_5__["isPlatformBrowser"])(this.platformId)) {
if (!this.disabled && this.autoPropagation && this.directiveRef) {
var /** @type {?} */ element = this.directiveRef.elementRef.nativeElement;
this.usePropagationX = element.classList.contains('ps--active-x');
this.usePropagationY = element.classList.contains('ps--active-y');
}
}
};
/**
* @param {?} event
* @param {?} deltaX
* @param {?} deltaY
* @return {?}
*/
PerfectScrollbarComponent.prototype.checkPropagation = /**
* @param {?} event
* @param {?} deltaX
* @param {?} deltaY
* @return {?}
*/
function (event, deltaX, deltaY) {
this.interaction = true;
var /** @type {?} */ scrollDirectionX = (deltaX < 0) ? -1 : 1;
var /** @type {?} */ scrollDirectionY = (deltaY < 0) ? -1 : 1;
if ((this.usePropagationX && this.usePropagationY) ||
(this.usePropagationX && (!this.allowPropagationX ||
(this.scrollDirectionX !== scrollDirectionX))) ||
(this.usePropagationY && (!this.allowPropagationY ||
(this.scrollDirectionY !== scrollDirectionY)))) {
event.preventDefault();
event.stopPropagation();
}
if (!!deltaX) {
this.scrollDirectionX = scrollDirectionX;
}
if (!!deltaY) {
this.scrollDirectionY = scrollDirectionY;
}
this.stateUpdate.next('interaction');
this.cdRef.detectChanges();
};
PerfectScrollbarComponent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{
selector: 'perfect-scrollbar',
exportAs: 'ngxPerfectScrollbar',
template: "<div style=\"position: static;\" [class.ps]=\"usePSClass\" [perfectScrollbar]=\"config\" [disabled]=\"disabled\">\n <div class=\"ps-content\">\n <ng-content></ng-content>\n </div>\n\n <div *ngIf=\"scrollIndicators\" class=\"ps-overlay\" [class.ps-at-top]=\"states.top\" [class.ps-at-left]=\"states.left\" [class.ps-at-right]=\"states.right\" [class.ps-at-bottom]=\"states.bottom\">\n <div class=\"ps-indicator-top\" [class.ps-indicator-show]=\"indicatorY && interaction\"></div>\n <div class=\"ps-indicator-left\" [class.ps-indicator-show]=\"indicatorX && interaction\"></div>\n <div class=\"ps-indicator-right\" [class.ps-indicator-show]=\"indicatorX && interaction\"></div>\n <div class=\"ps-indicator-bottom\" [class.ps-indicator-show]=\"indicatorY && interaction\"></div>\n </div>\n</div>\n",
encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
styles: ["/*\n * Container style\n */\n.ps {\n overflow: hidden !important;\n overflow-anchor: none;\n -ms-overflow-style: none;\n touch-action: auto;\n -ms-touch-action: auto; }\n\n/*\n * Scrollbar rail styles\n */\n.ps__rail-x {\n display: none;\n opacity: 0;\n transition: background-color .2s linear, opacity .2s linear;\n -webkit-transition: background-color .2s linear, opacity .2s linear;\n height: 15px;\n /* there must be 'bottom' or 'top' for ps__rail-x */\n bottom: 0px;\n /* please don't change 'position' */\n position: absolute; }\n\n.ps__rail-y {\n display: none;\n opacity: 0;\n transition: background-color .2s linear, opacity .2s linear;\n -webkit-transition: background-color .2s linear, opacity .2s linear;\n width: 15px;\n /* there must be 'right' or 'left' for ps__rail-y */\n right: 0;\n /* please don't change 'position' */\n position: absolute; }\n\n.ps--active-x > .ps__rail-x,\n.ps--active-y > .ps__rail-y {\n display: block;\n background-color: transparent; }\n\n.ps:hover > .ps__rail-x,\n.ps:hover > .ps__rail-y,\n.ps--focus > .ps__rail-x,\n.ps--focus > .ps__rail-y,\n.ps--scrolling-x > .ps__rail-x,\n.ps--scrolling-y > .ps__rail-y {\n opacity: 0.6; }\n\n.ps__rail-x:hover,\n.ps__rail-y:hover,\n.ps__rail-x:focus,\n.ps__rail-y:focus {\n background-color: #eee;\n opacity: 0.9; }\n\n/*\n * Scrollbar thumb styles\n */\n.ps__thumb-x {\n background-color: #aaa;\n border-radius: 6px;\n transition: background-color .2s linear, height .2s ease-in-out;\n -webkit-transition: background-color .2s linear, height .2s ease-in-out;\n height: 6px;\n /* there must be 'bottom' for ps__thumb-x */\n bottom: 2px;\n /* please don't change 'position' */\n position: absolute; }\n\n.ps__thumb-y {\n background-color: #aaa;\n border-radius: 6px;\n transition: background-color .2s linear, width .2s ease-in-out;\n -webkit-transition: background-color .2s linear, width .2s ease-in-out;\n width: 6px;\n /* there must be 'right' for ps__thumb-y */\n right: 2px;\n /* please don't change 'position' */\n position: absolute; }\n\n.ps__rail-x:hover > .ps__thumb-x,\n.ps__rail-x:focus > .ps__thumb-x {\n background-color: #999;\n height: 11px; }\n\n.ps__rail-y:hover > .ps__thumb-y,\n.ps__rail-y:focus > .ps__thumb-y {\n background-color: #999;\n width: 11px; }\n\n/* MS supports */\n@supports (-ms-overflow-style: none) {\n .ps {\n overflow: auto !important; } }\n\n@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n .ps {\n overflow: auto !important; } }\n\n/*\n TODO: Remove important flags after this bug if fixed:\n https://github.com/angular/flex-layout/issues/381\n*/\nperfect-scrollbar {\n position: relative;\n display: block;\n overflow: hidden;\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n /* stylelint-disable */\n /* stylelint-enable */ }\n perfect-scrollbar[hidden] {\n display: none; }\n perfect-scrollbar[fxflex] {\n display: flex;\n flex-direction: column;\n -webkit-box-orient: column;\n -webkit-box-direction: column;\n height: auto;\n min-width: 0;\n min-height: 0; }\n perfect-scrollbar[fxflex] > .ps {\n flex: 1 1 auto;\n -ms-flex: 1 1 auto;\n -webkit-box-flex: 1;\n width: auto;\n height: auto;\n min-width: 0;\n min-height: 0; }\n perfect-scrollbar[fxlayout] > .ps,\n perfect-scrollbar[fxlayout] > .ps > .ps-content {\n display: flex;\n flex: 1 1 auto;\n -ms-flex: 1 1 auto;\n -webkit-box-flex: 1;\n align-item: inherit;\n place-content: inherit;\n -webkit-box-pack: inherit;\n -webkit-box-align: inherit;\n flex-direction: inherit;\n -webkit-box-orient: inherit;\n -webkit-box-direction: inherit;\n width: 100%;\n height: 100%; }\n perfect-scrollbar[fxlayout=\"row\"] > .ps,\n perfect-scrollbar[fxlayout=\"row\"] > .ps > .ps-content {\n flex-direction: row !important;\n -webkit-box-orient: row !important;\n -webkit-box-direction: row !important; }\n perfect-scrollbar[fxlayout=\"column\"] > .ps,\n perfect-scrollbar[fxlayout=\"column\"] > .ps > .ps-content {\n flex-direction: column !important;\n -webkit-box-orient: column !important;\n -webkit-box-direction: column !important; }\n perfect-scrollbar > .ps {\n position: static;\n display: block;\n width: inherit;\n height: inherit;\n max-width: inherit;\n max-height: inherit; }\n perfect-scrollbar > .ps > .ps-overlay {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: block;\n overflow: hidden;\n pointer-events: none; }\n perfect-scrollbar > .ps > .ps-overlay .ps-indicator-top,\n perfect-scrollbar > .ps > .ps-overlay .ps-indicator-left,\n perfect-scrollbar > .ps > .ps-overlay .ps-indicator-right,\n perfect-scrollbar > .ps > .ps-overlay .ps-indicator-bottom {\n position: absolute;\n opacity: 0;\n transition: opacity 300ms ease-in-out; }\n perfect-scrollbar > .ps > .ps-overlay .ps-indicator-top,\n perfect-scrollbar > .ps > .ps-overlay .ps-indicator-bottom {\n left: 0;\n min-width: 100%;\n min-height: 24px; }\n perfect-scrollbar > .ps > .ps-overlay .ps-indicator-left,\n perfect-scrollbar > .ps > .ps-overlay .ps-indicator-right {\n top: 0;\n min-width: 24px;\n min-height: 100%; }\n perfect-scrollbar > .ps > .ps-overlay .ps-indicator-top {\n top: 0; }\n perfect-scrollbar > .ps > .ps-overlay .ps-indicator-left {\n left: 0; }\n perfect-scrollbar > .ps > .ps-overlay .ps-indicator-right {\n right: 0; }\n perfect-scrollbar > .ps > .ps-overlay .ps-indicator-bottom {\n bottom: 0; }\n perfect-scrollbar > .ps.ps--active-y > .ps__rail-y {\n top: 0 !important;\n right: 0 !important;\n left: auto !important;\n width: 10px;\n cursor: default;\n transition: width 200ms linear, opacity 200ms linear, background-color 200ms linear; }\n perfect-scrollbar > .ps.ps--active-y > .ps__rail-y:hover {\n width: 15px; }\n perfect-scrollbar > .ps.ps--active-x > .ps__rail-x {\n top: auto !important;\n bottom: 0 !important;\n left: 0 !important;\n height: 10px;\n cursor: default;\n transition: height 200ms linear, opacity 200ms linear, background-color 200ms linear; }\n perfect-scrollbar > .ps.ps--active-x > .ps__rail-x:hover {\n height: 15px; }\n perfect-scrollbar > .ps.ps--active-x.ps--active-y > .ps__rail-y {\n margin: 0 0 10px; }\n perfect-scrollbar > .ps.ps--active-x.ps--active-y > .ps__rail-x {\n margin: 0 10px 0 0; }\n perfect-scrollbar > .ps.ps--scrolling-y > .ps__rail-y {\n opacity: 0.9;\n background-color: #eee; }\n perfect-scrollbar > .ps.ps--scrolling-x > .ps__rail-x {\n opacity: 0.9;\n background-color: #eee; }\n perfect-scrollbar.ps-show-always > .ps.ps--active-y > .ps__rail-y {\n opacity: 0.6; }\n perfect-scrollbar.ps-show-always > .ps.ps--active-x > .ps__rail-x {\n opacity: 0.6; }\n perfect-scrollbar.ps-show-active > .ps.ps--active-y > .ps-overlay:not(.ps-at-top) .ps-indicator-top {\n opacity: 1;\n background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); }\n perfect-scrollbar.ps-show-active > .ps.ps--active-y > .ps-overlay:not(.ps-at-bottom) .ps-indicator-bottom {\n opacity: 1;\n background: linear-gradient(to top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); }\n perfect-scrollbar.ps-show-active > .ps.ps--active-x > .ps-overlay:not(.ps-at-left) .ps-indicator-left {\n opacity: 1;\n background: linear-gradient(to right, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); }\n perfect-scrollbar.ps-show-active > .ps.ps--active-x > .ps-overlay:not(.ps-at-right) .ps-indicator-right {\n opacity: 1;\n background: linear-gradient(to left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); }\n perfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-y > .ps-overlay.ps-at-top .ps-indicator-top {\n background: linear-gradient(to bottom, rgba(170, 170, 170, 0.5) 0%, rgba(170, 170, 170, 0) 100%); }\n perfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-y > .ps-overlay.ps-at-top .ps-indicator-top.ps-indicator-show {\n opacity: 1; }\n perfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-y > .ps-overlay.ps-at-bottom .ps-indicator-bottom {\n background: linear-gradient(to top, rgba(170, 170, 170, 0.5) 0%, rgba(170, 170, 170, 0) 100%); }\n perfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-y > .ps-overlay.ps-at-bottom .ps-indicator-bottom.ps-indicator-show {\n opacity: 1; }\n perfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-x > .ps-overlay.ps-at-left .ps-indicator-left {\n background: linear-gradient(to right, rgba(170, 170, 170, 0.5) 0%, rgba(170, 170, 170, 0) 100%); }\n perfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-x > .ps-overlay.ps-at-left .ps-indicator-left.ps-indicator-show {\n opacity: 1; }\n perfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-x > .ps-overlay.ps-at-right .ps-indicator-right {\n background: linear-gradient(to left, rgba(170, 170, 170, 0.5) 0%, rgba(170, 170, 170, 0) 100%); }\n perfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-x > .ps-overlay.ps-at-right .ps-indicator-right.ps-indicator-show {\n opacity: 1; }\n\n/*# sourceMappingURL=perfect-scrollbar.component.css.map */"]
}] }
];
/** @nocollapse */
PerfectScrollbarComponent.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"], },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"], },
{ type: Object, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"],] },] },
]; };
PerfectScrollbarComponent.propDecorators = {
"disabled": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"usePSClass": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"autoPropagation": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["HostBinding"], args: ['class.ps-show-limits',] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"scrollIndicators": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["HostBinding"], args: ['class.ps-show-active',] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"config": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] },],
"directiveRef": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"], args: [PerfectScrollbarDirective,] },],
"PS_SCROLL_Y": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psScrollY',] },],
"PS_SCROLL_X": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psScrollX',] },],
"PS_SCROLL_UP": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psScrollUp',] },],
"PS_SCROLL_DOWN": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psScrollDown',] },],
"PS_SCROLL_LEFT": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psScrollLeft',] },],
"PS_SCROLL_RIGHT": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psScrollRight',] },],
"PS_Y_REACH_END": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psYReachEnd',] },],
"PS_Y_REACH_START": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psYReachStart',] },],
"PS_X_REACH_END": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psXReachEnd',] },],
"PS_X_REACH_START": [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['psXReachStart',] },],
};
return PerfectScrollbarComponent;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var PerfectScrollbarModule = /** @class */ (function () {
function PerfectScrollbarModule() {
}
PerfectScrollbarModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__["CommonModule"]],
declarations: [PerfectScrollbarComponent, PerfectScrollbarDirective],
exports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__["CommonModule"], PerfectScrollbarComponent, PerfectScrollbarDirective]
},] }
];
return PerfectScrollbarModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
//# sourceMappingURL=ngx-perfect-scrollbar.es5.js.map
/***/ }),
/***/ "./node_modules/perfect-scrollbar/dist/perfect-scrollbar.esm.js":
/*!**********************************************************************!*\
!*** ./node_modules/perfect-scrollbar/dist/perfect-scrollbar.esm.js ***!
\**********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/*!
* perfect-scrollbar v1.4.0
* (c) 2018 Hyunje Jun
* @license MIT
*/
function get(element) {
return getComputedStyle(element);
}
function set(element, obj) {
for (var key in obj) {
var val = obj[key];
if (typeof val === 'number') {
val = val + "px";
}
element.style[key] = val;
}
return element;
}
function div(className) {
var div = document.createElement('div');
div.className = className;
return div;
}
var elMatches =
typeof Element !== 'undefined' &&
(Element.prototype.matches ||
Element.prototype.webkitMatchesSelector ||
Element.prototype.mozMatchesSelector ||
Element.prototype.msMatchesSelector);
function matches(element, query) {
if (!elMatches) {
throw new Error('No element matching method supported');
}
return elMatches.call(element, query);
}
function remove(element) {
if (element.remove) {
element.remove();
} else {
if (element.parentNode) {
element.parentNode.removeChild(element);
}
}
}
function queryChildren(element, selector) {
return Array.prototype.filter.call(element.children, function (child) { return matches(child, selector); }
);
}
var cls = {
main: 'ps',
element: {
thumb: function (x) { return ("ps__thumb-" + x); },
rail: function (x) { return ("ps__rail-" + x); },
consuming: 'ps__child--consume',
},
state: {
focus: 'ps--focus',
clicking: 'ps--clicking',
active: function (x) { return ("ps--active-" + x); },
scrolling: function (x) { return ("ps--scrolling-" + x); },
},
};
/*
* Helper methods
*/
var scrollingClassTimeout = { x: null, y: null };
function addScrollingClass(i, x) {
var classList = i.element.classList;
var className = cls.state.scrolling(x);
if (classList.contains(className)) {
clearTimeout(scrollingClassTimeout[x]);
} else {
classList.add(className);
}
}
function removeScrollingClass(i, x) {
scrollingClassTimeout[x] = setTimeout(
function () { return i.isAlive && i.element.classList.remove(cls.state.scrolling(x)); },
i.settings.scrollingThreshold
);
}
function setScrollingClassInstantly(i, x) {
addScrollingClass(i, x);
removeScrollingClass(i, x);
}
var EventElement = function EventElement(element) {
this.element = element;
this.handlers = {};
};
var prototypeAccessors = { isEmpty: { configurable: true } };
EventElement.prototype.bind = function bind (eventName, handler) {
if (typeof this.handlers[eventName] === 'undefined') {
this.handlers[eventName] = [];
}
this.handlers[eventName].push(handler);
this.element.addEventListener(eventName, handler, false);
};
EventElement.prototype.unbind = function unbind (eventName, target) {
var this$1 = this;
this.handlers[eventName] = this.handlers[eventName].filter(function (handler) {
if (target && handler !== target) {
return true;
}
this$1.element.removeEventListener(eventName, handler, false);
return false;
});
};
EventElement.prototype.unbindAll = function unbindAll () {
var this$1 = this;
for (var name in this$1.handlers) {
this$1.unbind(name);
}
};
prototypeAccessors.isEmpty.get = function () {
var this$1 = this;
return Object.keys(this.handlers).every(
function (key) { return this$1.handlers[key].length === 0; }
);
};
Object.defineProperties( EventElement.prototype, prototypeAccessors );
var EventManager = function EventManager() {
this.eventElements = [];
};
EventManager.prototype.eventElement = function eventElement (element) {
var ee = this.eventElements.filter(function (ee) { return ee.element === element; })[0];
if (!ee) {
ee = new EventElement(element);
this.eventElements.push(ee);
}
return ee;
};
EventManager.prototype.bind = function bind (element, eventName, handler) {
this.eventElement(element).bind(eventName, handler);
};
EventManager.prototype.unbind = function unbind (element, eventName, handler) {
var ee = this.eventElement(element);
ee.unbind(eventName, handler);
if (ee.isEmpty) {
// remove
this.eventElements.splice(this.eventElements.indexOf(ee), 1);
}
};
EventManager.prototype.unbindAll = function unbindAll () {
this.eventElements.forEach(function (e) { return e.unbindAll(); });
this.eventElements = [];
};
EventManager.prototype.once = function once (element, eventName, handler) {
var ee = this.eventElement(element);
var onceHandler = function (evt) {
ee.unbind(eventName, onceHandler);
handler(evt);
};
ee.bind(eventName, onceHandler);
};
function createEvent(name) {
if (typeof window.CustomEvent === 'function') {
return new CustomEvent(name);
} else {
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(name, false, false, undefined);
return evt;
}
}
var processScrollDiff = function(
i,
axis,
diff,
useScrollingClass,
forceFireReachEvent
) {
if ( useScrollingClass === void 0 ) useScrollingClass = true;
if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
var fields;
if (axis === 'top') {
fields = [
'contentHeight',
'containerHeight',
'scrollTop',
'y',
'up',
'down' ];
} else if (axis === 'left') {
fields = [
'contentWidth',
'containerWidth',
'scrollLeft',
'x',
'left',
'right' ];
} else {
throw new Error('A proper axis should be provided');
}
processScrollDiff$1(i, diff, fields, useScrollingClass, forceFireReachEvent);
};
function processScrollDiff$1(
i,
diff,
ref,
useScrollingClass,
forceFireReachEvent
) {
var contentHeight = ref[0];
var containerHeight = ref[1];
var scrollTop = ref[2];
var y = ref[3];
var up = ref[4];
var down = ref[5];
if ( useScrollingClass === void 0 ) useScrollingClass = true;
if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
var element = i.element;
// reset reach
i.reach[y] = null;
// 1 for subpixel rounding
if (element[scrollTop] < 1) {
i.reach[y] = 'start';
}
// 1 for subpixel rounding
if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {
i.reach[y] = 'end';
}
if (diff) {
element.dispatchEvent(createEvent(("ps-scroll-" + y)));
if (diff < 0) {
element.dispatchEvent(createEvent(("ps-scroll-" + up)));
} else if (diff > 0) {
element.dispatchEvent(createEvent(("ps-scroll-" + down)));
}
if (useScrollingClass) {
setScrollingClassInstantly(i, y);
}
}
if (i.reach[y] && (diff || forceFireReachEvent)) {
element.dispatchEvent(createEvent(("ps-" + y + "-reach-" + (i.reach[y]))));
}
}
function toInt(x) {
return parseInt(x, 10) || 0;
}
function isEditable(el) {
return (
matches(el, 'input,[contenteditable]') ||
matches(el, 'select,[contenteditable]') ||
matches(el, 'textarea,[contenteditable]') ||
matches(el, 'button,[contenteditable]')
);
}
function outerWidth(element) {
var styles = get(element);
return (
toInt(styles.width) +
toInt(styles.paddingLeft) +
toInt(styles.paddingRight) +
toInt(styles.borderLeftWidth) +
toInt(styles.borderRightWidth)
);
}
var env = {
isWebKit:
typeof document !== 'undefined' &&
'WebkitAppearance' in document.documentElement.style,
supportsTouch:
typeof window !== 'undefined' &&
('ontouchstart' in window ||
(window.DocumentTouch && document instanceof window.DocumentTouch)),
supportsIePointer:
typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,
isChrome:
typeof navigator !== 'undefined' &&
/Chrome/i.test(navigator && navigator.userAgent),
};
var updateGeometry = function(i) {
var element = i.element;
var roundedScrollTop = Math.floor(element.scrollTop);
i.containerWidth = element.clientWidth;
i.containerHeight = element.clientHeight;
i.contentWidth = element.scrollWidth;
i.contentHeight = element.scrollHeight;
if (!element.contains(i.scrollbarXRail)) {
// clean up and append
queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }
);
element.appendChild(i.scrollbarXRail);
}
if (!element.contains(i.scrollbarYRail)) {
// clean up and append
queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }
);
element.appendChild(i.scrollbarYRail);
}
if (
!i.settings.suppressScrollX &&
i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth
) {
i.scrollbarXActive = true;
i.railXWidth = i.containerWidth - i.railXMarginWidth;
i.railXRatio = i.containerWidth / i.railXWidth;
i.scrollbarXWidth = getThumbSize(
i,
toInt(i.railXWidth * i.containerWidth / i.contentWidth)
);
i.scrollbarXLeft = toInt(
(i.negativeScrollAdjustment + element.scrollLeft) *
(i.railXWidth - i.scrollbarXWidth) /
(i.contentWidth - i.containerWidth)
);
} else {
i.scrollbarXActive = false;
}
if (
!i.settings.suppressScrollY &&
i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight
) {
i.scrollbarYActive = true;
i.railYHeight = i.containerHeight - i.railYMarginHeight;
i.railYRatio = i.containerHeight / i.railYHeight;
i.scrollbarYHeight = getThumbSize(
i,
toInt(i.railYHeight * i.containerHeight / i.contentHeight)
);
i.scrollbarYTop = toInt(
roundedScrollTop *
(i.railYHeight - i.scrollbarYHeight) /
(i.contentHeight - i.containerHeight)
);
} else {
i.scrollbarYActive = false;
}
if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
}
if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
}
updateCss(element, i);
if (i.scrollbarXActive) {
element.classList.add(cls.state.active('x'));
} else {
element.classList.remove(cls.state.active('x'));
i.scrollbarXWidth = 0;
i.scrollbarXLeft = 0;
element.scrollLeft = 0;
}
if (i.scrollbarYActive) {
element.classList.add(cls.state.active('y'));
} else {
element.classList.remove(cls.state.active('y'));
i.scrollbarYHeight = 0;
i.scrollbarYTop = 0;
element.scrollTop = 0;
}
};
function getThumbSize(i, thumbSize) {
if (i.settings.minScrollbarLength) {
thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
}
if (i.settings.maxScrollbarLength) {
thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
}
return thumbSize;
}
function updateCss(element, i) {
var xRailOffset = { width: i.railXWidth };
var roundedScrollTop = Math.floor(element.scrollTop);
if (i.isRtl) {
xRailOffset.left =
i.negativeScrollAdjustment +
element.scrollLeft +
i.containerWidth -
i.contentWidth;
} else {
xRailOffset.left = element.scrollLeft;
}
if (i.isScrollbarXUsingBottom) {
xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;
} else {
xRailOffset.top = i.scrollbarXTop + roundedScrollTop;
}
set(i.scrollbarXRail, xRailOffset);
var yRailOffset = { top: roundedScrollTop, height: i.railYHeight };
if (i.isScrollbarYUsingRight) {
if (i.isRtl) {
yRailOffset.right =
i.contentWidth -
(i.negativeScrollAdjustment + element.scrollLeft) -
i.scrollbarYRight -
i.scrollbarYOuterWidth;
} else {
yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
}
} else {
if (i.isRtl) {
yRailOffset.left =
i.negativeScrollAdjustment +
element.scrollLeft +
i.containerWidth * 2 -
i.contentWidth -
i.scrollbarYLeft -
i.scrollbarYOuterWidth;
} else {
yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
}
}
set(i.scrollbarYRail, yRailOffset);
set(i.scrollbarX, {
left: i.scrollbarXLeft,
width: i.scrollbarXWidth - i.railBorderXWidth,
});
set(i.scrollbarY, {
top: i.scrollbarYTop,
height: i.scrollbarYHeight - i.railBorderYWidth,
});
}
var clickRail = function(i) {
i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); });
i.event.bind(i.scrollbarYRail, 'mousedown', function (e) {
var positionTop =
e.pageY -
window.pageYOffset -
i.scrollbarYRail.getBoundingClientRect().top;
var direction = positionTop > i.scrollbarYTop ? 1 : -1;
i.element.scrollTop += direction * i.containerHeight;
updateGeometry(i);
e.stopPropagation();
});
i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); });
i.event.bind(i.scrollbarXRail, 'mousedown', function (e) {
var positionLeft =
e.pageX -
window.pageXOffset -
i.scrollbarXRail.getBoundingClientRect().left;
var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
i.element.scrollLeft += direction * i.containerWidth;
updateGeometry(i);
e.stopPropagation();
});
};
var dragThumb = function(i) {
bindMouseScrollHandler(i, [
'containerWidth',
'contentWidth',
'pageX',
'railXWidth',
'scrollbarX',
'scrollbarXWidth',
'scrollLeft',
'x',
'scrollbarXRail' ]);
bindMouseScrollHandler(i, [
'containerHeight',
'contentHeight',
'pageY',
'railYHeight',
'scrollbarY',
'scrollbarYHeight',
'scrollTop',
'y',
'scrollbarYRail' ]);
};
function bindMouseScrollHandler(
i,
ref
) {
var containerHeight = ref[0];
var contentHeight = ref[1];
var pageY = ref[2];
var railYHeight = ref[3];
var scrollbarY = ref[4];
var scrollbarYHeight = ref[5];
var scrollTop = ref[6];
var y = ref[7];
var scrollbarYRail = ref[8];
var element = i.element;
var startingScrollTop = null;
var startingMousePageY = null;
var scrollBy = null;
function mouseMoveHandler(e) {
element[scrollTop] =
startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
addScrollingClass(i, y);
updateGeometry(i);
e.stopPropagation();
e.preventDefault();
}
function mouseUpHandler() {
removeScrollingClass(i, y);
i[scrollbarYRail].classList.remove(cls.state.clicking);
i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
}
i.event.bind(i[scrollbarY], 'mousedown', function (e) {
startingScrollTop = element[scrollTop];
startingMousePageY = e[pageY];
scrollBy =
(i[contentHeight] - i[containerHeight]) /
(i[railYHeight] - i[scrollbarYHeight]);
i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
i[scrollbarYRail].classList.add(cls.state.clicking);
e.stopPropagation();
e.preventDefault();
});
}
var keyboard = function(i) {
var element = i.element;
var elementHovered = function () { return matches(element, ':hover'); };
var scrollbarFocused = function () { return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus'); };
function shouldPreventDefault(deltaX, deltaY) {
var scrollTop = Math.floor(element.scrollTop);
if (deltaX === 0) {
if (!i.scrollbarYActive) {
return false;
}
if (
(scrollTop === 0 && deltaY > 0) ||
(scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)
) {
return !i.settings.wheelPropagation;
}
}
var scrollLeft = element.scrollLeft;
if (deltaY === 0) {
if (!i.scrollbarXActive) {
return false;
}
if (
(scrollLeft === 0 && deltaX < 0) ||
(scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)
) {
return !i.settings.wheelPropagation;
}
}
return true;
}
i.event.bind(i.ownerDocument, 'keydown', function (e) {
if (
(e.isDefaultPrevented && e.isDefaultPrevented()) ||
e.defaultPrevented
) {
return;
}
if (!elementHovered() && !scrollbarFocused()) {
return;
}
var activeElement = document.activeElement
? document.activeElement
: i.ownerDocument.activeElement;
if (activeElement) {
if (activeElement.tagName === 'IFRAME') {
activeElement = activeElement.contentDocument.activeElement;
} else {
// go deeper if element is a webcomponent
while (activeElement.shadowRoot) {
activeElement = activeElement.shadowRoot.activeElement;
}
}
if (isEditable(activeElement)) {
return;
}
}
var deltaX = 0;
var deltaY = 0;
switch (e.which) {
case 37: // left
if (e.metaKey) {
deltaX = -i.contentWidth;
} else if (e.altKey) {
deltaX = -i.containerWidth;
} else {
deltaX = -30;
}
break;
case 38: // up
if (e.metaKey) {
deltaY = i.contentHeight;
} else if (e.altKey) {
deltaY = i.containerHeight;
} else {
deltaY = 30;
}
break;
case 39: // right
if (e.metaKey) {
deltaX = i.contentWidth;
} else if (e.altKey) {
deltaX = i.containerWidth;
} else {
deltaX = 30;
}
break;
case 40: // down
if (e.metaKey) {
deltaY = -i.contentHeight;
} else if (e.altKey) {
deltaY = -i.containerHeight;
} else {
deltaY = -30;
}
break;
case 32: // space bar
if (e.shiftKey) {
deltaY = i.containerHeight;
} else {
deltaY = -i.containerHeight;
}
break;
case 33: // page up
deltaY = i.containerHeight;
break;
case 34: // page down
deltaY = -i.containerHeight;
break;
case 36: // home
deltaY = i.contentHeight;
break;
case 35: // end
deltaY = -i.contentHeight;
break;
default:
return;
}
if (i.settings.suppressScrollX && deltaX !== 0) {
return;
}
if (i.settings.suppressScrollY && deltaY !== 0) {
return;
}
element.scrollTop -= deltaY;
element.scrollLeft += deltaX;
updateGeometry(i);
if (shouldPreventDefault(deltaX, deltaY)) {
e.preventDefault();
}
});
};
var wheel = function(i) {
var element = i.element;
function shouldPreventDefault(deltaX, deltaY) {
var roundedScrollTop = Math.floor(element.scrollTop);
var isTop = element.scrollTop === 0;
var isBottom =
roundedScrollTop + element.offsetHeight === element.scrollHeight;
var isLeft = element.scrollLeft === 0;
var isRight =
element.scrollLeft + element.offsetWidth === element.scrollWidth;
var hitsBound;
// pick axis with primary direction
if (Math.abs(deltaY) > Math.abs(deltaX)) {
hitsBound = isTop || isBottom;
} else {
hitsBound = isLeft || isRight;
}
return hitsBound ? !i.settings.wheelPropagation : true;
}
function getDeltaFromEvent(e) {
var deltaX = e.deltaX;
var deltaY = -1 * e.deltaY;
if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {
// OS X Safari
deltaX = -1 * e.wheelDeltaX / 6;
deltaY = e.wheelDeltaY / 6;
}
if (e.deltaMode && e.deltaMode === 1) {
// Firefox in deltaMode 1: Line scrolling
deltaX *= 10;
deltaY *= 10;
}
if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {
// IE in some mouse drivers
deltaX = 0;
deltaY = e.wheelDelta;
}
if (e.shiftKey) {
// reverse axis with shift key
return [-deltaY, -deltaX];
}
return [deltaX, deltaY];
}
function shouldBeConsumedByChild(target, deltaX, deltaY) {
// FIXME: this is a workaround for <select> issue in FF and IE #571
if (!env.isWebKit && element.querySelector('select:focus')) {
return true;
}
if (!element.contains(target)) {
return false;
}
var cursor = target;
while (cursor && cursor !== element) {
if (cursor.classList.contains(cls.element.consuming)) {
return true;
}
var style = get(cursor);
var overflow = [style.overflow, style.overflowX, style.overflowY].join(
''
);
// if scrollable
if (overflow.match(/(scroll|auto)/)) {
var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
if (maxScrollTop > 0) {
if (
!(cursor.scrollTop === 0 && deltaY > 0) &&
!(cursor.scrollTop === maxScrollTop && deltaY < 0)
) {
return true;
}
}
var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
if (maxScrollLeft > 0) {
if (
!(cursor.scrollLeft === 0 && deltaX < 0) &&
!(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
) {
return true;
}
}
}
cursor = cursor.parentNode;
}
return false;
}
function mousewheelHandler(e) {
var ref = getDeltaFromEvent(e);
var deltaX = ref[0];
var deltaY = ref[1];
if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {
return;
}
var shouldPrevent = false;
if (!i.settings.useBothWheelAxes) {
// deltaX will only be used for horizontal scrolling and deltaY will
// only be used for vertical scrolling - this is the default
element.scrollTop -= deltaY * i.settings.wheelSpeed;
element.scrollLeft += deltaX * i.settings.wheelSpeed;
} else if (i.scrollbarYActive && !i.scrollbarXActive) {
// only vertical scrollbar is active and useBothWheelAxes option is
// active, so let's scroll vertical bar using both mouse wheel axes
if (deltaY) {
element.scrollTop -= deltaY * i.settings.wheelSpeed;
} else {
element.scrollTop += deltaX * i.settings.wheelSpeed;
}
shouldPrevent = true;
} else if (i.scrollbarXActive && !i.scrollbarYActive) {
// useBothWheelAxes and only horizontal bar is active, so use both
// wheel axes for horizontal bar
if (deltaX) {
element.scrollLeft += deltaX * i.settings.wheelSpeed;
} else {
element.scrollLeft -= deltaY * i.settings.wheelSpeed;
}
shouldPrevent = true;
}
updateGeometry(i);
shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);
if (shouldPrevent && !e.ctrlKey) {
e.stopPropagation();
e.preventDefault();
}
}
if (typeof window.onwheel !== 'undefined') {
i.event.bind(element, 'wheel', mousewheelHandler);
} else if (typeof window.onmousewheel !== 'undefined') {
i.event.bind(element, 'mousewheel', mousewheelHandler);
}
};
var touch = function(i) {
if (!env.supportsTouch && !env.supportsIePointer) {
return;
}
var element = i.element;
function shouldPrevent(deltaX, deltaY) {
var scrollTop = Math.floor(element.scrollTop);
var scrollLeft = element.scrollLeft;
var magnitudeX = Math.abs(deltaX);
var magnitudeY = Math.abs(deltaY);
if (magnitudeY > magnitudeX) {
// user is perhaps trying to swipe up/down the page
if (
(deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||
(deltaY > 0 && scrollTop === 0)
) {
// set prevent for mobile Chrome refresh
return window.scrollY === 0 && deltaY > 0 && env.isChrome;
}
} else if (magnitudeX > magnitudeY) {
// user is perhaps trying to swipe left/right across the page
if (
(deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||
(deltaX > 0 && scrollLeft === 0)
) {
return true;
}
}
return true;
}
function applyTouchMove(differenceX, differenceY) {
element.scrollTop -= differenceY;
element.scrollLeft -= differenceX;
updateGeometry(i);
}
var startOffset = {};
var startTime = 0;
var speed = {};
var easingLoop = null;
function getTouch(e) {
if (e.targetTouches) {
return e.targetTouches[0];
} else {
// Maybe IE pointer
return e;
}
}
function shouldHandle(e) {
if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {
return false;
}
if (e.targetTouches && e.targetTouches.length === 1) {
return true;
}
if (
e.pointerType &&
e.pointerType !== 'mouse' &&
e.pointerType !== e.MSPOINTER_TYPE_MOUSE
) {
return true;
}
return false;
}
function touchStart(e) {
if (!shouldHandle(e)) {
return;
}
var touch = getTouch(e);
startOffset.pageX = touch.pageX;
startOffset.pageY = touch.pageY;
startTime = new Date().getTime();
if (easingLoop !== null) {
clearInterval(easingLoop);
}
}
function shouldBeConsumedByChild(target, deltaX, deltaY) {
if (!element.contains(target)) {
return false;
}
var cursor = target;
while (cursor && cursor !== element) {
if (cursor.classList.contains(cls.element.consuming)) {
return true;
}
var style = get(cursor);
var overflow = [style.overflow, style.overflowX, style.overflowY].join(
''
);
// if scrollable
if (overflow.match(/(scroll|auto)/)) {
var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
if (maxScrollTop > 0) {
if (
!(cursor.scrollTop === 0 && deltaY > 0) &&
!(cursor.scrollTop === maxScrollTop && deltaY < 0)
) {
return true;
}
}
var maxScrollLeft = cursor.scrollLeft - cursor.clientWidth;
if (maxScrollLeft > 0) {
if (
!(cursor.scrollLeft === 0 && deltaX < 0) &&
!(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
) {
return true;
}
}
}
cursor = cursor.parentNode;
}
return false;
}
function touchMove(e) {
if (shouldHandle(e)) {
var touch = getTouch(e);
var currentOffset = { pageX: touch.pageX, pageY: touch.pageY };
var differenceX = currentOffset.pageX - startOffset.pageX;
var differenceY = currentOffset.pageY - startOffset.pageY;
if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {
return;
}
applyTouchMove(differenceX, differenceY);
startOffset = currentOffset;
var currentTime = new Date().getTime();
var timeGap = currentTime - startTime;
if (timeGap > 0) {
speed.x = differenceX / timeGap;
speed.y = differenceY / timeGap;
startTime = currentTime;
}
if (shouldPrevent(differenceX, differenceY)) {
e.preventDefault();
}
}
}
function touchEnd() {
if (i.settings.swipeEasing) {
clearInterval(easingLoop);
easingLoop = setInterval(function() {
if (i.isInitialized) {
clearInterval(easingLoop);
return;
}
if (!speed.x && !speed.y) {
clearInterval(easingLoop);
return;
}
if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
clearInterval(easingLoop);
return;
}
applyTouchMove(speed.x * 30, speed.y * 30);
speed.x *= 0.8;
speed.y *= 0.8;
}, 10);
}
}
if (env.supportsTouch) {
i.event.bind(element, 'touchstart', touchStart);
i.event.bind(element, 'touchmove', touchMove);
i.event.bind(element, 'touchend', touchEnd);
} else if (env.supportsIePointer) {
if (window.PointerEvent) {
i.event.bind(element, 'pointerdown', touchStart);
i.event.bind(element, 'pointermove', touchMove);
i.event.bind(element, 'pointerup', touchEnd);
} else if (window.MSPointerEvent) {
i.event.bind(element, 'MSPointerDown', touchStart);
i.event.bind(element, 'MSPointerMove', touchMove);
i.event.bind(element, 'MSPointerUp', touchEnd);
}
}
};
var defaultSettings = function () { return ({
handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],
maxScrollbarLength: null,
minScrollbarLength: null,
scrollingThreshold: 1000,
scrollXMarginOffset: 0,
scrollYMarginOffset: 0,
suppressScrollX: false,
suppressScrollY: false,
swipeEasing: true,
useBothWheelAxes: false,
wheelPropagation: true,
wheelSpeed: 1,
}); };
var handlers = {
'click-rail': clickRail,
'drag-thumb': dragThumb,
keyboard: keyboard,
wheel: wheel,
touch: touch,
};
var PerfectScrollbar = function PerfectScrollbar(element, userSettings) {
var this$1 = this;
if ( userSettings === void 0 ) userSettings = {};
if (typeof element === 'string') {
element = document.querySelector(element);
}
if (!element || !element.nodeName) {
throw new Error('no element is specified to initialize PerfectScrollbar');
}
this.element = element;
element.classList.add(cls.main);
this.settings = defaultSettings();
for (var key in userSettings) {
this$1.settings[key] = userSettings[key];
}
this.containerWidth = null;
this.containerHeight = null;
this.contentWidth = null;
this.contentHeight = null;
var focus = function () { return element.classList.add(cls.state.focus); };
var blur = function () { return element.classList.remove(cls.state.focus); };
this.isRtl = get(element).direction === 'rtl';
this.isNegativeScroll = (function () {
var originalScrollLeft = element.scrollLeft;
var result = null;
element.scrollLeft = -1;
result = element.scrollLeft < 0;
element.scrollLeft = originalScrollLeft;
return result;
})();
this.negativeScrollAdjustment = this.isNegativeScroll
? element.scrollWidth - element.clientWidth
: 0;
this.event = new EventManager();
this.ownerDocument = element.ownerDocument || document;
this.scrollbarXRail = div(cls.element.rail('x'));
element.appendChild(this.scrollbarXRail);
this.scrollbarX = div(cls.element.thumb('x'));
this.scrollbarXRail.appendChild(this.scrollbarX);
this.scrollbarX.setAttribute('tabindex', 0);
this.event.bind(this.scrollbarX, 'focus', focus);
this.event.bind(this.scrollbarX, 'blur', blur);
this.scrollbarXActive = null;
this.scrollbarXWidth = null;
this.scrollbarXLeft = null;
var railXStyle = get(this.scrollbarXRail);
this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);
if (isNaN(this.scrollbarXBottom)) {
this.isScrollbarXUsingBottom = false;
this.scrollbarXTop = toInt(railXStyle.top);
} else {
this.isScrollbarXUsingBottom = true;
}
this.railBorderXWidth =
toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);
// Set rail to display:block to calculate margins
set(this.scrollbarXRail, { display: 'block' });
this.railXMarginWidth =
toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);
set(this.scrollbarXRail, { display: '' });
this.railXWidth = null;
this.railXRatio = null;
this.scrollbarYRail = div(cls.element.rail('y'));
element.appendChild(this.scrollbarYRail);
this.scrollbarY = div(cls.element.thumb('y'));
this.scrollbarYRail.appendChild(this.scrollbarY);
this.scrollbarY.setAttribute('tabindex', 0);
this.event.bind(this.scrollbarY, 'focus', focus);
this.event.bind(this.scrollbarY, 'blur', blur);
this.scrollbarYActive = null;
this.scrollbarYHeight = null;
this.scrollbarYTop = null;
var railYStyle = get(this.scrollbarYRail);
this.scrollbarYRight = parseInt(railYStyle.right, 10);
if (isNaN(this.scrollbarYRight)) {
this.isScrollbarYUsingRight = false;
this.scrollbarYLeft = toInt(railYStyle.left);
} else {
this.isScrollbarYUsingRight = true;
}
this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;
this.railBorderYWidth =
toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);
set(this.scrollbarYRail, { display: 'block' });
this.railYMarginHeight =
toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);
set(this.scrollbarYRail, { display: '' });
this.railYHeight = null;
this.railYRatio = null;
this.reach = {
x:
element.scrollLeft <= 0
? 'start'
: element.scrollLeft >= this.contentWidth - this.containerWidth
? 'end'
: null,
y:
element.scrollTop <= 0
? 'start'
: element.scrollTop >= this.contentHeight - this.containerHeight
? 'end'
: null,
};
this.isAlive = true;
this.settings.handlers.forEach(function (handlerName) { return handlers[handlerName](this$1); });
this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only
this.lastScrollLeft = element.scrollLeft; // for onScroll only
this.event.bind(this.element, 'scroll', function (e) { return this$1.onScroll(e); });
updateGeometry(this);
};
PerfectScrollbar.prototype.update = function update () {
if (!this.isAlive) {
return;
}
// Recalcuate negative scrollLeft adjustment
this.negativeScrollAdjustment = this.isNegativeScroll
? this.element.scrollWidth - this.element.clientWidth
: 0;
// Recalculate rail margins
set(this.scrollbarXRail, { display: 'block' });
set(this.scrollbarYRail, { display: 'block' });
this.railXMarginWidth =
toInt(get(this.scrollbarXRail).marginLeft) +
toInt(get(this.scrollbarXRail).marginRight);
this.railYMarginHeight =
toInt(get(this.scrollbarYRail).marginTop) +
toInt(get(this.scrollbarYRail).marginBottom);
// Hide scrollbars not to affect scrollWidth and scrollHeight
set(this.scrollbarXRail, { display: 'none' });
set(this.scrollbarYRail, { display: 'none' });
updateGeometry(this);
processScrollDiff(this, 'top', 0, false, true);
processScrollDiff(this, 'left', 0, false, true);
set(this.scrollbarXRail, { display: '' });
set(this.scrollbarYRail, { display: '' });
};
PerfectScrollbar.prototype.onScroll = function onScroll (e) {
if (!this.isAlive) {
return;
}
updateGeometry(this);
processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);
processScrollDiff(
this,
'left',
this.element.scrollLeft - this.lastScrollLeft
);
this.lastScrollTop = Math.floor(this.element.scrollTop);
this.lastScrollLeft = this.element.scrollLeft;
};
PerfectScrollbar.prototype.destroy = function destroy () {
if (!this.isAlive) {
return;
}
this.event.unbindAll();
remove(this.scrollbarX);
remove(this.scrollbarY);
remove(this.scrollbarXRail);
remove(this.scrollbarYRail);
this.removePsClasses();
// unset elements
this.element = null;
this.scrollbarX = null;
this.scrollbarY = null;
this.scrollbarXRail = null;
this.scrollbarYRail = null;
this.isAlive = false;
};
PerfectScrollbar.prototype.removePsClasses = function removePsClasses () {
this.element.className = this.element.className
.split(' ')
.filter(function (name) { return !name.match(/^ps([-_].+|)$/); })
.join(' ');
};
/* harmony default export */ __webpack_exports__["default"] = (PerfectScrollbar);
/***/ }),
/***/ "./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js":
/*!*************************************************************************!*\
!*** ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js ***!
\*************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* A collection of shims that provide minimal functionality of the ES6 collections.
*
* These implementations are not meant to be used outside of the ResizeObserver
* modules as they cover only a limited range of use cases.
*/
/* eslint-disable require-jsdoc, valid-jsdoc */
var MapShim = (function () {
if (typeof Map !== 'undefined') {
return Map;
}
/**
* Returns index in provided array that matches the specified key.
*
* @param {Array<Array>} arr
* @param {*} key
* @returns {number}
*/
function getIndex(arr, key) {
var result = -1;
arr.some(function (entry, index) {
if (entry[0] === key) {
result = index;
return true;
}
return false;
});
return result;
}
return (function () {
function anonymous() {
this.__entries__ = [];
}
var prototypeAccessors = { size: { configurable: true } };
/**
* @returns {boolean}
*/
prototypeAccessors.size.get = function () {
return this.__entries__.length;
};
/**
* @param {*} key
* @returns {*}
*/
anonymous.prototype.get = function (key) {
var index = getIndex(this.__entries__, key);
var entry = this.__entries__[index];
return entry && entry[1];
};
/**
* @param {*} key
* @param {*} value
* @returns {void}
*/
anonymous.prototype.set = function (key, value) {
var index = getIndex(this.__entries__, key);
if (~index) {
this.__entries__[index][1] = value;
} else {
this.__entries__.push([key, value]);
}
};
/**
* @param {*} key
* @returns {void}
*/
anonymous.prototype.delete = function (key) {
var entries = this.__entries__;
var index = getIndex(entries, key);
if (~index) {
entries.splice(index, 1);
}
};
/**
* @param {*} key
* @returns {void}
*/
anonymous.prototype.has = function (key) {
return !!~getIndex(this.__entries__, key);
};
/**
* @returns {void}
*/
anonymous.prototype.clear = function () {
this.__entries__.splice(0);
};
/**
* @param {Function} callback
* @param {*} [ctx=null]
* @returns {void}
*/
anonymous.prototype.forEach = function (callback, ctx) {
var this$1 = this;
if ( ctx === void 0 ) ctx = null;
for (var i = 0, list = this$1.__entries__; i < list.length; i += 1) {
var entry = list[i];
callback.call(ctx, entry[1], entry[0]);
}
};
Object.defineProperties( anonymous.prototype, prototypeAccessors );
return anonymous;
}());
})();
/**
* Detects whether window and document objects are available in current environment.
*/
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
// Returns global object of a current environment.
var global$1 = (function () {
if (typeof global !== 'undefined' && global.Math === Math) {
return global;
}
if (typeof self !== 'undefined' && self.Math === Math) {
return self;
}
if (typeof window !== 'undefined' && window.Math === Math) {
return window;
}
// eslint-disable-next-line no-new-func
return Function('return this')();
})();
/**
* A shim for the requestAnimationFrame which falls back to the setTimeout if
* first one is not supported.
*
* @returns {number} Requests' identifier.
*/
var requestAnimationFrame$1 = (function () {
if (typeof requestAnimationFrame === 'function') {
// It's required to use a bounded function because IE sometimes throws
// an "Invalid calling object" error if rAF is invoked without the global
// object on the left hand side.
return requestAnimationFrame.bind(global$1);
}
return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
})();
// Defines minimum timeout before adding a trailing call.
var trailingTimeout = 2;
/**
* Creates a wrapper function which ensures that provided callback will be
* invoked only once during the specified delay period.
*
* @param {Function} callback - Function to be invoked after the delay period.
* @param {number} delay - Delay after which to invoke callback.
* @returns {Function}
*/
var throttle = function (callback, delay) {
var leadingCall = false,
trailingCall = false,
lastCallTime = 0;
/**
* Invokes the original callback function and schedules new invocation if
* the "proxy" was called during current request.
*
* @returns {void}
*/
function resolvePending() {
if (leadingCall) {
leadingCall = false;
callback();
}
if (trailingCall) {
proxy();
}
}
/**
* Callback invoked after the specified delay. It will further postpone
* invocation of the original function delegating it to the
* requestAnimationFrame.
*
* @returns {void}
*/
function timeoutCallback() {
requestAnimationFrame$1(resolvePending);
}
/**
* Schedules invocation of the original function.
*
* @returns {void}
*/
function proxy() {
var timeStamp = Date.now();
if (leadingCall) {
// Reject immediately following calls.
if (timeStamp - lastCallTime < trailingTimeout) {
return;
}
// Schedule new call to be in invoked when the pending one is resolved.
// This is important for "transitions" which never actually start
// immediately so there is a chance that we might miss one if change
// happens amids the pending invocation.
trailingCall = true;
} else {
leadingCall = true;
trailingCall = false;
setTimeout(timeoutCallback, delay);
}
lastCallTime = timeStamp;
}
return proxy;
};
// Minimum delay before invoking the update of observers.
var REFRESH_DELAY = 20;
// A list of substrings of CSS properties used to find transition events that
// might affect dimensions of observed elements.
var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
// Check if MutationObserver is available.
var mutationObserverSupported = typeof MutationObserver !== 'undefined';
/**
* Singleton controller class which handles updates of ResizeObserver instances.
*/
var ResizeObserverController = function() {
this.connected_ = false;
this.mutationEventsAdded_ = false;
this.mutationsObserver_ = null;
this.observers_ = [];
this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
};
/**
* Adds observer to observers list.
*
* @param {ResizeObserverSPI} observer - Observer to be added.
* @returns {void}
*/
/**
* Holds reference to the controller's instance.
*
* @private {ResizeObserverController}
*/
/**
* Keeps reference to the instance of MutationObserver.
*
* @private {MutationObserver}
*/
/**
* Indicates whether DOM listeners have been added.
*
* @private {boolean}
*/
ResizeObserverController.prototype.addObserver = function (observer) {
if (!~this.observers_.indexOf(observer)) {
this.observers_.push(observer);
}
// Add listeners if they haven't been added yet.
if (!this.connected_) {
this.connect_();
}
};
/**
* Removes observer from observers list.
*
* @param {ResizeObserverSPI} observer - Observer to be removed.
* @returns {void}
*/
ResizeObserverController.prototype.removeObserver = function (observer) {
var observers = this.observers_;
var index = observers.indexOf(observer);
// Remove observer if it's present in registry.
if (~index) {
observers.splice(index, 1);
}
// Remove listeners if controller has no connected observers.
if (!observers.length && this.connected_) {
this.disconnect_();
}
};
/**
* Invokes the update of observers. It will continue running updates insofar
* it detects changes.
*
* @returns {void}
*/
ResizeObserverController.prototype.refresh = function () {
var changesDetected = this.updateObservers_();
// Continue running updates if changes have been detected as there might
// be future ones caused by CSS transitions.
if (changesDetected) {
this.refresh();
}
};
/**
* Updates every observer from observers list and notifies them of queued
* entries.
*
* @private
* @returns {boolean} Returns "true" if any observer has detected changes in
* dimensions of it's elements.
*/
ResizeObserverController.prototype.updateObservers_ = function () {
// Collect observers that have active observations.
var activeObservers = this.observers_.filter(function (observer) {
return observer.gatherActive(), observer.hasActive();
});
// Deliver notifications in a separate cycle in order to avoid any
// collisions between observers, e.g. when multiple instances of
// ResizeObserver are tracking the same element and the callback of one
// of them changes content dimensions of the observed target. Sometimes
// this may result in notifications being blocked for the rest of observers.
activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
return activeObservers.length > 0;
};
/**
* Initializes DOM listeners.
*
* @private
* @returns {void}
*/
ResizeObserverController.prototype.connect_ = function () {
// Do nothing if running in a non-browser environment or if listeners
// have been already added.
if (!isBrowser || this.connected_) {
return;
}
// Subscription to the "Transitionend" event is used as a workaround for
// delayed transitions. This way it's possible to capture at least the
// final state of an element.
document.addEventListener('transitionend', this.onTransitionEnd_);
window.addEventListener('resize', this.refresh);
if (mutationObserverSupported) {
this.mutationsObserver_ = new MutationObserver(this.refresh);
this.mutationsObserver_.observe(document, {
attributes: true,
childList: true,
characterData: true,
subtree: true
});
} else {
document.addEventListener('DOMSubtreeModified', this.refresh);
this.mutationEventsAdded_ = true;
}
this.connected_ = true;
};
/**
* Removes DOM listeners.
*
* @private
* @returns {void}
*/
ResizeObserverController.prototype.disconnect_ = function () {
// Do nothing if running in a non-browser environment or if listeners
// have been already removed.
if (!isBrowser || !this.connected_) {
return;
}
document.removeEventListener('transitionend', this.onTransitionEnd_);
window.removeEventListener('resize', this.refresh);
if (this.mutationsObserver_) {
this.mutationsObserver_.disconnect();
}
if (this.mutationEventsAdded_) {
document.removeEventListener('DOMSubtreeModified', this.refresh);
}
this.mutationsObserver_ = null;
this.mutationEventsAdded_ = false;
this.connected_ = false;
};
/**
* "Transitionend" event handler.
*
* @private
* @param {TransitionEvent} event
* @returns {void}
*/
ResizeObserverController.prototype.onTransitionEnd_ = function (ref) {
var propertyName = ref.propertyName; if ( propertyName === void 0 ) propertyName = '';
// Detect whether transition may affect dimensions of an element.
var isReflowProperty = transitionKeys.some(function (key) {
return !!~propertyName.indexOf(key);
});
if (isReflowProperty) {
this.refresh();
}
};
/**
* Returns instance of the ResizeObserverController.
*
* @returns {ResizeObserverController}
*/
ResizeObserverController.getInstance = function () {
if (!this.instance_) {
this.instance_ = new ResizeObserverController();
}
return this.instance_;
};
ResizeObserverController.instance_ = null;
/**
* Defines non-writable/enumerable properties of the provided target object.
*
* @param {Object} target - Object for which to define properties.
* @param {Object} props - Properties to be defined.
* @returns {Object} Target object.
*/
var defineConfigurable = (function (target, props) {
for (var i = 0, list = Object.keys(props); i < list.length; i += 1) {
var key = list[i];
Object.defineProperty(target, key, {
value: props[key],
enumerable: false,
writable: false,
configurable: true
});
}
return target;
});
/**
* Returns the global object associated with provided element.
*
* @param {Object} target
* @returns {Object}
*/
var getWindowOf = (function (target) {
// Assume that the element is an instance of Node, which means that it
// has the "ownerDocument" property from which we can retrieve a
// corresponding global object.
var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
// Return the local global object if it's not possible extract one from
// provided element.
return ownerGlobal || global$1;
});
// Placeholder of an empty content rectangle.
var emptyRect = createRectInit(0, 0, 0, 0);
/**
* Converts provided string to a number.
*
* @param {number|string} value
* @returns {number}
*/
function toFloat(value) {
return parseFloat(value) || 0;
}
/**
* Extracts borders size from provided styles.
*
* @param {CSSStyleDeclaration} styles
* @param {...string} positions - Borders positions (top, right, ...)
* @returns {number}
*/
function getBordersSize(styles) {
var positions = [], len = arguments.length - 1;
while ( len-- > 0 ) positions[ len ] = arguments[ len + 1 ];
return positions.reduce(function (size, position) {
var value = styles['border-' + position + '-width'];
return size + toFloat(value);
}, 0);
}
/**
* Extracts paddings sizes from provided styles.
*
* @param {CSSStyleDeclaration} styles
* @returns {Object} Paddings box.
*/
function getPaddings(styles) {
var positions = ['top', 'right', 'bottom', 'left'];
var paddings = {};
for (var i = 0, list = positions; i < list.length; i += 1) {
var position = list[i];
var value = styles['padding-' + position];
paddings[position] = toFloat(value);
}
return paddings;
}
/**
* Calculates content rectangle of provided SVG element.
*
* @param {SVGGraphicsElement} target - Element content rectangle of which needs
* to be calculated.
* @returns {DOMRectInit}
*/
function getSVGContentRect(target) {
var bbox = target.getBBox();
return createRectInit(0, 0, bbox.width, bbox.height);
}
/**
* Calculates content rectangle of provided HTMLElement.
*
* @param {HTMLElement} target - Element for which to calculate the content rectangle.
* @returns {DOMRectInit}
*/
function getHTMLElementContentRect(target) {
// Client width & height properties can't be
// used exclusively as they provide rounded values.
var clientWidth = target.clientWidth;
var clientHeight = target.clientHeight;
// By this condition we can catch all non-replaced inline, hidden and
// detached elements. Though elements with width & height properties less
// than 0.5 will be discarded as well.
//
// Without it we would need to implement separate methods for each of
// those cases and it's not possible to perform a precise and performance
// effective test for hidden elements. E.g. even jQuery's ':visible' filter
// gives wrong results for elements with width & height less than 0.5.
if (!clientWidth && !clientHeight) {
return emptyRect;
}
var styles = getWindowOf(target).getComputedStyle(target);
var paddings = getPaddings(styles);
var horizPad = paddings.left + paddings.right;
var vertPad = paddings.top + paddings.bottom;
// Computed styles of width & height are being used because they are the
// only dimensions available to JS that contain non-rounded values. It could
// be possible to utilize the getBoundingClientRect if only it's data wasn't
// affected by CSS transformations let alone paddings, borders and scroll bars.
var width = toFloat(styles.width),
height = toFloat(styles.height);
// Width & height include paddings and borders when the 'border-box' box
// model is applied (except for IE).
if (styles.boxSizing === 'border-box') {
// Following conditions are required to handle Internet Explorer which
// doesn't include paddings and borders to computed CSS dimensions.
//
// We can say that if CSS dimensions + paddings are equal to the "client"
// properties then it's either IE, and thus we don't need to subtract
// anything, or an element merely doesn't have paddings/borders styles.
if (Math.round(width + horizPad) !== clientWidth) {
width -= getBordersSize(styles, 'left', 'right') + horizPad;
}
if (Math.round(height + vertPad) !== clientHeight) {
height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
}
}
// Following steps can't be applied to the document's root element as its
// client[Width/Height] properties represent viewport area of the window.
// Besides, it's as well not necessary as the <html> itself neither has
// rendered scroll bars nor it can be clipped.
if (!isDocumentElement(target)) {
// In some browsers (only in Firefox, actually) CSS width & height
// include scroll bars size which can be removed at this step as scroll
// bars are the only difference between rounded dimensions + paddings
// and "client" properties, though that is not always true in Chrome.
var vertScrollbar = Math.round(width + horizPad) - clientWidth;
var horizScrollbar = Math.round(height + vertPad) - clientHeight;
// Chrome has a rather weird rounding of "client" properties.
// E.g. for an element with content width of 314.2px it sometimes gives
// the client width of 315px and for the width of 314.7px it may give
// 314px. And it doesn't happen all the time. So just ignore this delta
// as a non-relevant.
if (Math.abs(vertScrollbar) !== 1) {
width -= vertScrollbar;
}
if (Math.abs(horizScrollbar) !== 1) {
height -= horizScrollbar;
}
}
return createRectInit(paddings.left, paddings.top, width, height);
}
/**
* Checks whether provided element is an instance of the SVGGraphicsElement.
*
* @param {Element} target - Element to be checked.
* @returns {boolean}
*/
var isSVGGraphicsElement = (function () {
// Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
// interface.
if (typeof SVGGraphicsElement !== 'undefined') {
return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
}
// If it's so, then check that element is at least an instance of the
// SVGElement and that it has the "getBBox" method.
// eslint-disable-next-line no-extra-parens
return function (target) { return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === 'function'; };
})();
/**
* Checks whether provided element is a document element (<html>).
*
* @param {Element} target - Element to be checked.
* @returns {boolean}
*/
function isDocumentElement(target) {
return target === getWindowOf(target).document.documentElement;
}
/**
* Calculates an appropriate content rectangle for provided html or svg element.
*
* @param {Element} target - Element content rectangle of which needs to be calculated.
* @returns {DOMRectInit}
*/
function getContentRect(target) {
if (!isBrowser) {
return emptyRect;
}
if (isSVGGraphicsElement(target)) {
return getSVGContentRect(target);
}
return getHTMLElementContentRect(target);
}
/**
* Creates rectangle with an interface of the DOMRectReadOnly.
* Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
*
* @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
* @returns {DOMRectReadOnly}
*/
function createReadOnlyRect(ref) {
var x = ref.x;
var y = ref.y;
var width = ref.width;
var height = ref.height;
// If DOMRectReadOnly is available use it as a prototype for the rectangle.
var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
var rect = Object.create(Constr.prototype);
// Rectangle's properties are not writable and non-enumerable.
defineConfigurable(rect, {
x: x, y: y, width: width, height: height,
top: y,
right: x + width,
bottom: height + y,
left: x
});
return rect;
}
/**
* Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
* Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
*
* @param {number} x - X coordinate.
* @param {number} y - Y coordinate.
* @param {number} width - Rectangle's width.
* @param {number} height - Rectangle's height.
* @returns {DOMRectInit}
*/
function createRectInit(x, y, width, height) {
return { x: x, y: y, width: width, height: height };
}
/**
* Class that is responsible for computations of the content rectangle of
* provided DOM element and for keeping track of it's changes.
*/
var ResizeObservation = function(target) {
this.broadcastWidth = 0;
this.broadcastHeight = 0;
this.contentRect_ = createRectInit(0, 0, 0, 0);
this.target = target;
};
/**
* Updates content rectangle and tells whether it's width or height properties
* have changed since the last broadcast.
*
* @returns {boolean}
*/
/**
* Reference to the last observed content rectangle.
*
* @private {DOMRectInit}
*/
/**
* Broadcasted width of content rectangle.
*
* @type {number}
*/
ResizeObservation.prototype.isActive = function () {
var rect = getContentRect(this.target);
this.contentRect_ = rect;
return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
};
/**
* Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
* from the corresponding properties of the last observed content rectangle.
*
* @returns {DOMRectInit} Last observed content rectangle.
*/
ResizeObservation.prototype.broadcastRect = function () {
var rect = this.contentRect_;
this.broadcastWidth = rect.width;
this.broadcastHeight = rect.height;
return rect;
};
var ResizeObserverEntry = function(target, rectInit) {
var contentRect = createReadOnlyRect(rectInit);
// According to the specification following properties are not writable
// and are also not enumerable in the native implementation.
//
// Property accessors are not being used as they'd require to define a
// private WeakMap storage which may cause memory leaks in browsers that
// don't support this type of collections.
defineConfigurable(this, { target: target, contentRect: contentRect });
};
var ResizeObserverSPI = function(callback, controller, callbackCtx) {
this.activeObservations_ = [];
this.observations_ = new MapShim();
if (typeof callback !== 'function') {
throw new TypeError('The callback provided as parameter 1 is not a function.');
}
this.callback_ = callback;
this.controller_ = controller;
this.callbackCtx_ = callbackCtx;
};
/**
* Starts observing provided element.
*
* @param {Element} target - Element to be observed.
* @returns {void}
*/
/**
* Registry of the ResizeObservation instances.
*
* @private {Map<Element, ResizeObservation>}
*/
/**
* Public ResizeObserver instance which will be passed to the callback
* function and used as a value of it's "this" binding.
*
* @private {ResizeObserver}
*/
/**
* Collection of resize observations that have detected changes in dimensions
* of elements.
*
* @private {Array<ResizeObservation>}
*/
ResizeObserverSPI.prototype.observe = function (target) {
if (!arguments.length) {
throw new TypeError('1 argument required, but only 0 present.');
}
// Do nothing if current environment doesn't have the Element interface.
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
return;
}
if (!(target instanceof getWindowOf(target).Element)) {
throw new TypeError('parameter 1 is not of type "Element".');
}
var observations = this.observations_;
// Do nothing if element is already being observed.
if (observations.has(target)) {
return;
}
observations.set(target, new ResizeObservation(target));
this.controller_.addObserver(this);
// Force the update of observations.
this.controller_.refresh();
};
/**
* Stops observing provided element.
*
* @param {Element} target - Element to stop observing.
* @returns {void}
*/
ResizeObserverSPI.prototype.unobserve = function (target) {
if (!arguments.length) {
throw new TypeError('1 argument required, but only 0 present.');
}
// Do nothing if current environment doesn't have the Element interface.
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
return;
}
if (!(target instanceof getWindowOf(target).Element)) {
throw new TypeError('parameter 1 is not of type "Element".');
}
var observations = this.observations_;
// Do nothing if element is not being observed.
if (!observations.has(target)) {
return;
}
observations.delete(target);
if (!observations.size) {
this.controller_.removeObserver(this);
}
};
/**
* Stops observing all elements.
*
* @returns {void}
*/
ResizeObserverSPI.prototype.disconnect = function () {
this.clearActive();
this.observations_.clear();
this.controller_.removeObserver(this);
};
/**
* Collects observation instances the associated element of which has changed
* it's content rectangle.
*
* @returns {void}
*/
ResizeObserverSPI.prototype.gatherActive = function () {
var this$1 = this;
this.clearActive();
this.observations_.forEach(function (observation) {
if (observation.isActive()) {
this$1.activeObservations_.push(observation);
}
});
};
/**
* Invokes initial callback function with a list of ResizeObserverEntry
* instances collected from active resize observations.
*
* @returns {void}
*/
ResizeObserverSPI.prototype.broadcastActive = function () {
// Do nothing if observer doesn't have active observations.
if (!this.hasActive()) {
return;
}
var ctx = this.callbackCtx_;
// Create ResizeObserverEntry instance for every active observation.
var entries = this.activeObservations_.map(function (observation) {
return new ResizeObserverEntry(observation.target, observation.broadcastRect());
});
this.callback_.call(ctx, entries, ctx);
this.clearActive();
};
/**
* Clears the collection of active observations.
*
* @returns {void}
*/
ResizeObserverSPI.prototype.clearActive = function () {
this.activeObservations_.splice(0);
};
/**
* Tells whether observer has active observations.
*
* @returns {boolean}
*/
ResizeObserverSPI.prototype.hasActive = function () {
return this.activeObservations_.length > 0;
};
// Registry of internal observers. If WeakMap is not available use current shim
// for the Map collection as it has all required methods and because WeakMap
// can't be fully polyfilled anyway.
var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
/**
* ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
* exposing only those methods and properties that are defined in the spec.
*/
var ResizeObserver = function(callback) {
if (!(this instanceof ResizeObserver)) {
throw new TypeError('Cannot call a class as a function.');
}
if (!arguments.length) {
throw new TypeError('1 argument required, but only 0 present.');
}
var controller = ResizeObserverController.getInstance();
var observer = new ResizeObserverSPI(callback, controller, this);
observers.set(this, observer);
};
// Expose public methods of ResizeObserver.
['observe', 'unobserve', 'disconnect'].forEach(function (method) {
ResizeObserver.prototype[method] = function () {
return (ref = observers.get(this))[method].apply(ref, arguments);
var ref;
};
});
var index = (function () {
// Export existing implementation if available.
if (typeof global$1.ResizeObserver !== 'undefined') {
return global$1.ResizeObserver;
}
return ResizeObserver;
})();
/* harmony default export */ __webpack_exports__["default"] = (index);
/***/ }),
/***/ "./node_modules/rxjs-compat/_esm5/BehaviorSubject.js":
/*!***********************************************************!*\
!*** ./node_modules/rxjs-compat/_esm5/BehaviorSubject.js ***!
\***********************************************************/
/*! exports provided: BehaviorSubject */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return rxjs__WEBPACK_IMPORTED_MODULE_0__["BehaviorSubject"]; });
//# sourceMappingURL=BehaviorSubject.js.map
/***/ }),
/***/ "./node_modules/rxjs-compat/_esm5/Observable.js":
/*!******************************************************!*\
!*** ./node_modules/rxjs-compat/_esm5/Observable.js ***!
\******************************************************/
/*! exports provided: Observable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return rxjs__WEBPACK_IMPORTED_MODULE_0__["Observable"]; });
//# sourceMappingURL=Observable.js.map
/***/ }),
/***/ "./node_modules/rxjs-compat/_esm5/ReplaySubject.js":
/*!*********************************************************!*\
!*** ./node_modules/rxjs-compat/_esm5/ReplaySubject.js ***!
\*********************************************************/
/*! exports provided: ReplaySubject */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return rxjs__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"]; });
//# sourceMappingURL=ReplaySubject.js.map
/***/ }),
/***/ "./node_modules/rxjs-compat/_esm5/Subject.js":
/*!***************************************************!*\
!*** ./node_modules/rxjs-compat/_esm5/Subject.js ***!
\***************************************************/
/*! exports provided: Subject */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return rxjs__WEBPACK_IMPORTED_MODULE_0__["Subject"]; });
//# sourceMappingURL=Subject.js.map
/***/ }),
/***/ "./node_modules/rxjs-compat/_esm5/add/operator/takeUntil.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs-compat/_esm5/add/operator/takeUntil.js ***!
\******************************************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _operator_takeUntil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../operator/takeUntil */ "./node_modules/rxjs-compat/_esm5/operator/takeUntil.js");
rxjs__WEBPACK_IMPORTED_MODULE_0__["Observable"].prototype.takeUntil = _operator_takeUntil__WEBPACK_IMPORTED_MODULE_1__["takeUntil"];
//# sourceMappingURL=takeUntil.js.map
/***/ }),
/***/ "./node_modules/rxjs-compat/_esm5/operator/takeUntil.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs-compat/_esm5/operator/takeUntil.js ***!
\**************************************************************/
/*! exports provided: takeUntil */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return takeUntil; });
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/**
* Emits the values emitted by the source Observable until a `notifier`
* Observable emits a value.
*
* <span class="informal">Lets values pass until a second Observable,
* `notifier`, emits a value. Then, it completes.</span>
*
* <img src="./img/takeUntil.png" width="100%">
*
* `takeUntil` subscribes and begins mirroring the source Observable. It also
* monitors a second Observable, `notifier` that you provide. If the `notifier`
* emits a value, the output Observable stops mirroring the source Observable
* and completes. If the `notifier` doesn't emit any value and completes
* then `takeUntil` will pass all values.
*
* @example <caption>Tick every second until the first click happens</caption>
* var interval = Rx.Observable.interval(1000);
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = interval.takeUntil(clicks);
* result.subscribe(x => console.log(x));
*
* @see {@link take}
* @see {@link takeLast}
* @see {@link takeWhile}
* @see {@link skip}
*
* @param {Observable} notifier The Observable whose first emitted value will
* cause the output Observable of `takeUntil` to stop emitting values from the
* source Observable.
* @return {Observable<T>} An Observable that emits the values from the source
* Observable until such time as `notifier` emits its first value.
* @method takeUntil
* @owner Observable
*/
function takeUntil(notifier) {
return Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_0__["takeUntil"])(notifier)(this);
}
//# sourceMappingURL=takeUntil.js.map
/***/ }),
/***/ "./node_modules/rxjs-compat/_esm5/operators/filter.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs-compat/_esm5/operators/filter.js ***!
\************************************************************/
/*! exports provided: filter */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return rxjs_operators__WEBPACK_IMPORTED_MODULE_0__["filter"]; });
//# sourceMappingURL=filter.js.map
/***/ }),
/***/ "./node_modules/rxjs-compat/_esm5/operators/map.js":
/*!*********************************************************!*\
!*** ./node_modules/rxjs-compat/_esm5/operators/map.js ***!
\*********************************************************/
/*! exports provided: map */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return rxjs_operators__WEBPACK_IMPORTED_MODULE_0__["map"]; });
//# sourceMappingURL=map.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/index.js":
/*!******************************************!*\
!*** ./node_modules/rxjs/_esm5/index.js ***!
\******************************************/
/*! exports provided: Observable, ConnectableObservable, GroupedObservable, observable, Subject, BehaviorSubject, ReplaySubject, AsyncSubject, asapScheduler, asyncScheduler, queueScheduler, animationFrameScheduler, VirtualTimeScheduler, VirtualAction, Scheduler, Subscription, Subscriber, Notification, pipe, noop, identity, isObservable, ArgumentOutOfRangeError, EmptyError, ObjectUnsubscribedError, UnsubscriptionError, TimeoutError, bindCallback, bindNodeCallback, combineLatest, concat, defer, empty, forkJoin, from, fromEvent, fromEventPattern, generate, iif, interval, merge, never, of, onErrorResumeNext, pairs, race, range, throwError, timer, using, zip, EMPTY, NEVER, config */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _internal_Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./internal/Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return _internal_Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]; });
/* harmony import */ var _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internal/observable/ConnectableObservable */ "./node_modules/rxjs/_esm5/internal/observable/ConnectableObservable.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__["ConnectableObservable"]; });
/* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./internal/operators/groupBy */ "./node_modules/rxjs/_esm5/internal/operators/groupBy.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__["GroupedObservable"]; });
/* harmony import */ var _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./internal/symbol/observable */ "./node_modules/rxjs/_esm5/internal/symbol/observable.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__["observable"]; });
/* harmony import */ var _internal_Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./internal/Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return _internal_Subject__WEBPACK_IMPORTED_MODULE_4__["Subject"]; });
/* harmony import */ var _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./internal/BehaviorSubject */ "./node_modules/rxjs/_esm5/internal/BehaviorSubject.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__["BehaviorSubject"]; });
/* harmony import */ var _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./internal/ReplaySubject */ "./node_modules/rxjs/_esm5/internal/ReplaySubject.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__["ReplaySubject"]; });
/* harmony import */ var _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./internal/AsyncSubject */ "./node_modules/rxjs/_esm5/internal/AsyncSubject.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__["AsyncSubject"]; });
/* harmony import */ var _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./internal/scheduler/asap */ "./node_modules/rxjs/_esm5/internal/scheduler/asap.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__["asap"]; });
/* harmony import */ var _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./internal/scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asyncScheduler", function() { return _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__["async"]; });
/* harmony import */ var _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./internal/scheduler/queue */ "./node_modules/rxjs/_esm5/internal/scheduler/queue.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "queueScheduler", function() { return _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__["queue"]; });
/* harmony import */ var _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./internal/scheduler/animationFrame */ "./node_modules/rxjs/_esm5/internal/scheduler/animationFrame.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "animationFrameScheduler", function() { return _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__["animationFrame"]; });
/* harmony import */ var _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./internal/scheduler/VirtualTimeScheduler */ "./node_modules/rxjs/_esm5/internal/scheduler/VirtualTimeScheduler.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualTimeScheduler"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualAction"]; });
/* harmony import */ var _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./internal/Scheduler */ "./node_modules/rxjs/_esm5/internal/Scheduler.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__["Scheduler"]; });
/* harmony import */ var _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./internal/Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__["Subscription"]; });
/* harmony import */ var _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./internal/Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__["Subscriber"]; });
/* harmony import */ var _internal_Notification__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./internal/Notification */ "./node_modules/rxjs/_esm5/internal/Notification.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return _internal_Notification__WEBPACK_IMPORTED_MODULE_16__["Notification"]; });
/* harmony import */ var _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./internal/util/pipe */ "./node_modules/rxjs/_esm5/internal/util/pipe.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__["pipe"]; });
/* harmony import */ var _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./internal/util/noop */ "./node_modules/rxjs/_esm5/internal/util/noop.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__["noop"]; });
/* harmony import */ var _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./internal/util/identity */ "./node_modules/rxjs/_esm5/internal/util/identity.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__["identity"]; });
/* harmony import */ var _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./internal/util/isObservable */ "./node_modules/rxjs/_esm5/internal/util/isObservable.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__["isObservable"]; });
/* harmony import */ var _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./internal/util/ArgumentOutOfRangeError */ "./node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__["ArgumentOutOfRangeError"]; });
/* harmony import */ var _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./internal/util/EmptyError */ "./node_modules/rxjs/_esm5/internal/util/EmptyError.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__["EmptyError"]; });
/* harmony import */ var _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./internal/util/ObjectUnsubscribedError */ "./node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__["ObjectUnsubscribedError"]; });
/* harmony import */ var _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./internal/util/UnsubscriptionError */ "./node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__["UnsubscriptionError"]; });
/* harmony import */ var _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./internal/util/TimeoutError */ "./node_modules/rxjs/_esm5/internal/util/TimeoutError.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__["TimeoutError"]; });
/* harmony import */ var _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./internal/observable/bindCallback */ "./node_modules/rxjs/_esm5/internal/observable/bindCallback.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__["bindCallback"]; });
/* harmony import */ var _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./internal/observable/bindNodeCallback */ "./node_modules/rxjs/_esm5/internal/observable/bindNodeCallback.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__["bindNodeCallback"]; });
/* harmony import */ var _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./internal/observable/combineLatest */ "./node_modules/rxjs/_esm5/internal/observable/combineLatest.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__["combineLatest"]; });
/* harmony import */ var _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./internal/observable/concat */ "./node_modules/rxjs/_esm5/internal/observable/concat.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__["concat"]; });
/* harmony import */ var _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./internal/observable/defer */ "./node_modules/rxjs/_esm5/internal/observable/defer.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__["defer"]; });
/* harmony import */ var _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./internal/observable/empty */ "./node_modules/rxjs/_esm5/internal/observable/empty.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["empty"]; });
/* harmony import */ var _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./internal/observable/forkJoin */ "./node_modules/rxjs/_esm5/internal/observable/forkJoin.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__["forkJoin"]; });
/* harmony import */ var _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./internal/observable/from */ "./node_modules/rxjs/_esm5/internal/observable/from.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "from", function() { return _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__["from"]; });
/* harmony import */ var _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./internal/observable/fromEvent */ "./node_modules/rxjs/_esm5/internal/observable/fromEvent.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__["fromEvent"]; });
/* harmony import */ var _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./internal/observable/fromEventPattern */ "./node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__["fromEventPattern"]; });
/* harmony import */ var _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./internal/observable/generate */ "./node_modules/rxjs/_esm5/internal/observable/generate.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__["generate"]; });
/* harmony import */ var _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./internal/observable/iif */ "./node_modules/rxjs/_esm5/internal/observable/iif.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__["iif"]; });
/* harmony import */ var _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./internal/observable/interval */ "./node_modules/rxjs/_esm5/internal/observable/interval.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__["interval"]; });
/* harmony import */ var _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./internal/observable/merge */ "./node_modules/rxjs/_esm5/internal/observable/merge.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__["merge"]; });
/* harmony import */ var _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./internal/observable/never */ "./node_modules/rxjs/_esm5/internal/observable/never.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "never", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["never"]; });
/* harmony import */ var _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./internal/observable/of */ "./node_modules/rxjs/_esm5/internal/observable/of.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "of", function() { return _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__["of"]; });
/* harmony import */ var _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./internal/observable/onErrorResumeNext */ "./node_modules/rxjs/_esm5/internal/observable/onErrorResumeNext.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__["onErrorResumeNext"]; });
/* harmony import */ var _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./internal/observable/pairs */ "./node_modules/rxjs/_esm5/internal/observable/pairs.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__["pairs"]; });
/* harmony import */ var _internal_observable_race__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./internal/observable/race */ "./node_modules/rxjs/_esm5/internal/observable/race.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_observable_race__WEBPACK_IMPORTED_MODULE_44__["race"]; });
/* harmony import */ var _internal_observable_range__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./internal/observable/range */ "./node_modules/rxjs/_esm5/internal/observable/range.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _internal_observable_range__WEBPACK_IMPORTED_MODULE_45__["range"]; });
/* harmony import */ var _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./internal/observable/throwError */ "./node_modules/rxjs/_esm5/internal/observable/throwError.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_46__["throwError"]; });
/* harmony import */ var _internal_observable_timer__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./internal/observable/timer */ "./node_modules/rxjs/_esm5/internal/observable/timer.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return _internal_observable_timer__WEBPACK_IMPORTED_MODULE_47__["timer"]; });
/* harmony import */ var _internal_observable_using__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./internal/observable/using */ "./node_modules/rxjs/_esm5/internal/observable/using.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "using", function() { return _internal_observable_using__WEBPACK_IMPORTED_MODULE_48__["using"]; });
/* harmony import */ var _internal_observable_zip__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./internal/observable/zip */ "./node_modules/rxjs/_esm5/internal/observable/zip.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_observable_zip__WEBPACK_IMPORTED_MODULE_49__["zip"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["EMPTY"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["NEVER"]; });
/* harmony import */ var _internal_config__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./internal/config */ "./node_modules/rxjs/_esm5/internal/config.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "config", function() { return _internal_config__WEBPACK_IMPORTED_MODULE_50__["config"]; });
/* Observable */
/** PURE_IMPORTS_START PURE_IMPORTS_END */
/* Subjects */
/* Schedulers */
/* Subscription */
/* Notification */
/* Utils */
/* Error types */
/* Static observable creation exports */
/* Constants */
/* Config */
//# sourceMappingURL=index.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/AsyncSubject.js":
/*!**********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/AsyncSubject.js ***!
\**********************************************************/
/*! exports provided: AsyncSubject */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return AsyncSubject; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/** PURE_IMPORTS_START tslib,_Subject,_Subscription PURE_IMPORTS_END */
/**
* @class AsyncSubject<T>
*/
var AsyncSubject = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsyncSubject, _super);
function AsyncSubject() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.value = null;
_this.hasNext = false;
_this.hasCompleted = false;
return _this;
}
/** @deprecated This is an internal implementation detail, do not use. */
AsyncSubject.prototype._subscribe = function (subscriber) {
if (this.hasError) {
subscriber.error(this.thrownError);
return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY;
}
else if (this.hasCompleted && this.hasNext) {
subscriber.next(this.value);
subscriber.complete();
return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY;
}
return _super.prototype._subscribe.call(this, subscriber);
};
AsyncSubject.prototype.next = function (value) {
if (!this.hasCompleted) {
this.value = value;
this.hasNext = true;
}
};
AsyncSubject.prototype.error = function (error) {
if (!this.hasCompleted) {
_super.prototype.error.call(this, error);
}
};
AsyncSubject.prototype.complete = function () {
this.hasCompleted = true;
if (this.hasNext) {
_super.prototype.next.call(this, this.value);
}
_super.prototype.complete.call(this);
};
return AsyncSubject;
}(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
//# sourceMappingURL=AsyncSubject.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/BehaviorSubject.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/BehaviorSubject.js ***!
\*************************************************************/
/*! exports provided: BehaviorSubject */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return BehaviorSubject; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ "./node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js");
/** PURE_IMPORTS_START tslib,_Subject,_util_ObjectUnsubscribedError PURE_IMPORTS_END */
/**
* @class BehaviorSubject<T>
*/
var BehaviorSubject = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BehaviorSubject, _super);
function BehaviorSubject(_value) {
var _this = _super.call(this) || this;
_this._value = _value;
return _this;
}
Object.defineProperty(BehaviorSubject.prototype, "value", {
get: function () {
return this.getValue();
},
enumerable: true,
configurable: true
});
/** @deprecated This is an internal implementation detail, do not use. */
BehaviorSubject.prototype._subscribe = function (subscriber) {
var subscription = _super.prototype._subscribe.call(this, subscriber);
if (subscription && !subscription.closed) {
subscriber.next(this._value);
}
return subscription;
};
BehaviorSubject.prototype.getValue = function () {
if (this.hasError) {
throw this.thrownError;
}
else if (this.closed) {
throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_2__["ObjectUnsubscribedError"]();
}
else {
return this._value;
}
};
BehaviorSubject.prototype.next = function (value) {
_super.prototype.next.call(this, this._value = value);
};
return BehaviorSubject;
}(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
//# sourceMappingURL=BehaviorSubject.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/InnerSubscriber.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/InnerSubscriber.js ***!
\*************************************************************/
/*! exports provided: InnerSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InnerSubscriber", function() { return InnerSubscriber; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var InnerSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](InnerSubscriber, _super);
function InnerSubscriber(parent, outerValue, outerIndex) {
var _this = _super.call(this) || this;
_this.parent = parent;
_this.outerValue = outerValue;
_this.outerIndex = outerIndex;
_this.index = 0;
return _this;
}
InnerSubscriber.prototype._next = function (value) {
this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);
};
InnerSubscriber.prototype._error = function (error) {
this.parent.notifyError(error, this);
this.unsubscribe();
};
InnerSubscriber.prototype._complete = function () {
this.parent.notifyComplete(this);
this.unsubscribe();
};
return InnerSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=InnerSubscriber.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/Notification.js":
/*!**********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/Notification.js ***!
\**********************************************************/
/*! exports provided: Notification */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return Notification; });
/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observable/empty */ "./node_modules/rxjs/_esm5/internal/observable/empty.js");
/* harmony import */ var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./observable/of */ "./node_modules/rxjs/_esm5/internal/observable/of.js");
/* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./observable/throwError */ "./node_modules/rxjs/_esm5/internal/observable/throwError.js");
/** PURE_IMPORTS_START _observable_empty,_observable_of,_observable_throwError PURE_IMPORTS_END */
/**
* Represents a push-based event or value that an {@link Observable} can emit.
* This class is particularly useful for operators that manage notifications,
* like {@link materialize}, {@link dematerialize}, {@link observeOn}, and
* others. Besides wrapping the actual delivered value, it also annotates it
* with metadata of, for instance, what type of push message it is (`next`,
* `error`, or `complete`).
*
* @see {@link materialize}
* @see {@link dematerialize}
* @see {@link observeOn}
*
* @class Notification<T>
*/
var Notification = /*@__PURE__*/ (function () {
function Notification(kind, value, error) {
this.kind = kind;
this.value = value;
this.error = error;
this.hasValue = kind === 'N';
}
/**
* Delivers to the given `observer` the value wrapped by this Notification.
* @param {Observer} observer
* @return
*/
Notification.prototype.observe = function (observer) {
switch (this.kind) {
case 'N':
return observer.next && observer.next(this.value);
case 'E':
return observer.error && observer.error(this.error);
case 'C':
return observer.complete && observer.complete();
}
};
/**
* Given some {@link Observer} callbacks, deliver the value represented by the
* current Notification to the correctly corresponding callback.
* @param {function(value: T): void} next An Observer `next` callback.
* @param {function(err: any): void} [error] An Observer `error` callback.
* @param {function(): void} [complete] An Observer `complete` callback.
* @return {any}
*/
Notification.prototype.do = function (next, error, complete) {
var kind = this.kind;
switch (kind) {
case 'N':
return next && next(this.value);
case 'E':
return error && error(this.error);
case 'C':
return complete && complete();
}
};
/**
* Takes an Observer or its individual callback functions, and calls `observe`
* or `do` methods accordingly.
* @param {Observer|function(value: T): void} nextOrObserver An Observer or
* the `next` callback.
* @param {function(err: any): void} [error] An Observer `error` callback.
* @param {function(): void} [complete] An Observer `complete` callback.
* @return {any}
*/
Notification.prototype.accept = function (nextOrObserver, error, complete) {
if (nextOrObserver && typeof nextOrObserver.next === 'function') {
return this.observe(nextOrObserver);
}
else {
return this.do(nextOrObserver, error, complete);
}
};
/**
* Returns a simple Observable that just delivers the notification represented
* by this Notification instance.
* @return {any}
*/
Notification.prototype.toObservable = function () {
var kind = this.kind;
switch (kind) {
case 'N':
return Object(_observable_of__WEBPACK_IMPORTED_MODULE_1__["of"])(this.value);
case 'E':
return Object(_observable_throwError__WEBPACK_IMPORTED_MODULE_2__["throwError"])(this.error);
case 'C':
return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_0__["empty"])();
}
throw new Error('unexpected notification kind value');
};
/**
* A shortcut to create a Notification instance of the type `next` from a
* given value.
* @param {T} value The `next` value.
* @return {Notification<T>} The "next" Notification representing the
* argument.
* @nocollapse
*/
Notification.createNext = function (value) {
if (typeof value !== 'undefined') {
return new Notification('N', value);
}
return Notification.undefinedValueNotification;
};
/**
* A shortcut to create a Notification instance of the type `error` from a
* given error.
* @param {any} [err] The `error` error.
* @return {Notification<T>} The "error" Notification representing the
* argument.
* @nocollapse
*/
Notification.createError = function (err) {
return new Notification('E', undefined, err);
};
/**
* A shortcut to create a Notification instance of the type `complete`.
* @return {Notification<any>} The valueless "complete" Notification.
* @nocollapse
*/
Notification.createComplete = function () {
return Notification.completeNotification;
};
Notification.completeNotification = new Notification('C');
Notification.undefinedValueNotification = new Notification('N', undefined);
return Notification;
}());
//# sourceMappingURL=Notification.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/Observable.js":
/*!********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/Observable.js ***!
\********************************************************/
/*! exports provided: Observable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return Observable; });
/* harmony import */ var _util_toSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/toSubscriber */ "./node_modules/rxjs/_esm5/internal/util/toSubscriber.js");
/* harmony import */ var _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../internal/symbol/observable */ "./node_modules/rxjs/_esm5/internal/symbol/observable.js");
/* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/pipe */ "./node_modules/rxjs/_esm5/internal/util/pipe.js");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./config */ "./node_modules/rxjs/_esm5/internal/config.js");
/** PURE_IMPORTS_START _util_toSubscriber,_internal_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */
/**
* A representation of any set of values over any amount of time. This is the most basic building block
* of RxJS.
*
* @class Observable<T>
*/
var Observable = /*@__PURE__*/ (function () {
/**
* @constructor
* @param {Function} subscribe the function that is called when the Observable is
* initially subscribed to. This function is given a Subscriber, to which new values
* can be `next`ed, or an `error` method can be called to raise an error, or
* `complete` can be called to notify of a successful completion.
*/
function Observable(subscribe) {
/** Internal implementation detail, do not use directly. */
this._isScalar = false;
if (subscribe) {
this._subscribe = subscribe;
}
}
/**
* Creates a new Observable, with this Observable as the source, and the passed
* operator defined as the new observable's operator.
* @method lift
* @param {Operator} operator the operator defining the operation to take on the observable
* @return {Observable} a new observable with the Operator applied
*/
Observable.prototype.lift = function (operator) {
var observable = new Observable();
observable.source = this;
observable.operator = operator;
return observable;
};
/**
* Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.
*
* <span class="informal">Use it when you have all these Observables, but still nothing is happening.</span>
*
* `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It
* might be for example a function that you passed to a {@link create} static factory, but most of the time it is
* a library implementation, which defines what and when will be emitted by an Observable. This means that calling
* `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often
* thought.
*
* Apart from starting the execution of an Observable, this method allows you to listen for values
* that an Observable emits, as well as for when it completes or errors. You can achieve this in two
* following ways.
*
* The first way is creating an object that implements {@link Observer} interface. It should have methods
* defined by that interface, but note that it should be just a regular JavaScript object, which you can create
* yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular do
* not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also
* that your object does not have to implement all methods. If you find yourself creating a method that doesn't
* do anything, you can simply omit it. Note however, that if `error` method is not provided, all errors will
* be left uncaught.
*
* The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.
* This means you can provide three functions as arguments to `subscribe`, where first function is equivalent
* of a `next` method, second of an `error` method and third of a `complete` method. Just as in case of Observer,
* if you do not need to listen for something, you can omit a function, preferably by passing `undefined` or `null`,
* since `subscribe` recognizes these functions by where they were placed in function call. When it comes
* to `error` function, just as before, if not provided, errors emitted by an Observable will be thrown.
*
* Whatever style of calling `subscribe` you use, in both cases it returns a Subscription object.
* This object allows you to call `unsubscribe` on it, which in turn will stop work that an Observable does and will clean
* up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback
* provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.
*
* Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.
* It is an Observable itself that decides when these functions will be called. For example {@link of}
* by default emits all its values synchronously. Always check documentation for how given Observable
* will behave when subscribed and if its default behavior can be modified with a {@link Scheduler}.
*
* @example <caption>Subscribe with an Observer</caption>
* const sumObserver = {
* sum: 0,
* next(value) {
* console.log('Adding: ' + value);
* this.sum = this.sum + value;
* },
* error() { // We actually could just remove this method,
* }, // since we do not really care about errors right now.
* complete() {
* console.log('Sum equals: ' + this.sum);
* }
* };
*
* Rx.Observable.of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.
* .subscribe(sumObserver);
*
* // Logs:
* // "Adding: 1"
* // "Adding: 2"
* // "Adding: 3"
* // "Sum equals: 6"
*
*
* @example <caption>Subscribe with functions</caption>
* let sum = 0;
*
* Rx.Observable.of(1, 2, 3)
* .subscribe(
* function(value) {
* console.log('Adding: ' + value);
* sum = sum + value;
* },
* undefined,
* function() {
* console.log('Sum equals: ' + sum);
* }
* );
*
* // Logs:
* // "Adding: 1"
* // "Adding: 2"
* // "Adding: 3"
* // "Sum equals: 6"
*
*
* @example <caption>Cancel a subscription</caption>
* const subscription = Rx.Observable.interval(1000).subscribe(
* num => console.log(num),
* undefined,
* () => console.log('completed!') // Will not be called, even
* ); // when cancelling subscription
*
*
* setTimeout(() => {
* subscription.unsubscribe();
* console.log('unsubscribed!');
* }, 2500);
*
* // Logs:
* // 0 after 1s
* // 1 after 2s
* // "unsubscribed!" after 2.5s
*
*
* @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,
* or the first of three possible handlers, which is the handler for each value emitted from the subscribed
* Observable.
* @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,
* the error will be thrown as unhandled.
* @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.
* @return {ISubscription} a subscription reference to the registered handlers
* @method subscribe
*/
Observable.prototype.subscribe = function (observerOrNext, error, complete) {
var operator = this.operator;
var sink = Object(_util_toSubscriber__WEBPACK_IMPORTED_MODULE_0__["toSubscriber"])(observerOrNext, error, complete);
if (operator) {
operator.call(sink, this.source);
}
else {
sink.add(this.source || !sink.syncErrorThrowable ? this._subscribe(sink) : this._trySubscribe(sink));
}
if (_config__WEBPACK_IMPORTED_MODULE_3__["config"].useDeprecatedSynchronousErrorHandling) {
if (sink.syncErrorThrowable) {
sink.syncErrorThrowable = false;
if (sink.syncErrorThrown) {
throw sink.syncErrorValue;
}
}
}
return sink;
};
/** @deprecated This is an internal implementation detail, do not use. */
Observable.prototype._trySubscribe = function (sink) {
try {
return this._subscribe(sink);
}
catch (err) {
if (_config__WEBPACK_IMPORTED_MODULE_3__["config"].useDeprecatedSynchronousErrorHandling) {
sink.syncErrorThrown = true;
sink.syncErrorValue = err;
}
sink.error(err);
}
};
/**
* @method forEach
* @param {Function} next a handler for each value emitted by the observable
* @param {PromiseConstructor} [promiseCtor] a constructor function used to instantiate the Promise
* @return {Promise} a promise that either resolves on observable completion or
* rejects with the handled error
*/
Observable.prototype.forEach = function (next, promiseCtor) {
var _this = this;
promiseCtor = getPromiseCtor(promiseCtor);
return new promiseCtor(function (resolve, reject) {
// Must be declared in a separate statement to avoid a RefernceError when
// accessing subscription below in the closure due to Temporal Dead Zone.
var subscription;
subscription = _this.subscribe(function (value) {
try {
next(value);
}
catch (err) {
reject(err);
if (subscription) {
subscription.unsubscribe();
}
}
}, reject, resolve);
});
};
/** @deprecated This is an internal implementation detail, do not use. */
Observable.prototype._subscribe = function (subscriber) {
var source = this.source;
return source && source.subscribe(subscriber);
};
/**
* An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable
* @method Symbol.observable
* @return {Observable} this instance of the observable
*/
Observable.prototype[_internal_symbol_observable__WEBPACK_IMPORTED_MODULE_1__["observable"]] = function () {
return this;
};
/* tslint:enable:max-line-length */
/**
* Used to stitch together functional operators into a chain.
* @method pipe
* @return {Observable} the Observable result of all of the operators having
* been called in the order they were passed in.
*
* @example
*
* import { map, filter, scan } from 'rxjs/operators';
*
* Rx.Observable.interval(1000)
* .pipe(
* filter(x => x % 2 === 0),
* map(x => x + x),
* scan((acc, x) => acc + x)
* )
* .subscribe(x => console.log(x))
*/
Observable.prototype.pipe = function () {
var operations = [];
for (var _i = 0; _i < arguments.length; _i++) {
operations[_i] = arguments[_i];
}
if (operations.length === 0) {
return this;
}
return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_2__["pipeFromArray"])(operations)(this);
};
/* tslint:enable:max-line-length */
Observable.prototype.toPromise = function (promiseCtor) {
var _this = this;
promiseCtor = getPromiseCtor(promiseCtor);
return new promiseCtor(function (resolve, reject) {
var value;
_this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
});
};
// HACK: Since TypeScript inherits static properties too, we have to
// fight against TypeScript here so Subject can have a different static create signature
/**
* Creates a new cold Observable by calling the Observable constructor
* @static true
* @owner Observable
* @method create
* @param {Function} subscribe? the subscriber function to be passed to the Observable constructor
* @return {Observable} a new cold observable
* @nocollapse
*/
Observable.create = function (subscribe) {
return new Observable(subscribe);
};
return Observable;
}());
/**
* Decides between a passed promise constructor from consuming code,
* A default configured promise constructor, and the native promise
* constructor and returns it. If nothing can be found, it will throw
* an error.
* @param promiseCtor The optional promise constructor to passed by consuming code
*/
function getPromiseCtor(promiseCtor) {
if (!promiseCtor) {
promiseCtor = _config__WEBPACK_IMPORTED_MODULE_3__["config"].Promise || Promise;
}
if (!promiseCtor) {
throw new Error('no Promise impl found');
}
return promiseCtor;
}
//# sourceMappingURL=Observable.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/Observer.js":
/*!******************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/Observer.js ***!
\******************************************************/
/*! exports provided: empty */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; });
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./config */ "./node_modules/rxjs/_esm5/internal/config.js");
/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/hostReportError */ "./node_modules/rxjs/_esm5/internal/util/hostReportError.js");
/** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */
var empty = {
closed: true,
next: function (value) { },
error: function (err) {
if (_config__WEBPACK_IMPORTED_MODULE_0__["config"].useDeprecatedSynchronousErrorHandling) {
throw err;
}
else {
Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_1__["hostReportError"])(err);
}
},
complete: function () { }
};
//# sourceMappingURL=Observer.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/OuterSubscriber.js ***!
\*************************************************************/
/*! exports provided: OuterSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OuterSubscriber", function() { return OuterSubscriber; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var OuterSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](OuterSubscriber, _super);
function OuterSubscriber() {
return _super !== null && _super.apply(this, arguments) || this;
}
OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.destination.next(innerValue);
};
OuterSubscriber.prototype.notifyError = function (error, innerSub) {
this.destination.error(error);
};
OuterSubscriber.prototype.notifyComplete = function (innerSub) {
this.destination.complete();
};
return OuterSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=OuterSubscriber.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/ReplaySubject.js":
/*!***********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/ReplaySubject.js ***!
\***********************************************************/
/*! exports provided: ReplaySubject */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return ReplaySubject; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/* harmony import */ var _scheduler_queue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scheduler/queue */ "./node_modules/rxjs/_esm5/internal/scheduler/queue.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony import */ var _operators_observeOn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./operators/observeOn */ "./node_modules/rxjs/_esm5/internal/operators/observeOn.js");
/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ "./node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js");
/* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SubjectSubscription */ "./node_modules/rxjs/_esm5/internal/SubjectSubscription.js");
/** PURE_IMPORTS_START tslib,_Subject,_scheduler_queue,_Subscription,_operators_observeOn,_util_ObjectUnsubscribedError,_SubjectSubscription PURE_IMPORTS_END */
/**
* @class ReplaySubject<T>
*/
var ReplaySubject = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ReplaySubject, _super);
function ReplaySubject(bufferSize, windowTime, scheduler) {
if (bufferSize === void 0) {
bufferSize = Number.POSITIVE_INFINITY;
}
if (windowTime === void 0) {
windowTime = Number.POSITIVE_INFINITY;
}
var _this = _super.call(this) || this;
_this.scheduler = scheduler;
_this._events = [];
_this._infiniteTimeWindow = false;
_this._bufferSize = bufferSize < 1 ? 1 : bufferSize;
_this._windowTime = windowTime < 1 ? 1 : windowTime;
if (windowTime === Number.POSITIVE_INFINITY) {
_this._infiniteTimeWindow = true;
_this.next = _this.nextInfiniteTimeWindow;
}
else {
_this.next = _this.nextTimeWindow;
}
return _this;
}
ReplaySubject.prototype.nextInfiniteTimeWindow = function (value) {
var _events = this._events;
_events.push(value);
// Since this method is invoked in every next() call than the buffer
// can overgrow the max size only by one item
if (_events.length > this._bufferSize) {
_events.shift();
}
_super.prototype.next.call(this, value);
};
ReplaySubject.prototype.nextTimeWindow = function (value) {
this._events.push(new ReplayEvent(this._getNow(), value));
this._trimBufferThenGetEvents();
_super.prototype.next.call(this, value);
};
/** @deprecated This is an internal implementation detail, do not use. */
ReplaySubject.prototype._subscribe = function (subscriber) {
// When `_infiniteTimeWindow === true` then the buffer is already trimmed
var _infiniteTimeWindow = this._infiniteTimeWindow;
var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();
var scheduler = this.scheduler;
var len = _events.length;
var subscription;
if (this.closed) {
throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_5__["ObjectUnsubscribedError"]();
}
else if (this.isStopped || this.hasError) {
subscription = _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
}
else {
this.observers.push(subscriber);
subscription = new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_6__["SubjectSubscription"](this, subscriber);
}
if (scheduler) {
subscriber.add(subscriber = new _operators_observeOn__WEBPACK_IMPORTED_MODULE_4__["ObserveOnSubscriber"](subscriber, scheduler));
}
if (_infiniteTimeWindow) {
for (var i = 0; i < len && !subscriber.closed; i++) {
subscriber.next(_events[i]);
}
}
else {
for (var i = 0; i < len && !subscriber.closed; i++) {
subscriber.next(_events[i].value);
}
}
if (this.hasError) {
subscriber.error(this.thrownError);
}
else if (this.isStopped) {
subscriber.complete();
}
return subscription;
};
ReplaySubject.prototype._getNow = function () {
return (this.scheduler || _scheduler_queue__WEBPACK_IMPORTED_MODULE_2__["queue"]).now();
};
ReplaySubject.prototype._trimBufferThenGetEvents = function () {
var now = this._getNow();
var _bufferSize = this._bufferSize;
var _windowTime = this._windowTime;
var _events = this._events;
var eventsCount = _events.length;
var spliceCount = 0;
// Trim events that fall out of the time window.
// Start at the front of the list. Break early once
// we encounter an event that falls within the window.
while (spliceCount < eventsCount) {
if ((now - _events[spliceCount].time) < _windowTime) {
break;
}
spliceCount++;
}
if (eventsCount > _bufferSize) {
spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);
}
if (spliceCount > 0) {
_events.splice(0, spliceCount);
}
return _events;
};
return ReplaySubject;
}(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
var ReplayEvent = /*@__PURE__*/ (function () {
function ReplayEvent(time, value) {
this.time = time;
this.value = value;
}
return ReplayEvent;
}());
//# sourceMappingURL=ReplaySubject.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/Scheduler.js":
/*!*******************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/Scheduler.js ***!
\*******************************************************/
/*! exports provided: Scheduler */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return Scheduler; });
/**
* An execution context and a data structure to order tasks and schedule their
* execution. Provides a notion of (potentially virtual) time, through the
* `now()` getter method.
*
* Each unit of work in a Scheduler is called an {@link Action}.
*
* ```ts
* class Scheduler {
* now(): number;
* schedule(work, delay?, state?): Subscription;
* }
* ```
*
* @class Scheduler
* @deprecated Scheduler is an internal implementation detail of RxJS, and
* should not be used directly. Rather, create your own class and implement
* {@link SchedulerLike}
*/
var Scheduler = /*@__PURE__*/ (function () {
function Scheduler(SchedulerAction, now) {
if (now === void 0) {
now = Scheduler.now;
}
this.SchedulerAction = SchedulerAction;
this.now = now;
}
/**
* Schedules a function, `work`, for execution. May happen at some point in
* the future, according to the `delay` parameter, if specified. May be passed
* some context object, `state`, which will be passed to the `work` function.
*
* The given arguments will be processed an stored as an Action object in a
* queue of actions.
*
* @param {function(state: ?T): ?Subscription} work A function representing a
* task, or some unit of work to be executed by the Scheduler.
* @param {number} [delay] Time to wait before executing the work, where the
* time unit is implicit and defined by the Scheduler itself.
* @param {T} [state] Some contextual data that the `work` function uses when
* called by the Scheduler.
* @return {Subscription} A subscription in order to be able to unsubscribe
* the scheduled work.
*/
Scheduler.prototype.schedule = function (work, delay, state) {
if (delay === void 0) {
delay = 0;
}
return new this.SchedulerAction(this, work).schedule(state, delay);
};
/** @nocollapse */
Scheduler.now = Date.now ? Date.now : function () { return +new Date(); };
return Scheduler;
}());
//# sourceMappingURL=Scheduler.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/Subject.js":
/*!*****************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/Subject.js ***!
\*****************************************************/
/*! exports provided: SubjectSubscriber, Subject, AnonymousSubject */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectSubscriber", function() { return SubjectSubscriber; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return Subject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnonymousSubject", function() { return AnonymousSubject; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ "./node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js");
/* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SubjectSubscription */ "./node_modules/rxjs/_esm5/internal/SubjectSubscription.js");
/* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../internal/symbol/rxSubscriber */ "./node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js");
/** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */
/**
* @class SubjectSubscriber<T>
*/
var SubjectSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubjectSubscriber, _super);
function SubjectSubscriber(destination) {
var _this = _super.call(this, destination) || this;
_this.destination = destination;
return _this;
}
return SubjectSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"]));
/**
* @class Subject<T>
*/
var Subject = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](Subject, _super);
function Subject() {
var _this = _super.call(this) || this;
_this.observers = [];
_this.closed = false;
_this.isStopped = false;
_this.hasError = false;
_this.thrownError = null;
return _this;
}
Subject.prototype[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_6__["rxSubscriber"]] = function () {
return new SubjectSubscriber(this);
};
Subject.prototype.lift = function (operator) {
var subject = new AnonymousSubject(this, this);
subject.operator = operator;
return subject;
};
Subject.prototype.next = function (value) {
if (this.closed) {
throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
}
if (!this.isStopped) {
var observers = this.observers;
var len = observers.length;
var copy = observers.slice();
for (var i = 0; i < len; i++) {
copy[i].next(value);
}
}
};
Subject.prototype.error = function (err) {
if (this.closed) {
throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
}
this.hasError = true;
this.thrownError = err;
this.isStopped = true;
var observers = this.observers;
var len = observers.length;
var copy = observers.slice();
for (var i = 0; i < len; i++) {
copy[i].error(err);
}
this.observers.length = 0;
};
Subject.prototype.complete = function () {
if (this.closed) {
throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
}
this.isStopped = true;
var observers = this.observers;
var len = observers.length;
var copy = observers.slice();
for (var i = 0; i < len; i++) {
copy[i].complete();
}
this.observers.length = 0;
};
Subject.prototype.unsubscribe = function () {
this.isStopped = true;
this.closed = true;
this.observers = null;
};
/** @deprecated This is an internal implementation detail, do not use. */
Subject.prototype._trySubscribe = function (subscriber) {
if (this.closed) {
throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
}
else {
return _super.prototype._trySubscribe.call(this, subscriber);
}
};
/** @deprecated This is an internal implementation detail, do not use. */
Subject.prototype._subscribe = function (subscriber) {
if (this.closed) {
throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
}
else if (this.hasError) {
subscriber.error(this.thrownError);
return _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
}
else if (this.isStopped) {
subscriber.complete();
return _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
}
else {
this.observers.push(subscriber);
return new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__["SubjectSubscription"](this, subscriber);
}
};
Subject.prototype.asObservable = function () {
var observable = new _Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"]();
observable.source = this;
return observable;
};
/**@nocollapse */
Subject.create = function (destination, source) {
return new AnonymousSubject(destination, source);
};
return Subject;
}(_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"]));
/**
* @class AnonymousSubject<T>
*/
var AnonymousSubject = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AnonymousSubject, _super);
function AnonymousSubject(destination, source) {
var _this = _super.call(this) || this;
_this.destination = destination;
_this.source = source;
return _this;
}
AnonymousSubject.prototype.next = function (value) {
var destination = this.destination;
if (destination && destination.next) {
destination.next(value);
}
};
AnonymousSubject.prototype.error = function (err) {
var destination = this.destination;
if (destination && destination.error) {
this.destination.error(err);
}
};
AnonymousSubject.prototype.complete = function () {
var destination = this.destination;
if (destination && destination.complete) {
this.destination.complete();
}
};
/** @deprecated This is an internal implementation detail, do not use. */
AnonymousSubject.prototype._subscribe = function (subscriber) {
var source = this.source;
if (source) {
return this.source.subscribe(subscriber);
}
else {
return _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
}
};
return AnonymousSubject;
}(Subject));
//# sourceMappingURL=Subject.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/SubjectSubscription.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/SubjectSubscription.js ***!
\*****************************************************************/
/*! exports provided: SubjectSubscription */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectSubscription", function() { return SubjectSubscription; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SubjectSubscription = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubjectSubscription, _super);
function SubjectSubscription(subject, subscriber) {
var _this = _super.call(this) || this;
_this.subject = subject;
_this.subscriber = subscriber;
_this.closed = false;
return _this;
}
SubjectSubscription.prototype.unsubscribe = function () {
if (this.closed) {
return;
}
this.closed = true;
var subject = this.subject;
var observers = subject.observers;
this.subject = null;
if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
return;
}
var subscriberIndex = observers.indexOf(this.subscriber);
if (subscriberIndex !== -1) {
observers.splice(subscriberIndex, 1);
}
};
return SubjectSubscription;
}(_Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]));
//# sourceMappingURL=SubjectSubscription.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/Subscriber.js":
/*!********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/Subscriber.js ***!
\********************************************************/
/*! exports provided: Subscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return Subscriber; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/isFunction */ "./node_modules/rxjs/_esm5/internal/util/isFunction.js");
/* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Observer */ "./node_modules/rxjs/_esm5/internal/Observer.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../internal/symbol/rxSubscriber */ "./node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./config */ "./node_modules/rxjs/_esm5/internal/config.js");
/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util/hostReportError */ "./node_modules/rxjs/_esm5/internal/util/hostReportError.js");
/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */
/**
* Implements the {@link Observer} interface and extends the
* {@link Subscription} class. While the {@link Observer} is the public API for
* consuming the values of an {@link Observable}, all Observers get converted to
* a Subscriber, in order to provide Subscription-like capabilities such as
* `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
* implementing operators, but it is rarely used as a public API.
*
* @class Subscriber<T>
*/
var Subscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](Subscriber, _super);
/**
* @param {Observer|function(value: T): void} [destinationOrNext] A partially
* defined Observer or a `next` callback function.
* @param {function(e: ?any): void} [error] The `error` callback of an
* Observer.
* @param {function(): void} [complete] The `complete` callback of an
* Observer.
*/
function Subscriber(destinationOrNext, error, complete) {
var _this = _super.call(this) || this;
/** @internal */ _this.syncErrorValue = null;
/** @internal */ _this.syncErrorThrown = false;
/** @internal */ _this.syncErrorThrowable = false;
_this.isStopped = false;
switch (arguments.length) {
case 0:
_this.destination = _Observer__WEBPACK_IMPORTED_MODULE_2__["empty"];
break;
case 1:
if (!destinationOrNext) {
_this.destination = _Observer__WEBPACK_IMPORTED_MODULE_2__["empty"];
break;
}
if (typeof destinationOrNext === 'object') {
// HACK(benlesh): For situations where Node has multiple copies of rxjs in
// node_modules, we cannot rely on `instanceof` checks
if (isTrustedSubscriber(destinationOrNext)) {
var trustedSubscriber = destinationOrNext[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__["rxSubscriber"]]();
_this.syncErrorThrowable = trustedSubscriber.syncErrorThrowable;
_this.destination = trustedSubscriber;
trustedSubscriber.add(_this);
}
else {
_this.syncErrorThrowable = true;
_this.destination = new SafeSubscriber(_this, destinationOrNext);
}
break;
}
default:
_this.syncErrorThrowable = true;
_this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
break;
}
return _this;
}
Subscriber.prototype[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__["rxSubscriber"]] = function () { return this; };
/**
* A static factory for a Subscriber, given a (potentially partial) definition
* of an Observer.
* @param {function(x: ?T): void} [next] The `next` callback of an Observer.
* @param {function(e: ?any): void} [error] The `error` callback of an
* Observer.
* @param {function(): void} [complete] The `complete` callback of an
* Observer.
* @return {Subscriber<T>} A Subscriber wrapping the (partially defined)
* Observer represented by the given arguments.
* @nocollapse
*/
Subscriber.create = function (next, error, complete) {
var subscriber = new Subscriber(next, error, complete);
subscriber.syncErrorThrowable = false;
return subscriber;
};
/**
* The {@link Observer} callback to receive notifications of type `next` from
* the Observable, with a value. The Observable may call this method 0 or more
* times.
* @param {T} [value] The `next` value.
* @return {void}
*/
Subscriber.prototype.next = function (value) {
if (!this.isStopped) {
this._next(value);
}
};
/**
* The {@link Observer} callback to receive notifications of type `error` from
* the Observable, with an attached {@link Error}. Notifies the Observer that
* the Observable has experienced an error condition.
* @param {any} [err] The `error` exception.
* @return {void}
*/
Subscriber.prototype.error = function (err) {
if (!this.isStopped) {
this.isStopped = true;
this._error(err);
}
};
/**
* The {@link Observer} callback to receive a valueless notification of type
* `complete` from the Observable. Notifies the Observer that the Observable
* has finished sending push-based notifications.
* @return {void}
*/
Subscriber.prototype.complete = function () {
if (!this.isStopped) {
this.isStopped = true;
this._complete();
}
};
Subscriber.prototype.unsubscribe = function () {
if (this.closed) {
return;
}
this.isStopped = true;
_super.prototype.unsubscribe.call(this);
};
Subscriber.prototype._next = function (value) {
this.destination.next(value);
};
Subscriber.prototype._error = function (err) {
this.destination.error(err);
this.unsubscribe();
};
Subscriber.prototype._complete = function () {
this.destination.complete();
this.unsubscribe();
};
/** @deprecated This is an internal implementation detail, do not use. */
Subscriber.prototype._unsubscribeAndRecycle = function () {
var _a = this, _parent = _a._parent, _parents = _a._parents;
this._parent = null;
this._parents = null;
this.unsubscribe();
this.closed = false;
this.isStopped = false;
this._parent = _parent;
this._parents = _parents;
return this;
};
return Subscriber;
}(_Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"]));
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SafeSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SafeSubscriber, _super);
function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
var _this = _super.call(this) || this;
_this._parentSubscriber = _parentSubscriber;
var next;
var context = _this;
if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(observerOrNext)) {
next = observerOrNext;
}
else if (observerOrNext) {
next = observerOrNext.next;
error = observerOrNext.error;
complete = observerOrNext.complete;
if (observerOrNext !== _Observer__WEBPACK_IMPORTED_MODULE_2__["empty"]) {
context = Object.create(observerOrNext);
if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(context.unsubscribe)) {
_this.add(context.unsubscribe.bind(context));
}
context.unsubscribe = _this.unsubscribe.bind(_this);
}
}
_this._context = context;
_this._next = next;
_this._error = error;
_this._complete = complete;
return _this;
}
SafeSubscriber.prototype.next = function (value) {
if (!this.isStopped && this._next) {
var _parentSubscriber = this._parentSubscriber;
if (!_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
this.__tryOrUnsub(this._next, value);
}
else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
this.unsubscribe();
}
}
};
SafeSubscriber.prototype.error = function (err) {
if (!this.isStopped) {
var _parentSubscriber = this._parentSubscriber;
var useDeprecatedSynchronousErrorHandling = _config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling;
if (this._error) {
if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
this.__tryOrUnsub(this._error, err);
this.unsubscribe();
}
else {
this.__tryOrSetError(_parentSubscriber, this._error, err);
this.unsubscribe();
}
}
else if (!_parentSubscriber.syncErrorThrowable) {
this.unsubscribe();
if (useDeprecatedSynchronousErrorHandling) {
throw err;
}
Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err);
}
else {
if (useDeprecatedSynchronousErrorHandling) {
_parentSubscriber.syncErrorValue = err;
_parentSubscriber.syncErrorThrown = true;
}
else {
Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err);
}
this.unsubscribe();
}
}
};
SafeSubscriber.prototype.complete = function () {
var _this = this;
if (!this.isStopped) {
var _parentSubscriber = this._parentSubscriber;
if (this._complete) {
var wrappedComplete = function () { return _this._complete.call(_this._context); };
if (!_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
this.__tryOrUnsub(wrappedComplete);
this.unsubscribe();
}
else {
this.__tryOrSetError(_parentSubscriber, wrappedComplete);
this.unsubscribe();
}
}
else {
this.unsubscribe();
}
}
};
SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
try {
fn.call(this._context, value);
}
catch (err) {
this.unsubscribe();
if (_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling) {
throw err;
}
else {
Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err);
}
}
};
SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
if (!_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling) {
throw new Error('bad call');
}
try {
fn.call(this._context, value);
}
catch (err) {
if (_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling) {
parent.syncErrorValue = err;
parent.syncErrorThrown = true;
return true;
}
else {
Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err);
return true;
}
}
return false;
};
/** @deprecated This is an internal implementation detail, do not use. */
SafeSubscriber.prototype._unsubscribe = function () {
var _parentSubscriber = this._parentSubscriber;
this._context = null;
this._parentSubscriber = null;
_parentSubscriber.unsubscribe();
};
return SafeSubscriber;
}(Subscriber));
function isTrustedSubscriber(obj) {
return obj instanceof Subscriber || ('syncErrorThrowable' in obj && obj[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__["rxSubscriber"]]);
}
//# sourceMappingURL=Subscriber.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/Subscription.js":
/*!**********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/Subscription.js ***!
\**********************************************************/
/*! exports provided: Subscription */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return Subscription; });
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/* harmony import */ var _util_isObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/isObject */ "./node_modules/rxjs/_esm5/internal/util/isObject.js");
/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/isFunction */ "./node_modules/rxjs/_esm5/internal/util/isFunction.js");
/* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/tryCatch */ "./node_modules/rxjs/_esm5/internal/util/tryCatch.js");
/* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/errorObject */ "./node_modules/rxjs/_esm5/internal/util/errorObject.js");
/* harmony import */ var _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/UnsubscriptionError */ "./node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js");
/** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_tryCatch,_util_errorObject,_util_UnsubscriptionError PURE_IMPORTS_END */
/**
* Represents a disposable resource, such as the execution of an Observable. A
* Subscription has one important method, `unsubscribe`, that takes no argument
* and just disposes the resource held by the subscription.
*
* Additionally, subscriptions may be grouped together through the `add()`
* method, which will attach a child Subscription to the current Subscription.
* When a Subscription is unsubscribed, all its children (and its grandchildren)
* will be unsubscribed as well.
*
* @class Subscription
*/
var Subscription = /*@__PURE__*/ (function () {
/**
* @param {function(): void} [unsubscribe] A function describing how to
* perform the disposal of resources when the `unsubscribe` method is called.
*/
function Subscription(unsubscribe) {
/**
* A flag to indicate whether this Subscription has already been unsubscribed.
* @type {boolean}
*/
this.closed = false;
/** @internal */
this._parent = null;
/** @internal */
this._parents = null;
/** @internal */
this._subscriptions = null;
if (unsubscribe) {
this._unsubscribe = unsubscribe;
}
}
/**
* Disposes the resources held by the subscription. May, for instance, cancel
* an ongoing Observable execution or cancel any other type of work that
* started when the Subscription was created.
* @return {void}
*/
Subscription.prototype.unsubscribe = function () {
var hasErrors = false;
var errors;
if (this.closed) {
return;
}
var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
this.closed = true;
this._parent = null;
this._parents = null;
// null out _subscriptions first so any child subscriptions that attempt
// to remove themselves from this subscription will noop
this._subscriptions = null;
var index = -1;
var len = _parents ? _parents.length : 0;
// if this._parent is null, then so is this._parents, and we
// don't have to remove ourselves from any parent subscriptions.
while (_parent) {
_parent.remove(this);
// if this._parents is null or index >= len,
// then _parent is set to null, and the loop exits
_parent = ++index < len && _parents[index] || null;
}
if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(_unsubscribe)) {
var trial = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_3__["tryCatch"])(_unsubscribe).call(this);
if (trial === _util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"]) {
hasErrors = true;
errors = errors || (_util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"].e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_5__["UnsubscriptionError"] ?
flattenUnsubscriptionErrors(_util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"].e.errors) : [_util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"].e]);
}
}
if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(_subscriptions)) {
index = -1;
len = _subscriptions.length;
while (++index < len) {
var sub = _subscriptions[index];
if (Object(_util_isObject__WEBPACK_IMPORTED_MODULE_1__["isObject"])(sub)) {
var trial = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_3__["tryCatch"])(sub.unsubscribe).call(sub);
if (trial === _util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"]) {
hasErrors = true;
errors = errors || [];
var err = _util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"].e;
if (err instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_5__["UnsubscriptionError"]) {
errors = errors.concat(flattenUnsubscriptionErrors(err.errors));
}
else {
errors.push(err);
}
}
}
}
}
if (hasErrors) {
throw new _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_5__["UnsubscriptionError"](errors);
}
};
/**
* Adds a tear down to be called during the unsubscribe() of this
* Subscription.
*
* If the tear down being added is a subscription that is already
* unsubscribed, is the same reference `add` is being called on, or is
* `Subscription.EMPTY`, it will not be added.
*
* If this subscription is already in an `closed` state, the passed
* tear down logic will be executed immediately.
*
* @param {TeardownLogic} teardown The additional logic to execute on
* teardown.
* @return {Subscription} Returns the Subscription used or created to be
* added to the inner subscriptions list. This Subscription can be used with
* `remove()` to remove the passed teardown logic from the inner subscriptions
* list.
*/
Subscription.prototype.add = function (teardown) {
if (!teardown || (teardown === Subscription.EMPTY)) {
return Subscription.EMPTY;
}
if (teardown === this) {
return this;
}
var subscription = teardown;
switch (typeof teardown) {
case 'function':
subscription = new Subscription(teardown);
case 'object':
if (subscription.closed || typeof subscription.unsubscribe !== 'function') {
return subscription;
}
else if (this.closed) {
subscription.unsubscribe();
return subscription;
}
else if (typeof subscription._addParent !== 'function' /* quack quack */) {
var tmp = subscription;
subscription = new Subscription();
subscription._subscriptions = [tmp];
}
break;
default:
throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
}
var subscriptions = this._subscriptions || (this._subscriptions = []);
subscriptions.push(subscription);
subscription._addParent(this);
return subscription;
};
/**
* Removes a Subscription from the internal list of subscriptions that will
* unsubscribe during the unsubscribe process of this Subscription.
* @param {Subscription} subscription The subscription to remove.
* @return {void}
*/
Subscription.prototype.remove = function (subscription) {
var subscriptions = this._subscriptions;
if (subscriptions) {
var subscriptionIndex = subscriptions.indexOf(subscription);
if (subscriptionIndex !== -1) {
subscriptions.splice(subscriptionIndex, 1);
}
}
};
/** @internal */
Subscription.prototype._addParent = function (parent) {
var _a = this, _parent = _a._parent, _parents = _a._parents;
if (!_parent || _parent === parent) {
// If we don't have a parent, or the new parent is the same as the
// current parent, then set this._parent to the new parent.
this._parent = parent;
}
else if (!_parents) {
// If there's already one parent, but not multiple, allocate an Array to
// store the rest of the parent Subscriptions.
this._parents = [parent];
}
else if (_parents.indexOf(parent) === -1) {
// Only add the new parent to the _parents list if it's not already there.
_parents.push(parent);
}
};
/** @nocollapse */
Subscription.EMPTY = (function (empty) {
empty.closed = true;
return empty;
}(new Subscription()));
return Subscription;
}());
function flattenUnsubscriptionErrors(errors) {
return errors.reduce(function (errs, err) { return errs.concat((err instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_5__["UnsubscriptionError"]) ? err.errors : err); }, []);
}
//# sourceMappingURL=Subscription.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/config.js":
/*!****************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/config.js ***!
\****************************************************/
/*! exports provided: config */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return config; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
var _enable_super_gross_mode_that_will_cause_bad_things = false;
/**
* The global configuration object for RxJS, used to configure things
* like what Promise contructor should used to create Promises
*/
var config = {
/**
* The promise constructor used by default for methods such as
* {@link toPromise} and {@link forEach}
*/
Promise: undefined,
/**
* If true, turns on synchronous error rethrowing, which is a deprecated behavior
* in v6 and higher. This behavior enables bad patterns like wrapping a subscribe
* call in a try/catch block. It also enables producer interference, a nasty bug
* where a multicast can be broken for all observers by a downstream consumer with
* an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BY TIME
* FOR MIGRATION REASONS.
*/
set useDeprecatedSynchronousErrorHandling(value) {
if (value) {
var error = /*@__PURE__*/ new Error();
/*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
}
else if (_enable_super_gross_mode_that_will_cause_bad_things) {
/*@__PURE__*/ console.log('RxJS: Back to a better error behavior. Thank you. <3');
}
_enable_super_gross_mode_that_will_cause_bad_things = value;
},
get useDeprecatedSynchronousErrorHandling() {
return _enable_super_gross_mode_that_will_cause_bad_things;
},
};
//# sourceMappingURL=config.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/ConnectableObservable.js":
/*!******************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/ConnectableObservable.js ***!
\******************************************************************************/
/*! exports provided: ConnectableObservable, connectableObservableDescriptor */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return ConnectableObservable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "connectableObservableDescriptor", function() { return connectableObservableDescriptor; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony import */ var _operators_refCount__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../operators/refCount */ "./node_modules/rxjs/_esm5/internal/operators/refCount.js");
/** PURE_IMPORTS_START tslib,_Subject,_Observable,_Subscriber,_Subscription,_operators_refCount PURE_IMPORTS_END */
/**
* @class ConnectableObservable<T>
*/
var ConnectableObservable = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ConnectableObservable, _super);
function ConnectableObservable(source, subjectFactory) {
var _this = _super.call(this) || this;
_this.source = source;
_this.subjectFactory = subjectFactory;
_this._refCount = 0;
/** @internal */
_this._isComplete = false;
return _this;
}
/** @deprecated This is an internal implementation detail, do not use. */
ConnectableObservable.prototype._subscribe = function (subscriber) {
return this.getSubject().subscribe(subscriber);
};
ConnectableObservable.prototype.getSubject = function () {
var subject = this._subject;
if (!subject || subject.isStopped) {
this._subject = this.subjectFactory();
}
return this._subject;
};
ConnectableObservable.prototype.connect = function () {
var connection = this._connection;
if (!connection) {
this._isComplete = false;
connection = this._connection = new _Subscription__WEBPACK_IMPORTED_MODULE_4__["Subscription"]();
connection.add(this.source
.subscribe(new ConnectableSubscriber(this.getSubject(), this)));
if (connection.closed) {
this._connection = null;
connection = _Subscription__WEBPACK_IMPORTED_MODULE_4__["Subscription"].EMPTY;
}
else {
this._connection = connection;
}
}
return connection;
};
ConnectableObservable.prototype.refCount = function () {
return Object(_operators_refCount__WEBPACK_IMPORTED_MODULE_5__["refCount"])()(this);
};
return ConnectableObservable;
}(_Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"]));
var connectableProto = ConnectableObservable.prototype;
var connectableObservableDescriptor = {
operator: { value: null },
_refCount: { value: 0, writable: true },
_subject: { value: null, writable: true },
_connection: { value: null, writable: true },
_subscribe: { value: connectableProto._subscribe },
_isComplete: { value: connectableProto._isComplete, writable: true },
getSubject: { value: connectableProto.getSubject },
connect: { value: connectableProto.connect },
refCount: { value: connectableProto.refCount }
};
var ConnectableSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ConnectableSubscriber, _super);
function ConnectableSubscriber(destination, connectable) {
var _this = _super.call(this, destination) || this;
_this.connectable = connectable;
return _this;
}
ConnectableSubscriber.prototype._error = function (err) {
this._unsubscribe();
_super.prototype._error.call(this, err);
};
ConnectableSubscriber.prototype._complete = function () {
this.connectable._isComplete = true;
this._unsubscribe();
_super.prototype._complete.call(this);
};
ConnectableSubscriber.prototype._unsubscribe = function () {
var connectable = this.connectable;
if (connectable) {
this.connectable = null;
var connection = connectable._connection;
connectable._refCount = 0;
connectable._subject = null;
connectable._connection = null;
if (connection) {
connection.unsubscribe();
}
}
};
return ConnectableSubscriber;
}(_Subject__WEBPACK_IMPORTED_MODULE_1__["SubjectSubscriber"]));
var RefCountOperator = /*@__PURE__*/ (function () {
function RefCountOperator(connectable) {
this.connectable = connectable;
}
RefCountOperator.prototype.call = function (subscriber, source) {
var connectable = this.connectable;
connectable._refCount++;
var refCounter = new RefCountSubscriber(subscriber, connectable);
var subscription = source.subscribe(refCounter);
if (!refCounter.closed) {
refCounter.connection = connectable.connect();
}
return subscription;
};
return RefCountOperator;
}());
var RefCountSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RefCountSubscriber, _super);
function RefCountSubscriber(destination, connectable) {
var _this = _super.call(this, destination) || this;
_this.connectable = connectable;
return _this;
}
RefCountSubscriber.prototype._unsubscribe = function () {
var connectable = this.connectable;
if (!connectable) {
this.connection = null;
return;
}
this.connectable = null;
var refCount = connectable._refCount;
if (refCount <= 0) {
this.connection = null;
return;
}
connectable._refCount = refCount - 1;
if (refCount > 1) {
this.connection = null;
return;
}
///
// Compare the local RefCountSubscriber's connection Subscription to the
// connection Subscription on the shared ConnectableObservable. In cases
// where the ConnectableObservable source synchronously emits values, and
// the RefCountSubscriber's downstream Observers synchronously unsubscribe,
// execution continues to here before the RefCountOperator has a chance to
// supply the RefCountSubscriber with the shared connection Subscription.
// For example:
// ```
// Observable.range(0, 10)
// .publish()
// .refCount()
// .take(5)
// .subscribe();
// ```
// In order to account for this case, RefCountSubscriber should only dispose
// the ConnectableObservable's shared connection Subscription if the
// connection Subscription exists, *and* either:
// a. RefCountSubscriber doesn't have a reference to the shared connection
// Subscription yet, or,
// b. RefCountSubscriber's connection Subscription reference is identical
// to the shared connection Subscription
///
var connection = this.connection;
var sharedConnection = connectable._connection;
this.connection = null;
if (sharedConnection && (!connection || sharedConnection === connection)) {
sharedConnection.unsubscribe();
}
};
return RefCountSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"]));
//# sourceMappingURL=ConnectableObservable.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/SubscribeOnObservable.js":
/*!******************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/SubscribeOnObservable.js ***!
\******************************************************************************/
/*! exports provided: SubscribeOnObservable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubscribeOnObservable", function() { return SubscribeOnObservable; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduler/asap */ "./node_modules/rxjs/_esm5/internal/scheduler/asap.js");
/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isNumeric */ "./node_modules/rxjs/_esm5/internal/util/isNumeric.js");
/** PURE_IMPORTS_START tslib,_Observable,_scheduler_asap,_util_isNumeric PURE_IMPORTS_END */
/**
* We need this JSDoc comment for affecting ESDoc.
* @extends {Ignored}
* @hide true
*/
var SubscribeOnObservable = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubscribeOnObservable, _super);
function SubscribeOnObservable(source, delayTime, scheduler) {
if (delayTime === void 0) {
delayTime = 0;
}
if (scheduler === void 0) {
scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__["asap"];
}
var _this = _super.call(this) || this;
_this.source = source;
_this.delayTime = delayTime;
_this.scheduler = scheduler;
if (!Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_3__["isNumeric"])(delayTime) || delayTime < 0) {
_this.delayTime = 0;
}
if (!scheduler || typeof scheduler.schedule !== 'function') {
_this.scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__["asap"];
}
return _this;
}
/** @nocollapse */
SubscribeOnObservable.create = function (source, delay, scheduler) {
if (delay === void 0) {
delay = 0;
}
if (scheduler === void 0) {
scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__["asap"];
}
return new SubscribeOnObservable(source, delay, scheduler);
};
/** @nocollapse */
SubscribeOnObservable.dispatch = function (arg) {
var source = arg.source, subscriber = arg.subscriber;
return this.add(source.subscribe(subscriber));
};
/** @deprecated This is an internal implementation detail, do not use. */
SubscribeOnObservable.prototype._subscribe = function (subscriber) {
var delay = this.delayTime;
var source = this.source;
var scheduler = this.scheduler;
return scheduler.schedule(SubscribeOnObservable.dispatch, delay, {
source: source, subscriber: subscriber
});
};
return SubscribeOnObservable;
}(_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"]));
//# sourceMappingURL=SubscribeOnObservable.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/bindCallback.js":
/*!*********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/bindCallback.js ***!
\*********************************************************************/
/*! exports provided: bindCallback */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return bindCallback; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AsyncSubject */ "./node_modules/rxjs/_esm5/internal/AsyncSubject.js");
/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/map */ "./node_modules/rxjs/_esm5/internal/operators/map.js");
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm5/internal/util/isScheduler.js");
/** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_isArray,_util_isScheduler PURE_IMPORTS_END */
// tslint:enable:max-line-length
/**
* Converts a callback API to a function that returns an Observable.
*
* <span class="informal">Give it a function `f` of type `f(x, callback)` and
* it will return a function `g` that when called as `g(x)` will output an
* Observable.</span>
*
* `bindCallback` is not an operator because its input and output are not
* Observables. The input is a function `func` with some parameters, the
* last parameter must be a callback function that `func` calls when it is
* done.
*
* The output of `bindCallback` is a function that takes the same parameters
* as `func`, except the last one (the callback). When the output function
* is called with arguments it will return an Observable. If function `func`
* calls its callback with one argument the Observable will emit that value.
* If on the other hand the callback is called with multiple values the resulting
* Observable will emit an array with said values as arguments.
*
* It is very important to remember that input function `func` is not called
* when the output function is, but rather when the Observable returned by the output
* function is subscribed. This means if `func` makes an AJAX request, that request
* will be made every time someone subscribes to the resulting Observable, but not before.
*
* The last optional parameter - {@link Scheduler} - can be used to control when the call
* to `func` happens after someone subscribes to Observable, as well as when results
* passed to callback will be emitted. By default, the subscription to an Observable calls `func`
* synchronously, but using `Scheduler.async` as the last parameter will defer the call to `func`,
* just like wrapping the call in `setTimeout` with a timeout of `0` would. If you use the async Scheduler
* and call `subscribe` on the output Observable all function calls that are currently executing
* will end before `func` is invoked.
*
* By default results passed to the callback are emitted immediately after `func` invokes the callback.
* In particular, if the callback is called synchronously the subscription of the resulting Observable
* will call the `next` function synchronously as well. If you want to defer that call,
* you may use `Scheduler.async` just as before. This means that by using `Scheduler.async` you can
* ensure that `func` always calls its callback asynchronously, thus avoiding terrifying Zalgo.
*
* Note that the Observable created by the output function will always emit a single value
* and then complete immediately. If `func` calls the callback multiple times, values from subsequent
* calls will not appear in the stream. If you need to listen for multiple calls,
* you probably want to use {@link fromEvent} or {@link fromEventPattern} instead.
*
* If `func` depends on some context (`this` property) and is not already bound the context of `func`
* will be the context that the output function has at call time. In particular, if `func`
* is called as a method of some objec and if `func` is not already bound, in order to preserve the context
* it is recommended that the context of the output function is set to that object as well.
*
* If the input function calls its callback in the "node style" (i.e. first argument to callback is
* optional error parameter signaling whether the call failed or not), {@link bindNodeCallback}
* provides convenient error handling and probably is a better choice.
* `bindCallback` will treat such functions the same as any other and error parameters
* (whether passed or not) will always be interpreted as regular callback argument.
*
*
* @example <caption>Convert jQuery's getJSON to an Observable API</caption>
* // Suppose we have jQuery.getJSON('/my/url', callback)
* var getJSONAsObservable = bindCallback(jQuery.getJSON);
* var result = getJSONAsObservable('/my/url');
* result.subscribe(x => console.log(x), e => console.error(e));
*
*
* @example <caption>Receive an array of arguments passed to a callback</caption>
* someFunction((a, b, c) => {
* console.log(a); // 5
* console.log(b); // 'some string'
* console.log(c); // {someProperty: 'someValue'}
* });
*
* const boundSomeFunction = bindCallback(someFunction);
* boundSomeFunction().subscribe(values => {
* console.log(values) // [5, 'some string', {someProperty: 'someValue'}]
* });
*
*
* @example <caption>Compare behaviour with and without async Scheduler</caption>
* function iCallMyCallbackSynchronously(cb) {
* cb();
* }
*
* const boundSyncFn = bindCallback(iCallMyCallbackSynchronously);
* const boundAsyncFn = bindCallback(iCallMyCallbackSynchronously, null, Rx.Scheduler.async);
*
* boundSyncFn().subscribe(() => console.log('I was sync!'));
* boundAsyncFn().subscribe(() => console.log('I was async!'));
* console.log('This happened...');
*
* // Logs:
* // I was sync!
* // This happened...
* // I was async!
*
*
* @example <caption>Use bindCallback on an object method</caption>
* const boundMethod = bindCallback(someObject.methodWithCallback);
* boundMethod.call(someObject) // make sure methodWithCallback has access to someObject
* .subscribe(subscriber);
*
*
* @see {@link bindNodeCallback}
* @see {@link from}
* @see {@link fromPromise}
*
* @param {function} func A function with a callback as the last parameter.
* @param {Scheduler} [scheduler] The scheduler on which to schedule the
* callbacks.
* @return {function(...params: *): Observable} A function which returns the
* Observable that delivers the same values the callback would deliver.
* @name bindCallback
*/
function bindCallback(callbackFunc, resultSelector, scheduler) {
if (resultSelector) {
if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(resultSelector)) {
scheduler = resultSelector;
}
else {
// DEPRECATED PATH
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return bindCallback(callbackFunc, scheduler).apply(void 0, args).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_3__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
};
}
}
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var context = this;
var subject;
var params = {
context: context,
subject: subject,
callbackFunc: callbackFunc,
scheduler: scheduler,
};
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
if (!scheduler) {
if (!subject) {
subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
var handler = function () {
var innerArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
innerArgs[_i] = arguments[_i];
}
subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
subject.complete();
};
try {
callbackFunc.apply(context, args.concat([handler]));
}
catch (err) {
subject.error(err);
}
}
return subject.subscribe(subscriber);
}
else {
var state = {
args: args, subscriber: subscriber, params: params,
};
return scheduler.schedule(dispatch, 0, state);
}
});
};
}
function dispatch(state) {
var _this = this;
var self = this;
var args = state.args, subscriber = state.subscriber, params = state.params;
var callbackFunc = params.callbackFunc, context = params.context, scheduler = params.scheduler;
var subject = params.subject;
if (!subject) {
subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
var handler = function () {
var innerArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
innerArgs[_i] = arguments[_i];
}
var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
_this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
};
try {
callbackFunc.apply(context, args.concat([handler]));
}
catch (err) {
subject.error(err);
}
}
this.add(subject.subscribe(subscriber));
}
function dispatchNext(state) {
var value = state.value, subject = state.subject;
subject.next(value);
subject.complete();
}
function dispatchError(state) {
var err = state.err, subject = state.subject;
subject.error(err);
}
//# sourceMappingURL=bindCallback.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/bindNodeCallback.js":
/*!*************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/bindNodeCallback.js ***!
\*************************************************************************/
/*! exports provided: bindNodeCallback */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return bindNodeCallback; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AsyncSubject */ "./node_modules/rxjs/_esm5/internal/AsyncSubject.js");
/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/map */ "./node_modules/rxjs/_esm5/internal/operators/map.js");
/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm5/internal/util/isScheduler.js");
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_isScheduler,_util_isArray PURE_IMPORTS_END */
/**
* Converts a Node.js-style callback API to a function that returns an
* Observable.
*
* <span class="informal">It's just like {@link bindCallback}, but the
* callback is expected to be of type `callback(error, result)`.</span>
*
* `bindNodeCallback` is not an operator because its input and output are not
* Observables. The input is a function `func` with some parameters, but the
* last parameter must be a callback function that `func` calls when it is
* done. The callback function is expected to follow Node.js conventions,
* where the first argument to the callback is an error object, signaling
* whether call was successful. If that object is passed to callback, it means
* something went wrong.
*
* The output of `bindNodeCallback` is a function that takes the same
* parameters as `func`, except the last one (the callback). When the output
* function is called with arguments, it will return an Observable.
* If `func` calls its callback with error parameter present, Observable will
* error with that value as well. If error parameter is not passed, Observable will emit
* second parameter. If there are more parameters (third and so on),
* Observable will emit an array with all arguments, except first error argument.
*
* Note that `func` will not be called at the same time output function is,
* but rather whenever resulting Observable is subscribed. By default call to
* `func` will happen synchronously after subscription, but that can be changed
* with proper {@link Scheduler} provided as optional third parameter. Scheduler
* can also control when values from callback will be emitted by Observable.
* To find out more, check out documentation for {@link bindCallback}, where
* Scheduler works exactly the same.
*
* As in {@link bindCallback}, context (`this` property) of input function will be set to context
* of returned function, when it is called.
*
* After Observable emits value, it will complete immediately. This means
* even if `func` calls callback again, values from second and consecutive
* calls will never appear on the stream. If you need to handle functions
* that call callbacks multiple times, check out {@link fromEvent} or
* {@link fromEventPattern} instead.
*
* Note that `bindNodeCallback` can be used in non-Node.js environments as well.
* "Node.js-style" callbacks are just a convention, so if you write for
* browsers or any other environment and API you use implements that callback style,
* `bindNodeCallback` can be safely used on that API functions as well.
*
* Remember that Error object passed to callback does not have to be an instance
* of JavaScript built-in `Error` object. In fact, it does not even have to an object.
* Error parameter of callback function is interpreted as "present", when value
* of that parameter is truthy. It could be, for example, non-zero number, non-empty
* string or boolean `true`. In all of these cases resulting Observable would error
* with that value. This means usually regular style callbacks will fail very often when
* `bindNodeCallback` is used. If your Observable errors much more often then you
* would expect, check if callback really is called in Node.js-style and, if not,
* switch to {@link bindCallback} instead.
*
* Note that even if error parameter is technically present in callback, but its value
* is falsy, it still won't appear in array emitted by Observable.
*
*
* @example <caption>Read a file from the filesystem and get the data as an Observable</caption>
* import * as fs from 'fs';
* var readFileAsObservable = bindNodeCallback(fs.readFile);
* var result = readFileAsObservable('./roadNames.txt', 'utf8');
* result.subscribe(x => console.log(x), e => console.error(e));
*
*
* @example <caption>Use on function calling callback with multiple arguments</caption>
* someFunction((err, a, b) => {
* console.log(err); // null
* console.log(a); // 5
* console.log(b); // "some string"
* });
* var boundSomeFunction = bindNodeCallback(someFunction);
* boundSomeFunction()
* .subscribe(value => {
* console.log(value); // [5, "some string"]
* });
*
* @example <caption>Use on function calling callback in regular style</caption>
* someFunction(a => {
* console.log(a); // 5
* });
* var boundSomeFunction = bindNodeCallback(someFunction);
* boundSomeFunction()
* .subscribe(
* value => {} // never gets called
* err => console.log(err) // 5
* );
*
*
* @see {@link bindCallback}
* @see {@link from}
* @see {@link fromPromise}
*
* @param {function} func Function with a Node.js-style callback as the last parameter.
* @param {Scheduler} [scheduler] The scheduler on which to schedule the
* callbacks.
* @return {function(...params: *): Observable} A function which returns the
* Observable that delivers the same values the Node.js callback would
* deliver.
* @name bindNodeCallback
*/
function bindNodeCallback(callbackFunc, resultSelector, scheduler) {
if (resultSelector) {
if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(resultSelector)) {
scheduler = resultSelector;
}
else {
// DEPRECATED PATH
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return bindNodeCallback(callbackFunc, scheduler).apply(void 0, args).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_4__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
};
}
}
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var params = {
subject: undefined,
args: args,
callbackFunc: callbackFunc,
scheduler: scheduler,
context: this,
};
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var context = params.context;
var subject = params.subject;
if (!scheduler) {
if (!subject) {
subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
var handler = function () {
var innerArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
innerArgs[_i] = arguments[_i];
}
var err = innerArgs.shift();
if (err) {
subject.error(err);
return;
}
subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
subject.complete();
};
try {
callbackFunc.apply(context, args.concat([handler]));
}
catch (err) {
subject.error(err);
}
}
return subject.subscribe(subscriber);
}
else {
return scheduler.schedule(dispatch, 0, { params: params, subscriber: subscriber, context: context });
}
});
};
}
function dispatch(state) {
var _this = this;
var params = state.params, subscriber = state.subscriber, context = state.context;
var callbackFunc = params.callbackFunc, args = params.args, scheduler = params.scheduler;
var subject = params.subject;
if (!subject) {
subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
var handler = function () {
var innerArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
innerArgs[_i] = arguments[_i];
}
var err = innerArgs.shift();
if (err) {
_this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
}
else {
var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
_this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
}
};
try {
callbackFunc.apply(context, args.concat([handler]));
}
catch (err) {
this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
}
}
this.add(subject.subscribe(subscriber));
}
function dispatchNext(arg) {
var value = arg.value, subject = arg.subject;
subject.next(value);
subject.complete();
}
function dispatchError(arg) {
var err = arg.err, subject = arg.subject;
subject.error(err);
}
//# sourceMappingURL=bindNodeCallback.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/combineLatest.js":
/*!**********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/combineLatest.js ***!
\**********************************************************************/
/*! exports provided: combineLatest, CombineLatestOperator, CombineLatestSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CombineLatestOperator", function() { return CombineLatestOperator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CombineLatestSubscriber", function() { return CombineLatestSubscriber; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm5/internal/util/isScheduler.js");
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./fromArray */ "./node_modules/rxjs/_esm5/internal/observable/fromArray.js");
/** PURE_IMPORTS_START tslib,_util_isScheduler,_util_isArray,_OuterSubscriber,_util_subscribeToResult,_fromArray PURE_IMPORTS_END */
var NONE = {};
/* tslint:enable:max-line-length */
/**
* Combines multiple Observables to create an Observable whose values are
* calculated from the latest values of each of its input Observables.
*
* <span class="informal">Whenever any input Observable emits a value, it
* computes a formula using the latest values from all the inputs, then emits
* the output of that formula.</span>
*
* <img src="./img/combineLatest.png" width="100%">
*
* `combineLatest` combines the values from all the Observables passed as
* arguments. This is done by subscribing to each Observable in order and,
* whenever any Observable emits, collecting an array of the most recent
* values from each Observable. So if you pass `n` Observables to operator,
* returned Observable will always emit an array of `n` values, in order
* corresponding to order of passed Observables (value from the first Observable
* on the first place and so on).
*
* Static version of `combineLatest` accepts either an array of Observables
* or each Observable can be put directly as an argument. Note that array of
* Observables is good choice, if you don't know beforehand how many Observables
* you will combine. Passing empty array will result in Observable that
* completes immediately.
*
* To ensure output array has always the same length, `combineLatest` will
* actually wait for all input Observables to emit at least once,
* before it starts emitting results. This means if some Observable emits
* values before other Observables started emitting, all that values but last
* will be lost. On the other hand, is some Observable does not emit value but
* completes, resulting Observable will complete at the same moment without
* emitting anything, since it will be now impossible to include value from
* completed Observable in resulting array. Also, if some input Observable does
* not emit any value and never completes, `combineLatest` will also never emit
* and never complete, since, again, it will wait for all streams to emit some
* value.
*
* If at least one Observable was passed to `combineLatest` and all passed Observables
* emitted something, resulting Observable will complete when all combined
* streams complete. So even if some Observable completes, result of
* `combineLatest` will still emit values when other Observables do. In case
* of completed Observable, its value from now on will always be the last
* emitted value. On the other hand, if any Observable errors, `combineLatest`
* will error immediately as well, and all other Observables will be unsubscribed.
*
* `combineLatest` accepts as optional parameter `project` function, which takes
* as arguments all values that would normally be emitted by resulting Observable.
* `project` can return any kind of value, which will be then emitted by Observable
* instead of default array. Note that `project` does not take as argument that array
* of values, but values themselves. That means default `project` can be imagined
* as function that takes all its arguments and puts them into an array.
*
*
* @example <caption>Combine two timer Observables</caption>
* const firstTimer = Rx.Observable.timer(0, 1000); // emit 0, 1, 2... after every second, starting from now
* const secondTimer = Rx.Observable.timer(500, 1000); // emit 0, 1, 2... after every second, starting 0,5s from now
* const combinedTimers = Rx.Observable.combineLatest(firstTimer, secondTimer);
* combinedTimers.subscribe(value => console.log(value));
* // Logs
* // [0, 0] after 0.5s
* // [1, 0] after 1s
* // [1, 1] after 1.5s
* // [2, 1] after 2s
*
*
* @example <caption>Combine an array of Observables</caption>
* const observables = [1, 5, 10].map(
* n => Rx.Observable.of(n).delay(n * 1000).startWith(0) // emit 0 and then emit n after n seconds
* );
* const combined = Rx.Observable.combineLatest(observables);
* combined.subscribe(value => console.log(value));
* // Logs
* // [0, 0, 0] immediately
* // [1, 0, 0] after 1s
* // [1, 5, 0] after 5s
* // [1, 5, 10] after 10s
*
*
* @example <caption>Use project function to dynamically calculate the Body-Mass Index</caption>
* var weight = Rx.Observable.of(70, 72, 76, 79, 75);
* var height = Rx.Observable.of(1.76, 1.77, 1.78);
* var bmi = Rx.Observable.combineLatest(weight, height, (w, h) => w / (h * h));
* bmi.subscribe(x => console.log('BMI is ' + x));
*
* // With output to console:
* // BMI is 24.212293388429753
* // BMI is 23.93948099205209
* // BMI is 23.671253629592222
*
*
* @see {@link combineAll}
* @see {@link merge}
* @see {@link withLatestFrom}
*
* @param {ObservableInput} observable1 An input Observable to combine with other Observables.
* @param {ObservableInput} observable2 An input Observable to combine with other Observables.
* More than one input Observables may be given as arguments
* or an array of Observables may be given as the first argument.
* @param {function} [project] An optional function to project the values from
* the combined latest values into a new value on the output Observable.
* @param {Scheduler} [scheduler=null] The IScheduler to use for subscribing to
* each input Observable.
* @return {Observable} An Observable of projected values from the most recent
* values from each input Observable, or an array of the most recent values from
* each input Observable.
*/
function combineLatest() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
var resultSelector = null;
var scheduler = null;
if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(observables[observables.length - 1])) {
scheduler = observables.pop();
}
if (typeof observables[observables.length - 1] === 'function') {
resultSelector = observables.pop();
}
// if the first and only other argument besides the resultSelector is an array
// assume it's been called with `combineLatest([obs1, obs2, obs3], resultSelector)`
if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(observables[0])) {
observables = observables[0];
}
return Object(_fromArray__WEBPACK_IMPORTED_MODULE_5__["fromArray"])(observables, scheduler).lift(new CombineLatestOperator(resultSelector));
}
var CombineLatestOperator = /*@__PURE__*/ (function () {
function CombineLatestOperator(resultSelector) {
this.resultSelector = resultSelector;
}
CombineLatestOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));
};
return CombineLatestOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var CombineLatestSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CombineLatestSubscriber, _super);
function CombineLatestSubscriber(destination, resultSelector) {
var _this = _super.call(this, destination) || this;
_this.resultSelector = resultSelector;
_this.active = 0;
_this.values = [];
_this.observables = [];
return _this;
}
CombineLatestSubscriber.prototype._next = function (observable) {
this.values.push(NONE);
this.observables.push(observable);
};
CombineLatestSubscriber.prototype._complete = function () {
var observables = this.observables;
var len = observables.length;
if (len === 0) {
this.destination.complete();
}
else {
this.active = len;
this.toRespond = len;
for (var i = 0; i < len; i++) {
var observable = observables[i];
this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, observable, observable, i));
}
}
};
CombineLatestSubscriber.prototype.notifyComplete = function (unused) {
if ((this.active -= 1) === 0) {
this.destination.complete();
}
};
CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
var values = this.values;
var oldVal = values[outerIndex];
var toRespond = !this.toRespond
? 0
: oldVal === NONE ? --this.toRespond : this.toRespond;
values[outerIndex] = innerValue;
if (toRespond === 0) {
if (this.resultSelector) {
this._tryResultSelector(values);
}
else {
this.destination.next(values.slice());
}
}
};
CombineLatestSubscriber.prototype._tryResultSelector = function (values) {
var result;
try {
result = this.resultSelector.apply(this, values);
}
catch (err) {
this.destination.error(err);
return;
}
this.destination.next(result);
};
return CombineLatestSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
//# sourceMappingURL=combineLatest.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/concat.js":
/*!***************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/concat.js ***!
\***************************************************************/
/*! exports provided: concat */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; });
/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm5/internal/util/isScheduler.js");
/* harmony import */ var _of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./of */ "./node_modules/rxjs/_esm5/internal/observable/of.js");
/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./from */ "./node_modules/rxjs/_esm5/internal/observable/from.js");
/* harmony import */ var _operators_concatAll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../operators/concatAll */ "./node_modules/rxjs/_esm5/internal/operators/concatAll.js");
/** PURE_IMPORTS_START _util_isScheduler,_of,_from,_operators_concatAll PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Creates an output Observable which sequentially emits all values from given
* Observable and then moves on to the next.
*
* <span class="informal">Concatenates multiple Observables together by
* sequentially emitting their values, one Observable after the other.</span>
*
* <img src="./img/concat.png" width="100%">
*
* `concat` joins multiple Observables together, by subscribing to them one at a time and
* merging their results into the output Observable. You can pass either an array of
* Observables, or put them directly as arguments. Passing an empty array will result
* in Observable that completes immediately.
*
* `concat` will subscribe to first input Observable and emit all its values, without
* changing or affecting them in any way. When that Observable completes, it will
* subscribe to then next Observable passed and, again, emit its values. This will be
* repeated, until the operator runs out of Observables. When last input Observable completes,
* `concat` will complete as well. At any given moment only one Observable passed to operator
* emits values. If you would like to emit values from passed Observables concurrently, check out
* {@link merge} instead, especially with optional `concurrent` parameter. As a matter of fact,
* `concat` is an equivalent of `merge` operator with `concurrent` parameter set to `1`.
*
* Note that if some input Observable never completes, `concat` will also never complete
* and Observables following the one that did not complete will never be subscribed. On the other
* hand, if some Observable simply completes immediately after it is subscribed, it will be
* invisible for `concat`, which will just move on to the next Observable.
*
* If any Observable in chain errors, instead of passing control to the next Observable,
* `concat` will error immediately as well. Observables that would be subscribed after
* the one that emitted error, never will.
*
* If you pass to `concat` the same Observable many times, its stream of values
* will be "replayed" on every subscription, which means you can repeat given Observable
* as many times as you like. If passing the same Observable to `concat` 1000 times becomes tedious,
* you can always use {@link repeat}.
*
* @example <caption>Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10</caption>
* var timer = Rx.Observable.interval(1000).take(4);
* var sequence = Rx.Observable.range(1, 10);
* var result = Rx.Observable.concat(timer, sequence);
* result.subscribe(x => console.log(x));
*
* // results in:
* // 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10
*
*
* @example <caption>Concatenate an array of 3 Observables</caption>
* var timer1 = Rx.Observable.interval(1000).take(10);
* var timer2 = Rx.Observable.interval(2000).take(6);
* var timer3 = Rx.Observable.interval(500).take(10);
* var result = Rx.Observable.concat([timer1, timer2, timer3]); // note that array is passed
* result.subscribe(x => console.log(x));
*
* // results in the following:
* // (Prints to console sequentially)
* // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9
* // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5
* // -500ms-> 0 -500ms-> 1 -500ms-> ... 9
*
*
* @example <caption>Concatenate the same Observable to repeat it</caption>
* const timer = Rx.Observable.interval(1000).take(2);
*
* Rx.Observable.concat(timer, timer) // concating the same Observable!
* .subscribe(
* value => console.log(value),
* err => {},
* () => console.log('...and it is done!')
* );
*
* // Logs:
* // 0 after 1s
* // 1 after 2s
* // 0 after 3s
* // 1 after 4s
* // "...and it is done!" also after 4s
*
* @see {@link concatAll}
* @see {@link concatMap}
* @see {@link concatMapTo}
*
* @param {ObservableInput} input1 An input Observable to concatenate with others.
* @param {ObservableInput} input2 An input Observable to concatenate with others.
* More than one input Observables may be given as argument.
* @param {Scheduler} [scheduler=null] An optional IScheduler to schedule each
* Observable subscription on.
* @return {Observable} All values of each passed Observable merged into a
* single Observable, in order, in serial fashion.
* @static true
* @name concat
* @owner Observable
*/
function concat() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
if (observables.length === 1 || (observables.length === 2 && Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__["isScheduler"])(observables[1]))) {
return Object(_from__WEBPACK_IMPORTED_MODULE_2__["from"])(observables[0]);
}
return Object(_operators_concatAll__WEBPACK_IMPORTED_MODULE_3__["concatAll"])()(_of__WEBPACK_IMPORTED_MODULE_1__["of"].apply(void 0, observables));
}
//# sourceMappingURL=concat.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/defer.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/defer.js ***!
\**************************************************************/
/*! exports provided: defer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return defer; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./from */ "./node_modules/rxjs/_esm5/internal/observable/from.js");
/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./empty */ "./node_modules/rxjs/_esm5/internal/observable/empty.js");
/** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */
// lol
/**
* Creates an Observable that, on subscribe, calls an Observable factory to
* make an Observable for each new Observer.
*
* <span class="informal">Creates the Observable lazily, that is, only when it
* is subscribed.
* </span>
*
* <img src="./img/defer.png" width="100%">
*
* `defer` allows you to create the Observable only when the Observer
* subscribes, and create a fresh Observable for each Observer. It waits until
* an Observer subscribes to it, and then it generates an Observable,
* typically with an Observable factory function. It does this afresh for each
* subscriber, so although each subscriber may think it is subscribing to the
* same Observable, in fact each subscriber gets its own individual
* Observable.
*
* @example <caption>Subscribe to either an Observable of clicks or an Observable of interval, at random</caption>
* var clicksOrInterval = Rx.Observable.defer(function () {
* if (Math.random() > 0.5) {
* return Rx.Observable.fromEvent(document, 'click');
* } else {
* return Rx.Observable.interval(1000);
* }
* });
* clicksOrInterval.subscribe(x => console.log(x));
*
* // Results in the following behavior:
* // If the result of Math.random() is greater than 0.5 it will listen
* // for clicks anywhere on the "document"; when document is clicked it
* // will log a MouseEvent object to the console. If the result is less
* // than 0.5 it will emit ascending numbers, one every second(1000ms).
*
* @see {@link create}
*
* @param {function(): SubscribableOrPromise} observableFactory The Observable
* factory function to invoke for each Observer that subscribes to the output
* Observable. May also return a Promise, which will be converted on the fly
* to an Observable.
* @return {Observable} An Observable whose Observers' subscriptions trigger
* an invocation of the given Observable factory function.
* @static true
* @name defer
* @owner Observable
*/
function defer(observableFactory) {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var input;
try {
input = observableFactory();
}
catch (err) {
subscriber.error(err);
return undefined;
}
var source = input ? Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(input) : Object(_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])();
return source.subscribe(subscriber);
});
}
//# sourceMappingURL=defer.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/empty.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/empty.js ***!
\**************************************************************/
/*! exports provided: EMPTY, empty, emptyScheduled */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return EMPTY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "emptyScheduled", function() { return emptyScheduled; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
/**
* The same Observable instance returned by any call to {@link empty} without a
* {@link Scheduler}. It is preferrable to use this over `empty()`.
*/
var EMPTY = /*@__PURE__*/ new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return subscriber.complete(); });
/**
* Creates an Observable that emits no items to the Observer and immediately
* emits a complete notification.
*
* <span class="informal">Just emits 'complete', and nothing else.
* </span>
*
* <img src="./img/empty.png" width="100%">
*
* This static operator is useful for creating a simple Observable that only
* emits the complete notification. It can be used for composing with other
* Observables, such as in a {@link mergeMap}.
*
* @example <caption>Emit the number 7, then complete.</caption>
* var result = Rx.Observable.empty().startWith(7);
* result.subscribe(x => console.log(x));
*
* @example <caption>Map and flatten only odd numbers to the sequence 'a', 'b', 'c'</caption>
* var interval = Rx.Observable.interval(1000);
* var result = interval.mergeMap(x =>
* x % 2 === 1 ? Rx.Observable.of('a', 'b', 'c') : Rx.Observable.empty()
* );
* result.subscribe(x => console.log(x));
*
* // Results in the following to the console:
* // x is equal to the count on the interval eg(0,1,2,3,...)
* // x will occur every 1000ms
* // if x % 2 is equal to 1 print abc
* // if x % 2 is not equal to 1 nothing will be output
*
* @see {@link create}
* @see {@link never}
* @see {@link of}
* @see {@link throw}
*
* @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling
* the emission of the complete notification.
* @return {Observable} An "empty" Observable: emits only the complete
* notification.
* @static true
* @name empty
* @owner Observable
* @deprecated Deprecated in favor of using EMPTY constant.
*/
function empty(scheduler) {
return scheduler ? emptyScheduled(scheduler) : EMPTY;
}
function emptyScheduled(scheduler) {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });
}
//# sourceMappingURL=empty.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/forkJoin.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/forkJoin.js ***!
\*****************************************************************/
/*! exports provided: forkJoin */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return forkJoin; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./empty */ "./node_modules/rxjs/_esm5/internal/observable/empty.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../operators/map */ "./node_modules/rxjs/_esm5/internal/operators/map.js");
/** PURE_IMPORTS_START tslib,_Observable,_util_isArray,_empty,_util_subscribeToResult,_OuterSubscriber,_operators_map PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Joins last values emitted by passed Observables.
*
* <span class="informal">Wait for Observables to complete and then combine last values they emitted.</span>
*
* <img src="./img/forkJoin.png" width="100%">
*
* `forkJoin` is an operator that takes any number of Observables which can be passed either as an array
* or directly as arguments. If no input Observables are provided, resulting stream will complete
* immediately.
*
* `forkJoin` will wait for all passed Observables to complete and then it will emit an array with last
* values from corresponding Observables. So if you pass `n` Observables to the operator, resulting
* array will have `n` values, where first value is the last thing emitted by the first Observable,
* second value is the last thing emitted by the second Observable and so on. That means `forkJoin` will
* not emit more than once and it will complete after that. If you need to emit combined values not only
* at the end of lifecycle of passed Observables, but also throughout it, try out {@link combineLatest}
* or {@link zip} instead.
*
* In order for resulting array to have the same length as the number of input Observables, whenever any of
* that Observables completes without emitting any value, `forkJoin` will complete at that moment as well
* and it will not emit anything either, even if it already has some last values from other Observables.
* Conversely, if there is an Observable that never completes, `forkJoin` will never complete as well,
* unless at any point some other Observable completes without emitting value, which brings us back to
* the previous case. Overall, in order for `forkJoin` to emit a value, all Observables passed as arguments
* have to emit something at least once and complete.
*
* If any input Observable errors at some point, `forkJoin` will error as well and all other Observables
* will be immediately unsubscribed.
*
* Optionally `forkJoin` accepts project function, that will be called with values which normally
* would land in emitted array. Whatever is returned by project function, will appear in output
* Observable instead. This means that default project can be thought of as a function that takes
* all its arguments and puts them into an array. Note that project function will be called only
* when output Observable is supposed to emit a result.
*
* @example <caption>Use forkJoin with operator emitting immediately</caption>
* import { forkJoin, of } from 'rxjs';
*
* const observable = forkJoin(
* of(1, 2, 3, 4),
* of(5, 6, 7, 8)
* );
* observable.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('This is how it ends!')
* );
*
* // Logs:
* // [4, 8]
* // "This is how it ends!"
*
*
* @example <caption>Use forkJoin with operator emitting after some time</caption>
* import { forkJoin, interval } from 'rxjs';
* import { take } from 'rxjs/operators';
*
* const observable = forkJoin(
* interval(1000).pipe(take(3)), // emit 0, 1, 2 every second and complete
* interval(500).pipe(take(4)) // emit 0, 1, 2, 3 every half a second and complete
* );
* observable.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('This is how it ends!')
* );
*
* // Logs:
* // [2, 3] after 3 seconds
* // "This is how it ends!" immediately after
*
*
* @example <caption>Use forkJoin with project function</caption>
* import { jorkJoin, interval } from 'rxjs';
* import { take } from 'rxjs/operators';
*
* const observable = forkJoin(
* interval(1000).pipe(take(3)), // emit 0, 1, 2 every second and complete
* interval(500).pipe(take(4)), // emit 0, 1, 2, 3 every half a second and complete
* (n, m) => n + m
* );
* observable.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('This is how it ends!')
* );
*
* // Logs:
* // 5 after 3 seconds
* // "This is how it ends!" immediately after
*
* @see {@link combineLatest}
* @see {@link zip}
*
* @param {...ObservableInput} sources Any number of Observables provided either as an array or as an arguments
* passed directly to the operator.
* @param {function} [project] Function that takes values emitted by input Observables and returns value
* that will appear in resulting Observable instead of default array.
* @return {Observable} Observable emitting either an array of last values emitted by passed Observables
* or value from project function.
*/
function forkJoin() {
var sources = [];
for (var _i = 0; _i < arguments.length; _i++) {
sources[_i] = arguments[_i];
}
var resultSelector;
if (typeof sources[sources.length - 1] === 'function') {
// DEPRECATED PATH
resultSelector = sources.pop();
}
// if the first and only other argument is an array
// assume it's been called with `forkJoin([obs1, obs2, obs3])`
if (sources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(sources[0])) {
sources = sources[0];
}
if (sources.length === 0) {
return _empty__WEBPACK_IMPORTED_MODULE_3__["EMPTY"];
}
if (resultSelector) {
// DEPRECATED PATH
return forkJoin(sources).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_6__["map"])(function (args) { return resultSelector.apply(void 0, args); }));
}
return new _Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"](function (subscriber) {
return new ForkJoinSubscriber(subscriber, sources);
});
}
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var ForkJoinSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ForkJoinSubscriber, _super);
function ForkJoinSubscriber(destination, sources) {
var _this = _super.call(this, destination) || this;
_this.sources = sources;
_this.completed = 0;
_this.haveValues = 0;
var len = sources.length;
_this.values = new Array(len);
for (var i = 0; i < len; i++) {
var source = sources[i];
var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(_this, source, null, i);
if (innerSubscription) {
_this.add(innerSubscription);
}
}
return _this;
}
ForkJoinSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.values[outerIndex] = innerValue;
if (!innerSub._hasValue) {
innerSub._hasValue = true;
this.haveValues++;
}
};
ForkJoinSubscriber.prototype.notifyComplete = function (innerSub) {
var _a = this, destination = _a.destination, haveValues = _a.haveValues, values = _a.values;
var len = values.length;
if (!innerSub._hasValue) {
destination.complete();
return;
}
this.completed++;
if (this.completed !== len) {
return;
}
if (haveValues === len) {
destination.next(values);
}
destination.complete();
};
return ForkJoinSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_5__["OuterSubscriber"]));
//# sourceMappingURL=forkJoin.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/from.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/from.js ***!
\*************************************************************/
/*! exports provided: from */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "from", function() { return from; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _util_isPromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isPromise */ "./node_modules/rxjs/_esm5/internal/util/isPromise.js");
/* harmony import */ var _util_isArrayLike__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isArrayLike */ "./node_modules/rxjs/_esm5/internal/util/isArrayLike.js");
/* harmony import */ var _util_isInteropObservable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isInteropObservable */ "./node_modules/rxjs/_esm5/internal/util/isInteropObservable.js");
/* harmony import */ var _util_isIterable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isIterable */ "./node_modules/rxjs/_esm5/internal/util/isIterable.js");
/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./fromArray */ "./node_modules/rxjs/_esm5/internal/observable/fromArray.js");
/* harmony import */ var _fromPromise__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./fromPromise */ "./node_modules/rxjs/_esm5/internal/observable/fromPromise.js");
/* harmony import */ var _fromIterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./fromIterable */ "./node_modules/rxjs/_esm5/internal/observable/fromIterable.js");
/* harmony import */ var _fromObservable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./fromObservable */ "./node_modules/rxjs/_esm5/internal/observable/fromObservable.js");
/* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util/subscribeTo */ "./node_modules/rxjs/_esm5/internal/util/subscribeTo.js");
/** PURE_IMPORTS_START _Observable,_util_isPromise,_util_isArrayLike,_util_isInteropObservable,_util_isIterable,_fromArray,_fromPromise,_fromIterable,_fromObservable,_util_subscribeTo PURE_IMPORTS_END */
function from(input, scheduler) {
if (!scheduler) {
if (input instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) {
return input;
}
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_9__["subscribeTo"])(input));
}
if (input != null) {
if (Object(_util_isInteropObservable__WEBPACK_IMPORTED_MODULE_3__["isInteropObservable"])(input)) {
return Object(_fromObservable__WEBPACK_IMPORTED_MODULE_8__["fromObservable"])(input, scheduler);
}
else if (Object(_util_isPromise__WEBPACK_IMPORTED_MODULE_1__["isPromise"])(input)) {
return Object(_fromPromise__WEBPACK_IMPORTED_MODULE_6__["fromPromise"])(input, scheduler);
}
else if (Object(_util_isArrayLike__WEBPACK_IMPORTED_MODULE_2__["isArrayLike"])(input)) {
return Object(_fromArray__WEBPACK_IMPORTED_MODULE_5__["fromArray"])(input, scheduler);
}
else if (Object(_util_isIterable__WEBPACK_IMPORTED_MODULE_4__["isIterable"])(input) || typeof input === 'string') {
return Object(_fromIterable__WEBPACK_IMPORTED_MODULE_7__["fromIterable"])(input, scheduler);
}
}
throw new TypeError((input !== null && typeof input || input) + ' is not observable');
}
//# sourceMappingURL=from.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/fromArray.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/fromArray.js ***!
\******************************************************************/
/*! exports provided: fromArray */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromArray", function() { return fromArray; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony import */ var _util_subscribeToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToArray */ "./node_modules/rxjs/_esm5/internal/util/subscribeToArray.js");
/** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToArray PURE_IMPORTS_END */
function fromArray(input, scheduler) {
if (!scheduler) {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToArray__WEBPACK_IMPORTED_MODULE_2__["subscribeToArray"])(input));
}
else {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
var i = 0;
sub.add(scheduler.schedule(function () {
if (i === input.length) {
subscriber.complete();
return;
}
subscriber.next(input[i++]);
if (!subscriber.closed) {
sub.add(this.schedule());
}
}));
return sub;
});
}
}
//# sourceMappingURL=fromArray.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/fromEvent.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/fromEvent.js ***!
\******************************************************************/
/*! exports provided: fromEvent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return fromEvent; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isFunction */ "./node_modules/rxjs/_esm5/internal/util/isFunction.js");
/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../operators/map */ "./node_modules/rxjs/_esm5/internal/operators/map.js");
/** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */
var toString = Object.prototype.toString;
/* tslint:enable:max-line-length */
/**
* Creates an Observable that emits events of a specific type coming from the
* given event target.
*
* <span class="informal">Creates an Observable from DOM events, or Node.js
* EventEmitter events or others.</span>
*
* <img src="./img/fromEvent.png" width="100%">
*
* `fromEvent` accepts as a first argument event target, which is an object with methods
* for registering event handler functions. As a second argument it takes string that indicates
* type of event we want to listen for. `fromEvent` supports selected types of event targets,
* which are described in detail below. If your event target does not match any of the ones listed,
* you should use {@link fromEventPattern}, which can be used on arbitrary APIs.
* When it comes to APIs supported by `fromEvent`, their methods for adding and removing event
* handler functions have different names, but they all accept a string describing event type
* and function itself, which will be called whenever said event happens.
*
* Every time resulting Observable is subscribed, event handler function will be registered
* to event target on given event type. When that event fires, value
* passed as a first argument to registered function will be emitted by output Observable.
* When Observable is unsubscribed, function will be unregistered from event target.
*
* Note that if event target calls registered function with more than one argument, second
* and following arguments will not appear in resulting stream. In order to get access to them,
* you can pass to `fromEvent` optional project function, which will be called with all arguments
* passed to event handler. Output Observable will then emit value returned by project function,
* instead of the usual value.
*
* Remember that event targets listed below are checked via duck typing. It means that
* no matter what kind of object you have and no matter what environment you work in,
* you can safely use `fromEvent` on that object if it exposes described methods (provided
* of course they behave as was described above). So for example if Node.js library exposes
* event target which has the same method names as DOM EventTarget, `fromEvent` is still
* a good choice.
*
* If the API you use is more callback then event handler oriented (subscribed
* callback function fires only once and thus there is no need to manually
* unregister it), you should use {@link bindCallback} or {@link bindNodeCallback}
* instead.
*
* `fromEvent` supports following types of event targets:
*
* **DOM EventTarget**
*
* This is an object with `addEventListener` and `removeEventListener` methods.
*
* In the browser, `addEventListener` accepts - apart from event type string and event
* handler function arguments - optional third parameter, which is either an object or boolean,
* both used for additional configuration how and when passed function will be called. When
* `fromEvent` is used with event target of that type, you can provide this values
* as third parameter as well.
*
* **Node.js EventEmitter**
*
* An object with `addListener` and `removeListener` methods.
*
* **JQuery-style event target**
*
* An object with `on` and `off` methods
*
* **DOM NodeList**
*
* List of DOM Nodes, returned for example by `document.querySelectorAll` or `Node.childNodes`.
*
* Although this collection is not event target in itself, `fromEvent` will iterate over all Nodes
* it contains and install event handler function in every of them. When returned Observable
* is unsubscribed, function will be removed from all Nodes.
*
* **DOM HtmlCollection**
*
* Just as in case of NodeList it is a collection of DOM nodes. Here as well event handler function is
* installed and removed in each of elements.
*
*
* @example <caption>Emits clicks happening on the DOM document</caption>
* var clicks = fromEvent(document, 'click');
* clicks.subscribe(x => console.log(x));
*
* // Results in:
* // MouseEvent object logged to console every time a click
* // occurs on the document.
*
*
* @example <caption>Use addEventListener with capture option</caption>
* var clicksInDocument = fromEvent(document, 'click', true); // note optional configuration parameter
* // which will be passed to addEventListener
* var clicksInDiv = fromEvent(someDivInDocument, 'click');
*
* clicksInDocument.subscribe(() => console.log('document'));
* clicksInDiv.subscribe(() => console.log('div'));
*
* // By default events bubble UP in DOM tree, so normally
* // when we would click on div in document
* // "div" would be logged first and then "document".
* // Since we specified optional `capture` option, document
* // will catch event when it goes DOWN DOM tree, so console
* // will log "document" and then "div".
*
* @see {@link bindCallback}
* @see {@link bindNodeCallback}
* @see {@link fromEventPattern}
*
* @param {FromEventTarget<T>} target The DOM EventTarget, Node.js
* EventEmitter, JQuery-like event target, NodeList or HTMLCollection to attach the event handler to.
* @param {string} eventName The event name of interest, being emitted by the
* `target`.
* @param {EventListenerOptions} [options] Options to pass through to addEventListener
* @return {Observable<T>}
* @name fromEvent
*/
function fromEvent(target, eventName, options, resultSelector) {
if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(options)) {
// DEPRECATED PATH
resultSelector = options;
options = undefined;
}
if (resultSelector) {
// DEPRECATED PATH
return fromEvent(target, eventName, options).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
}
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
function handler(e) {
if (arguments.length > 1) {
subscriber.next(Array.prototype.slice.call(arguments));
}
else {
subscriber.next(e);
}
}
setupSubscription(target, eventName, handler, subscriber, options);
});
}
function setupSubscription(sourceObj, eventName, handler, subscriber, options) {
var unsubscribe;
if (isEventTarget(sourceObj)) {
var source_1 = sourceObj;
sourceObj.addEventListener(eventName, handler, options);
unsubscribe = function () { return source_1.removeEventListener(eventName, handler, options); };
}
else if (isJQueryStyleEventEmitter(sourceObj)) {
var source_2 = sourceObj;
sourceObj.on(eventName, handler);
unsubscribe = function () { return source_2.off(eventName, handler); };
}
else if (isNodeStyleEventEmitter(sourceObj)) {
var source_3 = sourceObj;
sourceObj.addListener(eventName, handler);
unsubscribe = function () { return source_3.removeListener(eventName, handler); };
}
else if (sourceObj && sourceObj.length) {
for (var i = 0, len = sourceObj.length; i < len; i++) {
setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
}
}
else {
throw new TypeError('Invalid event target');
}
subscriber.add(unsubscribe);
}
function isNodeStyleEventEmitter(sourceObj) {
return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';
}
function isJQueryStyleEventEmitter(sourceObj) {
return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';
}
function isEventTarget(sourceObj) {
return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';
}
//# sourceMappingURL=fromEvent.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js":
/*!*************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js ***!
\*************************************************************************/
/*! exports provided: fromEventPattern */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return fromEventPattern; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isFunction */ "./node_modules/rxjs/_esm5/internal/util/isFunction.js");
/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../operators/map */ "./node_modules/rxjs/_esm5/internal/operators/map.js");
/** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Creates an Observable from an API based on addHandler/removeHandler
* functions.
*
* <span class="informal">Converts any addHandler/removeHandler API to an
* Observable.</span>
*
* <img src="./img/fromEventPattern.png" width="100%">
*
* Creates an Observable by using the `addHandler` and `removeHandler`
* functions to add and remove the handlers. The `addHandler` is
* called when the output Observable is subscribed, and `removeHandler` is
* called when the Subscription is unsubscribed.
*
* @example <caption>Emits clicks happening on the DOM document</caption>
* function addClickHandler(handler) {
* document.addEventListener('click', handler);
* }
*
* function removeClickHandler(handler) {
* document.removeEventListener('click', handler);
* }
*
* var clicks = fromEventPattern(
* addClickHandler,
* removeClickHandler
* );
* clicks.subscribe(x => console.log(x));
*
* @see {@link from}
* @see {@link fromEvent}
*
* @param {function(handler: Function): any} addHandler A function that takes
* a `handler` function as argument and attaches it somehow to the actual
* source of events.
* @param {function(handler: Function, signal?: any): void} [removeHandler] An optional function that
* takes a `handler` function as argument and removes it in case it was
* previously attached using `addHandler`. if addHandler returns signal to teardown when remove,
* removeHandler function will forward it.
* @return {Observable<T>}
* @name fromEventPattern
*/
function fromEventPattern(addHandler, removeHandler, resultSelector) {
if (resultSelector) {
// DEPRECATED PATH
return fromEventPattern(addHandler, removeHandler).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
}
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var handler = function () {
var e = [];
for (var _i = 0; _i < arguments.length; _i++) {
e[_i] = arguments[_i];
}
return subscriber.next(e.length === 1 ? e[0] : e);
};
var retValue;
try {
retValue = addHandler(handler);
}
catch (err) {
subscriber.error(err);
return undefined;
}
if (!Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(removeHandler)) {
return undefined;
}
return function () { return removeHandler(handler, retValue); };
});
}
//# sourceMappingURL=fromEventPattern.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/fromIterable.js":
/*!*********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/fromIterable.js ***!
\*********************************************************************/
/*! exports provided: fromIterable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromIterable", function() { return fromIterable; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../symbol/iterator */ "./node_modules/rxjs/_esm5/internal/symbol/iterator.js");
/* harmony import */ var _util_subscribeToIterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToIterable */ "./node_modules/rxjs/_esm5/internal/util/subscribeToIterable.js");
/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_iterator,_util_subscribeToIterable PURE_IMPORTS_END */
function fromIterable(input, scheduler) {
if (!input) {
throw new Error('Iterable cannot be null');
}
if (!scheduler) {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToIterable__WEBPACK_IMPORTED_MODULE_3__["subscribeToIterable"])(input));
}
else {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
var iterator;
sub.add(function () {
// Finalize generators
if (iterator && typeof iterator.return === 'function') {
iterator.return();
}
});
sub.add(scheduler.schedule(function () {
iterator = input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_2__["iterator"]]();
sub.add(scheduler.schedule(function () {
if (subscriber.closed) {
return;
}
var value;
var done;
try {
var result = iterator.next();
value = result.value;
done = result.done;
}
catch (err) {
subscriber.error(err);
return;
}
if (done) {
subscriber.complete();
}
else {
subscriber.next(value);
this.schedule();
}
}));
}));
return sub;
});
}
}
//# sourceMappingURL=fromIterable.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/fromObservable.js":
/*!***********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/fromObservable.js ***!
\***********************************************************************/
/*! exports provided: fromObservable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromObservable", function() { return fromObservable; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../symbol/observable */ "./node_modules/rxjs/_esm5/internal/symbol/observable.js");
/* harmony import */ var _util_subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToObservable */ "./node_modules/rxjs/_esm5/internal/util/subscribeToObservable.js");
/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_observable,_util_subscribeToObservable PURE_IMPORTS_END */
function fromObservable(input, scheduler) {
if (!scheduler) {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__["subscribeToObservable"])(input));
}
else {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
sub.add(scheduler.schedule(function () {
var observable = input[_symbol_observable__WEBPACK_IMPORTED_MODULE_2__["observable"]]();
sub.add(observable.subscribe({
next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); },
error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); },
complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); },
}));
}));
return sub;
});
}
}
//# sourceMappingURL=fromObservable.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/fromPromise.js":
/*!********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/fromPromise.js ***!
\********************************************************************/
/*! exports provided: fromPromise */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromPromise", function() { return fromPromise; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony import */ var _util_subscribeToPromise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToPromise */ "./node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js");
/** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToPromise PURE_IMPORTS_END */
function fromPromise(input, scheduler) {
if (!scheduler) {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToPromise__WEBPACK_IMPORTED_MODULE_2__["subscribeToPromise"])(input));
}
else {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
sub.add(scheduler.schedule(function () {
return input.then(function (value) {
sub.add(scheduler.schedule(function () {
subscriber.next(value);
sub.add(scheduler.schedule(function () { return subscriber.complete(); }));
}));
}, function (err) {
sub.add(scheduler.schedule(function () { return subscriber.error(err); }));
});
}));
return sub;
});
}
}
//# sourceMappingURL=fromPromise.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/generate.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/generate.js ***!
\*****************************************************************/
/*! exports provided: generate */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ "./node_modules/rxjs/_esm5/internal/util/identity.js");
/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm5/internal/util/isScheduler.js");
/** PURE_IMPORTS_START _Observable,_util_identity,_util_isScheduler PURE_IMPORTS_END */
function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) {
var resultSelector;
var initialState;
if (arguments.length == 1) {
var options = initialStateOrOptions;
initialState = options.initialState;
condition = options.condition;
iterate = options.iterate;
resultSelector = options.resultSelector || _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"];
scheduler = options.scheduler;
}
else if (resultSelectorOrObservable === undefined || Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_2__["isScheduler"])(resultSelectorOrObservable)) {
initialState = initialStateOrOptions;
resultSelector = _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"];
scheduler = resultSelectorOrObservable;
}
else {
initialState = initialStateOrOptions;
resultSelector = resultSelectorOrObservable;
}
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var state = initialState;
if (scheduler) {
return scheduler.schedule(dispatch, 0, {
subscriber: subscriber,
iterate: iterate,
condition: condition,
resultSelector: resultSelector,
state: state
});
}
do {
if (condition) {
var conditionResult = void 0;
try {
conditionResult = condition(state);
}
catch (err) {
subscriber.error(err);
return undefined;
}
if (!conditionResult) {
subscriber.complete();
break;
}
}
var value = void 0;
try {
value = resultSelector(state);
}
catch (err) {
subscriber.error(err);
return undefined;
}
subscriber.next(value);
if (subscriber.closed) {
break;
}
try {
state = iterate(state);
}
catch (err) {
subscriber.error(err);
return undefined;
}
} while (true);
return undefined;
});
}
function dispatch(state) {
var subscriber = state.subscriber, condition = state.condition;
if (subscriber.closed) {
return undefined;
}
if (state.needIterate) {
try {
state.state = state.iterate(state.state);
}
catch (err) {
subscriber.error(err);
return undefined;
}
}
else {
state.needIterate = true;
}
if (condition) {
var conditionResult = void 0;
try {
conditionResult = condition(state.state);
}
catch (err) {
subscriber.error(err);
return undefined;
}
if (!conditionResult) {
subscriber.complete();
return undefined;
}
if (subscriber.closed) {
return undefined;
}
}
var value;
try {
value = state.resultSelector(state.state);
}
catch (err) {
subscriber.error(err);
return undefined;
}
if (subscriber.closed) {
return undefined;
}
subscriber.next(value);
if (subscriber.closed) {
return undefined;
}
return this.schedule(state);
}
//# sourceMappingURL=generate.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/iif.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/iif.js ***!
\************************************************************/
/*! exports provided: iif */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return iif; });
/* harmony import */ var _defer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defer */ "./node_modules/rxjs/_esm5/internal/observable/defer.js");
/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./empty */ "./node_modules/rxjs/_esm5/internal/observable/empty.js");
/** PURE_IMPORTS_START _defer,_empty PURE_IMPORTS_END */
/**
* Decides at subscription time which Observable will actually be subscribed.
*
* <span class="informal">`If` statement for Observables.</span>
*
* `if` accepts a condition function and two Observables. When
* an Observable returned by the operator is subscribed, condition function will be called.
* Based on what boolean it returns at that moment, consumer will subscribe either to
* the first Observable (if condition was true) or to the second (if condition was false). Condition
* function may also not return anything - in that case condition will be evaluated as false and
* second Observable will be subscribed.
*
* Note that Observables for both cases (true and false) are optional. If condition points to an Observable that
* was left undefined, resulting stream will simply complete immediately. That allows you to, rather
* then controlling which Observable will be subscribed, decide at runtime if consumer should have access
* to given Observable or not.
*
* If you have more complex logic that requires decision between more than two Observables, {@link defer}
* will probably be a better choice. Actually `if` can be easily implemented with {@link defer}
* and exists only for convenience and readability reasons.
*
*
* @example <caption>Change at runtime which Observable will be subscribed</caption>
* let subscribeToFirst;
* const firstOrSecond = Rx.Observable.if(
* () => subscribeToFirst,
* Rx.Observable.of('first'),
* Rx.Observable.of('second')
* );
*
* subscribeToFirst = true;
* firstOrSecond.subscribe(value => console.log(value));
*
* // Logs:
* // "first"
*
* subscribeToFirst = false;
* firstOrSecond.subscribe(value => console.log(value));
*
* // Logs:
* // "second"
*
*
* @example <caption>Control an access to an Observable</caption>
* let accessGranted;
* const observableIfYouHaveAccess = Rx.Observable.if(
* () => accessGranted,
* Rx.Observable.of('It seems you have an access...') // Note that only one Observable is passed to the operator.
* );
*
* accessGranted = true;
* observableIfYouHaveAccess.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('The end')
* );
*
* // Logs:
* // "It seems you have an access..."
* // "The end"
*
* accessGranted = false;
* observableIfYouHaveAccess.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('The end')
* );
*
* // Logs:
* // "The end"
*
* @see {@link defer}
*
* @param {function(): boolean} condition Condition which Observable should be chosen.
* @param {Observable} [trueObservable] An Observable that will be subscribed if condition is true.
* @param {Observable} [falseObservable] An Observable that will be subscribed if condition is false.
* @return {Observable} Either first or second Observable, depending on condition.
* @static true
* @name iif
* @owner Observable
*/
function iif(condition, trueResult, falseResult) {
if (trueResult === void 0) {
trueResult = _empty__WEBPACK_IMPORTED_MODULE_1__["EMPTY"];
}
if (falseResult === void 0) {
falseResult = _empty__WEBPACK_IMPORTED_MODULE_1__["EMPTY"];
}
return Object(_defer__WEBPACK_IMPORTED_MODULE_0__["defer"])(function () { return condition() ? trueResult : falseResult; });
}
//# sourceMappingURL=iif.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/interval.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/interval.js ***!
\*****************************************************************/
/*! exports provided: interval */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return interval; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isNumeric */ "./node_modules/rxjs/_esm5/internal/util/isNumeric.js");
/** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric PURE_IMPORTS_END */
/**
* Creates an Observable that emits sequential numbers every specified
* interval of time, on a specified IScheduler.
*
* <span class="informal">Emits incremental numbers periodically in time.
* </span>
*
* <img src="./img/interval.png" width="100%">
*
* `interval` returns an Observable that emits an infinite sequence of
* ascending integers, with a constant interval of time of your choosing
* between those emissions. The first emission is not sent immediately, but
* only after the first period has passed. By default, this operator uses the
* `async` IScheduler to provide a notion of time, but you may pass any
* IScheduler to it.
*
* @example <caption>Emits ascending numbers, one every second (1000ms)</caption>
* var numbers = Rx.Observable.interval(1000);
* numbers.subscribe(x => console.log(x));
*
* @see {@link timer}
* @see {@link delay}
*
* @param {number} [period=0] The interval size in milliseconds (by default)
* or the time unit determined by the scheduler's clock.
* @param {Scheduler} [scheduler=async] The IScheduler to use for scheduling
* the emission of values, and providing a notion of "time".
* @return {Observable} An Observable that emits a sequential number each time
* interval.
* @static true
* @name interval
* @owner Observable
*/
function interval(period, scheduler) {
if (period === void 0) {
period = 0;
}
if (scheduler === void 0) {
scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
}
if (!Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(period) || period < 0) {
period = 0;
}
if (!scheduler || typeof scheduler.schedule !== 'function') {
scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
}
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
subscriber.add(scheduler.schedule(dispatch, period, { subscriber: subscriber, counter: 0, period: period }));
return subscriber;
});
}
function dispatch(state) {
var subscriber = state.subscriber, counter = state.counter, period = state.period;
subscriber.next(counter);
this.schedule({ subscriber: subscriber, counter: counter + 1, period: period }, period);
}
//# sourceMappingURL=interval.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/merge.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/merge.js ***!
\**************************************************************/
/*! exports provided: merge */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm5/internal/util/isScheduler.js");
/* harmony import */ var _operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/mergeAll */ "./node_modules/rxjs/_esm5/internal/operators/mergeAll.js");
/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fromArray */ "./node_modules/rxjs/_esm5/internal/observable/fromArray.js");
/** PURE_IMPORTS_START _Observable,_util_isScheduler,_operators_mergeAll,_fromArray PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Creates an output Observable which concurrently emits all values from every
* given input Observable.
*
* <span class="informal">Flattens multiple Observables together by blending
* their values into one Observable.</span>
*
* <img src="./img/merge.png" width="100%">
*
* `merge` subscribes to each given input Observable (as arguments), and simply
* forwards (without doing any transformation) all the values from all the input
* Observables to the output Observable. The output Observable only completes
* once all input Observables have completed. Any error delivered by an input
* Observable will be immediately emitted on the output Observable.
*
* @example <caption>Merge together two Observables: 1s interval and clicks</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var timer = Rx.Observable.interval(1000);
* var clicksOrTimer = Rx.Observable.merge(clicks, timer);
* clicksOrTimer.subscribe(x => console.log(x));
*
* // Results in the following:
* // timer will emit ascending values, one every second(1000ms) to console
* // clicks logs MouseEvents to console everytime the "document" is clicked
* // Since the two streams are merged you see these happening
* // as they occur.
*
* @example <caption>Merge together 3 Observables, but only 2 run concurrently</caption>
* var timer1 = Rx.Observable.interval(1000).take(10);
* var timer2 = Rx.Observable.interval(2000).take(6);
* var timer3 = Rx.Observable.interval(500).take(10);
* var concurrent = 2; // the argument
* var merged = Rx.Observable.merge(timer1, timer2, timer3, concurrent);
* merged.subscribe(x => console.log(x));
*
* // Results in the following:
* // - First timer1 and timer2 will run concurrently
* // - timer1 will emit a value every 1000ms for 10 iterations
* // - timer2 will emit a value every 2000ms for 6 iterations
* // - after timer1 hits it's max iteration, timer2 will
* // continue, and timer3 will start to run concurrently with timer2
* // - when timer2 hits it's max iteration it terminates, and
* // timer3 will continue to emit a value every 500ms until it is complete
*
* @see {@link mergeAll}
* @see {@link mergeMap}
* @see {@link mergeMapTo}
* @see {@link mergeScan}
*
* @param {...ObservableInput} observables Input Observables to merge together.
* @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input
* Observables being subscribed to concurrently.
* @param {Scheduler} [scheduler=null] The IScheduler to use for managing
* concurrency of input Observables.
* @return {Observable} an Observable that emits items that are the result of
* every input Observable.
* @static true
* @name merge
* @owner Observable
*/
function merge() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
var concurrent = Number.POSITIVE_INFINITY;
var scheduler = null;
var last = observables[observables.length - 1];
if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(last)) {
scheduler = observables.pop();
if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
concurrent = observables.pop();
}
}
else if (typeof last === 'number') {
concurrent = observables.pop();
}
if (scheduler === null && observables.length === 1 && observables[0] instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) {
return observables[0];
}
return Object(_operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__["mergeAll"])(concurrent)(Object(_fromArray__WEBPACK_IMPORTED_MODULE_3__["fromArray"])(observables, scheduler));
}
//# sourceMappingURL=merge.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/never.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/never.js ***!
\**************************************************************/
/*! exports provided: NEVER, never */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return NEVER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "never", function() { return never; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/noop */ "./node_modules/rxjs/_esm5/internal/util/noop.js");
/** PURE_IMPORTS_START _Observable,_util_noop PURE_IMPORTS_END */
/**
* An Observable that emits no items to the Observer and never completes.
*
* <img src="./img/never.png" width="100%">
*
* A simple Observable that emits neither values nor errors nor the completion
* notification. It can be used for testing purposes or for composing with other
* Observables. Please note that by never emitting a complete notification, this
* Observable keeps the subscription from being disposed automatically.
* Subscriptions need to be manually disposed.
*
* @example <caption>Emit the number 7, then never emit anything else (not even complete).</caption>
* function info() {
* console.log('Will not be called');
* }
* var result = NEVER.startWith(7);
* result.subscribe(x => console.log(x), info, info);
*
* @see {@link create}
* @see {@link EMPTY}
* @see {@link of}
* @see {@link throwError}
*/
var NEVER = /*@__PURE__*/ new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](_util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]);
/**
* @deprecated Deprecated in favor of using NEVER constant.
*/
function never() {
return NEVER;
}
//# sourceMappingURL=never.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/of.js":
/*!***********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/of.js ***!
\***********************************************************/
/*! exports provided: of */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "of", function() { return of; });
/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm5/internal/util/isScheduler.js");
/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fromArray */ "./node_modules/rxjs/_esm5/internal/observable/fromArray.js");
/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./empty */ "./node_modules/rxjs/_esm5/internal/observable/empty.js");
/* harmony import */ var _scalar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scalar */ "./node_modules/rxjs/_esm5/internal/observable/scalar.js");
/** PURE_IMPORTS_START _util_isScheduler,_fromArray,_empty,_scalar PURE_IMPORTS_END */
function of() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var scheduler = args[args.length - 1];
if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__["isScheduler"])(scheduler)) {
args.pop();
}
else {
scheduler = undefined;
}
switch (args.length) {
case 0:
return Object(_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])(scheduler);
case 1:
return scheduler ? Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(args, scheduler) : Object(_scalar__WEBPACK_IMPORTED_MODULE_3__["scalar"])(args[0]);
default:
return Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(args, scheduler);
}
}
//# sourceMappingURL=of.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/onErrorResumeNext.js":
/*!**************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/onErrorResumeNext.js ***!
\**************************************************************************/
/*! exports provided: onErrorResumeNext */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./from */ "./node_modules/rxjs/_esm5/internal/observable/from.js");
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./empty */ "./node_modules/rxjs/_esm5/internal/observable/empty.js");
/** PURE_IMPORTS_START _Observable,_from,_util_isArray,_empty PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* When any of the provided Observable emits an complete or error notification, it immediately subscribes to the next one
* that was passed.
*
* <span class="informal">Execute series of Observables no matter what, even if it means swallowing errors.</span>
*
* <img src="./img/onErrorResumeNext.png" width="100%">
*
* `onErrorResumeNext` Will subscribe to each observable source it is provided, in order.
* If the source it's subscribed to emits an error or completes, it will move to the next source
* without error.
*
* If `onErrorResumeNext` is provided no arguments, or a single, empty array, it will return {@link EMPTY}.
*
* `onErrorResumeNext` is basically {@link concat}, only it will continue, even if one of its
* sources emits an error.
*
* Note that there is no way to handle any errors thrown by sources via the resuult of
* `onErrorResumeNext`. If you want to handle errors thrown in any given source, you can
* always use the {@link catchError} operator on them before passing them into `onErrorResumeNext`.
*
* @example <caption>Subscribe to the next Observable after map fails</caption>
* import { onErrorResumeNext, of } from 'rxjs/create';
* import { map } from 'rxjs/operators';
*
* onErrorResumeNext(
* of(1, 2, 3, 0).pipe(
* map(x => {
* if (x === 0) throw Error();
* return 10 / x;
* })
* ),
* of(1, 2, 3),
* )
* .subscribe(
* val => console.log(val),
* err => console.log(err), // Will never be called.
* () => console.log('done')
* );
*
* // Logs:
* // 10
* // 5
* // 3.3333333333333335
* // 1
* // 2
* // 3
* // "done"
*
* @see {@link concat}
* @see {@link catch}
*
* @param {...ObservableInput} sources Observables (or anything that *is* observable) passed either directly or as an array.
* @return {Observable} An Observable that concatenates all sources, one after the other,
* ignoring all errors, such that any error causes it to move on to the next source.
*/
function onErrorResumeNext() {
var sources = [];
for (var _i = 0; _i < arguments.length; _i++) {
sources[_i] = arguments[_i];
}
if (sources.length === 0) {
return _empty__WEBPACK_IMPORTED_MODULE_3__["EMPTY"];
}
var first = sources[0], remainder = sources.slice(1);
if (sources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(first)) {
return onErrorResumeNext.apply(void 0, first);
}
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var subNext = function () { return subscriber.add(onErrorResumeNext.apply(void 0, remainder).subscribe(subscriber)); };
return Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(first).subscribe({
next: function (value) { subscriber.next(value); },
error: subNext,
complete: subNext,
});
});
}
//# sourceMappingURL=onErrorResumeNext.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/pairs.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/pairs.js ***!
\**************************************************************/
/*! exports provided: pairs, dispatch */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return pairs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */
/**
* Convert an object into an observable sequence of [key, value] pairs
* using an optional IScheduler to enumerate the object.
*
* @example <caption>Converts a javascript object to an Observable</caption>
* var obj = {
* foo: 42,
* bar: 56,
* baz: 78
* };
*
* var source = Rx.Observable.pairs(obj);
*
* var subscription = source.subscribe(
* function (x) {
* console.log('Next: %s', x);
* },
* function (err) {
* console.log('Error: %s', err);
* },
* function () {
* console.log('Completed');
* });
*
* @param {Object} obj The object to inspect and turn into an
* Observable sequence.
* @param {Scheduler} [scheduler] An optional IScheduler to run the
* enumeration of the input sequence on.
* @returns {(Observable<[string, T]>)} An observable sequence of
* [key, value] pairs from the object.
*/
function pairs(obj, scheduler) {
if (!scheduler) {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var keys = Object.keys(obj);
for (var i = 0; i < keys.length && !subscriber.closed; i++) {
var key = keys[i];
if (obj.hasOwnProperty(key)) {
subscriber.next([key, obj[key]]);
}
}
subscriber.complete();
});
}
else {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var keys = Object.keys(obj);
var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
subscription.add(scheduler.schedule(dispatch, 0, { keys: keys, index: 0, subscriber: subscriber, subscription: subscription, obj: obj }));
return subscription;
});
}
}
/** @internal */
function dispatch(state) {
var keys = state.keys, index = state.index, subscriber = state.subscriber, subscription = state.subscription, obj = state.obj;
if (!subscriber.closed) {
if (index < keys.length) {
var key = keys[index];
subscriber.next([key, obj[key]]);
subscription.add(this.schedule({ keys: keys, index: index + 1, subscriber: subscriber, subscription: subscription, obj: obj }));
}
else {
subscriber.complete();
}
}
}
//# sourceMappingURL=pairs.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/race.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/race.js ***!
\*************************************************************/
/*! exports provided: race, RaceOperator, RaceSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return race; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RaceOperator", function() { return RaceOperator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RaceSubscriber", function() { return RaceSubscriber; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fromArray */ "./node_modules/rxjs/_esm5/internal/observable/fromArray.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_util_isArray,_fromArray,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
function race() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
// if the only argument is an array, it was most likely called with
// `race([obs1, obs2, ...])`
if (observables.length === 1) {
if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(observables[0])) {
observables = observables[0];
}
else {
return observables[0];
}
}
return Object(_fromArray__WEBPACK_IMPORTED_MODULE_2__["fromArray"])(observables, undefined).lift(new RaceOperator());
}
var RaceOperator = /*@__PURE__*/ (function () {
function RaceOperator() {
}
RaceOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new RaceSubscriber(subscriber));
};
return RaceOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var RaceSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RaceSubscriber, _super);
function RaceSubscriber(destination) {
var _this = _super.call(this, destination) || this;
_this.hasFirst = false;
_this.observables = [];
_this.subscriptions = [];
return _this;
}
RaceSubscriber.prototype._next = function (observable) {
this.observables.push(observable);
};
RaceSubscriber.prototype._complete = function () {
var observables = this.observables;
var len = observables.length;
if (len === 0) {
this.destination.complete();
}
else {
for (var i = 0; i < len && !this.hasFirst; i++) {
var observable = observables[i];
var subscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, observable, observable, i);
if (this.subscriptions) {
this.subscriptions.push(subscription);
}
this.add(subscription);
}
this.observables = null;
}
};
RaceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
if (!this.hasFirst) {
this.hasFirst = true;
for (var i = 0; i < this.subscriptions.length; i++) {
if (i !== outerIndex) {
var subscription = this.subscriptions[i];
subscription.unsubscribe();
this.remove(subscription);
}
}
this.subscriptions = null;
}
this.destination.next(innerValue);
};
return RaceSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
//# sourceMappingURL=race.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/range.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/range.js ***!
\**************************************************************/
/*! exports provided: range, dispatch */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
/**
* Creates an Observable that emits a sequence of numbers within a specified
* range.
*
* <span class="informal">Emits a sequence of numbers in a range.</span>
*
* <img src="./img/range.png" width="100%">
*
* `range` operator emits a range of sequential integers, in order, where you
* select the `start` of the range and its `length`. By default, uses no
* IScheduler and just delivers the notifications synchronously, but may use
* an optional IScheduler to regulate those deliveries.
*
* @example <caption>Emits the numbers 1 to 10</caption>
* var numbers = Rx.Observable.range(1, 10);
* numbers.subscribe(x => console.log(x));
*
* @see {@link timer}
* @see {@link interval}
*
* @param {number} [start=0] The value of the first integer in the sequence.
* @param {number} [count=0] The number of sequential integers to generate.
* @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling
* the emissions of the notifications.
* @return {Observable} An Observable of numbers that emits a finite range of
* sequential integers.
* @static true
* @name range
* @owner Observable
*/
function range(start, count, scheduler) {
if (start === void 0) {
start = 0;
}
if (count === void 0) {
count = 0;
}
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var index = 0;
if (scheduler) {
return scheduler.schedule(dispatch, 0, {
index: index, count: count, start: start, subscriber: subscriber
});
}
else {
do {
if (index++ >= count) {
subscriber.complete();
break;
}
subscriber.next(start++);
if (subscriber.closed) {
break;
}
} while (true);
}
return undefined;
});
}
/** @internal */
function dispatch(state) {
var start = state.start, index = state.index, count = state.count, subscriber = state.subscriber;
if (index >= count) {
subscriber.complete();
return;
}
subscriber.next(start);
if (subscriber.closed) {
return;
}
state.index = index + 1;
state.start = start + 1;
this.schedule(state);
}
//# sourceMappingURL=range.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/scalar.js":
/*!***************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/scalar.js ***!
\***************************************************************/
/*! exports provided: scalar */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scalar", function() { return scalar; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
function scalar(value) {
var result = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
subscriber.next(value);
subscriber.complete();
});
result._isScalar = true;
result.value = value;
return result;
}
//# sourceMappingURL=scalar.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/throwError.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/throwError.js ***!
\*******************************************************************/
/*! exports provided: throwError */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return throwError; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
/**
* Creates an Observable that emits no items to the Observer and immediately
* emits an error notification.
*
* <span class="informal">Just emits 'error', and nothing else.
* </span>
*
* <img src="./img/throw.png" width="100%">
*
* This static operator is useful for creating a simple Observable that only
* emits the error notification. It can be used for composing with other
* Observables, such as in a {@link mergeMap}.
*
* @example <caption>Emit the number 7, then emit an error.</caption>
* import { throwError, concat, of } from 'rxjs/create';
*
* const result = concat(of(7), throwError(new Error('oops!')));
* result.subscribe(x => console.log(x), e => console.error(e));
*
* @example <caption>Map and flatten numbers to the sequence 'a', 'b', 'c', but throw an error for 13</caption>
* import { throwError, interval, of } from 'rxjs/create';
* import { mergeMap } from 'rxjs/operators';
*
* interval(1000).pipe(
* mergeMap(x => x === 13 ?
* throwError('Thirteens are bad') :
* of('a', 'b', 'c')
* )
* ).subscribe(x => console.log(x), e => console.error(e));
*
* @see {@link create}
* @see {@link empty}
* @see {@link never}
* @see {@link of}
*
* @param {any} error The particular Error to pass to the error notification.
* @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling
* the emission of the error notification.
* @return {Observable} An error Observable: emits only the error notification
* using the given error argument.
* @static true
* @name throw
* @owner Observable
*/
function throwError(error, scheduler) {
if (!scheduler) {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return subscriber.error(error); });
}
else {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return scheduler.schedule(dispatch, 0, { error: error, subscriber: subscriber }); });
}
}
function dispatch(_a) {
var error = _a.error, subscriber = _a.subscriber;
subscriber.error(error);
}
//# sourceMappingURL=throwError.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/timer.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/timer.js ***!
\**************************************************************/
/*! exports provided: timer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return timer; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isNumeric */ "./node_modules/rxjs/_esm5/internal/util/isNumeric.js");
/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm5/internal/util/isScheduler.js");
/** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */
/**
* Creates an Observable that starts emitting after an `initialDelay` and
* emits ever increasing numbers after each `period` of time thereafter.
*
* <span class="informal">Its like {@link interval}, but you can specify when
* should the emissions start.</span>
*
* <img src="./img/timer.png" width="100%">
*
* `timer` returns an Observable that emits an infinite sequence of ascending
* integers, with a constant interval of time, `period` of your choosing
* between those emissions. The first emission happens after the specified
* `initialDelay`. The initial delay may be a {@link Date}. By default, this
* operator uses the `async` IScheduler to provide a notion of time, but you
* may pass any IScheduler to it. If `period` is not specified, the output
* Observable emits only one value, `0`. Otherwise, it emits an infinite
* sequence.
*
* @example <caption>Emits ascending numbers, one every second (1000ms), starting after 3 seconds</caption>
* var numbers = Rx.Observable.timer(3000, 1000);
* numbers.subscribe(x => console.log(x));
*
* @example <caption>Emits one number after five seconds</caption>
* var numbers = Rx.Observable.timer(5000);
* numbers.subscribe(x => console.log(x));
*
* @see {@link interval}
* @see {@link delay}
*
* @param {number|Date} [dueTime] The initial delay time to wait before
* emitting the first value of `0`.
* @param {number|SchedulerLike} [periodOrScheduler] The period of time between emissions of the
* subsequent numbers.
* @param {SchedulerLike} [scheduler=async] The IScheduler to use for scheduling
* the emission of values, and providing a notion of "time".
* @return {Observable} An Observable that emits a `0` after the
* `initialDelay` and ever increasing numbers after each `period` of time
* thereafter.
* @static true
* @name timer
* @owner Observable
*/
function timer(dueTime, periodOrScheduler, scheduler) {
if (dueTime === void 0) {
dueTime = 0;
}
var period = -1;
if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(periodOrScheduler)) {
period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);
}
else if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(periodOrScheduler)) {
scheduler = periodOrScheduler;
}
if (!Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(scheduler)) {
scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
}
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var due = Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(dueTime)
? dueTime
: (+dueTime - scheduler.now());
return scheduler.schedule(dispatch, due, {
index: 0, period: period, subscriber: subscriber
});
});
}
function dispatch(state) {
var index = state.index, period = state.period, subscriber = state.subscriber;
subscriber.next(index);
if (subscriber.closed) {
return;
}
else if (period === -1) {
return subscriber.complete();
}
state.index = index + 1;
this.schedule(state, period);
}
//# sourceMappingURL=timer.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/using.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/using.js ***!
\**************************************************************/
/*! exports provided: using */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "using", function() { return using; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./from */ "./node_modules/rxjs/_esm5/internal/observable/from.js");
/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./empty */ "./node_modules/rxjs/_esm5/internal/observable/empty.js");
/** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */
// from from from! LAWL
/**
* Creates an Observable that uses a resource which will be disposed at the same time as the Observable.
*
* <span class="informal">Use it when you catch yourself cleaning up after an Observable.</span>
*
* `using` is a factory operator, which accepts two functions. First function returns a disposable resource.
* It can be an arbitrary object that implements `unsubscribe` method. Second function will be injected with
* that object and should return an Observable. That Observable can use resource object during its execution.
* Both functions passed to `using` will be called every time someone subscribes - neither an Observable nor
* resource object will be shared in any way between subscriptions.
*
* When Observable returned by `using` is subscribed, Observable returned from the second function will be subscribed
* as well. All its notifications (nexted values, completion and error events) will be emitted unchanged by the output
* Observable. If however someone unsubscribes from the Observable or source Observable completes or errors by itself,
* the `unsubscribe` method on resource object will be called. This can be used to do any necessary clean up, which
* otherwise would have to be handled by hand. Note that complete or error notifications are not emitted when someone
* cancels subscription to an Observable via `unsubscribe`, so `using` can be used as a hook, allowing you to make
* sure that all resources which need to exist during an Observable execution will be disposed at appropriate time.
*
* @see {@link defer}
*
* @param {function(): ISubscription} resourceFactory A function which creates any resource object
* that implements `unsubscribe` method.
* @param {function(resource: ISubscription): Observable<T>} observableFactory A function which
* creates an Observable, that can use injected resource object.
* @return {Observable<T>} An Observable that behaves the same as Observable returned by `observableFactory`, but
* which - when completed, errored or unsubscribed - will also call `unsubscribe` on created resource object.
*/
function using(resourceFactory, observableFactory) {
return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
var resource;
try {
resource = resourceFactory();
}
catch (err) {
subscriber.error(err);
return undefined;
}
var result;
try {
result = observableFactory(resource);
}
catch (err) {
subscriber.error(err);
return undefined;
}
var source = result ? Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(result) : _empty__WEBPACK_IMPORTED_MODULE_2__["EMPTY"];
var subscription = source.subscribe(subscriber);
return function () {
subscription.unsubscribe();
if (resource) {
resource.unsubscribe();
}
};
});
}
//# sourceMappingURL=using.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/observable/zip.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/observable/zip.js ***!
\************************************************************/
/*! exports provided: zip, ZipOperator, ZipSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipOperator", function() { return ZipOperator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipSubscriber", function() { return ZipSubscriber; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fromArray */ "./node_modules/rxjs/_esm5/internal/observable/fromArray.js");
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/* harmony import */ var _internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../internal/symbol/iterator */ "./node_modules/rxjs/_esm5/internal/symbol/iterator.js");
/** PURE_IMPORTS_START tslib,_fromArray,_util_isArray,_Subscriber,_OuterSubscriber,_util_subscribeToResult,_.._internal_symbol_iterator PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Combines multiple Observables to create an Observable whose values are calculated from the values, in order, of each
* of its input Observables.
*
* If the latest parameter is a function, this function is used to compute the created value from the input values.
* Otherwise, an array of the input values is returned.
*
* @example <caption>Combine age and name from different sources</caption>
*
* let age$ = Observable.of<number>(27, 25, 29);
* let name$ = Observable.of<string>('Foo', 'Bar', 'Beer');
* let isDev$ = Observable.of<boolean>(true, true, false);
*
* Observable
* .zip(age$,
* name$,
* isDev$,
* (age: number, name: string, isDev: boolean) => ({ age, name, isDev }))
* .subscribe(x => console.log(x));
*
* // outputs
* // { age: 27, name: 'Foo', isDev: true }
* // { age: 25, name: 'Bar', isDev: true }
* // { age: 29, name: 'Beer', isDev: false }
*
* @param observables
* @return {Observable<R>}
* @static true
* @name zip
* @owner Observable
*/
function zip() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
var resultSelector = observables[observables.length - 1];
if (typeof resultSelector === 'function') {
observables.pop();
}
return Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(observables, undefined).lift(new ZipOperator(resultSelector));
}
var ZipOperator = /*@__PURE__*/ (function () {
function ZipOperator(resultSelector) {
this.resultSelector = resultSelector;
}
ZipOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector));
};
return ZipOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var ZipSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ZipSubscriber, _super);
function ZipSubscriber(destination, resultSelector, values) {
if (values === void 0) {
values = Object.create(null);
}
var _this = _super.call(this, destination) || this;
_this.iterators = [];
_this.active = 0;
_this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : null;
_this.values = values;
return _this;
}
ZipSubscriber.prototype._next = function (value) {
var iterators = this.iterators;
if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(value)) {
iterators.push(new StaticArrayIterator(value));
}
else if (typeof value[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]] === 'function') {
iterators.push(new StaticIterator(value[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]]()));
}
else {
iterators.push(new ZipBufferIterator(this.destination, this, value));
}
};
ZipSubscriber.prototype._complete = function () {
var iterators = this.iterators;
var len = iterators.length;
if (len === 0) {
this.destination.complete();
return;
}
this.active = len;
for (var i = 0; i < len; i++) {
var iterator = iterators[i];
if (iterator.stillUnsubscribed) {
this.add(iterator.subscribe(iterator, i));
}
else {
this.active--; // not an observable
}
}
};
ZipSubscriber.prototype.notifyInactive = function () {
this.active--;
if (this.active === 0) {
this.destination.complete();
}
};
ZipSubscriber.prototype.checkIterators = function () {
var iterators = this.iterators;
var len = iterators.length;
var destination = this.destination;
// abort if not all of them have values
for (var i = 0; i < len; i++) {
var iterator = iterators[i];
if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) {
return;
}
}
var shouldComplete = false;
var args = [];
for (var i = 0; i < len; i++) {
var iterator = iterators[i];
var result = iterator.next();
// check to see if it's completed now that you've gotten
// the next value.
if (iterator.hasCompleted()) {
shouldComplete = true;
}
if (result.done) {
destination.complete();
return;
}
args.push(result.value);
}
if (this.resultSelector) {
this._tryresultSelector(args);
}
else {
destination.next(args);
}
if (shouldComplete) {
destination.complete();
}
};
ZipSubscriber.prototype._tryresultSelector = function (args) {
var result;
try {
result = this.resultSelector.apply(this, args);
}
catch (err) {
this.destination.error(err);
return;
}
this.destination.next(result);
};
return ZipSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"]));
var StaticIterator = /*@__PURE__*/ (function () {
function StaticIterator(iterator) {
this.iterator = iterator;
this.nextResult = iterator.next();
}
StaticIterator.prototype.hasValue = function () {
return true;
};
StaticIterator.prototype.next = function () {
var result = this.nextResult;
this.nextResult = this.iterator.next();
return result;
};
StaticIterator.prototype.hasCompleted = function () {
var nextResult = this.nextResult;
return nextResult && nextResult.done;
};
return StaticIterator;
}());
var StaticArrayIterator = /*@__PURE__*/ (function () {
function StaticArrayIterator(array) {
this.array = array;
this.index = 0;
this.length = 0;
this.length = array.length;
}
StaticArrayIterator.prototype[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]] = function () {
return this;
};
StaticArrayIterator.prototype.next = function (value) {
var i = this.index++;
var array = this.array;
return i < this.length ? { value: array[i], done: false } : { value: null, done: true };
};
StaticArrayIterator.prototype.hasValue = function () {
return this.array.length > this.index;
};
StaticArrayIterator.prototype.hasCompleted = function () {
return this.array.length === this.index;
};
return StaticArrayIterator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var ZipBufferIterator = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ZipBufferIterator, _super);
function ZipBufferIterator(destination, parent, observable) {
var _this = _super.call(this, destination) || this;
_this.parent = parent;
_this.observable = observable;
_this.stillUnsubscribed = true;
_this.buffer = [];
_this.isComplete = false;
return _this;
}
ZipBufferIterator.prototype[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]] = function () {
return this;
};
// NOTE: there is actually a name collision here with Subscriber.next and Iterator.next
// this is legit because `next()` will never be called by a subscription in this case.
ZipBufferIterator.prototype.next = function () {
var buffer = this.buffer;
if (buffer.length === 0 && this.isComplete) {
return { value: null, done: true };
}
else {
return { value: buffer.shift(), done: false };
}
};
ZipBufferIterator.prototype.hasValue = function () {
return this.buffer.length > 0;
};
ZipBufferIterator.prototype.hasCompleted = function () {
return this.buffer.length === 0 && this.isComplete;
};
ZipBufferIterator.prototype.notifyComplete = function () {
if (this.buffer.length > 0) {
this.isComplete = true;
this.parent.notifyInactive();
}
else {
this.destination.complete();
}
};
ZipBufferIterator.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.buffer.push(innerValue);
this.parent.checkIterators();
};
ZipBufferIterator.prototype.subscribe = function (value, index) {
return Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, this.observable, this, index);
};
return ZipBufferIterator;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"]));
//# sourceMappingURL=zip.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/audit.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/audit.js ***!
\*************************************************************/
/*! exports provided: audit */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return audit; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/tryCatch */ "./node_modules/rxjs/_esm5/internal/util/tryCatch.js");
/* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/errorObject */ "./node_modules/rxjs/_esm5/internal/util/errorObject.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Ignores source values for a duration determined by another Observable, then
* emits the most recent value from the source Observable, then repeats this
* process.
*
* <span class="informal">It's like {@link auditTime}, but the silencing
* duration is determined by a second Observable.</span>
*
* <img src="./img/audit.png" width="100%">
*
* `audit` is similar to `throttle`, but emits the last value from the silenced
* time window, instead of the first value. `audit` emits the most recent value
* from the source Observable on the output Observable as soon as its internal
* timer becomes disabled, and ignores source values while the timer is enabled.
* Initially, the timer is disabled. As soon as the first source value arrives,
* the timer is enabled by calling the `durationSelector` function with the
* source value, which returns the "duration" Observable. When the duration
* Observable emits a value or completes, the timer is disabled, then the most
* recent source value is emitted on the output Observable, and this process
* repeats for the next source value.
*
* @example <caption>Emit clicks at a rate of at most one click per second</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.audit(ev => Rx.Observable.interval(1000));
* result.subscribe(x => console.log(x));
*
* @see {@link auditTime}
* @see {@link debounce}
* @see {@link delayWhen}
* @see {@link sample}
* @see {@link throttle}
*
* @param {function(value: T): SubscribableOrPromise} durationSelector A function
* that receives a value from the source Observable, for computing the silencing
* duration, returned as an Observable or a Promise.
* @return {Observable<T>} An Observable that performs rate-limiting of
* emissions from the source Observable.
* @method audit
* @owner Observable
*/
function audit(durationSelector) {
return function auditOperatorFunction(source) {
return source.lift(new AuditOperator(durationSelector));
};
}
var AuditOperator = /*@__PURE__*/ (function () {
function AuditOperator(durationSelector) {
this.durationSelector = durationSelector;
}
AuditOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector));
};
return AuditOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var AuditSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AuditSubscriber, _super);
function AuditSubscriber(destination, durationSelector) {
var _this = _super.call(this, destination) || this;
_this.durationSelector = durationSelector;
_this.hasValue = false;
return _this;
}
AuditSubscriber.prototype._next = function (value) {
this.value = value;
this.hasValue = true;
if (!this.throttled) {
var duration = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_1__["tryCatch"])(this.durationSelector)(value);
if (duration === _util_errorObject__WEBPACK_IMPORTED_MODULE_2__["errorObject"]) {
this.destination.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_2__["errorObject"].e);
}
else {
var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, duration);
if (!innerSubscription || innerSubscription.closed) {
this.clearThrottle();
}
else {
this.add(this.throttled = innerSubscription);
}
}
}
};
AuditSubscriber.prototype.clearThrottle = function () {
var _a = this, value = _a.value, hasValue = _a.hasValue, throttled = _a.throttled;
if (throttled) {
this.remove(throttled);
this.throttled = null;
throttled.unsubscribe();
}
if (hasValue) {
this.value = null;
this.hasValue = false;
this.destination.next(value);
}
};
AuditSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) {
this.clearThrottle();
};
AuditSubscriber.prototype.notifyComplete = function () {
this.clearThrottle();
};
return AuditSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
//# sourceMappingURL=audit.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/auditTime.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/auditTime.js ***!
\*****************************************************************/
/*! exports provided: auditTime */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return auditTime; });
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/* harmony import */ var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./audit */ "./node_modules/rxjs/_esm5/internal/operators/audit.js");
/* harmony import */ var _observable_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/timer */ "./node_modules/rxjs/_esm5/internal/observable/timer.js");
/** PURE_IMPORTS_START _scheduler_async,_audit,_observable_timer PURE_IMPORTS_END */
/**
* Ignores source values for `duration` milliseconds, then emits the most recent
* value from the source Observable, then repeats this process.
*
* <span class="informal">When it sees a source values, it ignores that plus
* the next ones for `duration` milliseconds, and then it emits the most recent
* value from the source.</span>
*
* <img src="./img/auditTime.png" width="100%">
*
* `auditTime` is similar to `throttleTime`, but emits the last value from the
* silenced time window, instead of the first value. `auditTime` emits the most
* recent value from the source Observable on the output Observable as soon as
* its internal timer becomes disabled, and ignores source values while the
* timer is enabled. Initially, the timer is disabled. As soon as the first
* source value arrives, the timer is enabled. After `duration` milliseconds (or
* the time unit determined internally by the optional `scheduler`) has passed,
* the timer is disabled, then the most recent source value is emitted on the
* output Observable, and this process repeats for the next source value.
* Optionally takes a {@link IScheduler} for managing timers.
*
* @example <caption>Emit clicks at a rate of at most one click per second</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.auditTime(1000);
* result.subscribe(x => console.log(x));
*
* @see {@link audit}
* @see {@link debounceTime}
* @see {@link delay}
* @see {@link sampleTime}
* @see {@link throttleTime}
*
* @param {number} duration Time to wait before emitting the most recent source
* value, measured in milliseconds or the time unit determined internally
* by the optional `scheduler`.
* @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for
* managing the timers that handle the rate-limiting behavior.
* @return {Observable<T>} An Observable that performs rate-limiting of
* emissions from the source Observable.
* @method auditTime
* @owner Observable
*/
function auditTime(duration, scheduler) {
if (scheduler === void 0) {
scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
}
return Object(_audit__WEBPACK_IMPORTED_MODULE_1__["audit"])(function () { return Object(_observable_timer__WEBPACK_IMPORTED_MODULE_2__["timer"])(duration, scheduler); });
}
//# sourceMappingURL=auditTime.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/buffer.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/buffer.js ***!
\**************************************************************/
/*! exports provided: buffer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return buffer; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Buffers the source Observable values until `closingNotifier` emits.
*
* <span class="informal">Collects values from the past as an array, and emits
* that array only when another Observable emits.</span>
*
* <img src="./img/buffer.png" width="100%">
*
* Buffers the incoming Observable values until the given `closingNotifier`
* Observable emits a value, at which point it emits the buffer on the output
* Observable and starts a new buffer internally, awaiting the next time
* `closingNotifier` emits.
*
* @example <caption>On every click, emit array of most recent interval events</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var interval = Rx.Observable.interval(1000);
* var buffered = interval.buffer(clicks);
* buffered.subscribe(x => console.log(x));
*
* @see {@link bufferCount}
* @see {@link bufferTime}
* @see {@link bufferToggle}
* @see {@link bufferWhen}
* @see {@link window}
*
* @param {Observable<any>} closingNotifier An Observable that signals the
* buffer to be emitted on the output Observable.
* @return {Observable<T[]>} An Observable of buffers, which are arrays of
* values.
* @method buffer
* @owner Observable
*/
function buffer(closingNotifier) {
return function bufferOperatorFunction(source) {
return source.lift(new BufferOperator(closingNotifier));
};
}
var BufferOperator = /*@__PURE__*/ (function () {
function BufferOperator(closingNotifier) {
this.closingNotifier = closingNotifier;
}
BufferOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
};
return BufferOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var BufferSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferSubscriber, _super);
function BufferSubscriber(destination, closingNotifier) {
var _this = _super.call(this, destination) || this;
_this.buffer = [];
_this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, closingNotifier));
return _this;
}
BufferSubscriber.prototype._next = function (value) {
this.buffer.push(value);
};
BufferSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
var buffer = this.buffer;
this.buffer = [];
this.destination.next(buffer);
};
return BufferSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
//# sourceMappingURL=buffer.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/bufferCount.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/bufferCount.js ***!
\*******************************************************************/
/*! exports provided: bufferCount */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return bufferCount; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Buffers the source Observable values until the size hits the maximum
* `bufferSize` given.
*
* <span class="informal">Collects values from the past as an array, and emits
* that array only when its size reaches `bufferSize`.</span>
*
* <img src="./img/bufferCount.png" width="100%">
*
* Buffers a number of values from the source Observable by `bufferSize` then
* emits the buffer and clears it, and starts a new buffer each
* `startBufferEvery` values. If `startBufferEvery` is not provided or is
* `null`, then new buffers are started immediately at the start of the source
* and when each buffer closes and is emitted.
*
* @example <caption>Emit the last two click events as an array</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var buffered = clicks.bufferCount(2);
* buffered.subscribe(x => console.log(x));
*
* @example <caption>On every click, emit the last two click events as an array</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var buffered = clicks.bufferCount(2, 1);
* buffered.subscribe(x => console.log(x));
*
* @see {@link buffer}
* @see {@link bufferTime}
* @see {@link bufferToggle}
* @see {@link bufferWhen}
* @see {@link pairwise}
* @see {@link windowCount}
*
* @param {number} bufferSize The maximum size of the buffer emitted.
* @param {number} [startBufferEvery] Interval at which to start a new buffer.
* For example if `startBufferEvery` is `2`, then a new buffer will be started
* on every other value from the source. A new buffer is started at the
* beginning of the source by default.
* @return {Observable<T[]>} An Observable of arrays of buffered values.
* @method bufferCount
* @owner Observable
*/
function bufferCount(bufferSize, startBufferEvery) {
if (startBufferEvery === void 0) {
startBufferEvery = null;
}
return function bufferCountOperatorFunction(source) {
return source.lift(new BufferCountOperator(bufferSize, startBufferEvery));
};
}
var BufferCountOperator = /*@__PURE__*/ (function () {
function BufferCountOperator(bufferSize, startBufferEvery) {
this.bufferSize = bufferSize;
this.startBufferEvery = startBufferEvery;
if (!startBufferEvery || bufferSize === startBufferEvery) {
this.subscriberClass = BufferCountSubscriber;
}
else {
this.subscriberClass = BufferSkipCountSubscriber;
}
}
BufferCountOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));
};
return BufferCountOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var BufferCountSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferCountSubscriber, _super);
function BufferCountSubscriber(destination, bufferSize) {
var _this = _super.call(this, destination) || this;
_this.bufferSize = bufferSize;
_this.buffer = [];
return _this;
}
BufferCountSubscriber.prototype._next = function (value) {
var buffer = this.buffer;
buffer.push(value);
if (buffer.length == this.bufferSize) {
this.destination.next(buffer);
this.buffer = [];
}
};
BufferCountSubscriber.prototype._complete = function () {
var buffer = this.buffer;
if (buffer.length > 0) {
this.destination.next(buffer);
}
_super.prototype._complete.call(this);
};
return BufferCountSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var BufferSkipCountSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferSkipCountSubscriber, _super);
function BufferSkipCountSubscriber(destination, bufferSize, startBufferEvery) {
var _this = _super.call(this, destination) || this;
_this.bufferSize = bufferSize;
_this.startBufferEvery = startBufferEvery;
_this.buffers = [];
_this.count = 0;
return _this;
}
BufferSkipCountSubscriber.prototype._next = function (value) {
var _a = this, bufferSize = _a.bufferSize, startBufferEvery = _a.startBufferEvery, buffers = _a.buffers, count = _a.count;
this.count++;
if (count % startBufferEvery === 0) {
buffers.push([]);
}
for (var i = buffers.length; i--;) {
var buffer = buffers[i];
buffer.push(value);
if (buffer.length === bufferSize) {
buffers.splice(i, 1);
this.destination.next(buffer);
}
}
};
BufferSkipCountSubscriber.prototype._complete = function () {
var _a = this, buffers = _a.buffers, destination = _a.destination;
while (buffers.length > 0) {
var buffer = buffers.shift();
if (buffer.length > 0) {
destination.next(buffer);
}
}
_super.prototype._complete.call(this);
};
return BufferSkipCountSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=bufferCount.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/bufferTime.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/bufferTime.js ***!
\******************************************************************/
/*! exports provided: bufferTime */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return bufferTime; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm5/internal/util/isScheduler.js");
/** PURE_IMPORTS_START tslib,_scheduler_async,_Subscriber,_util_isScheduler PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Buffers the source Observable values for a specific time period.
*
* <span class="informal">Collects values from the past as an array, and emits
* those arrays periodically in time.</span>
*
* <img src="./img/bufferTime.png" width="100%">
*
* Buffers values from the source for a specific time duration `bufferTimeSpan`.
* Unless the optional argument `bufferCreationInterval` is given, it emits and
* resets the buffer every `bufferTimeSpan` milliseconds. If
* `bufferCreationInterval` is given, this operator opens the buffer every
* `bufferCreationInterval` milliseconds and closes (emits and resets) the
* buffer every `bufferTimeSpan` milliseconds. When the optional argument
* `maxBufferSize` is specified, the buffer will be closed either after
* `bufferTimeSpan` milliseconds or when it contains `maxBufferSize` elements.
*
* @example <caption>Every second, emit an array of the recent click events</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var buffered = clicks.bufferTime(1000);
* buffered.subscribe(x => console.log(x));
*
* @example <caption>Every 5 seconds, emit the click events from the next 2 seconds</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var buffered = clicks.bufferTime(2000, 5000);
* buffered.subscribe(x => console.log(x));
*
* @see {@link buffer}
* @see {@link bufferCount}
* @see {@link bufferToggle}
* @see {@link bufferWhen}
* @see {@link windowTime}
*
* @param {number} bufferTimeSpan The amount of time to fill each buffer array.
* @param {number} [bufferCreationInterval] The interval at which to start new
* buffers.
* @param {number} [maxBufferSize] The maximum buffer size.
* @param {Scheduler} [scheduler=async] The scheduler on which to schedule the
* intervals that determine buffer boundaries.
* @return {Observable<T[]>} An observable of arrays of buffered values.
* @method bufferTime
* @owner Observable
*/
function bufferTime(bufferTimeSpan) {
var length = arguments.length;
var scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(arguments[arguments.length - 1])) {
scheduler = arguments[arguments.length - 1];
length--;
}
var bufferCreationInterval = null;
if (length >= 2) {
bufferCreationInterval = arguments[1];
}
var maxBufferSize = Number.POSITIVE_INFINITY;
if (length >= 3) {
maxBufferSize = arguments[2];
}
return function bufferTimeOperatorFunction(source) {
return source.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler));
};
}
var BufferTimeOperator = /*@__PURE__*/ (function () {
function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
this.bufferTimeSpan = bufferTimeSpan;
this.bufferCreationInterval = bufferCreationInterval;
this.maxBufferSize = maxBufferSize;
this.scheduler = scheduler;
}
BufferTimeOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.maxBufferSize, this.scheduler));
};
return BufferTimeOperator;
}());
var Context = /*@__PURE__*/ (function () {
function Context() {
this.buffer = [];
}
return Context;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var BufferTimeSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferTimeSubscriber, _super);
function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
var _this = _super.call(this, destination) || this;
_this.bufferTimeSpan = bufferTimeSpan;
_this.bufferCreationInterval = bufferCreationInterval;
_this.maxBufferSize = maxBufferSize;
_this.scheduler = scheduler;
_this.contexts = [];
var context = _this.openContext();
_this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0;
if (_this.timespanOnly) {
var timeSpanOnlyState = { subscriber: _this, context: context, bufferTimeSpan: bufferTimeSpan };
_this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
}
else {
var closeState = { subscriber: _this, context: context };
var creationState = { bufferTimeSpan: bufferTimeSpan, bufferCreationInterval: bufferCreationInterval, subscriber: _this, scheduler: scheduler };
_this.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState));
_this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState));
}
return _this;
}
BufferTimeSubscriber.prototype._next = function (value) {
var contexts = this.contexts;
var len = contexts.length;
var filledBufferContext;
for (var i = 0; i < len; i++) {
var context_1 = contexts[i];
var buffer = context_1.buffer;
buffer.push(value);
if (buffer.length == this.maxBufferSize) {
filledBufferContext = context_1;
}
}
if (filledBufferContext) {
this.onBufferFull(filledBufferContext);
}
};
BufferTimeSubscriber.prototype._error = function (err) {
this.contexts.length = 0;
_super.prototype._error.call(this, err);
};
BufferTimeSubscriber.prototype._complete = function () {
var _a = this, contexts = _a.contexts, destination = _a.destination;
while (contexts.length > 0) {
var context_2 = contexts.shift();
destination.next(context_2.buffer);
}
_super.prototype._complete.call(this);
};
/** @deprecated This is an internal implementation detail, do not use. */
BufferTimeSubscriber.prototype._unsubscribe = function () {
this.contexts = null;
};
BufferTimeSubscriber.prototype.onBufferFull = function (context) {
this.closeContext(context);
var closeAction = context.closeAction;
closeAction.unsubscribe();
this.remove(closeAction);
if (!this.closed && this.timespanOnly) {
context = this.openContext();
var bufferTimeSpan = this.bufferTimeSpan;
var timeSpanOnlyState = { subscriber: this, context: context, bufferTimeSpan: bufferTimeSpan };
this.add(context.closeAction = this.scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
}
};
BufferTimeSubscriber.prototype.openContext = function () {
var context = new Context();
this.contexts.push(context);
return context;
};
BufferTimeSubscriber.prototype.closeContext = function (context) {
this.destination.next(context.buffer);
var contexts = this.contexts;
var spliceIndex = contexts ? contexts.indexOf(context) : -1;
if (spliceIndex >= 0) {
contexts.splice(contexts.indexOf(context), 1);
}
};
return BufferTimeSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"]));
function dispatchBufferTimeSpanOnly(state) {
var subscriber = state.subscriber;
var prevContext = state.context;
if (prevContext) {
subscriber.closeContext(prevContext);
}
if (!subscriber.closed) {
state.context = subscriber.openContext();
state.context.closeAction = this.schedule(state, state.bufferTimeSpan);
}
}
function dispatchBufferCreation(state) {
var bufferCreationInterval = state.bufferCreationInterval, bufferTimeSpan = state.bufferTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler;
var context = subscriber.openContext();
var action = this;
if (!subscriber.closed) {
subscriber.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { subscriber: subscriber, context: context }));
action.schedule(state, bufferCreationInterval);
}
}
function dispatchBufferClose(arg) {
var subscriber = arg.subscriber, context = arg.context;
subscriber.closeContext(context);
}
//# sourceMappingURL=bufferTime.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/bufferToggle.js":
/*!********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/bufferToggle.js ***!
\********************************************************************/
/*! exports provided: bufferToggle */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return bufferToggle; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/** PURE_IMPORTS_START tslib,_Subscription,_util_subscribeToResult,_OuterSubscriber PURE_IMPORTS_END */
/**
* Buffers the source Observable values starting from an emission from
* `openings` and ending when the output of `closingSelector` emits.
*
* <span class="informal">Collects values from the past as an array. Starts
* collecting only when `opening` emits, and calls the `closingSelector`
* function to get an Observable that tells when to close the buffer.</span>
*
* <img src="./img/bufferToggle.png" width="100%">
*
* Buffers values from the source by opening the buffer via signals from an
* Observable provided to `openings`, and closing and sending the buffers when
* a Subscribable or Promise returned by the `closingSelector` function emits.
*
* @example <caption>Every other second, emit the click events from the next 500ms</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var openings = Rx.Observable.interval(1000);
* var buffered = clicks.bufferToggle(openings, i =>
* i % 2 ? Rx.Observable.interval(500) : Rx.Observable.empty()
* );
* buffered.subscribe(x => console.log(x));
*
* @see {@link buffer}
* @see {@link bufferCount}
* @see {@link bufferTime}
* @see {@link bufferWhen}
* @see {@link windowToggle}
*
* @param {SubscribableOrPromise<O>} openings A Subscribable or Promise of notifications to start new
* buffers.
* @param {function(value: O): SubscribableOrPromise} closingSelector A function that takes
* the value emitted by the `openings` observable and returns a Subscribable or Promise,
* which, when it emits, signals that the associated buffer should be emitted
* and cleared.
* @return {Observable<T[]>} An observable of arrays of buffered values.
* @method bufferToggle
* @owner Observable
*/
function bufferToggle(openings, closingSelector) {
return function bufferToggleOperatorFunction(source) {
return source.lift(new BufferToggleOperator(openings, closingSelector));
};
}
var BufferToggleOperator = /*@__PURE__*/ (function () {
function BufferToggleOperator(openings, closingSelector) {
this.openings = openings;
this.closingSelector = closingSelector;
}
BufferToggleOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector));
};
return BufferToggleOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var BufferToggleSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferToggleSubscriber, _super);
function BufferToggleSubscriber(destination, openings, closingSelector) {
var _this = _super.call(this, destination) || this;
_this.openings = openings;
_this.closingSelector = closingSelector;
_this.contexts = [];
_this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, openings));
return _this;
}
BufferToggleSubscriber.prototype._next = function (value) {
var contexts = this.contexts;
var len = contexts.length;
for (var i = 0; i < len; i++) {
contexts[i].buffer.push(value);
}
};
BufferToggleSubscriber.prototype._error = function (err) {
var contexts = this.contexts;
while (contexts.length > 0) {
var context_1 = contexts.shift();
context_1.subscription.unsubscribe();
context_1.buffer = null;
context_1.subscription = null;
}
this.contexts = null;
_super.prototype._error.call(this, err);
};
BufferToggleSubscriber.prototype._complete = function () {
var contexts = this.contexts;
while (contexts.length > 0) {
var context_2 = contexts.shift();
this.destination.next(context_2.buffer);
context_2.subscription.unsubscribe();
context_2.buffer = null;
context_2.subscription = null;
}
this.contexts = null;
_super.prototype._complete.call(this);
};
BufferToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
outerValue ? this.closeBuffer(outerValue) : this.openBuffer(innerValue);
};
BufferToggleSubscriber.prototype.notifyComplete = function (innerSub) {
this.closeBuffer(innerSub.context);
};
BufferToggleSubscriber.prototype.openBuffer = function (value) {
try {
var closingSelector = this.closingSelector;
var closingNotifier = closingSelector.call(this, value);
if (closingNotifier) {
this.trySubscribe(closingNotifier);
}
}
catch (err) {
this._error(err);
}
};
BufferToggleSubscriber.prototype.closeBuffer = function (context) {
var contexts = this.contexts;
if (contexts && context) {
var buffer = context.buffer, subscription = context.subscription;
this.destination.next(buffer);
contexts.splice(contexts.indexOf(context), 1);
this.remove(subscription);
subscription.unsubscribe();
}
};
BufferToggleSubscriber.prototype.trySubscribe = function (closingNotifier) {
var contexts = this.contexts;
var buffer = [];
var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
var context = { buffer: buffer, subscription: subscription };
contexts.push(context);
var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, closingNotifier, context);
if (!innerSubscription || innerSubscription.closed) {
this.closeBuffer(context);
}
else {
innerSubscription.context = context;
this.add(innerSubscription);
subscription.add(innerSubscription);
}
};
return BufferToggleSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
//# sourceMappingURL=bufferToggle.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/bufferWhen.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/bufferWhen.js ***!
\******************************************************************/
/*! exports provided: bufferWhen */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return bufferWhen; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/tryCatch */ "./node_modules/rxjs/_esm5/internal/util/tryCatch.js");
/* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/errorObject */ "./node_modules/rxjs/_esm5/internal/util/errorObject.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_Subscription,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Buffers the source Observable values, using a factory function of closing
* Observables to determine when to close, emit, and reset the buffer.
*
* <span class="informal">Collects values from the past as an array. When it
* starts collecting values, it calls a function that returns an Observable that
* tells when to close the buffer and restart collecting.</span>
*
* <img src="./img/bufferWhen.png" width="100%">
*
* Opens a buffer immediately, then closes the buffer when the observable
* returned by calling `closingSelector` function emits a value. When it closes
* the buffer, it immediately opens a new buffer and repeats the process.
*
* @example <caption>Emit an array of the last clicks every [1-5] random seconds</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var buffered = clicks.bufferWhen(() =>
* Rx.Observable.interval(1000 + Math.random() * 4000)
* );
* buffered.subscribe(x => console.log(x));
*
* @see {@link buffer}
* @see {@link bufferCount}
* @see {@link bufferTime}
* @see {@link bufferToggle}
* @see {@link windowWhen}
*
* @param {function(): Observable} closingSelector A function that takes no
* arguments and returns an Observable that signals buffer closure.
* @return {Observable<T[]>} An observable of arrays of buffered values.
* @method bufferWhen
* @owner Observable
*/
function bufferWhen(closingSelector) {
return function (source) {
return source.lift(new BufferWhenOperator(closingSelector));
};
}
var BufferWhenOperator = /*@__PURE__*/ (function () {
function BufferWhenOperator(closingSelector) {
this.closingSelector = closingSelector;
}
BufferWhenOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));
};
return BufferWhenOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var BufferWhenSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferWhenSubscriber, _super);
function BufferWhenSubscriber(destination, closingSelector) {
var _this = _super.call(this, destination) || this;
_this.closingSelector = closingSelector;
_this.subscribing = false;
_this.openBuffer();
return _this;
}
BufferWhenSubscriber.prototype._next = function (value) {
this.buffer.push(value);
};
BufferWhenSubscriber.prototype._complete = function () {
var buffer = this.buffer;
if (buffer) {
this.destination.next(buffer);
}
_super.prototype._complete.call(this);
};
/** @deprecated This is an internal implementation detail, do not use. */
BufferWhenSubscriber.prototype._unsubscribe = function () {
this.buffer = null;
this.subscribing = false;
};
BufferWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.openBuffer();
};
BufferWhenSubscriber.prototype.notifyComplete = function () {
if (this.subscribing) {
this.complete();
}
else {
this.openBuffer();
}
};
BufferWhenSubscriber.prototype.openBuffer = function () {
var closingSubscription = this.closingSubscription;
if (closingSubscription) {
this.remove(closingSubscription);
closingSubscription.unsubscribe();
}
var buffer = this.buffer;
if (this.buffer) {
this.destination.next(buffer);
}
this.buffer = [];
var closingNotifier = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(this.closingSelector)();
if (closingNotifier === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) {
this.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"].e);
}
else {
closingSubscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
this.closingSubscription = closingSubscription;
this.add(closingSubscription);
this.subscribing = true;
closingSubscription.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, closingNotifier));
this.subscribing = false;
}
};
return BufferWhenSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"]));
//# sourceMappingURL=bufferWhen.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/catchError.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/catchError.js ***!
\******************************************************************/
/*! exports provided: catchError */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return catchError; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Catches errors on the observable to be handled by returning a new observable or throwing an error.
*
* <img src="./img/catch.png" width="100%">
*
* @example <caption>Continues with a different Observable when there's an error</caption>
*
* Observable.of(1, 2, 3, 4, 5)
* .map(n => {
* if (n == 4) {
* throw 'four!';
* }
* return n;
* })
* .catch(err => Observable.of('I', 'II', 'III', 'IV', 'V'))
* .subscribe(x => console.log(x));
* // 1, 2, 3, I, II, III, IV, V
*
* @example <caption>Retries the caught source Observable again in case of error, similar to retry() operator</caption>
*
* Observable.of(1, 2, 3, 4, 5)
* .map(n => {
* if (n === 4) {
* throw 'four!';
* }
* return n;
* })
* .catch((err, caught) => caught)
* .take(30)
* .subscribe(x => console.log(x));
* // 1, 2, 3, 1, 2, 3, ...
*
* @example <caption>Throws a new error when the source Observable throws an error</caption>
*
* Observable.of(1, 2, 3, 4, 5)
* .map(n => {
* if (n == 4) {
* throw 'four!';
* }
* return n;
* })
* .catch(err => {
* throw 'error in source. Details: ' + err;
* })
* .subscribe(
* x => console.log(x),
* err => console.log(err)
* );
* // 1, 2, 3, error in source. Details: four!
*
* @param {function} selector a function that takes as arguments `err`, which is the error, and `caught`, which
* is the source observable, in case you'd like to "retry" that observable by returning it again. Whatever observable
* is returned by the `selector` will be used to continue the observable chain.
* @return {Observable} An observable that originates from either the source or the observable returned by the
* catch `selector` function.
* @name catchError
*/
function catchError(selector) {
return function catchErrorOperatorFunction(source) {
var operator = new CatchOperator(selector);
var caught = source.lift(operator);
return (operator.caught = caught);
};
}
var CatchOperator = /*@__PURE__*/ (function () {
function CatchOperator(selector) {
this.selector = selector;
}
CatchOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught));
};
return CatchOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var CatchSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CatchSubscriber, _super);
function CatchSubscriber(destination, selector, caught) {
var _this = _super.call(this, destination) || this;
_this.selector = selector;
_this.caught = caught;
return _this;
}
// NOTE: overriding `error` instead of `_error` because we don't want
// to have this flag this subscriber as `isStopped`. We can mimic the
// behavior of the RetrySubscriber (from the `retry` operator), where
// we unsubscribe from our source chain, reset our Subscriber flags,
// then subscribe to the selector result.
CatchSubscriber.prototype.error = function (err) {
if (!this.isStopped) {
var result = void 0;
try {
result = this.selector(err, this.caught);
}
catch (err2) {
_super.prototype.error.call(this, err2);
return;
}
this._unsubscribeAndRecycle();
this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, result));
}
};
return CatchSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
//# sourceMappingURL=catchError.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/combineAll.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/combineAll.js ***!
\******************************************************************/
/*! exports provided: combineAll */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return combineAll; });
/* harmony import */ var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/combineLatest */ "./node_modules/rxjs/_esm5/internal/observable/combineLatest.js");
/** PURE_IMPORTS_START _observable_combineLatest PURE_IMPORTS_END */
function combineAll(project) {
return function (source) { return source.lift(new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__["CombineLatestOperator"](project)); };
}
//# sourceMappingURL=combineAll.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/combineLatest.js":
/*!*********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/combineLatest.js ***!
\*********************************************************************/
/*! exports provided: combineLatest */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; });
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/* harmony import */ var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/combineLatest */ "./node_modules/rxjs/_esm5/internal/observable/combineLatest.js");
/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/from */ "./node_modules/rxjs/_esm5/internal/observable/from.js");
/** PURE_IMPORTS_START _util_isArray,_observable_combineLatest,_observable_from PURE_IMPORTS_END */
var none = {};
/* tslint:enable:max-line-length */
/**
* @deprecated Deprecated in favor of static combineLatest.
*/
function combineLatest() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
var project = null;
if (typeof observables[observables.length - 1] === 'function') {
project = observables.pop();
}
// if the first and only other argument besides the resultSelector is an array
// assume it's been called with `combineLatest([obs1, obs2, obs3], project)`
if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) {
observables = observables[0].slice();
}
return function (source) { return source.lift.call(Object(_observable_from__WEBPACK_IMPORTED_MODULE_2__["from"])([source].concat(observables)), new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__["CombineLatestOperator"](project)); };
}
//# sourceMappingURL=combineLatest.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/concat.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/concat.js ***!
\**************************************************************/
/*! exports provided: concat */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; });
/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/concat */ "./node_modules/rxjs/_esm5/internal/observable/concat.js");
/** PURE_IMPORTS_START _observable_concat PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* @deprecated Deprecated in favor of static concat.
*/
function concat() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
return function (source) { return source.lift.call(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"].apply(void 0, [source].concat(observables))); };
}
//# sourceMappingURL=concat.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/concatAll.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/concatAll.js ***!
\*****************************************************************/
/*! exports provided: concatAll */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return concatAll; });
/* harmony import */ var _mergeAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeAll */ "./node_modules/rxjs/_esm5/internal/operators/mergeAll.js");
/** PURE_IMPORTS_START _mergeAll PURE_IMPORTS_END */
/**
* Converts a higher-order Observable into a first-order Observable by
* concatenating the inner Observables in order.
*
* <span class="informal">Flattens an Observable-of-Observables by putting one
* inner Observable after the other.</span>
*
* <img src="./img/concatAll.png" width="100%">
*
* Joins every Observable emitted by the source (a higher-order Observable), in
* a serial fashion. It subscribes to each inner Observable only after the
* previous inner Observable has completed, and merges all of their values into
* the returned observable.
*
* __Warning:__ If the source Observable emits Observables quickly and
* endlessly, and the inner Observables it emits generally complete slower than
* the source emits, you can run into memory issues as the incoming Observables
* collect in an unbounded buffer.
*
* Note: `concatAll` is equivalent to `mergeAll` with concurrency parameter set
* to `1`.
*
* @example <caption>For each click event, tick every second from 0 to 3, with no concurrency</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var higherOrder = clicks.map(ev => Rx.Observable.interval(1000).take(4));
* var firstOrder = higherOrder.concatAll();
* firstOrder.subscribe(x => console.log(x));
*
* // Results in the following:
* // (results are not concurrent)
* // For every click on the "document" it will emit values 0 to 3 spaced
* // on a 1000ms interval
* // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3
*
* @see {@link combineAll}
* @see {@link concat}
* @see {@link concatMap}
* @see {@link concatMapTo}
* @see {@link exhaust}
* @see {@link mergeAll}
* @see {@link switch}
* @see {@link zipAll}
*
* @return {Observable} An Observable emitting values from all the inner
* Observables concatenated.
* @method concatAll
* @owner Observable
*/
function concatAll() {
return Object(_mergeAll__WEBPACK_IMPORTED_MODULE_0__["mergeAll"])(1);
}
//# sourceMappingURL=concatAll.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/concatMap.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/concatMap.js ***!
\*****************************************************************/
/*! exports provided: concatMap */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return concatMap; });
/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ "./node_modules/rxjs/_esm5/internal/operators/mergeMap.js");
/** PURE_IMPORTS_START _mergeMap PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Projects each source value to an Observable which is merged in the output
* Observable, in a serialized fashion waiting for each one to complete before
* merging the next.
*
* <span class="informal">Maps each value to an Observable, then flattens all of
* these inner Observables using {@link concatAll}.</span>
*
* <img src="./img/concatMap.png" width="100%">
*
* Returns an Observable that emits items based on applying a function that you
* supply to each item emitted by the source Observable, where that function
* returns an (so-called "inner") Observable. Each new inner Observable is
* concatenated with the previous inner Observable.
*
* __Warning:__ if source values arrive endlessly and faster than their
* corresponding inner Observables can complete, it will result in memory issues
* as inner Observables amass in an unbounded buffer waiting for their turn to
* be subscribed to.
*
* Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set
* to `1`.
*
* @example <caption>For each click event, tick every second from 0 to 3, with no concurrency</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.concatMap(ev => Rx.Observable.interval(1000).take(4));
* result.subscribe(x => console.log(x));
*
* // Results in the following:
* // (results are not concurrent)
* // For every click on the "document" it will emit values 0 to 3 spaced
* // on a 1000ms interval
* // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3
*
* @see {@link concat}
* @see {@link concatAll}
* @see {@link concatMapTo}
* @see {@link exhaustMap}
* @see {@link mergeMap}
* @see {@link switchMap}
*
* @param {function(value: T, ?index: number): ObservableInput} project A function
* that, when applied to an item emitted by the source Observable, returns an
* Observable.
* @return {Observable} An Observable that emits the result of applying the
* projection function (and the optional `resultSelector`) to each item emitted
* by the source Observable and taking values from each projected inner
* Observable sequentially.
* @method concatMap
* @owner Observable
*/
function concatMap(project, resultSelector) {
return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(project, resultSelector, 1);
}
//# sourceMappingURL=concatMap.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/concatMapTo.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/concatMapTo.js ***!
\*******************************************************************/
/*! exports provided: concatMapTo */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return concatMapTo; });
/* harmony import */ var _concatMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./concatMap */ "./node_modules/rxjs/_esm5/internal/operators/concatMap.js");
/** PURE_IMPORTS_START _concatMap PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Projects each source value to the same Observable which is merged multiple
* times in a serialized fashion on the output Observable.
*
* <span class="informal">It's like {@link concatMap}, but maps each value
* always to the same inner Observable.</span>
*
* <img src="./img/concatMapTo.png" width="100%">
*
* Maps each source value to the given Observable `innerObservable` regardless
* of the source value, and then flattens those resulting Observables into one
* single Observable, which is the output Observable. Each new `innerObservable`
* instance emitted on the output Observable is concatenated with the previous
* `innerObservable` instance.
*
* __Warning:__ if source values arrive endlessly and faster than their
* corresponding inner Observables can complete, it will result in memory issues
* as inner Observables amass in an unbounded buffer waiting for their turn to
* be subscribed to.
*
* Note: `concatMapTo` is equivalent to `mergeMapTo` with concurrency parameter
* set to `1`.
*
* @example <caption>For each click event, tick every second from 0 to 3, with no concurrency</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.concatMapTo(Rx.Observable.interval(1000).take(4));
* result.subscribe(x => console.log(x));
*
* // Results in the following:
* // (results are not concurrent)
* // For every click on the "document" it will emit values 0 to 3 spaced
* // on a 1000ms interval
* // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3
*
* @see {@link concat}
* @see {@link concatAll}
* @see {@link concatMap}
* @see {@link mergeMapTo}
* @see {@link switchMapTo}
*
* @param {ObservableInput} innerObservable An Observable to replace each value from
* the source Observable.
* @return {Observable} An observable of values merged together by joining the
* passed observable with itself, one after the other, for each value emitted
* from the source.
* @method concatMapTo
* @owner Observable
*/
function concatMapTo(innerObservable, resultSelector) {
return Object(_concatMap__WEBPACK_IMPORTED_MODULE_0__["concatMap"])(function () { return innerObservable; }, resultSelector);
}
//# sourceMappingURL=concatMapTo.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/count.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/count.js ***!
\*************************************************************/
/*! exports provided: count */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "count", function() { return count; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Counts the number of emissions on the source and emits that number when the
* source completes.
*
* <span class="informal">Tells how many values were emitted, when the source
* completes.</span>
*
* <img src="./img/count.png" width="100%">
*
* `count` transforms an Observable that emits values into an Observable that
* emits a single value that represents the number of values emitted by the
* source Observable. If the source Observable terminates with an error, `count`
* will pass this error notification along without emitting a value first. If
* the source Observable does not terminate at all, `count` will neither emit
* a value nor terminate. This operator takes an optional `predicate` function
* as argument, in which case the output emission will represent the number of
* source values that matched `true` with the `predicate`.
*
* @example <caption>Counts how many seconds have passed before the first click happened</caption>
* var seconds = Rx.Observable.interval(1000);
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var secondsBeforeClick = seconds.takeUntil(clicks);
* var result = secondsBeforeClick.count();
* result.subscribe(x => console.log(x));
*
* @example <caption>Counts how many odd numbers are there between 1 and 7</caption>
* var numbers = Rx.Observable.range(1, 7);
* var result = numbers.count(i => i % 2 === 1);
* result.subscribe(x => console.log(x));
*
* // Results in:
* // 4
*
* @see {@link max}
* @see {@link min}
* @see {@link reduce}
*
* @param {function(value: T, i: number, source: Observable<T>): boolean} [predicate] A
* boolean function to select what values are to be counted. It is provided with
* arguments of:
* - `value`: the value from the source Observable.
* - `index`: the (zero-based) "index" of the value from the source Observable.
* - `source`: the source Observable instance itself.
* @return {Observable} An Observable of one number that represents the count as
* described above.
* @method count
* @owner Observable
*/
function count(predicate) {
return function (source) { return source.lift(new CountOperator(predicate, source)); };
}
var CountOperator = /*@__PURE__*/ (function () {
function CountOperator(predicate, source) {
this.predicate = predicate;
this.source = source;
}
CountOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source));
};
return CountOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var CountSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CountSubscriber, _super);
function CountSubscriber(destination, predicate, source) {
var _this = _super.call(this, destination) || this;
_this.predicate = predicate;
_this.source = source;
_this.count = 0;
_this.index = 0;
return _this;
}
CountSubscriber.prototype._next = function (value) {
if (this.predicate) {
this._tryPredicate(value);
}
else {
this.count++;
}
};
CountSubscriber.prototype._tryPredicate = function (value) {
var result;
try {
result = this.predicate(value, this.index++, this.source);
}
catch (err) {
this.destination.error(err);
return;
}
if (result) {
this.count++;
}
};
CountSubscriber.prototype._complete = function () {
this.destination.next(this.count);
this.destination.complete();
};
return CountSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=count.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/debounce.js":
/*!****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/debounce.js ***!
\****************************************************************/
/*! exports provided: debounce */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Emits a value from the source Observable only after a particular time span
* determined by another Observable has passed without another source emission.
*
* <span class="informal">It's like {@link debounceTime}, but the time span of
* emission silence is determined by a second Observable.</span>
*
* <img src="./img/debounce.png" width="100%">
*
* `debounce` delays values emitted by the source Observable, but drops previous
* pending delayed emissions if a new value arrives on the source Observable.
* This operator keeps track of the most recent value from the source
* Observable, and spawns a duration Observable by calling the
* `durationSelector` function. The value is emitted only when the duration
* Observable emits a value or completes, and if no other value was emitted on
* the source Observable since the duration Observable was spawned. If a new
* value appears before the duration Observable emits, the previous value will
* be dropped and will not be emitted on the output Observable.
*
* Like {@link debounceTime}, this is a rate-limiting operator, and also a
* delay-like operator since output emissions do not necessarily occur at the
* same time as they did on the source Observable.
*
* @example <caption>Emit the most recent click after a burst of clicks</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.debounce(() => Rx.Observable.interval(1000));
* result.subscribe(x => console.log(x));
*
* @see {@link audit}
* @see {@link debounceTime}
* @see {@link delayWhen}
* @see {@link throttle}
*
* @param {function(value: T): SubscribableOrPromise} durationSelector A function
* that receives a value from the source Observable, for computing the timeout
* duration for each source value, returned as an Observable or a Promise.
* @return {Observable} An Observable that delays the emissions of the source
* Observable by the specified duration Observable returned by
* `durationSelector`, and may drop some values if they occur too frequently.
* @method debounce
* @owner Observable
*/
function debounce(durationSelector) {
return function (source) { return source.lift(new DebounceOperator(durationSelector)); };
}
var DebounceOperator = /*@__PURE__*/ (function () {
function DebounceOperator(durationSelector) {
this.durationSelector = durationSelector;
}
DebounceOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));
};
return DebounceOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var DebounceSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DebounceSubscriber, _super);
function DebounceSubscriber(destination, durationSelector) {
var _this = _super.call(this, destination) || this;
_this.durationSelector = durationSelector;
_this.hasValue = false;
_this.durationSubscription = null;
return _this;
}
DebounceSubscriber.prototype._next = function (value) {
try {
var result = this.durationSelector.call(this, value);
if (result) {
this._tryNext(value, result);
}
}
catch (err) {
this.destination.error(err);
}
};
DebounceSubscriber.prototype._complete = function () {
this.emitValue();
this.destination.complete();
};
DebounceSubscriber.prototype._tryNext = function (value, duration) {
var subscription = this.durationSubscription;
this.value = value;
this.hasValue = true;
if (subscription) {
subscription.unsubscribe();
this.remove(subscription);
}
subscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, duration);
if (subscription && !subscription.closed) {
this.add(this.durationSubscription = subscription);
}
};
DebounceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.emitValue();
};
DebounceSubscriber.prototype.notifyComplete = function () {
this.emitValue();
};
DebounceSubscriber.prototype.emitValue = function () {
if (this.hasValue) {
var value = this.value;
var subscription = this.durationSubscription;
if (subscription) {
this.durationSubscription = null;
subscription.unsubscribe();
this.remove(subscription);
}
// This must be done *before* passing the value
// along to the destination because it's possible for
// the value to synchronously re-enter this operator
// recursively if the duration selector Observable
// emits synchronously
this.value = null;
this.hasValue = false;
_super.prototype._next.call(this, value);
}
};
return DebounceSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
//# sourceMappingURL=debounce.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/debounceTime.js":
/*!********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/debounceTime.js ***!
\********************************************************************/
/*! exports provided: debounceTime */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return debounceTime; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */
/**
* Emits a value from the source Observable only after a particular time span
* has passed without another source emission.
*
* <span class="informal">It's like {@link delay}, but passes only the most
* recent value from each burst of emissions.</span>
*
* <img src="./img/debounceTime.png" width="100%">
*
* `debounceTime` delays values emitted by the source Observable, but drops
* previous pending delayed emissions if a new value arrives on the source
* Observable. This operator keeps track of the most recent value from the
* source Observable, and emits that only when `dueTime` enough time has passed
* without any other value appearing on the source Observable. If a new value
* appears before `dueTime` silence occurs, the previous value will be dropped
* and will not be emitted on the output Observable.
*
* This is a rate-limiting operator, because it is impossible for more than one
* value to be emitted in any time window of duration `dueTime`, but it is also
* a delay-like operator since output emissions do not occur at the same time as
* they did on the source Observable. Optionally takes a {@link IScheduler} for
* managing timers.
*
* @example <caption>Emit the most recent click after a burst of clicks</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.debounceTime(1000);
* result.subscribe(x => console.log(x));
*
* @see {@link auditTime}
* @see {@link debounce}
* @see {@link delay}
* @see {@link sampleTime}
* @see {@link throttleTime}
*
* @param {number} dueTime The timeout duration in milliseconds (or the time
* unit determined internally by the optional `scheduler`) for the window of
* time required to wait for emission silence before emitting the most recent
* source value.
* @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for
* managing the timers that handle the timeout for each value.
* @return {Observable} An Observable that delays the emissions of the source
* Observable by the specified `dueTime`, and may drop some values if they occur
* too frequently.
* @method debounceTime
* @owner Observable
*/
function debounceTime(dueTime, scheduler) {
if (scheduler === void 0) {
scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"];
}
return function (source) { return source.lift(new DebounceTimeOperator(dueTime, scheduler)); };
}
var DebounceTimeOperator = /*@__PURE__*/ (function () {
function DebounceTimeOperator(dueTime, scheduler) {
this.dueTime = dueTime;
this.scheduler = scheduler;
}
DebounceTimeOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));
};
return DebounceTimeOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var DebounceTimeSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DebounceTimeSubscriber, _super);
function DebounceTimeSubscriber(destination, dueTime, scheduler) {
var _this = _super.call(this, destination) || this;
_this.dueTime = dueTime;
_this.scheduler = scheduler;
_this.debouncedSubscription = null;
_this.lastValue = null;
_this.hasValue = false;
return _this;
}
DebounceTimeSubscriber.prototype._next = function (value) {
this.clearDebounce();
this.lastValue = value;
this.hasValue = true;
this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));
};
DebounceTimeSubscriber.prototype._complete = function () {
this.debouncedNext();
this.destination.complete();
};
DebounceTimeSubscriber.prototype.debouncedNext = function () {
this.clearDebounce();
if (this.hasValue) {
var lastValue = this.lastValue;
// This must be done *before* passing the value
// along to the destination because it's possible for
// the value to synchronously re-enter this operator
// recursively when scheduled with things like
// VirtualScheduler/TestScheduler.
this.lastValue = null;
this.hasValue = false;
this.destination.next(lastValue);
}
};
DebounceTimeSubscriber.prototype.clearDebounce = function () {
var debouncedSubscription = this.debouncedSubscription;
if (debouncedSubscription !== null) {
this.remove(debouncedSubscription);
debouncedSubscription.unsubscribe();
this.debouncedSubscription = null;
}
};
return DebounceTimeSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
function dispatchNext(subscriber) {
subscriber.debouncedNext();
}
//# sourceMappingURL=debounceTime.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/defaultIfEmpty.js":
/*!**********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/defaultIfEmpty.js ***!
\**********************************************************************/
/*! exports provided: defaultIfEmpty */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return defaultIfEmpty; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Emits a given value if the source Observable completes without emitting any
* `next` value, otherwise mirrors the source Observable.
*
* <span class="informal">If the source Observable turns out to be empty, then
* this operator will emit a default value.</span>
*
* <img src="./img/defaultIfEmpty.png" width="100%">
*
* `defaultIfEmpty` emits the values emitted by the source Observable or a
* specified default value if the source Observable is empty (completes without
* having emitted any `next` value).
*
* @example <caption>If no clicks happen in 5 seconds, then emit "no clicks"</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var clicksBeforeFive = clicks.takeUntil(Rx.Observable.interval(5000));
* var result = clicksBeforeFive.defaultIfEmpty('no clicks');
* result.subscribe(x => console.log(x));
*
* @see {@link empty}
* @see {@link last}
*
* @param {any} [defaultValue=null] The default value used if the source
* Observable is empty.
* @return {Observable} An Observable that emits either the specified
* `defaultValue` if the source Observable emits no items, or the values emitted
* by the source Observable.
* @method defaultIfEmpty
* @owner Observable
*/
function defaultIfEmpty(defaultValue) {
if (defaultValue === void 0) {
defaultValue = null;
}
return function (source) { return source.lift(new DefaultIfEmptyOperator(defaultValue)); };
}
var DefaultIfEmptyOperator = /*@__PURE__*/ (function () {
function DefaultIfEmptyOperator(defaultValue) {
this.defaultValue = defaultValue;
}
DefaultIfEmptyOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue));
};
return DefaultIfEmptyOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var DefaultIfEmptySubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DefaultIfEmptySubscriber, _super);
function DefaultIfEmptySubscriber(destination, defaultValue) {
var _this = _super.call(this, destination) || this;
_this.defaultValue = defaultValue;
_this.isEmpty = true;
return _this;
}
DefaultIfEmptySubscriber.prototype._next = function (value) {
this.isEmpty = false;
this.destination.next(value);
};
DefaultIfEmptySubscriber.prototype._complete = function () {
if (this.isEmpty) {
this.destination.next(this.defaultValue);
}
this.destination.complete();
};
return DefaultIfEmptySubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=defaultIfEmpty.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/delay.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/delay.js ***!
\*************************************************************/
/*! exports provided: delay */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return delay; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isDate */ "./node_modules/rxjs/_esm5/internal/util/isDate.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Notification */ "./node_modules/rxjs/_esm5/internal/Notification.js");
/** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_Subscriber,_Notification PURE_IMPORTS_END */
/**
* Delays the emission of items from the source Observable by a given timeout or
* until a given Date.
*
* <span class="informal">Time shifts each item by some specified amount of
* milliseconds.</span>
*
* <img src="./img/delay.png" width="100%">
*
* If the delay argument is a Number, this operator time shifts the source
* Observable by that amount of time expressed in milliseconds. The relative
* time intervals between the values are preserved.
*
* If the delay argument is a Date, this operator time shifts the start of the
* Observable execution until the given date occurs.
*
* @example <caption>Delay each click by one second</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var delayedClicks = clicks.delay(1000); // each click emitted after 1 second
* delayedClicks.subscribe(x => console.log(x));
*
* @example <caption>Delay all clicks until a future date happens</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var date = new Date('March 15, 2050 12:00:00'); // in the future
* var delayedClicks = clicks.delay(date); // click emitted only after that date
* delayedClicks.subscribe(x => console.log(x));
*
* @see {@link debounceTime}
* @see {@link delayWhen}
*
* @param {number|Date} delay The delay duration in milliseconds (a `number`) or
* a `Date` until which the emission of the source items is delayed.
* @param {Scheduler} [scheduler=async] The IScheduler to use for
* managing the timers that handle the time-shift for each item.
* @return {Observable} An Observable that delays the emissions of the source
* Observable by the specified timeout or Date.
* @method delay
* @owner Observable
*/
function delay(delay, scheduler) {
if (scheduler === void 0) {
scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
}
var absoluteDelay = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_2__["isDate"])(delay);
var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);
return function (source) { return source.lift(new DelayOperator(delayFor, scheduler)); };
}
var DelayOperator = /*@__PURE__*/ (function () {
function DelayOperator(delay, scheduler) {
this.delay = delay;
this.scheduler = scheduler;
}
DelayOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));
};
return DelayOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var DelaySubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DelaySubscriber, _super);
function DelaySubscriber(destination, delay, scheduler) {
var _this = _super.call(this, destination) || this;
_this.delay = delay;
_this.scheduler = scheduler;
_this.queue = [];
_this.active = false;
_this.errored = false;
return _this;
}
DelaySubscriber.dispatch = function (state) {
var source = state.source;
var queue = source.queue;
var scheduler = state.scheduler;
var destination = state.destination;
while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {
queue.shift().notification.observe(destination);
}
if (queue.length > 0) {
var delay_1 = Math.max(0, queue[0].time - scheduler.now());
this.schedule(state, delay_1);
}
else {
this.unsubscribe();
source.active = false;
}
};
DelaySubscriber.prototype._schedule = function (scheduler) {
this.active = true;
this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {
source: this, destination: this.destination, scheduler: scheduler
}));
};
DelaySubscriber.prototype.scheduleNotification = function (notification) {
if (this.errored === true) {
return;
}
var scheduler = this.scheduler;
var message = new DelayMessage(scheduler.now() + this.delay, notification);
this.queue.push(message);
if (this.active === false) {
this._schedule(scheduler);
}
};
DelaySubscriber.prototype._next = function (value) {
this.scheduleNotification(_Notification__WEBPACK_IMPORTED_MODULE_4__["Notification"].createNext(value));
};
DelaySubscriber.prototype._error = function (err) {
this.errored = true;
this.queue = [];
this.destination.error(err);
};
DelaySubscriber.prototype._complete = function () {
this.scheduleNotification(_Notification__WEBPACK_IMPORTED_MODULE_4__["Notification"].createComplete());
};
return DelaySubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"]));
var DelayMessage = /*@__PURE__*/ (function () {
function DelayMessage(time, notification) {
this.time = time;
this.notification = notification;
}
return DelayMessage;
}());
//# sourceMappingURL=delay.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/delayWhen.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/delayWhen.js ***!
\*****************************************************************/
/*! exports provided: delayWhen */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return delayWhen; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_Observable,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Delays the emission of items from the source Observable by a given time span
* determined by the emissions of another Observable.
*
* <span class="informal">It's like {@link delay}, but the time span of the
* delay duration is determined by a second Observable.</span>
*
* <img src="./img/delayWhen.png" width="100%">
*
* `delayWhen` time shifts each emitted value from the source Observable by a
* time span determined by another Observable. When the source emits a value,
* the `delayDurationSelector` function is called with the source value as
* argument, and should return an Observable, called the "duration" Observable.
* The source value is emitted on the output Observable only when the duration
* Observable emits a value or completes.
*
* Optionally, `delayWhen` takes a second argument, `subscriptionDelay`, which
* is an Observable. When `subscriptionDelay` emits its first value or
* completes, the source Observable is subscribed to and starts behaving like
* described in the previous paragraph. If `subscriptionDelay` is not provided,
* `delayWhen` will subscribe to the source Observable as soon as the output
* Observable is subscribed.
*
* @example <caption>Delay each click by a random amount of time, between 0 and 5 seconds</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var delayedClicks = clicks.delayWhen(event =>
* Rx.Observable.interval(Math.random() * 5000)
* );
* delayedClicks.subscribe(x => console.log(x));
*
* @see {@link debounce}
* @see {@link delay}
*
* @param {function(value: T): Observable} delayDurationSelector A function that
* returns an Observable for each value emitted by the source Observable, which
* is then used to delay the emission of that item on the output Observable
* until the Observable returned from this function emits a value.
* @param {Observable} subscriptionDelay An Observable that triggers the
* subscription to the source Observable once it emits any value.
* @return {Observable} An Observable that delays the emissions of the source
* Observable by an amount of time specified by the Observable returned by
* `delayDurationSelector`.
* @method delayWhen
* @owner Observable
*/
function delayWhen(delayDurationSelector, subscriptionDelay) {
if (subscriptionDelay) {
return function (source) {
return new SubscriptionDelayObservable(source, subscriptionDelay)
.lift(new DelayWhenOperator(delayDurationSelector));
};
}
return function (source) { return source.lift(new DelayWhenOperator(delayDurationSelector)); };
}
var DelayWhenOperator = /*@__PURE__*/ (function () {
function DelayWhenOperator(delayDurationSelector) {
this.delayDurationSelector = delayDurationSelector;
}
DelayWhenOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector));
};
return DelayWhenOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var DelayWhenSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DelayWhenSubscriber, _super);
function DelayWhenSubscriber(destination, delayDurationSelector) {
var _this = _super.call(this, destination) || this;
_this.delayDurationSelector = delayDurationSelector;
_this.completed = false;
_this.delayNotifierSubscriptions = [];
_this.values = [];
return _this;
}
DelayWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.destination.next(outerValue);
this.removeSubscription(innerSub);
this.tryComplete();
};
DelayWhenSubscriber.prototype.notifyError = function (error, innerSub) {
this._error(error);
};
DelayWhenSubscriber.prototype.notifyComplete = function (innerSub) {
var value = this.removeSubscription(innerSub);
if (value) {
this.destination.next(value);
}
this.tryComplete();
};
DelayWhenSubscriber.prototype._next = function (value) {
try {
var delayNotifier = this.delayDurationSelector(value);
if (delayNotifier) {
this.tryDelay(delayNotifier, value);
}
}
catch (err) {
this.destination.error(err);
}
};
DelayWhenSubscriber.prototype._complete = function () {
this.completed = true;
this.tryComplete();
};
DelayWhenSubscriber.prototype.removeSubscription = function (subscription) {
subscription.unsubscribe();
var subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription);
var value = null;
if (subscriptionIdx !== -1) {
value = this.values[subscriptionIdx];
this.delayNotifierSubscriptions.splice(subscriptionIdx, 1);
this.values.splice(subscriptionIdx, 1);
}
return value;
};
DelayWhenSubscriber.prototype.tryDelay = function (delayNotifier, value) {
var notifierSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, delayNotifier, value);
if (notifierSubscription && !notifierSubscription.closed) {
this.add(notifierSubscription);
this.delayNotifierSubscriptions.push(notifierSubscription);
}
this.values.push(value);
};
DelayWhenSubscriber.prototype.tryComplete = function () {
if (this.completed && this.delayNotifierSubscriptions.length === 0) {
this.destination.complete();
}
};
return DelayWhenSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SubscriptionDelayObservable = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubscriptionDelayObservable, _super);
function SubscriptionDelayObservable(source, subscriptionDelay) {
var _this = _super.call(this) || this;
_this.source = source;
_this.subscriptionDelay = subscriptionDelay;
return _this;
}
/** @deprecated This is an internal implementation detail, do not use. */
SubscriptionDelayObservable.prototype._subscribe = function (subscriber) {
this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source));
};
return SubscriptionDelayObservable;
}(_Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"]));
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SubscriptionDelaySubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubscriptionDelaySubscriber, _super);
function SubscriptionDelaySubscriber(parent, source) {
var _this = _super.call(this) || this;
_this.parent = parent;
_this.source = source;
_this.sourceSubscribed = false;
return _this;
}
SubscriptionDelaySubscriber.prototype._next = function (unused) {
this.subscribeToSource();
};
SubscriptionDelaySubscriber.prototype._error = function (err) {
this.unsubscribe();
this.parent.error(err);
};
SubscriptionDelaySubscriber.prototype._complete = function () {
this.subscribeToSource();
};
SubscriptionDelaySubscriber.prototype.subscribeToSource = function () {
if (!this.sourceSubscribed) {
this.sourceSubscribed = true;
this.unsubscribe();
this.source.subscribe(this.parent);
}
};
return SubscriptionDelaySubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=delayWhen.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/dematerialize.js":
/*!*********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/dematerialize.js ***!
\*********************************************************************/
/*! exports provided: dematerialize */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return dematerialize; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Converts an Observable of {@link Notification} objects into the emissions
* that they represent.
*
* <span class="informal">Unwraps {@link Notification} objects as actual `next`,
* `error` and `complete` emissions. The opposite of {@link materialize}.</span>
*
* <img src="./img/dematerialize.png" width="100%">
*
* `dematerialize` is assumed to operate an Observable that only emits
* {@link Notification} objects as `next` emissions, and does not emit any
* `error`. Such Observable is the output of a `materialize` operation. Those
* notifications are then unwrapped using the metadata they contain, and emitted
* as `next`, `error`, and `complete` on the output Observable.
*
* Use this operator in conjunction with {@link materialize}.
*
* @example <caption>Convert an Observable of Notifications to an actual Observable</caption>
* var notifA = new Rx.Notification('N', 'A');
* var notifB = new Rx.Notification('N', 'B');
* var notifE = new Rx.Notification('E', void 0,
* new TypeError('x.toUpperCase is not a function')
* );
* var materialized = Rx.Observable.of(notifA, notifB, notifE);
* var upperCase = materialized.dematerialize();
* upperCase.subscribe(x => console.log(x), e => console.error(e));
*
* // Results in:
* // A
* // B
* // TypeError: x.toUpperCase is not a function
*
* @see {@link Notification}
* @see {@link materialize}
*
* @return {Observable} An Observable that emits items and notifications
* embedded in Notification objects emitted by the source Observable.
* @method dematerialize
* @owner Observable
*/
function dematerialize() {
return function dematerializeOperatorFunction(source) {
return source.lift(new DeMaterializeOperator());
};
}
var DeMaterializeOperator = /*@__PURE__*/ (function () {
function DeMaterializeOperator() {
}
DeMaterializeOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new DeMaterializeSubscriber(subscriber));
};
return DeMaterializeOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var DeMaterializeSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DeMaterializeSubscriber, _super);
function DeMaterializeSubscriber(destination) {
return _super.call(this, destination) || this;
}
DeMaterializeSubscriber.prototype._next = function (value) {
value.observe(this.destination);
};
return DeMaterializeSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=dematerialize.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/distinct.js":
/*!****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/distinct.js ***!
\****************************************************************/
/*! exports provided: distinct, DistinctSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DistinctSubscriber", function() { return DistinctSubscriber; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from previous items.
*
* If a keySelector function is provided, then it will project each value from the source observable into a new value that it will
* check for equality with previously projected values. If a keySelector function is not provided, it will use each value from the
* source observable directly with an equality check against previous values.
*
* In JavaScript runtimes that support `Set`, this operator will use a `Set` to improve performance of the distinct value checking.
*
* In other runtimes, this operator will use a minimal implementation of `Set` that relies on an `Array` and `indexOf` under the
* hood, so performance will degrade as more values are checked for distinction. Even in newer browsers, a long-running `distinct`
* use might result in memory leaks. To help alleviate this in some scenarios, an optional `flushes` parameter is also provided so
* that the internal `Set` can be "flushed", basically clearing it of values.
*
* @example <caption>A simple example with numbers</caption>
* Observable.of(1, 1, 2, 2, 2, 1, 2, 3, 4, 3, 2, 1)
* .distinct()
* .subscribe(x => console.log(x)); // 1, 2, 3, 4
*
* @example <caption>An example using a keySelector function</caption>
* interface Person {
* age: number,
* name: string
* }
*
* Observable.of<Person>(
* { age: 4, name: 'Foo'},
* { age: 7, name: 'Bar'},
* { age: 5, name: 'Foo'})
* .distinct((p: Person) => p.name)
* .subscribe(x => console.log(x));
*
* // displays:
* // { age: 4, name: 'Foo' }
* // { age: 7, name: 'Bar' }
*
* @see {@link distinctUntilChanged}
* @see {@link distinctUntilKeyChanged}
*
* @param {function} [keySelector] Optional function to select which value you want to check as distinct.
* @param {Observable} [flushes] Optional Observable for flushing the internal HashSet of the operator.
* @return {Observable} An Observable that emits items from the source Observable with distinct values.
* @method distinct
* @owner Observable
*/
function distinct(keySelector, flushes) {
return function (source) { return source.lift(new DistinctOperator(keySelector, flushes)); };
}
var DistinctOperator = /*@__PURE__*/ (function () {
function DistinctOperator(keySelector, flushes) {
this.keySelector = keySelector;
this.flushes = flushes;
}
DistinctOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes));
};
return DistinctOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var DistinctSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DistinctSubscriber, _super);
function DistinctSubscriber(destination, keySelector, flushes) {
var _this = _super.call(this, destination) || this;
_this.keySelector = keySelector;
_this.values = new Set();
if (flushes) {
_this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, flushes));
}
return _this;
}
DistinctSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.values.clear();
};
DistinctSubscriber.prototype.notifyError = function (error, innerSub) {
this._error(error);
};
DistinctSubscriber.prototype._next = function (value) {
if (this.keySelector) {
this._useKeySelector(value);
}
else {
this._finalizeNext(value, value);
}
};
DistinctSubscriber.prototype._useKeySelector = function (value) {
var key;
var destination = this.destination;
try {
key = this.keySelector(value);
}
catch (err) {
destination.error(err);
return;
}
this._finalizeNext(key, value);
};
DistinctSubscriber.prototype._finalizeNext = function (key, value) {
var values = this.values;
if (!values.has(key)) {
values.add(key);
this.destination.next(value);
}
};
return DistinctSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
//# sourceMappingURL=distinct.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/distinctUntilChanged.js":
/*!****************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/distinctUntilChanged.js ***!
\****************************************************************************/
/*! exports provided: distinctUntilChanged */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return distinctUntilChanged; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/tryCatch */ "./node_modules/rxjs/_esm5/internal/util/tryCatch.js");
/* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/errorObject */ "./node_modules/rxjs/_esm5/internal/util/errorObject.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_util_tryCatch,_util_errorObject PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item.
*
* If a comparator function is provided, then it will be called for each item to test for whether or not that value should be emitted.
*
* If a comparator function is not provided, an equality check is used by default.
*
* @example <caption>A simple example with numbers</caption>
* Observable.of(1, 1, 2, 2, 2, 1, 1, 2, 3, 3, 4)
* .distinctUntilChanged()
* .subscribe(x => console.log(x)); // 1, 2, 1, 2, 3, 4
*
* @example <caption>An example using a compare function</caption>
* interface Person {
* age: number,
* name: string
* }
*
* Observable.of<Person>(
* { age: 4, name: 'Foo'},
* { age: 7, name: 'Bar'},
* { age: 5, name: 'Foo'})
* { age: 6, name: 'Foo'})
* .distinctUntilChanged((p: Person, q: Person) => p.name === q.name)
* .subscribe(x => console.log(x));
*
* // displays:
* // { age: 4, name: 'Foo' }
* // { age: 7, name: 'Bar' }
* // { age: 5, name: 'Foo' }
*
* @see {@link distinct}
* @see {@link distinctUntilKeyChanged}
*
* @param {function} [compare] Optional comparison function called to test if an item is distinct from the previous item in the source.
* @return {Observable} An Observable that emits items from the source Observable with distinct values.
* @method distinctUntilChanged
* @owner Observable
*/
function distinctUntilChanged(compare, keySelector) {
return function (source) { return source.lift(new DistinctUntilChangedOperator(compare, keySelector)); };
}
var DistinctUntilChangedOperator = /*@__PURE__*/ (function () {
function DistinctUntilChangedOperator(compare, keySelector) {
this.compare = compare;
this.keySelector = keySelector;
}
DistinctUntilChangedOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));
};
return DistinctUntilChangedOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var DistinctUntilChangedSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DistinctUntilChangedSubscriber, _super);
function DistinctUntilChangedSubscriber(destination, compare, keySelector) {
var _this = _super.call(this, destination) || this;
_this.keySelector = keySelector;
_this.hasKey = false;
if (typeof compare === 'function') {
_this.compare = compare;
}
return _this;
}
DistinctUntilChangedSubscriber.prototype.compare = function (x, y) {
return x === y;
};
DistinctUntilChangedSubscriber.prototype._next = function (value) {
var keySelector = this.keySelector;
var key = value;
if (keySelector) {
key = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(this.keySelector)(value);
if (key === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) {
return this.destination.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"].e);
}
}
var result = false;
if (this.hasKey) {
result = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(this.compare)(this.key, key);
if (result === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) {
return this.destination.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"].e);
}
}
else {
this.hasKey = true;
}
if (Boolean(result) === false) {
this.key = key;
this.destination.next(value);
}
};
return DistinctUntilChangedSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=distinctUntilChanged.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/distinctUntilKeyChanged.js":
/*!*******************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/distinctUntilKeyChanged.js ***!
\*******************************************************************************/
/*! exports provided: distinctUntilKeyChanged */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return distinctUntilKeyChanged; });
/* harmony import */ var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./distinctUntilChanged */ "./node_modules/rxjs/_esm5/internal/operators/distinctUntilChanged.js");
/** PURE_IMPORTS_START _distinctUntilChanged PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item,
* using a property accessed by using the key provided to check if the two items are distinct.
*
* If a comparator function is provided, then it will be called for each item to test for whether or not that value should be emitted.
*
* If a comparator function is not provided, an equality check is used by default.
*
* @example <caption>An example comparing the name of persons</caption>
*
* interface Person {
* age: number,
* name: string
* }
*
* Observable.of<Person>(
* { age: 4, name: 'Foo'},
* { age: 7, name: 'Bar'},
* { age: 5, name: 'Foo'},
* { age: 6, name: 'Foo'})
* .distinctUntilKeyChanged('name')
* .subscribe(x => console.log(x));
*
* // displays:
* // { age: 4, name: 'Foo' }
* // { age: 7, name: 'Bar' }
* // { age: 5, name: 'Foo' }
*
* @example <caption>An example comparing the first letters of the name</caption>
*
* interface Person {
* age: number,
* name: string
* }
*
* Observable.of<Person>(
* { age: 4, name: 'Foo1'},
* { age: 7, name: 'Bar'},
* { age: 5, name: 'Foo2'},
* { age: 6, name: 'Foo3'})
* .distinctUntilKeyChanged('name', (x: string, y: string) => x.substring(0, 3) === y.substring(0, 3))
* .subscribe(x => console.log(x));
*
* // displays:
* // { age: 4, name: 'Foo1' }
* // { age: 7, name: 'Bar' }
* // { age: 5, name: 'Foo2' }
*
* @see {@link distinct}
* @see {@link distinctUntilChanged}
*
* @param {string} key String key for object property lookup on each item.
* @param {function} [compare] Optional comparison function called to test if an item is distinct from the previous item in the source.
* @return {Observable} An Observable that emits items from the source Observable with distinct values based on the key specified.
* @method distinctUntilKeyChanged
* @owner Observable
*/
function distinctUntilKeyChanged(key, compare) {
return Object(_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__["distinctUntilChanged"])(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; });
}
//# sourceMappingURL=distinctUntilKeyChanged.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/elementAt.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/elementAt.js ***!
\*****************************************************************/
/*! exports provided: elementAt */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return elementAt; });
/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ "./node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js");
/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ "./node_modules/rxjs/_esm5/internal/operators/filter.js");
/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./throwIfEmpty */ "./node_modules/rxjs/_esm5/internal/operators/throwIfEmpty.js");
/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./defaultIfEmpty */ "./node_modules/rxjs/_esm5/internal/operators/defaultIfEmpty.js");
/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./take */ "./node_modules/rxjs/_esm5/internal/operators/take.js");
/** PURE_IMPORTS_START _util_ArgumentOutOfRangeError,_filter,_throwIfEmpty,_defaultIfEmpty,_take PURE_IMPORTS_END */
/**
* Emits the single value at the specified `index` in a sequence of emissions
* from the source Observable.
*
* <span class="informal">Emits only the i-th value, then completes.</span>
*
* <img src="./img/elementAt.png" width="100%">
*
* `elementAt` returns an Observable that emits the item at the specified
* `index` in the source Observable, or a default value if that `index` is out
* of range and the `default` argument is provided. If the `default` argument is
* not given and the `index` is out of range, the output Observable will emit an
* `ArgumentOutOfRangeError` error.
*
* @example <caption>Emit only the third click event</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.elementAt(2);
* result.subscribe(x => console.log(x));
*
* // Results in:
* // click 1 = nothing
* // click 2 = nothing
* // click 3 = MouseEvent object logged to console
*
* @see {@link first}
* @see {@link last}
* @see {@link skip}
* @see {@link single}
* @see {@link take}
*
* @throws {ArgumentOutOfRangeError} When using `elementAt(i)`, it delivers an
* ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0` or the
* Observable has completed before emitting the i-th `next` notification.
*
* @param {number} index Is the number `i` for the i-th source emission that has
* happened since the subscription, starting from the number `0`.
* @param {T} [defaultValue] The default value returned for missing indices.
* @return {Observable} An Observable that emits a single item, if it is found.
* Otherwise, will emit the default value if given. If not, then emits an error.
* @method elementAt
* @owner Observable
*/
function elementAt(index, defaultValue) {
if (index < 0) {
throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__["ArgumentOutOfRangeError"]();
}
var hasDefaultValue = arguments.length >= 2;
return function (source) {
return source.pipe(Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(function (v, i) { return i === index; }), Object(_take__WEBPACK_IMPORTED_MODULE_4__["take"])(1), hasDefaultValue
? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__["defaultIfEmpty"])(defaultValue)
: Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__["throwIfEmpty"])(function () { return new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__["ArgumentOutOfRangeError"](); }));
};
}
//# sourceMappingURL=elementAt.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/every.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/every.js ***!
\*************************************************************/
/*! exports provided: every */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return every; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Returns an Observable that emits whether or not every item of the source satisfies the condition specified.
*
* @example <caption>A simple example emitting true if all elements are less than 5, false otherwise</caption>
* Observable.of(1, 2, 3, 4, 5, 6)
* .every(x => x < 5)
* .subscribe(x => console.log(x)); // -> false
*
* @param {function} predicate A function for determining if an item meets a specified condition.
* @param {any} [thisArg] Optional object to use for `this` in the callback.
* @return {Observable} An Observable of booleans that determines if all items of the source Observable meet the condition specified.
* @method every
* @owner Observable
*/
function every(predicate, thisArg) {
return function (source) { return source.lift(new EveryOperator(predicate, thisArg, source)); };
}
var EveryOperator = /*@__PURE__*/ (function () {
function EveryOperator(predicate, thisArg, source) {
this.predicate = predicate;
this.thisArg = thisArg;
this.source = source;
}
EveryOperator.prototype.call = function (observer, source) {
return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source));
};
return EveryOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var EverySubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](EverySubscriber, _super);
function EverySubscriber(destination, predicate, thisArg, source) {
var _this = _super.call(this, destination) || this;
_this.predicate = predicate;
_this.thisArg = thisArg;
_this.source = source;
_this.index = 0;
_this.thisArg = thisArg || _this;
return _this;
}
EverySubscriber.prototype.notifyComplete = function (everyValueMatch) {
this.destination.next(everyValueMatch);
this.destination.complete();
};
EverySubscriber.prototype._next = function (value) {
var result = false;
try {
result = this.predicate.call(this.thisArg, value, this.index++, this.source);
}
catch (err) {
this.destination.error(err);
return;
}
if (!result) {
this.notifyComplete(false);
}
};
EverySubscriber.prototype._complete = function () {
this.notifyComplete(true);
};
return EverySubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=every.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/exhaust.js":
/*!***************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/exhaust.js ***!
\***************************************************************/
/*! exports provided: exhaust */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return exhaust; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Converts a higher-order Observable into a first-order Observable by dropping
* inner Observables while the previous inner Observable has not yet completed.
*
* <span class="informal">Flattens an Observable-of-Observables by dropping the
* next inner Observables while the current inner is still executing.</span>
*
* <img src="./img/exhaust.png" width="100%">
*
* `exhaust` subscribes to an Observable that emits Observables, also known as a
* higher-order Observable. Each time it observes one of these emitted inner
* Observables, the output Observable begins emitting the items emitted by that
* inner Observable. So far, it behaves like {@link mergeAll}. However,
* `exhaust` ignores every new inner Observable if the previous Observable has
* not yet completed. Once that one completes, it will accept and flatten the
* next inner Observable and repeat this process.
*
* @example <caption>Run a finite timer for each click, only if there is no currently active timer</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000).take(5));
* var result = higherOrder.exhaust();
* result.subscribe(x => console.log(x));
*
* @see {@link combineAll}
* @see {@link concatAll}
* @see {@link switch}
* @see {@link mergeAll}
* @see {@link exhaustMap}
* @see {@link zipAll}
*
* @return {Observable} An Observable that takes a source of Observables and propagates the first observable
* exclusively until it completes before subscribing to the next.
* @method exhaust
* @owner Observable
*/
function exhaust() {
return function (source) { return source.lift(new SwitchFirstOperator()); };
}
var SwitchFirstOperator = /*@__PURE__*/ (function () {
function SwitchFirstOperator() {
}
SwitchFirstOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new SwitchFirstSubscriber(subscriber));
};
return SwitchFirstOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SwitchFirstSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SwitchFirstSubscriber, _super);
function SwitchFirstSubscriber(destination) {
var _this = _super.call(this, destination) || this;
_this.hasCompleted = false;
_this.hasSubscription = false;
return _this;
}
SwitchFirstSubscriber.prototype._next = function (value) {
if (!this.hasSubscription) {
this.hasSubscription = true;
this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, value));
}
};
SwitchFirstSubscriber.prototype._complete = function () {
this.hasCompleted = true;
if (!this.hasSubscription) {
this.destination.complete();
}
};
SwitchFirstSubscriber.prototype.notifyComplete = function (innerSub) {
this.remove(innerSub);
this.hasSubscription = false;
if (this.hasCompleted) {
this.destination.complete();
}
};
return SwitchFirstSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
//# sourceMappingURL=exhaust.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/exhaustMap.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/exhaustMap.js ***!
\******************************************************************/
/*! exports provided: exhaustMap */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return exhaustMap; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./map */ "./node_modules/rxjs/_esm5/internal/operators/map.js");
/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../observable/from */ "./node_modules/rxjs/_esm5/internal/observable/from.js");
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Projects each source value to an Observable which is merged in the output
* Observable only if the previous projected Observable has completed.
*
* <span class="informal">Maps each value to an Observable, then flattens all of
* these inner Observables using {@link exhaust}.</span>
*
* <img src="./img/exhaustMap.png" width="100%">
*
* Returns an Observable that emits items based on applying a function that you
* supply to each item emitted by the source Observable, where that function
* returns an (so-called "inner") Observable. When it projects a source value to
* an Observable, the output Observable begins emitting the items emitted by
* that projected Observable. However, `exhaustMap` ignores every new projected
* Observable if the previous projected Observable has not yet completed. Once
* that one completes, it will accept and flatten the next projected Observable
* and repeat this process.
*
* @example <caption>Run a finite timer for each click, only if there is no currently active timer</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.exhaustMap((ev) => Rx.Observable.interval(1000).take(5));
* result.subscribe(x => console.log(x));
*
* @see {@link concatMap}
* @see {@link exhaust}
* @see {@link mergeMap}
* @see {@link switchMap}
*
* @param {function(value: T, ?index: number): ObservableInput} project A function
* that, when applied to an item emitted by the source Observable, returns an
* Observable.
* @return {Observable} An Observable containing projected Observables
* of each item of the source, ignoring projected Observables that start before
* their preceding Observable has completed.
* @method exhaustMap
* @owner Observable
*/
function exhaustMap(project, resultSelector) {
if (resultSelector) {
// DEPRECATED PATH
return function (source) { return source.pipe(exhaustMap(function (a, i) { return Object(_observable_from__WEBPACK_IMPORTED_MODULE_4__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };
}
return function (source) {
return source.lift(new ExhauseMapOperator(project));
};
}
var ExhauseMapOperator = /*@__PURE__*/ (function () {
function ExhauseMapOperator(project) {
this.project = project;
}
ExhauseMapOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));
};
return ExhauseMapOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var ExhaustMapSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ExhaustMapSubscriber, _super);
function ExhaustMapSubscriber(destination, project) {
var _this = _super.call(this, destination) || this;
_this.project = project;
_this.hasSubscription = false;
_this.hasCompleted = false;
_this.index = 0;
return _this;
}
ExhaustMapSubscriber.prototype._next = function (value) {
if (!this.hasSubscription) {
this.tryNext(value);
}
};
ExhaustMapSubscriber.prototype.tryNext = function (value) {
var index = this.index++;
var destination = this.destination;
try {
var result = this.project(value, index);
this.hasSubscription = true;
this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, result, value, index));
}
catch (err) {
destination.error(err);
}
};
ExhaustMapSubscriber.prototype._complete = function () {
this.hasCompleted = true;
if (!this.hasSubscription) {
this.destination.complete();
}
};
ExhaustMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.destination.next(innerValue);
};
ExhaustMapSubscriber.prototype.notifyError = function (err) {
this.destination.error(err);
};
ExhaustMapSubscriber.prototype.notifyComplete = function (innerSub) {
this.remove(innerSub);
this.hasSubscription = false;
if (this.hasCompleted) {
this.destination.complete();
}
};
return ExhaustMapSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
//# sourceMappingURL=exhaustMap.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/expand.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/expand.js ***!
\**************************************************************/
/*! exports provided: expand, ExpandOperator, ExpandSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return expand; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpandOperator", function() { return ExpandOperator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpandSubscriber", function() { return ExpandSubscriber; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/tryCatch */ "./node_modules/rxjs/_esm5/internal/util/tryCatch.js");
/* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/errorObject */ "./node_modules/rxjs/_esm5/internal/util/errorObject.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Recursively projects each source value to an Observable which is merged in
* the output Observable.
*
* <span class="informal">It's similar to {@link mergeMap}, but applies the
* projection function to every source value as well as every output value.
* It's recursive.</span>
*
* <img src="./img/expand.png" width="100%">
*
* Returns an Observable that emits items based on applying a function that you
* supply to each item emitted by the source Observable, where that function
* returns an Observable, and then merging those resulting Observables and
* emitting the results of this merger. *Expand* will re-emit on the output
* Observable every source value. Then, each output value is given to the
* `project` function which returns an inner Observable to be merged on the
* output Observable. Those output values resulting from the projection are also
* given to the `project` function to produce new output values. This is how
* *expand* behaves recursively.
*
* @example <caption>Start emitting the powers of two on every click, at most 10 of them</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var powersOfTwo = clicks
* .mapTo(1)
* .expand(x => Rx.Observable.of(2 * x).delay(1000))
* .take(10);
* powersOfTwo.subscribe(x => console.log(x));
*
* @see {@link mergeMap}
* @see {@link mergeScan}
*
* @param {function(value: T, index: number) => Observable} project A function
* that, when applied to an item emitted by the source or the output Observable,
* returns an Observable.
* @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input
* Observables being subscribed to concurrently.
* @param {Scheduler} [scheduler=null] The IScheduler to use for subscribing to
* each projected inner Observable.
* @return {Observable} An Observable that emits the source values and also
* result of applying the projection function to each value emitted on the
* output Observable and and merging the results of the Observables obtained
* from this transformation.
* @method expand
* @owner Observable
*/
function expand(project, concurrent, scheduler) {
if (concurrent === void 0) {
concurrent = Number.POSITIVE_INFINITY;
}
if (scheduler === void 0) {
scheduler = undefined;
}
concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent;
return function (source) { return source.lift(new ExpandOperator(project, concurrent, scheduler)); };
}
var ExpandOperator = /*@__PURE__*/ (function () {
function ExpandOperator(project, concurrent, scheduler) {
this.project = project;
this.concurrent = concurrent;
this.scheduler = scheduler;
}
ExpandOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler));
};
return ExpandOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var ExpandSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ExpandSubscriber, _super);
function ExpandSubscriber(destination, project, concurrent, scheduler) {
var _this = _super.call(this, destination) || this;
_this.project = project;
_this.concurrent = concurrent;
_this.scheduler = scheduler;
_this.index = 0;
_this.active = 0;
_this.hasCompleted = false;
if (concurrent < Number.POSITIVE_INFINITY) {
_this.buffer = [];
}
return _this;
}
ExpandSubscriber.dispatch = function (arg) {
var subscriber = arg.subscriber, result = arg.result, value = arg.value, index = arg.index;
subscriber.subscribeToProjection(result, value, index);
};
ExpandSubscriber.prototype._next = function (value) {
var destination = this.destination;
if (destination.closed) {
this._complete();
return;
}
var index = this.index++;
if (this.active < this.concurrent) {
destination.next(value);
var result = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_1__["tryCatch"])(this.project)(value, index);
if (result === _util_errorObject__WEBPACK_IMPORTED_MODULE_2__["errorObject"]) {
destination.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_2__["errorObject"].e);
}
else if (!this.scheduler) {
this.subscribeToProjection(result, value, index);
}
else {
var state = { subscriber: this, result: result, value: value, index: index };
this.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state));
}
}
else {
this.buffer.push(value);
}
};
ExpandSubscriber.prototype.subscribeToProjection = function (result, value, index) {
this.active++;
this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, result, value, index));
};
ExpandSubscriber.prototype._complete = function () {
this.hasCompleted = true;
if (this.hasCompleted && this.active === 0) {
this.destination.complete();
}
};
ExpandSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this._next(innerValue);
};
ExpandSubscriber.prototype.notifyComplete = function (innerSub) {
var buffer = this.buffer;
this.remove(innerSub);
this.active--;
if (buffer && buffer.length > 0) {
this._next(buffer.shift());
}
if (this.hasCompleted && this.active === 0) {
this.destination.complete();
}
};
return ExpandSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
//# sourceMappingURL=expand.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/filter.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/filter.js ***!
\**************************************************************/
/*! exports provided: filter */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return filter; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Filter items emitted by the source Observable by only emitting those that
* satisfy a specified predicate.
*
* <span class="informal">Like
* [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),
* it only emits a value from the source if it passes a criterion function.</span>
*
* <img src="./img/filter.png" width="100%">
*
* Similar to the well-known `Array.prototype.filter` method, this operator
* takes values from the source Observable, passes them through a `predicate`
* function and only emits those values that yielded `true`.
*
* @example <caption>Emit only click events whose target was a DIV element</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var clicksOnDivs = clicks.filter(ev => ev.target.tagName === 'DIV');
* clicksOnDivs.subscribe(x => console.log(x));
*
* @see {@link distinct}
* @see {@link distinctUntilChanged}
* @see {@link distinctUntilKeyChanged}
* @see {@link ignoreElements}
* @see {@link partition}
* @see {@link skip}
*
* @param {function(value: T, index: number): boolean} predicate A function that
* evaluates each value emitted by the source Observable. If it returns `true`,
* the value is emitted, if `false` the value is not passed to the output
* Observable. The `index` parameter is the number `i` for the i-th source
* emission that has happened since the subscription, starting from the number
* `0`.
* @param {any} [thisArg] An optional argument to determine the value of `this`
* in the `predicate` function.
* @return {Observable} An Observable of values from the source that were
* allowed by the `predicate` function.
* @method filter
* @owner Observable
*/
function filter(predicate, thisArg) {
return function filterOperatorFunction(source) {
return source.lift(new FilterOperator(predicate, thisArg));
};
}
var FilterOperator = /*@__PURE__*/ (function () {
function FilterOperator(predicate, thisArg) {
this.predicate = predicate;
this.thisArg = thisArg;
}
FilterOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));
};
return FilterOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var FilterSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FilterSubscriber, _super);
function FilterSubscriber(destination, predicate, thisArg) {
var _this = _super.call(this, destination) || this;
_this.predicate = predicate;
_this.thisArg = thisArg;
_this.count = 0;
return _this;
}
// the try catch block below is left specifically for
// optimization and perf reasons. a tryCatcher is not necessary here.
FilterSubscriber.prototype._next = function (value) {
var result;
try {
result = this.predicate.call(this.thisArg, value, this.count++);
}
catch (err) {
this.destination.error(err);
return;
}
if (result) {
this.destination.next(value);
}
};
return FilterSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=filter.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/finalize.js":
/*!****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/finalize.js ***!
\****************************************************************/
/*! exports provided: finalize */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return finalize; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_Subscription PURE_IMPORTS_END */
/**
* Returns an Observable that mirrors the source Observable, but will call a specified function when
* the source terminates on complete or error.
* @param {function} callback Function to be called when source terminates.
* @return {Observable} An Observable that mirrors the source, but will call the specified function on termination.
* @method finally
* @owner Observable
*/
function finalize(callback) {
return function (source) { return source.lift(new FinallyOperator(callback)); };
}
var FinallyOperator = /*@__PURE__*/ (function () {
function FinallyOperator(callback) {
this.callback = callback;
}
FinallyOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new FinallySubscriber(subscriber, this.callback));
};
return FinallyOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var FinallySubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FinallySubscriber, _super);
function FinallySubscriber(destination, callback) {
var _this = _super.call(this, destination) || this;
_this.add(new _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"](callback));
return _this;
}
return FinallySubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=finalize.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/find.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/find.js ***!
\************************************************************/
/*! exports provided: find, FindValueOperator, FindValueSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return find; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindValueOperator", function() { return FindValueOperator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindValueSubscriber", function() { return FindValueSubscriber; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Emits only the first value emitted by the source Observable that meets some
* condition.
*
* <span class="informal">Finds the first value that passes some test and emits
* that.</span>
*
* <img src="./img/find.png" width="100%">
*
* `find` searches for the first item in the source Observable that matches the
* specified condition embodied by the `predicate`, and returns the first
* occurrence in the source. Unlike {@link first}, the `predicate` is required
* in `find`, and does not emit an error if a valid value is not found.
*
* @example <caption>Find and emit the first click that happens on a DIV element</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.find(ev => ev.target.tagName === 'DIV');
* result.subscribe(x => console.log(x));
*
* @see {@link filter}
* @see {@link first}
* @see {@link findIndex}
* @see {@link take}
*
* @param {function(value: T, index: number, source: Observable<T>): boolean} predicate
* A function called with each item to test for condition matching.
* @param {any} [thisArg] An optional argument to determine the value of `this`
* in the `predicate` function.
* @return {Observable<T>} An Observable of the first item that matches the
* condition.
* @method find
* @owner Observable
*/
function find(predicate, thisArg) {
if (typeof predicate !== 'function') {
throw new TypeError('predicate is not a function');
}
return function (source) { return source.lift(new FindValueOperator(predicate, source, false, thisArg)); };
}
var FindValueOperator = /*@__PURE__*/ (function () {
function FindValueOperator(predicate, source, yieldIndex, thisArg) {
this.predicate = predicate;
this.source = source;
this.yieldIndex = yieldIndex;
this.thisArg = thisArg;
}
FindValueOperator.prototype.call = function (observer, source) {
return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg));
};
return FindValueOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var FindValueSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FindValueSubscriber, _super);
function FindValueSubscriber(destination, predicate, source, yieldIndex, thisArg) {
var _this = _super.call(this, destination) || this;
_this.predicate = predicate;
_this.source = source;
_this.yieldIndex = yieldIndex;
_this.thisArg = thisArg;
_this.index = 0;
return _this;
}
FindValueSubscriber.prototype.notifyComplete = function (value) {
var destination = this.destination;
destination.next(value);
destination.complete();
};
FindValueSubscriber.prototype._next = function (value) {
var _a = this, predicate = _a.predicate, thisArg = _a.thisArg;
var index = this.index++;
try {
var result = predicate.call(thisArg || this, value, index, this.source);
if (result) {
this.notifyComplete(this.yieldIndex ? index : value);
}
}
catch (err) {
this.destination.error(err);
}
};
FindValueSubscriber.prototype._complete = function () {
this.notifyComplete(this.yieldIndex ? -1 : undefined);
};
return FindValueSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=find.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/findIndex.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/findIndex.js ***!
\*****************************************************************/
/*! exports provided: findIndex */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return findIndex; });
/* harmony import */ var _operators_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../operators/find */ "./node_modules/rxjs/_esm5/internal/operators/find.js");
/** PURE_IMPORTS_START _operators_find PURE_IMPORTS_END */
/**
* Emits only the index of the first value emitted by the source Observable that
* meets some condition.
*
* <span class="informal">It's like {@link find}, but emits the index of the
* found value, not the value itself.</span>
*
* <img src="./img/findIndex.png" width="100%">
*
* `findIndex` searches for the first item in the source Observable that matches
* the specified condition embodied by the `predicate`, and returns the
* (zero-based) index of the first occurrence in the source. Unlike
* {@link first}, the `predicate` is required in `findIndex`, and does not emit
* an error if a valid value is not found.
*
* @example <caption>Emit the index of first click that happens on a DIV element</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.findIndex(ev => ev.target.tagName === 'DIV');
* result.subscribe(x => console.log(x));
*
* @see {@link filter}
* @see {@link find}
* @see {@link first}
* @see {@link take}
*
* @param {function(value: T, index: number, source: Observable<T>): boolean} predicate
* A function called with each item to test for condition matching.
* @param {any} [thisArg] An optional argument to determine the value of `this`
* in the `predicate` function.
* @return {Observable} An Observable of the index of the first item that
* matches the condition.
* @method find
* @owner Observable
*/
function findIndex(predicate, thisArg) {
return function (source) { return source.lift(new _operators_find__WEBPACK_IMPORTED_MODULE_0__["FindValueOperator"](predicate, source, true, thisArg)); };
}
//# sourceMappingURL=findIndex.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/first.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/first.js ***!
\*************************************************************/
/*! exports provided: first */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; });
/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/EmptyError */ "./node_modules/rxjs/_esm5/internal/util/EmptyError.js");
/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ "./node_modules/rxjs/_esm5/internal/operators/filter.js");
/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./take */ "./node_modules/rxjs/_esm5/internal/operators/take.js");
/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./defaultIfEmpty */ "./node_modules/rxjs/_esm5/internal/operators/defaultIfEmpty.js");
/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./throwIfEmpty */ "./node_modules/rxjs/_esm5/internal/operators/throwIfEmpty.js");
/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/identity */ "./node_modules/rxjs/_esm5/internal/util/identity.js");
/** PURE_IMPORTS_START _util_EmptyError,_filter,_take,_defaultIfEmpty,_throwIfEmpty,_util_identity PURE_IMPORTS_END */
/**
* Emits only the first value (or the first value that meets some condition)
* emitted by the source Observable.
*
* <span class="informal">Emits only the first value. Or emits only the first
* value that passes some test.</span>
*
* <img src="./img/first.png" width="100%">
*
* If called with no arguments, `first` emits the first value of the source
* Observable, then completes. If called with a `predicate` function, `first`
* emits the first value of the source that matches the specified condition. It
* may also take a `resultSelector` function to produce the output value from
* the input value, and a `defaultValue` to emit in case the source completes
* before it is able to emit a valid value. Throws an error if `defaultValue`
* was not provided and a matching element is not found.
*
* @example <caption>Emit only the first click that happens on the DOM</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.first();
* result.subscribe(x => console.log(x));
*
* @example <caption>Emits the first click that happens on a DIV</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.first(ev => ev.target.tagName === 'DIV');
* result.subscribe(x => console.log(x));
*
* @see {@link filter}
* @see {@link find}
* @see {@link take}
*
* @throws {EmptyError} Delivers an EmptyError to the Observer's `error`
* callback if the Observable completes before any `next` notification was sent.
*
* @param {function(value: T, index: number, source: Observable<T>): boolean} [predicate]
* An optional function called with each item to test for condition matching.
* @param {R} [defaultValue] The default value emitted in case no valid value
* was found on the source.
* @return {Observable<T|R>} An Observable of the first item that matches the
* condition.
* @method first
* @owner Observable
*/
function first(predicate, defaultValue) {
var hasDefaultValue = arguments.length >= 2;
return function (source) { return source.pipe(predicate ? Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(function (v, i) { return predicate(v, i, source); }) : _util_identity__WEBPACK_IMPORTED_MODULE_5__["identity"], Object(_take__WEBPACK_IMPORTED_MODULE_2__["take"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__["throwIfEmpty"])(function () { return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"](); })); };
}
//# sourceMappingURL=first.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/groupBy.js":
/*!***************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/groupBy.js ***!
\***************************************************************/
/*! exports provided: groupBy, GroupedObservable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return GroupedObservable; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_Subscription,_Observable,_Subject PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Groups the items emitted by an Observable according to a specified criterion,
* and emits these grouped items as `GroupedObservables`, one
* {@link GroupedObservable} per group.
*
* <img src="./img/groupBy.png" width="100%">
*
* @example <caption>Group objects by id and return as array</caption>
* Observable.of<Obj>({id: 1, name: 'aze1'},
* {id: 2, name: 'sf2'},
* {id: 2, name: 'dg2'},
* {id: 1, name: 'erg1'},
* {id: 1, name: 'df1'},
* {id: 2, name: 'sfqfb2'},
* {id: 3, name: 'qfs3'},
* {id: 2, name: 'qsgqsfg2'}
* )
* .groupBy(p => p.id)
* .flatMap( (group$) => group$.reduce((acc, cur) => [...acc, cur], []))
* .subscribe(p => console.log(p));
*
* // displays:
* // [ { id: 1, name: 'aze1' },
* // { id: 1, name: 'erg1' },
* // { id: 1, name: 'df1' } ]
* //
* // [ { id: 2, name: 'sf2' },
* // { id: 2, name: 'dg2' },
* // { id: 2, name: 'sfqfb2' },
* // { id: 2, name: 'qsgqsfg2' } ]
* //
* // [ { id: 3, name: 'qfs3' } ]
*
* @example <caption>Pivot data on the id field</caption>
* Observable.of<Obj>({id: 1, name: 'aze1'},
* {id: 2, name: 'sf2'},
* {id: 2, name: 'dg2'},
* {id: 1, name: 'erg1'},
* {id: 1, name: 'df1'},
* {id: 2, name: 'sfqfb2'},
* {id: 3, name: 'qfs1'},
* {id: 2, name: 'qsgqsfg2'}
* )
* .groupBy(p => p.id, p => p.name)
* .flatMap( (group$) => group$.reduce((acc, cur) => [...acc, cur], ["" + group$.key]))
* .map(arr => ({'id': parseInt(arr[0]), 'values': arr.slice(1)}))
* .subscribe(p => console.log(p));
*
* // displays:
* // { id: 1, values: [ 'aze1', 'erg1', 'df1' ] }
* // { id: 2, values: [ 'sf2', 'dg2', 'sfqfb2', 'qsgqsfg2' ] }
* // { id: 3, values: [ 'qfs1' ] }
*
* @param {function(value: T): K} keySelector A function that extracts the key
* for each item.
* @param {function(value: T): R} [elementSelector] A function that extracts the
* return element for each item.
* @param {function(grouped: GroupedObservable<K,R>): Observable<any>} [durationSelector]
* A function that returns an Observable to determine how long each group should
* exist.
* @return {Observable<GroupedObservable<K,R>>} An Observable that emits
* GroupedObservables, each of which corresponds to a unique key value and each
* of which emits those items from the source Observable that share that key
* value.
* @method groupBy
* @owner Observable
*/
function groupBy(keySelector, elementSelector, durationSelector, subjectSelector) {
return function (source) {
return source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector));
};
}
var GroupByOperator = /*@__PURE__*/ (function () {
function GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector) {
this.keySelector = keySelector;
this.elementSelector = elementSelector;
this.durationSelector = durationSelector;
this.subjectSelector = subjectSelector;
}
GroupByOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector));
};
return GroupByOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var GroupBySubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GroupBySubscriber, _super);
function GroupBySubscriber(destination, keySelector, elementSelector, durationSelector, subjectSelector) {
var _this = _super.call(this, destination) || this;
_this.keySelector = keySelector;
_this.elementSelector = elementSelector;
_this.durationSelector = durationSelector;
_this.subjectSelector = subjectSelector;
_this.groups = null;
_this.attemptedToUnsubscribe = false;
_this.count = 0;
return _this;
}
GroupBySubscriber.prototype._next = function (value) {
var key;
try {
key = this.keySelector(value);
}
catch (err) {
this.error(err);
return;
}
this._group(value, key);
};
GroupBySubscriber.prototype._group = function (value, key) {
var groups = this.groups;
if (!groups) {
groups = this.groups = new Map();
}
var group = groups.get(key);
var element;
if (this.elementSelector) {
try {
element = this.elementSelector(value);
}
catch (err) {
this.error(err);
}
}
else {
element = value;
}
if (!group) {
group = (this.subjectSelector ? this.subjectSelector() : new _Subject__WEBPACK_IMPORTED_MODULE_4__["Subject"]());
groups.set(key, group);
var groupedObservable = new GroupedObservable(key, group, this);
this.destination.next(groupedObservable);
if (this.durationSelector) {
var duration = void 0;
try {
duration = this.durationSelector(new GroupedObservable(key, group));
}
catch (err) {
this.error(err);
return;
}
this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this)));
}
}
if (!group.closed) {
group.next(element);
}
};
GroupBySubscriber.prototype._error = function (err) {
var groups = this.groups;
if (groups) {
groups.forEach(function (group, key) {
group.error(err);
});
groups.clear();
}
this.destination.error(err);
};
GroupBySubscriber.prototype._complete = function () {
var groups = this.groups;
if (groups) {
groups.forEach(function (group, key) {
group.complete();
});
groups.clear();
}
this.destination.complete();
};
GroupBySubscriber.prototype.removeGroup = function (key) {
this.groups.delete(key);
};
GroupBySubscriber.prototype.unsubscribe = function () {
if (!this.closed) {
this.attemptedToUnsubscribe = true;
if (this.count === 0) {
_super.prototype.unsubscribe.call(this);
}
}
};
return GroupBySubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var GroupDurationSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GroupDurationSubscriber, _super);
function GroupDurationSubscriber(key, group, parent) {
var _this = _super.call(this, group) || this;
_this.key = key;
_this.group = group;
_this.parent = parent;
return _this;
}
GroupDurationSubscriber.prototype._next = function (value) {
this.complete();
};
/** @deprecated This is an internal implementation detail, do not use. */
GroupDurationSubscriber.prototype._unsubscribe = function () {
var _a = this, parent = _a.parent, key = _a.key;
this.key = this.parent = null;
if (parent) {
parent.removeGroup(key);
}
};
return GroupDurationSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
/**
* An Observable representing values belonging to the same group represented by
* a common key. The values emitted by a GroupedObservable come from the source
* Observable. The common key is available as the field `key` on a
* GroupedObservable instance.
*
* @class GroupedObservable<K, T>
*/
var GroupedObservable = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GroupedObservable, _super);
/** @deprecated Do not construct this type. Internal use only */
function GroupedObservable(key, groupSubject, refCountSubscription) {
var _this = _super.call(this) || this;
_this.key = key;
_this.groupSubject = groupSubject;
_this.refCountSubscription = refCountSubscription;
return _this;
}
/** @deprecated This is an internal implementation detail, do not use. */
GroupedObservable.prototype._subscribe = function (subscriber) {
var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"]();
var _a = this, refCountSubscription = _a.refCountSubscription, groupSubject = _a.groupSubject;
if (refCountSubscription && !refCountSubscription.closed) {
subscription.add(new InnerRefCountSubscription(refCountSubscription));
}
subscription.add(groupSubject.subscribe(subscriber));
return subscription;
};
return GroupedObservable;
}(_Observable__WEBPACK_IMPORTED_MODULE_3__["Observable"]));
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var InnerRefCountSubscription = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](InnerRefCountSubscription, _super);
function InnerRefCountSubscription(parent) {
var _this = _super.call(this) || this;
_this.parent = parent;
parent.count++;
return _this;
}
InnerRefCountSubscription.prototype.unsubscribe = function () {
var parent = this.parent;
if (!parent.closed && !this.closed) {
_super.prototype.unsubscribe.call(this);
parent.count -= 1;
if (parent.count === 0 && parent.attemptedToUnsubscribe) {
parent.unsubscribe();
}
}
};
return InnerRefCountSubscription;
}(_Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"]));
//# sourceMappingURL=groupBy.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/ignoreElements.js":
/*!**********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/ignoreElements.js ***!
\**********************************************************************/
/*! exports provided: ignoreElements */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return ignoreElements; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Ignores all items emitted by the source Observable and only passes calls of `complete` or `error`.
*
* <img src="./img/ignoreElements.png" width="100%">
*
* @return {Observable} An empty Observable that only calls `complete`
* or `error`, based on which one is called by the source Observable.
* @method ignoreElements
* @owner Observable
*/
function ignoreElements() {
return function ignoreElementsOperatorFunction(source) {
return source.lift(new IgnoreElementsOperator());
};
}
var IgnoreElementsOperator = /*@__PURE__*/ (function () {
function IgnoreElementsOperator() {
}
IgnoreElementsOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new IgnoreElementsSubscriber(subscriber));
};
return IgnoreElementsOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var IgnoreElementsSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](IgnoreElementsSubscriber, _super);
function IgnoreElementsSubscriber() {
return _super !== null && _super.apply(this, arguments) || this;
}
IgnoreElementsSubscriber.prototype._next = function (unused) {
// Do nothing
};
return IgnoreElementsSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=ignoreElements.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/isEmpty.js":
/*!***************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/isEmpty.js ***!
\***************************************************************/
/*! exports provided: isEmpty */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return isEmpty; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
function isEmpty() {
return function (source) { return source.lift(new IsEmptyOperator()); };
}
var IsEmptyOperator = /*@__PURE__*/ (function () {
function IsEmptyOperator() {
}
IsEmptyOperator.prototype.call = function (observer, source) {
return source.subscribe(new IsEmptySubscriber(observer));
};
return IsEmptyOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var IsEmptySubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](IsEmptySubscriber, _super);
function IsEmptySubscriber(destination) {
return _super.call(this, destination) || this;
}
IsEmptySubscriber.prototype.notifyComplete = function (isEmpty) {
var destination = this.destination;
destination.next(isEmpty);
destination.complete();
};
IsEmptySubscriber.prototype._next = function (value) {
this.notifyComplete(false);
};
IsEmptySubscriber.prototype._complete = function () {
this.notifyComplete(true);
};
return IsEmptySubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=isEmpty.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/last.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/last.js ***!
\************************************************************/
/*! exports provided: last */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return last; });
/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/EmptyError */ "./node_modules/rxjs/_esm5/internal/util/EmptyError.js");
/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ "./node_modules/rxjs/_esm5/internal/operators/filter.js");
/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./takeLast */ "./node_modules/rxjs/_esm5/internal/operators/takeLast.js");
/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./throwIfEmpty */ "./node_modules/rxjs/_esm5/internal/operators/throwIfEmpty.js");
/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaultIfEmpty */ "./node_modules/rxjs/_esm5/internal/operators/defaultIfEmpty.js");
/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/identity */ "./node_modules/rxjs/_esm5/internal/util/identity.js");
/** PURE_IMPORTS_START _util_EmptyError,_filter,_takeLast,_throwIfEmpty,_defaultIfEmpty,_util_identity PURE_IMPORTS_END */
/**
* Returns an Observable that emits only the last item emitted by the source Observable.
* It optionally takes a predicate function as a parameter, in which case, rather than emitting
* the last item from the source Observable, the resulting Observable will emit the last item
* from the source Observable that satisfies the predicate.
*
* <img src="./img/last.png" width="100%">
*
* @throws {EmptyError} Delivers an EmptyError to the Observer's `error`
* callback if the Observable completes before any `next` notification was sent.
* @param {function} [predicate] - The condition any source emitted item has to satisfy.
* @param {any} [defaultValue] - An optional default value to provide if last
* predicate isn't met or no values were emitted.
* @return {Observable} An Observable that emits only the last item satisfying the given condition
* from the source, or an NoSuchElementException if no such items are emitted.
* @throws - Throws if no items that match the predicate are emitted by the source Observable.
*/
function last(predicate, defaultValue) {
var hasDefaultValue = arguments.length >= 2;
return function (source) { return source.pipe(predicate ? Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(function (v, i) { return predicate(v, i, source); }) : _util_identity__WEBPACK_IMPORTED_MODULE_5__["identity"], Object(_takeLast__WEBPACK_IMPORTED_MODULE_2__["takeLast"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__["throwIfEmpty"])(function () { return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"](); })); };
}
//# sourceMappingURL=last.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/map.js":
/*!***********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/map.js ***!
\***********************************************************/
/*! exports provided: map, MapOperator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return map; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MapOperator", function() { return MapOperator; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Applies a given `project` function to each value emitted by the source
* Observable, and emits the resulting values as an Observable.
*
* <span class="informal">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),
* it passes each source value through a transformation function to get
* corresponding output values.</span>
*
* <img src="./img/map.png" width="100%">
*
* Similar to the well known `Array.prototype.map` function, this operator
* applies a projection to each value and emits that projection in the output
* Observable.
*
* @example <caption>Map every click to the clientX position of that click</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var positions = clicks.map(ev => ev.clientX);
* positions.subscribe(x => console.log(x));
*
* @see {@link mapTo}
* @see {@link pluck}
*
* @param {function(value: T, index: number): R} project The function to apply
* to each `value` emitted by the source Observable. The `index` parameter is
* the number `i` for the i-th emission that has happened since the
* subscription, starting from the number `0`.
* @param {any} [thisArg] An optional argument to define what `this` is in the
* `project` function.
* @return {Observable<R>} An Observable that emits the values from the source
* Observable transformed by the given `project` function.
* @method map
* @owner Observable
*/
function map(project, thisArg) {
return function mapOperation(source) {
if (typeof project !== 'function') {
throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');
}
return source.lift(new MapOperator(project, thisArg));
};
}
var MapOperator = /*@__PURE__*/ (function () {
function MapOperator(project, thisArg) {
this.project = project;
this.thisArg = thisArg;
}
MapOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));
};
return MapOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var MapSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MapSubscriber, _super);
function MapSubscriber(destination, project, thisArg) {
var _this = _super.call(this, destination) || this;
_this.project = project;
_this.count = 0;
_this.thisArg = thisArg || _this;
return _this;
}
// NOTE: This looks unoptimized, but it's actually purposefully NOT
// using try/catch optimizations.
MapSubscriber.prototype._next = function (value) {
var result;
try {
result = this.project.call(this.thisArg, value, this.count++);
}
catch (err) {
this.destination.error(err);
return;
}
this.destination.next(result);
};
return MapSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=map.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/mapTo.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/mapTo.js ***!
\*************************************************************/
/*! exports provided: mapTo */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return mapTo; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Emits the given constant value on the output Observable every time the source
* Observable emits a value.
*
* <span class="informal">Like {@link map}, but it maps every source value to
* the same output value every time.</span>
*
* <img src="./img/mapTo.png" width="100%">
*
* Takes a constant `value` as argument, and emits that whenever the source
* Observable emits a value. In other words, ignores the actual source value,
* and simply uses the emission moment to know when to emit the given `value`.
*
* @example <caption>Map every click to the string 'Hi'</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var greetings = clicks.mapTo('Hi');
* greetings.subscribe(x => console.log(x));
*
* @see {@link map}
*
* @param {any} value The value to map each source value to.
* @return {Observable} An Observable that emits the given `value` every time
* the source Observable emits something.
* @method mapTo
* @owner Observable
*/
function mapTo(value) {
return function (source) { return source.lift(new MapToOperator(value)); };
}
var MapToOperator = /*@__PURE__*/ (function () {
function MapToOperator(value) {
this.value = value;
}
MapToOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new MapToSubscriber(subscriber, this.value));
};
return MapToOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var MapToSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MapToSubscriber, _super);
function MapToSubscriber(destination, value) {
var _this = _super.call(this, destination) || this;
_this.value = value;
return _this;
}
MapToSubscriber.prototype._next = function (x) {
this.destination.next(this.value);
};
return MapToSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=mapTo.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/materialize.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/materialize.js ***!
\*******************************************************************/
/*! exports provided: materialize */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return materialize; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Notification */ "./node_modules/rxjs/_esm5/internal/Notification.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */
/**
* Represents all of the notifications from the source Observable as `next`
* emissions marked with their original types within {@link Notification}
* objects.
*
* <span class="informal">Wraps `next`, `error` and `complete` emissions in
* {@link Notification} objects, emitted as `next` on the output Observable.
* </span>
*
* <img src="./img/materialize.png" width="100%">
*
* `materialize` returns an Observable that emits a `next` notification for each
* `next`, `error`, or `complete` emission of the source Observable. When the
* source Observable emits `complete`, the output Observable will emit `next` as
* a Notification of type "complete", and then it will emit `complete` as well.
* When the source Observable emits `error`, the output will emit `next` as a
* Notification of type "error", and then `complete`.
*
* This operator is useful for producing metadata of the source Observable, to
* be consumed as `next` emissions. Use it in conjunction with
* {@link dematerialize}.
*
* @example <caption>Convert a faulty Observable to an Observable of Notifications</caption>
* var letters = Rx.Observable.of('a', 'b', 13, 'd');
* var upperCase = letters.map(x => x.toUpperCase());
* var materialized = upperCase.materialize();
* materialized.subscribe(x => console.log(x));
*
* // Results in the following:
* // - Notification {kind: "N", value: "A", error: undefined, hasValue: true}
* // - Notification {kind: "N", value: "B", error: undefined, hasValue: true}
* // - Notification {kind: "E", value: undefined, error: TypeError:
* // x.toUpperCase is not a function at MapSubscriber.letters.map.x
* // [as project] (http://1…, hasValue: false}
*
* @see {@link Notification}
* @see {@link dematerialize}
*
* @return {Observable<Notification<T>>} An Observable that emits
* {@link Notification} objects that wrap the original emissions from the source
* Observable with metadata.
* @method materialize
* @owner Observable
*/
function materialize() {
return function materializeOperatorFunction(source) {
return source.lift(new MaterializeOperator());
};
}
var MaterializeOperator = /*@__PURE__*/ (function () {
function MaterializeOperator() {
}
MaterializeOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new MaterializeSubscriber(subscriber));
};
return MaterializeOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var MaterializeSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MaterializeSubscriber, _super);
function MaterializeSubscriber(destination) {
return _super.call(this, destination) || this;
}
MaterializeSubscriber.prototype._next = function (value) {
this.destination.next(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createNext(value));
};
MaterializeSubscriber.prototype._error = function (err) {
var destination = this.destination;
destination.next(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createError(err));
destination.complete();
};
MaterializeSubscriber.prototype._complete = function () {
var destination = this.destination;
destination.next(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createComplete());
destination.complete();
};
return MaterializeSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=materialize.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/max.js":
/*!***********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/max.js ***!
\***********************************************************/
/*! exports provided: max */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reduce */ "./node_modules/rxjs/_esm5/internal/operators/reduce.js");
/** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
/**
* The Max operator operates on an Observable that emits numbers (or items that can be compared with a provided function),
* and when source Observable completes it emits a single item: the item with the largest value.
*
* <img src="./img/max.png" width="100%">
*
* @example <caption>Get the maximal value of a series of numbers</caption>
* Rx.Observable.of(5, 4, 7, 2, 8)
* .max()
* .subscribe(x => console.log(x)); // -> 8
*
* @example <caption>Use a comparer function to get the maximal item</caption>
* interface Person {
* age: number,
* name: string
* }
* Observable.of<Person>({age: 7, name: 'Foo'},
* {age: 5, name: 'Bar'},
* {age: 9, name: 'Beer'})
* .max<Person>((a: Person, b: Person) => a.age < b.age ? -1 : 1)
* .subscribe((x: Person) => console.log(x.name)); // -> 'Beer'
* }
*
* @see {@link min}
*
* @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the
* value of two items.
* @return {Observable} An Observable that emits item with the largest value.
* @method max
* @owner Observable
*/
function max(comparer) {
var max = (typeof comparer === 'function')
? function (x, y) { return comparer(x, y) > 0 ? x : y; }
: function (x, y) { return x > y ? x : y; };
return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(max);
}
//# sourceMappingURL=max.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/merge.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/merge.js ***!
\*************************************************************/
/*! exports provided: merge */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; });
/* harmony import */ var _observable_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/merge */ "./node_modules/rxjs/_esm5/internal/observable/merge.js");
/** PURE_IMPORTS_START _observable_merge PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* @deprecated Deprecated in favor of static merge.
*/
function merge() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
return function (source) { return source.lift.call(_observable_merge__WEBPACK_IMPORTED_MODULE_0__["merge"].apply(void 0, [source].concat(observables))); };
}
//# sourceMappingURL=merge.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/mergeAll.js":
/*!****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/mergeAll.js ***!
\****************************************************************/
/*! exports provided: mergeAll */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return mergeAll; });
/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ "./node_modules/rxjs/_esm5/internal/operators/mergeMap.js");
/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ "./node_modules/rxjs/_esm5/internal/util/identity.js");
/** PURE_IMPORTS_START _mergeMap,_util_identity PURE_IMPORTS_END */
/**
* Converts a higher-order Observable into a first-order Observable which
* concurrently delivers all values that are emitted on the inner Observables.
*
* <span class="informal">Flattens an Observable-of-Observables.</span>
*
* <img src="./img/mergeAll.png" width="100%">
*
* `mergeAll` subscribes to an Observable that emits Observables, also known as
* a higher-order Observable. Each time it observes one of these emitted inner
* Observables, it subscribes to that and delivers all the values from the
* inner Observable on the output Observable. The output Observable only
* completes once all inner Observables have completed. Any error delivered by
* a inner Observable will be immediately emitted on the output Observable.
*
* @example <caption>Spawn a new interval Observable for each click event, and blend their outputs as one Observable</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000));
* var firstOrder = higherOrder.mergeAll();
* firstOrder.subscribe(x => console.log(x));
*
* @example <caption>Count from 0 to 9 every second for each click, but only allow 2 concurrent timers</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000).take(10));
* var firstOrder = higherOrder.mergeAll(2);
* firstOrder.subscribe(x => console.log(x));
*
* @see {@link combineAll}
* @see {@link concatAll}
* @see {@link exhaust}
* @see {@link merge}
* @see {@link mergeMap}
* @see {@link mergeMapTo}
* @see {@link mergeScan}
* @see {@link switch}
* @see {@link zipAll}
*
* @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of inner
* Observables being subscribed to concurrently.
* @return {Observable} An Observable that emits values coming from all the
* inner Observables emitted by the source Observable.
* @method mergeAll
* @owner Observable
*/
function mergeAll(concurrent) {
if (concurrent === void 0) {
concurrent = Number.POSITIVE_INFINITY;
}
return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(_util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"], concurrent);
}
//# sourceMappingURL=mergeAll.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/mergeMap.js":
/*!****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/mergeMap.js ***!
\****************************************************************/
/*! exports provided: mergeMap, MergeMapOperator, MergeMapSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return mergeMap; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeMapOperator", function() { return MergeMapOperator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeMapSubscriber", function() { return MergeMapSubscriber; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./map */ "./node_modules/rxjs/_esm5/internal/operators/map.js");
/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../observable/from */ "./node_modules/rxjs/_esm5/internal/observable/from.js");
/** PURE_IMPORTS_START tslib,_util_subscribeToResult,_OuterSubscriber,_map,_observable_from PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Projects each source value to an Observable which is merged in the output
* Observable.
*
* <span class="informal">Maps each value to an Observable, then flattens all of
* these inner Observables using {@link mergeAll}.</span>
*
* <img src="./img/mergeMap.png" width="100%">
*
* Returns an Observable that emits items based on applying a function that you
* supply to each item emitted by the source Observable, where that function
* returns an Observable, and then merging those resulting Observables and
* emitting the results of this merger.
*
* @example <caption>Map and flatten each letter to an Observable ticking every 1 second</caption>
* var letters = Rx.Observable.of('a', 'b', 'c');
* var result = letters.mergeMap(x =>
* Rx.Observable.interval(1000).map(i => x+i)
* );
* result.subscribe(x => console.log(x));
*
* // Results in the following:
* // a0
* // b0
* // c0
* // a1
* // b1
* // c1
* // continues to list a,b,c with respective ascending integers
*
* @see {@link concatMap}
* @see {@link exhaustMap}
* @see {@link merge}
* @see {@link mergeAll}
* @see {@link mergeMapTo}
* @see {@link mergeScan}
* @see {@link switchMap}
*
* @param {function(value: T, ?index: number): ObservableInput} project A function
* that, when applied to an item emitted by the source Observable, returns an
* Observable.
* @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input
* Observables being subscribed to concurrently.
* @return {Observable} An Observable that emits the result of applying the
* projection function (and the optional `resultSelector`) to each item emitted
* by the source Observable and merging the results of the Observables obtained
* from this transformation.
* @method mergeMap
* @owner Observable
*/
function mergeMap(project, resultSelector, concurrent) {
if (concurrent === void 0) {
concurrent = Number.POSITIVE_INFINITY;
}
if (typeof resultSelector === 'function') {
// DEPRECATED PATH
return function (source) { return source.pipe(mergeMap(function (a, i) { return Object(_observable_from__WEBPACK_IMPORTED_MODULE_4__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); };
}
else if (typeof resultSelector === 'number') {
concurrent = resultSelector;
}
return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); };
}
var MergeMapOperator = /*@__PURE__*/ (function () {
function MergeMapOperator(project, concurrent) {
if (concurrent === void 0) {
concurrent = Number.POSITIVE_INFINITY;
}
this.project = project;
this.concurrent = concurrent;
}
MergeMapOperator.prototype.call = function (observer, source) {
return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));
};
return MergeMapOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var MergeMapSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MergeMapSubscriber, _super);
function MergeMapSubscriber(destination, project, concurrent) {
if (concurrent === void 0) {
concurrent = Number.POSITIVE_INFINITY;
}
var _this = _super.call(this, destination) || this;
_this.project = project;
_this.concurrent = concurrent;
_this.hasCompleted = false;
_this.buffer = [];
_this.active = 0;
_this.index = 0;
return _this;
}
MergeMapSubscriber.prototype._next = function (value) {
if (this.active < this.concurrent) {
this._tryNext(value);
}
else {
this.buffer.push(value);
}
};
MergeMapSubscriber.prototype._tryNext = function (value) {
var result;
var index = this.index++;
try {
result = this.project(value, index);
}
catch (err) {
this.destination.error(err);
return;
}
this.active++;
this._innerSub(result, value, index);
};
MergeMapSubscriber.prototype._innerSub = function (ish, value, index) {
this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, ish, value, index));
};
MergeMapSubscriber.prototype._complete = function () {
this.hasCompleted = true;
if (this.active === 0 && this.buffer.length === 0) {
this.destination.complete();
}
};
MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.destination.next(innerValue);
};
MergeMapSubscriber.prototype.notifyComplete = function (innerSub) {
var buffer = this.buffer;
this.remove(innerSub);
this.active--;
if (buffer.length > 0) {
this._next(buffer.shift());
}
else if (this.active === 0 && this.hasCompleted) {
this.destination.complete();
}
};
return MergeMapSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
//# sourceMappingURL=mergeMap.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/mergeMapTo.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/mergeMapTo.js ***!
\******************************************************************/
/*! exports provided: mergeMapTo */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return mergeMapTo; });
/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ "./node_modules/rxjs/_esm5/internal/operators/mergeMap.js");
/** PURE_IMPORTS_START _mergeMap PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Projects each source value to the same Observable which is merged multiple
* times in the output Observable.
*
* <span class="informal">It's like {@link mergeMap}, but maps each value always
* to the same inner Observable.</span>
*
* <img src="./img/mergeMapTo.png" width="100%">
*
* Maps each source value to the given Observable `innerObservable` regardless
* of the source value, and then merges those resulting Observables into one
* single Observable, which is the output Observable.
*
* @example <caption>For each click event, start an interval Observable ticking every 1 second</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.mergeMapTo(Rx.Observable.interval(1000));
* result.subscribe(x => console.log(x));
*
* @see {@link concatMapTo}
* @see {@link merge}
* @see {@link mergeAll}
* @see {@link mergeMap}
* @see {@link mergeScan}
* @see {@link switchMapTo}
*
* @param {ObservableInput} innerObservable An Observable to replace each value from
* the source Observable.
* @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input
* Observables being subscribed to concurrently.
* @return {Observable} An Observable that emits items from the given
* `innerObservable`
* @method mergeMapTo
* @owner Observable
*/
function mergeMapTo(innerObservable, resultSelector, concurrent) {
if (concurrent === void 0) {
concurrent = Number.POSITIVE_INFINITY;
}
if (typeof resultSelector === 'function') {
return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(function () { return innerObservable; }, resultSelector, concurrent);
}
if (typeof resultSelector === 'number') {
concurrent = resultSelector;
}
return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(function () { return innerObservable; }, concurrent);
}
//# sourceMappingURL=mergeMapTo.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/mergeScan.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/mergeScan.js ***!
\*****************************************************************/
/*! exports provided: mergeScan, MergeScanOperator, MergeScanSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return mergeScan; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeScanOperator", function() { return MergeScanOperator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeScanSubscriber", function() { return MergeScanSubscriber; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/tryCatch */ "./node_modules/rxjs/_esm5/internal/util/tryCatch.js");
/* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/errorObject */ "./node_modules/rxjs/_esm5/internal/util/errorObject.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_util_subscribeToResult,_OuterSubscriber PURE_IMPORTS_END */
/**
* Applies an accumulator function over the source Observable where the
* accumulator function itself returns an Observable, then each intermediate
* Observable returned is merged into the output Observable.
*
* <span class="informal">It's like {@link scan}, but the Observables returned
* by the accumulator are merged into the outer Observable.</span>
*
* @example <caption>Count the number of click events</caption>
* const click$ = Rx.Observable.fromEvent(document, 'click');
* const one$ = click$.mapTo(1);
* const seed = 0;
* const count$ = one$.mergeScan((acc, one) => Rx.Observable.of(acc + one), seed);
* count$.subscribe(x => console.log(x));
*
* // Results:
* 1
* 2
* 3
* 4
* // ...and so on for each click
*
* @param {function(acc: R, value: T): Observable<R>} accumulator
* The accumulator function called on each source value.
* @param seed The initial accumulation value.
* @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of
* input Observables being subscribed to concurrently.
* @return {Observable<R>} An observable of the accumulated values.
* @method mergeScan
* @owner Observable
*/
function mergeScan(accumulator, seed, concurrent) {
if (concurrent === void 0) {
concurrent = Number.POSITIVE_INFINITY;
}
return function (source) { return source.lift(new MergeScanOperator(accumulator, seed, concurrent)); };
}
var MergeScanOperator = /*@__PURE__*/ (function () {
function MergeScanOperator(accumulator, seed, concurrent) {
this.accumulator = accumulator;
this.seed = seed;
this.concurrent = concurrent;
}
MergeScanOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new MergeScanSubscriber(subscriber, this.accumulator, this.seed, this.concurrent));
};
return MergeScanOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var MergeScanSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MergeScanSubscriber, _super);
function MergeScanSubscriber(destination, accumulator, acc, concurrent) {
var _this = _super.call(this, destination) || this;
_this.accumulator = accumulator;
_this.acc = acc;
_this.concurrent = concurrent;
_this.hasValue = false;
_this.hasCompleted = false;
_this.buffer = [];
_this.active = 0;
_this.index = 0;
return _this;
}
MergeScanSubscriber.prototype._next = function (value) {
if (this.active < this.concurrent) {
var index = this.index++;
var ish = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_1__["tryCatch"])(this.accumulator)(this.acc, value);
var destination = this.destination;
if (ish === _util_errorObject__WEBPACK_IMPORTED_MODULE_2__["errorObject"]) {
destination.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_2__["errorObject"].e);
}
else {
this.active++;
this._innerSub(ish, value, index);
}
}
else {
this.buffer.push(value);
}
};
MergeScanSubscriber.prototype._innerSub = function (ish, value, index) {
this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, ish, value, index));
};
MergeScanSubscriber.prototype._complete = function () {
this.hasCompleted = true;
if (this.active === 0 && this.buffer.length === 0) {
if (this.hasValue === false) {
this.destination.next(this.acc);
}
this.destination.complete();
}
};
MergeScanSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
var destination = this.destination;
this.acc = innerValue;
this.hasValue = true;
destination.next(innerValue);
};
MergeScanSubscriber.prototype.notifyComplete = function (innerSub) {
var buffer = this.buffer;
this.remove(innerSub);
this.active--;
if (buffer.length > 0) {
this._next(buffer.shift());
}
else if (this.active === 0 && this.hasCompleted) {
if (this.hasValue === false) {
this.destination.next(this.acc);
}
this.destination.complete();
}
};
return MergeScanSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"]));
//# sourceMappingURL=mergeScan.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/min.js":
/*!***********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/min.js ***!
\***********************************************************/
/*! exports provided: min */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reduce */ "./node_modules/rxjs/_esm5/internal/operators/reduce.js");
/** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
/**
* The Min operator operates on an Observable that emits numbers (or items that can be compared with a provided function),
* and when source Observable completes it emits a single item: the item with the smallest value.
*
* <img src="./img/min.png" width="100%">
*
* @example <caption>Get the minimal value of a series of numbers</caption>
* Rx.Observable.of(5, 4, 7, 2, 8)
* .min()
* .subscribe(x => console.log(x)); // -> 2
*
* @example <caption>Use a comparer function to get the minimal item</caption>
* interface Person {
* age: number,
* name: string
* }
* Observable.of<Person>({age: 7, name: 'Foo'},
* {age: 5, name: 'Bar'},
* {age: 9, name: 'Beer'})
* .min<Person>( (a: Person, b: Person) => a.age < b.age ? -1 : 1)
* .subscribe((x: Person) => console.log(x.name)); // -> 'Bar'
* }
*
* @see {@link max}
*
* @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the
* value of two items.
* @return {Observable<R>} An Observable that emits item with the smallest value.
* @method min
* @owner Observable
*/
function min(comparer) {
var min = (typeof comparer === 'function')
? function (x, y) { return comparer(x, y) < 0 ? x : y; }
: function (x, y) { return x < y ? x : y; };
return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(min);
}
//# sourceMappingURL=min.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/multicast.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/multicast.js ***!
\*****************************************************************/
/*! exports provided: multicast, MulticastOperator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return multicast; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MulticastOperator", function() { return MulticastOperator; });
/* harmony import */ var _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/ConnectableObservable */ "./node_modules/rxjs/_esm5/internal/observable/ConnectableObservable.js");
/** PURE_IMPORTS_START _observable_ConnectableObservable PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Returns an Observable that emits the results of invoking a specified selector on items
* emitted by a ConnectableObservable that shares a single subscription to the underlying stream.
*
* <img src="./img/multicast.png" width="100%">
*
* @param {Function|Subject} subjectOrSubjectFactory - Factory function to create an intermediate subject through
* which the source sequence's elements will be multicast to the selector function
* or Subject to push source elements into.
* @param {Function} [selector] - Optional selector function that can use the multicasted source stream
* as many times as needed, without causing multiple subscriptions to the source stream.
* Subscribers to the given source will receive all notifications of the source from the
* time of the subscription forward.
* @return {Observable} An Observable that emits the results of invoking the selector
* on the items emitted by a `ConnectableObservable` that shares a single subscription to
* the underlying stream.
* @method multicast
* @owner Observable
*/
function multicast(subjectOrSubjectFactory, selector) {
return function multicastOperatorFunction(source) {
var subjectFactory;
if (typeof subjectOrSubjectFactory === 'function') {
subjectFactory = subjectOrSubjectFactory;
}
else {
subjectFactory = function subjectFactory() {
return subjectOrSubjectFactory;
};
}
if (typeof selector === 'function') {
return source.lift(new MulticastOperator(subjectFactory, selector));
}
var connectable = Object.create(source, _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__["connectableObservableDescriptor"]);
connectable.source = source;
connectable.subjectFactory = subjectFactory;
return connectable;
};
}
var MulticastOperator = /*@__PURE__*/ (function () {
function MulticastOperator(subjectFactory, selector) {
this.subjectFactory = subjectFactory;
this.selector = selector;
}
MulticastOperator.prototype.call = function (subscriber, source) {
var selector = this.selector;
var subject = this.subjectFactory();
var subscription = selector(subject).subscribe(subscriber);
subscription.add(source.subscribe(subject));
return subscription;
};
return MulticastOperator;
}());
//# sourceMappingURL=multicast.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/observeOn.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/observeOn.js ***!
\*****************************************************************/
/*! exports provided: observeOn, ObserveOnOperator, ObserveOnSubscriber, ObserveOnMessage */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return observeOn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnOperator", function() { return ObserveOnOperator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnSubscriber", function() { return ObserveOnSubscriber; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnMessage", function() { return ObserveOnMessage; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Notification */ "./node_modules/rxjs/_esm5/internal/Notification.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */
/**
*
* Re-emits all notifications from source Observable with specified scheduler.
*
* <span class="informal">Ensure a specific scheduler is used, from outside of an Observable.</span>
*
* `observeOn` is an operator that accepts a scheduler as a first parameter, which will be used to reschedule
* notifications emitted by the source Observable. It might be useful, if you do not have control over
* internal scheduler of a given Observable, but want to control when its values are emitted nevertheless.
*
* Returned Observable emits the same notifications (nexted values, complete and error events) as the source Observable,
* but rescheduled with provided scheduler. Note that this doesn't mean that source Observables internal
* scheduler will be replaced in any way. Original scheduler still will be used, but when the source Observable emits
* notification, it will be immediately scheduled again - this time with scheduler passed to `observeOn`.
* An anti-pattern would be calling `observeOn` on Observable that emits lots of values synchronously, to split
* that emissions into asynchronous chunks. For this to happen, scheduler would have to be passed into the source
* Observable directly (usually into the operator that creates it). `observeOn` simply delays notifications a
* little bit more, to ensure that they are emitted at expected moments.
*
* As a matter of fact, `observeOn` accepts second parameter, which specifies in milliseconds with what delay notifications
* will be emitted. The main difference between {@link delay} operator and `observeOn` is that `observeOn`
* will delay all notifications - including error notifications - while `delay` will pass through error
* from source Observable immediately when it is emitted. In general it is highly recommended to use `delay` operator
* for any kind of delaying of values in the stream, while using `observeOn` to specify which scheduler should be used
* for notification emissions in general.
*
* @example <caption>Ensure values in subscribe are called just before browser repaint.</caption>
* const intervals = Rx.Observable.interval(10); // Intervals are scheduled
* // with async scheduler by default...
*
* intervals
* .observeOn(Rx.Scheduler.animationFrame) // ...but we will observe on animationFrame
* .subscribe(val => { // scheduler to ensure smooth animation.
* someDiv.style.height = val + 'px';
* });
*
* @see {@link delay}
*
* @param {SchedulerLike} scheduler Scheduler that will be used to reschedule notifications from source Observable.
* @param {number} [delay] Number of milliseconds that states with what delay every notification should be rescheduled.
* @return {Observable<T>} Observable that emits the same notifications as the source Observable,
* but with provided scheduler.
*
* @method observeOn
* @owner Observable
*/
function observeOn(scheduler, delay) {
if (delay === void 0) {
delay = 0;
}
return function observeOnOperatorFunction(source) {
return source.lift(new ObserveOnOperator(scheduler, delay));
};
}
var ObserveOnOperator = /*@__PURE__*/ (function () {
function ObserveOnOperator(scheduler, delay) {
if (delay === void 0) {
delay = 0;
}
this.scheduler = scheduler;
this.delay = delay;
}
ObserveOnOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));
};
return ObserveOnOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var ObserveOnSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ObserveOnSubscriber, _super);
function ObserveOnSubscriber(destination, scheduler, delay) {
if (delay === void 0) {
delay = 0;
}
var _this = _super.call(this, destination) || this;
_this.scheduler = scheduler;
_this.delay = delay;
return _this;
}
/** @nocollapse */
ObserveOnSubscriber.dispatch = function (arg) {
var notification = arg.notification, destination = arg.destination;
notification.observe(destination);
this.unsubscribe();
};
ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {
this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));
};
ObserveOnSubscriber.prototype._next = function (value) {
this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createNext(value));
};
ObserveOnSubscriber.prototype._error = function (err) {
this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createError(err));
};
ObserveOnSubscriber.prototype._complete = function () {
this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createComplete());
};
return ObserveOnSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
var ObserveOnMessage = /*@__PURE__*/ (function () {
function ObserveOnMessage(notification, destination) {
this.notification = notification;
this.destination = destination;
}
return ObserveOnMessage;
}());
//# sourceMappingURL=observeOn.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/onErrorResumeNext.js":
/*!*************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/onErrorResumeNext.js ***!
\*************************************************************************/
/*! exports provided: onErrorResumeNext, onErrorResumeNextStatic */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNextStatic", function() { return onErrorResumeNextStatic; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/from */ "./node_modules/rxjs/_esm5/internal/observable/from.js");
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_observable_from,_util_isArray,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* When any of the provided Observable emits an complete or error notification, it immediately subscribes to the next one
* that was passed.
*
* <span class="informal">Execute series of Observables no matter what, even if it means swallowing errors.</span>
*
* <img src="./img/onErrorResumeNext.png" width="100%">
*
* `onErrorResumeNext` is an operator that accepts a series of Observables, provided either directly as
* arguments or as an array. If no single Observable is provided, returned Observable will simply behave the same
* as the source.
*
* `onErrorResumeNext` returns an Observable that starts by subscribing and re-emitting values from the source Observable.
* When its stream of values ends - no matter if Observable completed or emitted an error - `onErrorResumeNext`
* will subscribe to the first Observable that was passed as an argument to the method. It will start re-emitting
* its values as well and - again - when that stream ends, `onErrorResumeNext` will proceed to subscribing yet another
* Observable in provided series, no matter if previous Observable completed or ended with an error. This will
* be happening until there is no more Observables left in the series, at which point returned Observable will
* complete - even if the last subscribed stream ended with an error.
*
* `onErrorResumeNext` can be therefore thought of as version of {@link concat} operator, which is more permissive
* when it comes to the errors emitted by its input Observables. While `concat` subscribes to the next Observable
* in series only if previous one successfully completed, `onErrorResumeNext` subscribes even if it ended with
* an error.
*
* Note that you do not get any access to errors emitted by the Observables. In particular do not
* expect these errors to appear in error callback passed to {@link subscribe}. If you want to take
* specific actions based on what error was emitted by an Observable, you should try out {@link catch} instead.
*
*
* @example <caption>Subscribe to the next Observable after map fails</caption>
* Rx.Observable.of(1, 2, 3, 0)
* .map(x => {
* if (x === 0) { throw Error(); }
return 10 / x;
* })
* .onErrorResumeNext(Rx.Observable.of(1, 2, 3))
* .subscribe(
* val => console.log(val),
* err => console.log(err), // Will never be called.
* () => console.log('that\'s it!')
* );
*
* // Logs:
* // 10
* // 5
* // 3.3333333333333335
* // 1
* // 2
* // 3
* // "that's it!"
*
* @see {@link concat}
* @see {@link catch}
*
* @param {...ObservableInput} observables Observables passed either directly or as an array.
* @return {Observable} An Observable that emits values from source Observable, but - if it errors - subscribes
* to the next passed Observable and so on, until it completes or runs out of Observables.
* @method onErrorResumeNext
* @owner Observable
*/
function onErrorResumeNext() {
var nextSources = [];
for (var _i = 0; _i < arguments.length; _i++) {
nextSources[_i] = arguments[_i];
}
if (nextSources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(nextSources[0])) {
nextSources = nextSources[0];
}
return function (source) { return source.lift(new OnErrorResumeNextOperator(nextSources)); };
}
/* tslint:enable:max-line-length */
function onErrorResumeNextStatic() {
var nextSources = [];
for (var _i = 0; _i < arguments.length; _i++) {
nextSources[_i] = arguments[_i];
}
var source = null;
if (nextSources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(nextSources[0])) {
nextSources = nextSources[0];
}
source = nextSources.shift();
return Object(_observable_from__WEBPACK_IMPORTED_MODULE_1__["from"])(source, null).lift(new OnErrorResumeNextOperator(nextSources));
}
var OnErrorResumeNextOperator = /*@__PURE__*/ (function () {
function OnErrorResumeNextOperator(nextSources) {
this.nextSources = nextSources;
}
OnErrorResumeNextOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));
};
return OnErrorResumeNextOperator;
}());
var OnErrorResumeNextSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](OnErrorResumeNextSubscriber, _super);
function OnErrorResumeNextSubscriber(destination, nextSources) {
var _this = _super.call(this, destination) || this;
_this.destination = destination;
_this.nextSources = nextSources;
return _this;
}
OnErrorResumeNextSubscriber.prototype.notifyError = function (error, innerSub) {
this.subscribeToNextSource();
};
OnErrorResumeNextSubscriber.prototype.notifyComplete = function (innerSub) {
this.subscribeToNextSource();
};
OnErrorResumeNextSubscriber.prototype._error = function (err) {
this.subscribeToNextSource();
};
OnErrorResumeNextSubscriber.prototype._complete = function () {
this.subscribeToNextSource();
};
OnErrorResumeNextSubscriber.prototype.subscribeToNextSource = function () {
var next = this.nextSources.shift();
if (next) {
this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, next));
}
else {
this.destination.complete();
}
};
return OnErrorResumeNextSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
//# sourceMappingURL=onErrorResumeNext.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/pairwise.js":
/*!****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/pairwise.js ***!
\****************************************************************/
/*! exports provided: pairwise */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return pairwise; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Groups pairs of consecutive emissions together and emits them as an array of
* two values.
*
* <span class="informal">Puts the current value and previous value together as
* an array, and emits that.</span>
*
* <img src="./img/pairwise.png" width="100%">
*
* The Nth emission from the source Observable will cause the output Observable
* to emit an array [(N-1)th, Nth] of the previous and the current value, as a
* pair. For this reason, `pairwise` emits on the second and subsequent
* emissions from the source Observable, but not on the first emission, because
* there is no previous value in that case.
*
* @example <caption>On every click (starting from the second), emit the relative distance to the previous click</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var pairs = clicks.pairwise();
* var distance = pairs.map(pair => {
* var x0 = pair[0].clientX;
* var y0 = pair[0].clientY;
* var x1 = pair[1].clientX;
* var y1 = pair[1].clientY;
* return Math.sqrt(Math.pow(x0 - x1, 2) + Math.pow(y0 - y1, 2));
* });
* distance.subscribe(x => console.log(x));
*
* @see {@link buffer}
* @see {@link bufferCount}
*
* @return {Observable<Array<T>>} An Observable of pairs (as arrays) of
* consecutive values from the source Observable.
* @method pairwise
* @owner Observable
*/
function pairwise() {
return function (source) { return source.lift(new PairwiseOperator()); };
}
var PairwiseOperator = /*@__PURE__*/ (function () {
function PairwiseOperator() {
}
PairwiseOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new PairwiseSubscriber(subscriber));
};
return PairwiseOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var PairwiseSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](PairwiseSubscriber, _super);
function PairwiseSubscriber(destination) {
var _this = _super.call(this, destination) || this;
_this.hasPrev = false;
return _this;
}
PairwiseSubscriber.prototype._next = function (value) {
if (this.hasPrev) {
this.destination.next([this.prev, value]);
}
else {
this.hasPrev = true;
}
this.prev = value;
};
return PairwiseSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=pairwise.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/partition.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/partition.js ***!
\*****************************************************************/
/*! exports provided: partition */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return partition; });
/* harmony import */ var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/not */ "./node_modules/rxjs/_esm5/internal/util/not.js");
/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ "./node_modules/rxjs/_esm5/internal/operators/filter.js");
/** PURE_IMPORTS_START _util_not,_filter PURE_IMPORTS_END */
/**
* Splits the source Observable into two, one with values that satisfy a
* predicate, and another with values that don't satisfy the predicate.
*
* <span class="informal">It's like {@link filter}, but returns two Observables:
* one like the output of {@link filter}, and the other with values that did not
* pass the condition.</span>
*
* <img src="./img/partition.png" width="100%">
*
* `partition` outputs an array with two Observables that partition the values
* from the source Observable through the given `predicate` function. The first
* Observable in that array emits source values for which the predicate argument
* returns true. The second Observable emits source values for which the
* predicate returns false. The first behaves like {@link filter} and the second
* behaves like {@link filter} with the predicate negated.
*
* @example <caption>Partition click events into those on DIV elements and those elsewhere</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var parts = clicks.partition(ev => ev.target.tagName === 'DIV');
* var clicksOnDivs = parts[0];
* var clicksElsewhere = parts[1];
* clicksOnDivs.subscribe(x => console.log('DIV clicked: ', x));
* clicksElsewhere.subscribe(x => console.log('Other clicked: ', x));
*
* @see {@link filter}
*
* @param {function(value: T, index: number): boolean} predicate A function that
* evaluates each value emitted by the source Observable. If it returns `true`,
* the value is emitted on the first Observable in the returned array, if
* `false` the value is emitted on the second Observable in the array. The
* `index` parameter is the number `i` for the i-th source emission that has
* happened since the subscription, starting from the number `0`.
* @param {any} [thisArg] An optional argument to determine the value of `this`
* in the `predicate` function.
* @return {[Observable<T>, Observable<T>]} An array with two Observables: one
* with values that passed the predicate, and another with values that did not
* pass the predicate.
* @method partition
* @owner Observable
*/
function partition(predicate, thisArg) {
return function (source) {
return [
Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(predicate, thisArg)(source),
Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(Object(_util_not__WEBPACK_IMPORTED_MODULE_0__["not"])(predicate, thisArg))(source)
];
};
}
//# sourceMappingURL=partition.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/pluck.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/pluck.js ***!
\*************************************************************/
/*! exports provided: pluck */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return pluck; });
/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./map */ "./node_modules/rxjs/_esm5/internal/operators/map.js");
/** PURE_IMPORTS_START _map PURE_IMPORTS_END */
/**
* Maps each source value (an object) to its specified nested property.
*
* <span class="informal">Like {@link map}, but meant only for picking one of
* the nested properties of every emitted object.</span>
*
* <img src="./img/pluck.png" width="100%">
*
* Given a list of strings describing a path to an object property, retrieves
* the value of a specified nested property from all values in the source
* Observable. If a property can't be resolved, it will return `undefined` for
* that value.
*
* @example <caption>Map every click to the tagName of the clicked target element</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var tagNames = clicks.pluck('target', 'tagName');
* tagNames.subscribe(x => console.log(x));
*
* @see {@link map}
*
* @param {...string} properties The nested properties to pluck from each source
* value (an object).
* @return {Observable} A new Observable of property values from the source values.
* @method pluck
* @owner Observable
*/
function pluck() {
var properties = [];
for (var _i = 0; _i < arguments.length; _i++) {
properties[_i] = arguments[_i];
}
var length = properties.length;
if (length === 0) {
throw new Error('list of properties cannot be empty.');
}
return function (source) { return Object(_map__WEBPACK_IMPORTED_MODULE_0__["map"])(plucker(properties, length))(source); };
}
function plucker(props, length) {
var mapper = function (x) {
var currentProp = x;
for (var i = 0; i < length; i++) {
var p = currentProp[props[i]];
if (typeof p !== 'undefined') {
currentProp = p;
}
else {
return undefined;
}
}
return currentProp;
};
return mapper;
}
//# sourceMappingURL=pluck.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/publish.js":
/*!***************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/publish.js ***!
\***************************************************************/
/*! exports provided: publish */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return publish; });
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multicast */ "./node_modules/rxjs/_esm5/internal/operators/multicast.js");
/** PURE_IMPORTS_START _Subject,_multicast PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Returns a ConnectableObservable, which is a variety of Observable that waits until its connect method is called
* before it begins emitting items to those Observers that have subscribed to it.
*
* <img src="./img/publish.png" width="100%">
*
* @param {Function} [selector] - Optional selector function which can use the multicasted source sequence as many times
* as needed, without causing multiple subscriptions to the source sequence.
* Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
* @return A ConnectableObservable that upon connection causes the source Observable to emit items to its Observers.
* @method publish
* @owner Observable
*/
function publish(selector) {
return selector ?
Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(function () { return new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"](); }, selector) :
Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"]());
}
//# sourceMappingURL=publish.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/publishBehavior.js":
/*!***********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/publishBehavior.js ***!
\***********************************************************************/
/*! exports provided: publishBehavior */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return publishBehavior; });
/* harmony import */ var _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../BehaviorSubject */ "./node_modules/rxjs/_esm5/internal/BehaviorSubject.js");
/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multicast */ "./node_modules/rxjs/_esm5/internal/operators/multicast.js");
/** PURE_IMPORTS_START _BehaviorSubject,_multicast PURE_IMPORTS_END */
/**
* @param value
* @return {ConnectableObservable<T>}
* @method publishBehavior
* @owner Observable
*/
function publishBehavior(value) {
return function (source) { return Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__["BehaviorSubject"](value))(source); };
}
//# sourceMappingURL=publishBehavior.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/publishLast.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/publishLast.js ***!
\*******************************************************************/
/*! exports provided: publishLast */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return publishLast; });
/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../AsyncSubject */ "./node_modules/rxjs/_esm5/internal/AsyncSubject.js");
/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multicast */ "./node_modules/rxjs/_esm5/internal/operators/multicast.js");
/** PURE_IMPORTS_START _AsyncSubject,_multicast PURE_IMPORTS_END */
function publishLast() {
return function (source) { return Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__["AsyncSubject"]())(source); };
}
//# sourceMappingURL=publishLast.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/publishReplay.js":
/*!*********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/publishReplay.js ***!
\*********************************************************************/
/*! exports provided: publishReplay */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return publishReplay; });
/* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ReplaySubject */ "./node_modules/rxjs/_esm5/internal/ReplaySubject.js");
/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multicast */ "./node_modules/rxjs/_esm5/internal/operators/multicast.js");
/** PURE_IMPORTS_START _ReplaySubject,_multicast PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) {
if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') {
scheduler = selectorOrScheduler;
}
var selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined;
var subject = new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"](bufferSize, windowTime, scheduler);
return function (source) { return Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(function () { return subject; }, selector)(source); };
}
//# sourceMappingURL=publishReplay.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/race.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/race.js ***!
\************************************************************/
/*! exports provided: race */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return race; });
/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/* harmony import */ var _observable_race__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/race */ "./node_modules/rxjs/_esm5/internal/observable/race.js");
/** PURE_IMPORTS_START _util_isArray,_observable_race PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Returns an Observable that mirrors the first source Observable to emit an item
* from the combination of this Observable and supplied Observables.
* @param {...Observables} ...observables Sources used to race for which Observable emits first.
* @return {Observable} An Observable that mirrors the output of the first Observable to emit an item.
* @method race
* @owner Observable
*/
function race() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
return function raceOperatorFunction(source) {
// if the only argument is an array, it was most likely called with
// `pair([obs1, obs2, ...])`
if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) {
observables = observables[0];
}
return source.lift.call(_observable_race__WEBPACK_IMPORTED_MODULE_1__["race"].apply(void 0, [source].concat(observables)));
};
}
//# sourceMappingURL=race.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/reduce.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/reduce.js ***!
\**************************************************************/
/*! exports provided: reduce */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return reduce; });
/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scan */ "./node_modules/rxjs/_esm5/internal/operators/scan.js");
/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./takeLast */ "./node_modules/rxjs/_esm5/internal/operators/takeLast.js");
/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./defaultIfEmpty */ "./node_modules/rxjs/_esm5/internal/operators/defaultIfEmpty.js");
/* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/pipe */ "./node_modules/rxjs/_esm5/internal/util/pipe.js");
/** PURE_IMPORTS_START _scan,_takeLast,_defaultIfEmpty,_util_pipe PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Applies an accumulator function over the source Observable, and returns the
* accumulated result when the source completes, given an optional seed value.
*
* <span class="informal">Combines together all values emitted on the source,
* using an accumulator function that knows how to join a new source value into
* the accumulation from the past.</span>
*
* <img src="./img/reduce.png" width="100%">
*
* Like
* [Array.prototype.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce),
* `reduce` applies an `accumulator` function against an accumulation and each
* value of the source Observable (from the past) to reduce it to a single
* value, emitted on the output Observable. Note that `reduce` will only emit
* one value, only when the source Observable completes. It is equivalent to
* applying operator {@link scan} followed by operator {@link last}.
*
* Returns an Observable that applies a specified `accumulator` function to each
* item emitted by the source Observable. If a `seed` value is specified, then
* that value will be used as the initial value for the accumulator. If no seed
* value is specified, the first item of the source is used as the seed.
*
* @example <caption>Count the number of click events that happened in 5 seconds</caption>
* var clicksInFiveSeconds = Rx.Observable.fromEvent(document, 'click')
* .takeUntil(Rx.Observable.interval(5000));
* var ones = clicksInFiveSeconds.mapTo(1);
* var seed = 0;
* var count = ones.reduce((acc, one) => acc + one, seed);
* count.subscribe(x => console.log(x));
*
* @see {@link count}
* @see {@link expand}
* @see {@link mergeScan}
* @see {@link scan}
*
* @param {function(acc: R, value: T, index: number): R} accumulator The accumulator function
* called on each source value.
* @param {R} [seed] The initial accumulation value.
* @return {Observable<R>} An Observable that emits a single value that is the
* result of accumulating the values emitted by the source Observable.
* @method reduce
* @owner Observable
*/
function reduce(accumulator, seed) {
// providing a seed of `undefined` *should* be valid and trigger
// hasSeed! so don't use `seed !== undefined` checks!
// For this reason, we have to check it here at the original call site
// otherwise inside Operator/Subscriber we won't know if `undefined`
// means they didn't provide anything or if they literally provided `undefined`
if (arguments.length >= 2) {
return function reduceOperatorFunctionWithSeed(source) {
return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipe"])(Object(_scan__WEBPACK_IMPORTED_MODULE_0__["scan"])(accumulator, seed), Object(_takeLast__WEBPACK_IMPORTED_MODULE_1__["takeLast"])(1), Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__["defaultIfEmpty"])(seed))(source);
};
}
return function reduceOperatorFunction(source) {
return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipe"])(Object(_scan__WEBPACK_IMPORTED_MODULE_0__["scan"])(function (acc, value, index) {
return accumulator(acc, value, index + 1);
}), Object(_takeLast__WEBPACK_IMPORTED_MODULE_1__["takeLast"])(1))(source);
};
}
//# sourceMappingURL=reduce.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/refCount.js":
/*!****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/refCount.js ***!
\****************************************************************/
/*! exports provided: refCount */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return refCount; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
function refCount() {
return function refCountOperatorFunction(source) {
return source.lift(new RefCountOperator(source));
};
}
var RefCountOperator = /*@__PURE__*/ (function () {
function RefCountOperator(connectable) {
this.connectable = connectable;
}
RefCountOperator.prototype.call = function (subscriber, source) {
var connectable = this.connectable;
connectable._refCount++;
var refCounter = new RefCountSubscriber(subscriber, connectable);
var subscription = source.subscribe(refCounter);
if (!refCounter.closed) {
refCounter.connection = connectable.connect();
}
return subscription;
};
return RefCountOperator;
}());
var RefCountSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RefCountSubscriber, _super);
function RefCountSubscriber(destination, connectable) {
var _this = _super.call(this, destination) || this;
_this.connectable = connectable;
return _this;
}
RefCountSubscriber.prototype._unsubscribe = function () {
var connectable = this.connectable;
if (!connectable) {
this.connection = null;
return;
}
this.connectable = null;
var refCount = connectable._refCount;
if (refCount <= 0) {
this.connection = null;
return;
}
connectable._refCount = refCount - 1;
if (refCount > 1) {
this.connection = null;
return;
}
///
// Compare the local RefCountSubscriber's connection Subscription to the
// connection Subscription on the shared ConnectableObservable. In cases
// where the ConnectableObservable source synchronously emits values, and
// the RefCountSubscriber's downstream Observers synchronously unsubscribe,
// execution continues to here before the RefCountOperator has a chance to
// supply the RefCountSubscriber with the shared connection Subscription.
// For example:
// ```
// Observable.range(0, 10)
// .publish()
// .refCount()
// .take(5)
// .subscribe();
// ```
// In order to account for this case, RefCountSubscriber should only dispose
// the ConnectableObservable's shared connection Subscription if the
// connection Subscription exists, *and* either:
// a. RefCountSubscriber doesn't have a reference to the shared connection
// Subscription yet, or,
// b. RefCountSubscriber's connection Subscription reference is identical
// to the shared connection Subscription
///
var connection = this.connection;
var sharedConnection = connectable._connection;
this.connection = null;
if (sharedConnection && (!connection || sharedConnection === connection)) {
sharedConnection.unsubscribe();
}
};
return RefCountSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=refCount.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/repeat.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/repeat.js ***!
\**************************************************************/
/*! exports provided: repeat */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/empty */ "./node_modules/rxjs/_esm5/internal/observable/empty.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_observable_empty PURE_IMPORTS_END */
/**
* Returns an Observable that repeats the stream of items emitted by the source Observable at most count times.
*
* <img src="./img/repeat.png" width="100%">
*
* @param {number} [count] The number of times the source Observable items are repeated, a count of 0 will yield
* an empty Observable.
* @return {Observable} An Observable that repeats the stream of items emitted by the source Observable at most
* count times.
* @method repeat
* @owner Observable
*/
function repeat(count) {
if (count === void 0) {
count = -1;
}
return function (source) {
if (count === 0) {
return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])();
}
else if (count < 0) {
return source.lift(new RepeatOperator(-1, source));
}
else {
return source.lift(new RepeatOperator(count - 1, source));
}
};
}
var RepeatOperator = /*@__PURE__*/ (function () {
function RepeatOperator(count, source) {
this.count = count;
this.source = source;
}
RepeatOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));
};
return RepeatOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var RepeatSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RepeatSubscriber, _super);
function RepeatSubscriber(destination, count, source) {
var _this = _super.call(this, destination) || this;
_this.count = count;
_this.source = source;
return _this;
}
RepeatSubscriber.prototype.complete = function () {
if (!this.isStopped) {
var _a = this, source = _a.source, count = _a.count;
if (count === 0) {
return _super.prototype.complete.call(this);
}
else if (count > -1) {
this.count = count - 1;
}
source.subscribe(this._unsubscribeAndRecycle());
}
};
return RepeatSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=repeat.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/repeatWhen.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/repeatWhen.js ***!
\******************************************************************/
/*! exports provided: repeatWhen */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return repeatWhen; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/tryCatch */ "./node_modules/rxjs/_esm5/internal/util/tryCatch.js");
/* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/errorObject */ "./node_modules/rxjs/_esm5/internal/util/errorObject.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_Subject,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Returns an Observable that mirrors the source Observable with the exception of a `complete`. If the source
* Observable calls `complete`, this method will emit to the Observable returned from `notifier`. If that Observable
* calls `complete` or `error`, then this method will call `complete` or `error` on the child subscription. Otherwise
* this method will resubscribe to the source Observable.
*
* <img src="./img/repeatWhen.png" width="100%">
*
* @param {function(notifications: Observable): Observable} notifier - Receives an Observable of notifications with
* which a user can `complete` or `error`, aborting the repetition.
* @return {Observable} The source Observable modified with repeat logic.
* @method repeatWhen
* @owner Observable
*/
function repeatWhen(notifier) {
return function (source) { return source.lift(new RepeatWhenOperator(notifier)); };
}
var RepeatWhenOperator = /*@__PURE__*/ (function () {
function RepeatWhenOperator(notifier) {
this.notifier = notifier;
}
RepeatWhenOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source));
};
return RepeatWhenOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var RepeatWhenSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RepeatWhenSubscriber, _super);
function RepeatWhenSubscriber(destination, notifier, source) {
var _this = _super.call(this, destination) || this;
_this.notifier = notifier;
_this.source = source;
_this.sourceIsBeingSubscribedTo = true;
return _this;
}
RepeatWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.sourceIsBeingSubscribedTo = true;
this.source.subscribe(this);
};
RepeatWhenSubscriber.prototype.notifyComplete = function (innerSub) {
if (this.sourceIsBeingSubscribedTo === false) {
return _super.prototype.complete.call(this);
}
};
RepeatWhenSubscriber.prototype.complete = function () {
this.sourceIsBeingSubscribedTo = false;
if (!this.isStopped) {
if (!this.retries) {
this.subscribeToRetries();
}
if (!this.retriesSubscription || this.retriesSubscription.closed) {
return _super.prototype.complete.call(this);
}
this._unsubscribeAndRecycle();
this.notifications.next();
}
};
/** @deprecated This is an internal implementation detail, do not use. */
RepeatWhenSubscriber.prototype._unsubscribe = function () {
var _a = this, notifications = _a.notifications, retriesSubscription = _a.retriesSubscription;
if (notifications) {
notifications.unsubscribe();
this.notifications = null;
}
if (retriesSubscription) {
retriesSubscription.unsubscribe();
this.retriesSubscription = null;
}
this.retries = null;
};
/** @deprecated This is an internal implementation detail, do not use. */
RepeatWhenSubscriber.prototype._unsubscribeAndRecycle = function () {
var _unsubscribe = this._unsubscribe;
this._unsubscribe = null;
_super.prototype._unsubscribeAndRecycle.call(this);
this._unsubscribe = _unsubscribe;
return this;
};
RepeatWhenSubscriber.prototype.subscribeToRetries = function () {
this.notifications = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
var retries = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(this.notifier)(this.notifications);
if (retries === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) {
return _super.prototype.complete.call(this);
}
this.retries = retries;
this.retriesSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, retries);
};
return RepeatWhenSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"]));
//# sourceMappingURL=repeatWhen.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/retry.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/retry.js ***!
\*************************************************************/
/*! exports provided: retry */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return retry; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable
* calls `error`, this method will resubscribe to the source Observable for a maximum of `count` resubscriptions (given
* as a number parameter) rather than propagating the `error` call.
*
* <img src="./img/retry.png" width="100%">
*
* Any and all items emitted by the source Observable will be emitted by the resulting Observable, even those emitted
* during failed subscriptions. For example, if an Observable fails at first but emits [1, 2] then succeeds the second
* time and emits: [1, 2, 3, 4, 5] then the complete stream of emissions and notifications
* would be: [1, 2, 1, 2, 3, 4, 5, `complete`].
* @param {number} count - Number of retry attempts before failing.
* @return {Observable} The source Observable modified with the retry logic.
* @method retry
* @owner Observable
*/
function retry(count) {
if (count === void 0) {
count = -1;
}
return function (source) { return source.lift(new RetryOperator(count, source)); };
}
var RetryOperator = /*@__PURE__*/ (function () {
function RetryOperator(count, source) {
this.count = count;
this.source = source;
}
RetryOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source));
};
return RetryOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var RetrySubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RetrySubscriber, _super);
function RetrySubscriber(destination, count, source) {
var _this = _super.call(this, destination) || this;
_this.count = count;
_this.source = source;
return _this;
}
RetrySubscriber.prototype.error = function (err) {
if (!this.isStopped) {
var _a = this, source = _a.source, count = _a.count;
if (count === 0) {
return _super.prototype.error.call(this, err);
}
else if (count > -1) {
this.count = count - 1;
}
source.subscribe(this._unsubscribeAndRecycle());
}
};
return RetrySubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=retry.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/retryWhen.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/retryWhen.js ***!
\*****************************************************************/
/*! exports provided: retryWhen */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return retryWhen; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/tryCatch */ "./node_modules/rxjs/_esm5/internal/util/tryCatch.js");
/* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/errorObject */ "./node_modules/rxjs/_esm5/internal/util/errorObject.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_Subject,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable
* calls `error`, this method will emit the Throwable that caused the error to the Observable returned from `notifier`.
* If that Observable calls `complete` or `error` then this method will call `complete` or `error` on the child
* subscription. Otherwise this method will resubscribe to the source Observable.
*
* <img src="./img/retryWhen.png" width="100%">
*
* @param {function(errors: Observable): Observable} notifier - Receives an Observable of notifications with which a
* user can `complete` or `error`, aborting the retry.
* @return {Observable} The source Observable modified with retry logic.
* @method retryWhen
* @owner Observable
*/
function retryWhen(notifier) {
return function (source) { return source.lift(new RetryWhenOperator(notifier, source)); };
}
var RetryWhenOperator = /*@__PURE__*/ (function () {
function RetryWhenOperator(notifier, source) {
this.notifier = notifier;
this.source = source;
}
RetryWhenOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source));
};
return RetryWhenOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var RetryWhenSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RetryWhenSubscriber, _super);
function RetryWhenSubscriber(destination, notifier, source) {
var _this = _super.call(this, destination) || this;
_this.notifier = notifier;
_this.source = source;
return _this;
}
RetryWhenSubscriber.prototype.error = function (err) {
if (!this.isStopped) {
var errors = this.errors;
var retries = this.retries;
var retriesSubscription = this.retriesSubscription;
if (!retries) {
errors = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
retries = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(this.notifier)(errors);
if (retries === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) {
return _super.prototype.error.call(this, _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"].e);
}
retriesSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, retries);
}
else {
this.errors = null;
this.retriesSubscription = null;
}
this._unsubscribeAndRecycle();
this.errors = errors;
this.retries = retries;
this.retriesSubscription = retriesSubscription;
errors.next(err);
}
};
/** @deprecated This is an internal implementation detail, do not use. */
RetryWhenSubscriber.prototype._unsubscribe = function () {
var _a = this, errors = _a.errors, retriesSubscription = _a.retriesSubscription;
if (errors) {
errors.unsubscribe();
this.errors = null;
}
if (retriesSubscription) {
retriesSubscription.unsubscribe();
this.retriesSubscription = null;
}
this.retries = null;
};
RetryWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
var _unsubscribe = this._unsubscribe;
this._unsubscribe = null;
this._unsubscribeAndRecycle();
this._unsubscribe = _unsubscribe;
this.source.subscribe(this);
};
return RetryWhenSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"]));
//# sourceMappingURL=retryWhen.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/sample.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/sample.js ***!
\**************************************************************/
/*! exports provided: sample */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return sample; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Emits the most recently emitted value from the source Observable whenever
* another Observable, the `notifier`, emits.
*
* <span class="informal">It's like {@link sampleTime}, but samples whenever
* the `notifier` Observable emits something.</span>
*
* <img src="./img/sample.png" width="100%">
*
* Whenever the `notifier` Observable emits a value or completes, `sample`
* looks at the source Observable and emits whichever value it has most recently
* emitted since the previous sampling, unless the source has not emitted
* anything since the previous sampling. The `notifier` is subscribed to as soon
* as the output Observable is subscribed.
*
* @example <caption>On every click, sample the most recent "seconds" timer</caption>
* var seconds = Rx.Observable.interval(1000);
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = seconds.sample(clicks);
* result.subscribe(x => console.log(x));
*
* @see {@link audit}
* @see {@link debounce}
* @see {@link sampleTime}
* @see {@link throttle}
*
* @param {Observable<any>} notifier The Observable to use for sampling the
* source Observable.
* @return {Observable<T>} An Observable that emits the results of sampling the
* values emitted by the source Observable whenever the notifier Observable
* emits value or completes.
* @method sample
* @owner Observable
*/
function sample(notifier) {
return function (source) { return source.lift(new SampleOperator(notifier)); };
}
var SampleOperator = /*@__PURE__*/ (function () {
function SampleOperator(notifier) {
this.notifier = notifier;
}
SampleOperator.prototype.call = function (subscriber, source) {
var sampleSubscriber = new SampleSubscriber(subscriber);
var subscription = source.subscribe(sampleSubscriber);
subscription.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(sampleSubscriber, this.notifier));
return subscription;
};
return SampleOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SampleSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SampleSubscriber, _super);
function SampleSubscriber() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.hasValue = false;
return _this;
}
SampleSubscriber.prototype._next = function (value) {
this.value = value;
this.hasValue = true;
};
SampleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.emitValue();
};
SampleSubscriber.prototype.notifyComplete = function () {
this.emitValue();
};
SampleSubscriber.prototype.emitValue = function () {
if (this.hasValue) {
this.hasValue = false;
this.destination.next(this.value);
}
};
return SampleSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
//# sourceMappingURL=sample.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/sampleTime.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/sampleTime.js ***!
\******************************************************************/
/*! exports provided: sampleTime */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return sampleTime; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */
/**
* Emits the most recently emitted value from the source Observable within
* periodic time intervals.
*
* <span class="informal">Samples the source Observable at periodic time
* intervals, emitting what it samples.</span>
*
* <img src="./img/sampleTime.png" width="100%">
*
* `sampleTime` periodically looks at the source Observable and emits whichever
* value it has most recently emitted since the previous sampling, unless the
* source has not emitted anything since the previous sampling. The sampling
* happens periodically in time every `period` milliseconds (or the time unit
* defined by the optional `scheduler` argument). The sampling starts as soon as
* the output Observable is subscribed.
*
* @example <caption>Every second, emit the most recent click at most once</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.sampleTime(1000);
* result.subscribe(x => console.log(x));
*
* @see {@link auditTime}
* @see {@link debounceTime}
* @see {@link delay}
* @see {@link sample}
* @see {@link throttleTime}
*
* @param {number} period The sampling period expressed in milliseconds or the
* time unit determined internally by the optional `scheduler`.
* @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for
* managing the timers that handle the sampling.
* @return {Observable<T>} An Observable that emits the results of sampling the
* values emitted by the source Observable at the specified time interval.
* @method sampleTime
* @owner Observable
*/
function sampleTime(period, scheduler) {
if (scheduler === void 0) {
scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"];
}
return function (source) { return source.lift(new SampleTimeOperator(period, scheduler)); };
}
var SampleTimeOperator = /*@__PURE__*/ (function () {
function SampleTimeOperator(period, scheduler) {
this.period = period;
this.scheduler = scheduler;
}
SampleTimeOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler));
};
return SampleTimeOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SampleTimeSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SampleTimeSubscriber, _super);
function SampleTimeSubscriber(destination, period, scheduler) {
var _this = _super.call(this, destination) || this;
_this.period = period;
_this.scheduler = scheduler;
_this.hasValue = false;
_this.add(scheduler.schedule(dispatchNotification, period, { subscriber: _this, period: period }));
return _this;
}
SampleTimeSubscriber.prototype._next = function (value) {
this.lastValue = value;
this.hasValue = true;
};
SampleTimeSubscriber.prototype.notifyNext = function () {
if (this.hasValue) {
this.hasValue = false;
this.destination.next(this.lastValue);
}
};
return SampleTimeSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
function dispatchNotification(state) {
var subscriber = state.subscriber, period = state.period;
subscriber.notifyNext();
this.schedule(state, period);
}
//# sourceMappingURL=sampleTime.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/scan.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/scan.js ***!
\************************************************************/
/*! exports provided: scan */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return scan; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Applies an accumulator function over the source Observable, and returns each
* intermediate result, with an optional seed value.
*
* <span class="informal">It's like {@link reduce}, but emits the current
* accumulation whenever the source emits a value.</span>
*
* <img src="./img/scan.png" width="100%">
*
* Combines together all values emitted on the source, using an accumulator
* function that knows how to join a new source value into the accumulation from
* the past. Is similar to {@link reduce}, but emits the intermediate
* accumulations.
*
* Returns an Observable that applies a specified `accumulator` function to each
* item emitted by the source Observable. If a `seed` value is specified, then
* that value will be used as the initial value for the accumulator. If no seed
* value is specified, the first item of the source is used as the seed.
*
* @example <caption>Count the number of click events</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var ones = clicks.mapTo(1);
* var seed = 0;
* var count = ones.scan((acc, one) => acc + one, seed);
* count.subscribe(x => console.log(x));
*
* @see {@link expand}
* @see {@link mergeScan}
* @see {@link reduce}
*
* @param {function(acc: R, value: T, index: number): R} accumulator
* The accumulator function called on each source value.
* @param {T|R} [seed] The initial accumulation value.
* @return {Observable<R>} An observable of the accumulated values.
* @method scan
* @owner Observable
*/
function scan(accumulator, seed) {
var hasSeed = false;
// providing a seed of `undefined` *should* be valid and trigger
// hasSeed! so don't use `seed !== undefined` checks!
// For this reason, we have to check it here at the original call site
// otherwise inside Operator/Subscriber we won't know if `undefined`
// means they didn't provide anything or if they literally provided `undefined`
if (arguments.length >= 2) {
hasSeed = true;
}
return function scanOperatorFunction(source) {
return source.lift(new ScanOperator(accumulator, seed, hasSeed));
};
}
var ScanOperator = /*@__PURE__*/ (function () {
function ScanOperator(accumulator, seed, hasSeed) {
if (hasSeed === void 0) {
hasSeed = false;
}
this.accumulator = accumulator;
this.seed = seed;
this.hasSeed = hasSeed;
}
ScanOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));
};
return ScanOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var ScanSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ScanSubscriber, _super);
function ScanSubscriber(destination, accumulator, _seed, hasSeed) {
var _this = _super.call(this, destination) || this;
_this.accumulator = accumulator;
_this._seed = _seed;
_this.hasSeed = hasSeed;
_this.index = 0;
return _this;
}
Object.defineProperty(ScanSubscriber.prototype, "seed", {
get: function () {
return this._seed;
},
set: function (value) {
this.hasSeed = true;
this._seed = value;
},
enumerable: true,
configurable: true
});
ScanSubscriber.prototype._next = function (value) {
if (!this.hasSeed) {
this.seed = value;
this.destination.next(value);
}
else {
return this._tryNext(value);
}
};
ScanSubscriber.prototype._tryNext = function (value) {
var index = this.index++;
var result;
try {
result = this.accumulator(this.seed, value, index);
}
catch (err) {
this.destination.error(err);
}
this.seed = result;
this.destination.next(result);
};
return ScanSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=scan.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/sequenceEqual.js":
/*!*********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/sequenceEqual.js ***!
\*********************************************************************/
/*! exports provided: sequenceEqual, SequenceEqualOperator, SequenceEqualSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return sequenceEqual; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SequenceEqualOperator", function() { return SequenceEqualOperator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SequenceEqualSubscriber", function() { return SequenceEqualSubscriber; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/tryCatch */ "./node_modules/rxjs/_esm5/internal/util/tryCatch.js");
/* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/errorObject */ "./node_modules/rxjs/_esm5/internal/util/errorObject.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_util_tryCatch,_util_errorObject PURE_IMPORTS_END */
/**
* Compares all values of two observables in sequence using an optional comparor function
* and returns an observable of a single boolean value representing whether or not the two sequences
* are equal.
*
* <span class="informal">Checks to see of all values emitted by both observables are equal, in order.</span>
*
* <img src="./img/sequenceEqual.png" width="100%">
*
* `sequenceEqual` subscribes to two observables and buffers incoming values from each observable. Whenever either
* observable emits a value, the value is buffered and the buffers are shifted and compared from the bottom
* up; If any value pair doesn't match, the returned observable will emit `false` and complete. If one of the
* observables completes, the operator will wait for the other observable to complete; If the other
* observable emits before completing, the returned observable will emit `false` and complete. If one observable never
* completes or emits after the other complets, the returned observable will never complete.
*
* @example <caption>figure out if the Konami code matches</caption>
* var code = Rx.Observable.from([
* "ArrowUp",
* "ArrowUp",
* "ArrowDown",
* "ArrowDown",
* "ArrowLeft",
* "ArrowRight",
* "ArrowLeft",
* "ArrowRight",
* "KeyB",
* "KeyA",
* "Enter" // no start key, clearly.
* ]);
*
* var keys = Rx.Observable.fromEvent(document, 'keyup')
* .map(e => e.code);
* var matches = keys.bufferCount(11, 1)
* .mergeMap(
* last11 =>
* Rx.Observable.from(last11)
* .sequenceEqual(code)
* );
* matches.subscribe(matched => console.log('Successful cheat at Contra? ', matched));
*
* @see {@link combineLatest}
* @see {@link zip}
* @see {@link withLatestFrom}
*
* @param {Observable} compareTo The observable sequence to compare the source sequence to.
* @param {function} [comparor] An optional function to compare each value pair
* @return {Observable} An Observable of a single boolean value representing whether or not
* the values emitted by both observables were equal in sequence.
* @method sequenceEqual
* @owner Observable
*/
function sequenceEqual(compareTo, comparor) {
return function (source) { return source.lift(new SequenceEqualOperator(compareTo, comparor)); };
}
var SequenceEqualOperator = /*@__PURE__*/ (function () {
function SequenceEqualOperator(compareTo, comparor) {
this.compareTo = compareTo;
this.comparor = comparor;
}
SequenceEqualOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparor));
};
return SequenceEqualOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SequenceEqualSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SequenceEqualSubscriber, _super);
function SequenceEqualSubscriber(destination, compareTo, comparor) {
var _this = _super.call(this, destination) || this;
_this.compareTo = compareTo;
_this.comparor = comparor;
_this._a = [];
_this._b = [];
_this._oneComplete = false;
_this.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, _this)));
return _this;
}
SequenceEqualSubscriber.prototype._next = function (value) {
if (this._oneComplete && this._b.length === 0) {
this.emit(false);
}
else {
this._a.push(value);
this.checkValues();
}
};
SequenceEqualSubscriber.prototype._complete = function () {
if (this._oneComplete) {
this.emit(this._a.length === 0 && this._b.length === 0);
}
else {
this._oneComplete = true;
}
};
SequenceEqualSubscriber.prototype.checkValues = function () {
var _c = this, _a = _c._a, _b = _c._b, comparor = _c.comparor;
while (_a.length > 0 && _b.length > 0) {
var a = _a.shift();
var b = _b.shift();
var areEqual = false;
if (comparor) {
areEqual = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(comparor)(a, b);
if (areEqual === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) {
this.destination.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"].e);
}
}
else {
areEqual = a === b;
}
if (!areEqual) {
this.emit(false);
}
}
};
SequenceEqualSubscriber.prototype.emit = function (value) {
var destination = this.destination;
destination.next(value);
destination.complete();
};
SequenceEqualSubscriber.prototype.nextB = function (value) {
if (this._oneComplete && this._a.length === 0) {
this.emit(false);
}
else {
this._b.push(value);
this.checkValues();
}
};
return SequenceEqualSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
var SequenceEqualCompareToSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SequenceEqualCompareToSubscriber, _super);
function SequenceEqualCompareToSubscriber(destination, parent) {
var _this = _super.call(this, destination) || this;
_this.parent = parent;
return _this;
}
SequenceEqualCompareToSubscriber.prototype._next = function (value) {
this.parent.nextB(value);
};
SequenceEqualCompareToSubscriber.prototype._error = function (err) {
this.parent.error(err);
};
SequenceEqualCompareToSubscriber.prototype._complete = function () {
this.parent._complete();
};
return SequenceEqualCompareToSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=sequenceEqual.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/share.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/share.js ***!
\*************************************************************/
/*! exports provided: share */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "share", function() { return share; });
/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./multicast */ "./node_modules/rxjs/_esm5/internal/operators/multicast.js");
/* harmony import */ var _refCount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./refCount */ "./node_modules/rxjs/_esm5/internal/operators/refCount.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/** PURE_IMPORTS_START _multicast,_refCount,_Subject PURE_IMPORTS_END */
function shareSubjectFactory() {
return new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
}
/**
* Returns a new Observable that multicasts (shares) the original Observable. As long as there is at least one
* Subscriber this Observable will be subscribed and emitting data. When all subscribers have unsubscribed it will
* unsubscribe from the source Observable. Because the Observable is multicasting it makes the stream `hot`.
* This is an alias for .multicast(() => new Subject()).refCount().
*
* <img src="./img/share.png" width="100%">
*
* @return {Observable<T>} An Observable that upon connection causes the source Observable to emit items to its Observers.
* @method share
* @owner Observable
*/
function share() {
return function (source) { return Object(_refCount__WEBPACK_IMPORTED_MODULE_1__["refCount"])()(Object(_multicast__WEBPACK_IMPORTED_MODULE_0__["multicast"])(shareSubjectFactory)(source)); };
}
//# sourceMappingURL=share.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/shareReplay.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/shareReplay.js ***!
\*******************************************************************/
/*! exports provided: shareReplay */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return shareReplay; });
/* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ReplaySubject */ "./node_modules/rxjs/_esm5/internal/ReplaySubject.js");
/** PURE_IMPORTS_START _ReplaySubject PURE_IMPORTS_END */
/**
* @method shareReplay
* @owner Observable
*/
function shareReplay(bufferSize, windowTime, scheduler) {
return function (source) { return source.lift(shareReplayOperator(bufferSize, windowTime, scheduler)); };
}
function shareReplayOperator(bufferSize, windowTime, scheduler) {
var subject;
var refCount = 0;
var subscription;
var hasError = false;
var isComplete = false;
return function shareReplayOperation(source) {
refCount++;
if (!subject || hasError) {
hasError = false;
subject = new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"](bufferSize, windowTime, scheduler);
subscription = source.subscribe({
next: function (value) { subject.next(value); },
error: function (err) {
hasError = true;
subject.error(err);
},
complete: function () {
isComplete = true;
subject.complete();
},
});
}
var innerSub = subject.subscribe(this);
return function () {
refCount--;
innerSub.unsubscribe();
if (subscription && refCount === 0 && isComplete) {
subscription.unsubscribe();
}
};
};
}
//# sourceMappingURL=shareReplay.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/single.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/single.js ***!
\**************************************************************/
/*! exports provided: single */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "single", function() { return single; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/EmptyError */ "./node_modules/rxjs/_esm5/internal/util/EmptyError.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_util_EmptyError PURE_IMPORTS_END */
/**
* Returns an Observable that emits the single item emitted by the source Observable that matches a specified
* predicate, if that Observable emits one such item. If the source Observable emits more than one such item or no
* items, notify of an IllegalArgumentException or NoSuchElementException respectively. If the source Observable
* emits items but none match the specified predicate then `undefined` is emiited.
*
* <img src="./img/single.png" width="100%">
*
* @throws {EmptyError} Delivers an EmptyError to the Observer's `error`
* callback if the Observable completes before any `next` notification was sent.
* @param {Function} predicate - A predicate function to evaluate items emitted by the source Observable.
* @return {Observable<T>} An Observable that emits the single item emitted by the source Observable that matches
* the predicate or `undefined` when no items match.
*
* @method single
* @owner Observable
*/
function single(predicate) {
return function (source) { return source.lift(new SingleOperator(predicate, source)); };
}
var SingleOperator = /*@__PURE__*/ (function () {
function SingleOperator(predicate, source) {
this.predicate = predicate;
this.source = source;
}
SingleOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new SingleSubscriber(subscriber, this.predicate, this.source));
};
return SingleOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SingleSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SingleSubscriber, _super);
function SingleSubscriber(destination, predicate, source) {
var _this = _super.call(this, destination) || this;
_this.predicate = predicate;
_this.source = source;
_this.seenValue = false;
_this.index = 0;
return _this;
}
SingleSubscriber.prototype.applySingleValue = function (value) {
if (this.seenValue) {
this.destination.error('Sequence contains more than one element');
}
else {
this.seenValue = true;
this.singleValue = value;
}
};
SingleSubscriber.prototype._next = function (value) {
var index = this.index++;
if (this.predicate) {
this.tryNext(value, index);
}
else {
this.applySingleValue(value);
}
};
SingleSubscriber.prototype.tryNext = function (value, index) {
try {
if (this.predicate(value, index, this.source)) {
this.applySingleValue(value);
}
}
catch (err) {
this.destination.error(err);
}
};
SingleSubscriber.prototype._complete = function () {
var destination = this.destination;
if (this.index > 0) {
destination.next(this.seenValue ? this.singleValue : undefined);
destination.complete();
}
else {
destination.error(new _util_EmptyError__WEBPACK_IMPORTED_MODULE_2__["EmptyError"]);
}
};
return SingleSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=single.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/skip.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/skip.js ***!
\************************************************************/
/*! exports provided: skip */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return skip; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Returns an Observable that skips the first `count` items emitted by the source Observable.
*
* <img src="./img/skip.png" width="100%">
*
* @param {Number} count - The number of times, items emitted by source Observable should be skipped.
* @return {Observable} An Observable that skips values emitted by the source Observable.
*
* @method skip
* @owner Observable
*/
function skip(count) {
return function (source) { return source.lift(new SkipOperator(count)); };
}
var SkipOperator = /*@__PURE__*/ (function () {
function SkipOperator(total) {
this.total = total;
}
SkipOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new SkipSubscriber(subscriber, this.total));
};
return SkipOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SkipSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipSubscriber, _super);
function SkipSubscriber(destination, total) {
var _this = _super.call(this, destination) || this;
_this.total = total;
_this.count = 0;
return _this;
}
SkipSubscriber.prototype._next = function (x) {
if (++this.count > this.total) {
this.destination.next(x);
}
};
return SkipSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=skip.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/skipLast.js":
/*!****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/skipLast.js ***!
\****************************************************************/
/*! exports provided: skipLast */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return skipLast; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ "./node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError PURE_IMPORTS_END */
/**
* Skip the last `count` values emitted by the source Observable.
*
* <img src="./img/skipLast.png" width="100%">
*
* `skipLast` returns an Observable that accumulates a queue with a length
* enough to store the first `count` values. As more values are received,
* values are taken from the front of the queue and produced on the result
* sequence. This causes values to be delayed.
*
* @example <caption>Skip the last 2 values of an Observable with many values</caption>
* var many = Rx.Observable.range(1, 5);
* var skipLastTwo = many.skipLast(2);
* skipLastTwo.subscribe(x => console.log(x));
*
* // Results in:
* // 1 2 3
*
* @see {@link skip}
* @see {@link skipUntil}
* @see {@link skipWhile}
* @see {@link take}
*
* @throws {ArgumentOutOfRangeError} When using `skipLast(i)`, it throws
* ArgumentOutOrRangeError if `i < 0`.
*
* @param {number} count Number of elements to skip from the end of the source Observable.
* @returns {Observable<T>} An Observable that skips the last count values
* emitted by the source Observable.
* @method skipLast
* @owner Observable
*/
function skipLast(count) {
return function (source) { return source.lift(new SkipLastOperator(count)); };
}
var SkipLastOperator = /*@__PURE__*/ (function () {
function SkipLastOperator(_skipCount) {
this._skipCount = _skipCount;
if (this._skipCount < 0) {
throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__["ArgumentOutOfRangeError"];
}
}
SkipLastOperator.prototype.call = function (subscriber, source) {
if (this._skipCount === 0) {
// If we don't want to skip any values then just subscribe
// to Subscriber without any further logic.
return source.subscribe(new _Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"](subscriber));
}
else {
return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount));
}
};
return SkipLastOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SkipLastSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipLastSubscriber, _super);
function SkipLastSubscriber(destination, _skipCount) {
var _this = _super.call(this, destination) || this;
_this._skipCount = _skipCount;
_this._count = 0;
_this._ring = new Array(_skipCount);
return _this;
}
SkipLastSubscriber.prototype._next = function (value) {
var skipCount = this._skipCount;
var count = this._count++;
if (count < skipCount) {
this._ring[count] = value;
}
else {
var currentIndex = count % skipCount;
var ring = this._ring;
var oldValue = ring[currentIndex];
ring[currentIndex] = value;
this.destination.next(oldValue);
}
};
return SkipLastSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=skipLast.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/skipUntil.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/skipUntil.js ***!
\*****************************************************************/
/*! exports provided: skipUntil */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return skipUntil; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item.
*
* <img src="./img/skipUntil.png" width="100%">
*
* @param {Observable} notifier - The second Observable that has to emit an item before the source Observable's elements begin to
* be mirrored by the resulting Observable.
* @return {Observable<T>} An Observable that skips items from the source Observable until the second Observable emits
* an item, then emits the remaining items.
* @method skipUntil
* @owner Observable
*/
function skipUntil(notifier) {
return function (source) { return source.lift(new SkipUntilOperator(notifier)); };
}
var SkipUntilOperator = /*@__PURE__*/ (function () {
function SkipUntilOperator(notifier) {
this.notifier = notifier;
}
SkipUntilOperator.prototype.call = function (destination, source) {
return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
};
return SkipUntilOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SkipUntilSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipUntilSubscriber, _super);
function SkipUntilSubscriber(destination, notifier) {
var _this = _super.call(this, destination) || this;
_this.hasValue = false;
_this.add(_this.innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, notifier));
return _this;
}
SkipUntilSubscriber.prototype._next = function (value) {
if (this.hasValue) {
_super.prototype._next.call(this, value);
}
};
SkipUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.hasValue = true;
this.innerSubscription.unsubscribe();
};
SkipUntilSubscriber.prototype.notifyComplete = function () {
/* do nothing */
};
return SkipUntilSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
//# sourceMappingURL=skipUntil.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/skipWhile.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/skipWhile.js ***!
\*****************************************************************/
/*! exports provided: skipWhile */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return skipWhile; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Returns an Observable that skips all items emitted by the source Observable as long as a specified condition holds
* true, but emits all further source items as soon as the condition becomes false.
*
* <img src="./img/skipWhile.png" width="100%">
*
* @param {Function} predicate - A function to test each item emitted from the source Observable.
* @return {Observable<T>} An Observable that begins emitting items emitted by the source Observable when the
* specified predicate becomes false.
* @method skipWhile
* @owner Observable
*/
function skipWhile(predicate) {
return function (source) { return source.lift(new SkipWhileOperator(predicate)); };
}
var SkipWhileOperator = /*@__PURE__*/ (function () {
function SkipWhileOperator(predicate) {
this.predicate = predicate;
}
SkipWhileOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));
};
return SkipWhileOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SkipWhileSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipWhileSubscriber, _super);
function SkipWhileSubscriber(destination, predicate) {
var _this = _super.call(this, destination) || this;
_this.predicate = predicate;
_this.skipping = true;
_this.index = 0;
return _this;
}
SkipWhileSubscriber.prototype._next = function (value) {
var destination = this.destination;
if (this.skipping) {
this.tryCallPredicate(value);
}
if (!this.skipping) {
destination.next(value);
}
};
SkipWhileSubscriber.prototype.tryCallPredicate = function (value) {
try {
var result = this.predicate(value, this.index++);
this.skipping = Boolean(result);
}
catch (err) {
this.destination.error(err);
}
};
return SkipWhileSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=skipWhile.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/startWith.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/startWith.js ***!
\*****************************************************************/
/*! exports provided: startWith */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return startWith; });
/* harmony import */ var _observable_fromArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/fromArray */ "./node_modules/rxjs/_esm5/internal/observable/fromArray.js");
/* harmony import */ var _observable_scalar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/scalar */ "./node_modules/rxjs/_esm5/internal/observable/scalar.js");
/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/empty */ "./node_modules/rxjs/_esm5/internal/observable/empty.js");
/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../observable/concat */ "./node_modules/rxjs/_esm5/internal/observable/concat.js");
/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm5/internal/util/isScheduler.js");
/** PURE_IMPORTS_START _observable_fromArray,_observable_scalar,_observable_empty,_observable_concat,_util_isScheduler PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Returns an Observable that emits the items you specify as arguments before it begins to emit
* items emitted by the source Observable.
*
* <img src="./img/startWith.png" width="100%">
*
* @param {...T} values - Items you want the modified Observable to emit first.
* @param {Scheduler} [scheduler] - A {@link IScheduler} to use for scheduling
* the emissions of the `next` notifications.
* @return {Observable} An Observable that emits the items in the specified Iterable and then emits the items
* emitted by the source Observable.
* @method startWith
* @owner Observable
*/
function startWith() {
var array = [];
for (var _i = 0; _i < arguments.length; _i++) {
array[_i] = arguments[_i];
}
return function (source) {
var scheduler = array[array.length - 1];
if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(scheduler)) {
array.pop();
}
else {
scheduler = null;
}
var len = array.length;
if (len === 1 && !scheduler) {
return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_3__["concat"])(Object(_observable_scalar__WEBPACK_IMPORTED_MODULE_1__["scalar"])(array[0]), source);
}
else if (len > 0) {
return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_3__["concat"])(Object(_observable_fromArray__WEBPACK_IMPORTED_MODULE_0__["fromArray"])(array, scheduler), source);
}
else {
return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_3__["concat"])(Object(_observable_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])(scheduler), source);
}
};
}
//# sourceMappingURL=startWith.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/subscribeOn.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/subscribeOn.js ***!
\*******************************************************************/
/*! exports provided: subscribeOn */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return subscribeOn; });
/* harmony import */ var _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/SubscribeOnObservable */ "./node_modules/rxjs/_esm5/internal/observable/SubscribeOnObservable.js");
/** PURE_IMPORTS_START _observable_SubscribeOnObservable PURE_IMPORTS_END */
/**
* Asynchronously subscribes Observers to this Observable on the specified IScheduler.
*
* <img src="./img/subscribeOn.png" width="100%">
*
* @param {Scheduler} scheduler - The IScheduler to perform subscription actions on.
* @return {Observable<T>} The source Observable modified so that its subscriptions happen on the specified IScheduler.
.
* @method subscribeOn
* @owner Observable
*/
function subscribeOn(scheduler, delay) {
if (delay === void 0) {
delay = 0;
}
return function subscribeOnOperatorFunction(source) {
return source.lift(new SubscribeOnOperator(scheduler, delay));
};
}
var SubscribeOnOperator = /*@__PURE__*/ (function () {
function SubscribeOnOperator(scheduler, delay) {
this.scheduler = scheduler;
this.delay = delay;
}
SubscribeOnOperator.prototype.call = function (subscriber, source) {
return new _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__["SubscribeOnObservable"](source, this.delay, this.scheduler).subscribe(subscriber);
};
return SubscribeOnOperator;
}());
//# sourceMappingURL=subscribeOn.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/switchAll.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/switchAll.js ***!
\*****************************************************************/
/*! exports provided: switchAll */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return switchAll; });
/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./switchMap */ "./node_modules/rxjs/_esm5/internal/operators/switchMap.js");
/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ "./node_modules/rxjs/_esm5/internal/util/identity.js");
/** PURE_IMPORTS_START _switchMap,_util_identity PURE_IMPORTS_END */
function switchAll() {
return Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(_util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"]);
}
//# sourceMappingURL=switchAll.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/switchMap.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/switchMap.js ***!
\*****************************************************************/
/*! exports provided: switchMap */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return switchMap; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./map */ "./node_modules/rxjs/_esm5/internal/operators/map.js");
/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../observable/from */ "./node_modules/rxjs/_esm5/internal/observable/from.js");
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Projects each source value to an Observable which is merged in the output
* Observable, emitting values only from the most recently projected Observable.
*
* <span class="informal">Maps each value to an Observable, then flattens all of
* these inner Observables using {@link switch}.</span>
*
* <img src="./img/switchMap.png" width="100%">
*
* Returns an Observable that emits items based on applying a function that you
* supply to each item emitted by the source Observable, where that function
* returns an (so-called "inner") Observable. Each time it observes one of these
* inner Observables, the output Observable begins emitting the items emitted by
* that inner Observable. When a new inner Observable is emitted, `switchMap`
* stops emitting items from the earlier-emitted inner Observable and begins
* emitting items from the new one. It continues to behave like this for
* subsequent inner Observables.
*
* @example <caption>Rerun an interval Observable on every click event</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.switchMap((ev) => Rx.Observable.interval(1000));
* result.subscribe(x => console.log(x));
*
* @see {@link concatMap}
* @see {@link exhaustMap}
* @see {@link mergeMap}
* @see {@link switch}
* @see {@link switchMapTo}
*
* @param {function(value: T, ?index: number): ObservableInput} project A function
* that, when applied to an item emitted by the source Observable, returns an
* Observable.
* @return {Observable} An Observable that emits the result of applying the
* projection function (and the optional `resultSelector`) to each item emitted
* by the source Observable and taking only the values from the most recently
* projected inner Observable.
* @method switchMap
* @owner Observable
*/
function switchMap(project, resultSelector) {
if (typeof resultSelector === 'function') {
return function (source) { return source.pipe(switchMap(function (a, i) { return Object(_observable_from__WEBPACK_IMPORTED_MODULE_4__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };
}
return function (source) { return source.lift(new SwitchMapOperator(project)); };
}
var SwitchMapOperator = /*@__PURE__*/ (function () {
function SwitchMapOperator(project) {
this.project = project;
}
SwitchMapOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));
};
return SwitchMapOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var SwitchMapSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SwitchMapSubscriber, _super);
function SwitchMapSubscriber(destination, project) {
var _this = _super.call(this, destination) || this;
_this.project = project;
_this.index = 0;
return _this;
}
SwitchMapSubscriber.prototype._next = function (value) {
var result;
var index = this.index++;
try {
result = this.project(value, index);
}
catch (error) {
this.destination.error(error);
return;
}
this._innerSub(result, value, index);
};
SwitchMapSubscriber.prototype._innerSub = function (result, value, index) {
var innerSubscription = this.innerSubscription;
if (innerSubscription) {
innerSubscription.unsubscribe();
}
this.add(this.innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, result, value, index));
};
SwitchMapSubscriber.prototype._complete = function () {
var innerSubscription = this.innerSubscription;
if (!innerSubscription || innerSubscription.closed) {
_super.prototype._complete.call(this);
}
};
SwitchMapSubscriber.prototype._unsubscribe = function () {
this.innerSubscription = null;
};
SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) {
this.remove(innerSub);
this.innerSubscription = null;
if (this.isStopped) {
_super.prototype._complete.call(this);
}
};
SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.destination.next(innerValue);
};
return SwitchMapSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
//# sourceMappingURL=switchMap.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/switchMapTo.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/switchMapTo.js ***!
\*******************************************************************/
/*! exports provided: switchMapTo */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return switchMapTo; });
/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./switchMap */ "./node_modules/rxjs/_esm5/internal/operators/switchMap.js");
/** PURE_IMPORTS_START _switchMap PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Projects each source value to the same Observable which is flattened multiple
* times with {@link switch} in the output Observable.
*
* <span class="informal">It's like {@link switchMap}, but maps each value
* always to the same inner Observable.</span>
*
* <img src="./img/switchMapTo.png" width="100%">
*
* Maps each source value to the given Observable `innerObservable` regardless
* of the source value, and then flattens those resulting Observables into one
* single Observable, which is the output Observable. The output Observables
* emits values only from the most recently emitted instance of
* `innerObservable`.
*
* @example <caption>Rerun an interval Observable on every click event</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.switchMapTo(Rx.Observable.interval(1000));
* result.subscribe(x => console.log(x));
*
* @see {@link concatMapTo}
* @see {@link switch}
* @see {@link switchMap}
* @see {@link mergeMapTo}
*
* @param {ObservableInput} innerObservable An Observable to replace each value from
* the source Observable.
* @return {Observable} An Observable that emits items from the given
* `innerObservable` (and optionally transformed through `resultSelector`) every
* time a value is emitted on the source Observable, and taking only the values
* from the most recently projected inner Observable.
* @method switchMapTo
* @owner Observable
*/
function switchMapTo(innerObservable, resultSelector) {
return resultSelector ? Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(function () { return innerObservable; }, resultSelector) : Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(function () { return innerObservable; });
}
//# sourceMappingURL=switchMapTo.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/take.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/take.js ***!
\************************************************************/
/*! exports provided: take */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return take; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ "./node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js");
/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../observable/empty */ "./node_modules/rxjs/_esm5/internal/observable/empty.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */
/**
* Emits only the first `count` values emitted by the source Observable.
*
* <span class="informal">Takes the first `count` values from the source, then
* completes.</span>
*
* <img src="./img/take.png" width="100%">
*
* `take` returns an Observable that emits only the first `count` values emitted
* by the source Observable. If the source emits fewer than `count` values then
* all of its values are emitted. After that, it completes, regardless if the
* source completes.
*
* @example <caption>Take the first 5 seconds of an infinite 1-second interval Observable</caption>
* var interval = Rx.Observable.interval(1000);
* var five = interval.take(5);
* five.subscribe(x => console.log(x));
*
* @see {@link takeLast}
* @see {@link takeUntil}
* @see {@link takeWhile}
* @see {@link skip}
*
* @throws {ArgumentOutOfRangeError} When using `take(i)`, it delivers an
* ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.
*
* @param {number} count The maximum number of `next` values to emit.
* @return {Observable<T>} An Observable that emits only the first `count`
* values emitted by the source Observable, or all of the values from the source
* if the source emits fewer than `count` values.
* @method take
* @owner Observable
*/
function take(count) {
return function (source) {
if (count === 0) {
return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_3__["empty"])();
}
else {
return source.lift(new TakeOperator(count));
}
};
}
var TakeOperator = /*@__PURE__*/ (function () {
function TakeOperator(total) {
this.total = total;
if (this.total < 0) {
throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__["ArgumentOutOfRangeError"];
}
}
TakeOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new TakeSubscriber(subscriber, this.total));
};
return TakeOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var TakeSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeSubscriber, _super);
function TakeSubscriber(destination, total) {
var _this = _super.call(this, destination) || this;
_this.total = total;
_this.count = 0;
return _this;
}
TakeSubscriber.prototype._next = function (value) {
var total = this.total;
var count = ++this.count;
if (count <= total) {
this.destination.next(value);
if (count === total) {
this.destination.complete();
this.unsubscribe();
}
}
};
return TakeSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=take.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/takeLast.js":
/*!****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/takeLast.js ***!
\****************************************************************/
/*! exports provided: takeLast */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return takeLast; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ "./node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js");
/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../observable/empty */ "./node_modules/rxjs/_esm5/internal/observable/empty.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */
/**
* Emits only the last `count` values emitted by the source Observable.
*
* <span class="informal">Remembers the latest `count` values, then emits those
* only when the source completes.</span>
*
* <img src="./img/takeLast.png" width="100%">
*
* `takeLast` returns an Observable that emits at most the last `count` values
* emitted by the source Observable. If the source emits fewer than `count`
* values then all of its values are emitted. This operator must wait until the
* `complete` notification emission from the source in order to emit the `next`
* values on the output Observable, because otherwise it is impossible to know
* whether or not more values will be emitted on the source. For this reason,
* all values are emitted synchronously, followed by the complete notification.
*
* @example <caption>Take the last 3 values of an Observable with many values</caption>
* var many = Rx.Observable.range(1, 100);
* var lastThree = many.pipe(takeLast(3));
* lastThree.subscribe(x => console.log(x));
*
* @see {@link take}
* @see {@link takeUntil}
* @see {@link takeWhile}
* @see {@link skip}
*
* @throws {ArgumentOutOfRangeError} When using `takeLast(i)`, it delivers an
* ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.
*
* @param {number} count The maximum number of values to emit from the end of
* the sequence of values emitted by the source Observable.
* @return {Observable<T>} An Observable that emits at most the last count
* values emitted by the source Observable.
* @method takeLast
* @owner Observable
*/
function takeLast(count) {
return function takeLastOperatorFunction(source) {
if (count === 0) {
return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_3__["empty"])();
}
else {
return source.lift(new TakeLastOperator(count));
}
};
}
var TakeLastOperator = /*@__PURE__*/ (function () {
function TakeLastOperator(total) {
this.total = total;
if (this.total < 0) {
throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__["ArgumentOutOfRangeError"];
}
}
TakeLastOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new TakeLastSubscriber(subscriber, this.total));
};
return TakeLastOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var TakeLastSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeLastSubscriber, _super);
function TakeLastSubscriber(destination, total) {
var _this = _super.call(this, destination) || this;
_this.total = total;
_this.ring = new Array();
_this.count = 0;
return _this;
}
TakeLastSubscriber.prototype._next = function (value) {
var ring = this.ring;
var total = this.total;
var count = this.count++;
if (ring.length < total) {
ring.push(value);
}
else {
var index = count % total;
ring[index] = value;
}
};
TakeLastSubscriber.prototype._complete = function () {
var destination = this.destination;
var count = this.count;
if (count > 0) {
var total = this.count >= this.total ? this.total : this.count;
var ring = this.ring;
for (var i = 0; i < total; i++) {
var idx = (count++) % total;
destination.next(ring[idx]);
}
}
destination.complete();
};
return TakeLastSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=takeLast.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/takeUntil.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/takeUntil.js ***!
\*****************************************************************/
/*! exports provided: takeUntil */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return takeUntil; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Emits the values emitted by the source Observable until a `notifier`
* Observable emits a value.
*
* <span class="informal">Lets values pass until a second Observable,
* `notifier`, emits a value. Then, it completes.</span>
*
* <img src="./img/takeUntil.png" width="100%">
*
* `takeUntil` subscribes and begins mirroring the source Observable. It also
* monitors a second Observable, `notifier` that you provide. If the `notifier`
* emits a value, the output Observable stops mirroring the source Observable
* and completes. If the `notifier` doesn't emit any value and completes
* then `takeUntil` will pass all values.
*
* @example <caption>Tick every second until the first click happens</caption>
* var interval = Rx.Observable.interval(1000);
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = interval.takeUntil(clicks);
* result.subscribe(x => console.log(x));
*
* @see {@link take}
* @see {@link takeLast}
* @see {@link takeWhile}
* @see {@link skip}
*
* @param {Observable} notifier The Observable whose first emitted value will
* cause the output Observable of `takeUntil` to stop emitting values from the
* source Observable.
* @return {Observable<T>} An Observable that emits the values from the source
* Observable until such time as `notifier` emits its first value.
* @method takeUntil
* @owner Observable
*/
function takeUntil(notifier) {
return function (source) { return source.lift(new TakeUntilOperator(notifier)); };
}
var TakeUntilOperator = /*@__PURE__*/ (function () {
function TakeUntilOperator(notifier) {
this.notifier = notifier;
}
TakeUntilOperator.prototype.call = function (subscriber, source) {
var takeUntilSubscriber = new TakeUntilSubscriber(subscriber);
var notifierSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(takeUntilSubscriber, this.notifier);
if (notifierSubscription && !notifierSubscription.closed) {
takeUntilSubscriber.add(notifierSubscription);
return source.subscribe(takeUntilSubscriber);
}
return takeUntilSubscriber;
};
return TakeUntilOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var TakeUntilSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeUntilSubscriber, _super);
function TakeUntilSubscriber(destination) {
return _super.call(this, destination) || this;
}
TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.complete();
};
TakeUntilSubscriber.prototype.notifyComplete = function () {
// noop
};
return TakeUntilSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
//# sourceMappingURL=takeUntil.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/takeWhile.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/takeWhile.js ***!
\*****************************************************************/
/*! exports provided: takeWhile */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return takeWhile; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
/**
* Emits values emitted by the source Observable so long as each value satisfies
* the given `predicate`, and then completes as soon as this `predicate` is not
* satisfied.
*
* <span class="informal">Takes values from the source only while they pass the
* condition given. When the first value does not satisfy, it completes.</span>
*
* <img src="./img/takeWhile.png" width="100%">
*
* `takeWhile` subscribes and begins mirroring the source Observable. Each value
* emitted on the source is given to the `predicate` function which returns a
* boolean, representing a condition to be satisfied by the source values. The
* output Observable emits the source values until such time as the `predicate`
* returns false, at which point `takeWhile` stops mirroring the source
* Observable and completes the output Observable.
*
* @example <caption>Emit click events only while the clientX property is greater than 200</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.takeWhile(ev => ev.clientX > 200);
* result.subscribe(x => console.log(x));
*
* @see {@link take}
* @see {@link takeLast}
* @see {@link takeUntil}
* @see {@link skip}
*
* @param {function(value: T, index: number): boolean} predicate A function that
* evaluates a value emitted by the source Observable and returns a boolean.
* Also takes the (zero-based) index as the second argument.
* @return {Observable<T>} An Observable that emits the values from the source
* Observable so long as each value satisfies the condition defined by the
* `predicate`, then completes.
* @method takeWhile
* @owner Observable
*/
function takeWhile(predicate) {
return function (source) { return source.lift(new TakeWhileOperator(predicate)); };
}
var TakeWhileOperator = /*@__PURE__*/ (function () {
function TakeWhileOperator(predicate) {
this.predicate = predicate;
}
TakeWhileOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate));
};
return TakeWhileOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var TakeWhileSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeWhileSubscriber, _super);
function TakeWhileSubscriber(destination, predicate) {
var _this = _super.call(this, destination) || this;
_this.predicate = predicate;
_this.index = 0;
return _this;
}
TakeWhileSubscriber.prototype._next = function (value) {
var destination = this.destination;
var result;
try {
result = this.predicate(value, this.index++);
}
catch (err) {
destination.error(err);
return;
}
this.nextOrComplete(value, result);
};
TakeWhileSubscriber.prototype.nextOrComplete = function (value, predicateResult) {
var destination = this.destination;
if (Boolean(predicateResult)) {
destination.next(value);
}
else {
destination.complete();
}
};
return TakeWhileSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=takeWhile.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/tap.js":
/*!***********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/tap.js ***!
\***********************************************************/
/*! exports provided: tap */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return tap; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/noop */ "./node_modules/rxjs/_esm5/internal/util/noop.js");
/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isFunction */ "./node_modules/rxjs/_esm5/internal/util/isFunction.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_util_noop,_util_isFunction PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Perform a side effect for every emission on the source Observable, but return
* an Observable that is identical to the source.
*
* <span class="informal">Intercepts each emission on the source and runs a
* function, but returns an output which is identical to the source as long as errors don't occur.</span>
*
* <img src="./img/do.png" width="100%">
*
* Returns a mirrored Observable of the source Observable, but modified so that
* the provided Observer is called to perform a side effect for every value,
* error, and completion emitted by the source. Any errors that are thrown in
* the aforementioned Observer or handlers are safely sent down the error path
* of the output Observable.
*
* This operator is useful for debugging your Observables for the correct values
* or performing other side effects.
*
* Note: this is different to a `subscribe` on the Observable. If the Observable
* returned by `do` is not subscribed, the side effects specified by the
* Observer will never happen. `do` therefore simply spies on existing
* execution, it does not trigger an execution to happen like `subscribe` does.
*
* @example <caption>Map every click to the clientX position of that click, while also logging the click event</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var positions = clicks
* .do(ev => console.log(ev))
* .map(ev => ev.clientX);
* positions.subscribe(x => console.log(x));
*
* @see {@link map}
* @see {@link subscribe}
*
* @param {Observer|function} [nextOrObserver] A normal Observer object or a
* callback for `next`.
* @param {function} [error] Callback for errors in the source.
* @param {function} [complete] Callback for the completion of the source.
* @return {Observable} An Observable identical to the source, but runs the
* specified Observer or callback(s) for each item.
* @name tap
*/
function tap(nextOrObserver, error, complete) {
return function tapOperatorFunction(source) {
return source.lift(new DoOperator(nextOrObserver, error, complete));
};
}
var DoOperator = /*@__PURE__*/ (function () {
function DoOperator(nextOrObserver, error, complete) {
this.nextOrObserver = nextOrObserver;
this.error = error;
this.complete = complete;
}
DoOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));
};
return DoOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var TapSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TapSubscriber, _super);
function TapSubscriber(destination, observerOrNext, error, complete) {
var _this = _super.call(this, destination) || this;
_this._tapNext = _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
_this._tapError = _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
_this._tapComplete = _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
_this._tapError = error || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
_this._tapComplete = complete || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_3__["isFunction"])(observerOrNext)) {
_this._context = _this;
_this._tapNext = observerOrNext;
}
else if (observerOrNext) {
_this._context = observerOrNext;
_this._tapNext = observerOrNext.next || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
_this._tapError = observerOrNext.error || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
_this._tapComplete = observerOrNext.complete || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
}
return _this;
}
TapSubscriber.prototype._next = function (value) {
try {
this._tapNext.call(this._context, value);
}
catch (err) {
this.destination.error(err);
return;
}
this.destination.next(value);
};
TapSubscriber.prototype._error = function (err) {
try {
this._tapError.call(this._context, err);
}
catch (err) {
this.destination.error(err);
return;
}
this.destination.error(err);
};
TapSubscriber.prototype._complete = function () {
try {
this._tapComplete.call(this._context);
}
catch (err) {
this.destination.error(err);
return;
}
return this.destination.complete();
};
return TapSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=tap.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/throttle.js":
/*!****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/throttle.js ***!
\****************************************************************/
/*! exports provided: defaultThrottleConfig, throttle */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultThrottleConfig", function() { return defaultThrottleConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return throttle; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
var defaultThrottleConfig = {
leading: true,
trailing: false
};
/**
* Emits a value from the source Observable, then ignores subsequent source
* values for a duration determined by another Observable, then repeats this
* process.
*
* <span class="informal">It's like {@link throttleTime}, but the silencing
* duration is determined by a second Observable.</span>
*
* <img src="./img/throttle.png" width="100%">
*
* `throttle` emits the source Observable values on the output Observable
* when its internal timer is disabled, and ignores source values when the timer
* is enabled. Initially, the timer is disabled. As soon as the first source
* value arrives, it is forwarded to the output Observable, and then the timer
* is enabled by calling the `durationSelector` function with the source value,
* which returns the "duration" Observable. When the duration Observable emits a
* value or completes, the timer is disabled, and this process repeats for the
* next source value.
*
* @example <caption>Emit clicks at a rate of at most one click per second</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.throttle(ev => Rx.Observable.interval(1000));
* result.subscribe(x => console.log(x));
*
* @see {@link audit}
* @see {@link debounce}
* @see {@link delayWhen}
* @see {@link sample}
* @see {@link throttleTime}
*
* @param {function(value: T): SubscribableOrPromise} durationSelector A function
* that receives a value from the source Observable, for computing the silencing
* duration for each source value, returned as an Observable or a Promise.
* @param {Object} config a configuration object to define `leading` and `trailing` behavior. Defaults
* to `{ leading: true, trailing: false }`.
* @return {Observable<T>} An Observable that performs the throttle operation to
* limit the rate of emissions from the source.
* @method throttle
* @owner Observable
*/
function throttle(durationSelector, config) {
if (config === void 0) {
config = defaultThrottleConfig;
}
return function (source) { return source.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing)); };
}
var ThrottleOperator = /*@__PURE__*/ (function () {
function ThrottleOperator(durationSelector, leading, trailing) {
this.durationSelector = durationSelector;
this.leading = leading;
this.trailing = trailing;
}
ThrottleOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing));
};
return ThrottleOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc
* @ignore
* @extends {Ignored}
*/
var ThrottleSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ThrottleSubscriber, _super);
function ThrottleSubscriber(destination, durationSelector, _leading, _trailing) {
var _this = _super.call(this, destination) || this;
_this.destination = destination;
_this.durationSelector = durationSelector;
_this._leading = _leading;
_this._trailing = _trailing;
_this._hasValue = false;
return _this;
}
ThrottleSubscriber.prototype._next = function (value) {
this._hasValue = true;
this._sendValue = value;
if (!this._throttled) {
if (this._leading) {
this.send();
}
else {
this.throttle(value);
}
}
};
ThrottleSubscriber.prototype.send = function () {
var _a = this, _hasValue = _a._hasValue, _sendValue = _a._sendValue;
if (_hasValue) {
this.destination.next(_sendValue);
this.throttle(_sendValue);
}
this._hasValue = false;
this._sendValue = null;
};
ThrottleSubscriber.prototype.throttle = function (value) {
var duration = this.tryDurationSelector(value);
if (duration) {
this.add(this._throttled = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, duration));
}
};
ThrottleSubscriber.prototype.tryDurationSelector = function (value) {
try {
return this.durationSelector(value);
}
catch (err) {
this.destination.error(err);
return null;
}
};
ThrottleSubscriber.prototype.throttlingDone = function () {
var _a = this, _throttled = _a._throttled, _trailing = _a._trailing;
if (_throttled) {
_throttled.unsubscribe();
}
this._throttled = null;
if (_trailing) {
this.send();
}
};
ThrottleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.throttlingDone();
};
ThrottleSubscriber.prototype.notifyComplete = function () {
this.throttlingDone();
};
return ThrottleSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
//# sourceMappingURL=throttle.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/throttleTime.js":
/*!********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/throttleTime.js ***!
\********************************************************************/
/*! exports provided: throttleTime */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return throttleTime; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./throttle */ "./node_modules/rxjs/_esm5/internal/operators/throttle.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async,_throttle PURE_IMPORTS_END */
/**
* Emits a value from the source Observable, then ignores subsequent source
* values for `duration` milliseconds, then repeats this process.
*
* <span class="informal">Lets a value pass, then ignores source values for the
* next `duration` milliseconds.</span>
*
* <img src="./img/throttleTime.png" width="100%">
*
* `throttleTime` emits the source Observable values on the output Observable
* when its internal timer is disabled, and ignores source values when the timer
* is enabled. Initially, the timer is disabled. As soon as the first source
* value arrives, it is forwarded to the output Observable, and then the timer
* is enabled. After `duration` milliseconds (or the time unit determined
* internally by the optional `scheduler`) has passed, the timer is disabled,
* and this process repeats for the next source value. Optionally takes a
* {@link IScheduler} for managing timers.
*
* @example <caption>Emit clicks at a rate of at most one click per second</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.throttleTime(1000);
* result.subscribe(x => console.log(x));
*
* @see {@link auditTime}
* @see {@link debounceTime}
* @see {@link delay}
* @see {@link sampleTime}
* @see {@link throttle}
*
* @param {number} duration Time to wait before emitting another value after
* emitting the last value, measured in milliseconds or the time unit determined
* internally by the optional `scheduler`.
* @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for
* managing the timers that handle the throttling.
* @param {Object} config a configuration object to define `leading` and
* `trailing` behavior. Defaults to `{ leading: true, trailing: false }`.
* @return {Observable<T>} An Observable that performs the throttle operation to
* limit the rate of emissions from the source.
* @method throttleTime
* @owner Observable
*/
function throttleTime(duration, scheduler, config) {
if (scheduler === void 0) {
scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"];
}
if (config === void 0) {
config = _throttle__WEBPACK_IMPORTED_MODULE_3__["defaultThrottleConfig"];
}
return function (source) { return source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing)); };
}
var ThrottleTimeOperator = /*@__PURE__*/ (function () {
function ThrottleTimeOperator(duration, scheduler, leading, trailing) {
this.duration = duration;
this.scheduler = scheduler;
this.leading = leading;
this.trailing = trailing;
}
ThrottleTimeOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));
};
return ThrottleTimeOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var ThrottleTimeSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ThrottleTimeSubscriber, _super);
function ThrottleTimeSubscriber(destination, duration, scheduler, leading, trailing) {
var _this = _super.call(this, destination) || this;
_this.duration = duration;
_this.scheduler = scheduler;
_this.leading = leading;
_this.trailing = trailing;
_this._hasTrailingValue = false;
_this._trailingValue = null;
return _this;
}
ThrottleTimeSubscriber.prototype._next = function (value) {
if (this.throttled) {
if (this.trailing) {
this._trailingValue = value;
this._hasTrailingValue = true;
}
}
else {
this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, { subscriber: this }));
if (this.leading) {
this.destination.next(value);
}
}
};
ThrottleTimeSubscriber.prototype._complete = function () {
if (this._hasTrailingValue) {
this.destination.next(this._trailingValue);
this.destination.complete();
}
else {
this.destination.complete();
}
};
ThrottleTimeSubscriber.prototype.clearThrottle = function () {
var throttled = this.throttled;
if (throttled) {
if (this.trailing && this._hasTrailingValue) {
this.destination.next(this._trailingValue);
this._trailingValue = null;
this._hasTrailingValue = false;
}
throttled.unsubscribe();
this.remove(throttled);
this.throttled = null;
}
};
return ThrottleTimeSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
function dispatchNext(arg) {
var subscriber = arg.subscriber;
subscriber.clearThrottle();
}
//# sourceMappingURL=throttleTime.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/throwIfEmpty.js":
/*!********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/throwIfEmpty.js ***!
\********************************************************************/
/*! exports provided: throwIfEmpty */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return throwIfEmpty; });
/* harmony import */ var _tap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tap */ "./node_modules/rxjs/_esm5/internal/operators/tap.js");
/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/EmptyError */ "./node_modules/rxjs/_esm5/internal/util/EmptyError.js");
/** PURE_IMPORTS_START _tap,_util_EmptyError PURE_IMPORTS_END */
/**
* If the source observable completes without emitting a value, it will emit
* an error. The error will be created at that time by the optional
* `errorFactory` argument, otherwise, the error will be {@link ErrorEmpty}.
*
* @example
*
* const click$ = fromEvent(button, 'click');
*
* clicks$.pipe(
* takeUntil(timer(1000)),
* throwIfEmpty(
* () => new Error('the button was not clicked within 1 second')
* ),
* )
* .subscribe({
* next() { console.log('The button was clicked'); },
* error(err) { console.error(err); },
* });
* @param {Function} [errorFactory] A factory function called to produce the
* error to be thrown when the source observable completes without emitting a
* value.
*/
var throwIfEmpty = function (errorFactory) {
if (errorFactory === void 0) {
errorFactory = defaultErrorFactory;
}
return Object(_tap__WEBPACK_IMPORTED_MODULE_0__["tap"])({
hasValue: false,
next: function () { this.hasValue = true; },
complete: function () {
if (!this.hasValue) {
throw errorFactory();
}
}
});
};
function defaultErrorFactory() {
return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__["EmptyError"]();
}
//# sourceMappingURL=throwIfEmpty.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/timeInterval.js":
/*!********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/timeInterval.js ***!
\********************************************************************/
/*! exports provided: timeInterval, TimeInterval */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return timeInterval; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeInterval", function() { return TimeInterval; });
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scan */ "./node_modules/rxjs/_esm5/internal/operators/scan.js");
/* harmony import */ var _observable_defer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/defer */ "./node_modules/rxjs/_esm5/internal/observable/defer.js");
/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./map */ "./node_modules/rxjs/_esm5/internal/operators/map.js");
/** PURE_IMPORTS_START _scheduler_async,_scan,_observable_defer,_map PURE_IMPORTS_END */
function timeInterval(scheduler) {
if (scheduler === void 0) {
scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
}
return function (source) {
return Object(_observable_defer__WEBPACK_IMPORTED_MODULE_2__["defer"])(function () {
return source.pipe(
// HACK: the typings seem off with scan
Object(_scan__WEBPACK_IMPORTED_MODULE_1__["scan"])(function (_a, value) {
var current = _a.current;
return ({ value: value, current: scheduler.now(), last: current });
}, { current: scheduler.now(), value: undefined, last: undefined }), Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (_a) {
var current = _a.current, last = _a.last, value = _a.value;
return new TimeInterval(value, current - last);
}));
});
};
}
var TimeInterval = /*@__PURE__*/ (function () {
function TimeInterval(value, interval) {
this.value = value;
this.interval = interval;
}
return TimeInterval;
}());
//# sourceMappingURL=timeInterval.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/timeout.js":
/*!***************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/timeout.js ***!
\***************************************************************/
/*! exports provided: timeout */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return timeout; });
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/* harmony import */ var _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/TimeoutError */ "./node_modules/rxjs/_esm5/internal/util/TimeoutError.js");
/* harmony import */ var _timeoutWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./timeoutWith */ "./node_modules/rxjs/_esm5/internal/operators/timeoutWith.js");
/* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../observable/throwError */ "./node_modules/rxjs/_esm5/internal/observable/throwError.js");
/** PURE_IMPORTS_START _scheduler_async,_util_TimeoutError,_timeoutWith,_observable_throwError PURE_IMPORTS_END */
/**
*
* Errors if Observable does not emit a value in given time span.
*
* <span class="informal">Timeouts on Observable that doesn't emit values fast enough.</span>
*
* <img src="./img/timeout.png" width="100%">
*
* `timeout` operator accepts as an argument either a number or a Date.
*
* If number was provided, it returns an Observable that behaves like a source
* Observable, unless there is a period of time where there is no value emitted.
* So if you provide `100` as argument and first value comes after 50ms from
* the moment of subscription, this value will be simply re-emitted by the resulting
* Observable. If however after that 100ms passes without a second value being emitted,
* stream will end with an error and source Observable will be unsubscribed.
* These checks are performed throughout whole lifecycle of Observable - from the moment
* it was subscribed to, until it completes or errors itself. Thus every value must be
* emitted within specified period since previous value.
*
* If provided argument was Date, returned Observable behaves differently. It throws
* if Observable did not complete before provided Date. This means that periods between
* emission of particular values do not matter in this case. If Observable did not complete
* before provided Date, source Observable will be unsubscribed. Other than that, resulting
* stream behaves just as source Observable.
*
* `timeout` accepts also a Scheduler as a second parameter. It is used to schedule moment (or moments)
* when returned Observable will check if source stream emitted value or completed.
*
* @example <caption>Check if ticks are emitted within certain timespan</caption>
* const seconds = Rx.Observable.interval(1000);
*
* seconds.timeout(1100) // Let's use bigger timespan to be safe,
* // since `interval` might fire a bit later then scheduled.
* .subscribe(
* value => console.log(value), // Will emit numbers just as regular `interval` would.
* err => console.log(err) // Will never be called.
* );
*
* seconds.timeout(900).subscribe(
* value => console.log(value), // Will never be called.
* err => console.log(err) // Will emit error before even first value is emitted,
* // since it did not arrive within 900ms period.
* );
*
* @example <caption>Use Date to check if Observable completed</caption>
* const seconds = Rx.Observable.interval(1000);
*
* seconds.timeout(new Date("December 17, 2020 03:24:00"))
* .subscribe(
* value => console.log(value), // Will emit values as regular `interval` would
* // until December 17, 2020 at 03:24:00.
* err => console.log(err) // On December 17, 2020 at 03:24:00 it will emit an error,
* // since Observable did not complete by then.
* );
*
* @see {@link timeoutWith}
*
* @param {number|Date} due Number specifying period within which Observable must emit values
* or Date specifying before when Observable should complete
* @param {Scheduler} [scheduler] Scheduler controlling when timeout checks occur.
* @return {Observable<T>} Observable that mirrors behaviour of source, unless timeout checks fail.
* @method timeout
* @owner Observable
*/
function timeout(due, scheduler) {
if (scheduler === void 0) {
scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
}
return Object(_timeoutWith__WEBPACK_IMPORTED_MODULE_2__["timeoutWith"])(due, Object(_observable_throwError__WEBPACK_IMPORTED_MODULE_3__["throwError"])(new _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__["TimeoutError"]()), scheduler);
}
//# sourceMappingURL=timeout.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/timeoutWith.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/timeoutWith.js ***!
\*******************************************************************/
/*! exports provided: timeoutWith */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return timeoutWith; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isDate */ "./node_modules/rxjs/_esm5/internal/util/isDate.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
*
* Errors if Observable does not emit a value in given time span, in case of which
* subscribes to the second Observable.
*
* <span class="informal">It's a version of `timeout` operator that let's you specify fallback Observable.</span>
*
* <img src="./img/timeoutWith.png" width="100%">
*
* `timeoutWith` is a variation of `timeout` operator. It behaves exactly the same,
* still accepting as a first argument either a number or a Date, which control - respectively -
* when values of source Observable should be emitted or when it should complete.
*
* The only difference is that it accepts a second, required parameter. This parameter
* should be an Observable which will be subscribed when source Observable fails any timeout check.
* So whenever regular `timeout` would emit an error, `timeoutWith` will instead start re-emitting
* values from second Observable. Note that this fallback Observable is not checked for timeouts
* itself, so it can emit values and complete at arbitrary points in time. From the moment of a second
* subscription, Observable returned from `timeoutWith` simply mirrors fallback stream. When that
* stream completes, it completes as well.
*
* Scheduler, which in case of `timeout` is provided as as second argument, can be still provided
* here - as a third, optional parameter. It still is used to schedule timeout checks and -
* as a consequence - when second Observable will be subscribed, since subscription happens
* immediately after failing check.
*
* @example <caption>Add fallback observable</caption>
* const seconds = Rx.Observable.interval(1000);
* const minutes = Rx.Observable.interval(60 * 1000);
*
* seconds.timeoutWith(900, minutes)
* .subscribe(
* value => console.log(value), // After 900ms, will start emitting `minutes`,
* // since first value of `seconds` will not arrive fast enough.
* err => console.log(err) // Would be called after 900ms in case of `timeout`,
* // but here will never be called.
* );
*
* @param {number|Date} due Number specifying period within which Observable must emit values
* or Date specifying before when Observable should complete
* @param {Observable<T>} withObservable Observable which will be subscribed if source fails timeout check.
* @param {Scheduler} [scheduler] Scheduler controlling when timeout checks occur.
* @return {Observable<T>} Observable that mirrors behaviour of source or, when timeout check fails, of an Observable
* passed as a second parameter.
* @method timeoutWith
* @owner Observable
*/
function timeoutWith(due, withObservable, scheduler) {
if (scheduler === void 0) {
scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
}
return function (source) {
var absoluteTimeout = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_2__["isDate"])(due);
var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due);
return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler));
};
}
var TimeoutWithOperator = /*@__PURE__*/ (function () {
function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) {
this.waitFor = waitFor;
this.absoluteTimeout = absoluteTimeout;
this.withObservable = withObservable;
this.scheduler = scheduler;
}
TimeoutWithOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler));
};
return TimeoutWithOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var TimeoutWithSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TimeoutWithSubscriber, _super);
function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) {
var _this = _super.call(this, destination) || this;
_this.absoluteTimeout = absoluteTimeout;
_this.waitFor = waitFor;
_this.withObservable = withObservable;
_this.scheduler = scheduler;
_this.action = null;
_this.scheduleTimeout();
return _this;
}
TimeoutWithSubscriber.dispatchTimeout = function (subscriber) {
var withObservable = subscriber.withObservable;
subscriber._unsubscribeAndRecycle();
subscriber.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(subscriber, withObservable));
};
TimeoutWithSubscriber.prototype.scheduleTimeout = function () {
var action = this.action;
if (action) {
// Recycle the action if we've already scheduled one. All the production
// Scheduler Actions mutate their state/delay time and return themeselves.
// VirtualActions are immutable, so they create and return a clone. In this
// case, we need to set the action reference to the most recent VirtualAction,
// to ensure that's the one we clone from next time.
this.action = action.schedule(this, this.waitFor);
}
else {
this.add(this.action = this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, this));
}
};
TimeoutWithSubscriber.prototype._next = function (value) {
if (!this.absoluteTimeout) {
this.scheduleTimeout();
}
_super.prototype._next.call(this, value);
};
/** @deprecated This is an internal implementation detail, do not use. */
TimeoutWithSubscriber.prototype._unsubscribe = function () {
this.action = null;
this.scheduler = null;
this.withObservable = null;
};
return TimeoutWithSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
//# sourceMappingURL=timeoutWith.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/timestamp.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/timestamp.js ***!
\*****************************************************************/
/*! exports provided: timestamp, Timestamp */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return timestamp; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timestamp", function() { return Timestamp; });
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map */ "./node_modules/rxjs/_esm5/internal/operators/map.js");
/** PURE_IMPORTS_START _scheduler_async,_map PURE_IMPORTS_END */
/**
* @param scheduler
* @return {Observable<Timestamp<any>>|WebSocketSubject<T>|Observable<T>}
* @method timestamp
* @owner Observable
*/
function timestamp(scheduler) {
if (scheduler === void 0) {
scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
}
return Object(_map__WEBPACK_IMPORTED_MODULE_1__["map"])(function (value) { return new Timestamp(value, scheduler.now()); });
// return (source: Observable<T>) => source.lift(new TimestampOperator(scheduler));
}
var Timestamp = /*@__PURE__*/ (function () {
function Timestamp(value, timestamp) {
this.value = value;
this.timestamp = timestamp;
}
return Timestamp;
}());
//# sourceMappingURL=timestamp.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/toArray.js":
/*!***************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/toArray.js ***!
\***************************************************************/
/*! exports provided: toArray */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return toArray; });
/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reduce */ "./node_modules/rxjs/_esm5/internal/operators/reduce.js");
/** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
function toArrayReducer(arr, item, index) {
if (index === 0) {
return [item];
}
arr.push(item);
return arr;
}
function toArray() {
return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(toArrayReducer, []);
}
//# sourceMappingURL=toArray.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/window.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/window.js ***!
\**************************************************************/
/*! exports provided: window */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "window", function() { return window; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_Subject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Branch out the source Observable values as a nested Observable whenever
* `windowBoundaries` emits.
*
* <span class="informal">It's like {@link buffer}, but emits a nested Observable
* instead of an array.</span>
*
* <img src="./img/window.png" width="100%">
*
* Returns an Observable that emits windows of items it collects from the source
* Observable. The output Observable emits connected, non-overlapping
* windows. It emits the current window and opens a new one whenever the
* Observable `windowBoundaries` emits an item. Because each window is an
* Observable, the output is a higher-order Observable.
*
* @example <caption>In every window of 1 second each, emit at most 2 click events</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var interval = Rx.Observable.interval(1000);
* var result = clicks.window(interval)
* .map(win => win.take(2)) // each window has at most 2 emissions
* .mergeAll(); // flatten the Observable-of-Observables
* result.subscribe(x => console.log(x));
*
* @see {@link windowCount}
* @see {@link windowTime}
* @see {@link windowToggle}
* @see {@link windowWhen}
* @see {@link buffer}
*
* @param {Observable<any>} windowBoundaries An Observable that completes the
* previous window and starts a new window.
* @return {Observable<Observable<T>>} An Observable of windows, which are
* Observables emitting values of the source Observable.
* @method window
* @owner Observable
*/
function window(windowBoundaries) {
return function windowOperatorFunction(source) {
return source.lift(new WindowOperator(windowBoundaries));
};
}
var WindowOperator = /*@__PURE__*/ (function () {
function WindowOperator(windowBoundaries) {
this.windowBoundaries = windowBoundaries;
}
WindowOperator.prototype.call = function (subscriber, source) {
var windowSubscriber = new WindowSubscriber(subscriber);
var sourceSubscription = source.subscribe(windowSubscriber);
if (!sourceSubscription.closed) {
windowSubscriber.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(windowSubscriber, this.windowBoundaries));
}
return sourceSubscription;
};
return WindowOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var WindowSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowSubscriber, _super);
function WindowSubscriber(destination) {
var _this = _super.call(this, destination) || this;
_this.window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
destination.next(_this.window);
return _this;
}
WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.openWindow();
};
WindowSubscriber.prototype.notifyError = function (error, innerSub) {
this._error(error);
};
WindowSubscriber.prototype.notifyComplete = function (innerSub) {
this._complete();
};
WindowSubscriber.prototype._next = function (value) {
this.window.next(value);
};
WindowSubscriber.prototype._error = function (err) {
this.window.error(err);
this.destination.error(err);
};
WindowSubscriber.prototype._complete = function () {
this.window.complete();
this.destination.complete();
};
/** @deprecated This is an internal implementation detail, do not use. */
WindowSubscriber.prototype._unsubscribe = function () {
this.window = null;
};
WindowSubscriber.prototype.openWindow = function () {
var prevWindow = this.window;
if (prevWindow) {
prevWindow.complete();
}
var destination = this.destination;
var newWindow = this.window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
destination.next(newWindow);
};
return WindowSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
//# sourceMappingURL=window.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/windowCount.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/windowCount.js ***!
\*******************************************************************/
/*! exports provided: windowCount */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return windowCount; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/** PURE_IMPORTS_START tslib,_Subscriber,_Subject PURE_IMPORTS_END */
/**
* Branch out the source Observable values as a nested Observable with each
* nested Observable emitting at most `windowSize` values.
*
* <span class="informal">It's like {@link bufferCount}, but emits a nested
* Observable instead of an array.</span>
*
* <img src="./img/windowCount.png" width="100%">
*
* Returns an Observable that emits windows of items it collects from the source
* Observable. The output Observable emits windows every `startWindowEvery`
* items, each containing no more than `windowSize` items. When the source
* Observable completes or encounters an error, the output Observable emits
* the current window and propagates the notification from the source
* Observable. If `startWindowEvery` is not provided, then new windows are
* started immediately at the start of the source and when each window completes
* with size `windowSize`.
*
* @example <caption>Ignore every 3rd click event, starting from the first one</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.windowCount(3)
* .map(win => win.skip(1)) // skip first of every 3 clicks
* .mergeAll(); // flatten the Observable-of-Observables
* result.subscribe(x => console.log(x));
*
* @example <caption>Ignore every 3rd click event, starting from the third one</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.windowCount(2, 3)
* .mergeAll(); // flatten the Observable-of-Observables
* result.subscribe(x => console.log(x));
*
* @see {@link window}
* @see {@link windowTime}
* @see {@link windowToggle}
* @see {@link windowWhen}
* @see {@link bufferCount}
*
* @param {number} windowSize The maximum number of values emitted by each
* window.
* @param {number} [startWindowEvery] Interval at which to start a new window.
* For example if `startWindowEvery` is `2`, then a new window will be started
* on every other value from the source. A new window is started at the
* beginning of the source by default.
* @return {Observable<Observable<T>>} An Observable of windows, which in turn
* are Observable of values.
* @method windowCount
* @owner Observable
*/
function windowCount(windowSize, startWindowEvery) {
if (startWindowEvery === void 0) {
startWindowEvery = 0;
}
return function windowCountOperatorFunction(source) {
return source.lift(new WindowCountOperator(windowSize, startWindowEvery));
};
}
var WindowCountOperator = /*@__PURE__*/ (function () {
function WindowCountOperator(windowSize, startWindowEvery) {
this.windowSize = windowSize;
this.startWindowEvery = startWindowEvery;
}
WindowCountOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));
};
return WindowCountOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var WindowCountSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowCountSubscriber, _super);
function WindowCountSubscriber(destination, windowSize, startWindowEvery) {
var _this = _super.call(this, destination) || this;
_this.destination = destination;
_this.windowSize = windowSize;
_this.startWindowEvery = startWindowEvery;
_this.windows = [new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]()];
_this.count = 0;
destination.next(_this.windows[0]);
return _this;
}
WindowCountSubscriber.prototype._next = function (value) {
var startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;
var destination = this.destination;
var windowSize = this.windowSize;
var windows = this.windows;
var len = windows.length;
for (var i = 0; i < len && !this.closed; i++) {
windows[i].next(value);
}
var c = this.count - windowSize + 1;
if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {
windows.shift().complete();
}
if (++this.count % startWindowEvery === 0 && !this.closed) {
var window_1 = new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
windows.push(window_1);
destination.next(window_1);
}
};
WindowCountSubscriber.prototype._error = function (err) {
var windows = this.windows;
if (windows) {
while (windows.length > 0 && !this.closed) {
windows.shift().error(err);
}
}
this.destination.error(err);
};
WindowCountSubscriber.prototype._complete = function () {
var windows = this.windows;
if (windows) {
while (windows.length > 0 && !this.closed) {
windows.shift().complete();
}
}
this.destination.complete();
};
WindowCountSubscriber.prototype._unsubscribe = function () {
this.count = 0;
this.windows = null;
};
return WindowCountSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
//# sourceMappingURL=windowCount.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/windowTime.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/windowTime.js ***!
\******************************************************************/
/*! exports provided: windowTime */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return windowTime; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm5/internal/scheduler/async.js");
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isNumeric */ "./node_modules/rxjs/_esm5/internal/util/isNumeric.js");
/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm5/internal/util/isScheduler.js");
/** PURE_IMPORTS_START tslib,_Subject,_scheduler_async,_Subscriber,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */
function windowTime(windowTimeSpan) {
var scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"];
var windowCreationInterval = null;
var maxWindowSize = Number.POSITIVE_INFINITY;
if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(arguments[3])) {
scheduler = arguments[3];
}
if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(arguments[2])) {
scheduler = arguments[2];
}
else if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_4__["isNumeric"])(arguments[2])) {
maxWindowSize = arguments[2];
}
if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(arguments[1])) {
scheduler = arguments[1];
}
else if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_4__["isNumeric"])(arguments[1])) {
windowCreationInterval = arguments[1];
}
return function windowTimeOperatorFunction(source) {
return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));
};
}
var WindowTimeOperator = /*@__PURE__*/ (function () {
function WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
this.windowTimeSpan = windowTimeSpan;
this.windowCreationInterval = windowCreationInterval;
this.maxWindowSize = maxWindowSize;
this.scheduler = scheduler;
}
WindowTimeOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler));
};
return WindowTimeOperator;
}());
var CountedSubject = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CountedSubject, _super);
function CountedSubject() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._numberOfNextedValues = 0;
return _this;
}
CountedSubject.prototype.next = function (value) {
this._numberOfNextedValues++;
_super.prototype.next.call(this, value);
};
Object.defineProperty(CountedSubject.prototype, "numberOfNextedValues", {
get: function () {
return this._numberOfNextedValues;
},
enumerable: true,
configurable: true
});
return CountedSubject;
}(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var WindowTimeSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowTimeSubscriber, _super);
function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
var _this = _super.call(this, destination) || this;
_this.destination = destination;
_this.windowTimeSpan = windowTimeSpan;
_this.windowCreationInterval = windowCreationInterval;
_this.maxWindowSize = maxWindowSize;
_this.scheduler = scheduler;
_this.windows = [];
var window = _this.openWindow();
if (windowCreationInterval !== null && windowCreationInterval >= 0) {
var closeState = { subscriber: _this, window: window, context: null };
var creationState = { windowTimeSpan: windowTimeSpan, windowCreationInterval: windowCreationInterval, subscriber: _this, scheduler: scheduler };
_this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState));
_this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState));
}
else {
var timeSpanOnlyState = { subscriber: _this, window: window, windowTimeSpan: windowTimeSpan };
_this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));
}
return _this;
}
WindowTimeSubscriber.prototype._next = function (value) {
var windows = this.windows;
var len = windows.length;
for (var i = 0; i < len; i++) {
var window_1 = windows[i];
if (!window_1.closed) {
window_1.next(value);
if (window_1.numberOfNextedValues >= this.maxWindowSize) {
this.closeWindow(window_1);
}
}
}
};
WindowTimeSubscriber.prototype._error = function (err) {
var windows = this.windows;
while (windows.length > 0) {
windows.shift().error(err);
}
this.destination.error(err);
};
WindowTimeSubscriber.prototype._complete = function () {
var windows = this.windows;
while (windows.length > 0) {
var window_2 = windows.shift();
if (!window_2.closed) {
window_2.complete();
}
}
this.destination.complete();
};
WindowTimeSubscriber.prototype.openWindow = function () {
var window = new CountedSubject();
this.windows.push(window);
var destination = this.destination;
destination.next(window);
return window;
};
WindowTimeSubscriber.prototype.closeWindow = function (window) {
window.complete();
var windows = this.windows;
windows.splice(windows.indexOf(window), 1);
};
return WindowTimeSubscriber;
}(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"]));
function dispatchWindowTimeSpanOnly(state) {
var subscriber = state.subscriber, windowTimeSpan = state.windowTimeSpan, window = state.window;
if (window) {
subscriber.closeWindow(window);
}
state.window = subscriber.openWindow();
this.schedule(state, windowTimeSpan);
}
function dispatchWindowCreation(state) {
var windowTimeSpan = state.windowTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler, windowCreationInterval = state.windowCreationInterval;
var window = subscriber.openWindow();
var action = this;
var context = { action: action, subscription: null };
var timeSpanState = { subscriber: subscriber, window: window, context: context };
context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState);
action.add(context.subscription);
action.schedule(state, windowCreationInterval);
}
function dispatchWindowClose(state) {
var subscriber = state.subscriber, window = state.window, context = state.context;
if (context && context.action && context.subscription) {
context.action.remove(context.subscription);
}
subscriber.closeWindow(window);
}
//# sourceMappingURL=windowTime.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/windowToggle.js":
/*!********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/windowToggle.js ***!
\********************************************************************/
/*! exports provided: windowToggle */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return windowToggle; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/tryCatch */ "./node_modules/rxjs/_esm5/internal/util/tryCatch.js");
/* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/errorObject */ "./node_modules/rxjs/_esm5/internal/util/errorObject.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_Subject,_Subscription,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Branch out the source Observable values as a nested Observable starting from
* an emission from `openings` and ending when the output of `closingSelector`
* emits.
*
* <span class="informal">It's like {@link bufferToggle}, but emits a nested
* Observable instead of an array.</span>
*
* <img src="./img/windowToggle.png" width="100%">
*
* Returns an Observable that emits windows of items it collects from the source
* Observable. The output Observable emits windows that contain those items
* emitted by the source Observable between the time when the `openings`
* Observable emits an item and when the Observable returned by
* `closingSelector` emits an item.
*
* @example <caption>Every other second, emit the click events from the next 500ms</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var openings = Rx.Observable.interval(1000);
* var result = clicks.windowToggle(openings, i =>
* i % 2 ? Rx.Observable.interval(500) : Rx.Observable.empty()
* ).mergeAll();
* result.subscribe(x => console.log(x));
*
* @see {@link window}
* @see {@link windowCount}
* @see {@link windowTime}
* @see {@link windowWhen}
* @see {@link bufferToggle}
*
* @param {Observable<O>} openings An observable of notifications to start new
* windows.
* @param {function(value: O): Observable} closingSelector A function that takes
* the value emitted by the `openings` observable and returns an Observable,
* which, when it emits (either `next` or `complete`), signals that the
* associated window should complete.
* @return {Observable<Observable<T>>} An observable of windows, which in turn
* are Observables.
* @method windowToggle
* @owner Observable
*/
function windowToggle(openings, closingSelector) {
return function (source) { return source.lift(new WindowToggleOperator(openings, closingSelector)); };
}
var WindowToggleOperator = /*@__PURE__*/ (function () {
function WindowToggleOperator(openings, closingSelector) {
this.openings = openings;
this.closingSelector = closingSelector;
}
WindowToggleOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector));
};
return WindowToggleOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var WindowToggleSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowToggleSubscriber, _super);
function WindowToggleSubscriber(destination, openings, closingSelector) {
var _this = _super.call(this, destination) || this;
_this.openings = openings;
_this.closingSelector = closingSelector;
_this.contexts = [];
_this.add(_this.openSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_6__["subscribeToResult"])(_this, openings, openings));
return _this;
}
WindowToggleSubscriber.prototype._next = function (value) {
var contexts = this.contexts;
if (contexts) {
var len = contexts.length;
for (var i = 0; i < len; i++) {
contexts[i].window.next(value);
}
}
};
WindowToggleSubscriber.prototype._error = function (err) {
var contexts = this.contexts;
this.contexts = null;
if (contexts) {
var len = contexts.length;
var index = -1;
while (++index < len) {
var context_1 = contexts[index];
context_1.window.error(err);
context_1.subscription.unsubscribe();
}
}
_super.prototype._error.call(this, err);
};
WindowToggleSubscriber.prototype._complete = function () {
var contexts = this.contexts;
this.contexts = null;
if (contexts) {
var len = contexts.length;
var index = -1;
while (++index < len) {
var context_2 = contexts[index];
context_2.window.complete();
context_2.subscription.unsubscribe();
}
}
_super.prototype._complete.call(this);
};
/** @deprecated This is an internal implementation detail, do not use. */
WindowToggleSubscriber.prototype._unsubscribe = function () {
var contexts = this.contexts;
this.contexts = null;
if (contexts) {
var len = contexts.length;
var index = -1;
while (++index < len) {
var context_3 = contexts[index];
context_3.window.unsubscribe();
context_3.subscription.unsubscribe();
}
}
};
WindowToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
if (outerValue === this.openings) {
var closingSelector = this.closingSelector;
var closingNotifier = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_3__["tryCatch"])(closingSelector)(innerValue);
if (closingNotifier === _util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"]) {
return this.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"].e);
}
else {
var window_1 = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"]();
var context_4 = { window: window_1, subscription: subscription };
this.contexts.push(context_4);
var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_6__["subscribeToResult"])(this, closingNotifier, context_4);
if (innerSubscription.closed) {
this.closeWindow(this.contexts.length - 1);
}
else {
innerSubscription.context = context_4;
subscription.add(innerSubscription);
}
this.destination.next(window_1);
}
}
else {
this.closeWindow(this.contexts.indexOf(outerValue));
}
};
WindowToggleSubscriber.prototype.notifyError = function (err) {
this.error(err);
};
WindowToggleSubscriber.prototype.notifyComplete = function (inner) {
if (inner !== this.openSubscription) {
this.closeWindow(this.contexts.indexOf(inner.context));
}
};
WindowToggleSubscriber.prototype.closeWindow = function (index) {
if (index === -1) {
return;
}
var contexts = this.contexts;
var context = contexts[index];
var window = context.window, subscription = context.subscription;
contexts.splice(index, 1);
window.complete();
subscription.unsubscribe();
};
return WindowToggleSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_5__["OuterSubscriber"]));
//# sourceMappingURL=windowToggle.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/windowWhen.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/windowWhen.js ***!
\******************************************************************/
/*! exports provided: windowWhen */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return windowWhen; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm5/internal/Subject.js");
/* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/tryCatch */ "./node_modules/rxjs/_esm5/internal/util/tryCatch.js");
/* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/errorObject */ "./node_modules/rxjs/_esm5/internal/util/errorObject.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_Subject,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/**
* Branch out the source Observable values as a nested Observable using a
* factory function of closing Observables to determine when to start a new
* window.
*
* <span class="informal">It's like {@link bufferWhen}, but emits a nested
* Observable instead of an array.</span>
*
* <img src="./img/windowWhen.png" width="100%">
*
* Returns an Observable that emits windows of items it collects from the source
* Observable. The output Observable emits connected, non-overlapping windows.
* It emits the current window and opens a new one whenever the Observable
* produced by the specified `closingSelector` function emits an item. The first
* window is opened immediately when subscribing to the output Observable.
*
* @example <caption>Emit only the first two clicks events in every window of [1-5] random seconds</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks
* .windowWhen(() => Rx.Observable.interval(1000 + Math.random() * 4000))
* .map(win => win.take(2)) // each window has at most 2 emissions
* .mergeAll(); // flatten the Observable-of-Observables
* result.subscribe(x => console.log(x));
*
* @see {@link window}
* @see {@link windowCount}
* @see {@link windowTime}
* @see {@link windowToggle}
* @see {@link bufferWhen}
*
* @param {function(): Observable} closingSelector A function that takes no
* arguments and returns an Observable that signals (on either `next` or
* `complete`) when to close the previous window and start a new one.
* @return {Observable<Observable<T>>} An observable of windows, which in turn
* are Observables.
* @method windowWhen
* @owner Observable
*/
function windowWhen(closingSelector) {
return function windowWhenOperatorFunction(source) {
return source.lift(new WindowOperator(closingSelector));
};
}
var WindowOperator = /*@__PURE__*/ (function () {
function WindowOperator(closingSelector) {
this.closingSelector = closingSelector;
}
WindowOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));
};
return WindowOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var WindowSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowSubscriber, _super);
function WindowSubscriber(destination, closingSelector) {
var _this = _super.call(this, destination) || this;
_this.destination = destination;
_this.closingSelector = closingSelector;
_this.openWindow();
return _this;
}
WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.openWindow(innerSub);
};
WindowSubscriber.prototype.notifyError = function (error, innerSub) {
this._error(error);
};
WindowSubscriber.prototype.notifyComplete = function (innerSub) {
this.openWindow(innerSub);
};
WindowSubscriber.prototype._next = function (value) {
this.window.next(value);
};
WindowSubscriber.prototype._error = function (err) {
this.window.error(err);
this.destination.error(err);
this.unsubscribeClosingNotification();
};
WindowSubscriber.prototype._complete = function () {
this.window.complete();
this.destination.complete();
this.unsubscribeClosingNotification();
};
WindowSubscriber.prototype.unsubscribeClosingNotification = function () {
if (this.closingNotification) {
this.closingNotification.unsubscribe();
}
};
WindowSubscriber.prototype.openWindow = function (innerSub) {
if (innerSub === void 0) {
innerSub = null;
}
if (innerSub) {
this.remove(innerSub);
innerSub.unsubscribe();
}
var prevWindow = this.window;
if (prevWindow) {
prevWindow.complete();
}
var window = this.window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
this.destination.next(window);
var closingNotifier = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(this.closingSelector)();
if (closingNotifier === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) {
var err = _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"].e;
this.destination.error(err);
this.window.error(err);
}
else {
this.add(this.closingNotification = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, closingNotifier));
}
};
return WindowSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"]));
//# sourceMappingURL=windowWhen.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/withLatestFrom.js":
/*!**********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/withLatestFrom.js ***!
\**********************************************************************/
/*! exports provided: withLatestFrom */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return withLatestFrom; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm5/internal/OuterSubscriber.js");
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js");
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* Combines the source Observable with other Observables to create an Observable
* whose values are calculated from the latest values of each, only when the
* source emits.
*
* <span class="informal">Whenever the source Observable emits a value, it
* computes a formula using that value plus the latest values from other input
* Observables, then emits the output of that formula.</span>
*
* <img src="./img/withLatestFrom.png" width="100%">
*
* `withLatestFrom` combines each value from the source Observable (the
* instance) with the latest values from the other input Observables only when
* the source emits a value, optionally using a `project` function to determine
* the value to be emitted on the output Observable. All input Observables must
* emit at least one value before the output Observable will emit a value.
*
* @example <caption>On every click event, emit an array with the latest timer event plus the click event</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var timer = Rx.Observable.interval(1000);
* var result = clicks.withLatestFrom(timer);
* result.subscribe(x => console.log(x));
*
* @see {@link combineLatest}
*
* @param {ObservableInput} other An input Observable to combine with the source
* Observable. More than one input Observables may be given as argument.
* @param {Function} [project] Projection function for combining values
* together. Receives all values in order of the Observables passed, where the
* first parameter is a value from the source Observable. (e.g.
* `a.withLatestFrom(b, c, (a1, b1, c1) => a1 + b1 + c1)`). If this is not
* passed, arrays will be emitted on the output Observable.
* @return {Observable} An Observable of projected values from the most recent
* values from each input Observable, or an array of the most recent values from
* each input Observable.
* @method withLatestFrom
* @owner Observable
*/
function withLatestFrom() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return function (source) {
var project;
if (typeof args[args.length - 1] === 'function') {
project = args.pop();
}
var observables = args;
return source.lift(new WithLatestFromOperator(observables, project));
};
}
var WithLatestFromOperator = /*@__PURE__*/ (function () {
function WithLatestFromOperator(observables, project) {
this.observables = observables;
this.project = project;
}
WithLatestFromOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));
};
return WithLatestFromOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var WithLatestFromSubscriber = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WithLatestFromSubscriber, _super);
function WithLatestFromSubscriber(destination, observables, project) {
var _this = _super.call(this, destination) || this;
_this.observables = observables;
_this.project = project;
_this.toRespond = [];
var len = observables.length;
_this.values = new Array(len);
for (var i = 0; i < len; i++) {
_this.toRespond.push(i);
}
for (var i = 0; i < len; i++) {
var observable = observables[i];
_this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, observable, observable, i));
}
return _this;
}
WithLatestFromSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
this.values[outerIndex] = innerValue;
var toRespond = this.toRespond;
if (toRespond.length > 0) {
var found = toRespond.indexOf(outerIndex);
if (found !== -1) {
toRespond.splice(found, 1);
}
}
};
WithLatestFromSubscriber.prototype.notifyComplete = function () {
// noop
};
WithLatestFromSubscriber.prototype._next = function (value) {
if (this.toRespond.length === 0) {
var args = [value].concat(this.values);
if (this.project) {
this._tryProject(args);
}
else {
this.destination.next(args);
}
}
};
WithLatestFromSubscriber.prototype._tryProject = function (args) {
var result;
try {
result = this.project.apply(this, args);
}
catch (err) {
this.destination.error(err);
return;
}
this.destination.next(result);
};
return WithLatestFromSubscriber;
}(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
//# sourceMappingURL=withLatestFrom.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/zip.js":
/*!***********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/zip.js ***!
\***********************************************************/
/*! exports provided: zip */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; });
/* harmony import */ var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/zip */ "./node_modules/rxjs/_esm5/internal/observable/zip.js");
/** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
/**
* @deprecated Deprecated in favor of static zip.
*/
function zip() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
return function zipOperatorFunction(source) {
return source.lift.call(_observable_zip__WEBPACK_IMPORTED_MODULE_0__["zip"].apply(void 0, [source].concat(observables)));
};
}
//# sourceMappingURL=zip.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/operators/zipAll.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/operators/zipAll.js ***!
\**************************************************************/
/*! exports provided: zipAll */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return zipAll; });
/* harmony import */ var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/zip */ "./node_modules/rxjs/_esm5/internal/observable/zip.js");
/** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */
function zipAll(project) {
return function (source) { return source.lift(new _observable_zip__WEBPACK_IMPORTED_MODULE_0__["ZipOperator"](project)); };
}
//# sourceMappingURL=zipAll.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/Action.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/Action.js ***!
\**************************************************************/
/*! exports provided: Action */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Action", function() { return Action; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js");
/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */
/**
* A unit of work to be executed in a {@link Scheduler}. An action is typically
* created from within a Scheduler and an RxJS user does not need to concern
* themselves about creating and manipulating an Action.
*
* ```ts
* class Action<T> extends Subscription {
* new (scheduler: Scheduler, work: (state?: T) => void);
* schedule(state?: T, delay: number = 0): Subscription;
* }
* ```
*
* @class Action<T>
*/
var Action = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](Action, _super);
function Action(scheduler, work) {
return _super.call(this) || this;
}
/**
* Schedules this action on its parent Scheduler for execution. May be passed
* some context object, `state`. May happen at some point in the future,
* according to the `delay` parameter, if specified.
* @param {T} [state] Some contextual data that the `work` function uses when
* called by the Scheduler.
* @param {number} [delay] Time to wait before executing the work, where the
* time unit is implicit and defined by the Scheduler.
* @return {void}
*/
Action.prototype.schedule = function (state, delay) {
if (delay === void 0) {
delay = 0;
}
return this;
};
return Action;
}(_Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]));
//# sourceMappingURL=Action.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameAction.js":
/*!****************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameAction.js ***!
\****************************************************************************/
/*! exports provided: AnimationFrameAction */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFrameAction", function() { return AnimationFrameAction; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncAction */ "./node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js");
/** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var AnimationFrameAction = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AnimationFrameAction, _super);
function AnimationFrameAction(scheduler, work) {
var _this = _super.call(this, scheduler, work) || this;
_this.scheduler = scheduler;
_this.work = work;
return _this;
}
AnimationFrameAction.prototype.requestAsyncId = function (scheduler, id, delay) {
if (delay === void 0) {
delay = 0;
}
// If delay is greater than 0, request as an async action.
if (delay !== null && delay > 0) {
return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
}
// Push the action to the end of the scheduler queue.
scheduler.actions.push(this);
// If an animation frame has already been requested, don't request another
// one. If an animation frame hasn't been requested yet, request one. Return
// the current animation frame request id.
return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(function () { return scheduler.flush(null); }));
};
AnimationFrameAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
if (delay === void 0) {
delay = 0;
}
// If delay exists and is greater than 0, or if the delay is null (the
// action wasn't rescheduled) but was originally scheduled as an async
// action, then recycle as an async action.
if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
}
// If the scheduler queue is empty, cancel the requested animation frame and
// set the scheduled flag to undefined so the next AnimationFrameAction will
// request its own.
if (scheduler.actions.length === 0) {
cancelAnimationFrame(id);
scheduler.scheduled = undefined;
}
// Return undefined so the action knows to request a new async id if it's rescheduled.
return undefined;
};
return AnimationFrameAction;
}(_AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"]));
//# sourceMappingURL=AnimationFrameAction.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameScheduler.js":
/*!*******************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameScheduler.js ***!
\*******************************************************************************/
/*! exports provided: AnimationFrameScheduler */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFrameScheduler", function() { return AnimationFrameScheduler; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncScheduler */ "./node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js");
/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */
var AnimationFrameScheduler = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AnimationFrameScheduler, _super);
function AnimationFrameScheduler() {
return _super !== null && _super.apply(this, arguments) || this;
}
AnimationFrameScheduler.prototype.flush = function (action) {
this.active = true;
this.scheduled = undefined;
var actions = this.actions;
var error;
var index = -1;
var count = actions.length;
action = action || actions.shift();
do {
if (error = action.execute(action.state, action.delay)) {
break;
}
} while (++index < count && (action = actions.shift()));
this.active = false;
if (error) {
while (++index < count && (action = actions.shift())) {
action.unsubscribe();
}
throw error;
}
};
return AnimationFrameScheduler;
}(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"]));
//# sourceMappingURL=AnimationFrameScheduler.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/AsapAction.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/AsapAction.js ***!
\******************************************************************/
/*! exports provided: AsapAction */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsapAction", function() { return AsapAction; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _util_Immediate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/Immediate */ "./node_modules/rxjs/_esm5/internal/util/Immediate.js");
/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AsyncAction */ "./node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js");
/** PURE_IMPORTS_START tslib,_util_Immediate,_AsyncAction PURE_IMPORTS_END */
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var AsapAction = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsapAction, _super);
function AsapAction(scheduler, work) {
var _this = _super.call(this, scheduler, work) || this;
_this.scheduler = scheduler;
_this.work = work;
return _this;
}
AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {
if (delay === void 0) {
delay = 0;
}
// If delay is greater than 0, request as an async action.
if (delay !== null && delay > 0) {
return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
}
// Push the action to the end of the scheduler queue.
scheduler.actions.push(this);
// If a microtask has already been scheduled, don't schedule another
// one. If a microtask hasn't been scheduled yet, schedule one now. Return
// the current scheduled microtask id.
return scheduler.scheduled || (scheduler.scheduled = _util_Immediate__WEBPACK_IMPORTED_MODULE_1__["Immediate"].setImmediate(scheduler.flush.bind(scheduler, null)));
};
AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
if (delay === void 0) {
delay = 0;
}
// If delay exists and is greater than 0, or if the delay is null (the
// action wasn't rescheduled) but was originally scheduled as an async
// action, then recycle as an async action.
if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
}
// If the scheduler queue is empty, cancel the requested microtask and
// set the scheduled flag to undefined so the next AsapAction will schedule
// its own.
if (scheduler.actions.length === 0) {
_util_Immediate__WEBPACK_IMPORTED_MODULE_1__["Immediate"].clearImmediate(id);
scheduler.scheduled = undefined;
}
// Return undefined so the action knows to request a new async id if it's rescheduled.
return undefined;
};
return AsapAction;
}(_AsyncAction__WEBPACK_IMPORTED_MODULE_2__["AsyncAction"]));
//# sourceMappingURL=AsapAction.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/AsapScheduler.js":
/*!*********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/AsapScheduler.js ***!
\*********************************************************************/
/*! exports provided: AsapScheduler */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsapScheduler", function() { return AsapScheduler; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncScheduler */ "./node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js");
/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */
var AsapScheduler = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsapScheduler, _super);
function AsapScheduler() {
return _super !== null && _super.apply(this, arguments) || this;
}
AsapScheduler.prototype.flush = function (action) {
this.active = true;
this.scheduled = undefined;
var actions = this.actions;
var error;
var index = -1;
var count = actions.length;
action = action || actions.shift();
do {
if (error = action.execute(action.state, action.delay)) {
break;
}
} while (++index < count && (action = actions.shift()));
this.active = false;
if (error) {
while (++index < count && (action = actions.shift())) {
action.unsubscribe();
}
throw error;
}
};
return AsapScheduler;
}(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"]));
//# sourceMappingURL=AsapScheduler.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js ***!
\*******************************************************************/
/*! exports provided: AsyncAction */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncAction", function() { return AsyncAction; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Action__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Action */ "./node_modules/rxjs/_esm5/internal/scheduler/Action.js");
/** PURE_IMPORTS_START tslib,_Action PURE_IMPORTS_END */
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var AsyncAction = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsyncAction, _super);
function AsyncAction(scheduler, work) {
var _this = _super.call(this, scheduler, work) || this;
_this.scheduler = scheduler;
_this.work = work;
_this.pending = false;
return _this;
}
AsyncAction.prototype.schedule = function (state, delay) {
if (delay === void 0) {
delay = 0;
}
if (this.closed) {
return this;
}
// Always replace the current state with the new state.
this.state = state;
var id = this.id;
var scheduler = this.scheduler;
//
// Important implementation note:
//
// Actions only execute once by default, unless rescheduled from within the
// scheduled callback. This allows us to implement single and repeat
// actions via the same code path, without adding API surface area, as well
// as mimic traditional recursion but across asynchronous boundaries.
//
// However, JS runtimes and timers distinguish between intervals achieved by
// serial `setTimeout` calls vs. a single `setInterval` call. An interval of
// serial `setTimeout` calls can be individually delayed, which delays
// scheduling the next `setTimeout`, and so on. `setInterval` attempts to
// guarantee the interval callback will be invoked more precisely to the
// interval period, regardless of load.
//
// Therefore, we use `setInterval` to schedule single and repeat actions.
// If the action reschedules itself with the same delay, the interval is not
// canceled. If the action doesn't reschedule, or reschedules with a
// different delay, the interval will be canceled after scheduled callback
// execution.
//
if (id != null) {
this.id = this.recycleAsyncId(scheduler, id, delay);
}
// Set the pending flag indicating that this action has been scheduled, or
// has recursively rescheduled itself.
this.pending = true;
this.delay = delay;
// If this action has already an async Id, don't request a new one.
this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
return this;
};
AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {
if (delay === void 0) {
delay = 0;
}
return setInterval(scheduler.flush.bind(scheduler, this), delay);
};
AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
if (delay === void 0) {
delay = 0;
}
// If this action is rescheduled with the same delay time, don't clear the interval id.
if (delay !== null && this.delay === delay && this.pending === false) {
return id;
}
// Otherwise, if the action's delay time is different from the current delay,
// or the action has been rescheduled before it's executed, clear the interval id
return clearInterval(id) && undefined || undefined;
};
/**
* Immediately executes this action and the `work` it contains.
* @return {any}
*/
AsyncAction.prototype.execute = function (state, delay) {
if (this.closed) {
return new Error('executing a cancelled action');
}
this.pending = false;
var error = this._execute(state, delay);
if (error) {
return error;
}
else if (this.pending === false && this.id != null) {
// Dequeue if the action didn't reschedule itself. Don't call
// unsubscribe(), because the action could reschedule later.
// For example:
// ```
// scheduler.schedule(function doWork(counter) {
// /* ... I'm a busy worker bee ... */
// var originalAction = this;
// /* wait 100ms before rescheduling the action */
// setTimeout(function () {
// originalAction.schedule(counter + 1);
// }, 100);
// }, 1000);
// ```
this.id = this.recycleAsyncId(this.scheduler, this.id, null);
}
};
AsyncAction.prototype._execute = function (state, delay) {
var errored = false;
var errorValue = undefined;
try {
this.work(state);
}
catch (e) {
errored = true;
errorValue = !!e && e || new Error(e);
}
if (errored) {
this.unsubscribe();
return errorValue;
}
};
/** @deprecated This is an internal implementation detail, do not use. */
AsyncAction.prototype._unsubscribe = function () {
var id = this.id;
var scheduler = this.scheduler;
var actions = scheduler.actions;
var index = actions.indexOf(this);
this.work = null;
this.state = null;
this.pending = false;
this.scheduler = null;
if (index !== -1) {
actions.splice(index, 1);
}
if (id != null) {
this.id = this.recycleAsyncId(scheduler, id, null);
}
this.delay = null;
};
return AsyncAction;
}(_Action__WEBPACK_IMPORTED_MODULE_1__["Action"]));
//# sourceMappingURL=AsyncAction.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js":
/*!**********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js ***!
\**********************************************************************/
/*! exports provided: AsyncScheduler */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncScheduler", function() { return AsyncScheduler; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _Scheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Scheduler */ "./node_modules/rxjs/_esm5/internal/Scheduler.js");
/** PURE_IMPORTS_START tslib,_Scheduler PURE_IMPORTS_END */
var AsyncScheduler = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsyncScheduler, _super);
function AsyncScheduler(SchedulerAction, now) {
if (now === void 0) {
now = _Scheduler__WEBPACK_IMPORTED_MODULE_1__["Scheduler"].now;
}
var _this = _super.call(this, SchedulerAction, function () {
if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) {
return AsyncScheduler.delegate.now();
}
else {
return now();
}
}) || this;
_this.actions = [];
/**
* A flag to indicate whether the Scheduler is currently executing a batch of
* queued actions.
* @type {boolean}
* @deprecated internal use only
*/
_this.active = false;
/**
* An internal ID used to track the latest asynchronous task such as those
* coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and
* others.
* @type {any}
* @deprecated internal use only
*/
_this.scheduled = undefined;
return _this;
}
AsyncScheduler.prototype.schedule = function (work, delay, state) {
if (delay === void 0) {
delay = 0;
}
if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {
return AsyncScheduler.delegate.schedule(work, delay, state);
}
else {
return _super.prototype.schedule.call(this, work, delay, state);
}
};
AsyncScheduler.prototype.flush = function (action) {
var actions = this.actions;
if (this.active) {
actions.push(action);
return;
}
var error;
this.active = true;
do {
if (error = action.execute(action.state, action.delay)) {
break;
}
} while (action = actions.shift()); // exhaust the scheduler queue
this.active = false;
if (error) {
while (action = actions.shift()) {
action.unsubscribe();
}
throw error;
}
};
return AsyncScheduler;
}(_Scheduler__WEBPACK_IMPORTED_MODULE_1__["Scheduler"]));
//# sourceMappingURL=AsyncScheduler.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/QueueAction.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/QueueAction.js ***!
\*******************************************************************/
/*! exports provided: QueueAction */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueueAction", function() { return QueueAction; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncAction */ "./node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js");
/** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var QueueAction = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](QueueAction, _super);
function QueueAction(scheduler, work) {
var _this = _super.call(this, scheduler, work) || this;
_this.scheduler = scheduler;
_this.work = work;
return _this;
}
QueueAction.prototype.schedule = function (state, delay) {
if (delay === void 0) {
delay = 0;
}
if (delay > 0) {
return _super.prototype.schedule.call(this, state, delay);
}
this.delay = delay;
this.state = state;
this.scheduler.flush(this);
return this;
};
QueueAction.prototype.execute = function (state, delay) {
return (delay > 0 || this.closed) ?
_super.prototype.execute.call(this, state, delay) :
this._execute(state, delay);
};
QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) {
if (delay === void 0) {
delay = 0;
}
// If delay exists and is greater than 0, or if the delay is null (the
// action wasn't rescheduled) but was originally scheduled as an async
// action, then recycle as an async action.
if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
}
// Otherwise flush the scheduler starting with this action.
return scheduler.flush(this);
};
return QueueAction;
}(_AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"]));
//# sourceMappingURL=QueueAction.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/QueueScheduler.js":
/*!**********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/QueueScheduler.js ***!
\**********************************************************************/
/*! exports provided: QueueScheduler */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueueScheduler", function() { return QueueScheduler; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncScheduler */ "./node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js");
/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */
var QueueScheduler = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](QueueScheduler, _super);
function QueueScheduler() {
return _super !== null && _super.apply(this, arguments) || this;
}
return QueueScheduler;
}(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"]));
//# sourceMappingURL=QueueScheduler.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/VirtualTimeScheduler.js":
/*!****************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/VirtualTimeScheduler.js ***!
\****************************************************************************/
/*! exports provided: VirtualTimeScheduler, VirtualAction */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return VirtualTimeScheduler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return VirtualAction; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncAction */ "./node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js");
/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AsyncScheduler */ "./node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js");
/** PURE_IMPORTS_START tslib,_AsyncAction,_AsyncScheduler PURE_IMPORTS_END */
var VirtualTimeScheduler = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](VirtualTimeScheduler, _super);
function VirtualTimeScheduler(SchedulerAction, maxFrames) {
if (SchedulerAction === void 0) {
SchedulerAction = VirtualAction;
}
if (maxFrames === void 0) {
maxFrames = Number.POSITIVE_INFINITY;
}
var _this = _super.call(this, SchedulerAction, function () { return _this.frame; }) || this;
_this.maxFrames = maxFrames;
_this.frame = 0;
_this.index = -1;
return _this;
}
/**
* Prompt the Scheduler to execute all of its queued actions, therefore
* clearing its queue.
* @return {void}
*/
VirtualTimeScheduler.prototype.flush = function () {
var _a = this, actions = _a.actions, maxFrames = _a.maxFrames;
var error, action;
while ((action = actions.shift()) && (this.frame = action.delay) <= maxFrames) {
if (error = action.execute(action.state, action.delay)) {
break;
}
}
if (error) {
while (action = actions.shift()) {
action.unsubscribe();
}
throw error;
}
};
VirtualTimeScheduler.frameTimeFactor = 10;
return VirtualTimeScheduler;
}(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_2__["AsyncScheduler"]));
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var VirtualAction = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](VirtualAction, _super);
function VirtualAction(scheduler, work, index) {
if (index === void 0) {
index = scheduler.index += 1;
}
var _this = _super.call(this, scheduler, work) || this;
_this.scheduler = scheduler;
_this.work = work;
_this.index = index;
_this.active = true;
_this.index = scheduler.index = index;
return _this;
}
VirtualAction.prototype.schedule = function (state, delay) {
if (delay === void 0) {
delay = 0;
}
if (!this.id) {
return _super.prototype.schedule.call(this, state, delay);
}
this.active = false;
// If an action is rescheduled, we save allocations by mutating its state,
// pushing it to the end of the scheduler queue, and recycling the action.
// But since the VirtualTimeScheduler is used for testing, VirtualActions
// must be immutable so they can be inspected later.
var action = new VirtualAction(this.scheduler, this.work);
this.add(action);
return action.schedule(state, delay);
};
VirtualAction.prototype.requestAsyncId = function (scheduler, id, delay) {
if (delay === void 0) {
delay = 0;
}
this.delay = scheduler.frame + delay;
var actions = scheduler.actions;
actions.push(this);
actions.sort(VirtualAction.sortActions);
return true;
};
VirtualAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
if (delay === void 0) {
delay = 0;
}
return undefined;
};
VirtualAction.prototype._execute = function (state, delay) {
if (this.active === true) {
return _super.prototype._execute.call(this, state, delay);
}
};
VirtualAction.sortActions = function (a, b) {
if (a.delay === b.delay) {
if (a.index === b.index) {
return 0;
}
else if (a.index > b.index) {
return 1;
}
else {
return -1;
}
}
else if (a.delay > b.delay) {
return 1;
}
else {
return -1;
}
};
return VirtualAction;
}(_AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"]));
//# sourceMappingURL=VirtualTimeScheduler.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/animationFrame.js":
/*!**********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/animationFrame.js ***!
\**********************************************************************/
/*! exports provided: animationFrame */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "animationFrame", function() { return animationFrame; });
/* harmony import */ var _AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AnimationFrameAction */ "./node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameAction.js");
/* harmony import */ var _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AnimationFrameScheduler */ "./node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameScheduler.js");
/** PURE_IMPORTS_START _AnimationFrameAction,_AnimationFrameScheduler PURE_IMPORTS_END */
/**
*
* Animation Frame Scheduler
*
* <span class="informal">Perform task when `window.requestAnimationFrame` would fire</span>
*
* When `animationFrame` scheduler is used with delay, it will fall back to {@link async} scheduler
* behaviour.
*
* Without delay, `animationFrame` scheduler can be used to create smooth browser animations.
* It makes sure scheduled task will happen just before next browser content repaint,
* thus performing animations as efficiently as possible.
*
* @example <caption>Schedule div height animation</caption>
* const div = document.querySelector('.some-div');
*
* Rx.Scheduler.animationFrame.schedule(function(height) {
* div.style.height = height + "px";
*
* this.schedule(height + 1); // `this` references currently executing Action,
* // which we reschedule with new state
* }, 0, 0);
*
* // You will see .some-div element growing in height
*
*
* @static true
* @name animationFrame
* @owner Scheduler
*/
var animationFrame = /*@__PURE__*/ new _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__["AnimationFrameScheduler"](_AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__["AnimationFrameAction"]);
//# sourceMappingURL=animationFrame.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/asap.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/asap.js ***!
\************************************************************/
/*! exports provided: asap */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asap", function() { return asap; });
/* harmony import */ var _AsapAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsapAction */ "./node_modules/rxjs/_esm5/internal/scheduler/AsapAction.js");
/* harmony import */ var _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsapScheduler */ "./node_modules/rxjs/_esm5/internal/scheduler/AsapScheduler.js");
/** PURE_IMPORTS_START _AsapAction,_AsapScheduler PURE_IMPORTS_END */
/**
*
* Asap Scheduler
*
* <span class="informal">Perform task as fast as it can be performed asynchronously</span>
*
* `asap` scheduler behaves the same as {@link async} scheduler when you use it to delay task
* in time. If however you set delay to `0`, `asap` will wait for current synchronously executing
* code to end and then it will try to execute given task as fast as possible.
*
* `asap` scheduler will do its best to minimize time between end of currently executing code
* and start of scheduled task. This makes it best candidate for performing so called "deferring".
* Traditionally this was achieved by calling `setTimeout(deferredTask, 0)`, but that technique involves
* some (although minimal) unwanted delay.
*
* Note that using `asap` scheduler does not necessarily mean that your task will be first to process
* after currently executing code. In particular, if some task was also scheduled with `asap` before,
* that task will execute first. That being said, if you need to schedule task asynchronously, but
* as soon as possible, `asap` scheduler is your best bet.
*
* @example <caption>Compare async and asap scheduler</caption>
*
* Rx.Scheduler.async.schedule(() => console.log('async')); // scheduling 'async' first...
* Rx.Scheduler.asap.schedule(() => console.log('asap'));
*
* // Logs:
* // "asap"
* // "async"
* // ... but 'asap' goes first!
*
* @static true
* @name asap
* @owner Scheduler
*/
var asap = /*@__PURE__*/ new _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__["AsapScheduler"](_AsapAction__WEBPACK_IMPORTED_MODULE_0__["AsapAction"]);
//# sourceMappingURL=asap.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/async.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/async.js ***!
\*************************************************************/
/*! exports provided: async */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "async", function() { return async; });
/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncAction */ "./node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js");
/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncScheduler */ "./node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js");
/** PURE_IMPORTS_START _AsyncAction,_AsyncScheduler PURE_IMPORTS_END */
/**
*
* Async Scheduler
*
* <span class="informal">Schedule task as if you used setTimeout(task, duration)</span>
*
* `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript
* event loop queue. It is best used to delay tasks in time or to schedule tasks repeating
* in intervals.
*
* If you just want to "defer" task, that is to perform it right after currently
* executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),
* better choice will be the {@link asap} scheduler.
*
* @example <caption>Use async scheduler to delay task</caption>
* const task = () => console.log('it works!');
*
* Rx.Scheduler.async.schedule(task, 2000);
*
* // After 2 seconds logs:
* // "it works!"
*
*
* @example <caption>Use async scheduler to repeat task in intervals</caption>
* function task(state) {
* console.log(state);
* this.schedule(state + 1, 1000); // `this` references currently executing Action,
* // which we reschedule with new state and delay
* }
*
* Rx.Scheduler.async.schedule(task, 3000, 0);
*
* // Logs:
* // 0 after 3s
* // 1 after 4s
* // 2 after 5s
* // 3 after 6s
*
* @static true
* @name async
* @owner Scheduler
*/
var async = /*@__PURE__*/ new _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"](_AsyncAction__WEBPACK_IMPORTED_MODULE_0__["AsyncAction"]);
//# sourceMappingURL=async.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/scheduler/queue.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/scheduler/queue.js ***!
\*************************************************************/
/*! exports provided: queue */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "queue", function() { return queue; });
/* harmony import */ var _QueueAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./QueueAction */ "./node_modules/rxjs/_esm5/internal/scheduler/QueueAction.js");
/* harmony import */ var _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./QueueScheduler */ "./node_modules/rxjs/_esm5/internal/scheduler/QueueScheduler.js");
/** PURE_IMPORTS_START _QueueAction,_QueueScheduler PURE_IMPORTS_END */
/**
*
* Queue Scheduler
*
* <span class="informal">Put every next task on a queue, instead of executing it immediately</span>
*
* `queue` scheduler, when used with delay, behaves the same as {@link async} scheduler.
*
* When used without delay, it schedules given task synchronously - executes it right when
* it is scheduled. However when called recursively, that is when inside the scheduled task,
* another task is scheduled with queue scheduler, instead of executing immediately as well,
* that task will be put on a queue and wait for current one to finish.
*
* This means that when you execute task with `queue` scheduler, you are sure it will end
* before any other task scheduled with that scheduler will start.
*
* @examples <caption>Schedule recursively first, then do something</caption>
*
* Rx.Scheduler.queue.schedule(() => {
* Rx.Scheduler.queue.schedule(() => console.log('second')); // will not happen now, but will be put on a queue
*
* console.log('first');
* });
*
* // Logs:
* // "first"
* // "second"
*
*
* @example <caption>Reschedule itself recursively</caption>
*
* Rx.Scheduler.queue.schedule(function(state) {
* if (state !== 0) {
* console.log('before', state);
* this.schedule(state - 1); // `this` references currently executing Action,
* // which we reschedule with new state
* console.log('after', state);
* }
* }, 0, 3);
*
* // In scheduler that runs recursively, you would expect:
* // "before", 3
* // "before", 2
* // "before", 1
* // "after", 1
* // "after", 2
* // "after", 3
*
* // But with queue it logs:
* // "before", 3
* // "after", 3
* // "before", 2
* // "after", 2
* // "before", 1
* // "after", 1
*
*
* @static true
* @name queue
* @owner Scheduler
*/
var queue = /*@__PURE__*/ new _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__["QueueScheduler"](_QueueAction__WEBPACK_IMPORTED_MODULE_0__["QueueAction"]);
//# sourceMappingURL=queue.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/symbol/iterator.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/symbol/iterator.js ***!
\*************************************************************/
/*! exports provided: getSymbolIterator, iterator, $$iterator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSymbolIterator", function() { return getSymbolIterator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iterator", function() { return iterator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$$iterator", function() { return $$iterator; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
function getSymbolIterator() {
if (typeof Symbol !== 'function' || !Symbol.iterator) {
return '@@iterator';
}
return Symbol.iterator;
}
var iterator = /*@__PURE__*/ getSymbolIterator();
/**
* @deprecated use {@link iterator} instead
*/
var $$iterator = iterator;
//# sourceMappingURL=iterator.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/symbol/observable.js":
/*!***************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/symbol/observable.js ***!
\***************************************************************/
/*! exports provided: observable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return observable; });
/** Symbol.observable or a string "@@observable". Used for interop */
/** PURE_IMPORTS_START PURE_IMPORTS_END */
var observable = typeof Symbol === 'function' && Symbol.observable || '@@observable';
//# sourceMappingURL=observable.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js":
/*!*****************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js ***!
\*****************************************************************/
/*! exports provided: rxSubscriber, $$rxSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rxSubscriber", function() { return rxSubscriber; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$$rxSubscriber", function() { return $$rxSubscriber; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
var rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'function')
? /*@__PURE__*/ Symbol.for('rxSubscriber')
: '@@rxSubscriber';
/**
* @deprecated use rxSubscriber instead
*/
var $$rxSubscriber = rxSubscriber;
//# sourceMappingURL=rxSubscriber.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js":
/*!**************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js ***!
\**************************************************************************/
/*! exports provided: ArgumentOutOfRangeError */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return ArgumentOutOfRangeError; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/** PURE_IMPORTS_START tslib PURE_IMPORTS_END */
/**
* An error thrown when an element was queried at a certain index of an
* Observable, but no such index or position exists in that sequence.
*
* @see {@link elementAt}
* @see {@link take}
* @see {@link takeLast}
*
* @class ArgumentOutOfRangeError
*/
var ArgumentOutOfRangeError = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ArgumentOutOfRangeError, _super);
function ArgumentOutOfRangeError() {
var _this = _super.call(this, 'argument out of range') || this;
_this.name = 'ArgumentOutOfRangeError';
Object.setPrototypeOf(_this, ArgumentOutOfRangeError.prototype);
return _this;
}
return ArgumentOutOfRangeError;
}(Error));
//# sourceMappingURL=ArgumentOutOfRangeError.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/EmptyError.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/EmptyError.js ***!
\*************************************************************/
/*! exports provided: EmptyError */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return EmptyError; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/** PURE_IMPORTS_START tslib PURE_IMPORTS_END */
/**
* An error thrown when an Observable or a sequence was queried but has no
* elements.
*
* @see {@link first}
* @see {@link last}
* @see {@link single}
*
* @class EmptyError
*/
var EmptyError = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](EmptyError, _super);
function EmptyError() {
var _this = _super.call(this, 'no elements in sequence') || this;
_this.name = 'EmptyError';
Object.setPrototypeOf(_this, EmptyError.prototype);
return _this;
}
return EmptyError;
}(Error));
//# sourceMappingURL=EmptyError.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/Immediate.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/Immediate.js ***!
\************************************************************/
/*! exports provided: Immediate */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Immediate", function() { return Immediate; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
var nextHandle = 1;
var tasksByHandle = {};
function runIfPresent(handle) {
var cb = tasksByHandle[handle];
if (cb) {
cb();
}
}
var Immediate = {
setImmediate: function (cb) {
var handle = nextHandle++;
tasksByHandle[handle] = cb;
Promise.resolve().then(function () { return runIfPresent(handle); });
return handle;
},
clearImmediate: function (handle) {
delete tasksByHandle[handle];
},
};
//# sourceMappingURL=Immediate.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js":
/*!**************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js ***!
\**************************************************************************/
/*! exports provided: ObjectUnsubscribedError */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return ObjectUnsubscribedError; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/** PURE_IMPORTS_START tslib PURE_IMPORTS_END */
/**
* An error thrown when an action is invalid because the object has been
* unsubscribed.
*
* @see {@link Subject}
* @see {@link BehaviorSubject}
*
* @class ObjectUnsubscribedError
*/
var ObjectUnsubscribedError = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ObjectUnsubscribedError, _super);
function ObjectUnsubscribedError() {
var _this = _super.call(this, 'object unsubscribed') || this;
_this.name = 'ObjectUnsubscribedError';
Object.setPrototypeOf(_this, ObjectUnsubscribedError.prototype);
return _this;
}
return ObjectUnsubscribedError;
}(Error));
//# sourceMappingURL=ObjectUnsubscribedError.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/TimeoutError.js":
/*!***************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/TimeoutError.js ***!
\***************************************************************/
/*! exports provided: TimeoutError */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return TimeoutError; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/** PURE_IMPORTS_START tslib PURE_IMPORTS_END */
/**
* An error thrown when duetime elapses.
*
* @see {@link timeout}
*
* @class TimeoutError
*/
var TimeoutError = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TimeoutError, _super);
function TimeoutError() {
var _this = _super.call(this, 'Timeout has occurred') || this;
Object.setPrototypeOf(_this, TimeoutError.prototype);
return _this;
}
return TimeoutError;
}(Error));
//# sourceMappingURL=TimeoutError.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js":
/*!**********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js ***!
\**********************************************************************/
/*! exports provided: UnsubscriptionError */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return UnsubscriptionError; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/** PURE_IMPORTS_START tslib PURE_IMPORTS_END */
/**
* An error thrown when one or more errors have occurred during the
* `unsubscribe` of a {@link Subscription}.
*/
var UnsubscriptionError = /*@__PURE__*/ (function (_super) {
tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](UnsubscriptionError, _super);
function UnsubscriptionError(errors) {
var _this = _super.call(this, errors ?
errors.length + " errors occurred during unsubscription:\n " + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ') : '') || this;
_this.errors = errors;
_this.name = 'UnsubscriptionError';
Object.setPrototypeOf(_this, UnsubscriptionError.prototype);
return _this;
}
return UnsubscriptionError;
}(Error));
//# sourceMappingURL=UnsubscriptionError.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/errorObject.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/errorObject.js ***!
\**************************************************************/
/*! exports provided: errorObject */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "errorObject", function() { return errorObject; });
// typeof any so that it we don't have to cast when comparing a result to the error object
/** PURE_IMPORTS_START PURE_IMPORTS_END */
var errorObject = { e: {} };
//# sourceMappingURL=errorObject.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/hostReportError.js":
/*!******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/hostReportError.js ***!
\******************************************************************/
/*! exports provided: hostReportError */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hostReportError", function() { return hostReportError; });
/**
* Throws an error on another job so that it's picked up by the runtime's
* uncaught error handling mechanism.
* @param err the error to throw
*/
/** PURE_IMPORTS_START PURE_IMPORTS_END */
function hostReportError(err) {
setTimeout(function () { throw err; });
}
//# sourceMappingURL=hostReportError.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/identity.js":
/*!***********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/identity.js ***!
\***********************************************************/
/*! exports provided: identity */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
function identity(x) {
return x;
}
//# sourceMappingURL=identity.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/isArray.js":
/*!**********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/isArray.js ***!
\**********************************************************/
/*! exports provided: isArray */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
var isArray = Array.isArray || (function (x) { return x && typeof x.length === 'number'; });
//# sourceMappingURL=isArray.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/isArrayLike.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/isArrayLike.js ***!
\**************************************************************/
/*! exports provided: isArrayLike */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return isArrayLike; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });
//# sourceMappingURL=isArrayLike.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/isDate.js":
/*!*********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/isDate.js ***!
\*********************************************************/
/*! exports provided: isDate */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return isDate; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
function isDate(value) {
return value instanceof Date && !isNaN(+value);
}
//# sourceMappingURL=isDate.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/isFunction.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/isFunction.js ***!
\*************************************************************/
/*! exports provided: isFunction */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
function isFunction(x) {
return typeof x === 'function';
}
//# sourceMappingURL=isFunction.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/isInteropObservable.js":
/*!**********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/isInteropObservable.js ***!
\**********************************************************************/
/*! exports provided: isInteropObservable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInteropObservable", function() { return isInteropObservable; });
/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/observable */ "./node_modules/rxjs/_esm5/internal/symbol/observable.js");
/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */
/** Identifies an input as being Observable (but not necessary an Rx Observable) */
function isInteropObservable(input) {
return input && typeof input[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__["observable"]] === 'function';
}
//# sourceMappingURL=isInteropObservable.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/isIterable.js":
/*!*************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/isIterable.js ***!
\*************************************************************/
/*! exports provided: isIterable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIterable", function() { return isIterable; });
/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/iterator */ "./node_modules/rxjs/_esm5/internal/symbol/iterator.js");
/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */
/** Identifies an input as being an Iterable */
function isIterable(input) {
return input && typeof input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__["iterator"]] === 'function';
}
//# sourceMappingURL=isIterable.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/isNumeric.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/isNumeric.js ***!
\************************************************************/
/*! exports provided: isNumeric */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumeric", function() { return isNumeric; });
/* harmony import */ var _isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js");
/** PURE_IMPORTS_START _isArray PURE_IMPORTS_END */
function isNumeric(val) {
// parseFloat NaNs numeric-cast false positives (null|true|false|"")
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
// subtraction forces infinities to NaN
// adding 1 corrects loss of precision from parseFloat (#15100)
return !Object(_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(val) && (val - parseFloat(val) + 1) >= 0;
}
//# sourceMappingURL=isNumeric.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/isObject.js":
/*!***********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/isObject.js ***!
\***********************************************************/
/*! exports provided: isObject */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
function isObject(x) {
return x != null && typeof x === 'object';
}
//# sourceMappingURL=isObject.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/isObservable.js":
/*!***************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/isObservable.js ***!
\***************************************************************/
/*! exports provided: isObservable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return isObservable; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
/**
* Tests to see if the object is an RxJS {@link Observable}
* @param obj the object to test
*/
function isObservable(obj) {
return obj && obj instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"] || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function');
}
//# sourceMappingURL=isObservable.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/isPromise.js":
/*!************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/isPromise.js ***!
\************************************************************/
/*! exports provided: isPromise */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromise", function() { return isPromise; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
function isPromise(value) {
return value && typeof value.subscribe !== 'function' && typeof value.then === 'function';
}
//# sourceMappingURL=isPromise.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/isScheduler.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/isScheduler.js ***!
\**************************************************************/
/*! exports provided: isScheduler */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isScheduler", function() { return isScheduler; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
function isScheduler(value) {
return value && typeof value.schedule === 'function';
}
//# sourceMappingURL=isScheduler.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/noop.js":
/*!*******************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/noop.js ***!
\*******************************************************/
/*! exports provided: noop */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return noop; });
/* tslint:disable:no-empty */
/** PURE_IMPORTS_START PURE_IMPORTS_END */
function noop() { }
//# sourceMappingURL=noop.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/not.js":
/*!******************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/not.js ***!
\******************************************************/
/*! exports provided: not */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "not", function() { return not; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
function not(pred, thisArg) {
function notPred() {
return !(notPred.pred.apply(notPred.thisArg, arguments));
}
notPred.pred = pred;
notPred.thisArg = thisArg;
return notPred;
}
//# sourceMappingURL=not.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/pipe.js":
/*!*******************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/pipe.js ***!
\*******************************************************/
/*! exports provided: pipe, pipeFromArray */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return pipe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pipeFromArray", function() { return pipeFromArray; });
/* harmony import */ var _noop__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./noop */ "./node_modules/rxjs/_esm5/internal/util/noop.js");
/** PURE_IMPORTS_START _noop PURE_IMPORTS_END */
/* tslint:enable:max-line-length */
function pipe() {
var fns = [];
for (var _i = 0; _i < arguments.length; _i++) {
fns[_i] = arguments[_i];
}
return pipeFromArray(fns);
}
/* @internal */
function pipeFromArray(fns) {
if (!fns) {
return _noop__WEBPACK_IMPORTED_MODULE_0__["noop"];
}
if (fns.length === 1) {
return fns[0];
}
return function piped(input) {
return fns.reduce(function (prev, fn) { return fn(prev); }, input);
};
}
//# sourceMappingURL=pipe.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/subscribeTo.js":
/*!**************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/subscribeTo.js ***!
\**************************************************************/
/*! exports provided: subscribeTo */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeTo", function() { return subscribeTo; });
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js");
/* harmony import */ var _subscribeToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscribeToArray */ "./node_modules/rxjs/_esm5/internal/util/subscribeToArray.js");
/* harmony import */ var _subscribeToPromise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./subscribeToPromise */ "./node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js");
/* harmony import */ var _subscribeToIterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./subscribeToIterable */ "./node_modules/rxjs/_esm5/internal/util/subscribeToIterable.js");
/* harmony import */ var _subscribeToObservable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./subscribeToObservable */ "./node_modules/rxjs/_esm5/internal/util/subscribeToObservable.js");
/* harmony import */ var _isArrayLike__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArrayLike */ "./node_modules/rxjs/_esm5/internal/util/isArrayLike.js");
/* harmony import */ var _isPromise__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isPromise */ "./node_modules/rxjs/_esm5/internal/util/isPromise.js");
/* harmony import */ var _isObject__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isObject */ "./node_modules/rxjs/_esm5/internal/util/isObject.js");
/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../symbol/iterator */ "./node_modules/rxjs/_esm5/internal/symbol/iterator.js");
/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../symbol/observable */ "./node_modules/rxjs/_esm5/internal/symbol/observable.js");
/** PURE_IMPORTS_START _Observable,_subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */
var subscribeTo = function (result) {
if (result instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) {
return function (subscriber) {
if (result._isScalar) {
subscriber.next(result.value);
subscriber.complete();
return undefined;
}
else {
return result.subscribe(subscriber);
}
};
}
else if (Object(_isArrayLike__WEBPACK_IMPORTED_MODULE_5__["isArrayLike"])(result)) {
return Object(_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__["subscribeToArray"])(result);
}
else if (Object(_isPromise__WEBPACK_IMPORTED_MODULE_6__["isPromise"])(result)) {
return Object(_subscribeToPromise__WEBPACK_IMPORTED_MODULE_2__["subscribeToPromise"])(result);
}
else if (result && typeof result[_symbol_iterator__WEBPACK_IMPORTED_MODULE_8__["iterator"]] === 'function') {
return Object(_subscribeToIterable__WEBPACK_IMPORTED_MODULE_3__["subscribeToIterable"])(result);
}
else if (result && typeof result[_symbol_observable__WEBPACK_IMPORTED_MODULE_9__["observable"]] === 'function') {
return Object(_subscribeToObservable__WEBPACK_IMPORTED_MODULE_4__["subscribeToObservable"])(result);
}
else {
var value = Object(_isObject__WEBPACK_IMPORTED_MODULE_7__["isObject"])(result) ? 'an invalid object' : "'" + result + "'";
var msg = "You provided " + value + " where a stream was expected."
+ ' You can provide an Observable, Promise, Array, or Iterable.';
throw new TypeError(msg);
}
};
//# sourceMappingURL=subscribeTo.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/subscribeToArray.js":
/*!*******************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/subscribeToArray.js ***!
\*******************************************************************/
/*! exports provided: subscribeToArray */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToArray", function() { return subscribeToArray; });
/**
* Subscribes to an ArrayLike with a subscriber
* @param array The array or array-like to subscribe to
*/
/** PURE_IMPORTS_START PURE_IMPORTS_END */
var subscribeToArray = function (array) {
return function (subscriber) {
for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) {
subscriber.next(array[i]);
}
if (!subscriber.closed) {
subscriber.complete();
}
};
};
//# sourceMappingURL=subscribeToArray.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/subscribeToIterable.js":
/*!**********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/subscribeToIterable.js ***!
\**********************************************************************/
/*! exports provided: subscribeToIterable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToIterable", function() { return subscribeToIterable; });
/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/iterator */ "./node_modules/rxjs/_esm5/internal/symbol/iterator.js");
/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */
var subscribeToIterable = function (iterable) {
return function (subscriber) {
var iterator = iterable[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__["iterator"]]();
do {
var item = iterator.next();
if (item.done) {
subscriber.complete();
break;
}
subscriber.next(item.value);
if (subscriber.closed) {
break;
}
} while (true);
// Finalize the iterator if it happens to be a Generator
if (typeof iterator.return === 'function') {
subscriber.add(function () {
if (iterator.return) {
iterator.return();
}
});
}
return subscriber;
};
};
//# sourceMappingURL=subscribeToIterable.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/subscribeToObservable.js":
/*!************************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/subscribeToObservable.js ***!
\************************************************************************/
/*! exports provided: subscribeToObservable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToObservable", function() { return subscribeToObservable; });
/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/observable */ "./node_modules/rxjs/_esm5/internal/symbol/observable.js");
/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */
/**
* Subscribes to an object that implements Symbol.observable with the given
* Subscriber.
* @param obj An object that implements Symbol.observable
*/
var subscribeToObservable = function (obj) {
return function (subscriber) {
var obs = obj[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__["observable"]]();
if (typeof obs.subscribe !== 'function') {
// Should be caught by observable subscribe function error handling.
throw new TypeError('Provided object does not correctly implement Symbol.observable');
}
else {
return obs.subscribe(subscriber);
}
};
};
//# sourceMappingURL=subscribeToObservable.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js":
/*!*********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js ***!
\*********************************************************************/
/*! exports provided: subscribeToPromise */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToPromise", function() { return subscribeToPromise; });
/* harmony import */ var _hostReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hostReportError */ "./node_modules/rxjs/_esm5/internal/util/hostReportError.js");
/** PURE_IMPORTS_START _hostReportError PURE_IMPORTS_END */
var subscribeToPromise = function (promise) {
return function (subscriber) {
promise.then(function (value) {
if (!subscriber.closed) {
subscriber.next(value);
subscriber.complete();
}
}, function (err) { return subscriber.error(err); })
.then(null, _hostReportError__WEBPACK_IMPORTED_MODULE_0__["hostReportError"]);
return subscriber;
};
};
//# sourceMappingURL=subscribeToPromise.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js":
/*!********************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js ***!
\********************************************************************/
/*! exports provided: subscribeToResult */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToResult", function() { return subscribeToResult; });
/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../InnerSubscriber */ "./node_modules/rxjs/_esm5/internal/InnerSubscriber.js");
/* harmony import */ var _subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscribeTo */ "./node_modules/rxjs/_esm5/internal/util/subscribeTo.js");
/** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo PURE_IMPORTS_END */
function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) {
var destination = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__["InnerSubscriber"](outerSubscriber, outerValue, outerIndex);
return Object(_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(result)(destination);
}
//# sourceMappingURL=subscribeToResult.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/toSubscriber.js":
/*!***************************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/toSubscriber.js ***!
\***************************************************************/
/*! exports provided: toSubscriber */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toSubscriber", function() { return toSubscriber; });
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js");
/* harmony import */ var _symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../symbol/rxSubscriber */ "./node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js");
/* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Observer */ "./node_modules/rxjs/_esm5/internal/Observer.js");
/** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */
function toSubscriber(nextOrObserver, error, complete) {
if (nextOrObserver) {
if (nextOrObserver instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"]) {
return nextOrObserver;
}
if (nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__["rxSubscriber"]]) {
return nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__["rxSubscriber"]]();
}
}
if (!nextOrObserver && !error && !complete) {
return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](_Observer__WEBPACK_IMPORTED_MODULE_2__["empty"]);
}
return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](nextOrObserver, error, complete);
}
//# sourceMappingURL=toSubscriber.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/internal/util/tryCatch.js":
/*!***********************************************************!*\
!*** ./node_modules/rxjs/_esm5/internal/util/tryCatch.js ***!
\***********************************************************/
/*! exports provided: tryCatch */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tryCatch", function() { return tryCatch; });
/* harmony import */ var _errorObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errorObject */ "./node_modules/rxjs/_esm5/internal/util/errorObject.js");
/** PURE_IMPORTS_START _errorObject PURE_IMPORTS_END */
var tryCatchTarget;
function tryCatcher() {
try {
return tryCatchTarget.apply(this, arguments);
}
catch (e) {
_errorObject__WEBPACK_IMPORTED_MODULE_0__["errorObject"].e = e;
return _errorObject__WEBPACK_IMPORTED_MODULE_0__["errorObject"];
}
}
function tryCatch(fn) {
tryCatchTarget = fn;
return tryCatcher;
}
//# sourceMappingURL=tryCatch.js.map
/***/ }),
/***/ "./node_modules/rxjs/_esm5/operators/index.js":
/*!****************************************************!*\
!*** ./node_modules/rxjs/_esm5/operators/index.js ***!
\****************************************************/
/*! exports provided: audit, auditTime, buffer, bufferCount, bufferTime, bufferToggle, bufferWhen, catchError, combineAll, combineLatest, concat, concatAll, concatMap, concatMapTo, count, debounce, debounceTime, defaultIfEmpty, delay, delayWhen, dematerialize, distinct, distinctUntilChanged, distinctUntilKeyChanged, elementAt, every, exhaust, exhaustMap, expand, filter, finalize, find, findIndex, first, groupBy, ignoreElements, isEmpty, last, map, mapTo, materialize, max, merge, mergeAll, mergeMap, flatMap, mergeMapTo, mergeScan, min, multicast, observeOn, onErrorResumeNext, pairwise, partition, pluck, publish, publishBehavior, publishLast, publishReplay, race, reduce, repeat, repeatWhen, retry, retryWhen, refCount, sample, sampleTime, scan, sequenceEqual, share, shareReplay, single, skip, skipLast, skipUntil, skipWhile, startWith, subscribeOn, switchAll, switchMap, switchMapTo, take, takeLast, takeUntil, takeWhile, tap, throttle, throttleTime, throwIfEmpty, timeInterval, timeout, timeoutWith, timestamp, toArray, window, windowCount, windowTime, windowToggle, windowWhen, withLatestFrom, zip, zipAll */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../internal/operators/audit */ "./node_modules/rxjs/_esm5/internal/operators/audit.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__["audit"]; });
/* harmony import */ var _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../internal/operators/auditTime */ "./node_modules/rxjs/_esm5/internal/operators/auditTime.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__["auditTime"]; });
/* harmony import */ var _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../internal/operators/buffer */ "./node_modules/rxjs/_esm5/internal/operators/buffer.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__["buffer"]; });
/* harmony import */ var _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../internal/operators/bufferCount */ "./node_modules/rxjs/_esm5/internal/operators/bufferCount.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__["bufferCount"]; });
/* harmony import */ var _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../internal/operators/bufferTime */ "./node_modules/rxjs/_esm5/internal/operators/bufferTime.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__["bufferTime"]; });
/* harmony import */ var _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../internal/operators/bufferToggle */ "./node_modules/rxjs/_esm5/internal/operators/bufferToggle.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__["bufferToggle"]; });
/* harmony import */ var _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../internal/operators/bufferWhen */ "./node_modules/rxjs/_esm5/internal/operators/bufferWhen.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__["bufferWhen"]; });
/* harmony import */ var _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../internal/operators/catchError */ "./node_modules/rxjs/_esm5/internal/operators/catchError.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__["catchError"]; });
/* harmony import */ var _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../internal/operators/combineAll */ "./node_modules/rxjs/_esm5/internal/operators/combineAll.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__["combineAll"]; });
/* harmony import */ var _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../internal/operators/combineLatest */ "./node_modules/rxjs/_esm5/internal/operators/combineLatest.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__["combineLatest"]; });
/* harmony import */ var _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../internal/operators/concat */ "./node_modules/rxjs/_esm5/internal/operators/concat.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__["concat"]; });
/* harmony import */ var _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../internal/operators/concatAll */ "./node_modules/rxjs/_esm5/internal/operators/concatAll.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__["concatAll"]; });
/* harmony import */ var _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../internal/operators/concatMap */ "./node_modules/rxjs/_esm5/internal/operators/concatMap.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__["concatMap"]; });
/* harmony import */ var _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../internal/operators/concatMapTo */ "./node_modules/rxjs/_esm5/internal/operators/concatMapTo.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__["concatMapTo"]; });
/* harmony import */ var _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../internal/operators/count */ "./node_modules/rxjs/_esm5/internal/operators/count.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "count", function() { return _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__["count"]; });
/* harmony import */ var _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../internal/operators/debounce */ "./node_modules/rxjs/_esm5/internal/operators/debounce.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__["debounce"]; });
/* harmony import */ var _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../internal/operators/debounceTime */ "./node_modules/rxjs/_esm5/internal/operators/debounceTime.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__["debounceTime"]; });
/* harmony import */ var _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../internal/operators/defaultIfEmpty */ "./node_modules/rxjs/_esm5/internal/operators/defaultIfEmpty.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__["defaultIfEmpty"]; });
/* harmony import */ var _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../internal/operators/delay */ "./node_modules/rxjs/_esm5/internal/operators/delay.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__["delay"]; });
/* harmony import */ var _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../internal/operators/delayWhen */ "./node_modules/rxjs/_esm5/internal/operators/delayWhen.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__["delayWhen"]; });
/* harmony import */ var _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../internal/operators/dematerialize */ "./node_modules/rxjs/_esm5/internal/operators/dematerialize.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__["dematerialize"]; });
/* harmony import */ var _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../internal/operators/distinct */ "./node_modules/rxjs/_esm5/internal/operators/distinct.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__["distinct"]; });
/* harmony import */ var _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../internal/operators/distinctUntilChanged */ "./node_modules/rxjs/_esm5/internal/operators/distinctUntilChanged.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__["distinctUntilChanged"]; });
/* harmony import */ var _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../internal/operators/distinctUntilKeyChanged */ "./node_modules/rxjs/_esm5/internal/operators/distinctUntilKeyChanged.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__["distinctUntilKeyChanged"]; });
/* harmony import */ var _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../internal/operators/elementAt */ "./node_modules/rxjs/_esm5/internal/operators/elementAt.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__["elementAt"]; });
/* harmony import */ var _internal_operators_every__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../internal/operators/every */ "./node_modules/rxjs/_esm5/internal/operators/every.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _internal_operators_every__WEBPACK_IMPORTED_MODULE_25__["every"]; });
/* harmony import */ var _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../internal/operators/exhaust */ "./node_modules/rxjs/_esm5/internal/operators/exhaust.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_26__["exhaust"]; });
/* harmony import */ var _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../internal/operators/exhaustMap */ "./node_modules/rxjs/_esm5/internal/operators/exhaustMap.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_27__["exhaustMap"]; });
/* harmony import */ var _internal_operators_expand__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../internal/operators/expand */ "./node_modules/rxjs/_esm5/internal/operators/expand.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return _internal_operators_expand__WEBPACK_IMPORTED_MODULE_28__["expand"]; });
/* harmony import */ var _internal_operators_filter__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../internal/operators/filter */ "./node_modules/rxjs/_esm5/internal/operators/filter.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _internal_operators_filter__WEBPACK_IMPORTED_MODULE_29__["filter"]; });
/* harmony import */ var _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../internal/operators/finalize */ "./node_modules/rxjs/_esm5/internal/operators/finalize.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_30__["finalize"]; });
/* harmony import */ var _internal_operators_find__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../internal/operators/find */ "./node_modules/rxjs/_esm5/internal/operators/find.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _internal_operators_find__WEBPACK_IMPORTED_MODULE_31__["find"]; });
/* harmony import */ var _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../internal/operators/findIndex */ "./node_modules/rxjs/_esm5/internal/operators/findIndex.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_32__["findIndex"]; });
/* harmony import */ var _internal_operators_first__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../internal/operators/first */ "./node_modules/rxjs/_esm5/internal/operators/first.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _internal_operators_first__WEBPACK_IMPORTED_MODULE_33__["first"]; });
/* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../internal/operators/groupBy */ "./node_modules/rxjs/_esm5/internal/operators/groupBy.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_34__["groupBy"]; });
/* harmony import */ var _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../internal/operators/ignoreElements */ "./node_modules/rxjs/_esm5/internal/operators/ignoreElements.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_35__["ignoreElements"]; });
/* harmony import */ var _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../internal/operators/isEmpty */ "./node_modules/rxjs/_esm5/internal/operators/isEmpty.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_36__["isEmpty"]; });
/* harmony import */ var _internal_operators_last__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../internal/operators/last */ "./node_modules/rxjs/_esm5/internal/operators/last.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _internal_operators_last__WEBPACK_IMPORTED_MODULE_37__["last"]; });
/* harmony import */ var _internal_operators_map__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../internal/operators/map */ "./node_modules/rxjs/_esm5/internal/operators/map.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _internal_operators_map__WEBPACK_IMPORTED_MODULE_38__["map"]; });
/* harmony import */ var _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../internal/operators/mapTo */ "./node_modules/rxjs/_esm5/internal/operators/mapTo.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_39__["mapTo"]; });
/* harmony import */ var _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../internal/operators/materialize */ "./node_modules/rxjs/_esm5/internal/operators/materialize.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_40__["materialize"]; });
/* harmony import */ var _internal_operators_max__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../internal/operators/max */ "./node_modules/rxjs/_esm5/internal/operators/max.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _internal_operators_max__WEBPACK_IMPORTED_MODULE_41__["max"]; });
/* harmony import */ var _internal_operators_merge__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../internal/operators/merge */ "./node_modules/rxjs/_esm5/internal/operators/merge.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_operators_merge__WEBPACK_IMPORTED_MODULE_42__["merge"]; });
/* harmony import */ var _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ../internal/operators/mergeAll */ "./node_modules/rxjs/_esm5/internal/operators/mergeAll.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_43__["mergeAll"]; });
/* harmony import */ var _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ../internal/operators/mergeMap */ "./node_modules/rxjs/_esm5/internal/operators/mergeMap.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_44__["mergeMap"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_44__["mergeMap"]; });
/* harmony import */ var _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ../internal/operators/mergeMapTo */ "./node_modules/rxjs/_esm5/internal/operators/mergeMapTo.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_45__["mergeMapTo"]; });
/* harmony import */ var _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ../internal/operators/mergeScan */ "./node_modules/rxjs/_esm5/internal/operators/mergeScan.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_46__["mergeScan"]; });
/* harmony import */ var _internal_operators_min__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ../internal/operators/min */ "./node_modules/rxjs/_esm5/internal/operators/min.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _internal_operators_min__WEBPACK_IMPORTED_MODULE_47__["min"]; });
/* harmony import */ var _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ../internal/operators/multicast */ "./node_modules/rxjs/_esm5/internal/operators/multicast.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_48__["multicast"]; });
/* harmony import */ var _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ../internal/operators/observeOn */ "./node_modules/rxjs/_esm5/internal/operators/observeOn.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_49__["observeOn"]; });
/* harmony import */ var _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ../internal/operators/onErrorResumeNext */ "./node_modules/rxjs/_esm5/internal/operators/onErrorResumeNext.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_50__["onErrorResumeNext"]; });
/* harmony import */ var _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ../internal/operators/pairwise */ "./node_modules/rxjs/_esm5/internal/operators/pairwise.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_51__["pairwise"]; });
/* harmony import */ var _internal_operators_partition__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ../internal/operators/partition */ "./node_modules/rxjs/_esm5/internal/operators/partition.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_operators_partition__WEBPACK_IMPORTED_MODULE_52__["partition"]; });
/* harmony import */ var _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ../internal/operators/pluck */ "./node_modules/rxjs/_esm5/internal/operators/pluck.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_53__["pluck"]; });
/* harmony import */ var _internal_operators_publish__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ../internal/operators/publish */ "./node_modules/rxjs/_esm5/internal/operators/publish.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return _internal_operators_publish__WEBPACK_IMPORTED_MODULE_54__["publish"]; });
/* harmony import */ var _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ../internal/operators/publishBehavior */ "./node_modules/rxjs/_esm5/internal/operators/publishBehavior.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_55__["publishBehavior"]; });
/* harmony import */ var _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ../internal/operators/publishLast */ "./node_modules/rxjs/_esm5/internal/operators/publishLast.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_56__["publishLast"]; });
/* harmony import */ var _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ../internal/operators/publishReplay */ "./node_modules/rxjs/_esm5/internal/operators/publishReplay.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_57__["publishReplay"]; });
/* harmony import */ var _internal_operators_race__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ../internal/operators/race */ "./node_modules/rxjs/_esm5/internal/operators/race.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_operators_race__WEBPACK_IMPORTED_MODULE_58__["race"]; });
/* harmony import */ var _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ../internal/operators/reduce */ "./node_modules/rxjs/_esm5/internal/operators/reduce.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_59__["reduce"]; });
/* harmony import */ var _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ../internal/operators/repeat */ "./node_modules/rxjs/_esm5/internal/operators/repeat.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_60__["repeat"]; });
/* harmony import */ var _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ../internal/operators/repeatWhen */ "./node_modules/rxjs/_esm5/internal/operators/repeatWhen.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_61__["repeatWhen"]; });
/* harmony import */ var _internal_operators_retry__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ../internal/operators/retry */ "./node_modules/rxjs/_esm5/internal/operators/retry.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return _internal_operators_retry__WEBPACK_IMPORTED_MODULE_62__["retry"]; });
/* harmony import */ var _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ../internal/operators/retryWhen */ "./node_modules/rxjs/_esm5/internal/operators/retryWhen.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_63__["retryWhen"]; });
/* harmony import */ var _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ../internal/operators/refCount */ "./node_modules/rxjs/_esm5/internal/operators/refCount.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_64__["refCount"]; });
/* harmony import */ var _internal_operators_sample__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ../internal/operators/sample */ "./node_modules/rxjs/_esm5/internal/operators/sample.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _internal_operators_sample__WEBPACK_IMPORTED_MODULE_65__["sample"]; });
/* harmony import */ var _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ../internal/operators/sampleTime */ "./node_modules/rxjs/_esm5/internal/operators/sampleTime.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_66__["sampleTime"]; });
/* harmony import */ var _internal_operators_scan__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ../internal/operators/scan */ "./node_modules/rxjs/_esm5/internal/operators/scan.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return _internal_operators_scan__WEBPACK_IMPORTED_MODULE_67__["scan"]; });
/* harmony import */ var _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ../internal/operators/sequenceEqual */ "./node_modules/rxjs/_esm5/internal/operators/sequenceEqual.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_68__["sequenceEqual"]; });
/* harmony import */ var _internal_operators_share__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ../internal/operators/share */ "./node_modules/rxjs/_esm5/internal/operators/share.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "share", function() { return _internal_operators_share__WEBPACK_IMPORTED_MODULE_69__["share"]; });
/* harmony import */ var _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ../internal/operators/shareReplay */ "./node_modules/rxjs/_esm5/internal/operators/shareReplay.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_70__["shareReplay"]; });
/* harmony import */ var _internal_operators_single__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ../internal/operators/single */ "./node_modules/rxjs/_esm5/internal/operators/single.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "single", function() { return _internal_operators_single__WEBPACK_IMPORTED_MODULE_71__["single"]; });
/* harmony import */ var _internal_operators_skip__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ../internal/operators/skip */ "./node_modules/rxjs/_esm5/internal/operators/skip.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return _internal_operators_skip__WEBPACK_IMPORTED_MODULE_72__["skip"]; });
/* harmony import */ var _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ../internal/operators/skipLast */ "./node_modules/rxjs/_esm5/internal/operators/skipLast.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_73__["skipLast"]; });
/* harmony import */ var _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ../internal/operators/skipUntil */ "./node_modules/rxjs/_esm5/internal/operators/skipUntil.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_74__["skipUntil"]; });
/* harmony import */ var _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ../internal/operators/skipWhile */ "./node_modules/rxjs/_esm5/internal/operators/skipWhile.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_75__["skipWhile"]; });
/* harmony import */ var _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ../internal/operators/startWith */ "./node_modules/rxjs/_esm5/internal/operators/startWith.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_76__["startWith"]; });
/* harmony import */ var _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ../internal/operators/subscribeOn */ "./node_modules/rxjs/_esm5/internal/operators/subscribeOn.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_77__["subscribeOn"]; });
/* harmony import */ var _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ../internal/operators/switchAll */ "./node_modules/rxjs/_esm5/internal/operators/switchAll.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_78__["switchAll"]; });
/* harmony import */ var _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ../internal/operators/switchMap */ "./node_modules/rxjs/_esm5/internal/operators/switchMap.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_79__["switchMap"]; });
/* harmony import */ var _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ../internal/operators/switchMapTo */ "./node_modules/rxjs/_esm5/internal/operators/switchMapTo.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_80__["switchMapTo"]; });
/* harmony import */ var _internal_operators_take__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ../internal/operators/take */ "./node_modules/rxjs/_esm5/internal/operators/take.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _internal_operators_take__WEBPACK_IMPORTED_MODULE_81__["take"]; });
/* harmony import */ var _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ../internal/operators/takeLast */ "./node_modules/rxjs/_esm5/internal/operators/takeLast.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_82__["takeLast"]; });
/* harmony import */ var _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ../internal/operators/takeUntil */ "./node_modules/rxjs/_esm5/internal/operators/takeUntil.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_83__["takeUntil"]; });
/* harmony import */ var _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ../internal/operators/takeWhile */ "./node_modules/rxjs/_esm5/internal/operators/takeWhile.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_84__["takeWhile"]; });
/* harmony import */ var _internal_operators_tap__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ../internal/operators/tap */ "./node_modules/rxjs/_esm5/internal/operators/tap.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _internal_operators_tap__WEBPACK_IMPORTED_MODULE_85__["tap"]; });
/* harmony import */ var _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ../internal/operators/throttle */ "./node_modules/rxjs/_esm5/internal/operators/throttle.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_86__["throttle"]; });
/* harmony import */ var _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ../internal/operators/throttleTime */ "./node_modules/rxjs/_esm5/internal/operators/throttleTime.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_87__["throttleTime"]; });
/* harmony import */ var _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ../internal/operators/throwIfEmpty */ "./node_modules/rxjs/_esm5/internal/operators/throwIfEmpty.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_88__["throwIfEmpty"]; });
/* harmony import */ var _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ../internal/operators/timeInterval */ "./node_modules/rxjs/_esm5/internal/operators/timeInterval.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_89__["timeInterval"]; });
/* harmony import */ var _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ../internal/operators/timeout */ "./node_modules/rxjs/_esm5/internal/operators/timeout.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_90__["timeout"]; });
/* harmony import */ var _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ../internal/operators/timeoutWith */ "./node_modules/rxjs/_esm5/internal/operators/timeoutWith.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_91__["timeoutWith"]; });
/* harmony import */ var _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ../internal/operators/timestamp */ "./node_modules/rxjs/_esm5/internal/operators/timestamp.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_92__["timestamp"]; });
/* harmony import */ var _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ../internal/operators/toArray */ "./node_modules/rxjs/_esm5/internal/operators/toArray.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_93__["toArray"]; });
/* harmony import */ var _internal_operators_window__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ../internal/operators/window */ "./node_modules/rxjs/_esm5/internal/operators/window.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return _internal_operators_window__WEBPACK_IMPORTED_MODULE_94__["window"]; });
/* harmony import */ var _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ../internal/operators/windowCount */ "./node_modules/rxjs/_esm5/internal/operators/windowCount.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_95__["windowCount"]; });
/* harmony import */ var _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ../internal/operators/windowTime */ "./node_modules/rxjs/_esm5/internal/operators/windowTime.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_96__["windowTime"]; });
/* harmony import */ var _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ../internal/operators/windowToggle */ "./node_modules/rxjs/_esm5/internal/operators/windowToggle.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_97__["windowToggle"]; });
/* harmony import */ var _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ../internal/operators/windowWhen */ "./node_modules/rxjs/_esm5/internal/operators/windowWhen.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_98__["windowWhen"]; });
/* harmony import */ var _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ../internal/operators/withLatestFrom */ "./node_modules/rxjs/_esm5/internal/operators/withLatestFrom.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_99__["withLatestFrom"]; });
/* harmony import */ var _internal_operators_zip__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ../internal/operators/zip */ "./node_modules/rxjs/_esm5/internal/operators/zip.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_operators_zip__WEBPACK_IMPORTED_MODULE_100__["zip"]; });
/* harmony import */ var _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ../internal/operators/zipAll */ "./node_modules/rxjs/_esm5/internal/operators/zipAll.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_101__["zipAll"]; });
/* Operator exports */
/** PURE_IMPORTS_START PURE_IMPORTS_END */
//# sourceMappingURL=index.js.map
/***/ }),
/***/ "./node_modules/tslib/tslib.es6.js":
/*!*****************************************!*\
!*** ./node_modules/tslib/tslib.es6.js ***!
\*****************************************/
/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
return __assign.apply(this, arguments);
}
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
function __exportStar(m, exports) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
function __values(o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
if (m) return m.call(o);
return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result.default = mod;
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
/***/ })
}]);
//# sourceMappingURL=vendor.js.map