var __hasProp={}.hasOwnProperty,__extends=function(e,t){function r(){this.constructor=e}for(var n in t)__hasProp.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};define(["environ","mediator","jquery","underscore","backbone"],function(e,t,n,r,i){var s;return s=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.template=r.template('            <div id="report-container">                <div id="report-alert" class="alert alert-block">                    <h4 class="alert-heading" data-alert-heading></h4>                    <span data-alert-message></span>                </div>                <table id="report-table" class="table table-striped">                    <div class="pinned-thead"></div>                    <thead></thead>                    <tbody></tbody>                </table>            </div>        '),t.prototype.events={scroll:"togglePinnedThead","click tbody tr":"highlightRow"},t.prototype.initialize=function(){var e=this;return this.setElement(this.template()),this.$table=this.$("table"),this.$thead=this.$("thead"),this.$tbody=this.$("tbody"),this.$pinnedThead=this.$(".pinned-thead"),n(window).on("resize",function(){return e.resizePinnedThead()})},t.prototype.setBody=function(e,t){var n,r,i,s,o,u,a,f;t==null&&(t=!1),r=[];for(s=0,u=e.length;s<u;s++){i=e[s],r.push("<tr>"),f=i.values;for(o=0,a=f.length;o<a;o++)n=f[o],n||(n="<span class=no-data>(no data)</span>"),r.push("<td>"+n+"</td>");r.push("</tr>")}return t?this.$tbody.append(r.join("")):this.$tbody.html(r.join("")),this.resizePinnedThead()},t.prototype.setHeader=function(e){var t,r,i,s,o,u,a,f;i=[],s=[];for(a=0,f=e.length;a<f;a++)t=e[a],u=n("<th data-id="+t.id+">"+t.name+"</th>"),r=n("<div data-id="+t.id+">"+t.name+"</div>"),t.direction&&(t.direction==="desc"?(u.append(n("<i class=icon-chevron-down></i>")),r.append(n("<i class=icon-chevron-down></i>"))):(u.append(n("<i class=icon-chevron-up></i>")),r.append(n("<i class=icon-chevron-up></i>"))),u.data("direction",t.direction),u.addClass(t.direction),r.data("direction",t.direction),r.addClass(t.direction)),i.push(u),s.push(r);return this.$pinnedThead.empty(),this.$thead.html((o=n("<tr>")).append.apply(o,i)),this.$pinnedThead.append.apply(this.$pinnedThead,s)},t.prototype.resizePinnedThead=function(){var e,t=this;return e=this.$thead.width(),this.$thead.find("th").each(function(r,i){var s,o;return o=n(i),s=n(t.$pinnedThead.children()[r]),s.css("width",o.width()/e*100+"%")})},t.prototype.togglePinnedThead=function(e){var t,n;t=this.$el.scrollTop(),n=this.$pinnedThead.is(":visible");if(t<=0&&n)return this.$pinnedThead.hide();if(!n)return this.$pinnedThead.show()},t.prototype.highlightRow=function(e){var t;return t=n(e.target).parent(),t.toggleClass("highlight")},t}(i.View),s})