text: /**
   * @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
   */
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/collections"),require("rxjs/operators"),require("@angular/core"),require("rxjs"),require("@angular/cdk/bidi"),require("@angular/cdk/coercion"),require("@angular/cdk/a11y"),require("@angular/common")):"function"==typeof define&&define.amd?define("@angular/cdk/tree",["exports","@angular/cdk/collections","rxjs/operators","@angular/core","rxjs","@angular/cdk/bidi","@angular/cdk/coercion","@angular/cdk/a11y","@angular/common"],t):t((e.ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.tree={}),e.ng.cdk.collections,e.rxjs.operators,e.ng.core,e.rxjs,e.ng.cdk.bidi,e.ng.cdk.coercion,e.ng.cdk.a11y,e.ng.common)}(this,function(e,t,r,n,o,i,s,a,d){"use strict";function c(e,t){function r(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function u(){return Error("A valid data source must be provided.")}function l(){return Error("There can only be one default row without a when predicate function.")}function p(){return Error("Could not find a matching node definition for the provided node data.")}function h(){return Error("Could not find a tree control for the tree.")}function f(){return Error("Could not find functions for nested/flat tree in tree control.")}var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},_=function(){function e(){this.expansionModel=new t.SelectionModel(!0)}return e.prototype.toggle=function(e){this.expansionModel.toggle(e)},e.prototype.expand=function(e){this.expansionModel.select(e)},e.prototype.collapse=function(e){this.expansionModel.deselect(e)},e.prototype.isExpanded=function(e){return this.expansionModel.isSelected(e)},e.prototype.toggleDescendants=function(e){this.expansionModel.isSelected(e)?this.collapseDescendants(e):this.expandDescendants(e)},e.prototype.collapseAll=function(){this.expansionModel.clear()},e.prototype.expandDescendants=function(e){var t=[e];t.push.apply(t,this.getDescendants(e)),(r=this.expansionModel).select.apply(r,t);var r},e.prototype.collapseDescendants=function(e){var t=[e];t.push.apply(t,this.getDescendants(e)),(r=this.expansionModel).deselect.apply(r,t);var r},e}(),y=function(e){function t(t,r){var n=e.call(this)||this;return n.getLevel=t,n.isExpandable=r,n}return c(t,e),t.prototype.getDescendants=function(e){for(var t=this.dataNodes.indexOf(e),r=[],n=t+1;n<this.dataNodes.length&&this.getLevel(e)<this.getLevel(this.dataNodes[n]);n++)r.push(this.dataNodes[n]);return r},t.prototype.expandAll=function(){(e=this.expansionModel).select.apply(e,this.dataNodes);var e},t}(_),v=function(e){function t(t){var r=e.call(this)||this;return r.getChildren=t,r}return c(t,e),t.prototype.expandAll=function(){var e=this;this.expansionModel.clear();var t=this.dataNodes.reduce(function(t,r){return t.concat(e.getDescendants(r),[r])},[]);(r=this.expansionModel).select.apply(r,t);var r},t.prototype.getDescendants=function(e){var t=[];return this._getDescendants(t,e),t.splice(1)},t.prototype._getDescendants=function(e,t){var n=this;e.push(t),this.getChildren(t).pipe(r.take(1)).subscribe(function(t){t&&t.length>0&&t.forEach(function(t){return n._getDescendants(e,t)})})},t}(_),b=function(){function e(e){this.$implicit=e}return e}(),C=function(){function e(e){this.template=e}return e.decorators=[{type:n.Directive,args:[{selector:"[cdkTreeNodeDef]",inputs:["when: cdkTreeNodeDefWhen"]}]}],e.ctorParameters=function(){return[{type:n.TemplateRef}]},e}(),D=function(){function e(e){this.viewContainer=e}return e.decorators=[{type:n.Directive,args:[{selector:"[cdkTreeNodeOutlet]"}]}],e.ctorParameters=function(){return[{type:n.ViewContainerRef}]},e}(),m=function(){function e(t,r){this._elementRef=t,this._tree=r,this._destroyed=new o.Subject,this.role="treeitem",e.mostRecentTreeNode=this}return Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e,this._setRoleFromData()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isExpanded",{get:function(){return this._tree.treeControl.isExpanded(this._data)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"level",{get:function(){return this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._data):0},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this._destroyed.next(),this._destroyed.complete()},e.prototype.focus=function(){this._elementRef.nativeElement.focus()},e.prototype._setRoleFromData=function(){var e=this;if(this._tree.treeControl.isExpandable)this.role=this._tree.treeControl.isExpandable(this._data)?"group":"treeitem";else{if(!this._tree.treeControl.getChildren)throw f();this._tree.treeControl.getChildren(this._data).pipe(r.takeUntil(this._destroyed)).subscribe(function(t){e.role=t&&t.length?"group":"treeitem"})}},e.mostRecentTreeNode=null,e.decorators=[{type:n.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"}}]}],e.ctorParameters=function(){return[{type:n.ElementRef},{type:N}]},e.propDecorators={role:[{type:n.Input}]},e}(),N=function(){function e(e,t){this._differs=e,this._changeDetectorRef=t,this._onDestroy=new o.Subject,this._levels=new Map,this.viewChange=new o.BehaviorSubject({start:0,end:Number.MAX_VALUE})}return Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource!==e&&this._switchDataSource(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){if(this._dataDiffer=this._differs.find([]).create(this.trackBy),!this.treeControl)throw h()},e.prototype.ngOnDestroy=function(){this._nodeOutlet.viewContainer.clear(),this._onDestroy.next(),this._onDestroy.complete(),this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null)},e.prototype.ngAfterContentChecked=function(){var e=this._nodeDefs.filter(function(e){return!e.when});if(e.length>1)throw l();this._defaultNodeDef=e[0],this.dataSource&&this._nodeDefs&&!this._dataSubscription&&this._observeRenderChanges()},e.prototype._switchDataSource=function(e){this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null),e||this._nodeOutlet.viewContainer.clear(),this._dataSource=e,this._nodeDefs&&this._observeRenderChanges()},e.prototype._observeRenderChanges=function(){var e,t=this;if("function"==typeof this._dataSource.connect?e=this._dataSource.connect(this):this._dataSource instanceof o.Observable?e=this._dataSource:Array.isArray(this._dataSource)&&(e=o.of(this._dataSource)),!e)throw u();this._dataSubscription=e.pipe(r.takeUntil(this._onDestroy)).subscribe(function(e){return t.renderNodeChanges(e)})},e.prototype.renderNodeChanges=function(e,t,r,n){var o=this;void 0===t&&(t=this._dataDiffer),void 0===r&&(r=this._nodeOutlet.viewContainer);var i=t.diff(e);i&&(i.forEachOperation(function(t,i,s){if(null==t.previousIndex)o.insertNode(e[s],s,r,n);else if(null==s)r.remove(i),o._levels.delete(t.item);else{var a=r.get(i);r.move(a,s)}}),this._changeDetectorRef.detectChanges())},e.prototype._getNodeDef=function(e,t){if(1===this._nodeDefs.length)return this._nodeDefs.first;var r=this._nodeDefs.find(function(r){return r.when&&r.when(t,e)})||this._defaultNodeDef;if(!r)throw p();return r},e.prototype.insertNode=function(e,t,r,n){var o=this._getNodeDef(e,t),i=new b(e);this.treeControl.getLevel?i.level=this.treeControl.getLevel(e):void 0!==n&&this._levels.has(n)?i.level=this._levels.get(n)+1:i.level=0,this._levels.set(e,i.level),(r||this._nodeOutlet.viewContainer).createEmbeddedView(o.template,i,t),m.mostRecentTreeNode&&(m.mostRecentTreeNode.data=e)},e.decorators=[{type:n.Component,args:[{selector:"cdk-tree",exportAs:"cdkTree",template:"<ng-container cdkTreeNodeOutlet></ng-container>",host:{class:"cdk-tree",role:"tree"},encapsulation:n.ViewEncapsulation.None,changeDetection:n.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:n.IterableDiffers},{type:n.ChangeDetectorRef}]},e.propDecorators={dataSource:[{type:n.Input}],treeControl:[{type:n.Input}],trackBy:[{type:n.Input}],_nodeOutlet:[{type:n.ViewChild,args:[D]}],_nodeDefs:[{type:n.ContentChildren,args:[C]}]},e}(),k=function(e){function t(t,r,n){var o=e.call(this,t,r)||this;return o._elementRef=t,o._tree=r,o._differs=n,o}return c(t,e),t.prototype.ngAfterContentInit=function(){var e=this;if(this._dataDiffer=this._differs.find([]).create(this._tree.trackBy),!this._tree.treeControl.getChildren)throw f();this._tree.treeControl.getChildren(this.data).pipe(r.takeUntil(this._destroyed)).subscribe(function(t){e._children=t,e.updateChildrenNodes()}),this.nodeOutlet.changes.pipe(r.takeUntil(this._destroyed)).subscribe(function(){return e.updateChildrenNodes()})},t.prototype.ngOnDestroy=function(){this._clear(),e.prototype.ngOnDestroy.call(this)},t.prototype.updateChildrenNodes=function(){if(this.nodeOutlet.length&&this._children){var e=this.nodeOutlet.first.viewContainer;this._tree.renderNodeChanges(this._children,this._dataDiffer,e,this._data)}else this._dataDiffer.diff([])},t.prototype._clear=function(){this.nodeOutlet&&this.nodeOutlet.first&&(this.nodeOutlet.first.viewContainer.clear(),this._dataDiffer.diff([]))},t.decorators=[{type:n.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:m,useExisting:t}]}]}],t.ctorParameters=function(){return[{type:n.ElementRef},{type:N},{type:n.IterableDiffers}]},t.propDecorators={nodeOutlet:[{type:n.ContentChildren,args:[D]}]},t}(m),x=function(){function e(e,t,n,i,s){var a=this;this._treeNode=e,this._tree=t,this._renderer=n,this._element=i,this._dir=s,this._destroyed=new o.Subject,this._indent=40,this._setPadding(),this._dir&&this._dir.change.pipe(r.takeUntil(this._destroyed)).subscribe(function(){return a._setPadding()})}return Object.defineProperty(e.prototype,"level",{get:function(){return this._level},set:function(e){this._level=s.coerceNumberProperty(e),this._setPadding()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"indent",{get:function(){return this._indent},set:function(e){this._indent=s.coerceNumberProperty(e),this._setPadding()},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this._destroyed.next(),this._destroyed.complete()},e.prototype._paddingIndent=function(){var e=this._treeNode.data&&this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._treeNode.data):null,t=this._level||e;return t?t*this._indent+"px":null},e.prototype._setPadding=function(){var e=this._paddingIndent(),t=this._dir&&"rtl"===this._dir.value?"paddingRight":"paddingLeft";this._renderer.setStyle(this._element.nativeElement,t,e)},e.decorators=[{type:n.Directive,args:[{selector:"[cdkTreeNodePadding]"}]}],e.ctorParameters=function(){return[{type:m},{type:N},{type:n.Renderer2},{type:n.ElementRef},{type:i.Directionality,decorators:[{type:n.Optional}]}]},e.propDecorators={level:[{type:n.Input,args:["cdkTreeNodePadding"]}],indent:[{type:n.Input,args:["cdkTreeNodePaddingIndent"]}]},e}(),O=function(){function e(e,t){this._tree=e,this._treeNode=t,this._recursive=!1}return Object.defineProperty(e.prototype,"recursive",{get:function(){return this._recursive},set:function(e){this._recursive=s.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.prototype._toggle=function(e){this.recursive?this._tree.treeControl.toggleDescendants(this._treeNode.data):this._tree.treeControl.toggle(this._treeNode.data),e.stopPropagation()},e.decorators=[{type:n.Directive,args:[{selector:"[cdkTreeNodeToggle]",host:{"(click)":"_toggle($event)"}}]}],e.ctorParameters=function(){return[{type:N},{type:m}]},e.propDecorators={recursive:[{type:n.Input,args:["cdkTreeNodeToggleRecursive"]}]},e}(),S=[k,C,x,O,N,m,D],T=function(){function e(){}return e.decorators=[{type:n.NgModule,args:[{imports:[d.CommonModule],exports:S,declarations:S,providers:[a.FocusMonitor,C]}]}],e}();e.BaseTreeControl=_,e.FlatTreeControl=y,e.NestedTreeControl=v,e.CdkNestedTreeNode=k,e.CdkTreeNodeOutletContext=b,e.CdkTreeNodeDef=C,e.CdkTreeNodePadding=x,e.CdkTreeNodeOutlet=D,e.CdkTreeNode=m,e.CdkTree=N,e.getTreeNoValidDataSourceError=u,e.getTreeMultipleDefaultNodeDefsError=l,e.getTreeMissingMatchingNodeDefError=p,e.getTreeControlMissingError=h,e.getTreeControlFunctionsMissingError=f,e.CdkTreeModule=T,e.CdkTreeNodeToggle=O,Object.defineProperty(e,"__esModule",{value:!0})});
  //# sourceMappingURL=cdk-tree.umd.min.js.map
  