text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("@angular/material/sort")):"function"==typeof define&&define.amd?define("@angular/components-examples/material/sort",["exports","@angular/common","@angular/core","@angular/material/sort"],t):t(((e=e||self).ng=e.ng||{},e.ng.componentsExamples=e.ng.componentsExamples||{},e.ng.componentsExamples.material=e.ng.componentsExamples.material||{},e.ng.componentsExamples.material.sort={}),e.ng.common,e.ng.core,e.ng.material.sort)}(this,(function(e,t,r,n){"use strict";function a(e,t){if(1&e&&(r.ɵɵelementStart(0,"tr"),r.ɵɵelementStart(1,"td"),r.ɵɵtext(2),r.ɵɵelementEnd(),r.ɵɵelementStart(3,"td"),r.ɵɵtext(4),r.ɵɵelementEnd(),r.ɵɵelementStart(5,"td"),r.ɵɵtext(6),r.ɵɵelementEnd(),r.ɵɵelementStart(7,"td"),r.ɵɵtext(8),r.ɵɵelementEnd(),r.ɵɵelementStart(9,"td"),r.ɵɵtext(10),r.ɵɵelementEnd(),r.ɵɵelementEnd()),2&e){var n=t.$implicit;r.ɵɵadvance(2),r.ɵɵtextInterpolate(n.name),r.ɵɵadvance(2),r.ɵɵtextInterpolate(n.calories),r.ɵɵadvance(2),r.ɵɵtextInterpolate(n.fat),r.ɵɵadvance(2),r.ɵɵtextInterpolate(n.carbs),r.ɵɵadvance(2),r.ɵɵtextInterpolate(n.protein)}}var o=function(){function e(){this.desserts=[{name:"Frozen yogurt",calories:159,fat:6,carbs:24,protein:4},{name:"Ice cream sandwich",calories:237,fat:9,carbs:37,protein:4},{name:"Eclair",calories:262,fat:16,carbs:24,protein:6},{name:"Cupcake",calories:305,fat:4,carbs:67,protein:4},{name:"Gingerbread",calories:356,fat:16,carbs:49,protein:4}],this.sortedData=this.desserts.slice()}return e.prototype.sortData=function(e){var t=this.desserts.slice();this.sortedData=e.active&&""!==e.direction?t.sort((function(t,r){var n="asc"===e.direction;switch(e.active){case"name":return s(t.name,r.name,n);case"calories":return s(t.calories,r.calories,n);case"fat":return s(t.fat,r.fat,n);case"carbs":return s(t.carbs,r.carbs,n);case"protein":return s(t.protein,r.protein,n);default:return 0}})):t},e.decorators=[{type:r.Component,args:[{selector:"sort-overview-example",templateUrl:"sort-overview-example.html",styleUrls:["sort-overview-example.css"]}]}],e.ctorParameters=function(){return[]},e.ɵfac=function t(r){return new(r||e)},e.ɵcmp=r.ɵɵdefineComponent({type:e,selectors:[["sort-overview-example"]],decls:13,vars:1,consts:[["matSort","",3,"matSortChange"],["mat-sort-header","name"],["mat-sort-header","calories"],["mat-sort-header","fat"],["mat-sort-header","carbs"],["mat-sort-header","protein"],[4,"ngFor","ngForOf"]],template:function e(t,n){1&t&&(r.ɵɵelementStart(0,"table",0),r.ɵɵlistener("matSortChange",(function e(t){return n.sortData(t)})),r.ɵɵelementStart(1,"tr"),r.ɵɵelementStart(2,"th",1),r.ɵɵtext(3,"Dessert (100g)"),r.ɵɵelementEnd(),r.ɵɵelementStart(4,"th",2),r.ɵɵtext(5,"Calories"),r.ɵɵelementEnd(),r.ɵɵelementStart(6,"th",3),r.ɵɵtext(7,"Fat (g)"),r.ɵɵelementEnd(),r.ɵɵelementStart(8,"th",4),r.ɵɵtext(9,"Carbs (g)"),r.ɵɵelementEnd(),r.ɵɵelementStart(10,"th",5),r.ɵɵtext(11,"Protein (g)"),r.ɵɵelementEnd(),r.ɵɵelementEnd(),r.ɵɵtemplate(12,a,11,5,"tr",6),r.ɵɵelementEnd()),2&t&&(r.ɵɵadvance(12),r.ɵɵproperty("ngForOf",n.sortedData))},directives:[n.MatSort,n.MatSortHeader,t.NgForOf],styles:[".mat-sort-header-container[_ngcontent-%COMP%] {\n  align-items: center;\n}"]}),e}();function s(e,t,r){return(e<t?-1:1)*(r?1:-1)}var l=[o],i=function(){function e(){}return e.decorators=[{type:r.NgModule,args:[{imports:[t.CommonModule,n.MatSortModule],declarations:l,exports:l}]}],e.ɵmod=r.ɵɵdefineNgModule({type:e}),e.ɵinj=r.ɵɵdefineInjector({factory:function t(r){return new(r||e)},imports:[[t.CommonModule,n.MatSortModule]]}),e}();("undefined"==typeof ngJitMode||ngJitMode)&&r.ɵɵsetNgModuleScope(i,{declarations:[o],imports:[t.CommonModule,n.MatSortModule],exports:[o]}),e.SortExamplesModule=i,e.SortOverviewExample=o,Object.defineProperty(e,"__esModule",{value:!0})}));