activity-board/browser/lib/vizgrimoire.min.js

41 lines
373 KiB
JavaScript

/*
* VizGrimoire.js - https://github.com/VizGrimoire/VizGrimoireJS
* Copyright (C) 2012 Bitergia
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Authors:
* Alvaro del Castillo San Felix <acs@bitergia.com>
*
* Underscore.js 1.1.7 (c) 2011 Jeremy Ashkenas, DocumentCloud Inc. MIT license
* bean.js - copyright Jacob Thornton 2011, MIT license
* Flotr2 (c) 2012 Carl Sutherland, MIT license
* Bonzo: DOM Utility (c) Dustin Diaz 2011, MIT license
* Envision.js (c) 2012 Carl Sutherland, Humble Software, MIT license
* gridster.js Copyright (c) 2012 ducksboard; Licensed MIT
* d3.js: Copyright (c) 2012, Michael Bostocks
*
*/function resizedw(){Report.convertGlobal(),Report.convertStudiesGlobal(),Report.convertStudies(),Convert.activateHelp()}function DataSource(e,t){function n(e,t){if(e instanceof Array)return e;var n={};return $.each(e,function(e,r){var i=e,s=e.split("_");isNaN(s[s.length-1])===!1&&(i=s.slice(0,s.length-1).join("_"));var o=t.getName()+"_"+i,u=t.getName()+"_"+e;t.getMetrics()[o]===undefined?n[e]=r:n[u]=r}),n}this.top_data_file=this.data_dir+"/"+this.name+"-top.json",this.getTopDataFile=function(){return this.top_data_file},this.getMetrics=function(){return this.basic_metrics},this.setMetrics=function(e){this.basic_metrics=e},this.setMetricsDefinition=function(e){if(e===undefined)return;this.setMetrics(e)},this.data_file=this.data_dir+"/"+this.name+"-evolutionary.json",this.getDataFile=function(){return this.data_file},this.setDataFile=function(e){this.data_file=e},this.data=null,this.getData=function(){return this.data},this.setData=function(e,t){t===undefined&&(t=this),t.data=n(e,t)},this.demographics_aging_file=this.data_dir+"/"+this.name+"-demographics-aging.json",this.demographics_birth_file=this.data_dir+"/"+this.name+"-demographics-birth.json",this.getDemographicsAgingFile=function(){return this.demographics_aging_file},this.getDemographicsBirthFile=function(){return this.demographics_birth_file},this.demographics_data={},this.getDemographicsData=function(){return this.demographics_data},this.setDemographicsAgingData=function(e,t){t===undefined&&(t=this),t.demographics_data.aging=e},this.setDemographicsBirthData=function(e,t){t===undefined&&(t=this),t.demographics_data.birth=e},this.data_dir="data/json",this.getDataDir=function(){return this.data_dir},this.setDataDir=function(e){this.data_dir=e,this.data_file=e+"/"+this.name+"-evolutionary.json",this.demographics_aging_file=e+"/"+this.name+"-demographics-aging.json",this.demographics_birth_file=e+"/"+this.name+"-demographics-birth.json",this.global_data_file=e+"/"+this.name+"-static.json",this.top_data_file=e+"/"+this.name+"-top.json",this.companies_data_file=e+"/"+this.name+"-companies.json",this.repos_data_file=e+"/"+this.name+"-repos.json",this.countries_data_file=e+"/"+this.name+"-countries.json",this.domains_data_file=e+"/"+this.name+"-domains.json",this.projects_data_file=e+"/"+this.name+"-projects.json",this.time_to_fix_data_file=e+"/"+this.name+"-quantiles-month-time_to_fix_hour.json"},this.global_data_file=this.data_dir+"/"+this.name+"-static.json",this.getGlobalDataFile=function(){return this.global_data_file},this.global_data=null,this.getGlobalData=function(){return this.global_data},this.setGlobalData=function(e,t){t===undefined&&(t=this),t.global_data=n(e,t)},this.global_top_data=null,this.getGlobalTopData=function(){return this.global_top_data},this.setGlobalTopData=function(e,t){t===undefined&&(t=this),t.global_top_data=e},this.name=e,this.getName=function(){return this.name},this.people_data_file=this.data_dir+"/"+this.name+"-people.json",this.getPeopleDataFile=function(){return this.people_data_file},this.people=null,this.getPeopleData=function(){return this.people},this.setPeopleData=function(e,t){t===undefined&&(t=this),t.people=e},this.time_to_fix_data_file=this.data_dir+"/"+this.name+"-quantiles-month-time_to_fix_hour.json",this.getTimeToFixDataFile=function(){return this.time_to_fix_data_file},this.time_to_fix_data=null,this.getTimeToFixData=function(){return this.time_to_fix_data},this.setTimeToFixData=function(e,t){t===undefined&&(t=this),t.time_to_fix_data=e},this.time_to_attention_data_file=this.data_dir+"/"+this.name+"-quantiles-month-time_to_attention_hour.json",this.getTimeToAttentionDataFile=function(){return this.time_to_attention_data_file},this.time_to_attention_data=null,this.getTimeToAttentionData=function(){return this.time_to_attention_data},this.setTimeToAttentionData=function(e,t){t===undefined&&(t=this),t.time_to_attention_data=e},this.project=null,this.getProject=function(){return this.project},this.setProject=function(e){this.project=e},this.markov_table_data_file=this.data_dir+"/"+this.name+"-markov.json",this.getMarkovTableDataFile=function(){return this.markov_table_data_file},this.markov_table_data=null,this.getMarkovTableData=function(){return this.markov_table_data},this.setMarkovTableData=function(e,t){t===undefined&&(t=this),t.markov_table_data=e},this.companies_data_file=this.data_dir+"/"+this.name+"-companies.json",this.getCompaniesDataFile=function(){return this.companies_data_file},this.companies=null,this.getCompaniesDataFull=function(){return this.companies},this.getCompaniesData=function(){var e=this.companies;return e instanceof Array==0&&this.companies!==null&&(e=this.companies.name),e},this.setCompaniesData=function(e,t){e===null&&(e=[]),t===undefined&&(t=this),t.companies=e},this.companies_metrics_data={},this.addCompanyMetricsData=function(e,t,r){r===undefined&&(r=this),r.companies_metrics_data[e]=n(t,r)},this.getCompaniesMetricsData=function(){return this.companies_metrics_data},this.companies_global_data={},this.addCompanyGlobalData=function(e,t,r){r===undefined&&(r=this),r.companies_global_data[e]=n(t,r)},this.getCompaniesGlobalData=function(){return this.companies_global_data},this.companies_top_data={},this.addCompanyTopData=function(e,t,n){n===undefined&&(n=this),n.companies_top_data[e]===undefined&&(n.companies_top_data[e]={}),n.companies_top_data[e]=t},this.getCompaniesTopData=function(){return this.companies_top_data},this.setCompaniesTopData=function(e,t){t===undefined&&(t=this),t.companies_top_data=e},this.repos_data_file=this.data_dir+"/"+this.name+"-repos.json",this.getReposDataFile=function(){return this.repos_data_file},this.repos=null,this.getReposDataFull=function(){return this.repos},this.getReposData=function(){var e=this.repos;return e instanceof Array==0&&this.repos!==null&&(e=this.repos.name),e},this.setReposData=function(e,t){t===undefined&&(t=this),t.repos=e;if(t.getName()!=="its")return;repos_names=[],e instanceof Array==1&&(t.repos={},t.repos.name=e);var n=[];for(var r=0;r<t.repos.name.length;r++)n.push(t.repos.name[r].replace(/\//g,"_"));t.repos.name=n},this.repos_metrics_data={},this.addRepoMetricsData=function(e,t,r){r===undefined&&(r=this),r.repos_metrics_data[e]=n(t,r)},this.getReposMetricsData=function(){return this.repos_metrics_data},this.repos_global_data={},this.addRepoGlobalData=function(e,t,r){r===undefined&&(r=this),r.repos_global_data[e]=n(t,r)},this.getReposGlobalData=function(){return this.repos_global_data},this.repositories_top_data={},this.addRepositoryTopData=function(e,t,n){n===undefined&&(n=this),n.repositories_top_data[e]===undefined&&(n.repositories_top_data[e]={}),n.repositories_top_data[e]=t},this.getRepositoriesTopData=function(){return this.repositories_top_data},this.setRepositoriesTopData=function(e,t){t===undefined&&(t=this),t.repositories_top_data=e},this.countries_data_file=this.data_dir+"/"+this.name+"-countries.json",this.getCountriesDataFile=function(){return this.countries_data_file},this.countries=null,this.getCountriesData=function(){return this.countries},this.setCountriesData=function(e,t){t===undefined&&(t=this),t.countries=e},this.countries_metrics_data={},this.addCountryMetricsData=function(e,t,r){r===undefined&&(r=this),r.countries_metrics_data[e]=n(t,r)},this.getCountriesMetricsData=function(){return this.countries_metrics_data},this.countries_global_data={},this.addCountryGlobalData=function(e,t,r){r===undefined&&(r=this),r.countries_global_data[e]=n(t,r)},this.getCountriesGlobalData=function(){return this.countries_global_data},this.domains_data_file=this.data_dir+"/"+this.name+"-domains.json",this.getDomainsDataFile=function(){return this.domains_data_file},this.domains=null,this.getDomainsDataFull=function(){return this.domains},this.getDomainsData=function(){var e=this.domains;return e instanceof Array==0&&this.domains!==null&&(e=this.domains.name),e},this.setDomainsData=function(e,t){e===null&&(e=[]),t===undefined&&(t=this),t.domains=e},this.domains_metrics_data={},this.addDomainMetricsData=function(e,t,r){r===undefined&&(r=this),r.domains_metrics_data[e]=n(t,r)},this.getDomainsMetricsData=function(){return this.domains_metrics_data},this.domains_global_data={},this.addDomainGlobalData=function(e,t,r){r===undefined&&(r=this),r.domains_global_data[e]=n(t,r)},this.getDomainsGlobalData=function(){return this.domains_global_data},this.projects_data_file=this.data_dir+"/"+this.name+"-projects.json",this.getProjectsDataFile=function(){return this.projects_data_file},this.projects=null,this.getProjectsData=function(){return this.projects},this.setProjectsData=function(e,t){e===null&&(e=[]),e instanceof Array||(e=[e]),t===undefined&&(t=this),t.projects=e},this.projects_metrics_data={},this.addProjectMetricsData=function(e,t,r){r===undefined&&(r=this),r.projects_metrics_data[e]=n(t,r)},this.getProjectsMetricsData=function(){return this.projects_metrics_data},this.projects_global_data={},this.addProjectGlobalData=function(e,t,r){r===undefined&&(r=this),r.projects_global_data[e]=n(t,r)},this.getProjectsGlobalData=function(){return this.projects_global_data},this.people_metrics_data={},this.addPeopleMetricsData=function(e,t,r){r===undefined&&(r=this),r.people_metrics_data[e]=n(t,r)},this.getPeopleMetricsData=function(){return this.people_metrics_data},this.people_global_data={},this.addPeopleGlobalData=function(e,t,r){r===undefined&&(r=this),r.people_global_data[e]=n(t,r)},this.getPeopleGlobalData=function(){return this.people_global_data},this.getCompanyQuery=function(){var e=null,t=window.location.search.substr(1);return t&&t.split("&")[0].split("=")[0]==="company"&&(e=t.split("&")[0].split("=")[1]),e},this.displayMetricCompanies=function(e,t,n,r,i){var s=this.getCompaniesMetricsData();Viz.displayMetricCompanies(e,s,t,n,r,i)},this.displayMetricMyCompanies=function(e,t,n,r,i,s){var o={},u=this;$.each(e,function(e,t){o[t]=u.getCompaniesMetricsData()[t]}),Viz.displayMetricCompanies(t,o,n,r,i,s)},this.displayMetricRepos=function(e,t,n,r,i){var s=this.getReposMetricsData();Viz.displayMetricRepos(e,s,t,n,r,i)},this.displayBasicMetricMyRepos=function(e,t,n,r,i,s){var o={},u=Report.getReposMap(),a=this;$.each(e,function(e,t){var n=a.getReposMetricsData()[t];n||(u[t]instanceof Object?t=u[t][a.getName()]:t=u[t],n=a.getReposMetricsData()[t]),o[t]=n}),Viz.displayMetricRepos(t,o,n,r,i,s)},this.displayMetricDomains=function(e,t,n,r,i){var s=this.getDomainsMetricsData();Viz.displayMetricDomains(e,s,t,n,r,i)},this.displayMetricProjects=function(e,t,n,r,i){var s=this.getProjectsMetricsData();Viz.displayMetricProjects(e,s,t,n,r,i)},this.displayMetricCompaniesStatic=function(e,t,n,r,i){this.displayMetricSubReportStatic("companies",e,t,n,r,i)},this.displayMetricReposStatic=function(e,t,n,r,i){this.displayMetricSubReportStatic("repos",e,t,n,r,i)},this.displayMetricCountriesStatic=function(e,t,n,r,i){this.displayMetricSubReportStatic("countries",e,t,n,r,i)},this.displayMetricDomainsStatic=function(e,t,n,r,i){this.displayMetricSubReportStatic("domains",e,t,n,r,i)},this.displayMetricProjectsStatic=function(e,t,n,r,i){this.displayMetricSubReportStatic("projects",e,t,n,r,i)},this.displayMetricSubReportStatic=function(e,t,n,r,i,s){i===undefined&&(i=t);var o=null;if(e=="companies")o=this.getCompaniesGlobalData();else if(e=="repos")o=this.getReposGlobalData();else if(e=="countries")o=this.getCountriesGlobalData();else if(e=="domains")o=this.getDomainsGlobalData();else{if(e!="projects")return;o=this.getProjectsGlobalData()}if($.isEmptyObject(o))return;var u=DataProcess.sortGlobal(this,i,e);u instanceof Array==0&&(u=u.name),data_page=DataProcess.paginate(u,Report.getCurrentPage()),Viz.displayMetricSubReportStatic(t,o,data_page,n,r)},this.displayMetricsCompany=function(e,t,n,r){var i=this.getCompaniesMetricsData()[e];if(i===undefined){$("#"+n).hide();return}Viz.displayMetricsCompany(this,e,t,i,n,r)},this.displayMetricsRepo=function(e,t,n,r){var i=this.getReposMetricsData()[e];if(i===undefined){$("#"+n).hide();return}Viz.displayMetricsRepo(this,e,t,i,n,r)},this.displayMetricsCountry=function(e,t,n,r){var i=this.getCountriesMetricsData()[e];if(i===undefined){$("#"+n).hide();return}Viz.displayMetricsCountry(this,e,t,i,n,r)},this.displayMetricsDomain=function(e,t,n,r){var i=this.getDomainsMetricsData()[e];if(i===undefined)return;Viz.displayMetricsDomain(this,e,t,i,n,r)},this.displayMetricsProject=function(e,t,n,r){var i=this.getProjectsMetricsData()[e];if(i===undefined)return;Viz.displayMetricsProject(this,e,t,i,n,r)},this.displayMetricsPeople=function(e,t,n,r,i){var s=this.getPeopleMetricsData()[e];if(s===undefined||s instanceof Array){$("#"+r).hide();return}Viz.displayMetricsPeople(this,t,n,s,r,i)},this.displayMetricsEvol=function(e,t,n,r){var i={},s;if(n.repo_filter){s=n.repo_filter.split(",");var o=this;$.each(s,function(e,t){if($.inArray(t,o.getReposData())>=0)if(o.getName()==="mls"){var n=MLS.displayMLSListName(t);i[n]=o.getReposMetricsData()[t]}else i[t]=o.getReposMetricsData()[t]})}else i=this.getData();r&&(i=DataProcess.convert(i,r,e)),Viz.displayMetricsEvol(this,e,i,t,n,s)},this.isPageDisplayed=function(e,t,n,r){var i=Math.floor((r-3)/2),s=e-i,o=e+i;return t===1||t===n||t==e?!0:t>=s&&t<e?!0:t<=o&&t>e?!0:!1},this.displayItemsNav=function(e,t,n,r){var i=parseInt(n,null);isNaN(i)&&(i=1);var s=null,o="",u=0,a=5;if(t==="companies")s=this.getCompaniesData(),o="List of companies";else if(t==="repos")s=this.getReposData(),r&&(s=DataProcess.sortGlobal(this,r,t));else if(t==="countries")s=this.getCountriesData();else if(t==="domains")s=this.getDomainsData();else{if(t!=="projects")return;s=this.getProjectsData()}u=s.length;var f="",l=Report.getPageSize();if(i){f+="<div class='pagination'>";var c=Math.ceil(u/l),h=(i-1)*l+1,p=i*l;p>u&&(p=u),f+="<ul class='pagination'>",i>1?f+="<li><a href='?page="+(i-1)+"'>&laquo;</a></li>":f+="<li class='disabled'><a href='?page="+i+"'>&laquo;</a></li>";for(var d=0;d*Report.getPageSize()<u;d++)if(this.isPageDisplayed(i,d+1,c,a)===!0)i===d+1?f+="<li class='active'><a href='?page="+(d+1)+"'>"+(d+1)+"</a></li>":f+="<li><a href='?page="+(d+1)+"'>"+(d+1)+"</a></li>";else if(d+1+1===c||d+1-1===1)f+="<li class='disabled'><a href='#'> .. </a></li>";i*Report.getPageSize()<s.length&&(f+="<li><a href='?page="+(parseInt(i,null)+1)+"'>",f+="&raquo;</a></li>"),f+="</ul>",f+="<span class='pagination-text'> ("+h+" - "+p+"/"+u+")</span>",f+="</div>"}Report.getPageSize()>10&&$.each(s,function(e,t){var n=Report.cleanLabel(t);f+="<a href='#"+t+"-nav'>"+n+"</a> "}),$("#"+e).append(f)},this.displayCompaniesLinks=function(e,t,n){var r=DataProcess.sortGlobal(this,n,"companies"),i="",s=0;$.each(r,function(e,n){i+='<a href="company.html?company='+n,Report.addDataDir()&&(i+="&"+Report.addDataDir()),i+='">'+n+"</a>| ";if(s++>=t-1)return!1}),$("#"+e).append(i)},this.displayCompaniesList=function(e,t,n,r,i,s,o,u,a){this.displaySubReportList("companies",e,t,n,r,i,s,o,u,a)},this.displayReposList=function(e,t,n,r,i,s,o,u,a){this.displaySubReportList("repos",e,t,n,r,i,s,o,u,a)},this.displayCountriesList=function(e,t,n,r,i,s,o,u,a){this.displaySubReportList("countries",e,t,n,r,i,s,o,u,a)},this.displayDomainsList=function(e,t,n,r,i,s,o,u,a){this.displaySubReportList("domains",e,t,n,r,i,s,o,u,a)},this.displayProjectsList=function(e,t,n,r,i,s,o,u,a){this.displaySubReportList("projects",e,t,n,r,i,s,o,u,a)},this.displaySubReportList=function(e,t,n,r,i,s,o,u,a,f){var l=parseInt(s,null);isNaN(l)&&(l=1);var c="",h=(l-1)*Report.getPageSize()+1,p=this,d=null,v=null;o===undefined&&(o=!0);if(e==="companies")d=this.getCompaniesMetricsData(),v=DataProcess.sortGlobal(this,i,e);else if(e==="repos")d=this.getReposMetricsData(),v=DataProcess.sortGlobal(this,i,e);else if(e==="countries")d=this.getCountriesMetricsData(),v=DataProcess.sortGlobal(this,i,e);else if(e==="domains")d=this.getDomainsMetricsData(),v=DataProcess.sortGlobal(this,i,e);else{if(e!=="projects")return;d=this.getProjectsMetricsData(),v=DataProcess.sortGlobal(this,i,e)}v=DataProcess.paginate(v,l),c+='<table class="table table-hover table-repositories">',c+="<tr><th></th>",$.each(t,function(e,t){p.getMetrics()[t]?(title=p.getMetrics()[t].name,c+="<th>"+title+"</th>"):c+="<th>"+t+"</th>"}),c+="</tr>",$.each(v,function(n,r){c+="<tr><td class='col-md-2 repository-name'>",c+="#"+h+"&nbsp;",h++;var i=null;Report.addDataDir()&&(i=Report.addDataDir());if(o){var s="";Utils.isReleasePage()&&(s="&release="+$.urlParam("release")),e==="companies"?(c+="<a href='company.html?company="+r,c+=s,i&&(c+="&"+i),c+="'>"):e==="repos"?(c+="<a href='",c+="repository.html",c+="?repository="+encodeURIComponent(r),c+=s,c+="&ds="+p.getName(),i&&(c+="&"+i),c+="'>"):e==="countries"?(c+="<a href='country.html?country="+r,c+=s,i&&(c+="&"+i),c+="'>"):e==="domains"?(c+="<a href='domain.html?domain="+r,c+=s,i&&(c+="&"+i),c+="'>"):e==="projects"&&(c+="<a href='project.html?project="+r,c+=s,i&&(c+="&"+i),c+="'>")}c+="<strong>",c+=Report.cleanLabel(r),c+="</strong>",o&&(c+="</a>"),c+="</td>",$.each(t,function(t,n){c+="<td class='col-md-5'>",c+="<div id='"+e+"-"+r+"-"+n+"'",c+=" class='subreport-list-item'>"}),c+="</td></tr>"}),c+="</table>",$("#"+n).append(c);var m=null,g=null,y=null;u&&(typeof u=="number"?m=[u.toString()]:m=u.split(",")),a&&(typeof a=="number"?g=[a.toString()]:g=a.split(",")),f&&(y=f.split(",")),$.each(v,function(n,i){var s=0;$.each(t,function(t,n){var o=null,u=null,a=null;m&&(m.length==1?o=m[0]:o=m[s]),g&&(g.length==1?u=g[0]:u=g[s]),y&&(a=y[s]);if(i in d==0)return;var f=d[i];if(f[n]===undefined)return;var l=e+"-"+i+"-"+n,c={};c[i]=f;var h="";Viz.displayMetricSubReportLines(l,n,c,h,r,o,u,a),s++})})},this.displayGlobalSummary=function(e){this.displaySummary(null,e,null,this)},this.displayCompanySummary=function(e,t,n){this.displaySummary("companies",e,t,n)},this.displayRepoSummary=function(e,t,n){this.displaySummary("repositories",e,t,n)},this.displayCountrySummary=function(e,t,n){this.displaySummary("countries",e,t,n)},this.displayDomainSummary=function(e,t,n){this.displaySummary("domains",e,t,n)},this.displayProjectSummary=function(e,t,n){this.displaySummary("projects",e,t,n)},this.displayPeopleSummary=function(e,t,n,r){var i=r.getPeopleGlobalData()[t];if(i===undefined||i instanceof Array)return;html=HTMLComposer.personSummaryTable(r.getName(),i),$("#"+e).append(html)},this.displayCompaniesSummary=function(e,t){var n="",r=t.getGlobalData();n+="Total companies: "+r.companies+"<br>",r.companies_2006&&(n+="Companies in 2006: "+r.companies_2006+"<br>"),r.companies_2009&&(n+="Companies in 2009: "+r.companies_2009+"<br>"),r.companies_2012&&(n+="Companies in 2012: "+r.companies_2012+"<br>"),$("#"+e).append(n)},this.getSummaryLabels=function(){},this.getLabelForRepository=function(){return"repository"},this.getLabelForRepositories=function(){return"repositories"},this.displaySummary=function(e,t,n,r){n||(n="");var i="<h6>"+r.getTitle()+"</h6>",s=this.getSummaryLabels(),o=null;e==="companies"?o=r.getCompaniesGlobalData()[n]:e==="countries"?o=r.getCountriesGlobalData()[n]:e==="repositories"?o=r.getReposGlobalData()[n]:e==="domains"?o=r.getDomainsGlobalData()[n]:e==="projects"?o=r.getProjectsGlobalData()[n]:o=r.getGlobalData();if(!o)return;i=HTMLComposer.repositorySummaryTable(r,o,s),$("#"+t).append(i)},this.displayReposSummary=function(e,t){var n="",r=t.getGlobalData();n+="Total repositories: "+r[t.getName()+"_repositories"]+"<br>",$("#"+e).append(n)},this.displayCountriesSummary=function(e,t){var n="",r=t.getGlobalData();n+="Total countries: "+r[t.getName()+"_countries"]+"<br>",$("#"+e).append(n)},this.displayDomainsSummary=function(e,t){var n="",r=t.getGlobalData();n+="Total domains: "+r.domains+"<br>",$("#"+e).append(n)},this.displayProjectsSummary=function(e,t){var n="",r=t.getGlobalData();n+="Total projects: "+r.projects+"<br>",$("#"+e).append(n)},this.displayDemographics=function(e,t){var n=this.getDemographicsData();Viz.displayDemographicsChart(e,this,n,t)},this.displayTimeToAttention=function(e,t,n,r){n=!0,r="Time to Attention "+t;var i=this.getTimeToAttentionData();if(i instanceof Array)return;Viz.displayTimeToAttention(e,i,t,n,r)},this.displayTimeToFix=function(e,t,n,r){n=!0,r="Time to Fix "+t;var i=this.getTimeToFixData();if(i instanceof Array)return;Viz.displayTimeToFix(e,this.getTimeToFixData(),t,n,r)},this.displayMarkovTable=function(e,t){var n=this.getMarkovTableData();if(n===undefined){Report.log("No Markov data available");return}Viz.displayMarkovTable(e,n,t)},this.displayTop=function(e,t,n,r,i,s,o,u,a,f){t===undefined&&(t=!0);var l=null;Viz.displayTop(e,this,t,n,r,i,null,null,o,u,a,f)},this.displayTopCompany=function(e,t,n,r,i){var s=this.getCompaniesTopData()[e];if(s===undefined)return;var o=this.getMetrics()[n];Viz.displayTopCompany(e,s,t,o,r,i)},this.displayTopGlobal=function(e,t,n,r){Viz.displayTopGlobal(e,this,t,n,r)},this.envisionEvo=function(e,t,n,r,i){config=Report.getVizConfig();var s=Viz.getEnvisionOptions(e,t,this.getName(),Report.getVizConfig()[this.getName()+"_hide"],i);s.legend_show=r,n&&DataProcess.addRelativeValues(s.data,this.getMainMetric()),new envision.templates.Envision_Report(s,[this])},this.displayEnvision=function(e,t,n,r){var i=Report.getProjectsDataSources();this.envisionEvo(e,i,t,n,r)}}function IRC(){var e=this;this.basic_metrics={irc_sent:{divid:"irc_sent",column:"sent",name:"Sent",desc:"Messages sent"},irc_senders:{divid:"irc_senders",column:"senders",name:"Senders",desc:"Messages senders",action:"sent"},irc_repositories:{divid:"irc_repositories",column:"repositories",name:"Repositories",desc:"Number of active repositories"}},this.getMainMetric=function(){return"irc_sent"},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End"};return e},this.getLabelForRepository=function(){return"channel"},this.getLabelForRepositories=function(){return"channels"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .irc_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().irc_url,this.global_data.type&&$(t+" #irc_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #irc_url").attr("href",r),$(t+" #irc_name").text("IRC "+this.global_data.type)):($(t+" #irc_url").attr("href",Report.getProjectData().irc_url),$(t+" #irc_name").text(Report.getProjectData().irc_name),$(t+" #irc_type").text(Report.getProjectData().irc_type));var i=this.getGlobalData();$(t+" #ircFirst").text(i.first_date),$(t+" #ircLast").text(i.last_date),$(t+" #ircSent").text(i.irc_sent),$(t+" #ircRepositories").text(i.irc_repositories),i.repositories===1&&$(t+" #ircRepositories").hide()},this.displayBubbles=function(e,t){},this.getTitle=function(){return"IRC Messages"}}function ITS(){this.basic_metrics={its_opened:{divid:"its_opened",column:"opened",name:"Opened",desc:"Number of opened tickets",envision:{y_labels:!0,show_markers:!0}},its_openers:{divid:"its_openers",column:"openers",name:"Openers",desc:"Unique identities opening tickets",action:"opened",envision:{gtype:"whiskers"}},its_closed:{divid:"its_closed",column:"closed",name:"Closed",desc:"Number of closed tickets"},its_closers:{divid:"its_closers",column:"closers",name:"Closers",desc:"Number of identities closing tickets",action:"closed",envision:{gtype:"whiskers"}},its_changed:{divid:"its_changed",column:"changed",name:"Changed",desc:"Number of changes to the state of tickets"},its_changers:{divid:"its_changers",column:"changers",name:"Changers",desc:"Number of identities changing the state of tickets",action:"changed",envision:{gtype:"whiskers"}},its_companies:{divid:"its_companies",column:"companies",name:"Companies",desc:"Number of active companies"},its_countries:{divid:"its_countries",column:"countries",name:"Countries",desc:"Number of active countries"},its_repositories:{divid:"its_repositories",column:"repositories",name:"Respositories",desc:"Number of active respositories"},its_domains:{divid:"its_domains",column:"domains",name:"Domains",desc:"Number of active domains"}},this.getMainMetric=function(){return"its_opened"},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End",tickets:"Tickets",trackers:"Trackers"};return e},this.getLabelForRepository=function(){return"tracker"},this.getLabelForRepositories=function(){return"trackers"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .its-info").hide();return}$(t+" #its_type").text(this.global_data.type);var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().its_url,r===undefined&&(r=""),this.global_data.type==="allura"?r=r.replace("rest/",""):this.global_data.type==="github"&&(r=r.replace("api.",""),r=r.replace("repos/","")),$(t+" #its_url").attr("href",r);var i=this.global_data.type.charAt(0).toUpperCase()+this.global_data.type.slice(1);$(t+" #its_name").text(i+" Tickets");var s=this.getGlobalData();$(t+" #itsFirst").text(s.first_date),$(t+" #itsLast").text(s.last_date),$(t+" #itsTickets").text(s.its_opened),$(t+" #itsOpeners").text(s.its_openers),$(t+" #itsRepositories").text(s.its_repositories),s.repositories===1&&$(t+" #itsRepositories").hide()},this.getTitle=function(){return"Tickets"},this.displayBubbles=function(e,t){Viz.displayBubbles(e,"its_opened","its_openers",t)}}function MediaWiki(){var e=this;this.basic_metrics={mediawiki_reviews:{divid:"mediawiki_reviews",column:"reviews",name:"Editions",desc:"Wiki page editions"},mediawiki_authors:{divid:"mediawiki_authors",column:"authors",name:"Editors",desc:"Editors doing editions",action:"reviews"},mediawiki_pages:{divid:"mediawiki_pages",column:"pages",name:"Pages",desc:"Wiki pages"}},this.getMainMetric=function(){return"mediawiki_reviews"},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End"};return e},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .mediawiki_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().mediawiki_url,this.global_data.type&&$(t+" #mediawiki_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #mediawiki_url").attr("href",r),$(t+" #mediawiki_name").text("MediaWiki "+this.global_data.type)):($(t+" #mediawiki_url").attr("href",Report.getProjectData().mediawiki_url),$(t+" #mediawiki_name").text(Report.getProjectData().mediawiki_name),$(t+" #mediawiki_type").text(Report.getProjectData().mediawiki_type));var i=this.getGlobalData();$(t+" #mediawikiFirst").text(i.first_date),$(t+" #mediawikiLast").text(i.last_date),$(t+" #mediawikiSent").text(i.mediawiki_reviews)},this.displayBubbles=function(e,t){},this.getTitle=function(){return"MediaWiki Reviews"}}function MLS(){function t(){var e=document.getElementById("form_mls_selector"),t=[];for(var n=0;n<e.elements.length;n++)e.elements[n].checked&&t.push(e.elements[n].value);return localStorage&&localStorage.setItem(i(),JSON.stringify(t)),t}function n(e,t,n,r){var i=Viz.checkBasicConfig(r);for(var s in basic_metrics){var o=basic_metrics[s],u="";i.show_title&&(u=o.name);if($.inArray(o.column,Report.getConfig().mls_hide)>-1)continue;var a="<div class='info-pill m0-box-div flotr2-"+o.column+"'>";a+="<h4>"+o.name+" "+MLS.displayMLSListName(t)+"</h4>",a+="<div id='"+o.divid+"_"+t+"' class='m0-box flotr2-"+o.column+"'></div>",i.show_desc&&(a+="<p>"+o.desc+"</p>"),a+="</div>",$("#"+e).append(a),Viz.displayBasicLinesFile(o.divid+"_"+t,n,o.column,i.show_labels,u)}}function r(){var e=Report.getProjectData();return e.date+"_"+e.project_name}function i(){return r()+"_mls_lists"}function s(){localStorage&&localStorage.length&&localStorage.getItem(i())&&localStorage.removeItem(i())}function o(e){return typeof e.id=="number"&&$.each(e,function(e,t){t=[t]}),e}var e=this;this.basic_metrics={mls_responses:{divid:"mls_responses",column:"responses",name:"Responses",desc:"Number of messages that are responses"},mls_sent:{divid:"mls_sent",column:"sent",name:"Sent",desc:"Number of messages"},mls_senders:{divid:"mls_senders",column:"senders",name:"Senders",desc:"Number of unique message senders",action:"sent"},mls_threads:{divid:"mls_threads",column:"threads",name:"Threads",desc:"Number of messages threads"},mls_companies:{divid:"mls_companies",column:"companies",name:"Companies",desc:"Number of active companies"},mls_countries:{divid:"mls_countries",column:"countries",name:"Countries",desc:"Number of active countries"},mls_repositories:{divid:"mls_repositories",column:"repositories",name:"Respositories",desc:"Number of active respositories"},mls_domains:{divid:"mls_domains",column:"domains",name:"Domains",desc:"Number of active domains"}},this.data_lists_file=this.data_dir+"/mls-lists.json",this.getListsFile=function(){return this.data_lists_file},this.data_lists=null,this.getListsData=function(){return this.data_lists},this.setListsData=function(e,t){t===undefined&&(t=this),t.data_lists=e},this.setDataDir=function(e){this.data_dir=e,this.data_lists_file=this.data_dir+"/mls-lists.json",MLS.prototype.setDataDir.call(this,e)},this.getMainMetric=function(){return"mls_sent"},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End"};return e},this.getLabelForRepository=function(){return"mailing list"},this.getLabelForRepositories=function(){return"mailing lists"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;(!n||n.length===0)&&$(t+" .mls_info").hide();var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().mls_url,this.global_data.type&&$(t+" #mls_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #mls_url").attr("href",r),$(t+" #mls_name").text("MLS "+this.global_data.type)):($(t+" #mls_url").attr("href",Report.getProjectData().mls_url),$(t+" #mls_name").text(Report.getProjectData().mls_name),$(t+" #mls_type").text(Report.getProjectData().mls_type));var i=this.getGlobalData();$(t+" #mlsFirst").text(i.first_date),$(t+" #mlsLast").text(i.last_date),$(t+" #mlsMessages").text(i.mls_sent),$(t+" #mlsSenders").text(i.mls_senders),$(t+" #mlsRepositories").text(i.mls_repositories),i.repositories===1&&$(t+" #mlsRepositories").hide()},this.displayBubbles=function(e,t){Viz.displayBubbles(e,"mls_sent","mls_senders",t)},MLS.displayMLSListName=function(e){var t=e.split("_"),n="";return t.length>1?(n=t[t.length-1],n===""&&(n=t[t.length-2])):(n=e.replace("<",""),n=n.replace(">",""),t=n.split("."),n=t[0]),n},this.displayBasicUserAll=function(e,t){var n=document.getElementById("form_mls_selector");for(var r=0;r<n.elements.length;r++)n.elements[r].type=="checkbox"&&(n.elements[r].checked=t);this.displayBasicUser(e)},this.displayBasicUser=function(e){$("#"+e).empty(),lists=t();for(var r=0;r<lists.length;r++){var i=lists[r];file_messages=this.getDataDir()+"/mls-",file_messages+=i,file_messages+="-evolutionary.json",n(e,i,file_messages)}},this.displayBasic=function(e,t){var r=this.getListsData();lists_hide=Report.getConfig().mls_hide_lists,r=r.mailing_list;if(r===undefined)return null;var s=!1;typeof r=="string"&&(r=[r]),localStorage&&localStorage.length&&localStorage.getItem(i())&&(r=JSON.parse(localStorage.getItem(i())),s=!0);for(var o=0;o<r.length;o++){var u=r[o];if(!s&&$.inArray(u,lists_hide)>-1)continue;file_messages=this.getDataDir()+"/mls-",file_messages+=u,file_messages+="-evolutionary.json"
,n(e,u,file_messages,t)}},this.getTitle=function(){return"Mailing Lists"},this.displayEvoListsMain=function(e){if(localStorage&&localStorage.length&&localStorage.getItem(i()))return lists=JSON.parse(localStorage.getItem(i())),this.displayEvoLists(e,lists);history=this.getListsData(),lists=history.mailing_list;if(lists===undefined)return;var t=Report.getConfig();lists_hide=t.mls_hide_lists,typeof lists=="string"&&(lists=[lists]);var n=[];for(var r=0;r<lists.length;r++)$.inArray(lists[r],lists_hide)==-1&&n.push(lists[r]);localStorage&&(localStorage.getItem(i())||localStorage.setItem(i(),JSON.stringify(n))),this.displayEvoLists(e,n)},this.getDefaultLists=function(){var e=[],t=Report.getConfig().mls_hide_lists;return $.each(this.getListsData().mailing_list,function(n,r){$.inArray(r,t)===-1&&e.push(r)}),e},this.displaySelectorCheckDefault=function(){var e=this.getDefaultLists(),t=document.getElementById("form_mls_selector");for(var n=0;n<t.elements.length;n++)if(t.elements[n].type=="checkbox"){var r=t.elements[n].id;l=r.split("_check")[0],$.inArray(l,e)>-1?t.elements[n].checked=!0:t.elements[n].checked=!1}},this.displayBasicDefault=function(t){var n=e;this instanceof MLS&&(n=this),s(),n.displaySelectorCheckDefault(),$("#"+t).empty(),n.displayBasic(t)},this.displayEvoDefault=function(t){var n=e;this instanceof MLS&&(n=this),s(),document.getElementById("form_mls_selector")&&n.displaySelectorCheckDefault(),$("#"+t).empty(),n.displayEvoLists(t,n.getDefaultLists())},this.displayEvoUserAll=function(e,t){var n=document.getElementById("form_mls_selector");for(var r=0;r<n.elements.length;r++)n.elements[r].type=="checkbox"&&(n.elements[r].checked=t);this.displayEvoUser(e)},this.displayEvoUser=function(n){$("#"+n).empty();var r=e;this instanceof MLS&&(r=this),r.displayEvoLists(n,t())},this.displayEvoListSelector=function(e,t){this.displayEvoBasicListSelector(e,t,null)},this.displayBasicListSelector=function(e,t){this.displayEvoBasicListSelector(e,null,t)},this.displayEvoBasicListSelector=function(e,t,n){var r=this.getListsData(),s=r.mailing_list,o=[];if(s===undefined)return;localStorage&&localStorage.length&&localStorage.getItem(i())&&(o=JSON.parse(localStorage.getItem(i()))),Report.displayBasicUser=this.displayBasicUser,Report.displayBasicUserAll=this.displayBasicUserAll,Report.displayBasicDefault=this.displayBasicDefault,Report.displayEvoDefault=this.displayEvoDefault,Report.displayEvoUser=this.displayEvoUser,Report.displayEvoUserAll=this.displayEvoUserAll;var u="Mailing list selector:";u+="<form id='form_mls_selector'>",typeof s=="string"&&(s=[s]);for(var a=0;a<s.length;a++){var f=s[a];u+='<input type=checkbox name="check_list" value="'+f+'" ',u+='onClick="',t&&(u+="Report.displayEvoUser('"+t+"');"),n&&(u+="Report.displayBasicUser('"+n+"')\";"),u+='" ',u+='id="'+f+'_check" ',$.inArray(f,o)>-1&&(u+="checked "),u+=">",u+=MLS.displayMLSListName(f),u+="<br>"}u+='<input type=button value="All" ',u+='onClick="',t&&(u+="Report.displayEvoUserAll('"+t+"',true);"),n&&(u+="Report.displayBasicUserAll('"+n+"',true);"),u+='">',u+='<input type=button value="None" ',u+='onClick="',t&&(u+="Report.displayEvoUserAll('"+t+"',false);"),n&&(u+="Report.displayBasicUserAll('"+n+"',false);"),u+='">',u+='<input type=button value="Default" ',u+='onClick="',t&&(u+="Report.displayEvoDefault('"+t+"');"),n&&(u+="Report.displayBasicDefault('"+n+"')"),u+='">',u+="</form>",$("#"+e).html(u),Report.getProjectsList().length>1&&($("#"+e).append("Not supported in multiproject"),$("#"+e+" :input").attr("disabled",!0))},this.displayEvoLists=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];file_messages=this.getDataDir()+"/mls-",file_messages+=r,file_messages+="-evolutionary.json",this.displayEvoList(MLS.displayMLSListName(r),e,file_messages)}},this.displayEvoList=function(e,t,n){var r=this;$.getJSON(n,function(n){r.envisionEvoList(e,t,n)})},this.envisionEvoList=function(e,t,n){var r=Report.getConfig(),i=Viz.getEnvisionOptionsMin(t,n,r.mls_hide);i.data.list_label=MLS.displayMLSListName(e),new envision.templates.Envision_Report(i,[this])}}function SCM(){this.basic_metrics={scm_commits:{divid:"scm_commits",column:"commits",name:"Commits",desc:"Evolution of the number of commits (aggregating branches)",envision:{y_labels:!0,show_markers:!0}},scm_committers:{divid:"scm_committers",column:"committers",name:"Committers",desc:"Unique committers making changes to the source code",action:"commits",envision:{gtype:"whiskers"}},scm_authors:{divid:"scm_authors",column:"authors",name:"Authors",desc:"Unique authors making changes to the source code",action:"commits",envision:{gtype:"whiskers"}},scm_branches:{divid:"scm_branches",column:"branches",name:"Branches",desc:"Evolution of the number of branches"},scm_files:{divid:"scm_files",column:"files",name:"Files",desc:"Evolution of the number of unique files handled by the community"},scm_added_lines:{divid:"scm_added_lines",column:"added_lines",name:"Lines Added",desc:"Evolution of the source code lines added"},scm_removed_lines:{divid:"scm_removed_lines",column:"removed_lines",name:"Lines Removed",desc:"Evolution of the source code lines removed"},scm_repositories:{divid:"scm_repositories",column:"repositories",name:"Repositories",desc:"Evolution of the number of repositories",envision:{gtype:"whiskers"}},scm_companies:{divid:"scm_companies",column:"companies",name:"Companies",desc:"Number of active companies"},scm_countries:{divid:"scm_countries",column:"countries",name:"Countries",desc:"Number of active countries"},scm_domains:{divid:"scm_domains",column:"domains",name:"Domains",desc:"Number of active domains"}},this.getMainMetric=function(){return"scm_commits"},this.setITS=function(e){this.its=e},this.getITS=function(e){return this.its},this.getTitle=function(){return"Source Code Management"},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End"};return e},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .scm-info").hide();return}var r=this.global_data.type.charAt(0).toUpperCase()+this.global_data.type.slice(1);$(t+" #scm_type").text(r);var i="";this.global_data.repositories===1?i=this.global_data.url:i=Report.getProjectData().scm_url,this.global_data.type==="git"&&i&&(i=i.replace("git://","http://")),$(t+" #scm_url").attr("href",i),$(t+" #scm_name").text(r);var s=this.getGlobalData();$(t+" #scmFirst").text(s.first_date),$(t+" #scmLast").text(s.last_date),$(t+" #scmCommits").text(s.scm_commits),$(t+" #scmAuthors").text(s.scm_authors),s.reviewers&&$(t+" #scmReviewers").text(s.scm_reviewers),$(t+" #scmCommitters").text(s.scm_committers),$(t+" #scmRepositories").text(s.scm_repositories),s.repositories===1&&$(t+" #scmRepositories").hide()},this.displayBubbles=function(e,t){Viz.displayBubbles(e,"scm_commits","scm_committers",t)}}function SCR(){var e=this;this.basic_metrics={scr_opened:{divid:"scr_opened",column:"opened",name:"Reviews opened",desc:"Reviews in status new or inprogress"},scr_closed:{divid:"scr_closed",column:"closed",name:"Reviews closed",desc:"Reviews merged or abandoned"},scr_merged:{divid:"scr_merged",column:"merged",name:"Reviews merged",desc:"Reviews merged"},scr_mergers:{divid:"scr_mergers",column:"mergers",name:"Reviews mergers",action:"merged",desc:"People merging reviews"},scr_new:{divid:"scr_new",column:"new",name:"Reviews new",desc:"Reviews in status new"},scr_abandoned:{divid:"scr_abandoned",column:"abandoned",name:"Reviews abandoned",desc:"Reviews abandoned"},scr_pending:{divid:"scr_pending",column:"pending",name:"Reviews pending",desc:"Reviews pending to be attended"},scr_review_time_days_avg:{divid:"scr_review_time_days_avg",column:"review_time_days_avg",name:"Average review time",desc:"Average review time in days"},scr_verified:{divid:"scr_verified",column:"verified",name:"Patches verified",desc:"Patches verified"},scr_approved:{divid:"scr_approved",column:"approved",name:"Patches approved",desc:"Patches approved"},scr_codereview:{divid:"scr_codereview",column:"codereview",name:"Patches codereview",desc:"Patches in code review process"},scr_WaitingForReviewer:{divid:"scr_WaitingForReviewer",column:"WaitingForReviewer",name:"Patches waiting reviewer",desc:"Patches waiting for reviewer"},scr_WaitingForSubmitter:{divid:"scr_WaitingForSubmitter",column:"WaitingForSubmitter",name:"Patches waiting submitter",desc:"Patches waiting for a new version"},scr_submitted:{divid:"scr_submitted",column:"submitted",name:"Reviews submitted",desc:"Reviews submitted"},scr_submitters:{divid:"scr_submitters",column:"submitters",name:"Reviews submitters",desc:"Number of people submitting review processes."},scr_sent:{divid:"scr_sent",column:"sent",name:"Patches Sent",desc:"Patches sent"},scr_companies:{divid:"scr_companies",column:"companies",name:"Companies",desc:"Number of active companies"},scr_countries:{divid:"scr_countries",column:"countries",name:"Countries",desc:"Number of active countries"},scr_repositories:{divid:"scr_repositories",column:"repositories",name:"Respositories",desc:"Number of active respositories"},scr_closers:{divid:"scr_closers",column:"closers",name:"Closers",desc:"Reviews closers",action:"closed"},scr_openers:{divid:"scr_openers",column:"openers",name:"Openers",desc:"Reviews openers",action:"opened"},scr_reviewers:{divid:"scr_reviewers",column:"reviewers",name:"Reviewers",desc:"Number of people reviewing contributions"}},this.getMainMetric=function(){return"scr_merged"},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End",review_time_pending_ReviewsWaitingForReviewer_days_avg:"Review Time for reviewers (days, avg)",review_time_pending_ReviewsWaitingForReviewer_days_median:"Review Time for reviewers (days, median)",review_time_pending_update_ReviewsWaitingForReviewer_days_avg:"Update time for reviewers (days, avg)",review_time_pending_update_ReviewsWaitingForReviewer_days_median:"Update time for reviewers (days, avg)",review_time_pending_days_avg:"Review time (days, avg)",review_time_pending_days_median:"Review time (days, median)",review_time_pending_update_days_avg:"Update time (days, avg)",review_time_pending_update_days_median:"Update time (days, median)"};return e},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .scr_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().scr_url,this.global_data.type&&$(t+" #scr_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #scr_url").attr("href",r),$(t+" #scr_name").text("SCR "+this.global_data.type)):($(t+" #scr_url").attr("href",Report.getProjectData().mls_url),$(t+" #scr_name").text(Report.getProjectData().scr_name),$(t+" #scr_type").text(Report.getProjectData().scr_type));var i=this.getCompanyQuery(),s=this.getGlobalData();i&&(s=this.getCompaniesGlobalData()[i]),$(t+" #scrFirst").text(s.first_date),$(t+" #scrLast").text(s.last_date),$(t+" #scrReviews").text(s.scr_opened)},this.displayBubbles=function(e,t){},SCR.displaySCRListName=function(e){var t=e.split("_"),n="";return t.length>1?(n=t[t.length-1],n===""&&(n=t[t.length-2])):(n=e.replace("<",""),n=n.replace(">",""),t=n.split("."),n=t[0]),n},this.getTitle=function(){return"Source Code Review"}}function People(){this.basic_metrics={people_members:{column:"members",name:"Members",desc:"Community Members"}},this.getMainMetric=function(){return"people_members"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .mediawiki_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().mediawiki_url,this.global_data.type&&$(t+" #mediawiki_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #mediawiki_url").attr("href",r),$(t+" #mediawiki_name").text("MediaWiki "+this.global_data.type)):($(t+" #mediawiki_url").attr("href",Report.getProjectData().mediawiki_url),$(t+" #mediawiki_name").text(Report.getProjectData().mediawiki_name),$(t+" #mediawiki_type").text(Report.getProjectData().mediawiki_type));var i=this.getGlobalData();$(t+" #mediawikiFirst").text(i.first_date),$(t+" #mediawikiLast").text(i.last_date),$(t+" #mediawikiSent").text(i.mediawiki_reviews)},this.displayBubbles=function(e,t){},this.getTitle=function(){return"Community Members"}}function Downloads(){var e=this;this.basic_metrics={downloads_downloads:{name:"Total downloads",column:"downloads"},downloads_packages:{divid:"",column:"packages",name:"Packages downloaded",desc:"",action:"downloads"},downloads_ips:{divid:"",column:"ips",name:"IP addresses",desc:"",action:"downloads"}},this.getMainMetric=function(){return"downloads_downloads"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .irc_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().irc_url,this.global_data.type&&$(t+" #irc_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #irc_url").attr("href",r),$(t+" #irc_name").text("IRC "+this.global_data.type)):($(t+" #irc_url").attr("href",Report.getProjectData().irc_url),$(t+" #irc_name").text(Report.getProjectData().irc_name),$(t+" #irc_type").text(Report.getProjectData().irc_type));var i=this.getGlobalData();$(t+" #ircFirst").text(i.first_date),$(t+" #ircLast").text(i.last_date),$(t+" #ircSent").text(i.irc_sent),$(t+" #ircRepositories").text(i.irc_repositories),i.repositories===1&&$(t+" #ircRepositories").hide()},this.displayBubbles=function(e,t){},this.getTitle=function(){return"Downloads"}}function QAForums(){var e=this;this.basic_metrics={qaforums_sent:{name:"Messages posted",desc:"Number of messages posted to Q&A forums(s)",column:"sent"},qaforums_qsent:{name:"Questions posted",desc:"Number of questions posted to Q&A forums(s)",column:"qsent"},qaforums_asent:{name:"Answers posted",desc:"Number of answers posted to Q&A forums(s)",column:"asent"},qaforums_senders:{name:"Persons posting messages",desc:"Number of persons posting messages to Q&A forums(s)",column:"senders"},qaforums_asenders:{name:"Persons posting answers",desc:"Number of persons answering in Q&A forums(s)",column:"asenders"},qaforums_qsenders:{divid:"qaforums_qsenders",name:"Persons posting questions",desc:"Number of persons asking questions in Q&A forums(s)",column:"qsenders"},qaforums_participants:{name:"Participants",desc:"Number of persons posting messages",column:"participants"}},this.getMainMetric=function(){return"qaforums_qsent"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .irc_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().irc_url,this.global_data.type&&$(t+" #irc_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #irc_url").attr("href",r),$(t+" #irc_name").text("IRC "+this.global_data.type)):($(t+" #irc_url").attr("href",Report.getProjectData().irc_url),$(t+" #irc_name").text(Report.getProjectData().irc_name),$(t+" #irc_type").text(Report.getProjectData().irc_type));var i=this.getGlobalData();$(t+" #ircFirst").text(i.first_date),$(t+" #ircLast").text(i.last_date),$(t+" #ircSent").text(i.irc_sent),$(t+" #ircRepositories").text(i.irc_repositories),i.repositories===1&&$(t+" #ircRepositories").hide()},this.displayBubbles=function(e,t){},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End",sent:"Messages posted",qsent:"Questions posted",asent:"Answers posted",senders:"Persons posting messages",asenders:"Persons posting answers",qsenders:"Persons posting questions"};return e},this.getTitle=function(){return"QAForums"}}function Releases(){var e=this;this.basic_metrics={releases_modules:{name:"Modules created",desc:"Number of modules created on the forge",column:"modules"}},this.getMainMetric=function(){return"releases_modules"},this.displayData=function(e){var t="#"+e,n=this.global_data.url;if(!n||n.length===0){$(t+" .irc_info").hide();return}var r="";this.global_data.repositories===1?r=this.global_data.url:r=Report.getProjectData().irc_url,this.global_data.type&&$(t+" #irc_type").text(this.global_data.type),this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined?($(t+" #irc_url").attr("href",r),$(t+" #irc_name").text("IRC "+this.global_data.type)):($(t+" #irc_url").attr("href",Report.getProjectData().irc_url),$(t+" #irc_name").text(Report.getProjectData().irc_name),$(t+" #irc_type").text(Report.getProjectData().irc_type));var i=this.getGlobalData();$(t+" #ircFirst").text(i.first_date),$(t+" #ircLast").text(i.last_date),$(t+" #ircSent").text(i.irc_sent),$(t+" #ircRepositories").text(i.irc_repositories),i.repositories===1&&$(t+" #ircRepositories").hide()},this.displayBubbles=function(e,t){},this.getSummaryLabels=function(){var e={first_date:"Start",last_date:"End",modules:"Modules created",releases:"Module releases created",authors:"Persons creating/updating modules"};return e},this.getTitle=function(){return"Releases"}}(function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.slice,u=r.unshift,a=i.toString,f=i.hasOwnProperty,l=r.forEach,c=r.map,h=r.reduce,p=r.reduceRight,d=r.filter,v=r.every,m=r.some,g=r.indexOf,y=r.lastIndexOf,b=Array.isArray,w=Object.keys,E=s.bind,S=function(e){return new k(e)};typeof module!="undefined"&&module.exports?(module.exports=S,S._=S):e._=S,S.VERSION="1.1.7";var x=S.each=S.forEach=function(e,t,r){if(e==null)return;if(l&&e.forEach===l)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(i in e&&t.call(r,e[i],i,e)===n)return}else for(var o in e)if(f.call(e,o)&&t.call(r,e[o],o,e)===n)return};S.map=function(e,t,n){var r=[];return e==null?r:c&&e.map===c?e.map(t,n):(x(e,function(e,i,s){r[r.length]=t.call(n,e,i,s)}),r)},S.reduce=S.foldl=S.inject=function(e,t,n,r){var i=n!==void 0;e==null&&(e=[]);if(h&&e.reduce===h)return r&&(t=S.bind(t,r)),i?e.reduce(t,n):e.reduce(t);x(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},S.reduceRight=S.foldr=function(e,t,n,r){e==null&&(e=[]);if(p&&e.reduceRight===p)return r&&(t=S.bind(t,r)),n!==void 0?e.reduceRight(t,n):e.reduceRight(t);var i=(S.isArray(e)?e.slice():S.toArray(e)).reverse();return S.reduce(i,t,n,r)},S.find=S.detect=function(e,t,n){var r;return T(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},S.filter=S.select=function(e,t,n){var r=[];return e==null?r:d&&e.filter===d?e.filter(t,n):(x(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},S.reject=function(e,t,n){var r=[];return e==null?r:(x(e,function(e,i,s){t.call(n,e,i,s)||(r[r.length]=e)}),r)},S.every=S.all=function(e,t,r){var i=!0;return e==null?i:v&&e.every===v?e.every(t,r):(x(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),i)};var T=S.some=S.any=function(e,t,r){t=t||S.identity;var i=!1;return e==null?i:m&&e.some===m?e.some(t,r):(x(e,function(e,s,o){if(i|=t.call(r,e,s,o))return n}),!!i)};S.include=S.contains=function(e,t){var n=!1;return e==null?n:g&&e.indexOf===g?e.indexOf(t)!=-1:(T(e,function(e){if(n=e===t)return!0}),n)},S.invoke=function(e,t){var n=o.call(arguments,2);return S.map(e,function(e){return(t.call?t||e:e[t]).apply(e,n)})},S.pluck=function(e,t){return S.map(e,function(e){return e[t]})},S.max=function(e,t,n){if(!t&&S.isArray(e))return Math.max.apply(Math,e);var r={computed:-Infinity};return x(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},S.min=function(e,t,n){if(!t&&S.isArray(e))return Math.min.apply(Math,e);var r={computed:Infinity};return x(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},S.sortBy=function(e,t,n){return S.pluck(S.map(e,function(e,r,i){return{value:e,criteria:t.call(n,e,r,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;return n<r?-1:n>r?1:0}),"value")},S.groupBy=function(e,t){var n={};return x(e,function(e,r){var i=t(e,r);(n[i]||(n[i]=[])).push(e)}),n},S.sortedIndex=function(e,t,n){n||(n=S.identity);var r=0,i=e.length;while(r<i){var s=r+i>>1;n(e[s])<n(t)?r=s+1:i=s}return r},S.toArray=function(e){return e?e.toArray?e.toArray():S.isArray(e)?o.call(e):S.isArguments(e)?o.call(e):S.values(e):[]},S.size=function(e){return S.toArray(e).length},S.first=S.head=function(e,t,n){return t!=null&&!n?o.call(e,0,t):e[0]},S.rest=S.tail=function(e,t,n){return o.call(e,t==null||n?1:t)},S.last=function(e){return e[e.length-1]},S.compact=function(e){return S.filter(e,function(e){return!!e})},S.flatten=function(e){return S.reduce(e,function(e,t){return S.isArray(t)?e.concat(S.flatten(t)):(e[e.length]=t,e)},[])},S.without=function(e){return S.difference(e,o.call(arguments,1))},S.uniq=S.unique=function(e,t){return S.reduce(e,function(e,n,r){if(0==r||(t===!0?S.last(e)!=n:!S.include(e,n)))e[e.length]=n;return e},[])},S.union=function(){return S.uniq(S.flatten(arguments))},S.intersection=S.intersect=function(e){var t=o.call(arguments,1);return S.filter(S.uniq(e),function(e){return S.every(t,function(t){return S.indexOf(t,e)>=0})})},S.difference=function(e,t){return S.filter(e,function(e){return!S.include(t,e)})},S.zip=function(){var e=o.call(arguments),t=S.max(S.pluck(e,"length")),n=new Array(t);for(var r=0;r<t;r++)n[r]=S.pluck(e,""+r);return n},S.indexOf=function(e,t,n){if(e==null)return-1;var r,i;if(n)return r=S.sortedIndex(e,t),e[r]===t?r:-1;if(g&&e.indexOf===g)return e.indexOf(t);for(r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1},S.lastIndexOf=function(e,t){if(e==null)return-1;if(y&&e.lastIndexOf===y)return e.lastIndexOf(t);var n=e.length;while(n--)if(e[n]===t)return n;return-1},S.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s},S.bind=function(e,t){if(e.bind===E&&E)return E.apply(e,o.call(arguments,1));var n=o.call(arguments,2);return function(){return e.apply(t,n.concat(o.call(arguments)))}},S.bindAll=function(e){var t=o.call(arguments,1);return t.length==0&&(t=S.functions(e)),x(t,function(t){e[t]=S.bind(e[t],e)}),e},S.memoize=function(e,t){var n={};return t||(t=S.identity),function(){var r=t.apply(this,arguments);return f.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},S.delay=function(e,t){var n=o.call(arguments,2);return setTimeout(function(){return e.apply(e,n)},t)},S.defer=function(e){return S.delay.apply(S,[e,1].concat(o.call(arguments,1)))};var N=function(e,t,n){var r;return function(){var i=this,s=arguments,o=function(){r=null,e.apply(i,s)};n&&clearTimeout(r);if(n||!r)r=setTimeout(o,t)}};S.throttle=function(e,t){return N(e,t,!1)},S.debounce=function(e,t){return N(e,t,!0)},S.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments))}},S.wrap=function(e,t){return function(){var n=[e].concat(o.call(arguments));return t.apply(this,n)}},S.compose=function(){var e=o.call(arguments);return function(){var t=o.call(arguments);for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},S.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},S.keys=w||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)f.call(e,n)&&(t[t.length]=n);return t},S.values=function(e){return S.map(e,S.identity)},S.functions=S.methods=function(e){var t=[];for(var n in e)S.isFunction(e[n])&&t.push(n);return t.sort()},S.extend=function(e){return x(o.call(arguments,1),function(t){for(var n in t)t[n]!==void 0&&(e[n]=t[n])}),e},S.defaults=function(e){return x(o.call(arguments,1),function(t){for(var n in t)e[n]==null&&(e[n]=t[n])}),e},S.clone=function(e){return S.isArray(e)?e.slice():S.extend({},e)},S.tap=function(e,t){return t(e),e},S.isEqual=function(e,t){if(e===t)return!0;var n=typeof e,r=typeof t;if(n!=r)return!1;if(e==t)return!0;if(!e&&t||e&&!t)return!1;e._chain&&(e=e._wrapped),t._chain&&(t=t._wrapped);if(e.isEqual)return e.isEqual(t);if(t.isEqual)return t.isEqual(e);if(S.isDate(e)&&S.isDate(t))return e.getTime()===t.getTime();if(S.isNaN(e)&&S.isNaN(t))return!1;if(S.isRegExp(e)&&S.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline;if(n!=="object")return!1;if(e.length&&e.length!==t.length)return!1;var i=S.keys(e),s=S.keys(t);if(i.length!=s.length)return!1;for(var o in e)if(!(o in t)||!S.isEqual(e[o],t[o]))return!1;return!0},S.isEmpty=function(e){if(S.isArray(e)||S.isString(e))return e.length===0;for(var t in e)if(f.call(e,t))return!1;return!0},S.isElement=function(e){return!!e&&e.nodeType==1},S.isArray=b||function(e){return a.call(e)==="[object Array]"},S.isObject=function(e){return e===Object(e)},S.isArguments=function(e){return!!e&&!!f.call(e,"callee")},S.isFunction=function(e){return!!(e&&e.constructor&&e.call&&e.apply)},S.isString=function(e){return!!(e===""||e&&e.charCodeAt&&e.substr)},S.isNumber=function(e){return!!(e===0||e&&e.toExponential&&e.toFixed)},S.isNaN=function(e){return e!==e},S.isBoolean=function(e){return e===!0||e===!1},S.isDate=function(e){return!!(e&&e.getTimezoneOffset&&e.setUTCFullYear)},S.isRegExp=function(e){return!(!(e&&e.test&&e.exec)||!e.ignoreCase&&e.ignoreCase!==!1)},S.isNull=function(e){return e===null},S.isUndefined=function(e){return e===void 0},S.noConflict=function(){return e._=t,this},S.identity=function(e){return e},S.times=function(e,t,n){for(var r=0;r<e;r++)t.call(n,r)},S.mixin=function(e){x(S.functions(e),function(t){A(t,S[t]=e[t])})};var C=0;S.uniqueId=function(e){var t=C++;return e?e+t:t},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g},S.template=function(e,t){var n=S.templateSettings,r="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(n.interpolate,function(e,t){return"',"+t.replace(/\\'/g,"'")+",'"}).replace(n.evaluate||null,function(e,t){return"');"+t.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",i=new Function("obj",r);return t?i(t):i};var k=function(e){this._wrapped=e};S.prototype=k.prototype;var L=function(e,t){return t?S(e).chain():e},A=function(e,t){k.prototype[e]=function(){var e=o.call(arguments);return u.call(e,this._wrapped),L(t.apply(S,e),this._chain)}};S.mixin(S),x(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];k.prototype[e]=function(){return t.apply(this._wrapped,arguments),L(this._wrapped,this._chain)}}),x(["concat","join","slice"],function(e){var t=r[e];k.prototype[e]=function(){return L(t.apply(this._wrapped,arguments),this._chain)}}),k.prototype.chain=function(){return this._chain=!0,this},k.prototype.value=function(){return this._wrapped}})(),!function(e,t,n){typeof module!="undefined"?module.exports=n(e,t):typeof define=="function"&&typeof define.amd=="object"?define(n):t[e]=n(e,t)}("bean",this,function(e,t){var n=window,r=t[e],i=/over|out/,s=/[^\.]*(?=\..*)\.|.*/,o=/\..*/,u="addEventListener",a="attachEvent",f="removeEventListener",l="detachEvent",c=document||{},h=c.documentElement||{},p=h[u],d=p?u:a,v=Array.prototype.slice,m=/click|mouse|menu|drag|drop/i,g=/^touch|^gesture/i,y={one:1},b=function(e,t,n){for(n=0;n<t.length;n++)e[t[n]]=1;return e}({},("click dblclick mouseup mousedown contextmenu mousewheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(p?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),w=function(){function e(e,t){while((t=t.parentNode)!==null)if(t===e)return!0;return!1}function t(t){var n=t.relatedTarget;return n?n!==this&&n.prefix!=="xul"&&!/document/.test(this.toString())&&!e(this,n):n===null}return{mouseenter:{base:"mouseover",condition:t},mouseleave:{base:"mouseout",condition:t},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),E=function(){var e="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),t=e.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),n=e.concat("char charCode key keyCode".split(" ")),r=e.concat("touches targetTouches changedTouches scale rotation".split(" ")),s="preventDefault",o=function(e){return function(){e[s]?e[s]():e.returnValue=!1}},u="stopPropagation",a=function(e){return function(){e[u]?e[u]():e.cancelBubble=!0}},f=function(e){return function(){e[s](),e[u](),e.stopped=!0}},l=function(e,t,n){var r,i;for(r=n.length;r--;)i=n[r],!(i in t)&&i in e&&(t[i]=e[i])};return function(p,d){var v={originalEvent:p,isNative:d};if(!p)return v;var y,b=p.type,w=p.target||p.srcElement;v[s]=o(p),v[u]=a(p),v.stop=f(v),v.target=w&&w.nodeType===3?w.parentNode:w;if(d){if(b.indexOf("key")!==-1)y=n,v.keyCode=p.which||p.keyCode;else if(m.test(b)){y=t,v.rightClick=p.which===3||p.button===2,v.pos={x:0,y:0};if(p.pageX||p.pageY)v.clientX=p.pageX,v.clientY=p.pageY;else if(p.clientX||p.clientY)v.clientX=p.clientX+c.body.scrollLeft+h.scrollLeft,v.clientY=p.clientY+c.body.scrollTop+h.scrollTop;i.test(b)&&(v.relatedTarget=p.relatedTarget||p[(b==="mouseover"?"from":"to")+"Element"])}else g.test(b)&&(y=r);l(p,v,y||e)}return v}}(),S=function(e,t){return!p&&!t&&(e===c||e===n)?h:e},x=function(){function e(e,t,n,r,i){this.element=e,this.type=t,this.handler=n,this.original=r,this.namespaces=i,this.custom=w[t],this.isNative=b[t]&&e[d],this.eventType=p||this.isNative?t:"propertychange",this.customType=!p&&!this.isNative&&t,this.target=S(e,this.isNative),this.eventSupport=this.target[d]}return e.prototype={inNamespaces:function(e){var t,n;if(!e)return!0;if(!this.namespaces)return!1;for(t=e.length;t--;)for(n=this.namespaces.length;n--;)if(e[t]===this.namespaces[n])return!0;return!1},matches:function(e,t,n){return this.element===e&&(!t||this.original===t)&&(!n||this.handler===n)}},e}(),T=function(){var e={},t=function(n,r,i,s,o){if(!r||r==="*")for(var u in e)u.charAt(0)==="$"&&t(n,u.substr(1),i,s,o);else{var a=0,f,l=e["$"+r],c=n==="*";if(!l)return;for(f=l.length;a<f;a++)if(c||l[a].matches(n,i,s))if(!o(l[a],l,a,r))return}},n=function(t,n,r){var i,s=e["$"+n];if(s)for(i=s.length;i--;)if(s[i].matches(t,r,null))return!0;return!1},r=function(e,n,r){var i=[];return t(e,n,r,null,function(e){return i.push(e)}),i},i=function(t){return(e["$"+t.type]||(e["$"+t.type]=[])).push(t),t},s=function(n){t(n.element,n.type,null,n.handler,function(t,n,r){return n.splice(r,1),n.length===0&&delete e["$"+t.type],!1})},o=function(){var t,n=[];for(t in e)t.charAt(0)==="$"&&(n=n.concat(e[t]));return n};return{has:n,get:r,put:i,del:s,entries:o}}(),N=p?function(e,t,n,r){e[r?u:f](t,n,!1)}:function(e,t,n,r,i){i&&r&&e["_on"+i]===null&&(e["_on"+i]=0),e[r?a:l]("on"+t,n)},C=function(e,t,r){return function(i){return i=E(i||((this.ownerDocument||this.document||this).parentWindow||n).event,!0),t.apply(e,[i].concat(r))}},k=function(e,t,r,i,s,o){return function(u){if(i?i.apply(this,arguments):p?!0:u&&u.propertyName==="_on"+r||!u)u&&(u=E(u||((this.ownerDocument||this.document||this).parentWindow||n).event,o)),t.apply(e,u&&(!s||s.length===0)?arguments:v.call(arguments,u?0:1).concat(s))}},L=function(e,t,n,r,i){return function(){e(t,n,i),r.apply(this,arguments)}},A=function(e,t,n,r){var i,s,u,a=t&&t.replace(o,""),f=T.get(e,a,n);for(i=0,s=f.length;i<s;i++)f[i].inNamespaces(r)&&((u=f[i]).eventSupport&&N(u.target,u.eventType,u.handler,!1,u.type),T.del(u))},O=function(e,t,n,r,i){var u,a=t.replace(o,""),f=t.replace(s,"").split(".");if(T.has(e,a,n))return e;a==="unload"&&(n=L(A,e,a,n,r)),w[a]&&(w[a].condition&&(n=k(e,n,a,w[a].condition,!0)),a=w[a].base||a),u=T.put(new x(e,a,n,r,f[0]&&f)),u.handler=u.isNative?C(e,u.handler,i):k(e,u.handler,a,!1,i,!1),u.eventSupport&&N(u.target,u.eventType,u.handler,!0,u.customType)
},M=function(e,t,n){return function(r){var i,s,o=typeof e=="string"?n(e,this):e;for(i=r.target;i&&i!==this;i=i.parentNode)for(s=o.length;s--;)if(o[s]===i)return t.apply(i,arguments)}},_=function(e,t,n){var r,i,u,a,f,l=A,c=t&&typeof t=="string";if(c&&t.indexOf(" ")>0){t=t.split(" ");for(f=t.length;f--;)_(e,t[f],n);return e}u=c&&t.replace(o,""),u&&w[u]&&(u=w[u].type);if(!t||c){if(a=c&&t.replace(s,""))a=a.split(".");l(e,u,n,a)}else if(typeof t=="function")l(e,null,t);else for(r in t)t.hasOwnProperty(r)&&_(e,r,t[r]);return e},D=function(e,t,n,r,i){var s,o,u,a,f=n,l=n&&typeof n=="string";if(t&&!n&&typeof t=="object")for(s in t)t.hasOwnProperty(s)&&D.apply(this,[e,s,t[s]]);else{a=arguments.length>3?v.call(arguments,3):[],o=(l?n:t).split(" "),l&&(n=M(t,f=r,i))&&(a=v.call(a,1)),this===y&&(n=L(_,e,t,n,f));for(u=o.length;u--;)O(e,o[u],n,f,a)}return e},P=function(){return D.apply(y,arguments)},H=p?function(e,t,r){var i=c.createEvent(e?"HTMLEvents":"UIEvents");i[e?"initEvent":"initUIEvent"](t,!0,!0,n,1),r.dispatchEvent(i)}:function(e,t,n){n=S(n,e),e?n.fireEvent("on"+t,c.createEventObject()):n["_on"+t]++},B=function(e,t,n){var r,i,u,a,f,l=t.split(" ");for(r=l.length;r--;){t=l[r].replace(o,"");if(a=l[r].replace(s,""))a=a.split(".");if(!a&&!n&&e[d])H(b[t],t,e);else{f=T.get(e,t),n=[!1].concat(n);for(i=0,u=f.length;i<u;i++)f[i].inNamespaces(a)&&f[i].handler.apply(e,n)}}return e},j=function(e,t,n){var r=0,i=T.get(t,n),s=i.length;for(;r<s;r++)i[r].original&&D(e,i[r].type,i[r].original);return e},F={add:D,one:P,remove:_,clone:j,fire:B,noConflict:function(){return t[e]=r,this}};if(n[a]){var I=function(){var e,t=T.entries();for(e in t)t[e].type&&t[e].type!=="unload"&&_(t[e].element,t[e].type);n[l]("onunload",I),n.CollectGarbage&&n.CollectGarbage()};n[a]("onunload",I)}return F}),function(){var e=this,t=this.Flotr,n;n={_:_,bean:bean,isIphone:/iphone/i.test(navigator.userAgent),isIE:navigator.appVersion.indexOf("MSIE")!=-1?parseFloat(navigator.appVersion.split("MSIE")[1]):!1,graphTypes:{},plugins:{},addType:function(e,t){n.graphTypes[e]=t,n.defaultOptions[e]=t.options||{},n.defaultOptions.defaultType=n.defaultOptions.defaultType||e},addPlugin:function(e,t){n.plugins[e]=t,n.defaultOptions[e]=t.options||{}},draw:function(e,t,r,i){return i=i||n.Graph,new i(e,t,r)},merge:function(e,t){var r,i,s=t||{};for(r in e)i=e[r],i&&typeof i=="object"?i.constructor===Array?s[r]=this._.clone(i):i.constructor!==RegExp&&!this._.isElement(i)&&!i.jquery?s[r]=n.merge(i,t?t[r]:undefined):s[r]=i:s[r]=i;return s},clone:function(e){return n.merge(e,{})},getTickSize:function(e,t,r,i){var s=(r-t)/e,o=n.getMagnitude(s),u=10,a=s/o;return a<1.5?u=1:a<2.25?u=2:a<3?u=i===0?2:2.5:a<7.5&&(u=5),u*o},defaultTickFormatter:function(e,t){return e+""},defaultTrackFormatter:function(e){return"("+e.x+", "+e.y+")"},engineeringNotation:function(e,t,n){var r=["Y","Z","E","P","T","G","M","k",""],i=["y","z","a","f","p","n","µ","m",""],s=r.length;n=n||1e3,t=Math.pow(10,t||2);if(e===0)return 0;if(e>1)while(s--&&e>=n)e/=n;else{r=i,s=r.length;while(s--&&e<1)e*=n}return Math.round(e*t)/t+r[s]},getMagnitude:function(e){return Math.pow(10,Math.floor(Math.log(e)/Math.LN10))},toPixel:function(e){return Math.floor(e)+.5},toRad:function(e){return-e*(Math.PI/180)},floorInBase:function(e,t){return t*Math.floor(e/t)},drawText:function(e,t,r,i,s){if(!e.fillText){e.drawText(t,r,i,s);return}s=this._.extend({size:n.defaultOptions.fontSize,color:"#000000",textAlign:"left",textBaseline:"bottom",weight:1,angle:0},s),e.save(),e.translate(r,i),e.rotate(s.angle),e.fillStyle=s.color,e.font=(s.weight>1?"bold ":"")+s.size*1.3+"px sans-serif",e.textAlign=s.textAlign,e.textBaseline=s.textBaseline,e.fillText(t,0,0),e.restore()},getBestTextAlign:function(e,t){return t=t||{textAlign:"center",textBaseline:"middle"},e+=n.getTextAngleFromAlign(t),Math.abs(Math.cos(e))>.01&&(t.textAlign=Math.cos(e)>0?"right":"left"),Math.abs(Math.sin(e))>.01&&(t.textBaseline=Math.sin(e)>0?"top":"bottom"),t},alignTable:{"right middle":0,"right top":Math.PI/4,"center top":Math.PI/2,"left top":3*(Math.PI/4),"left middle":Math.PI,"left bottom":-3*(Math.PI/4),"center bottom":-Math.PI/2,"right bottom":-Math.PI/4,"center middle":0},getTextAngleFromAlign:function(e){return n.alignTable[e.textAlign+" "+e.textBaseline]||0},noConflict:function(){return e.Flotr=t,this}},e.Flotr=n}(),Flotr.defaultOptions={colors:["#00A8F0","#C0D800","#CB4B4B","#4DA74D","#9440ED"],ieBackgroundColor:"#FFFFFF",title:null,subtitle:null,shadowSize:4,defaultType:null,HtmlText:!0,fontColor:"#545454",fontSize:7.5,resolution:1,parseFloat:!0,preventDefault:!0,xaxis:{ticks:null,minorTicks:null,showLabels:!0,showMinorLabels:!1,labelsAngle:0,title:null,titleAngle:0,noTicks:5,minorTickFreq:null,tickFormatter:Flotr.defaultTickFormatter,tickDecimals:null,min:null,max:null,autoscale:!1,autoscaleMargin:0,color:null,mode:"normal",timeFormat:null,timeMode:"UTC",timeUnit:"millisecond",scaling:"linear",base:Math.E,titleAlign:"center",margin:!0},x2axis:{},yaxis:{ticks:null,minorTicks:null,showLabels:!0,showMinorLabels:!1,labelsAngle:0,title:null,titleAngle:90,noTicks:5,minorTickFreq:null,tickFormatter:Flotr.defaultTickFormatter,tickDecimals:null,min:null,max:null,autoscale:!1,autoscaleMargin:0,color:null,scaling:"linear",base:Math.E,titleAlign:"center",margin:!0},y2axis:{titleAngle:270},grid:{color:"#545454",backgroundColor:null,backgroundImage:null,watermarkAlpha:.4,tickColor:"#DDDDDD",labelMargin:3,verticalLines:!0,minorVerticalLines:null,horizontalLines:!0,minorHorizontalLines:null,outlineWidth:1,outline:"nsew",circular:!1},mouse:{track:!1,trackAll:!1,position:"se",relative:!1,trackFormatter:Flotr.defaultTrackFormatter,margin:5,lineColor:"#FF3F19",trackDecimals:1,sensibility:2,trackY:!0,radius:3,fillColor:null,fillOpacity:.4}},function(){function t(e,t,n,r){this.rgba=["r","g","b","a"];var i=4;while(-1<--i)this[this.rgba[i]]=arguments[i]||(i==3?1:0);this.normalize()}var e=Flotr._,n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};t.prototype={scale:function(t,n,r,i){var s=4;while(-1<--s)e.isUndefined(arguments[s])||(this[this.rgba[s]]*=arguments[s]);return this.normalize()},alpha:function(t){return!e.isUndefined(t)&&!e.isNull(t)&&(this.a=t),this.normalize()},clone:function(){return new t(this.r,this.b,this.g,this.a)},limit:function(e,t,n){return Math.max(Math.min(e,n),t)},normalize:function(){var e=this.limit;return this.r=e(parseInt(this.r,10),0,255),this.g=e(parseInt(this.g,10),0,255),this.b=e(parseInt(this.b,10),0,255),this.a=e(this.a,0,1),this},distance:function(e){if(!e)return;e=new t.parse(e);var n=0,r=3;while(-1<--r)n+=Math.abs(this[this.rgba[r]]-e[this.rgba[r]]);return n},toString:function(){return this.a>=1?"rgb("+[this.r,this.g,this.b].join(",")+")":"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"},contrast:function(){var e=1-(.299*this.r+.587*this.g+.114*this.b)/255;return e<.5?"#000000":"#ffffff"}},e.extend(t,{parse:function(e){if(e instanceof t)return e;var r;if(r=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e))return new t(parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16));if(r=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))return new t(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10));if(r=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e))return new t(parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16));if(r=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return new t(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4]));if(r=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(e))return new t(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55);if(r=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return new t(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55,parseFloat(r[4]));var i=(e+"").replace(/^\s*([\S\s]*?)\s*$/,"$1").toLowerCase();return i=="transparent"?new t(255,255,255,0):(r=n[i])?new t(r[0],r[1],r[2]):new t(0,0,0,0)},processColor:function(n,r){var i=r.opacity;if(!n)return"rgba(0, 0, 0, 0)";if(n instanceof t)return n.alpha(i).toString();if(e.isString(n))return t.parse(n).alpha(i).toString();var s=n.colors?n:{colors:n};if(!r.ctx)return e.isArray(s.colors)?t.parse(e.isArray(s.colors[0])?s.colors[0][1]:s.colors[0]).alpha(i).toString():"rgba(0, 0, 0, 0)";s=e.extend({start:"top",end:"bottom"},s),/top/i.test(s.start)&&(r.x1=0),/left/i.test(s.start)&&(r.y1=0),/bottom/i.test(s.end)&&(r.x2=0),/right/i.test(s.end)&&(r.y2=0);var o,u,a,f=r.ctx.createLinearGradient(r.x1,r.y1,r.x2,r.y2);for(o=0;o<s.colors.length;o++)u=s.colors[o],e.isArray(u)?(a=u[0],u=u[1]):a=o/(s.colors.length-1),f.addColorStop(a,t.parse(u).alpha(i));return f}}),Flotr.Color=t}(),Flotr.Date={set:function(e,t,n,r){n=n||"UTC",t="set"+(n==="UTC"?"UTC":"")+t,e[t](r)},get:function(e,t,n){return n=n||"UTC",t="get"+(n==="UTC"?"UTC":"")+t,e[t]()},format:function(e,t,n){function s(e){return e+="",e.length==1?"0"+e:e}if(!e)return;var r=this.get,i={h:r(e,"Hours",n).toString(),H:s(r(e,"Hours",n)),M:s(r(e,"Minutes",n)),S:s(r(e,"Seconds",n)),s:r(e,"Milliseconds",n),d:r(e,"Date",n).toString(),m:(r(e,"Month",n)+1).toString(),y:r(e,"FullYear",n).toString(),b:Flotr.Date.monthNames[r(e,"Month",n)]},o=[],u,a=!1;for(var f=0;f<t.length;++f)u=t.charAt(f),a?(o.push(i[u]||u),a=!1):u=="%"?a=!0:o.push(u);return o.join("")},getFormat:function(e,t){var n=Flotr.Date.timeUnits;return e<n.second?"%h:%M:%S.%s":e<n.minute?"%h:%M:%S":e<n.day?t<2*n.day?"%h:%M":"%b %d %h:%M":e<n.month?"%b %d":e<n.year?t<n.year?"%b":"%b %y":"%y"},formatter:function(e,t){var n=t.options,r=Flotr.Date.timeUnits[n.timeUnit],i=new Date(e*r);if(t.options.timeFormat)return Flotr.Date.format(i,n.timeFormat,n.timeMode);var s=(t.max-t.min)*r,o=t.tickSize*Flotr.Date.timeUnits[t.tickUnit];return Flotr.Date.format(i,Flotr.Date.getFormat(o,s),n.timeMode)},generator:function(e){function y(e){t(m,e,o,Flotr.floorInBase(n(m,e,o),h))}var t=this.set,n=this.get,r=this.timeUnits,i=this.spec,s=e.options,o=s.timeMode,u=r[s.timeUnit],a=e.min*u,f=e.max*u,l=(f-a)/s.noTicks,c=[],h=e.tickSize,p,d,v;d=s.tickFormatter===Flotr.defaultTickFormatter?this.formatter:s.tickFormatter;for(v=0;v<i.length-1;++v){var m=i[v][0]*r[i[v][1]];if(l<(m+i[v+1][0]*r[i[v+1][1]])/2&&m>=h)break}h=i[v][0],p=i[v][1],p=="year"&&(h=Flotr.getTickSize(s.noTicks*r.year,a,f,0),h==.5&&(p="month",h=6)),e.tickUnit=p,e.tickSize=h;var g=h*r[p];m=new Date(a);switch(p){case"millisecond":y("Milliseconds");break;case"second":y("Seconds");break;case"minute":y("Minutes");break;case"hour":y("Hours");break;case"month":y("Month");break;case"year":y("FullYear")}g>=r.second&&t(m,"Milliseconds",o,0),g>=r.minute&&t(m,"Seconds",o,0),g>=r.hour&&t(m,"Minutes",o,0),g>=r.day&&t(m,"Hours",o,0),g>=r.day*4&&t(m,"Date",o,1),g>=r.year&&t(m,"Month",o,0);var b=0,w=NaN,E;do{E=w,w=m.getTime(),c.push({v:w/u,label:d(w/u,e)});if(p=="month")if(h<1){t(m,"Date",o,1);var S=m.getTime();t(m,"Month",o,n(m,"Month",o)+1);var x=m.getTime();m.setTime(w+b*r.hour+(x-S)*h),b=n(m,"Hours",o),t(m,"Hours",o,0)}else t(m,"Month",o,n(m,"Month",o)+h);else p=="year"?t(m,"FullYear",o,n(m,"FullYear",o)+h):m.setTime(w+g)}while(w<f&&w!=E);return c},timeUnits:{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,year:31556952e3},spec:[[1,"millisecond"],[20,"millisecond"],[50,"millisecond"],[100,"millisecond"],[200,"millisecond"],[500,"millisecond"],[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},function(){function t(e){return e&&e.jquery?e[0]:e}var e=Flotr._;Flotr.DOM={addClass:function(n,r){n=t(n);var i=n.className?n.className:"";if(e.include(i.split(/\s+/g),r))return;n.className=(i?i+" ":"")+r},create:function(e){return document.createElement(e)},node:function(e){var t=Flotr.DOM.create("div"),n;return t.innerHTML=e,n=t.children[0],t.innerHTML="",n},empty:function(e){e=t(e),e.innerHTML=""},remove:function(e){e=t(e),e.parentNode.removeChild(e)},hide:function(e){e=t(e),Flotr.DOM.setStyles(e,{display:"none"})},insert:function(n,r){n=t(n),e.isString(r)?n.innerHTML+=r:e.isElement(r)&&n.appendChild(r)},opacity:function(e,n){e=t(e),e.style.opacity=n},position:function(e,n){return e=t(e),e.offsetParent?(n=this.position(e.offsetParent),n.left+=e.offsetLeft,n.top+=e.offsetTop,n):{left:e.offsetLeft||0,top:e.offsetTop||0}},removeClass:function(n,r){var i=n.className?n.className:"";n=t(n),n.className=e.filter(i.split(/\s+/g),function(e){if(e!=r)return!0}).join(" ")},setStyles:function(n,r){n=t(n),e.each(r,function(e,t){n.style[t]=e})},show:function(e){e=t(e),Flotr.DOM.setStyles(e,{display:""})},size:function(e){return e=t(e),{height:e.offsetHeight,width:e.offsetWidth}}}}(),function(){var e=Flotr,t=e.bean;e.EventAdapter={observe:function(e,n,r){return t.add(e,n,r),this},fire:function(e,n,r){return t.fire(e,n,r),typeof Prototype!="undefined"&&Event.fire(e,n,r),this},stopObserving:function(e,n,r){return t.remove(e,n,r),this},eventPointer:function(t){if(!e._.isUndefined(t.touches)&&t.touches.length>0)return{x:t.touches[0].pageX,y:t.touches[0].pageY};if(!e._.isUndefined(t.changedTouches)&&t.changedTouches.length>0)return{x:t.changedTouches[0].pageX,y:t.changedTouches[0].pageY};if(t.pageX||t.pageY)return{x:t.pageX,y:t.pageY};if(t.clientX||t.clientY){var n=document,r=n.body,i=n.documentElement;return{x:t.clientX+r.scrollLeft+i.scrollLeft,y:t.clientY+r.scrollTop+i.scrollTop}}}}}(),function(){function i(e,n,r){return t.observe.apply(this,arguments),this._handles.push(arguments),this}var e=Flotr.DOM,t=Flotr.EventAdapter,n=Flotr._,r=Flotr;Graph=function(e,i,s){this._setEl(e),this._initMembers(),this._initPlugins(),t.fire(this.el,"flotr:beforeinit",[this]),this.data=i,this.series=r.Series.getSeries(i),this._initOptions(s),this._initGraphTypes(),this._initCanvas(),this._text=new r.Text({element:this.el,ctx:this.ctx,html:this.options.HtmlText,textEnabled:this.textEnabled}),t.fire(this.el,"flotr:afterconstruct",[this]),this._initEvents(),this.findDataRanges(),this.calculateSpacing(),this.draw(n.bind(function(){t.fire(this.el,"flotr:afterinit",[this])},this))},Graph.prototype={destroy:function(){t.fire(this.el,"flotr:destroy"),n.each(this._handles,function(e){t.stopObserving.apply(this,e)}),this._handles=[],this.el.graph=null},observe:i,_observe:i,processColor:function(e,t){var i={x1:0,y1:0,x2:this.plotWidth,y2:this.plotHeight,opacity:1,ctx:this.ctx};return n.extend(i,t),r.Color.processColor(e,i)},findDataRanges:function(){var e=this.axes,t,i,s;n.each(this.series,function(e){s=e.getRange(),s&&(t=e.xaxis,i=e.yaxis,t.datamin=Math.min(s.xmin,t.datamin),t.datamax=Math.max(s.xmax,t.datamax),i.datamin=Math.min(s.ymin,i.datamin),i.datamax=Math.max(s.ymax,i.datamax),t.used=t.used||s.xused,i.used=i.used||s.yused)},this),!e.x.used&&!e.x2.used&&(e.x.used=!0),!e.y.used&&!e.y2.used&&(e.y.used=!0),n.each(e,function(e){e.calculateRange()});var o=n.keys(r.graphTypes),u=!1;n.each(this.series,function(e){if(e.hide)return;n.each(o,function(t){e[t]&&e[t].show&&(this.extendRange(t,e),u=!0)},this),u||this.extendRange(this.options.defaultType,e)},this)},extendRange:function(e,t){this[e].extendRange&&this[e].extendRange(t,t.data,t[e],this[e]),this[e].extendYRange&&this[e].extendYRange(t.yaxis,t.data,t[e],this[e]),this[e].extendXRange&&this[e].extendXRange(t.xaxis,t.data,t[e],this[e])},calculateSpacing:function(){var e=this.axes,t=this.options,r=this.series,i=t.grid.labelMargin,s=this._text,o=e.x,u=e.x2,a=e.y,f=e.y2,l=t.grid.outlineWidth,c,h,p,d;n.each(e,function(e){e.calculateTicks(),e.calculateTextDimensions(s,t)}),d=s.dimensions(t.title,{size:t.fontSize*1.5},"font-size:1em;font-weight:bold;","flotr-title"),this.titleHeight=d.height,d=s.dimensions(t.subtitle,{size:t.fontSize},"font-size:smaller;","flotr-subtitle"),this.subtitleHeight=d.height;for(h=0;h<t.length;++h)r[h].points.show&&(l=Math.max(l,r[h].points.radius+r[h].points.lineWidth/2));var v=this.plotOffset;o.options.margin===!1?(v.bottom=0,v.top=0):o.options.margin===!0?(v.bottom+=(t.grid.circular?0:o.used&&o.options.showLabels?o.maxLabel.height+i:0)+(o.used&&o.options.title?o.titleSize.height+i:0)+l,v.top+=(t.grid.circular?0:u.used&&u.options.showLabels?u.maxLabel.height+i:0)+(u.used&&u.options.title?u.titleSize.height+i:0)+this.subtitleHeight+this.titleHeight+l):(v.bottom=o.options.margin,v.top=o.options.margin),a.options.margin===!1?(v.left=0,v.right=0):a.options.margin===!0?(v.left+=(t.grid.circular?0:a.used&&a.options.showLabels?a.maxLabel.width+i:0)+(a.used&&a.options.title?a.titleSize.width+i:0)+l,v.right+=(t.grid.circular?0:f.used&&f.options.showLabels?f.maxLabel.width+i:0)+(f.used&&f.options.title?f.titleSize.width+i:0)+l):(v.left=a.options.margin,v.right=a.options.margin),v.top=Math.floor(v.top),this.plotWidth=this.canvasWidth-v.left-v.right,this.plotHeight=this.canvasHeight-v.bottom-v.top,o.length=u.length=this.plotWidth,a.length=f.length=this.plotHeight,a.offset=f.offset=this.plotHeight,o.setScale(),u.setScale(),a.setScale(),f.setScale()},draw:function(e){var n=this.ctx,r;t.fire(this.el,"flotr:beforedraw",[this.series,this]);if(this.series.length){n.save(),n.translate(this.plotOffset.left,this.plotOffset.top);for(r=0;r<this.series.length;r++)this.series[r].hide||this.drawSeries(this.series[r]);n.restore(),this.clip()}t.fire(this.el,"flotr:afterdraw",[this.series,this]),e&&e()},drawSeries:function(e){function t(e,t){var n=this.getOptions(e,t);this[t].draw(n)}var i=!1;e=e||this.series,n.each(r.graphTypes,function(n,r){e[r]&&e[r].show&&this[r]&&(i=!0,t.call(this,e,r))},this),i||t.call(this,e,this.options.defaultType)},getOptions:function(e,t){var n=e[t],i=this[t],s=e.xaxis,o=e.yaxis,u={context:this.ctx,width:this.plotWidth,height:this.plotHeight,fontSize:this.options.fontSize,fontColor:this.options.fontColor,textEnabled:this.textEnabled,htmlText:this.options.HtmlText,text:this._text,element:this.el,data:e.data,color:e.color,shadowSize:e.shadowSize,xScale:s.d2p,yScale:o.d2p,xInverse:s.p2d,yInverse:o.p2d};return u=r.merge(n,u),u.fillStyle=this.processColor(n.fillColor||e.color,{opacity:n.fillOpacity}),u},getEventPosition:function(n){var r=document,i=r.body,s=r.documentElement,o=this.axes,u=this.plotOffset,a=this.lastMousePos,f=t.eventPointer(n),l=f.x-a.pageX,c=f.y-a.pageY,h,p,d;return"ontouchstart"in this.el?(h=e.position(this.overlay),p=f.x-h.left-u.left,d=f.y-h.top-u.top):(h=this.overlay.getBoundingClientRect(),p=n.clientX-h.left-u.left-i.scrollLeft-s.scrollLeft,d=n.clientY-h.top-u.top-i.scrollTop-s.scrollTop),{x:o.x.p2d(p),x2:o.x2.p2d(p),y:o.y.p2d(d),y2:o.y2.p2d(d),relX:p,relY:d,dX:l,dY:c,absX:f.x,absY:f.y,pageX:f.x,pageY:f.y}},clickHandler:function(e){if(this.ignoreClick)return this.ignoreClick=!1,this.ignoreClick;t.fire(this.el,"flotr:click",[this.getEventPosition(e),this])},mouseMoveHandler:function(e){if(this.mouseDownMoveHandler)return;var n=this.getEventPosition(e);t.fire(this.el,"flotr:mousemove",[e,n,this]),this.lastMousePos=n},mouseDownHandler:function(e){if(this.mouseUpHandler)return;this.mouseUpHandler=n.bind(function(e){t.stopObserving(document,"mouseup",this.mouseUpHandler),t.stopObserving(document,"mousemove",this.mouseDownMoveHandler),this.mouseDownMoveHandler=null,this.mouseUpHandler=null,t.fire(this.el,"flotr:mouseup",[e,this])},this),this.mouseDownMoveHandler=n.bind(function(n){var r=this.getEventPosition(n);t.fire(this.el,"flotr:mousemove",[e,r,this]),this.lastMousePos=r},this),t.observe(document,"mouseup",this.mouseUpHandler),t.observe(document,"mousemove",this.mouseDownMoveHandler),t.fire(this.el,"flotr:mousedown",[e,this]),this.ignoreClick=!1},drawTooltip:function(t,n,r,i){var s=this.getMouseTrack(),o="opacity:0.7;background-color:#000;color:#fff;display:none;position:absolute;padding:2px 8px;-moz-border-radius:4px;border-radius:4px;white-space:nowrap;",u=i.position,a=i.margin,f=this.plotOffset;n!==null&&r!==null?(i.relative?(u.charAt(0)=="n"?o+="bottom:"+(a-f.top-r+this.canvasHeight)+"px;top:auto;":u.charAt(0)=="s"&&(o+="top:"+(a+f.top+r)+"px;bottom:auto;"),u.charAt(1)=="e"?o+="left:"+(a+f.left+n)+"px;right:auto;":u.charAt(1)=="w"&&(o+="right:"+(a-f.left-n+this.canvasWidth)+"px;left:auto;")):(u.charAt(0)=="n"?o+="top:"+(a+f.top)+"px;bottom:auto;":u.charAt(0)=="s"&&(o+="bottom:"+(a+f.bottom)+"px;top:auto;"),u.charAt(1)=="e"?o+="right:"+(a+f.right)+"px;left:auto;":u.charAt(1)=="w"&&(o+="left:"+(a+f.left)+"px;right:auto;")),s.style.cssText=o,e.empty(s),e.insert(s,t),e.show(s)):e.hide(s)},clip:function(e){var t=this.plotOffset,n=this.canvasWidth,i=this.canvasHeight;e=e||this.ctx;if(r.isIE&&r.isIE<9&&!r.isFlashCanvas){if(e===this.octx)return;e.save(),e.fillStyle=this.processColor(this.options.ieBackgroundColor),e.fillRect(0,0,n,t.top),e.fillRect(0,0,t.left,i),e.fillRect(0,i-t.bottom,n,t.bottom),e.fillRect(n-t.right,0,t.right,i),e.restore()}else e.clearRect(0,0,n,t.top),e.clearRect(0,0,t.left,i),e.clearRect(0,i-t.bottom,n,t.bottom),e.clearRect(n-t.right,0,t.right,i)},_initMembers:function(){this._handles=[],this.lastMousePos={pageX:null,pageY:null},this.plotOffset={left:0,right:0,top:0,bottom:0},this.ignoreClick=!0,this.prevHit=null},_initGraphTypes:function(){n.each(r.graphTypes,function(e,t){this[t]=r.clone(e)},this)},_initEvents:function(){var e=this.el,r,i,s;"ontouchstart"in e?(r=n.bind(function(n){s=!0,t.stopObserving(document,"touchend",r),t.fire(e,"flotr:mouseup",[event,this]),this.multitouches=null,i||this.clickHandler(n)},this),this.observe(this.overlay,"touchstart",n.bind(function(n){i=!1,s=!1,this.ignoreClick=!1,n.touches&&n.touches.length>1&&(this.multitouches=n.touches),t.fire(e,"flotr:mousedown",[event,this]),this.observe(document,"touchend",r)},this)),this.observe(this.overlay,"touchmove",n.bind(function(n){var r=this.getEventPosition(n);this.options.preventDefault&&n.preventDefault(),i=!0,this.multitouches||n.touches&&n.touches.length>1?this.multitouches=n.touches:s||t.fire(e,"flotr:mousemove",[event,r,this]),this.lastMousePos=r},this))):this.observe(this.overlay,"mousedown",n.bind(this.mouseDownHandler,this)).observe(e,"mousemove",n.bind(this.mouseMoveHandler,this)).observe(this.overlay,"click",n.bind(this.clickHandler,this)).observe(e,"mouseout",function(n){t.fire(e,"flotr:mouseout",n)})},_initCanvas:function(){function l(i,s){return i||(i=e.create("canvas"),typeof FlashCanvas!="undefined"&&typeof i.getContext=="function"&&(FlashCanvas.initElement(i),this.isFlashCanvas=!0),i.className="flotr-"+s,i.style.cssText="position:absolute;left:0px;top:0px;",e.insert(t,i)),n.each(a,function(t,n){e.show(i);if(s=="canvas"&&i.getAttribute(n)===t)return;i.setAttribute(n,t*r.resolution),i.style[n]=t+"px"}),i.context_=null,i}function c(e){window.G_vmlCanvasManager&&window.G_vmlCanvasManager.initElement(e);var t=e.getContext("2d");return window.G_vmlCanvasManager||t.scale(r.resolution,r.resolution),t}var t=this.el,r=this.options,i=t.children,s=[],o,u,a,f;for(u=i.length;u--;)o=i[u],!this.canvas&&o.className==="flotr-canvas"?this.canvas=o:!this.overlay&&o.className==="flotr-overlay"?this.overlay=o:s.push(o);for(u=s.length;u--;)t.removeChild(s[u]);e.setStyles(t,{position:"relative"}),a={},a.width=t.clientWidth,a.height=t.clientHeight;if(a.width<=0||a.height<=0||r.resolution<=0)throw"Invalid dimensions for plot, width = "+a.width+", height = "+a.height+", resolution = "+r.resolution;this.canvas=l(this.canvas,"canvas"),this.overlay=l(this.overlay,"overlay"),this.ctx=c(this.canvas),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.octx=c(this.overlay),this.octx.clearRect(0,0,this.overlay.width,this.overlay.height),this.canvasHeight=a.height,this.canvasWidth=a.width,this.textEnabled=!!this.ctx.drawText||!!this.ctx.fillText},_initPlugins:function(){n.each(r.plugins,function(e,t){n.each(e.callbacks,function(e,t){this.observe(this.el,t,n.bind(e,this))},this),this[t]=r.clone(e),n.each(this[t],function(e,r){n.isFunction(e)&&(this[t][r]=n.bind(e,this))},this)},this)},_initOptions:function(e){var i=r.clone(r.defaultOptions);i.x2axis=n.extend(n.clone(i.xaxis),i.x2axis),i.y2axis=n.extend(n.clone(i.yaxis),i.y2axis),this.options=r.merge(e||{},i),this.options.grid.minorVerticalLines===null&&this.options.xaxis.scaling==="logarithmic"&&(this.options.grid.minorVerticalLines=!0),this.options.grid.minorHorizontalLines===null&&this.options.yaxis.scaling==="logarithmic"&&(this.options.grid.minorHorizontalLines=!0),t.fire(this.el,"flotr:afterinitoptions",[this]),this.axes=r.Axis.getAxes(this.options);var s=[],o=[],u=this.series.length,a=this.series.length,f=this.options.colors,l=[],c=0,h,p,d,v;for(p=a-1;p>-1;--p)h=this.series[p].color,h&&(--a,n.isNumber(h)?s.push(h):l.push(r.Color.parse(h)));for(p=s.length-1;p>-1;--p)a=Math.max(a,s[p]+1);for(p=0;o.length<a;){h=f.length==p?new r.Color(100,100,100):r.Color.parse(f[p]);var m=c%2==1?-1:1,g=1+m*Math.ceil(c/2)*.2;h.scale(g,g,g),o.push(h),++p>=f.length&&(p=0,++c)}for(p=0,d=0;p<u;++p){v=this.series[p],v.color?n.isNumber(v.color)&&(v.color=o[v.color].toString()):v.color=o[d++].toString(),v.xaxis||(v.xaxis=this.axes.x),v.xaxis==1?v.xaxis=this.axes.x:v.xaxis==2&&(v.xaxis=this.axes.x2),v.yaxis||(v.yaxis=this.axes.y),v.yaxis==1?v.yaxis=this.axes.y:v.yaxis==2&&(v.yaxis=this.axes.y2);for(var y in r.graphTypes)v[y]=n.extend(n.clone(this.options[y]),v[y]);v.mouse=n.extend(n.clone(this.options.mouse),v.mouse),n.isUndefined(v.shadowSize)&&(v.shadowSize=this.options.shadowSize)}},_setEl:function(e){if(!e)throw"The target container doesn't exist";if(e.graph instanceof Graph)e.graph.destroy();else if(!e.clientWidth)throw"The target container must be visible";e.graph=this,this.el=e}},Flotr.Graph=Graph}(),function(){function n(t){this.orientation=1,this.offset=0,this.datamin=Number.MAX_VALUE,this.datamax=-Number.MAX_VALUE,e.extend(this,t)}function r(e,t){return e=Math.log(Math.max(e,Number.MIN_VALUE)),t!==Math.E&&(e/=Math.log(t)),e}function s(e,t){return t===Math.E?Math.exp(e):Math.pow(t,e)}var e=Flotr._,t="logarithmic";n.prototype={setScale:function(){var e=this.length,n=this.max,i=this.min,o=this.offset,u=this.orientation,a=this.options,f=a.scaling===t,l;f?l=e/(r(n,a.base)-r(i,a.base)):l=e/(n-i),this.scale=l,f?(this.d2p=function(e){return o+u*(r(e,a.base)-r(i,a.base))*l},this.p2d=function(e){return s((o+u*e)/l+r(i,a.base),a.base)}):(this.d2p=function(e){return o+u*(e-i)*l},this.p2d=function(e){return(o+u*e)/l+i})},calculateTicks:function(){var t=this.options;this.ticks=[],this.minorTicks=[],t.ticks?(this._cleanUserTicks(t.ticks,this.ticks),this._cleanUserTicks(t.minorTicks||[],this.minorTicks)):t.mode=="time"?this._calculateTimeTicks():t.scaling==="logarithmic"?this._calculateLogTicks():this._calculateTicks(),e.each(this.ticks,function(e){e.label+=""}),e.each(this.minorTicks,function(e){e.label+=""})},calculateRange:function(){if(!this.used)return;var e=this,t=e.options,n=t.min!==null?t.min:e.datamin,r=t.max!==null?t.max:e.datamax,i=t.autoscaleMargin;t.scaling=="logarithmic"&&(n<=0&&(n=e.datamin),r<=0&&(r=n));if(r==n){var s=r?.01:1;t.min===null&&(n-=s),t.max===null&&(r+=s)}if(t.scaling==="logarithmic"){n<0&&(n=r/t.base);var o=Math.log(r);t.base!=Math.E&&(o/=Math.log(t.base)),o=Math.ceil(o);var u=Math.log(n);t.base!=Math.E&&(u/=Math.log(t.base)),u=Math.ceil(u),e.tickSize=Flotr.getTickSize(t.noTicks,u,o,t.tickDecimals===null?0:t.tickDecimals),t.minorTickFreq===null&&(o-u>10?t.minorTickFreq=0:o-u>5?t.minorTickFreq=2:t.minorTickFreq=5)}else e.tickSize=Flotr.getTickSize(t.noTicks,n,r,t.tickDecimals);e.min=n,e.max=r,t.min===null&&t.autoscale&&(e.min-=e.tickSize*i,e.min<0&&e.datamin>=0&&(e.min=0),e.min=e.tickSize*Math.floor(e.min/e.tickSize)),t.max===null&&t.autoscale&&(e.max+=e.tickSize*i,e.max>0&&e.datamax<=0&&e.datamax!=e.datamin&&(e.max=0),e.max=e.tickSize*Math.ceil(e.max/e.tickSize)),e.min==e.max&&(e.max=e.min+1)},calculateTextDimensions:function(e,t){var n="",r,i;if(this.options.showLabels)for(i=0;i<this.ticks.length;++i)r=this.ticks[i].label.length,r>n.length&&(n=this.ticks[i].label);this.maxLabel=e.dimensions(n,{size:t.fontSize,angle:Flotr.toRad(this.options.labelsAngle)},"font-size:smaller;","flotr-grid-label"),this.titleSize=e.dimensions(this.options.title,{size:t.fontSize*1.2,angle:Flotr.toRad(this.options.titleAngle)},"font-weight:bold;","flotr-axis-title")},_cleanUserTicks:function(t,n){var r=this,i=this.options,s,o,u,a;e.isFunction(t)&&(t=t({min:r.min,max:r.max}));for(o=0;o<t.length;++o)a=t[o],typeof a=="object"?(s=a[0],u=a.length>1?a[1]:i.tickFormatter(s,{min:r.min,max:r.max})):(s=a,u=i.tickFormatter(s,{min:this.min,max:this.max})),n[o]={v:s,label:u}},_calculateTimeTicks:function(){this.ticks=Flotr.Date.generator(this)},_calculateLogTicks:function(){var e=this,t=e.options,n,r,s=Math.log(e.max);t.base!=Math.E&&(s/=Math.log(t.base)),s=Math.ceil(s);var o=Math.log(e.min);t.base!=Math.E&&(o/=Math.log(t.base)),o=Math.ceil(o);for(i=o;i<s;i+=e.tickSize){r=t.base==Math.E?Math.exp(i):Math.pow(t.base,i);var u=r*(t.base==Math.E?Math.exp(e.tickSize):Math.pow(t.base,e.tickSize)),a=(u-r)/t.minorTickFreq;e.ticks.push({v:r,label:t.tickFormatter(r,{min:e.min,max:e.max})});for(n=r+a;n<u;n+=a)e.minorTicks.push({v:n,label:t.tickFormatter(n,{min:e.min,max:e.max})})}r=t.base==Math.E?Math.exp(i):Math.pow(t.base,i),e.ticks.push({v:r,label:t.tickFormatter(r,{min:e.min,max:e.max})})},_calculateTicks:function(){var e=this,t=e.options,n=e.tickSize,r=e.min,i=e.max,s=n*Math.ceil(r/n),o,u,a,f,l,c;t.minorTickFreq&&(u=n/t.minorTickFreq);for(l=0;(a=f=s+l*n)<=i;++l){o=t.tickDecimals,o===null&&(o=1-Math.floor(Math.log(n)/Math.LN10)),o<0&&(o=0),a=a.toFixed(o),e.ticks.push({v:a,label:t.tickFormatter(a,{min:e.min,max:e.max})});if(t.minorTickFreq)for(c=0;c<t.minorTickFreq&&l*n+c*u<i;++c)a=f+c*u,e.minorTicks.push({v:a,label:t.tickFormatter(a,{min:e.min,max:e.max})})}}},e.extend(n,{getAxes:function(e){return{x:new n({options:e.xaxis,n:1,length:this.plotWidth}),x2:new n({options:e.x2axis,n:2,length:this.plotWidth}),y:new n({options:e.yaxis,n:1,length:this.plotHeight,offset:this.plotHeight,orientation:-1}),y2:new n({options:e.y2axis,n:2,length:this.plotHeight,offset:this.plotHeight,orientation:-1})}}}),Flotr.Axis=n}(),function(){function t(t){e.extend(this,t)}var e=Flotr._;t.prototype={getRange:function(){var e=this.data,t=e.length,n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=-Number.MAX_VALUE,s=-Number.MAX_VALUE,o=!1,u=!1,a,f,l;if(t<0||this.hide)return!1;for(l=0;l<t;l++)a=e[l][0],f=e[l][1],a!==null&&(a<n&&(n=a,o=!0),a>i&&(i=a,o=!0)),f!==null&&(f<r&&(r=f,u=!0),f>s&&(s=f,u=!0));return{xmin:n,xmax:i,ymin:r,ymax:s,xused:o,yused:u}}},e.extend(t,{getSeries:function(n){return e.map(n,function(n){var r;return n.data?(r=new t,e.extend(r,n)):r=new t({data:n}),r})}}),Flotr.Series=t}(),function(){var e=Flotr,t=e.DOM,n=e._,r=function(e){this.o=e};r.prototype={dimensions:function(e,t,n,r){return e?this.o.html?this.html(e,this.o.element,n,r):this.canvas(e,t):{width:0,height:0}},canvas:function(t,n){if(!this.o.textEnabled)return;n=n||{};var r=this.measureText(t,n),i=r.width,s=n.size||e.defaultOptions.fontSize,o=n.angle||0,u=Math.cos(o),a=Math.sin(o),f=2,l=6,c;return c={width:Math.abs(u*i)+Math.abs(a*s)+f,height:Math.abs(a*i)+Math.abs(u*s)+l},c},html:function(e,n,r,i){var s=t.create("div");return t.setStyles(s,{position:"absolute",top:"-100000px"}),t.insert(s,'<div style="'+r+'" class="'+i+' flotr-dummy-div">'+e+"</div>"),t.insert(this.o.element,s),t.size(s)},measureText:function(t,r){var i=this.o.ctx,s;return!i.fillText||e.isIphone&&i.measure?{width:i.measure(t,r)}:(r=n.extend({size:e.defaultOptions.fontSize,weight:1,angle:0},r),i.save(),i.font=(r.weight>1?"bold ":"")+r.size*1.3+"px sans-serif",s=i.measureText(t),i.restore(),s)}},Flotr.Text=r}(),
Flotr.addType("lines",{options:{show:!1,lineWidth:2,fill:!1,fillBorder:!1,fillColor:null,fillOpacity:.4,steps:!1,stacked:!1},stack:{values:[]},draw:function(e){var t=e.context,n=e.lineWidth,r=e.shadowSize,i;t.save(),t.lineJoin="round",r&&!1&&(t.lineWidth=r/2,i=n/2+t.lineWidth/2,t.strokeStyle="rgba(0,0,0,0.1)",this.plot(e,i+r/2,!1),t.strokeStyle="rgba(0,0,0,0.2)",this.plot(e,i,!1)),t.lineWidth=n,t.strokeStyle=e.color,this.plot(e,0,!0),t.restore()},plot:function(e,t,n){function T(t){var n=null;for(n=l-1;n>=0;--n){if(!e.fill)return;if(!t[n])return;t[n][1]===null&&(t[n][1]=0),x=o(t[n][0]),y=u(t[n][1]),y<0&&(y=0);if(y>s||x>i||y<0||x<0)return;r.lineTo(x,y),r.stroke()}}function N(e){var t=[],n=a[0][0];for(S=0;S<e.length;++S)t.push([S+n,e[S]]);return t}function C(){if(!t&&e.fill&&d){e.fillBorder&&r.stroke(),v=o(d[0]),r.fillStyle=e.fillStyle;if(!f||f.values.length===0)r.lineTo(m,p),r.lineTo(v,p),r.lineTo(v,u(d[1]));else{var n=N(f.values);stack_x1=o(n[0][0]),stack_y2=u(n[n.length-1][1]),r.lineTo(m,stack_y2),T(n),r.lineTo(stack_x1,u(a[0][1]))}r.fill()}}var r=e.context,i=e.width,s=e.height,o=e.xScale,u=e.yScale,a=e.data,f=e.stacked?this.stack:!1,l=a.length-1,c=null,h=null,p=u(0),d=null,v,m,g,b,w,E,S;if(l<1)return;r.beginPath();for(S=0;S<l;++S){if(a[S][1]===null||a[S+1][1]===null){e.fill&&S>0&&a[S][1]&&(r.stroke(),C(),d=null,r.closePath(),r.beginPath());continue}v=o(a[S][0]),m=o(a[S+1][0]),d===null&&(d=a[S]),f?(w=f.values[S]||0,E=f.values[S+1]||0,g=u(a[S][1]+w),b=u(a[S+1][1]+E)):(g=u(a[S][1]),b=u(a[S+1][1]));if(g>s&&b>s||g<0&&b<0||v<0&&m<0||v>i&&m>i)continue;(c!=v||h!=g+t)&&r.moveTo(v,g+t),c=m,h=b+t,e.steps?(r.lineTo(c+t/2,g+t),r.lineTo(c+t/2,h)):r.lineTo(c,h)}(!e.fill||e.fill&&!e.fillBorder)&&r.stroke(),C();if(f)for(S=0;S<l;++S)w=f.values[S]||0,E=f.values[S+1]||0,n&&(f.values[S]=a[S][1]+w,S==l-1&&(f.values[S+1]=a[S+1][1]+E))},extendYRange:function(e,t,n,r){var i=e.options;if(n.stacked&&(!i.max&&i.max!==0||!i.min&&i.min!==0)){var s=e.max,o=e.min,u=r.positiveSums||{},a=r.negativeSums||{},f,l;for(l=0;l<t.length;l++)f=t[l][0]+"",t[l][1]>0?(u[f]=(u[f]||0)+t[l][1],s=Math.max(s,u[f])):(a[f]=(a[f]||0)+t[l][1],o=Math.min(o,a[f]));r.negativeSums=a,r.positiveSums=u,e.max=s,e.min=o}n.steps&&(this.hit=function(e){var t=e.data,n=e.args,r=e.yScale,i=n[0],s=t.length,o=n[1],u=e.xInverse(i.relX),a=i.relY,f;for(f=0;f<s-1;f++)if(u>=t[f][0]&&u<=t[f+1][0]){Math.abs(r(t[f][1])-a)<8&&(o.x=t[f][0],o.y=t[f][1],o.index=f,o.seriesIndex=e.index);break}},this.drawHit=function(e){var t=e.context,n=e.args,r=e.data,i=e.xScale,s=n.index,o=i(n.x),u=e.yScale(n.y),a;r.length-1>s&&(a=e.xScale(r[s+1][0]),t.save(),t.strokeStyle=e.color,t.lineWidth=e.lineWidth,t.beginPath(),t.moveTo(o,u),t.lineTo(a,u),t.stroke(),t.closePath(),t.restore())},this.clearHit=function(e){var t=e.context,n=e.args,r=e.data,i=e.xScale,s=e.lineWidth,o=n.index,u=i(n.x),a=e.yScale(n.y),f;r.length-1>o&&(f=e.xScale(r[o+1][0]),t.clearRect(u-s,a-s,f-u+2*s,2*s))})}}),Flotr.addType("bars",{options:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,fillOpacity:.4,horizontal:!1,stacked:!1,centered:!0,topPadding:.1,grouped:!1},stack:{positive:[],negative:[],_positive:[],_negative:[]},draw:function(e){var t=e.context;this.current+=1,t.save(),t.lineJoin="miter",t.lineWidth=e.lineWidth,t.strokeStyle=e.color,e.fill&&(t.fillStyle=e.fillStyle),this.plot(e),t.restore()},plot:function(e){var t=e.data,n=e.context,r=e.shadowSize,i,s,o,u,a,f;if(t.length<1)return;this.translate(n,e.horizontal);for(i=0;i<t.length;i++){s=this.getBarGeometry(t[i][0],t[i][1],e);if(s===null)continue;o=s.left,u=s.top,a=s.width,f=s.height,e.fill&&n.fillRect(o,u,a,f),r&&(n.save(),n.fillStyle="rgba(0,0,0,0.05)",n.fillRect(o+r,u+r,a,f),n.restore()),e.lineWidth&&n.strokeRect(o,u,a,f)}},translate:function(e,t){t&&(e.rotate(-Math.PI/2),e.scale(-1,1))},getBarGeometry:function(e,t,n){var r=n.horizontal,i=n.barWidth,s=n.centered,o=n.stacked?this.stack:!1,u=n.lineWidth,a=s?i/2:0,f=r?n.yScale:n.xScale,l=r?n.xScale:n.yScale,c=r?t:e,h=r?e:t,p=0,d,v,m,g,y;return n.grouped&&(this.current/this.groups,c-=a,i/=this.groups,a=i/2,c=c+i*this.current-a),o&&(d=h>0?o.positive:o.negative,p=d[c]||p,d[c]=p+h),v=f(c-a),m=f(c+i-a),g=l(h+p),y=l(p),y<0&&(y=0),e===null||t===null?null:{x:c,y:h,xScale:f,yScale:l,top:g,left:Math.min(v,m)-u/2,width:Math.abs(m-v)-u,height:y-g}},hit:function(e){var t=e.data,n=e.args,r=n[0],i=n[1],s=e.xInverse(r.relX),o=e.yInverse(r.relY),u=this.getBarGeometry(s,o,e),a=u.width/2,f=u.left,l=u.y,c,h;for(h=t.length;h--;)c=this.getBarGeometry(t[h][0],t[h][1],e),(l>0&&l<c.y||l<0&&l>c.y)&&Math.abs(f-c.left)<a&&(i.x=t[h][0],i.y=t[h][1],i.index=h,i.seriesIndex=e.index)},drawHit:function(e){var t=e.context,n=e.args,r=this.getBarGeometry(n.x,n.y,e),i=r.left,s=r.top,o=r.width,u=r.height;t.save(),t.strokeStyle=e.color,t.lineWidth=e.lineWidth,this.translate(t,e.horizontal),t.beginPath(),t.moveTo(i,s+u),t.lineTo(i,s),t.lineTo(i+o,s),t.lineTo(i+o,s+u),e.fill&&(t.fillStyle=e.fillStyle,t.fill()),t.stroke(),t.closePath(),t.restore()},clearHit:function(e){var t=e.context,n=e.args,r=this.getBarGeometry(n.x,n.y,e),i=r.left,s=r.width,o=r.top,u=r.height,a=2*e.lineWidth;t.save(),this.translate(t,e.horizontal),t.clearRect(i-a,Math.min(o,o+u)-a,s+2*a,Math.abs(u)+2*a),t.restore()},extendXRange:function(e,t,n,r){this._extendRange(e,t,n,r),this.groups=this.groups+1||1,this.current=0},extendYRange:function(e,t,n,r){this._extendRange(e,t,n,r)},_extendRange:function(e,t,n,r){var i=e.options.max;if(_.isNumber(i)||_.isString(i))return;var s=e.min,o=e.max,u=n.horizontal,a=e.orientation,f=this.positiveSums||{},l=this.negativeSums||{},c,h,p,d;(a==1&&!u||a==-1&&u)&&n.centered&&(o=Math.max(e.datamax+n.barWidth,o),s=Math.min(e.datamin-n.barWidth,s));if(n.stacked&&(a==1&&u||a==-1&&!u))for(d=t.length;d--;)c=t[d][a==1?1:0]+"",h=t[d][a==1?0:1],h>0?(f[c]=(f[c]||0)+h,o=Math.max(o,f[c])):(l[c]=(l[c]||0)+h,s=Math.min(s,l[c]));(a==1&&u||a==-1&&!u)&&n.topPadding&&(e.max===e.datamax||n.stacked&&this.stackMax!==o)&&(o+=n.topPadding*(o-s)),this.stackMin=s,this.stackMax=o,this.negativeSums=l,this.positiveSums=f,e.max=o,e.min=s}}),Flotr.addType("bubbles",{options:{show:!1,lineWidth:2,fill:!0,fillOpacity:.4,baseRadius:2},draw:function(e){var t=e.context,n=e.shadowSize;t.save(),t.lineWidth=e.lineWidth,t.fillStyle="rgba(0,0,0,0.05)",t.strokeStyle="rgba(0,0,0,0.05)",this.plot(e,n/2),t.strokeStyle="rgba(0,0,0,0.1)",this.plot(e,n/4),t.strokeStyle=e.color,t.fillStyle=e.fillStyle,this.plot(e),t.restore()},plot:function(e,t){var n=e.data,r=e.context,i,s,o,u,a;t=t||0;for(s=0;s<n.length;++s)i=this.getGeometry(n[s],e),r.beginPath(),r.arc(i.x+t,i.y+t,i.z,0,2*Math.PI,!0),r.stroke(),e.fill&&r.fill(),r.closePath()},getGeometry:function(e,t){return{x:t.xScale(e[0]),y:t.yScale(e[1]),z:e[2]*t.baseRadius}},hit:function(e){var t=e.data,n=e.args,r=n[0],s=n[1],o=r.relX,u=r.relY,a,f,l,c;s.best=s.best||Number.MAX_VALUE;for(i=t.length;i--;)f=this.getGeometry(t[i],e),l=f.x-o,c=f.y-u,a=Math.sqrt(l*l+c*c),a<f.z&&f.z<s.best&&(s.x=t[i][0],s.y=t[i][1],s.index=i,s.seriesIndex=e.index,s.best=f.z)},drawHit:function(e){var t=e.context,n=this.getGeometry(e.data[e.args.index],e);t.save(),t.lineWidth=e.lineWidth,t.fillStyle=e.fillStyle,t.strokeStyle=e.color,t.beginPath(),t.arc(n.x,n.y,n.z,0,2*Math.PI,!0),t.fill(),t.stroke(),t.closePath(),t.restore()},clearHit:function(e){var t=e.context,n=this.getGeometry(e.data[e.args.index],e),r=n.z+e.lineWidth;t.save(),t.clearRect(n.x-r,n.y-r,2*r,2*r),t.restore()}}),function(){function e(e){return typeof e=="object"&&e.constructor&&(Image?!0:e.constructor===Image)}Flotr.defaultMarkerFormatter=function(e){return Math.round(e.y*100)/100+""},Flotr.addType("markers",{options:{show:!1,lineWidth:1,color:"#000000",fill:!1,fillColor:"#FFFFFF",fillOpacity:.4,stroke:!1,position:"ct",verticalMargin:0,labelFormatter:Flotr.defaultMarkerFormatter,fontSize:Flotr.defaultOptions.fontSize,stacked:!1,stackingType:"b",horizontal:!1},stack:{positive:[],negative:[],values:[]},draw:function(e){function h(e,t){return o=r.negative[e]||0,s=r.positive[e]||0,t>0?(r.positive[e]=o+t,o+t):(r.negative[e]=s+t,s+t)}var t=e.data,n=e.context,r=e.stacked?e.stack:!1,i=e.stackingType,s,o,u,a,f,l,c;n.save(),n.lineJoin="round",n.lineWidth=e.lineWidth,n.strokeStyle="rgba(0,0,0,0.5)",n.fillStyle=e.fillStyle;for(a=0;a<t.length;++a)f=t[a][0],l=t[a][1],r&&(i=="b"?e.horizontal?l=h(l,f):f=h(f,l):i=="a"&&(u=r.values[f]||0,r.values[f]=u+l,l=u+l)),c=e.labelFormatter({x:f,y:l,index:a,data:t}),this.plot(e.xScale(f),e.yScale(l),c,e);n.restore()},plot:function(t,n,r,i){var s=i.context;if(e(r)&&!r.complete)throw"Marker image not loaded.";this._plot(t,n,r,i)},_plot:function(t,n,r,i){var s=i.context,o=2,u=t,a=n,f;e(r)?f={height:r.height,width:r.width}:f=i.text.canvas(r),f.width=Math.floor(f.width+o*2),f.height=Math.floor(f.height+o*2),i.position.indexOf("c")!=-1?u-=f.width/2+o:i.position.indexOf("l")!=-1&&(u-=f.width),i.position.indexOf("m")!=-1?a-=f.height/2+o:i.position.indexOf("t")!=-1?a-=f.height+i.verticalMargin:a+=i.verticalMargin,u=Math.floor(u)+.5,a=Math.floor(a)+.5,i.fill&&s.fillRect(u,a,f.width,f.height),i.stroke&&s.strokeRect(u,a,f.width,f.height),e(r)?s.drawImage(r,parseInt(u+o,10),parseInt(a+o,10)):Flotr.drawText(s,r,u+o,a+o,{textBaseline:"top",textAlign:"left",size:i.fontSize,color:i.color})}})}(),function(){var e=Flotr._;Flotr.defaultPieLabelFormatter=function(e,t){return(100*t/e).toFixed(2)+"%"},Flotr.addType("pie",{options:{show:!1,lineWidth:1,fill:!0,fillColor:null,fillOpacity:.6,explode:6,sizeRatio:.6,startAngle:Math.PI/4,labelFormatter:Flotr.defaultPieLabelFormatter,pie3D:!1,pie3DviewAngle:Math.PI/2*.8,pie3DspliceThickness:20,epsilon:.1},draw:function(e){var t=e.data,n=e.context,r=n.canvas,i=e.lineWidth,s=e.shadowSize,o=e.sizeRatio,u=e.height,a=e.width,f=e.explode,l=e.color,c=e.fill,h=e.fillStyle,p=Math.min(r.width,r.height)*o/2,d=t[0][1],v=[],m=1,g=Math.PI*2*d/this.total,y=this.startAngle||2*Math.PI*e.startAngle,b=y+g,w=y+g/2,E=e.labelFormatter(this.total,d),S=f+p+4,x=Math.cos(w)*S,T=Math.sin(w)*S,N=x<0?"right":"left",C=T>0?"top":"bottom",k,L,A;n.save(),n.translate(a/2,u/2),n.scale(1,m),L=Math.cos(w)*f,A=Math.sin(w)*f,s>0&&(this.plotSlice(L+s,A+s,p,y,b,n),c&&(n.fillStyle="rgba(0,0,0,0.1)",n.fill())),this.plotSlice(L,A,p,y,b,n),c&&(n.fillStyle=h,n.fill()),n.lineWidth=i,n.strokeStyle=l,n.stroke(),k={size:e.fontSize*1.2,color:e.fontColor,weight:1.5},E&&(e.htmlText||!e.textEnabled?(divStyle="position:absolute;"+C+":"+(u/2+(C==="top"?T:-T))+"px;",divStyle+=N+":"+(a/2+(N==="right"?-x:x))+"px;",v.push('<div style="',divStyle,'" class="flotr-grid-label">',E,"</div>")):(k.textAlign=N,k.textBaseline=C,Flotr.drawText(n,E,x,T,k)));if(e.htmlText||!e.textEnabled){var O=Flotr.DOM.node('<div style="color:'+e.fontColor+'" class="flotr-labels"></div>');Flotr.DOM.insert(O,v.join("")),Flotr.DOM.insert(e.element,O)}n.restore(),this.startAngle=b,this.slices=this.slices||[],this.slices.push({radius:Math.min(r.width,r.height)*o/2,x:L,y:A,explode:f,start:y,end:b})},plotSlice:function(e,t,n,r,i,s){s.beginPath(),s.moveTo(e,t),s.arc(e,t,n,r,i,!1),s.lineTo(e,t),s.closePath()},hit:function(e){var t=e.data[0],n=e.args,r=e.index,i=n[0],s=n[1],o=this.slices[r],u=i.relX-e.width/2,a=i.relY-e.height/2,f=Math.sqrt(u*u+a*a),l=Math.atan(a/u),c=Math.PI*2,h=o.explode||e.explode,p=o.start%c,d=o.end%c,v=e.epsilon;u<0?l+=Math.PI:u>0&&a<0&&(l+=c),f<o.radius+h&&f>h&&(l>p&&l<d||p>d&&(l<d||l>p)||p===d&&(o.start===o.end&&Math.abs(l-p)<v||o.start!==o.end&&Math.abs(l-p)>v))&&(s.x=t[0],s.y=t[1],s.sAngle=p,s.eAngle=d,s.index=0,s.seriesIndex=r,s.fraction=t[1]/this.total)},drawHit:function(e){var t=e.context,n=this.slices[e.args.seriesIndex];t.save(),t.translate(e.width/2,e.height/2),this.plotSlice(n.x,n.y,n.radius,n.start,n.end,t),t.stroke(),t.restore()},clearHit:function(e){var t=e.context,n=this.slices[e.args.seriesIndex],r=2*e.lineWidth,i=n.radius+r;t.save(),t.translate(e.width/2,e.height/2),t.clearRect(n.x-i,n.y-i,2*i+r,2*i+r),t.restore()},extendYRange:function(e,t){this.total=(this.total||0)+t[0][1]}})}(),Flotr.addType("points",{options:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#FFFFFF",fillOpacity:1,hitRadius:null},draw:function(e){var t=e.context,n=e.lineWidth,r=e.shadowSize;t.save(),r>0&&(t.lineWidth=r/2,t.strokeStyle="rgba(0,0,0,0.1)",this.plot(e,r/2+t.lineWidth/2),t.strokeStyle="rgba(0,0,0,0.2)",this.plot(e,t.lineWidth/2)),t.lineWidth=e.lineWidth,t.strokeStyle=e.color,e.fill&&(t.fillStyle=e.fillStyle),this.plot(e),t.restore()},plot:function(e,t){var n=e.data,r=e.context,i=e.xScale,s=e.yScale,o,u,a;for(o=n.length-1;o>-1;--o){a=n[o][1];if(a===null)continue;u=i(n[o][0]),a=s(a);if(u<0||u>e.width||a<0||a>e.height)continue;r.beginPath(),t?r.arc(u,a+t,e.radius,0,Math.PI,!1):(r.arc(u,a,e.radius,0,2*Math.PI,!0),e.fill&&r.fill()),r.stroke(),r.closePath()}}}),Flotr.addType("radar",{options:{show:!1,lineWidth:2,fill:!0,fillOpacity:.4,radiusRatio:.9,sensibility:2},draw:function(e){var t=e.context,n=e.shadowSize;t.save(),t.translate(e.width/2,e.height/2),t.lineWidth=e.lineWidth,t.fillStyle="rgba(0,0,0,0.05)",t.strokeStyle="rgba(0,0,0,0.05)",this.plot(e,n/2),t.strokeStyle="rgba(0,0,0,0.1)",this.plot(e,n/4),t.strokeStyle=e.color,t.fillStyle=e.fillStyle,this.plot(e),t.restore()},plot:function(e,t){var n=e.data,r=e.context,i=Math.min(e.height,e.width)*e.radiusRatio/2,s=2*Math.PI/n.length,o=-Math.PI/2,u,a;t=t||0,r.beginPath();for(u=0;u<n.length;++u)a=n[u][1]/this.max,r[u===0?"moveTo":"lineTo"](Math.cos(u*s+o)*i*a+t,Math.sin(u*s+o)*i*a+t);r.closePath(),e.fill&&r.fill(),r.stroke()},getGeometry:function(e,t){var n=Math.min(t.height,t.width)*t.radiusRatio/2,r=2*Math.PI/t.data.length,i=-Math.PI/2,s=e[1]/this.max;return{x:Math.cos(e[0]*r+i)*n*s+t.width/2,y:Math.sin(e[0]*r+i)*n*s+t.height/2}},hit:function(e){var t=e.args,n=t[0],r=t[1],i=n.relX,s=n.relY,o,u,a,f;for(var l=0;l<r.series.length;l++){var c=r.series[l],h=c.data;for(var p=h.length;p--;){u=this.getGeometry(h[p],e),a=u.x-i,f=u.y-s,o=Math.sqrt(a*a+f*f);if(o<e.sensibility*2)return r.x=h[p][0],r.y=h[p][1],r.index=p,r.seriesIndex=l,r}}},drawHit:function(e){var t=2*Math.PI/e.data.length,n=-Math.PI/2,r=Math.min(e.height,e.width)*e.radiusRatio/2,i=e.args.series,s=i.points.hitRadius||i.points.radius||i.mouse.radius,o=e.context;o.translate(e.width/2,e.height/2);var u=e.args.index,a=e.data[u][1]/this.max,f=Math.cos(u*t+n)*r*a,l=Math.sin(u*t+n)*r*a;o.beginPath(),o.arc(f,l,s,0,2*Math.PI,!0),o.closePath(),o.stroke()},clearHit:function(e){var t=2*Math.PI/e.data.length,n=-Math.PI/2,r=Math.min(e.height,e.width)*e.radiusRatio/2,i=e.context,s=e.args.series,o=s.points?s.points.lineWidth:1;offset=(s.points.hitRadius||s.points.radius||s.mouse.radius)+o,i.translate(e.width/2,e.height/2);var u=e.args.index,a=e.data[u][1]/this.max,f=Math.cos(u*t+n)*r*a,l=Math.sin(u*t+n)*r*a;i.clearRect(f-offset,l-offset,offset*2,offset*2)},extendYRange:function(e,t){this.max=Math.max(e.max,this.max||-Number.MAX_VALUE)}}),function(){function e(e,t){return e.which?e.which===1:e.button===0||e.button===1}function t(e,t){return Math.min(Math.max(0,e),t.plotWidth-1)}function n(e,t){return Math.min(Math.max(0,e),t.plotHeight)}var r=Flotr.DOM,i=Flotr.EventAdapter,s=Flotr._;Flotr.addPlugin("selection",{options:{pinchOnly:null,mode:null,color:"#B6D9FF",fps:20},callbacks:{"flotr:mouseup":function(e){var t=this.options.selection,n=this.selection,r=this.getEventPosition(e);if(!t||!t.mode)return;n.interval&&clearInterval(n.interval),this.multitouches?n.updateSelection():t.pinchOnly||n.setSelectionPos(n.selection.second,r),n.clearSelection(),n.selecting&&n.selectionIsSane()&&(n.drawSelection(),n.fireSelectEvent(),this.ignoreClick=!0)},"flotr:mousedown":function(t){var n=this.options.selection,r=this.selection,i=this.getEventPosition(t);if(!n||!n.mode)return;if(!n.mode||!e(t)&&s.isUndefined(t.touches))return;n.pinchOnly||r.setSelectionPos(r.selection.first,i),r.interval&&clearInterval(r.interval),this.lastMousePos.pageX=null,r.selecting=!1,r.interval=setInterval(s.bind(r.updateSelection,this),1e3/n.fps)},"flotr:destroy":function(e){clearInterval(this.selection.interval)}},getArea:function(){var e=this.selection.selection,t=this.axes,n=e.first,r=e.second,i,s,o,u;return i=t.x.p2d(e.first.x),s=t.x.p2d(e.second.x),o=t.y.p2d(e.first.y),u=t.y.p2d(e.second.y),{x1:Math.min(i,s),y1:Math.min(o,u),x2:Math.max(i,s),y2:Math.max(o,u),xfirst:i,xsecond:s,yfirst:o,ysecond:u}},selection:{first:{x:-1,y:-1},second:{x:-1,y:-1}},prevSelection:null,interval:null,fireSelectEvent:function(e){var t=this.selection.getArea();e=e||"select",t.selection=this.selection.selection,i.fire(this.el,"flotr:"+e,[t,this])},setSelection:function(e,r){var i=this.options,s=this.axes.x,o=this.axes.y,u=o.scale,a=s.scale,f=i.selection.mode.indexOf("x")!=-1,l=i.selection.mode.indexOf("y")!=-1,c=this.selection.selection;this.selection.clearSelection(),c.first.y=n(f&&!l?0:(o.max-e.y1)*u,this),c.second.y=n(f&&!l?this.plotHeight-1:(o.max-e.y2)*u,this),c.first.x=t(l&&!f?0:(e.x1-s.min)*a,this),c.second.x=t(l&&!f?this.plotWidth:(e.x2-s.min)*a,this),this.selection.drawSelection(),r||this.selection.fireSelectEvent()},setSelectionPos:function(e,r){var i=this.options.selection.mode,s=this.selection.selection;i.indexOf("x")==-1?e.x=e==s.first?0:this.plotWidth:e.x=t(r.relX,this),i.indexOf("y")==-1?e.y=e==s.first?0:this.plotHeight-1:e.y=n(r.relY,this)},drawSelection:function(){this.selection.fireSelectEvent("selecting");var e=this.selection.selection,t=this.octx,n=this.options,r=this.plotOffset,i=this.selection.prevSelection;if(i&&e.first.x==i.first.x&&e.first.y==i.first.y&&e.second.x==i.second.x&&e.second.y==i.second.y)return;t.save(),t.strokeStyle=this.processColor(n.selection.color,{opacity:.8}),t.lineWidth=1,t.lineJoin="miter",t.fillStyle=this.processColor(n.selection.color,{opacity:.4}),this.selection.prevSelection={first:{x:e.first.x,y:e.first.y},second:{x:e.second.x,y:e.second.y}};var s=Math.min(e.first.x,e.second.x),o=Math.min(e.first.y,e.second.y),u=Math.abs(e.second.x-e.first.x),a=Math.abs(e.second.y-e.first.y);t.fillRect(s+r.left+.5,o+r.top+.5,u,a),t.strokeRect(s+r.left+.5,o+r.top+.5,u,a),t.restore()},updateSelection:function(){if(!this.lastMousePos.pageX)return;this.selection.selecting=!0;if(this.multitouches)this.selection.setSelectionPos(this.selection.selection.first,this.getEventPosition(this.multitouches[0])),this.selection.setSelectionPos(this.selection.selection.second,this.getEventPosition(this.multitouches[1]));else{if(this.options.selection.pinchOnly)return;this.selection.setSelectionPos(this.selection.selection.second,this.lastMousePos)}this.selection.clearSelection(),this.selection.selectionIsSane()&&this.selection.drawSelection()},clearSelection:function(){if(!this.selection.prevSelection)return;var e=this.selection.prevSelection,t=1,n=this.plotOffset,r=Math.min(e.first.x,e.second.x),i=Math.min(e.first.y,e.second.y),s=Math.abs(e.second.x-e.first.x),o=Math.abs(e.second.y-e.first.y);this.octx.clearRect(r+n.left-t+.5,i+n.top-t,s+2*t+.5,o+2*t+.5),this.selection.prevSelection=null},selectionIsSane:function(){var e=this.selection.selection;return Math.abs(e.second.x-e.first.x)>=5||Math.abs(e.second.y-e.first.y)>=5}})}(),function(){var e=Flotr.DOM,t=Flotr._;Flotr.addPlugin("legend",{options:{show:!0,noColumns:1,labelFormatter:function(e){return e},labelBoxBorderColor:"#CCCCCC",labelBoxWidth:14,labelBoxHeight:10,labelBoxMargin:5,container:null,position:"nw",margin:5,backgroundColor:"#F0F0F0",backgroundOpacity:.85},callbacks:{"flotr:afterinit":function(){this.legend.insertLegend()},"flotr:destroy":function(){var t=this.legend.markup;t&&(this.legend.markup=null,e.remove(t))}},insertLegend:function(){if(!this.options.legend.show)return;var n=this.series,r=this.plotOffset,i=this.options,s=i.legend,o=[],u=!1,a=this.ctx,f=t.filter(n,function(e){return e.label&&!e.hide}).length,l=s.position,c=s.margin,h=s.backgroundOpacity,p,d,v;if(f){var m=s.labelBoxWidth,g=s.labelBoxHeight,y=s.labelBoxMargin,b=r.left+c,w=r.top+c,E=0,S={size:i.fontSize*1.1,color:i.grid.color};for(p=n.length-1;p>-1;--p){if(!n[p].label||n[p].hide)continue;d=s.labelFormatter(n[p].label),E=Math.max(E,this._text.measureText(d,S).width)}var x=Math.round(m+y*3+E),T=Math.round(f*(y+g)+y);!h&&h!==0&&(h=.1);if(!i.HtmlText&&this.textEnabled&&!s.container){l.charAt(0)=="s"&&(w=r.top+this.plotHeight-(c+T)),l.charAt(0)=="c"&&(w=r.top+this.plotHeight/2-(c+T/2)),l.charAt(1)=="e"&&(b=r.left+this.plotWidth-(c+x)),v=this.processColor(s.backgroundColor,{opacity:h}),a.fillStyle=v,a.fillRect(b,w,x,T),a.strokeStyle=s.labelBoxBorderColor,a.strokeRect(Flotr.toPixel(b),Flotr.toPixel(w),x,T);var N=b+y,C=w+y;for(p=0;p<n.length;p++){if(!n[p].label||n[p].hide)continue;d=s.labelFormatter(n[p].label),a.fillStyle=n[p].color,a.fillRect(N,C,m-1,g-1),a.strokeStyle=s.labelBoxBorderColor,a.lineWidth=1,a.strokeRect(Math.ceil(N)-1.5,Math.ceil(C)-1.5,m+2,g+2),Flotr.drawText(a,d,N+m+y,C+g,S),C+=g+y}}else{for(p=0;p<n.length;++p){if(!n[p].label||n[p].hide)continue;p%s.noColumns===0&&(o.push(u?"</tr><tr>":"<tr>"),u=!0);var k=n[p],L=s.labelBoxWidth,A=s.labelBoxHeight;d=s.labelFormatter(k.label),v="background-color:"+(k.bars&&k.bars.show&&k.bars.fillColor&&k.bars.fill?k.bars.fillColor:k.color)+";",o.push('<td class="flotr-legend-color-box">','<div style="border:1px solid ',s.labelBoxBorderColor,';padding:1px">','<div style="width:',L-1,"px;height:",A-1,"px;border:1px solid ",n[p].color,'">','<div style="width:',L,"px;height:",A,"px;",v,'"></div>',"</div>","</div>","</td>",'<td class="flotr-legend-label">',d,"</td>")}u&&o.push("</tr>");if(o.length>0){var O='<table style="font-size:smaller;color:'+i.grid.color+'">'+o.join("")+"</table>";if(s.container)O=e.node(O),this.legend.markup=O,e.insert(s.container,O);else{var M={position:"absolute",zIndex:"2",border:"1px solid "+s.labelBoxBorderColor};l.charAt(0)=="n"?(M.top=c+r.top+"px",M.bottom="auto"):l.charAt(0)=="c"?(M.top=c+(this.plotHeight-T)/2+"px",M.bottom="auto"):l.charAt(0)=="s"&&(M.bottom=c+r.bottom+"px",M.top="auto"),l.charAt(1)=="e"?(M.right=c+r.right+"px",M.left="auto"):l.charAt(1)=="w"&&(M.left=c+r.left+"px",M.right="auto");var P=e.create("div"),H;P.className="flotr-legend",e.setStyles(P,M),e.insert(P,O),e.insert(this.el,P);if(!h)return;var B=s.backgroundColor||i.grid.backgroundColor||"#ffffff";t.extend(M,e.size(P),{backgroundColor:B,zIndex:"",border:""}),M.width+="px",M.height+="px",P=e.create("div"),P.className="flotr-legend-bg",e.setStyles(P,M),e.opacity(P,h),e.insert(P," "),e.insert(this.el,P)}}}}}})}(),function(){var e=Flotr.DOM,t=Flotr._,n=Flotr,r="opacity:0.7;background-color:#000;color:#fff;position:absolute;padding:2px 8px;-moz-border-radius:4px;border-radius:4px;white-space:nowrap;";Flotr.addPlugin("hit",{callbacks:{"flotr:mousemove":function(e,t){this.hit.track(t)},"flotr:click":function(e){var n=this.hit.track(e);n&&!t.isUndefined(n.index)&&(e.hit=n)},"flotr:mouseout":function(e){e.relatedTarget!==this.mouseTrack&&this.hit.clearHit()},"flotr:destroy":function(){this.options.mouse.container&&e.remove(this.mouseTrack),this.mouseTrack=null}},track:function(e){if(this.options.mouse.track||t.any(this.series,function(e){return e.mouse&&e.mouse.track}))return this.hit.hit(e)},executeOnType:function(e,r,i){function u(e,u){t.each(t.keys(n.graphTypes),function(t){e[t]&&e[t].show&&this[t][r]&&(o=this.getOptions(e,t),o.fill=!!e.mouse.fillColor,o.fillStyle=this.processColor(e.mouse.fillColor||"#ffffff",{opacity:e.mouse.fillOpacity}),o.color=e.mouse.lineColor,o.context=this.octx,o.index=u,i&&(o.args=i),this[t][r].call(this[t],o),s=!0)},this)}var s=!1,o;return t.isArray(e)||(e=[e]),t.each(e,u,this),s},drawHit:function(e){var t=this.octx,n=e.series;if(n.mouse.lineColor){t.save(),t.lineWidth=n.points?n.points.lineWidth:1,t.strokeStyle=n.mouse.lineColor,t.fillStyle=this.processColor(n.mouse.fillColor||"#ffffff",{opacity:n.mouse.fillOpacity}),t.translate(this.plotOffset.left,this.plotOffset.top);if(!this.hit.executeOnType(n,"drawHit",e)){var r=e.xaxis,i=e.yaxis;t.beginPath(),t.arc(r.d2p(e.x),i.d2p(e.y),n.points.hitRadius||n.points.radius||n.mouse.radius,0,2*Math.PI,!0),t.fill(),t.stroke(),t.closePath()}t.restore(),this.clip(t)}this.prevHit=e},clearHit:function(){var t=this.prevHit,n=this.octx,r=this.plotOffset;n.save(),n.translate(r.left,r.top);if(t){if(!this.hit.executeOnType(t.series,"clearHit",this.prevHit)){var i=t.series,s=i.points?i.points.lineWidth:1;offset=(i.points.hitRadius||i.points.radius||i.mouse.radius)+s,n.clearRect(t.xaxis.d2p(t.x)-offset,t.yaxis.d2p(t.y)-offset,offset*2,offset*2)}e.hide(this.mouseTrack),this.prevHit=null}n.restore()},hit:function(e){var n=this.options,r=this.prevHit,i,s,o,u,a,f,l,c,h;if(this.series.length===0)return;h={relX:e.relX,relY:e.relY,absX:e.absX,absY:e.absY,series:this.series};if(n.mouse.trackY&&!n.mouse.trackAll&&this.hit.executeOnType(this.series,"hit",[e,h])&&!t.isUndefined(h.seriesIndex))a=this.series[h.seriesIndex],h.series=a,h.mouse=a.mouse,h.xaxis=a.xaxis,h.yaxis=a.yaxis;else{i=this.hit.closest(e);if(i){i=n.mouse.trackY?i.point:i.x,u=i.seriesIndex,a=this.series[u],l=a.xaxis,c=a.yaxis,s=2*a.mouse.sensibility;if(n.mouse.trackAll||i.distanceX<s/l.scale&&(!n.mouse.trackY||i.distanceY<s/c.scale))h.series=a,h.xaxis=a.xaxis,h.yaxis=a.yaxis,h.mouse=a.mouse,h.x=i.x,h.y=i.y,h.dist=i.distance,h.index=i.dataIndex,h.seriesIndex=u}}if(!r||r.index!==h.index||r.seriesIndex!==h.seriesIndex)this.hit.clearHit(),h.series&&h.mouse&&h.mouse.track&&(this.hit.drawMouseTrack(h),this.hit.drawHit(h),Flotr.EventAdapter.fire(this.el,"flotr:hit",[h,this]));return h},closest:function(e){function E(e){e.distance=h,e.distanceX=p,e.distanceY=d,e.seriesIndex=b,e.dataIndex=w,e.x=g,e.y=y,f=!0}var t=this.series,n=this.options,r=e.relX,i=e.relY,s=Number.MAX_VALUE,o=Number.MAX_VALUE,u={},a={},f=!1,l,c,h,p,d,v,m,g,y,b,w;for(b=0;b<t.length;b++){l=t[b],c=l.data,v=l.xaxis.p2d(r),m=l.yaxis.p2d(i);for(w=c.length;w--;){g=c[w][0],y=c[w][1];if(g===null||y===null)continue;if(g<l.xaxis.min||g>l.xaxis.max)continue;p=Math.abs(g-v),d=Math.abs(y-m),h=p*p+d*d,h<s&&(s=h,E(u)),p<o&&(o=p,E(a))}}return f?{point:u,x:a}:!1},drawMouseTrack:function(n){var i="",s=n.series,o=n.mouse.position,u=n.mouse.margin,a=n.x,f=n.y,l=r,c=this.mouseTrack,h=this.plotOffset,p=h.left,d=h.right,v=h.bottom,m=h.top,g=n.mouse.trackDecimals,y=this.options,b=y.mouse.container,w=0,E=0,S,x,T;c||(c=e.node('<div class="flotr-mouse-value" style="'+l+'"></div>'),this.mouseTrack=c,e.insert(b||this.el,c));if(!g||g<0)g=0;a&&a.toFixed&&(a=a.toFixed(g)),f&&f.toFixed&&(f=f.toFixed(g)),T=n.mouse.trackFormatter({x:a,y:f,series:n.series,index:n.index,nearest:n,fraction:n.fraction});if(t.isNull(T)||t.isUndefined(T)){e.hide(c);return}c.innerHTML=T,e.show(c);if(b)return;x=e.size(c),b&&(S=e.position(this.el),w=S.top,E=S.left);if(!n.mouse.relative)i+="top:",o.charAt(0)=="n"?i+=w+u+m:o.charAt(0)=="s"&&(i+=w-u+m+this.plotHeight-x.height),i+="px;bottom:auto;left:",o.charAt(1)=="e"?i+=E-u+p+this.plotWidth-x.width:o.charAt(1)=="w"&&(i+=E+u+p),i+="px;right:auto;";else if(s.pie&&s.pie.show){var N={x:this.plotWidth/2,y:this.plotHeight/2},C=Math.min(this.canvasWidth,this.canvasHeight)*s.pie.sizeRatio/2,k=n.sAngle<n.eAngle?(n.sAngle+n.eAngle)/2:(n.sAngle+n.eAngle+2*Math.PI)/2;i+="bottom:"+(u-m-N.y-Math.sin(k)*C/2+this.canvasHeight)+"px;top:auto;",i+="left:"+(u+p+N.x+Math.cos(k)*C/2)+"px;right:auto;"}else i+="top:",/n/.test(o)?i+=w-u+m+n.yaxis.d2p(n.y)-x.height:i+=w+u+m+n.yaxis.d2p(n.y),i+="px;bottom:auto;left:",/w/.test(o)?i+=E-u+p+n.xaxis.d2p(n.x)-x.width:i+=E+u+p+n.xaxis.d2p(n.x),i+="px;right:auto;";c.style.cssText=l+i,n.mouse.relative&&(/[ew]/.test(o)?/[ns]/.test(o)||(c.style.top=w+m+n.yaxis.d2p(n.y)-e.size(c).height/2+"px"):c.style.left=E+p+n.xaxis.d2p(n.x)-e.size(c).width/2+"px")}})}(),function(){var e=Flotr.DOM;Flotr.addPlugin("labels",{callbacks:{"flotr:afterdraw":function(){this.labels.draw()}},draw:function(){function b(e,t,r){var i=r?t.minorTicks:t.ticks,s=t.orientation===1,u=t.n===1,l,h;l={color:t.options.color||d.grid.color,angle:Flotr.toRad(t.options.labelsAngle),textBaseline:"middle"};for(c=0;c<i.length&&(r?t.options.showMinorLabels:t.options.showLabels);++c){n=i[c],n.label+="";if(!n.label||!n.label.length)continue;x=Math.cos(c*a+f)*o,y=Math.sin(c*a+f)*o,l.textAlign=s?Math.abs(x)<.1?"center":x<0?"right":"left":"left",Flotr.drawText(v,n.label,s?x:3,s?y:-(t.ticks[c].v/t.max)*(o-d.fontSize),l)}}function w(e,t,r,i){function f(e){return e.options.showLabels&&e.used}function l(e,t,n,r){return e.plotOffset.left+(t?r:n?-d.grid.labelMargin:d.grid.labelMargin+e.plotWidth)}function h(e,t,n,r){return e.plotOffset.top+(t?d.grid.labelMargin:r)+(t&&n?e.plotHeight:0)}var s=t.orientation===1,o=t.n===1,u,a;u={color:t.options.color||d.grid.color,textAlign:r,textBaseline:i,angle:Flotr.toRad(t.options.labelsAngle)},u=Flotr.getBestTextAlign(u.angle,u);for(c=0;c<t.ticks.length&&f(t);++c){n=t.ticks[c];if(!n.label||!n.label.length)continue;a=t.d2p(n.v);if(a<0||a>(s?e.plotWidth:e.plotHeight))continue;Flotr.drawText(v,n.label,l(e,s,o,a),h(e,s,o,a),u),!s&&!o&&(v.save(),v.strokeStyle=u.color,v.beginPath(),v.moveTo(e.plotOffset.left+e.plotWidth-8,e.plotOffset.top+t.d2p(n.v)),v.lineTo(e.plotOffset.left+e.plotWidth,e.plotOffset.top+t.d2p(n.v)),v.stroke(),v.restore())}}function E(e,t){var r=t.orientation===1,i=t.n===1,o="",u,a,f,l=e.plotOffset;!r&&!i&&(v.save(),v.strokeStyle=t.options.color||d.grid.color,v.beginPath());if(t.options.showLabels&&(i?!0:t.used))for(c=0;c<t.ticks.length;++c){n=t.ticks[c];if(!n.label||!n.label.length||(r?l.left:l.top)+t.d2p(n.v)<0||(r?l.left:l.top)+t.d2p(n.v)>(r?e.canvasWidth:e.canvasHeight))continue;f=l.top+(r?(i?1:-1)*(e.plotHeight+d.grid.labelMargin):t.d2p(n.v)-t.maxLabel.height/2),u=r?l.left+t.d2p(n.v)-s/2:0,o="",c===0?o=" first":c===t.ticks.length-1&&(o=" last"),o+=r?" flotr-grid-label-x":" flotr-grid-label-y",h+=['<div style="position:absolute; text-align:'+(r?"center":"right")+"; ","top:"+f+"px; ",(!r&&!i?"right:":"left:")+u+"px; ","width:"+(r?s:(i?l.left:l.right)-d.grid.labelMargin)+"px; ",t.options.color?"color:"+t.options.color+"; ":" ",'" class="flotr-grid-label'+o+'">'+n.label+"</div>"].join(" "),!r&&!i&&(v.moveTo(l.left+e.plotWidth-8,l.top+t.d2p(n.v)),v.lineTo(l.left+e.plotWidth,l.top+t.d2p(n.v)))}}var t,n,r,i,s,o,u,a,f,l,c,h="",p=0,d=this.options,v=this.ctx,m=this.axes,g={size:d.fontSize};for(c=0;c<m.x.ticks.length;++c)m.x.ticks[c].label&&++p;s=this.plotWidth/p,d.grid.circular&&(v.save(),v.translate(this.plotOffset.left+this.plotWidth/2,this.plotOffset.top+this.plotHeight/2),o=this.plotHeight*d.radar.radiusRatio/2+d.fontSize,u=this.axes.x.ticks.length,a=2*(Math.PI/u),f=-Math.PI/2,b(this,m.x,!1),b(this,m.x,!0),b(this,m.y,!1),b(this,m.y,!0),v.restore()),!d.HtmlText&&this.textEnabled?(w(this,m.x,"center","top"),w(this,m.x2,"center","bottom"),w(this,m.y,"right","middle"),w(this,m.y2,"left","middle")):(m.x.options.showLabels||m.x2.options.showLabels||m.y.options.showLabels||m.y2.options.showLabels)&&!d.grid.circular&&(h="",E(this,m.x),E(this,m.x2),E(this,m.y),E(this,m.y2),v.stroke(),v.restore(),l=e.create("div"),e.setStyles(l,{fontSize:"smaller",color:d.grid.color}),l.className="flotr-labels",e.insert(this.el,l),e.insert(l,h))}})}(),function(){var e=Flotr.DOM,t=Flotr._;Flotr.addPlugin("legend",{options:{show:!0,noColumns:1,labelFormatter:function(e){return e},labelBoxBorderColor:"#CCCCCC",labelBoxWidth:14,labelBoxHeight:10,labelBoxMargin:5,container:null,position:"nw",margin:5,backgroundColor:"#F0F0F0",backgroundOpacity:.85},callbacks:{"flotr:afterinit":function(){this.legend.insertLegend()},"flotr:destroy":function(){var t=this.legend.markup;t&&(this.legend.markup=null,e.remove(t))}},insertLegend:function(){if(!this.options.legend.show)return;var n=this.series,r=this.plotOffset,i=this.options,s=i.legend,o=[],u=!1,a=this.ctx,f=t.filter(n,function(e){return e.label&&!e.hide}).length,l=s.position,c=s.margin,h=s.backgroundOpacity,p,d,v;if(f){var m=s.labelBoxWidth,g=s.labelBoxHeight,y=s.labelBoxMargin,b=r.left+c,w=r.top+c,E=0,S={size:i.fontSize*1.1,color:i.grid.color};for(p=n.length-1;p>-1;--p){if(!n[p].label||n[p].hide)continue;d=s.labelFormatter(n[p].label),E=Math.max(E,this._text.measureText(d,S).width)}var x=Math.round(m+y*3+E),T=Math.round(f*(y+g)+y);!h&&h!==0&&(h=.1);if(!i.HtmlText&&this.textEnabled&&!s.container){l.charAt(0)=="s"&&(w=r.top+this.plotHeight-(c+T)),l.charAt(0)=="c"&&(w=r.top+this.plotHeight/2-(c+T/2)),l.charAt(1)=="e"&&(b=r.left+this.plotWidth-(c+x)),v=this.processColor(s.backgroundColor,{opacity:h}),a.fillStyle=v,a.fillRect(b,w,x,T),a.strokeStyle=s.labelBoxBorderColor,a.strokeRect(Flotr.toPixel(b),Flotr.toPixel(w),x,T);var N=b+y,C=w+y;for(p=0;p<n.length;p++){if(!n[p].label||n[p].hide)continue;d=s.labelFormatter(n[p].label),a.fillStyle=n[p].color,a.fillRect(N,C,m-1,g-1),a.strokeStyle=s.labelBoxBorderColor,a.lineWidth=1,a.strokeRect(Math.ceil(N)-1.5,Math.ceil(C)-1.5,m+2,g+2),Flotr.drawText(a,d,N+m+y,C+g,S),C+=g+y}}else{for(
p=0;p<n.length;++p){if(!n[p].label||n[p].hide)continue;p%s.noColumns===0&&(o.push(u?"</tr><tr>":"<tr>"),u=!0);var k=n[p],L=s.labelBoxWidth,A=s.labelBoxHeight;d=s.labelFormatter(k.label),v="background-color:"+(k.bars&&k.bars.show&&k.bars.fillColor&&k.bars.fill?k.bars.fillColor:k.color)+";",o.push('<td class="flotr-legend-color-box">','<div style="border:1px solid ',s.labelBoxBorderColor,';padding:1px">','<div style="width:',L-1,"px;height:",A-1,"px;border:1px solid ",n[p].color,'">','<div style="width:',L,"px;height:",A,"px;",v,'"></div>',"</div>","</div>","</td>",'<td class="flotr-legend-label">',d,"</td>")}u&&o.push("</tr>");if(o.length>0){var O='<table style="font-size:smaller;color:'+i.grid.color+'">'+o.join("")+"</table>";if(s.container)O=e.node(O),this.legend.markup=O,e.insert(s.container,O);else{var M={position:"absolute",zIndex:"2",border:"1px solid "+s.labelBoxBorderColor};l.charAt(0)=="n"?(M.top=c+r.top+"px",M.bottom="auto"):l.charAt(0)=="c"?(M.top=c+(this.plotHeight-T)/2+"px",M.bottom="auto"):l.charAt(0)=="s"&&(M.bottom=c+r.bottom+"px",M.top="auto"),l.charAt(1)=="e"?(M.right=c+r.right+"px",M.left="auto"):l.charAt(1)=="w"&&(M.left=c+r.left+"px",M.right="auto");var P=e.create("div"),H;P.className="flotr-legend",e.setStyles(P,M),e.insert(P,O),e.insert(this.el,P);if(!h)return;var B=s.backgroundColor||i.grid.backgroundColor||"#ffffff";t.extend(M,e.size(P),{backgroundColor:B,zIndex:"",border:""}),M.width+="px",M.height+="px",P=e.create("div"),P.className="flotr-legend-bg",e.setStyles(P,M),e.opacity(P,h),e.insert(P," "),e.insert(this.el,P)}}}}}})}(),function(){var e=Flotr.DOM;Flotr.addPlugin("titles",{callbacks:{"flotr:afterdraw":function(){this.titles.drawTitles()}},drawTitles:function(){var t,n=this.options,r=n.grid.labelMargin,i=this.ctx,s=this.axes;if(!n.HtmlText&&this.textEnabled){var o={size:n.fontSize,color:n.grid.color,textAlign:"center"};n.subtitle&&Flotr.drawText(i,n.subtitle,this.plotOffset.left+this.plotWidth/2,this.titleHeight+this.subtitleHeight-2,o),o.weight=1.5,o.size*=1.5,n.title&&Flotr.drawText(i,n.title,this.plotOffset.left+this.plotWidth/2,this.titleHeight-2,o),o.weight=1.8,o.size*=.8,s.x.options.title&&s.x.used&&(o.textAlign=s.x.options.titleAlign||"center",o.textBaseline="top",o.angle=Flotr.toRad(s.x.options.titleAngle),o=Flotr.getBestTextAlign(o.angle,o),Flotr.drawText(i,s.x.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top+s.x.maxLabel.height+this.plotHeight+2*r,o)),s.x2.options.title&&s.x2.used&&(o.textAlign=s.x2.options.titleAlign||"center",o.textBaseline="bottom",o.angle=Flotr.toRad(s.x2.options.titleAngle),o=Flotr.getBestTextAlign(o.angle,o),Flotr.drawText(i,s.x2.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top-s.x2.maxLabel.height-2*r,o)),s.y.options.title&&s.y.used&&(o.textAlign=s.y.options.titleAlign||"right",o.textBaseline="middle",o.angle=Flotr.toRad(s.y.options.titleAngle),o=Flotr.getBestTextAlign(o.angle,o),Flotr.drawText(i,s.y.options.title,this.plotOffset.left-s.y.maxLabel.width-2*r,this.plotOffset.top+this.plotHeight/2,o)),s.y2.options.title&&s.y2.used&&(o.textAlign=s.y2.options.titleAlign||"left",o.textBaseline="middle",o.angle=Flotr.toRad(s.y2.options.titleAngle),o=Flotr.getBestTextAlign(o.angle,o),Flotr.drawText(i,s.y2.options.title,this.plotOffset.left+this.plotWidth+s.y2.maxLabel.width+2*r,this.plotOffset.top+this.plotHeight/2,o))}else{t=[],n.title&&t.push('<div style="position:absolute;top:0;left:',this.plotOffset.left,"px;font-size:1em;font-weight:bold;text-align:center;width:",this.plotWidth,'px;" class="flotr-title">',n.title,"</div>"),n.subtitle&&t.push('<div style="position:absolute;top:',this.titleHeight,"px;left:",this.plotOffset.left,"px;font-size:smaller;text-align:center;width:",this.plotWidth,'px;" class="flotr-subtitle">',n.subtitle,"</div>"),t.push("</div>"),t.push('<div class="flotr-axis-title" style="font-weight:bold;">'),s.x.options.title&&s.x.used&&t.push('<div style="position:absolute;top:',this.plotOffset.top+this.plotHeight+n.grid.labelMargin+s.x.titleSize.height,"px;left:",this.plotOffset.left,"px;width:",this.plotWidth,"px;text-align:",s.x.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-x1">',s.x.options.title,"</div>"),s.x2.options.title&&s.x2.used&&t.push('<div style="position:absolute;top:0;left:',this.plotOffset.left,"px;width:",this.plotWidth,"px;text-align:",s.x2.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-x2">',s.x2.options.title,"</div>"),s.y.options.title&&s.y.used&&t.push('<div style="position:absolute;top:',this.plotOffset.top+this.plotHeight/2-s.y.titleSize.height/2,"px;left:0;text-align:",s.y.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-y1">',s.y.options.title,"</div>"),s.y2.options.title&&s.y2.used&&t.push('<div style="position:absolute;top:',this.plotOffset.top+this.plotHeight/2-s.y.titleSize.height/2,"px;right:0;text-align:",s.y2.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-y2">',s.y2.options.title,"</div>"),t=t.join("");var u=e.create("div");e.setStyles({color:n.grid.color}),u.className="flotr-titles",e.insert(this.el,u),e.insert(u,t)}}})}(),function(){function t(){var t=this.options,n=this.handles,r=this.el,i,s,o,u;if(!t.selection.mode||!t.handles.show||"ontouchstart"in r)return;n.initialized=!0,u=e.node('<div class="flotr-handles"></div>'),t=t.handles,t.drag&&(o=e.node('<div class="flotr-handles-handle flotr-handles-drag flotr-handles-right"></div>'),s=e.node('<div class="flotr-handles-handle flotr-handles-drag flotr-handles-left"></div>'),e.insert(u,o),e.insert(u,s),e.hide(s),e.hide(o),n.left=s,n.right=o,this.observe(s,"mousedown",function(){n.moveHandler=a}),this.observe(o,"mousedown",function(){n.moveHandler=f})),t.scroll&&(i=e.node('<div class="flotr-handles-handle flotr-handles-scroll"></div>'),e.insert(u,i),e.hide(i),n.scroll=i,this.observe(i,"mousedown",function(){n.moveHandler=l})),this.observe(document,"mouseup",function(){n.moveHandler=null}),e.insert(r,u)}function n(e){if(!this.handles.initialized)return;var t=this.handles,n=this.options.handles,s=t.left,o=t.right,u=t.scroll;n&&(n.drag&&(r(this,s,e.x1),r(this,o,e.x2)),n.scroll&&i(this,u,e.x1,e.x2))}function r(t,n,r){e.show(n);var i=e.size(n),s=Math.round(t.axes.x.d2p(r)-i.width/2),o=(t.plotHeight-i.height)/2;e.setStyles(n,{left:s+"px",top:o+"px"})}function i(t,n,r,i){e.show(n);var s=e.size(n),o=Math.round(t.axes.x.d2p(r)),u=t.plotHeight-s.height/2,a=t.axes.x.d2p(i)-t.axes.x.d2p(r);e.setStyles(n,{left:o+"px",top:u+"px",width:a+"px"})}function s(){if(!this.handles.initialized)return;var t=this.handles;t&&(e.hide(t.left),e.hide(t.right),e.hide(t.scroll))}function o(e,t){if(!this.handles.initialized)return;if(!this.handles.moveHandler)return;var n=t.x-this.lastMousePos.x,r=this.selection.selection,i=this.selection.getArea(),s=this.handles;s.moveHandler(i,n),u(i,s),this.selection.setSelection(i)}function u(e,t){var n=t.moveHandler;e.x1>e.x2&&(n==a?n=f:n==f&&(n=a),t.moveHandler=n)}function a(e,t){e.x1+=t}function f(e,t){e.x2+=t}function l(e,t){e.x1+=t,e.x2+=t}var e=Flotr.DOM;Flotr.addPlugin("handles",{options:{show:!1,drag:!0,scroll:!0},callbacks:{"flotr:afterinit":t,"flotr:select":n,"flotr:mousedown":s,"flotr:mousemove":o}})}(),function(){var e=Flotr.EventAdapter,t=Flotr._;Flotr.addPlugin("graphGrid",{callbacks:{"flotr:beforedraw":function(){this.graphGrid.drawGrid()},"flotr:afterdraw":function(){this.graphGrid.drawOutline()}},drawGrid:function(){function v(e){for(p=0;p<e.length;++p){var t=e[p].v/c.max;for(d=0;d<=w;++d)n[d===0?"moveTo":"lineTo"](Math.cos(d*S+x)*b*t,Math.sin(d*S+x)*b*t)}}function m(e,r){t.each(t.pluck(e,"v"),function(e){if(e<=c.min||e>=c.max||(e==c.min||e==c.max)&&i.outlineWidth)return;r(Math.floor(c.d2p(e))+n.lineWidth/2)})}function g(e){n.moveTo(e,0),n.lineTo(e,f)}function y(e){n.moveTo(0,e),n.lineTo(l,e)}var n=this.ctx,r=this.options,i=r.grid,s=i.verticalLines,o=i.horizontalLines,u=i.minorVerticalLines,a=i.minorHorizontalLines,f=this.plotHeight,l=this.plotWidth,c,h,p,d;(s||u||o||a)&&e.fire(this.el,"flotr:beforegrid",[this.axes.x,this.axes.y,r,this]),n.save(),n.lineWidth=1,n.strokeStyle=i.tickColor;if(i.circular){n.translate(this.plotOffset.left+l/2,this.plotOffset.top+f/2);var b=Math.min(f,l)*r.radar.radiusRatio/2,w=this.axes.x.ticks.length,S=2*(Math.PI/w),x=-Math.PI/2;n.beginPath(),c=this.axes.y,o&&v(c.ticks),a&&v(c.minorTicks),s&&t.times(w,function(e){n.moveTo(0,0),n.lineTo(Math.cos(e*S+x)*b,Math.sin(e*S+x)*b)}),n.stroke()}else n.translate(this.plotOffset.left,this.plotOffset.top),i.backgroundColor&&(n.fillStyle=this.processColor(i.backgroundColor,{x1:0,y1:0,x2:l,y2:f}),n.fillRect(0,0,l,f)),n.beginPath(),c=this.axes.x,s&&m(c.ticks,g),u&&m(c.minorTicks,g),c=this.axes.y,o&&m(c.ticks,y),a&&m(c.minorTicks,y),n.stroke();n.restore(),(s||u||o||a)&&e.fire(this.el,"flotr:aftergrid",[this.axes.x,this.axes.y,r,this])},drawOutline:function(){var e=this,t=e.options,n=t.grid,r=n.outline,s=e.ctx,o=n.backgroundImage,u=e.plotOffset,a=u.left,f=u.top,l=e.plotWidth,c=e.plotHeight,h,p,d,v,m,g;if(!n.outlineWidth)return;s.save();if(n.circular){s.translate(a+l/2,f+c/2);var y=Math.min(c,l)*t.radar.radiusRatio/2,b=this.axes.x.ticks.length,w=2*(Math.PI/b),E=-Math.PI/2;s.beginPath(),s.lineWidth=n.outlineWidth,s.strokeStyle=n.color,s.lineJoin="round";for(i=0;i<=b;++i)s[i===0?"moveTo":"lineTo"](Math.cos(i*w+E)*y,Math.sin(i*w+E)*y);s.stroke()}else{s.translate(a,f);var S=n.outlineWidth,x=.5-S+(S+1)%2/2,T="lineTo",N="moveTo";s.lineWidth=S,s.strokeStyle=n.color,s.lineJoin="miter",s.beginPath(),s.moveTo(x,x),l-=S/2%1,c+=S/2,s[r.indexOf("n")!==-1?T:N](l,x),s[r.indexOf("e")!==-1?T:N](l,c),s[r.indexOf("s")!==-1?T:N](x,c),s[r.indexOf("w")!==-1?T:N](x,x),s.stroke(),s.closePath()}s.restore(),o&&(d=o.src||o,v=(parseInt(o.left,10)||0)+u.left,m=(parseInt(o.top,10)||0)+u.top,p=new Image,p.onload=function(){s.save(),o.alpha&&(s.globalAlpha=o.alpha),s.globalCompositeOperation="destination-over",s.drawImage(p,0,0,p.width,p.height,v,m,l,c),s.restore()},p.src=d)}})}(),!function(e,t){typeof define=="function"?define(t):typeof module!="undefined"?module.exports=t():this[e]=t()}("bonzo",function(){function e(e){return new RegExp("(^|\\s+)"+e+"(\\s+|$)")}function t(e,t,n){for(var r=0,i=e.length;r<i;r++)t.call(n||e[r],e[r],r,e);return e}function n(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function r(e){return e&&e.nodeName&&e.nodeType==1}function i(e,t,n,r){for(r=0,j=e.length;r<j;++r)if(t.call(n,e[r],r,e))return!0;return!1}function s(e,n,r){var i=0,s=n||this,o=[],u=E&&typeof e=="string"&&e.charAt(0)!="<"?function(t){return(t=E(e))&&(t.selected=1)&&t}():e;return t(c(u),function(e){t(s,function(t){var n=!t[w]||t[w]&&!t[w][w]?function(){var e=t.cloneNode(!0);return s.$&&s.cloneEvents&&s.$(e).cloneEvents(t),e}():t;r(e,n),o[i]=n,i++})},this),t(o,function(e,t){s[t]=e}),s.length=i,s}function o(e,t,n){var r=v(e),i=r.css("position"),s=r.offset(),o="relative",u=i==o,a=[parseInt(r.css("left"),10),parseInt(r.css("top"),10)];i=="static"&&(r.css("position",o),i=o),isNaN(a[0])&&(a[0]=u?0:e.offsetLeft),isNaN(a[1])&&(a[1]=u?0:e.offsetTop),t!=null&&(e.style.left=t-s.left+a[0]+M),n!=null&&(e.style.top=n-s.top+a[1]+M)}function u(t,n){return e(n).test(t.className)}function a(e,t){e.className=F(e.className+" "+t)}function f(t,n){t.className=F(t.className.replace(e(n)," "))}function l(e){this.length=0;if(e){e=typeof e!="string"&&!e.nodeType&&typeof e.length!="undefined"?e:[e],this.length=e.length;for(var t=0;t<e.length;t++)this[t]=e[t]}}function c(e){return typeof e=="string"?v.create(e):r(e)?[e]:e}function h(e,t,n){var r=this[0];return e==null&&t==null?(p(r)?d():{x:r.scrollLeft,y:r.scrollTop})[n]:(p(r)?g.scrollTo(e,t):(e!=null&&(r.scrollLeft=e),t!=null&&(r.scrollTop=t)),this)}function p(e){return e===g||/^(?:body|html)$/i.test(e.tagName)}function d(){return{x:g.pageXOffset||b.scrollLeft,y:g.pageYOffset||b.scrollTop}}function v(e,t){return new l(e,t)}var m=this,g=window,y=g.document,b=y.documentElement,w="parentNode",E=null,S=/^checked|value|selected$/,x=/select|fieldset|table|tbody|tfoot|td|tr|colgroup/i,T="table",N={thead:T,tbody:T,tfoot:T,tr:"tbody",th:"tr",td:"tr",fieldset:"form",option:"select"},C=/^checked|selected$/,k=/msie/i.test(navigator.userAgent),L=[],A=0,O=/^-?[\d\.]+$/,M="px",_="setAttribute",D="getAttribute",P=/(^\s*|\s*$)/g,H={lineHeight:1,zoom:1,zIndex:1,opacity:1},B=function(){var e=["webkitTransform","MozTransform","OTransform","msTransform","Transform"],t;for(t=0;t<e.length;t++)if(e[t]in y.createElement("a").style)return e[t]}(),F=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(P,"")},I=y.defaultView&&y.defaultView.getComputedStyle?function(e,t){t=t=="transform"?B:t,t=t=="transform-origin"?B+"Origin":t;var r=null;t=="float"&&(t="cssFloat");var i=y.defaultView.getComputedStyle(e,"");return i&&(r=i[n(t)]),e.style[t]||r}:k&&b.currentStyle?function(e,t){t=n(t),t=t=="float"?"styleFloat":t;if(t=="opacity"){var r=100;try{r=e.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(i){try{r=e.filters("alpha").opacity}catch(s){}}return r/100}var o=e.currentStyle?e.currentStyle[t]:null;return e.style[t]||o}:function(e,t){return e.style[n(t)]};l.prototype={get:function(e){return this[e]},each:function(e,n){return t(this,e,n)},map:function(e,t){var n=[],r,i;for(i=0;i<this.length;i++)r=e.call(this,this[i],i),t?t(r)&&n.push(r):n.push(r);return n},first:function(){return v(this[0])},last:function(){return v(this[this.length-1])},html:function(e,n){function r(n){while(n.firstChild)n.removeChild(n.firstChild);t(c(e),function(e){n.appendChild(e)})}var i=n?b.textContent===null?"innerText":"textContent":"innerHTML",s;return typeof e!="undefined"?this.each(function(t){(s=t.tagName.match(x))?r(t,s[0]):t[i]=e}):this[0]?this[0][i]:""},text:function(e){return this.html(e,1)},addClass:function(e){return this.each(function(t){u(t,e)||a(t,e)})},removeClass:function(e){return this.each(function(t){u(t,e)&&f(t,e)})},hasClass:function(e){return i(this,function(t){return u(t,e)})},toggleClass:function(e,t){return this.each(function(n){typeof t!="undefined"?t?a(n,e):f(n,e):u(n,e)?f(n,e):a(n,e)})},show:function(e){return this.each(function(t){t.style.display=e||""})},hide:function(e){return this.each(function(e){e.style.display="none"})},append:function(e){return this.each(function(n){t(c(e),function(e){n.appendChild(e)})})},prepend:function(e){return this.each(function(n){var r=n.firstChild;t(c(e),function(e){n.insertBefore(e,r)})})},appendTo:function(e,t){return s.call(this,e,t,function(e,t){e.appendChild(t)})},prependTo:function(e,t){return s.call(this,e,t,function(e,t){e.insertBefore(t,e.firstChild)})},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},related:function(e){return this.map(function(t){t=t[e];while(t&&t.nodeType!==1)t=t[e];return t||0},function(e){return e})},before:function(e){return this.each(function(n){t(v.create(e),function(e){n[w].insertBefore(e,n)})})},after:function(e){return this.each(function(n){t(v.create(e),function(e){n[w].insertBefore(e,n.nextSibling)})})},insertBefore:function(e,t){return s.call(this,e,t,function(e,t){e[w].insertBefore(t,e)})},insertAfter:function(e,t){return s.call(this,e,t,function(e,t){var n=e.nextSibling;n?e[w].insertBefore(t,n):e[w].appendChild(t)})},css:function(e,t,r){function i(e,t,r){for(var i in s)s.hasOwnProperty(i)&&(r=s[i],(t=n(i))&&O.test(r)&&!(t in H)&&(r+=M),t=t=="transform"?B:t,t=t=="transformOrigin"?B+"Origin":t,e.style[t]=r)}if(t===undefined&&typeof e=="string")return t=this[0],t?t==y||t==g?(r=t==y?v.doc():v.viewport(),e=="width"?r.width:e=="height"?r.height:""):I(t,e):null;var s=e;typeof e=="string"&&(s={},s[e]=t),k&&s.opacity&&(s.filter="alpha(opacity="+s.opacity*100+")",s.zoom=e.zoom||1,delete s.opacity);if(t=s["float"])k?s.styleFloat=t:s.cssFloat=t,delete s["float"];return this.each(i)},offset:function(e,t){if(typeof e=="number"||typeof t=="number")return this.each(function(n){o(n,e,t)});var n=this[0],r=n.offsetWidth,i=n.offsetHeight,s=n.offsetTop,u=n.offsetLeft;while(n=n.offsetParent)s+=n.offsetTop,u+=n.offsetLeft;return{top:s,left:u,height:i,width:r}},attr:function(e,t){var n=this[0];if(typeof e=="string"||e instanceof String)return typeof t=="undefined"?S.test(e)?C.test(e)&&typeof n[e]=="string"?!0:n[e]:n[D](e):this.each(function(n){S.test(e)?n[e]=t:n[_](e,t)});for(var r in e)e.hasOwnProperty(r)&&this.attr(r,e[r]);return this},val:function(e){return typeof e=="string"?this.attr("value",e):this[0].value},removeAttr:function(e){return this.each(function(t){C.test(e)?t[e]=!1:t.removeAttribute(e)})},data:function(e,t){var n=this[0];if(typeof t=="undefined"){n[D]("data-node-uid")||n[_]("data-node-uid",++A);var r=n[D]("data-node-uid");return L[r]||(L[r]={}),L[r][e]}return this.each(function(n){n[D]("data-node-uid")||n[_]("data-node-uid",++A);var r=n[D]("data-node-uid"),i=L[r]||(L[r]={});i[e]=t})},remove:function(){return this.each(function(e){e[w]&&e[w].removeChild(e)})},empty:function(){return this.each(function(e){while(e.firstChild)e.removeChild(e.firstChild)})},detach:function(){return this.map(function(e){return e[w].removeChild(e)})},scrollTop:function(e){return h.call(this,null,e,"y")},scrollLeft:function(e){return h.call(this,e,null,"x")},toggle:function(e){return this.each(function(e){e.style.display=e.offsetWidth||e.offsetHeight?"none":"block"}),e&&e(),this}},v.setQueryEngine=function(e){E=e,delete v.setQueryEngine},v.aug=function(e,t){for(var n in e)e.hasOwnProperty(n)&&((t||l.prototype)[n]=e[n])},v.create=function(e){return typeof e=="string"?function(){var t=/^<([^\s>]+)/.exec(e),n=y.createElement(t&&N[t[1].toLowerCase()]||"div"),r=[];n.innerHTML=e;var i=n.childNodes;n=n.firstChild,r.push(n);while(n=n.nextSibling)n.nodeType==1&&r.push(n);return r}():r(e)?[e.cloneNode(!0)]:[]},v.doc=function(){var e=this.viewport();return{width:Math.max(y.body.scrollWidth,b.scrollWidth,e.width),height:Math.max(y.body.scrollHeight,b.scrollHeight,e.height)}},v.firstChild=function(e){for(var t=e.childNodes,n=0,r=t&&t.length||0,i;n<r;n++)t[n].nodeType===1&&(i=t[r=n]);return i},v.viewport=function(){return{width:k?b.clientWidth:self.innerWidth,height:k?b.clientHeight:self.innerHeight}},v.isAncestor="compareDocumentPosition"in b?function(e,t){return(e.compareDocumentPosition(t)&16)==16}:"contains"in b?function(e,t){return e!==t&&e.contains(t)}:function(e,t){while(t=t[w])if(t===e)return!0;return!1};var q=m.bonzo;return v.noConflict=function(){return m.bonzo=q,this},v});var envision={_:Flotr._,bean:Flotr.bean,bonzo:bonzo,noConflict:function(e){var t=e.envision;return function(){return e.envision=t,this}}(this)};(function(){function r(e){this.options=e||{},this.components=[],this.node=null,this.rendered=!1}var e="envision-first",t="envision-last",n='<div class="envision-visualization"></div>';T_COMPONENT_CONTAINER='<div class="envision-component-container"></div>',r.prototype={render:function(e){var t=this.options;e=e||t.element;if(!e)throw"No element to render within.";return this.node=bonzo.create(n)[0],bonzo(this.node).addClass(t.name||""),this.container=e,bonzo(e).append(this.node),bonzo(e).data("envision",this),_.each(this.components,function(e){this._renderComponent(e)},this),this._updateClasses(),this.rendered=!0,this},add:function(e){return this.components.push(e),this.rendered&&(this._renderComponent(e),this._updateClasses()),this},remove:function(e){var t=this.components,n=this.indexOf(e);return n!==-1&&(t.splice(n,1),bonzo(e.container).remove(),this._updateClasses()),this},setPosition:function(e,t){var n=this.components;return t>=0&&t<n.length&&this.remove(e)&&(this.rendered&&(t===n.length?this.node.appendChild(e.container):this.node.insertBefore(e.container,n[t].container)),n.splice(t,0,e),this._updateClasses()),this},indexOf:function(e){return _.indexOf(this.components,e)},getComponent:function(e){var t=this.components;if(e<t.length)return t[e]},isFirst:function(e){return this.indexOf(e)===0?!0:!1},isLast:function(e){return this.indexOf(e)===this.components.length-1?!0:!1},destroy:function(){_.each(this.components,function(e){e.destroy()}),bonzo(this.container).empty()},_renderComponent:function(e){var t=bonzo.create(T_COMPONENT_CONTAINER)[0];bonzo(this.node).append(t),e.render(t)},_updateClasses:function(){var n=this.components,r=0,i=n.length-1,s;_.each(n,function(n,o){s=bonzo(n.container),o===r?s.addClass(e):s.removeClass(e),o===i?s.addClass(t):s.removeClass(t)})}},envision.Visualization=r})(),function(){function r(t){t=t||{};var r=bonzo.create(n)[0];this.options=t,this.node=r,t.adapter?this.api=t.adapter:t.adapterConstructor?this.api=new t.adapterConstructor(t.config):t.adapterCallback?this.api=t.adapterCallback.call(null,t.config):t.config&&(this.api=new e.adapters.flotr.Child(t.config||{})),this.preprocessors=[]}var e=envision,t="envision-component",n='<div class="'+t+'"></div>';r.prototype={render:function(e){var t=this.node,n=this.options;e=e||n.element;if(!e)throw"No element to render within.";bonzo(e).addClass(n.name||"").append(this.node),this._setDimension("width"),this._setDimension("height"),this.container=e,this.draw(n.data,n.config)},draw:function(t,n){var r=this.api,i=this.options,s=this.preprocessors,o;o=t=t||i.data,n=n||i.config,!i.skipPreprocess&&t&&(o=[],_.each(r.getDataArray(t),function(u,a){var f=s[a]||new e.Preprocessor,l=_.isArray(u),c=_.isFunction(u),h=l?u:c?u:u.data,p=i.processData,d=r.range(n),v=d.min,m=d.max,g=this.node.clientWidth,y=u,b,w;!c&&!l&&(y=u.data,w=_.extend({},u)),c?b=t(v,m,g):(y!==f.data?f.setData(y):f.reset(),p?(p.apply(this,[{preprocessor:f,min:v,max:m,resolution:g}]),b=f.getData()):b=f.bound(v,m).subsampleMinMax(g).getData()),r.transformData&&(b=r.transformData(b)),w?(w.data=b,o.push(w)):o.push(b)},this)),r&&r.draw(o,n,this.node)},trigger:function(){this.api.trigger.apply(this.api,Array.prototype.concat.apply([this],arguments))},attach:function(){this.api.attach.apply(this.api,Array.prototype.concat.apply([this],arguments))},detach:function(){this.api.detach.apply(this.api,Array.prototype.concat.apply([this],arguments))},destroy:function(){this.api&&this.api.destroy&&this.api.destroy(),bonzo(this.container).empty()},_setDimension:function(e){var t=this.node,n=this.options;n[e]?bonzo(t).css(e,n[e]):n[e]=t.clientWidth,this[e]=n[e]}},e.Component=r}(),function(){function t(e){this.options=e=e||{},this.actions=[],this.actionOptions=[],this.followers=[],this.leaders=[],this.prevent={},e.leader&&this.leader(e.leader)}var e=envision;t.prototype={leader:function(e){return this.leaders.push(e),_.each(this.actions,function(t,n){this._bindLeader(e,t,this.actionOptions[n])},this),this},follower:function(e){return this.followers.push(e),this},group:function(e){return _.isArray(e)||(e=[e]),_.each(e,function(e){this.leader(e),this.follower(e)},this),this},add:function(e,t){return this.actions.push(e),this.actionOptions.push(t),_.each(this.leaders,function(n){this._bindLeader(n,e,t)},this),this},_bindLeader:function(e,t,n){_.each(t.events,function(t){var r=t.handler||t,i=t.consumer||t;e.attach(r,_.bind(function(e,t){if(this.prevent[name])return;n&&n.callback&&n.callback.call(this,t),this.prevent[name]=!0;try{_.each(this.followers,function(n){if(e===n)return;n.trigger(i,t)},this)}catch(r){throw this.prevent[name]=!1,r}this.prevent[name]=!1},this))},this)}},e.Interaction=t}(),function(){function e(e){e=e||{},this.getData=function(){return this.bounded&&r(this),this.processing},this.reset=function(){return this.processing=this.data,this},this.setData=function(e){var t,n;if(!_.isArray(e))throw new Error("Array expected.");if(e.length<2)throw new Error("Data must contain at least two dimensions.");n=e[0].length;for(t=e.length;t--;){if(!_.isArray(e[t]))throw new Error("Data dimensions must be arrays.");if(e[t].length!==n)throw new Error("Data dimensions must contain the same number of points.")}return this.processing=e,this.data=e,this},e.data&&this.setData(e.data)}function t(e,t){var n=_.sortedIndex(e,t);return e[n]>t&&n>0&&n--,n}function n(e,t){return _.sortedIndex(e,t)}function r(e){delete e.bounded;var r=e.processing,i=e.length(),s=r[0],o=r[1],u=e.min||0,a=e.max||i,f=t(s,u),l=n(s,a);e.processing=[s.slice(f,l+1),o.slice(f,l+1)],e.start=f,e.end=l}function i(e,t,n,r,i,s,o,u,a){var f=(e-r)/(s-r),l=1-f,c=(1+2*f)*l*l,h=f*l*l,p=f*f*(3-2*f),d=f*f*(f-1),v=(o-i)/(2*(s-r))+(typeof n=="undefined"?0:(i-n)/(2*(r-t))),m=(typeof a=="undefined"?0:(a-o)/(2*(u-s)))+(o-i)/(2*(s-r)),g=c*i+h*(s-r)*v+p*o+d*(s-r)*m;return g}e.prototype={length:function(){return this.getData()[0].length},bound:function(e,t){return!_.isNumber(e)||!_.isNumber(t)?this:(this.min=e,this.max=t,this.bounded=!0,this)},subsampleMinMax:function(e){var r=this.bounded;delete this.bounded;var i=this.processing,s=this.length(),o=i[0],u=i[1],a=r?t(o,this.min):0,f=r?n(o,this.max):s-1,l=(e-2)/2,c=[],h=[],p=Number.MAX_VALUE,d=-Number.MAX_VALUE,v=1,m=1,g=(f-a)/l,y,b,w,E;if(f-a+1>e){c.push(o[a]),h.push(u[a]),y=a+g;for(w=a;w<f;w++)w===Math.round(y)?(y+=g,E=Math.min(m,v),c.push(o[E]),h.push(u[E]),E=Math.max(m,v),c.push(o[E]),h.push(u[E]),v=w,p=u[v],m=w,d=u[m]):(u[w]>d&&(d=u[w],m=w),u[w]<p&&(p=u[w],v=w));w<y&&(c.push(o[v]),h.push(p),c.push(o[m]),h.push(d)),c.push(o[f]),h.push(u[f]),this.processing=[c,h],this.start=a,this.end=f}else this.bounded=r;return this},subsample:function(e){var r=this.bounded;delete this.bounded;var i=this.processing,s=this.length(),o=i[0],u=i[1],a=r?t(o,this.min):0,f=r?n(o,this.max):s-1,l=(f-a+1)/e,c=[],h=[],p,d;if(f-a+1>e){c.push(o[a]),h.push(u[a]);for(p=1;p<e;p++){if(p*l>=f-l)break;d=Math.round(p*l)+a,c.push(o[d]),h.push(u[d])}c.push(o[f]),h.push(u[f]),this.processing=[c,h],this.start=a,this.end=f}else this.bounded=r;return this},interpolate:function(e){var r=this.bounded;delete this.bounded;var s=this.processing,o=this.length(),u=s[0],a=s[1],f=r?t(u,this.min):0,l=r?n(u,this.max):o-1,c=(u[l]-u[f])/e,h=[],p=[],d,v,m;h.push(u[f]),p.push(a[f]);if(l-f+1<e){for(d=f;d<l;d++){m=u[d+1]-u[d],h.push(u[d]),p.push(a[d]);for(v=u[d+0]+c;v<u[d+1];v+=c)h.push(v),p.push(i(v,u[d-1],a[d-1],u[d+0],a[d+0],u[d+1],a[d+1],u[d+2],a[d+2]))}this.processing=[h,p],this.start=f,this.end=l}return this}},envision.Preprocessor=e}(),envision.actions=envision.actions||{},envision.actions.hit={events:["hit","mouseout"]},envision.actions.selection={events:[{handler:"select",consumer:"zoom"},{handler:"click",consumer:"reset"}]},envision.actions.zoom={events:[{handler:"select",consumer:"zoom"},"zoom","reset"]},envision.adapters=envision.adapters||{},envision.adapters.flotr={},envision.adapters.defaultOptions={grid:{outlineWidth:0,labelMargin:0,horizontalLines:!1,verticalLines:!1},bars:{show:!1,barWidth:.5,fill:!0,lineWidth:1,fillOpacity:1},lines:{lineWidth:1},xaxis:{margin:!1,tickDecimals:0,showLabels:!1},yaxis:{margin:!1,showLabels:!1},shadowSize:!1},function(){function i(e){this.options=e||{},this.flotr=null,this._flotrDefaultOptions()}function s(e,t){var n=e.options.config.selection.mode,r=e.api.flotr.axes,i,s,o,u,a;return n.indexOf("x")!==-1&&(i={},i.min=t.x1,i.max=t.x2,o={},o.min=r.x.d2p(t.x1),o.max=r.x.d2p(t.x2)),n.indexOf("y")!==-1&&(s={},s.min=t.y1,s.max=t.y2,u={},u.min=r.y.d2p(t.y1),u.max=r.y.d2p(t.y2)),a={data:{x:i,y:s},x:o,y:u},a}var e=envision,t=envision.adapters,n=Flotr.EventAdapter,r=t.defaultOptions;i.prototype={destroy:function(){this.flotr.destroy()},draw:function(e,t,n){var r=this.options;e=this.getDataArray(e||r.data),t?t=Flotr.merge(t,Flotr.clone(r)):t=r,r.data=e;if(!t)throw"No graph submitted.";this.flotr=Flotr.draw(n,e,t)},range:function(e){var t=e.xaxis;return{min:t.min,max:t.max}},transformData:function(e){var t=e[0].length,n=e.length,r=[],i,s,o;for(s=0;s<t;s++){i=[];for(o=0;o<n;o++)i.push(e[o][s]);r.push(i)}return r},getDataArray:function(e){return e[0]&&(!_.isArray(e[0])||!e[0].length||e[0][0]&&_.isArray(e[0][0]))?e:[e]},_flotrDefaultOptions:function(e){var t=e||this.options,n;for(n in r)r.hasOwnProperty(n)&&(_.isUndefined(t[n])?t[n]=r[n]:_.defaults(t[n],r[n]))},attach:function(e,t,r){var i=this.events[t]||{},s=i.handler||!1;return t=i.name||!1,s?n.observe(e.node,t,function(){var t=[e].concat(Array.prototype.slice.call(arguments)),n=s.apply(this,t);return r.apply(null,[e,n])}):!1},detach:function(e,t,r){return n.stopObserve(e.node,t,handler)},trigger:function(e,t,n){var r=this.events[t],i=r.consumer||!1;return i?i.apply(this,[e,n]):!1},events:{hit:{name:"flotr:hit",handler:function(e,t){var n=t.x,r=t.y,i=e.api.flotr,s;return s={data:{index:t.index,x:n,y:r},x:i.axes.x.d2p(n),y:i.axes.y.d2p(r)},s},consumer:function(e,t){var n=e.api.flotr,r;r={x:t.data.x,y:t.data.y||1,relX:t.x,relY:t.y||1},n.hit.hit(r)}},select:{name:"flotr:selecting",handler:s,consumer:function(e,t){var n=e.api.flotr,r=n.axes,i=t.data||{},s={},o=t.x,u=t.y;!o&&i.x?(o=i.x,s.x1=o.min,s.x2=o.max):o&&(s.x1=r.x.p2d(o.min),s.x2=r.x.p2d(o.max)),!u&&i.y?(u=i.y,s.y1=u.min,s.y2=u.max):u&&(s.y1=r.y.d2p(u.min),s.y2=r.y.d2p(u.max)),n.selection.setSelection(s)}},zoom:{name:"flotr:select",handler:function(e,t){var n=s(e,t);return e.trigger("zoom",n),n},consumer:function(e,t){var n=t.data.x,r=t.data.y,i={};n&&(i.xaxis={min:n.min,max:n.max}),r&&(i.yaxis={min:r.min,max:r.max}),e.draw(null,i)}},mouseout:{name:"flotr:mouseout",handler:function(e){},consumer:function(e){e.api.flotr.hit.clearHit()}},reset:{name:"flotr:click",handler:function(e){e.draw()},consumer:function(e){e.draw()}},click:{name:"flotr:click",handler:function(e){var t=e.api.flotr.axes.x.min,n=e.api.flotr.axes.x.max;return{data:{x:{min:t,max:n}},x:{min:e.api.flotr.axes.x.d2p(t),max:e.api.flotr.axes.x.d2p(n)}}},consumer:function(e,t){var n=t.data.x,r=t.data.y,i={};n&&(i.xaxis={min:n.min,max:n.max}),r&&(i.yaxis={min:r.min,max:r.max}),e.draw(null,i)}}}},t.flotr.Child=i}(),Flotr.addType("lite-lines",{options:{show:!1,lineWidth:2,fill:!1,fillBorder:!1,fillColor:null,fillOpacity:.4},draw:function(e){var t=e.context,n=e.lineWidth,r=e.shadowSize,i;t.save(),t.lineCap="butt",t.lineWidth=n,t.strokeStyle=e.color,this.plot(e),t.restore()},plot:function(e){var t=e.context,n=e.xScale,r=e.yScale,s=e.data,o=s.length-1,u=r(0),a,f;if(o<1)return;a=n(s[0][0]),f=r(s[0][1]),t.beginPath(),t.moveTo(a,f);for(i=0;i<o;++i)t.lineTo(n(s[i+1][0]),r(s[i+1][1]));(!e.fill||e.fill&&!e.fillBorder)&&t.stroke(),e.fill&&(a=n(s[0][0]),t.fillStyle=e.fillStyle,t.lineTo(n(s[o][0]),u),t.lineTo(a,u),t.lineTo(a,r(s[0][1])),t.fill(),e.fillBorder&&t.stroke())},extendYRange:function(e,t,n,r){var i=e.options;if(!i.max&&i.max!==0||!i.min&&i.min!==0)e.max+=n.lineWidth*.01,e.min-=n.lineWidth*.01}}),Flotr.addType("whiskers",{options:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,fillOpacity:.4,horizontal:!1,stacked:!1,centered:!0},stack:{positive:[],negative:[],_positive:[],_negative:[]},draw:function(e){var t=e.context;t.save(),t.lineJoin="miter",t.lineCap="butt",t.lineWidth=e.lineWidth,t.strokeStyle=e.color,e.fill&&(t.fillStyle=e.fillStyle),this.plot(e),t.restore()},plot:function(e){var t=e.data,n=e.context,r=e.shadowSize,i=e.xScale,s=e.yScale,o=s(0),u,a;if(t.length<1)return;n.translate(-e.lineWidth,0),n.beginPath();for(u=0;u<t.length;u++)a=i(t[u][0]),n.moveTo(a,o),n.lineTo(a,s(t[u][1]));n.closePath(),n.stroke()},drawHit:function(e){var t=e.args,n=e.context,r=e.shadowSize,i=e.xScale,s=e.yScale,o=s(0),u=i(t.x),a=s(t.y);n.save(),n.translate(-e.lineWidth,0),n.beginPath(),n.moveTo(u,o),n.lineTo(u,a),n.closePath(),n.stroke(),n.restore()},clearHit:function(e){var t=e.args,n=e.context,r=e.shadowSize,i=e.xScale,s=e.yScale,o=e.lineWidth,u=s(0),a=i(t.x),f=s(t.y);n.save(),n.clearRect(a-2*o,f-o,4*o,u-f+o),n.restore()}}),envision.components=envision.components||{},function(){function e(e){this.options=e||{}}e.prototype={height:null,width:null,rendered:!1,render:function(e){var t=document.createElement("canvas"),n=bonzo(e).offset();this.height=n.height,this.width=n.width,bonzo(t).attr("height",n.height).attr("width",n.width).css({position:"absolute",top:"0px",left:"0px"}),e.appendChild(t),bonzo(e).css({position:"relative"}),typeof FlashCanvas!="undefined"&&FlashCanvas.initElement(t),this.context=t.getContext("2d"),this.rendered=!0},draw:function(e,t,n){this.rendered||this.render(n);var r=this.context,i=this.height,s=this.width,o=Math.round(i/2)-.5,u,a;t=t||{min:s/2,max:s/2},u=t.min+.5,a=t.max+.5,r.clearRect(0,0,s,i);if(u||a)r.save(),r.strokeStyle=this.options.strokeStyle||"#B6D9FF",r.fillStyle=this.options.fillStyle||"rgba(182, 217, 255, .4)",r.beginPath(),u<=1?(r.moveTo(0,i),r.lineTo(0,-0.5)):(r.moveTo(u,i),r.quadraticCurveTo(u,o,Math.max(u-o,u/2),o),r.lineTo(Math.min(o,u/2),o),r.quadraticCurveTo(0,o,.5,-0.5)),r.lineTo(s-.5,-0.5),a>=s-1?r.lineTo(a,i):(r.quadraticCurveTo(s,o,Math.max(s-o,s-(s-a)/2),o),r.lineTo(Math.min(a+o,s-(s-a)/2),o),r.quadraticCurveTo(a,o,a,i)),r.stroke(),r.closePath(),r.fill(),r.restore()},trigger:function(e,t
,n){t==="zoom"?this.zoom(e,n):t==="reset"&&this.reset(e)},zoom:function(e,t){var n=t.x||{},r=n.min,i=n.max,s=e.api;e.draw(null,{min:r,max:i})},reset:function(e){e.draw(null,{min:e.width/2,max:e.width/2})}},envision.components.QuadraticDrawing=e}(),envision.templates=envision.templates||{},function(){function t(e){var t=e.resolution;e.preprocessor.bound(e.min,e.max).subsampleMinMax(t+Math.round(t/3))}function n(){return{price:{name:"envision-finance-price",config:{"lite-lines":{lineWidth:1,show:!0,fill:!0,fillOpacity:.2},mouse:{track:!0,trackY:!1,trackAll:!0,sensibility:1,trackDecimals:4,position:"ne"},yaxis:{autoscale:!0,autoscaleMargin:.05,noTicks:4,showLabels:!0,min:0}},processData:t},volume:{name:"envision-finance-volume",config:{whiskers:{show:!0,lineWidth:2},mouse:{track:!0,trackY:!1,trackAll:!0},yaxis:{autoscale:!0,autoscaleMargin:.5}},processData:t},summary:{name:"envision-finance-summary",config:{"lite-lines":{show:!0,lineWidth:1,fill:!0,fillOpacity:.2,fillBorder:!0},xaxis:{noTicks:5,showLabels:!0},yaxis:{autoscale:!0,autoscaleMargin:.1},handles:{show:!0},selection:{mode:"x"},grid:{verticalLines:!1}}},connection:{name:"envision-finance-connection",adapterConstructor:e.components.QuadraticDrawing}}}function r(t){var r=t.data,i=n(),s=new e.Visualization({name:"envision-finance"}),o=new e.Interaction,u=new e.Interaction,a,f,l,c;t.defaults&&(i=Flotr.merge(t.defaults,i)),i.price.data=r.price,i.volume.data=r.volume,i.summary.data=r.summary,i.price.config.mouse.trackFormatter=t.trackFormatter||function(e){var t=e.index,n;return a.api.preprocessor&&(t+=a.api.preprocessor.start),n="Price: $"+r.price[1][t]+", Vol: "+r.volume[1][t],n},t.xTickFormatter&&(i.summary.config.xaxis.tickFormatter=t.xTickFormatter),i.price.config.yaxis.tickFormatter=t.yTickFormatter||function(e){return"$"+e},a=new e.Component(i.price),f=new e.Component(i.volume),l=new e.Component(i.connection),c=new e.Component(i.summary),s.add(a).add(f).add(l).add(c).render(t.container),o.follower(a).follower(f).follower(l).leader(c).add(e.actions.selection,t.selectionCallback?{callback:t.selectionCallback}:null),u.group([a,f]).add(e.actions.hit),t.selection&&c.trigger("select",t.selection),this.vis=s,this.selection=o,this.hit=u,this.price=a,this.volume=f,this.summary=c}var e=envision;e.templates.Finance=r}(),function(){function t(){return{detail:{name:"envision-timeseries-detail",config:{"lite-lines":{lineWidth:1,show:!0}}},summary:{name:"envision-timeseries-summary",config:{"lite-lines":{lineWidth:1,show:!0},handles:{show:!0},selection:{mode:"x"},yaxis:{autoscale:!0,autoscaleMargin:.1}}},connection:{name:"envision-timeseries-connection",adapterConstructor:e.components.QuadraticDrawing}}}function n(n){var r=n.data,i=t(),s=new e.Visualization({name:"envision-timeseries"}),o=new e.Interaction,u,a,f;n.defaults&&(i=Flotr.merge(n.defaults,i)),i.detail.data=r.detail,i.summary.data=r.summary,u=new e.Component(i.detail),f=new e.Component(i.connection),a=new e.Component(i.summary),s.add(u).add(f).add(a).render(n.container),o.follower(u).follower(f).leader(a).add(e.actions.selection,n.selectionCallback?{callback:n.selectionCallback}:null),n.selection&&a.trigger("select",n.selection),this.vis=s,this.selection=o,this.detail=u,this.summary=a}var e=envision;e.templates.TimeSeries=n}(),function(){function n(){return{name:"zoom"}}function r(){return{name:"summary",config:{handles:{show:!0},selection:{mode:"x"}}}}function i(e,t){var n=_.defaults(e,t);return n.flotr=_.defaults(n.flotr,t.flotr),n}var e=envision,t;t=function(t){var s=new e.Visualization,o=new e.Component(i(t.zoom||{},n())),u=new e.Component(i(t.summary||{},r())),a=new e.Interaction({leader:u});s.add(o).add(u),a.add(e.actions.selection),a.follower(o),this.vis=s,this.interaction=a,t.container&&this.render(t.container)},t.prototype={render:function(e){this.vis.render(e)}},e.templates.Zoom=t}(),function(){function e(e){return e.target}function t(e){return e.source}function n(e,t){try{for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}catch(r){e.prototype=t}}function r(e){var t=-1,n=e.length,r=[];while(++t<n)r.push(e[t]);return r}function i(e){return Array.prototype.slice.call(e)}function s(){}function o(e){return e}function u(){return!0}function a(e){return typeof e=="function"?e:function(){return e}}function f(e,t,n){return function(){var r=n.apply(t,arguments);return arguments.length?e:r}}function l(e){return e!=null&&!isNaN(e)}function c(e){return e.length}function h(e){return e.trim().replace(/\s+/g," ")}function p(e){var t=1;while(e*t%1)t*=10;return t}function d(e){return e.length===1?function(t,n){e(t==null?n:null)}:e}function v(e){return e.responseText}function m(e){return JSON.parse(e.responseText)}function g(e){var t=document.createRange();return t.selectNode(document.body),t.createContextualFragment(e.responseText)}function y(e){return e.responseXML}function b(){}function w(e){function t(){var t=n,r=-1,i=t.length,s;while(++r<i)(s=t[r].on)&&s.apply(this,arguments);return e}var n=[],r=new s;return t.on=function(t,i){var s=r.get(t),o;return arguments.length<2?s&&s.on:(s&&(s.on=null,n=n.slice(0,o=n.indexOf(s)).concat(n.slice(o+1)),r.remove(t)),i&&n.push(r.set(t,{on:i})),e)},t}function E(e,t){return t-(e?1+Math.floor(Math.log(e+Math.pow(10,1+Math.floor(Math.log(e)/Math.LN10)-t))/Math.LN10):1)}function S(e){return e+""}function x(e,t){var n=Math.pow(10,Math.abs(8-t)*3);return{scale:t>8?function(e){return e/n}:function(e){return e*n},symbol:e}}function T(e){return function(t){return t<=0?0:t>=1?1:e(t)}}function N(e){return function(t){return 1-e(1-t)}}function C(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function k(e){return e*e}function L(e){return e*e*e}function A(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function O(e){return function(t){return Math.pow(t,e)}}function M(e){return 1-Math.cos(e*cr/2)}function _(e){return Math.pow(2,10*(e-1))}function D(e){return 1-Math.sqrt(1-e*e)}function P(e,t){var n;return arguments.length<2&&(t=.45),arguments.length?n=t/(2*cr)*Math.asin(1/e):(e=1,n=t/4),function(r){return 1+e*Math.pow(2,10*-r)*Math.sin((r-n)*2*cr/t)}}function H(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}}function B(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function j(){d3.event.stopPropagation(),d3.event.preventDefault()}function F(){var e=d3.event,t;while(t=e.sourceEvent)e=t;return e}function I(e){var t=new b,n=0,r=arguments.length;while(++n<r)t[arguments[n]]=w(t);return t.of=function(n,r){return function(i){try{var s=i.sourceEvent=d3.event;i.target=e,d3.event=i,t[i.type].apply(n,r)}finally{d3.event=s}}},t}function q(e){var t=[e.a,e.b],n=[e.c,e.d],r=U(t),i=R(t,n),s=U(z(n,t,-i))||0;t[0]*n[1]<n[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-n[0],n[1]))*dr,this.translate=[e.e,e.f],this.scale=[r,s],this.skew=s?Math.atan2(i,s)*dr:0}function R(e,t){return e[0]*t[0]+e[1]*t[1]}function U(e){var t=Math.sqrt(R(e,e));return t&&(e[0]/=t,e[1]/=t),t}function z(e,t,n){return e[0]+=n*t[0],e[1]+=n*t[1],e}function W(e){return e=="transform"?d3.interpolateTransform:d3.interpolate}function X(e,t){return t=t-(e=+e)?1/(t-e):0,function(n){return(n-e)*t}}function V(e,t){return t=t-(e=+e)?1/(t-e):0,function(n){return Math.max(0,Math.min(1,(n-e)*t))}}function $(){}function J(e,t,n){return new K(e,t,n)}function K(e,t,n){this.r=e,this.g=t,this.b=n}function Q(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function G(e,t,n){var r=0,i=0,s=0,o,u,a;o=/([a-z]+)\((.*)\)/i.exec(e);if(o){u=o[2].split(",");switch(o[1]){case"hsl":return n(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(tt(u[0]),tt(u[1]),tt(u[2]))}}return(a=Pr.get(e))?t(a.r,a.g,a.b):(e!=null&&e.charAt(0)==="#"&&(e.length===4?(r=e.charAt(1),r+=r,i=e.charAt(2),i+=i,s=e.charAt(3),s+=s):e.length===7&&(r=e.substring(1,3),i=e.substring(3,5),s=e.substring(5,7)),r=parseInt(r,16),i=parseInt(i,16),s=parseInt(s,16)),t(r,i,s))}function Y(e,t,n){var r=Math.min(e/=255,t/=255,n/=255),i=Math.max(e,t,n),s=i-r,o,u,a=(i+r)/2;return s?(u=a<.5?s/(i+r):s/(2-i-r),e==i?o=(t-n)/s+(t<n?6:0):t==i?o=(n-e)/s+2:o=(e-t)/s+4,o*=60):u=o=0,nt(o,u,a)}function Z(e,t,n){e=et(e),t=et(t),n=et(n);var r=pt((.4124564*e+.3575761*t+.1804375*n)/Fr),i=pt((.2126729*e+.7151522*t+.072175*n)/Ir),s=pt((.0193339*e+.119192*t+.9503041*n)/qr);return at(116*i-16,500*(r-i),200*(i-s))}function et(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function tt(e){var t=parseFloat(e);return e.charAt(e.length-1)==="%"?Math.round(t*2.55):t}function nt(e,t,n){return new rt(e,t,n)}function rt(e,t,n){this.h=e,this.s=t,this.l=n}function it(e,t,n){function r(e){return e>360?e-=360:e<0&&(e+=360),e<60?s+(o-s)*e/60:e<180?o:e<240?s+(o-s)*(240-e)/60:s}function i(e){return Math.round(r(e)*255)}var s,o;return e%=360,e<0&&(e+=360),t=t<0?0:t>1?1:t,n=n<0?0:n>1?1:n,o=n<=.5?n*(1+t):n+t-n*t,s=2*n-o,J(i(e+120),i(e),i(e-120))}function st(e,t,n){return new ot(e,t,n)}function ot(e,t,n){this.h=e,this.c=t,this.l=n}function ut(e,t,n){return at(n,Math.cos(e*=pr)*t,Math.sin(e)*t)}function at(e,t,n){return new ft(e,t,n)}function ft(e,t,n){this.l=e,this.a=t,this.b=n}function lt(e,t,n){var r=(e+16)/116,i=r+t/500,s=r-n/200;return i=ht(i)*Fr,r=ht(r)*Ir,s=ht(s)*qr,J(dt(3.2404542*i-1.5371385*r-.4985314*s),dt(-0.969266*i+1.8760108*r+.041556*s),dt(.0556434*i-.2040259*r+1.0572252*s))}function ct(e,t,n){return st(Math.atan2(n,t)/cr*180,Math.sqrt(t*t+n*n),e)}function ht(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function pt(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function dt(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function vt(e){return gr(e,$r),e}function mt(e){return function(){return Ur(e,this)}}function gt(e){return function(){return zr(e,this)}}function yt(e,t){function n(){this.removeAttribute(e)}function r(){this.removeAttributeNS(e.space,e.local)}function i(){this.setAttribute(e,t)}function s(){this.setAttributeNS(e.space,e.local,t)}function o(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}function u(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}return e=d3.ns.qualify(e),t==null?e.local?r:n:typeof t=="function"?e.local?u:o:e.local?s:i}function bt(e){return new RegExp("(?:^|\\s+)"+d3.requote(e)+"(?:\\s+|$)","g")}function wt(e,t){function n(){var n=-1;while(++n<i)e[n](this,t)}function r(){var n=-1,r=t.apply(this,arguments);while(++n<i)e[n](this,r)}e=e.trim().split(/\s+/).map(Et);var i=e.length;return typeof t=="function"?r:n}function Et(e){var t=bt(e);return function(n,r){if(i=n.classList)return r?i.add(e):i.remove(e);var i=n.className,s=i.baseVal!=null,o=s?i.baseVal:i;r?(t.lastIndex=0,t.test(o)||(o=h(o+" "+e),s?i.baseVal=o:n.className=o)):o&&(o=h(o.replace(t," ")),s?i.baseVal=o:n.className=o)}}function St(e,t,n){function r(){this.style.removeProperty(e)}function i(){this.style.setProperty(e,t,n)}function s(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}return t==null?r:typeof t=="function"?s:i}function xt(e,t){function n(){delete this[e]}function r(){this[e]=t}function i(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}return t==null?n:typeof t=="function"?i:r}function Tt(e){return{__data__:e}}function Nt(e){return function(){return Vr(this,e)}}function Ct(e){return arguments.length||(e=d3.ascending),function(t,n){return e(t&&t.__data__,n&&n.__data__)}}function kt(e,t,n){function r(){var t=this[s];t&&(this.removeEventListener(e,t,t.$),delete this[s])}function i(){function i(e){var n=d3.event;d3.event=e,u[0]=o.__data__;try{t.apply(o,u)}finally{d3.event=n}}var o=this,u=vr(arguments);r.call(this),this.addEventListener(e,this[s]=i,i.$=n),i._=t}var s="__on"+e,o=e.indexOf(".");return o>0&&(e=e.substring(0,o)),t?i:r}function Lt(e,t){for(var n=0,r=e.length;n<r;n++)for(var i=e[n],s=0,o=i.length,u;s<o;s++)(u=i[s])&&t(u,s,n);return e}function At(e){return gr(e,Kr),e}function Ot(e,t){return gr(e,Qr),e.id=t,e}function Mt(e,t,n,r){var i=e.__transition__||(e.__transition__={active:0,count:0}),o=i[n];if(!o){var u=r.time;return o=i[n]={tween:new s,event:d3.dispatch("start","end"),time:u,ease:r.ease,delay:r.delay,duration:r.duration},++i.count,d3.timer(function(r){function s(r){return i.active>n?f():(i.active=n,h.start.call(e,l,t),o.tween.forEach(function(n,r){(r=r.call(e,l,t))&&v.push(r)}),a(r)||d3.timer(a,0,u),1)}function a(r){if(i.active!==n)return f();var s=(r-p)/d,o=c(s),u=v.length;while(u>0)v[--u].call(e,o);if(s>=1)return f(),h.end.call(e,l,t),1}function f(){return--i.count?delete i[n]:delete e.__transition__,1}var l=e.__data__,c=o.ease,h=o.event,p=o.delay,d=o.duration,v=[];return p<=r?s(r):d3.timer(s,p,u),1},0,u),o}}function _t(e){return e==null&&(e=""),function(){this.textContent=e}}function Dt(e,t,n,r){var i=e.id;return Lt(e,typeof n=="function"?function(e,s,o){e.__transition__[i].tween.set(t,r(n.call(e,e.__data__,s,o)))}:(n=r(n),function(e){e.__transition__[i].tween.set(t,n)}))}function Pt(){var e,t=Date.now(),n=ni;while(n)e=t-n.then,e>=n.delay&&(n.flush=n.callback(e)),n=n.next;var r=Ht()-t;r>24?(isFinite(r)&&(clearTimeout(ii),ii=setTimeout(Pt,r)),ri=0):(ri=1,si(Pt))}function Ht(){var e=null,t=ni,n=Infinity;while(t)t.flush?(delete ti[t.callback.id],t=e?e.next=t.next:ni=t.next):(n=Math.min(n,t.then+t.delay),t=(e=t).next);return n}function Bt(e,t){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();if(oi<0&&(window.scrollX||window.scrollY)){n=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0);var i=n[0][0].getScreenCTM();oi=!i.f&&!i.e,n.remove()}return oi?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}var s=e.getBoundingClientRect();return[t.clientX-s.left-e.clientLeft,t.clientY-s.top-e.clientTop]}function jt(){}function Ft(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function It(e){return e.rangeExtent?e.rangeExtent():Ft(e.range())}function qt(e,t){var n=0,r=e.length-1,i=e[n],s=e[r],o;s<i&&(o=n,n=r,r=o,o=i,i=s,s=o);if(t=t(s-i))e[n]=t.floor(i),e[r]=t.ceil(s);return e}function Rt(){return Math}function Ut(e,t,n,r){function i(){var i=Math.min(e.length,t.length)>2?Kt:Jt,a=r?V:X;return o=i(e,t,a,n),u=i(t,e,a,d3.interpolate),s}function s(e){return o(e)}var o,u;return s.invert=function(e){return u(e)},s.domain=function(t){return arguments.length?(e=t.map(Number),i()):e},s.range=function(e){return arguments.length?(t=e,i()):t},s.rangeRound=function(e){return s.range(e).interpolate(d3.interpolateRound)},s.clamp=function(e){return arguments.length?(r=e,i()):r},s.interpolate=function(e){return arguments.length?(n=e,i()):n},s.ticks=function(t){return Vt(e,t)},s.tickFormat=function(t){return $t(e,t)},s.nice=function(){return qt(e,Wt),i()},s.copy=function(){return Ut(e,t,n,r)},i()}function zt(e,t){return d3.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Wt(e){return e=Math.pow(10,Math.round(Math.log(e)/Math.LN10)-1),e&&{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}}function Xt(e,t){var n=Ft(e),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),s=t/r*i;return s<=.15?i*=10:s<=.35?i*=5:s<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+i*.5,n[2]=i,n}function Vt(e,t){return d3.range.apply(d3,Xt(e,t))}function $t(e,t){return d3.format(",."+Math.max(0,-Math.floor(Math.log(Xt(e,t)[2])/Math.LN10+.01))+"f")}function Jt(e,t,n,r){var i=n(e[0],e[1]),s=r(t[0],t[1]);return function(e){return s(i(e))}}function Kt(e,t,n,r){var i=[],s=[],o=0,u=Math.min(e.length,t.length)-1;e[u]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());while(++o<=u)i.push(n(e[o-1],e[o])),s.push(r(t[o-1],t[o]));return function(t){var n=d3.bisect(e,t,1,u)-1;return s[n](i[n](t))}}function Qt(e,t){function n(n){return e(t(n))}var r=t.pow;return n.invert=function(t){return r(e.invert(t))},n.domain=function(i){return arguments.length?(t=i[0]<0?Yt:Gt,r=t.pow,e.domain(i.map(t)),n):e.domain().map(r)},n.nice=function(){return e.domain(qt(e.domain(),Rt)),n},n.ticks=function(){var n=Ft(e.domain()),i=[];if(n.every(isFinite)){var s=Math.floor(n[0]),o=Math.ceil(n[1]),u=r(n[0]),a=r(n[1]);if(t===Yt){i.push(r(s));for(;s++<o;)for(var f=9;f>0;f--)i.push(r(s)*f)}else{for(;s<o;s++)for(var f=1;f<10;f++)i.push(r(s)*f);i.push(r(s))}for(s=0;i[s]<u;s++);for(o=i.length;i[o-1]>a;o--);i=i.slice(s,o)}return i},n.tickFormat=function(e,i){arguments.length<2&&(i=ui);if(!arguments.length)return i;var s=Math.max(.1,e/n.ticks().length),o=t===Yt?(u=-1e-12,Math.floor):(u=1e-12,Math.ceil),u;return function(e){return e/r(o(t(e)+u))<=s?i(e):""}},n.copy=function(){return Qt(e.copy(),t)},zt(n,e)}function Gt(e){return Math.log(e<0?0:e)/Math.LN10}function Yt(e){return-Math.log(e>0?0:-e)/Math.LN10}function Zt(e,t){function n(t){return e(r(t))}var r=en(t),i=en(1/t);return n.invert=function(t){return i(e.invert(t))},n.domain=function(t){return arguments.length?(e.domain(t.map(r)),n):e.domain().map(i)},n.ticks=function(e){return Vt(n.domain(),e)},n.tickFormat=function(e){return $t(n.domain(),e)},n.nice=function(){return n.domain(qt(n.domain(),Wt))},n.exponent=function(e){if(!arguments.length)return t;var s=n.domain();return r=en(t=e),i=en(1/t),n.domain(s)},n.copy=function(){return Zt(e.copy(),t)},zt(n,e)}function en(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function tn(e,t){function n(t){return o[((i.get(t)||i.set(t,e.push(t)))-1)%o.length]}function r(t,n){return d3.range(e.length).map(function(e){return t+n*e})}var i,o,u;return n.domain=function(r){if(!arguments.length)return e;e=[],i=new s;var o=-1,u=r.length,a;while(++o<u)i.has(a=r[o])||i.set(a,e.push(a));return n[t.t].apply(n,t.a)},n.range=function(e){return arguments.length?(o=e,u=0,t={t:"range",a:arguments},n):o},n.rangePoints=function(i,s){arguments.length<2&&(s=0);var a=i[0],f=i[1],l=(f-a)/(Math.max(1,e.length-1)+s);return o=r(e.length<2?(a+f)/2:a+l*s/2,l),u=0,t={t:"rangePoints",a:arguments},n},n.rangeBands=function(i,s,a){arguments.length<2&&(s=0),arguments.length<3&&(a=s);var f=i[1]<i[0],l=i[f-0],c=i[1-f],h=(c-l)/(e.length-s+2*a);return o=r(l+h*a,h),f&&o.reverse(),u=h*(1-s),t={t:"rangeBands",a:arguments},n},n.rangeRoundBands=function(i,s,a){arguments.length<2&&(s=0),arguments.length<3&&(a=s);var f=i[1]<i[0],l=i[f-0],c=i[1-f],h=Math.floor((c-l)/(e.length-s+2*a)),p=c-l-(e.length-s)*h;return o=r(l+Math.round(p/2),h),f&&o.reverse(),u=Math.round(h*(1-s)),t={t:"rangeRoundBands",a:arguments},n},n.rangeBand=function(){return u},n.rangeExtent=function(){return Ft(t.a[0])},n.copy=function(){return tn(e,t)},n.domain(e)}function nn(e,t){function n(){var n=0,s=t.length;i=[];while(++n<s)i[n-1]=d3.quantile(e,n/s);return r}function r(e){return isNaN(e=+e)?NaN:t[d3.bisect(i,e)]}var i;return r.domain=function(t){return arguments.length?(e=t.filter(function(e){return!isNaN(e)}).sort(d3.ascending),n()):e},r.range=function(e){return arguments.length?(t=e,n()):t},r.quantiles=function(){return i},r.copy=function(){return nn(e,t)},n()}function rn(e,t,n){function r(t){return n[Math.max(0,Math.min(o,Math.floor(s*(t-e))))]}function i(){return s=n.length/(t-e),o=n.length-1,r}var s,o;return r.domain=function(n){return arguments.length?(e=+n[0],t=+n[n.length-1],i()):[e,t]},r.range=function(e){return arguments.length?(n=e,i()):n},r.copy=function(){return rn(e,t,n)},i()}function sn(e,t){function n(n){return t[d3.bisect(e,n)]}return n.domain=function(t){return arguments.length?(e=t,n):e},n.range=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return sn(e,t)},n}function on(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=n.map(t),t):e},t.ticks=function(t){return Vt(e,t)},t.tickFormat=function(t){return $t(e,t)},t.copy=function(){return on(e)},t}function un(e){var t=e.source,n=e.target,r=fn(t,n),i=[t];while(t!==r)t=t.parent,i.push(t);var s=i.length;while(n!==r)i.splice(s,0,n),n=n.parent;return i}function an(e){var t=[],n=e.parent;while(n!=null)t.push(e),e=n,n=n.parent;return t.push(e),t}function fn(e,t){if(e===t)return e;var n=an(e),r=an(t),i=n.pop(),s=r.pop(),o=null;while(i===s)o=i,i=n.pop(),s=r.pop();return o}function ln(e){e.fixed|=2}function cn(e){e.fixed&=1}function hn(e){e.fixed|=4,e.px=e.x,e.py=e.y}function pn(e){e.fixed&=3}function dn(e,t,n){var r=0,i=0;e.charge=0;if(!e.leaf){var s=e.nodes,o=s.length,u=-1,a;while(++u<o){a=s[u];if(a==null)continue;dn(a,t,n),e.charge+=a.charge,r+=a.charge*a.cx,i+=a.charge*a.cy}}if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var f=t*n[e.point.index];e.charge+=e.pointCharge=f,r+=f*e.point.x,i+=f*e.point.y}e.cx=r/e.charge,e.cy=i/e.charge}function vn(){return 20}function mn(){return 1}function gn(e){return e.x}function yn(e){return e.y}function bn(e,t,n){e.y0=t,e.y=n}function wn(e){return d3.range(e.length)}function En(e){var t=-1,n=e[0].length,r=[];while(++t<n)r[t]=0;return r}function Sn(e){var t=1,n=0,r=e[0][1],i,s=e.length;for(;t<s;++t)(i=e[t][1])>r&&(n=t,r=i);return n}function xn(e){return e.reduce(Tn,0)}function Tn(e,t){return e+t[1]}function Nn(e,t){return Cn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Cn(e,t){var n=-1,r=+e[0],i=(e[1]-r)/t,s=[];while(++n<=t)s[n]=i*n+r;return s}function kn(e){return[d3.min(e),d3.max(e)]}function Ln(e,t){return d3.rebind(e,t,"sort","children","value"),e.nodes=e,e.links=_n,e}function An(e){return e.children}function On(e){return e.value}function Mn(e,t){return t.value-e.value}function _n(e){return d3.merge(e.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}function Dn(e,t){return e.value-t.value}function Pn(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function Hn(e,t){e._pack_next=t,t._pack_prev=e}function Bn(e,t){var n=t.x-e.x,r=t.y-e.y,i=e.r+t.r;return i*i-n*n-r*r>.001}function jn(e){function t(e){r=Math.min(e.x-e.r,r),i=Math.max(e.x+e.r,i),s=Math.min(e.y-e.r,s),o=Math.max(e.y+e.r,o)}if(!(n=e.children)||!(p=n.length))return;var n,r=Infinity,i=-Infinity,s=Infinity,o=-Infinity,u,a,f,l,c,h,p;n.forEach(Fn),u=n[0],u.x=-u.r,u.y=0,t(u);if(p>1){a=n[1],a.x=a.r,a.y=0,t(a);if(p>2){f=n[2],Rn(u,a,f),t(f),Pn(u,f),u._pack_prev=f,Pn(f,a),a=u._pack_next;for(l=3;l<p;l++){Rn(u,a,f=n[l]);var d=0,v=1,m=1;for(c=a._pack_next;c!==a;c=c._pack_next,v++)if(Bn(c,f)){d=1;break}if(d==1)for(h=u._pack_prev;h!==c._pack_prev;h=h._pack_prev,m++)if(Bn(h,f))break;d?(v<m||v==m&&a.r<u.r?Hn(u,a=c):Hn(u=h,a),l--):(Pn(u,f),a=f,t(f))}}}var g=(r+i)/2,y=(s+o)/2,b=0;for(l=0;l<p;l++)f=n[l],f.x-=g,f.y-=y,b=Math.max(b,f.r+Math.sqrt(f.x*f.x+f.y*f.y));e.r=b,n.forEach(In)}function Fn(e){e._pack_next=e._pack_prev=e}function In(e){delete e._pack_next,delete e._pack_prev}function qn(e,t,n,r){var i=e.children;e.x=t+=r*e.x,e.y=n+=r*e.y,e.r*=r;if(i){var s=-1,o=i.length;while(++s<o)qn(i[s],t,n,r)}}function Rn(e,t,n){var r=e.r+n.r,i=t.x-e.x,s=t.y-e.y;if(r&&(i||s)){var o=t.r+n.r,u=i*i+s*s;o*=o,r*=r;var a=.5+(r-o)/(2*u),f=Math.sqrt(Math.max(0,2*o*(r+u)-(r-=u)*r-o*o))/(2*u);n.x=e.x+a*i+f*s,n.y=e.y+a*s-f*i}else n.x=e.x+r,n.y=e.y}function Un(e){return 1+d3.max(e,function(e){return e.y})}function zn(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}function Wn(e){var t=e.children;return t&&t.length?Wn(t[0]):e}function Xn(e){var t=e.children,n;return t&&(n=t.length)?Xn(t[n-1]):e}function Vn(e,t){return e.parent==t.parent?1:2}function $n(e){var t=e.children;return t&&t.length?t[0]:e._tree.thread}function Jn(e){var t=e.children,n;return t&&(n=t.length)?t[n-1]:e._tree.thread}function Kn(e,t){var n=e.children;if(n&&(i=n.length)){var r,i,s=-1;while(++s<i)t(r=Kn(n[s],t),e)>0&&(e=r)}return e}function Qn(e,t){return e.x-t.x}function Gn(e,t){return t.x-e.x}function Yn(e,t){return e.depth-t.depth}function Zn(e,t){function n(e,r){var i=e.children;if(i&&(a=i.length)){var s,o=null,u=-1,a;while(++u<a)s=i[u],n(s,o),o=s}t(e,r)}n(e,null)}function er(e){var t=0,n=0,r=e.children,i=r.length,s;while(--i>=0)s=r[i]._tree,s.prelim+=t,s.mod+=t,t+=s.shift+(n+=s.change)}function tr(e,t,n){e=e._tree,t=t._tree;var r=n/(t.number-e.number);e.change+=r,t.change-=r,t.shift+=n,t.prelim+=n,t.mod+=n}function nr(e,t,n){return e._tree.ancestor.parent==t.parent?e._tree.ancestor:n}function rr(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function ir(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],s=e.dy-t[0]-t[2];return i<0&&(n+=i/2,i=0),s<0&&(r+=s/2,s=0),{x:n,y:r,dx:i,dy:s}}var sr=".",or=",",ur=[3,3];Date.now||(Date.now=function(){return+(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(ar){var fr=CSSStyleDeclaration.prototype,lr=fr.setProperty;fr.setProperty=function(e,t,n){lr.call(this,e,t+"",n)}}d3={version:"3.0.2"};var cr=Math.PI,hr=1e-6,pr=cr/180,dr=180/cr,vr=i;try{vr(document.documentElement.childNodes)[0].nodeType}catch(mr){vr=r}var gr=[].__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]};d3.map=function(e){var t=new s;for(var n in e)t.set(n,e[n]);return t},n(s,{has:function(e){return yr+e in this},get:function(e){return this[yr+e]},set:function(e,t){return this[yr+e]=t},remove:function(e){return e=yr+e,e in this&&delete this[e]},keys:function(){var e=[];return this.forEach(function(t){e.push(t)}),e},values:function(){var e=[];return this.forEach(function(t,n){e.push(n)}),e},entries:function(){var e=[];return this.forEach(function(t,n){e.push({key:t,value:n})}),e},forEach:function(e){for(var t in this)t.charCodeAt(0)===br&&e.call(this,t.substring(1),this[t])}});var yr="\0",br=yr.charCodeAt(0);d3.functor=a,d3.rebind=function(e,t){var n=1,r=arguments.length,i;while(++n<r)e[i=arguments[n]]=f(e,t,t[i]);return e},d3.ascending=function(e,t){return e<t?-1:e>t?1:e>=t?0:NaN},d3.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},d3.mean=function(e,t){var n=e.length,r,i=0,s=-1,o=0;if(arguments.length===1)while(++s<n)l(r=e[s])&&(i+=(r-i)/++o);else while(++s<n)l(r=t.call(e,e[s],s))&&(i+=(r-i)/++o);return o?i:undefined},d3.median=function(e,t){return arguments.length>1&&(e=e.map(t)),e=e.filter(l),e.length?d3.quantile(e.sort(d3.ascending),.5):undefined},d3.min=function(e,t){var n=-1,r=e.length,i,s;if(arguments.length===1){while(++n<r&&((i=e[n])==null||i!=i))i=undefined;while(++n<r)(s=e[n])!=null&&i>s&&(i=s)}else{while(++n<r&&((i=t.call(e,e[n],n))==null||i!=i))i=undefined;while(++n<r)(s=t.call(e,e[n],n))!=null&&i>s&&(i=s)}return i},d3.max=function(e,t){var n=-1,r=e.length,i,s;if(arguments.length===1){while(++n<r&&((i=e[n])==null||i!=i))i=undefined;while(++n<r)(s=e[n])!=null&&s>i&&(i=s)}else{while(++n<r&&((i=t.call(e,e[n],n))==null||i!=i))i=undefined;while(++n<r)(s=t.call(e,e[n],n))!=null&&s>i&&(i=s)}return i},d3.extent=function(e,t){var n=-1,r=e.length,i,s,o;if(arguments.length===1){while(++n<r&&((i=o=e[n])==null||i!=i))i=o=undefined;while(++n<r)(s=e[n])!=null&&(i>s&&(i=s),o<s&&(o=s))}else{while(++n<r&&((i=o=t.call(e,e[n],n))==null||i!=i))i=undefined;while(++n<r)(s=t.call(e,e[n],n))!=null&&(i>s&&(i=s),o<s&&(o=s))}return[i,o]},d3.random={normal:function(e,t){var n=arguments.length;return n<2&&(t=1),n<1&&(e=0),function(){var n,r,i;do n=Math.random()*2-1,r=Math.random()*2-1,i=n*n+r*r;while(!i||i>1);return e+t*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(e,t){var n=arguments.length;n<2&&(t=1),n<1&&(e=0);var r=d3.random.normal();return function(){return Math.exp(e+t*r())}},irwinHall:function(e){return function(){for(var t=0,n=0;n<e;n++)t+=Math.random();return t/e}}},d3.sum=function(e,t){var n=0,r=e.length,i,s=-1;if(arguments.length===1)while(++s<r)isNaN(i=+e[s])||(n+=i);else while(++s<r)isNaN(i=+t.call(e,e[s],s))||(n+=i);return n},d3.quantile=function(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],s=n-r;return s?i+s*(e[r]-i):i},d3.shuffle=function(e){var t=e.length,n,r;while(t)r=Math.random()*t--|0,n=e[t],e[t]=e[r],e[r]=n;return e},d3.transpose=function(e){return d3.zip.apply(d3,e)},d3.zip=function(){if(!(i=arguments.length))return[];for(var e=-1,t=d3.min(arguments,c),n=new Array(t);++e<t;)for(var r=-1,i,s=n[e]=new Array(i);++r<i;)s[r]=arguments[r][e];return n},d3.bisector=function(e){return{left:function(t,n,r,i){arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);while(r<i){var s=r+i>>>1;e.call(t,t[s],s)<n?r=s+1:i=s}return r},right:function(t,n,r,i){arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);while(r<i){var s=r+i>>>1;n<e.call(t,t[s],s)?i=s:r=s+1}return r}}};var wr=d3.bisector(function(e){return e});d3.bisectLeft=wr.left,d3.bisect=d3.bisectRight=wr.right,d3.nest=function(){function e(t,i){if(i>=r.length)return u?u.call(n,t):o?t.sort(o):t;var a=-1,f=t.length,l=r[i++],c,h,p=new s,d,v={};while(++a<f)(d=p.get(c=l(h=t[a])))?d.push(h):p.set(c,[h]);return p.forEach(function(t,n){v[t]=e(n,i)}),v}function t(e,n){if(n>=r.length)return e;var s=[],o=i[n++],u;for(u in e)s.push({key:u,values:t(e[u],n)});return o&&s.sort(function(e,t){return o(e.key,t.key)}),s}var n={},r=[],i=[],o,u;return n.map=function(t){return e(t,0)},n.entries=function(n){return t(e(n,0),0)},n.key=function(e){return r.push(e),n},n.sortKeys=function(e){return i[r.length-1]=e,n},n.sortValues=function(e){return o=e,n},n.rollup=function(e){return u=e,n},n},d3.keys=function(e){var t=[];for(var n in e)t.push(n);return t},d3.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},d3.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},d3.permute=function(e,t){var n=[],r=-1,i=t.length;while(++r<i)n[r]=e[t[r]];return n},d3.merge=function(e){return Array.prototype.concat.apply([],e)},d3.range=function(e,t,n){arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0));if((t-e)/n===Infinity)throw new Error("infinite range");var r=[],i=p(Math.abs(n)),s=-1,o;e*=i,t*=i,n*=i;if(n<0)while((o=e+n*++s)>t)r.push(o/i);else while((o=e+n*++s)<t)r.push(o/i);return r},d3.requote=function(e){return e.replace(Er,"\\$&")};var Er=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},d3.xhr=function(e,t,n){function r(){var e=f.status;!e&&f.responseText||e>=200&&e<300||e===304?s.load.call(i,a.call(i,f)):s.error.call(i,f)}var i={},s=d3.dispatch("progress","load","error"),u={},a=o,f=new(window.XDomainRequest&&/^(http(s)?:)?\/\//.test(e)?XDomainRequest:XMLHttpRequest);return"onload"in f?f.onload=f.onerror=r:f.onreadystatechange=function(){f.readyState>3&&r()},f.onprogress=function(e){var t=d3.event;d3.event=e;try{s.progress.call(i,f)}finally{d3.event=t}},i.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?u[e]:(t==null?delete u[e]:u[e]=t+"",i)},i.mimeType=function(e){return arguments.length?(t=e==null?null:e+"",i):t},i.response=function(e){return a=e,i},["get","post"].forEach(function(e){i[e]=function(){return i.send.apply(i,[e].concat(vr(arguments)))}}),i.send=function(n,r,s){arguments.length===2&&typeof r=="function"&&(s=r,r=null),f.open(n,e,!0),t!=null&&!("accept"in u)&&(u.accept=t+",*/*");if(f.setRequestHeader)for(var o in u)f.setRequestHeader(o,u[o]);return t!=null&&f.overrideMimeType&&f.overrideMimeType(t),s!=null&&i.on("error",s).on("load",function(e){s(null,e)}),f.send(r==null?null:r),i},i.abort=function(){return f.abort(),i},d3.rebind(i,s,"on"),arguments.length===2&&typeof t=="function"&&(n=t,t=null),n==null?i:i.get(d(n))},d3.text=function(){return d3.xhr.apply(d3,arguments).response(v)},d3.json=function(e,t){return d3.xhr(e,"application/json",t).response(m)},d3.html=function(e,t){return d3.xhr(e,"text/html",t).response(g)},d3.xml=function(){return d3.xhr.apply(d3,arguments).response(y)};var Sr={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/"};d3.ns={prefix:Sr,qualify:function(e){var t=e.indexOf(":"),n=e;return t>=0&&(n=e.substring(0,t),e=e.substring(t+1)),Sr.hasOwnProperty(n)?{space:Sr[n],local:e}:e}},d3.dispatch=function(){var e=new b,t=-1,n=arguments.length;while(++t<n)e[arguments[t]]=w(e);return e},b.prototype.on=function(e,t){var n=e.indexOf("."),r="";return n>0&&(r=e.substring(n+1),e=e.substring(0,n)),arguments.length<2?this[e].on(r):this[e].on(r,t)},d3.format=function(e){var t=xr.exec(e),n=t[1]||" ",r=t[2]||">",i=t[3]||"",s=t[4]||"",o=t[5],u=+t[6],a=t[7],f=t[8],l=t[9],c=1,h="",p=!1;f&&(f=+f.substring(1));if(o||n==="0"&&r==="=")o=n="0",r="=",a&&(u-=Math.floor((u-1)/4));switch(l){case"n":a=!0,l="g";break;case"%":c=100,h="%",l="f";break;case"p":c=100,h="%",l="r";break;case"b":case"o":case"x":case"X":s&&(s="0"+l.toLowerCase());case"c":case"d":p=!0,f=0;break;case"s"
:c=-1,l="r"}s==="#"&&(s=""),l=="r"&&!f&&(l="g"),l=Tr.get(l)||S;var d=o&&a;return function(e){if(p&&e%1)return"";var t=e<0||e===0&&1/e<0?(e=-e,"-"):i;if(c<0){var v=d3.formatPrefix(e,f);e=v.scale(e),h=v.symbol}else e*=c;e=l(e,f),!o&&a&&(e=Nr(e));var m=s.length+e.length+(d?0:t.length),g=m<u?(new Array(m=u-m+1)).join(n):"";return d&&(e=Nr(g+e)),sr&&e.replace(".",sr),t+=s,(r==="<"?t+e+g:r===">"?g+t+e:r==="^"?g.substring(0,m>>=1)+t+e+g.substring(m):t+(d?e:g+e))+h}};var xr=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,Tr=d3.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(e,t){return d3.round(e,t=E(e,t)).toFixed(Math.max(0,Math.min(20,t)))}}),Nr=o;if(ur){var Cr=ur.length;Nr=function(e){var t=e.lastIndexOf("."),n=t>=0?"."+e.substring(t+1):(t=e.length,""),r=[],i=0,s=ur[0];while(t>0&&s>0)r.push(e.substring(t-=s,t+s)),s=ur[i=(i+1)%Cr];return r.reverse().join(or||"")+n}}var kr=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(x);d3.formatPrefix=function(e,t){var n=0;return e&&(e<0&&(e*=-1),t&&(e=d3.round(e,E(e,t))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,Math.floor((n<=0?n+1:n-1)/3)*3))),kr[8+n/3]};var Lr=function(){return o},Ar=d3.map({linear:Lr,poly:O,quad:function(){return k},cubic:function(){return L},sin:function(){return M},exp:function(){return _},circle:function(){return D},elastic:P,back:H,bounce:function(){return B}}),Or=d3.map({"in":o,out:N,"in-out":C,"out-in":function(e){return C(N(e))}});d3.ease=function(e){var t=e.indexOf("-"),n=t>=0?e.substring(0,t):e,r=t>=0?e.substring(t+1):"in";return n=Ar.get(n)||Lr,r=Or.get(r)||o,T(r(n.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.transform=function(e){var t=document.createElementNS(d3.ns.prefix.svg,"g");return(d3.transform=function(e){t.setAttribute("transform",e);var n=t.transform.baseVal.consolidate();return new q(n?n.matrix:Mr)})(e)},q.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Mr={a:1,b:0,c:0,d:1,e:0,f:0};d3.interpolate=function(e,t){var n=d3.interpolators.length,r;while(--n>=0&&!(r=d3.interpolators[n](e,t)));return r},d3.interpolateNumber=function(e,t){return t-=e,function(n){return e+t*n}},d3.interpolateRound=function(e,t){return t-=e,function(n){return Math.round(e+t*n)}},d3.interpolateString=function(e,t){var n,r,i,s=0,o=0,u=[],a=[],f,l;_r.lastIndex=0;for(r=0;n=_r.exec(t);++r)n.index&&u.push(t.substring(s,o=n.index)),a.push({i:u.length,x:n[0]}),u.push(null),s=_r.lastIndex;s<t.length&&u.push(t.substring(s));for(r=0,f=a.length;(n=_r.exec(e))&&r<f;++r){l=a[r];if(l.x==n[0]){if(l.i)if(u[l.i+1]==null){u[l.i-1]+=l.x,u.splice(l.i,1);for(i=r+1;i<f;++i)a[i].i--}else{u[l.i-1]+=l.x+u[l.i+1],u.splice(l.i,2);for(i=r+1;i<f;++i)a[i].i-=2}else if(u[l.i+1]==null)u[l.i]=l.x;else{u[l.i]=l.x+u[l.i+1],u.splice(l.i+1,1);for(i=r+1;i<f;++i)a[i].i--}a.splice(r,1),f--,r--}else l.x=d3.interpolateNumber(parseFloat(n[0]),parseFloat(l.x))}while(r<f)l=a.pop(),u[l.i+1]==null?u[l.i]=l.x:(u[l.i]=l.x+u[l.i+1],u.splice(l.i+1,1)),f--;return u.length===1?u[0]==null?a[0].x:function(){return t}:function(e){for(r=0;r<f;++r)u[(l=a[r]).i]=l.x(e);return u.join("")}},d3.interpolateTransform=function(e,t){var n=[],r=[],i,s=d3.transform(e),o=d3.transform(t),u=s.translate,a=o.translate,f=s.rotate,l=o.rotate,c=s.skew,h=o.skew,p=s.scale,d=o.scale;return u[0]!=a[0]||u[1]!=a[1]?(n.push("translate(",null,",",null,")"),r.push({i:1,x:d3.interpolateNumber(u[0],a[0])},{i:3,x:d3.interpolateNumber(u[1],a[1])})):a[0]||a[1]?n.push("translate("+a+")"):n.push(""),f!=l?(f-l>180?l+=360:l-f>180&&(f+=360),r.push({i:n.push(n.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(f,l)})):l&&n.push(n.pop()+"rotate("+l+")"),c!=h?r.push({i:n.push(n.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(c,h)}):h&&n.push(n.pop()+"skewX("+h+")"),p[0]!=d[0]||p[1]!=d[1]?(i=n.push(n.pop()+"scale(",null,",",null,")"),r.push({i:i-4,x:d3.interpolateNumber(p[0],d[0])},{i:i-2,x:d3.interpolateNumber(p[1],d[1])})):(d[0]!=1||d[1]!=1)&&n.push(n.pop()+"scale("+d+")"),i=r.length,function(e){var t=-1,s;while(++t<i)n[(s=r[t]).i]=s.x(e);return n.join("")}},d3.interpolateRgb=function(e,t){e=d3.rgb(e),t=d3.rgb(t);var n=e.r,r=e.g,i=e.b,s=t.r-n,o=t.g-r,u=t.b-i;return function(e){return"#"+Q(Math.round(n+s*e))+Q(Math.round(r+o*e))+Q(Math.round(i+u*e))}},d3.interpolateHsl=function(e,t){e=d3.hsl(e),t=d3.hsl(t);var n=e.h,r=e.s,i=e.l,s=t.h-n,o=t.s-r,u=t.l-i;return s>180?s-=360:s<-180&&(s+=360),function(e){return it(n+s*e,r+o*e,i+u*e)+""}},d3.interpolateLab=function(e,t){e=d3.lab(e),t=d3.lab(t);var n=e.l,r=e.a,i=e.b,s=t.l-n,o=t.a-r,u=t.b-i;return function(e){return lt(n+s*e,r+o*e,i+u*e)+""}},d3.interpolateHcl=function(e,t){e=d3.hcl(e),t=d3.hcl(t);var n=e.h,r=e.c,i=e.l,s=t.h-n,o=t.c-r,u=t.l-i;return s>180?s-=360:s<-180&&(s+=360),function(e){return ut(n+s*e,r+o*e,i+u*e)+""}},d3.interpolateArray=function(e,t){var n=[],r=[],i=e.length,s=t.length,o=Math.min(e.length,t.length),u;for(u=0;u<o;++u)n.push(d3.interpolate(e[u],t[u]));for(;u<i;++u)r[u]=e[u];for(;u<s;++u)r[u]=t[u];return function(e){for(u=0;u<o;++u)r[u]=n[u](e);return r}},d3.interpolateObject=function(e,t){var n={},r={},i;for(i in e)i in t?n[i]=W(i)(e[i],t[i]):r[i]=e[i];for(i in t)i in e||(r[i]=t[i]);return function(e){for(i in n)r[i]=n[i](e);return r}};var _r=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(e,t){return t instanceof Array&&d3.interpolateArray(e,t)},function(e,t){return(typeof e=="string"||typeof t=="string")&&d3.interpolateString(e+"",t+"")},function(e,t){return(typeof t=="string"?Pr.has(t)||/^(#|rgb\(|hsl\()/.test(t):t instanceof $)&&d3.interpolateRgb(e,t)},function(e,t){return!isNaN(e=+e)&&!isNaN(t=+t)&&d3.interpolateNumber(e,t)}],$.prototype.toString=function(){return this.rgb()+""},d3.rgb=function(e,t,n){return arguments.length===1?e instanceof K?J(e.r,e.g,e.b):G(""+e,J,it):J(~~e,~~t,~~n)};var Dr=K.prototype=new $;Dr.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,n=this.g,r=this.b,i=30;return!t&&!n&&!r?J(i,i,i):(t&&t<i&&(t=i),n&&n<i&&(n=i),r&&r<i&&(r=i),J(Math.min(255,Math.floor(t/e)),Math.min(255,Math.floor(n/e)),Math.min(255,Math.floor(r/e))))},Dr.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),J(Math.floor(e*this.r),Math.floor(e*this.g),Math.floor(e*this.b))},Dr.hsl=function(){return Y(this.r,this.g,this.b)},Dr.toString=function(){return"#"+Q(this.r)+Q(this.g)+Q(this.b)};var Pr=d3.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});Pr.forEach(function(e,t){Pr.set(e,G(t,J,it))}),d3.hsl=function(e,t,n){return arguments.length===1?e instanceof rt?nt(e.h,e.s,e.l):G(""+e,Y,nt):nt(+e,+t,+n)};var Hr=rt.prototype=new $;Hr.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),nt(this.h,this.s,this.l/e)},Hr.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),nt(this.h,this.s,e*this.l)},Hr.rgb=function(){return it(this.h,this.s,this.l)},d3.hcl=function(e,t,n){return arguments.length===1?e instanceof ot?st(e.h,e.c,e.l):e instanceof ft?ct(e.l,e.a,e.b):ct((e=Z((e=d3.rgb(e)).r,e.g,e.b)).l,e.a,e.b):st(+e,+t,+n)};var Br=ot.prototype=new $;Br.brighter=function(e){return st(this.h,this.c,Math.min(100,this.l+jr*(arguments.length?e:1)))},Br.darker=function(e){return st(this.h,this.c,Math.max(0,this.l-jr*(arguments.length?e:1)))},Br.rgb=function(){return ut(this.h,this.c,this.l).rgb()},d3.lab=function(e,t,n){return arguments.length===1?e instanceof ft?at(e.l,e.a,e.b):e instanceof ot?ut(e.l,e.c,e.h):Z((e=d3.rgb(e)).r,e.g,e.b):at(+e,+t,+n)};var jr=18,Fr=.95047,Ir=1,qr=1.08883,Rr=ft.prototype=new $;Rr.brighter=function(e){return at(Math.min(100,this.l+jr*(arguments.length?e:1)),this.a,this.b)},Rr.darker=function(e){return at(Math.max(0,this.l-jr*(arguments.length?e:1)),this.a,this.b)},Rr.rgb=function(){return lt(this.l,this.a,this.b)};var Ur=function(e,t){return t.querySelector(e)},zr=function(e,t){return t.querySelectorAll(e)},Wr=document.documentElement,Xr=Wr.matchesSelector||Wr.webkitMatchesSelector||Wr.mozMatchesSelector||Wr.msMatchesSelector||Wr.oMatchesSelector,Vr=function(e,t){return Xr.call(e,t)};typeof Sizzle=="function"&&(Ur=function(e,t){return Sizzle(e,t)[0]||null},zr=function(e,t){return Sizzle.uniqueSort(Sizzle(e,t))},Vr=Sizzle.matchesSelector);var $r=[];d3.selection=function(){return Jr},d3.selection.prototype=$r,$r.select=function(e){var t=[],n,r,i,s;typeof e!="function"&&(e=mt(e));for(var o=-1,u=this.length;++o<u;){t.push(n=[]),n.parentNode=(i=this[o]).parentNode;for(var a=-1,f=i.length;++a<f;)(s=i[a])?(n.push(r=e.call(s,s.__data__,a)),r&&"__data__"in s&&(r.__data__=s.__data__)):n.push(null)}return vt(t)},$r.selectAll=function(e){var t=[],n,r;typeof e!="function"&&(e=gt(e));for(var i=-1,s=this.length;++i<s;)for(var o=this[i],u=-1,a=o.length;++u<a;)if(r=o[u])t.push(n=vr(e.call(r,r.__data__,u))),n.parentNode=r;return vt(t)},$r.attr=function(e,t){if(arguments.length<2){if(typeof e=="string"){var n=this.node();return e=d3.ns.qualify(e),e.local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(t in e)this.each(yt(t,e[t]));return this}return this.each(yt(e,t))},$r.classed=function(e,t){if(arguments.length<2){if(typeof e=="string"){var n=this.node(),r=(e=e.trim().split(/^|\s+/g)).length,i=-1;if(t=n.classList){while(++i<r)if(!t.contains(e[i]))return!1}else{t=n.className,t.baseVal!=null&&(t=t.baseVal);while(++i<r)if(!bt(e[i]).test(t))return!1}return!0}for(t in e)this.each(wt(t,e[t]));return this}return this.each(wt(e,t))},$r.style=function(e,t,n){var r=arguments.length;if(r<3){if(typeof e!="string"){r<2&&(t="");for(n in e)this.each(St(n,e[n],t));return this}if(r<2)return getComputedStyle(this.node(),null).getPropertyValue(e);n=""}return this.each(St(e,t,n))},$r.property=function(e,t){if(arguments.length<2){if(typeof e=="string")return this.node()[e];for(t in e)this.each(xt(t,e[t]));return this}return this.each(xt(e,t))},$r.text=function(e){return arguments.length?this.each(typeof e=="function"?function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}:e==null?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},$r.html=function(e){return arguments.length?this.each(typeof e=="function"?function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}:e==null?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},$r.append=function(e){function t(){return this.appendChild(document.createElementNS(this.namespaceURI,e))}function n(){return this.appendChild(document.createElementNS(e.space,e.local))}return e=d3.ns.qualify(e),this.select(e.local?n:t)},$r.insert=function(e,t){function n(){return this.insertBefore(document.createElementNS(this.namespaceURI,e),Ur(t,this))}function r(){return this.insertBefore(document.createElementNS(e.space,e.local),Ur(t,this))}return e=d3.ns.qualify(e),this.select(e.local?r:n)},$r.remove=function(){return this.each(function(){var e=this.parentNode;e&&e.removeChild(this)})},$r.data=function(e,t){function n(e,n){var r,i=e.length,o=n.length,u=Math.min(i,o),c=Math.max(i,o),h=[],p=[],d=[],v,m;if(t){var g=new s,y=[],b,w=n.length;for(r=-1;++r<i;)b=t.call(v=e[r],v.__data__,r),g.has(b)?d[w++]=v:g.set(b,v),y.push(b);for(r=-1;++r<o;)b=t.call(n,m=n[r],r),g.has(b)?(h[r]=v=g.get(b),v.__data__=m,p[r]=d[r]=null):(p[r]=Tt(m),h[r]=d[r]=null),g.remove(b);for(r=-1;++r<i;)g.has(y[r])&&(d[r]=e[r])}else{for(r=-1;++r<u;)v=e[r],m=n[r],v?(v.__data__=m,h[r]=v,p[r]=d[r]=null):(p[r]=Tt(m),h[r]=d[r]=null);for(;r<o;++r)p[r]=Tt(n[r]),h[r]=d[r]=null;for(;r<c;++r)d[r]=e[r],p[r]=h[r]=null}p.update=h,p.parentNode=h.parentNode=d.parentNode=e.parentNode,a.push(p),f.push(h),l.push(d)}var r=-1,i=this.length,o,u;if(!arguments.length){e=new Array(i=(o=this[0]).length);while(++r<i)if(u=o[r])e[r]=u.__data__;return e}var a=At([]),f=vt([]),l=vt([]);if(typeof e=="function")while(++r<i)n(o=this[r],e.call(o,o.parentNode.__data__,r));else while(++r<i)n(o=this[r],e);return f.enter=function(){return a},f.exit=function(){return l},f},$r.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},$r.filter=function(e){var t=[],n,r,i;typeof e!="function"&&(e=Nt(e));for(var s=0,o=this.length;s<o;s++){t.push(n=[]),n.parentNode=(r=this[s]).parentNode;for(var u=0,a=r.length;u<a;u++)(i=r[u])&&e.call(i,i.__data__,u)&&n.push(i)}return vt(t)},$r.order=function(){for(var e=-1,t=this.length;++e<t;)for(var n=this[e],r=n.length-1,i=n[r],s;--r>=0;)if(s=n[r])i&&i!==s.nextSibling&&i.parentNode.insertBefore(s,i),i=s;return this},$r.sort=function(e){e=Ct.apply(this,arguments);for(var t=-1,n=this.length;++t<n;)this[t].sort(e);return this.order()},$r.on=function(e,t,n){var r=arguments.length;if(r<3){if(typeof e!="string"){r<2&&(t=!1);for(n in e)this.each(kt(n,e[n],t));return this}if(r<2)return(r=this.node()["__on"+e])&&r._;n=!1}return this.each(kt(e,t,n))},$r.each=function(e){return Lt(this,function(t,n,r){e.call(t,t.__data__,n,r)})},$r.call=function(e){var t=vr(arguments);return e.apply(t[0]=this,t),this},$r.empty=function(){return!this.node()},$r.node=function(){for(var e=0,t=this.length;e<t;e++)for(var n=this[e],r=0,i=n.length;r<i;r++){var s=n[r];if(s)return s}return null},$r.transition=function(){var e=Yr||++Gr,t=[],n,r,i=Object.create(Zr);i.time=Date.now();for(var s=-1,o=this.length;++s<o;){t.push(n=[]);for(var u=this[s],a=-1,f=u.length;++a<f;)(r=u[a])&&Mt(r,a,e,i),n.push(r)}return Ot(t,e)};var Jr=vt([[document]]);Jr[0].parentNode=Wr,d3.select=function(e){return typeof e=="string"?Jr.select(e):vt([[e]])},d3.selectAll=function(e){return typeof e=="string"?Jr.selectAll(e):vt([vr(e)])};var Kr=[];d3.selection.enter=At,d3.selection.enter.prototype=Kr,Kr.append=$r.append,Kr.insert=$r.insert,Kr.empty=$r.empty,Kr.node=$r.node,Kr.select=function(e){var t=[],n,r,i,s,o;for(var u=-1,a=this.length;++u<a;){i=(s=this[u]).update,t.push(n=[]),n.parentNode=s.parentNode;for(var f=-1,l=s.length;++f<l;)(o=s[f])?(n.push(i[f]=r=e.call(s.parentNode,o.__data__,f)),r.__data__=o.__data__):n.push(null)}return vt(t)};var Qr=[],Gr=0,Yr,Zr={ease:A,delay:0,duration:250};Qr.call=$r.call,Qr.empty=$r.empty,Qr.node=$r.node,d3.transition=function(e){return arguments.length?Yr?e.transition():e:Jr.transition()},d3.transition.prototype=Qr,Qr.select=function(e){var t=this.id,n=[],r,i,s;typeof e!="function"&&(e=mt(e));for(var o=-1,u=this.length;++o<u;){n.push(r=[]);for(var a=this[o],f=-1,l=a.length;++f<l;)(s=a[f])&&(i=e.call(s,s.__data__,f))?("__data__"in s&&(i.__data__=s.__data__),Mt(i,f,t,s.__transition__[t]),r.push(i)):r.push(null)}return Ot(n,t)},Qr.selectAll=function(e){var t=this.id,n=[],r,i,s,o,u;typeof e!="function"&&(e=gt(e));for(var a=-1,f=this.length;++a<f;)for(var l=this[a],c=-1,h=l.length;++c<h;)if(s=l[c]){u=s.__transition__[t],i=e.call(s,s.__data__,c),n.push(r=[]);for(var p=-1,d=i.length;++p<d;)Mt(o=i[p],p,t,u),r.push(o)}return Ot(n,t)},Qr.filter=function(e){var t=[],n,r,i;typeof e!="function"&&(e=Nt(e));for(var s=0,o=this.length;s<o;s++){t.push(n=[]);for(var r=this[s],u=0,a=r.length;u<a;u++)(i=r[u])&&e.call(i,i.__data__,u)&&n.push(i)}return Ot(t,this.id,this.time).ease(this.ease())},Qr.attr=function(e,t){function n(){this.removeAttribute(s)}function r(){this.removeAttributeNS(s.space,s.local)}if(arguments.length<2){for(t in e)this.attr(t,e[t]);return this}var i=W(e),s=d3.ns.qualify(e);return Dt(this,"attr."+e,t,function(e){function t(){var t=this.getAttribute(s),n;return t!==e&&(n=i(t,e),function(e){this.setAttribute(s,n(e))})}function o(){var t=this.getAttributeNS(s.space,s.local),n;return t!==e&&(n=i(t,e),function(e){this.setAttributeNS(s.space,s.local,n(e))})}return e==null?s.local?r:n:(e+="",s.local?o:t)})},Qr.attrTween=function(e,t){function n(e,n){var r=t.call(this,e,n,this.getAttribute(i));return r&&function(e){this.setAttribute(i,r(e))}}function r(e,n){var r=t.call(this,e,n,this.getAttributeNS(i.space,i.local));return r&&function(e){this.setAttributeNS(i.space,i.local,r(e))}}var i=d3.ns.qualify(e);return this.tween("attr."+e,i.local?r:n)},Qr.style=function(e,t,n){function r(){this.style.removeProperty(e)}var i=arguments.length;if(i<3){if(typeof e!="string"){i<2&&(t="");for(n in e)this.style(n,e[n],t);return this}n=""}var s=W(e);return Dt(this,"style."+e,t,function(t){function i(){var r=getComputedStyle(this,null).getPropertyValue(e),i;return r!==t&&(i=s(r,t),function(t){this.style.setProperty(e,i(t),n)})}return t==null?r:(t+="",i)})},Qr.styleTween=function(e,t,n){return arguments.length<3&&(n=""),this.tween("style."+e,function(r,i){var s=t.call(this,r,i,getComputedStyle(this,null).getPropertyValue(e));return s&&function(t){this.style.setProperty(e,s(t),n)}})},Qr.text=function(e){return Dt(this,"text",e,_t)},Qr.remove=function(){return this.each("end.transition",function(){var e;!this.__transition__&&(e=this.parentNode)&&e.removeChild(this)})},Qr.ease=function(e){var t=this.id;return arguments.length<1?this.node().__transition__[t].ease:(typeof e!="function"&&(e=d3.ease.apply(d3,arguments)),Lt(this,function(n){n.__transition__[t].ease=e}))},Qr.delay=function(e){var t=this.id;return Lt(this,typeof e=="function"?function(n,r,i){n.__transition__[t].delay=e.call(n,n.__data__,r,i)|0}:(e|=0,function(n){n.__transition__[t].delay=e}))},Qr.duration=function(e){var t=this.id;return Lt(this,typeof e=="function"?function(n,r,i){n.__transition__[t].duration=Math.max(1,e.call(n,n.__data__,r,i)|0)}:(e=Math.max(1,e|0),function(n){n.__transition__[t].duration=e}))},Qr.each=function(e,t){var n=this.id;if(arguments.length<2){var r=Zr,i=Yr;Yr=n,Lt(this,function(t,r,i){Zr=t.__transition__[n],e.call(t,t.__data__,r,i)}),Zr=r,Yr=i}else Lt(this,function(r){r.__transition__[n].event.on(e,t)});return this},Qr.transition=function(){var e=this.id,t=++Gr,n=[],r,i,s,o;for(var u=0,a=this.length;u<a;u++){n.push(r=[]);for(var i=this[u],f=0,l=i.length;f<l;f++){if(s=i[f])o=Object.create(s.__transition__[e]),o.delay+=o.duration,Mt(s,f,t,o);r.push(s)}}return Ot(n,t)},Qr.tween=function(e,t){var n=this.id;return arguments.length<2?this.node().__transition__[n].tween.get(e):Lt(this,t==null?function(t){t.__transition__[n].tween.remove(e)}:function(r){r.__transition__[n].tween.set(e,t)})};var ei=0,ti={},ni=null,ri,ii;d3.timer=function(e,t,n){if(arguments.length<3){if(arguments.length<2)t=0;else if(!isFinite(t))return;n=Date.now()}var r=ti[e.id];r&&r.callback===e?(r.then=n,r.delay=t):ti[e.id=++ei]=ni={callback:e,then:n,delay:t,next:ni},ri||(ii=clearTimeout(ii),ri=1,si(Pt))},d3.timer.flush=function(){var e,t=Date.now(),n=ni;while(n)e=t-n.then,n.delay||(n.flush=n.callback(e)),n=n.next;Ht()};var si=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,17)};d3.mouse=function(e){return Bt(e,F())};var oi=/WebKit/.test(navigator.userAgent)?-1:0;d3.touches=function(e,t){return arguments.length<2&&(t=F().touches),t?vr(t).map(function(t){var n=Bt(e,t);return n.identifier=t.identifier,n}):[]},d3.scale={},d3.scale.linear=function(){return Ut([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return Qt(d3.scale.linear(),Gt)};var ui=d3.format(".0e");Gt.pow=function(e){return Math.pow(10,e)},Yt.pow=function(e){return-Math.pow(10,-e)},d3.scale.pow=function(){return Zt(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return tn([],{t:"range",a:[[]]})},d3.scale.category10=function(){return d3.scale.ordinal().range(ai)},d3.scale.category20=function(){return d3.scale.ordinal().range(fi)},d3.scale.category20b=function(){return d3.scale.ordinal().range(li)},d3.scale.category20c=function(){return d3.scale.ordinal().range(ci)};var ai=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],fi=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],li=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],ci=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return nn([],[])},d3.scale.quantize=function(){return rn(0,1,[0,1])},d3.scale.threshold=function(){return sn([.5],[0,1])},d3.scale.identity=function(){return on([0,1])},d3.layout={},d3.layout.bundle=function(){return function(e){var t=[],n=-1,r=e.length;while(++n<r)t.push(un(e[n]));return t}},d3.layout.chord=function(){function e(){var e={},n=[],c=d3.range(o),h=[],p,d,v,m,g;r=[],i=[],p=0,m=-1;while(++m<o){d=0,g=-1;while(++g<o)d+=s[m][g];n.push(d),h.push(d3.range(o)),p+=d}a&&c.sort(function(e,t){return a(n[e],n[t])}),f&&h.forEach(function(e,t){e.sort(function(e,n){return f(s[t][e],s[t][n])})}),p=(2*cr-u*o)/p,d=0,m=-1;while(++m<o){v=d,g=-1;while(++g<o){var y=c[m],b=h[y][g],w=s[y][b],E=d,S=d+=w*p;e[y+"-"+b]={index:y,subindex:b,startAngle:E,endAngle:S,value:w}}i[y]={index:y,startAngle:v,endAngle:d,value:(d-v)/p},d+=u}m=-1;while(++m<o){g=m-1;while(++g<o){var x=e[m+"-"+g],T=e[g+"-"+m];(x.value||T.value)&&r.push(x.value<T.value?{source:T,target:x}:{source:x,target:T})}}l&&t()}function t(){r.sort(function(e,t){return l((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)})}var n={},r,i,s,o,u=0,a,f,l;return n.matrix=function(e){return arguments.length?(o=(s=e)&&s.length,r=i=null,n):s},n.padding=function(e){return arguments.length?(u=e,r=i=null,n):u},n.sortGroups=function(e){return arguments.length?(a=e,r=i=null,n):a},n.sortSubgroups=function(e){return arguments.length?(f=e,r=null,n):f},n.sortChords=function(e){return arguments.length?(l=e,r&&t(),n):l},n.chords=function(){return r||e(),r},n.groups=function(){return i||e(),i},n},d3.layout.force=function(){function e(e){return function(t,n,r,i){if(t.point!==e){var s=t.cx-e.x,o=t.cy-e.y,u=1/Math.sqrt(s*s+o*o);if((i-n)*u<d){var a=t.charge*u*u;return e.px-=s*a,e.py-=o*a,!0}if(t.point&&isFinite(u)){var a=t.pointCharge*u*u;e.px-=s*a,e.py-=o*a}}return!t.charge}}function t(e){e.px=d3.event.x,e.py=d3.event.y,n.resume()}var n={},r=d3.dispatch("start","tick","end"),i=[1,1],s,u,f=.9,l=vn,c=mn,h=-30,p=.1,d=.8,v=[],m=[],g,y,b;return n.tick=function(){if((u*=.99)<.005)return r.end({type:"end",alpha:u=0}),!0;var t=v.length,n=m.length,s,o,a,l,c,d,w,E,S;for(o=0;o<n;++o){a=m[o],l=a.source,c=a.target,E=c.x-l.x,S=c.y-l.y;if(d=E*E+S*S)d=u*y[o]*((d=Math.sqrt(d))-g[o])/d,E*=d,S*=d,c.x-=E*(w=l.weight/(c.weight+l.weight)),c.y-=S*w,l.x+=E*(w=1-w),l.y+=S*w}if(w=u*p){E=i[0]/2,S=i[1]/2,o=-1;if(w)while(++o<t)a=v[o],a.x+=(E-a.x)*w,a.y+=(S-a.y)*w}if(h){dn(s=d3.geom.quadtree(v),u,b),o=-1;while(++o<t)(a=v[o]).fixed||s.visit(e(a))}o=-1;while(++o<t)a=v[o],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*f,a.y-=(a.py-(a.py=a.y))*f);r.tick({type:"tick",alpha:u})},n.nodes=function(e){return arguments.length?(v=e,n):v},n.links=function(e){return arguments.length?(m=e,n):m},n.size=function(e){return arguments.length?(i=e,n):i},n.linkDistance=function(e){return arguments.length?(l=a(e),n):l},n.distance=n.linkDistance,n.linkStrength=function(e){return arguments.length?(c=a(e),n):c},n.friction=function(e){return arguments.length?(f=e,n):f},n.charge=function(e){return arguments.length?(h=typeof e=="function"?e:+e,n):h},n.gravity=function(e){return arguments.length?(p=e,n):p},n.theta=function(e){return arguments.length?(d=e,n):d},n.alpha=function(e){return arguments.length?(u?e>0?u=e:u=0:e>0&&(r.start({type:"start",alpha:u=e}),d3.timer(n.tick)),n):u},n.start=function(){function e(e,n){var i=t(r),s=-1,o=i.length,u;while(++s<o)if(!isNaN(u=i[s][e]))return u;return Math.random()*n}function t(){if(!p){p=[];for(s=0;s<o;++s)p[s]=[];for(s=0;s<u;++s){var e=m[s];p[e.source.index].push(e.target),p[e.target.index].push(e.source)}}return p[r]}var r,s,o=v.length,u=m.length,a=i[0],f=i[1],p,d;for(r=0;r<o;++r)(d=v[r]).index=r,d.weight=0;g=[],y=[];for(r=0;r<u;++r)d=m[r],typeof d.source=="number"&&(d.source=v[d.source]),typeof d.target=="number"&&(d.target=v[d.target]),g[r]=l.call(this,d,r),y[r]=c.call(this,d,r),++d.source.weight,++d.target.weight;for(r=0;r<o;++r)d=v[r],isNaN(d.x)&&(d.x=e("x",a)),isNaN(d.y)&&(d.y=e("y",f)),isNaN(d.px)&&(d.px=d.x),isNaN(d.py)&&(d.py=d.y);b=[];if(typeof h=="function")for(r=0;r<o;++r)b[r]=+h.call(this,v[r],r);else for(r=0;r<o;++r)b[r]=h;return n.resume()},n.resume=function(){return n.alpha(.1)},n.stop=function(){return n.alpha(0)},n.drag=function(){s||(s=d3.behavior.drag().origin(o).on("dragstart",ln).on("drag",t).on("dragend",cn)),this.on("mouseover.force",hn).on("mouseout.force",pn).call(s)},d3.rebind(n,r,"on")},d3.layout.partition=function(){function e(t,n,r,i){var s=t.children;t.x=n,t.y=t.depth*i,t.dx=r,t.dy=i;if(s&&(u=s.length)){var o=-1,u,a,f;r=t.value?r/t.value:0;while(++o<u)e(a=s[o],n,f=a.value*r,i),n+=f}}function t(e){var n=e.children,r=0;if(n&&(s=n.length)){var i=-1,s;while(++i<s)r=Math.max(r,t(n[i]))}return 1+r}function n(n,s){var o=r.call(this,n,s);return e(o[0],0,i[0],i[1]/t(o[0])),o}var r=d3.layout.hierarchy(),i=[1,1];return n.size=function(e){return arguments.length?(i=e,n):i},Ln(n,r)},d3.layout.pie=function(){function e(s){var o=s.map(function(n,r){return+t.call(e,n,r)}),u=+(typeof r=="function"?r.apply(this,arguments):r),a=((typeof i=="function"?i.apply(this,arguments):i)-r)/d3.sum(o),f=d3.range(s.length);n!=null&&f.sort(n===hi?function(e,t){return o[t]-o[e]}:function(e,t){return n(s[e],s[t])});var l=[];return f.forEach(function(e){var t;l[e]={data:s[e],value:t=o[e],startAngle:u,endAngle:u+=t*a}}),l}var t=Number,n=hi,r=0,i=2*cr;return e.value=function(n){return arguments.length?(t=n,e):t},e.sort=function(t){return arguments.length?(n=t,e):n},e.startAngle=function(t){return arguments.length?(r=t,e):r},e.endAngle=function(t){return arguments.length?(i=t,e):i},e};var hi={};d3.layout.stack=function(){function e(o,a){var f=o.map(function(n,r){return t.call(e,n,r)}),l=f.map(function(t){return t.map(function(t,n){return[s.call(e,t,n),u.call(e,t,n)]})}),c=n.call(e,l,a);f=d3.permute(f,c),l=d3.permute(l,c);var h=r.call(e,l,a),p=f.length,d=f[0].length,v,m,g;for(m=0;m<d;++m){i.call(e,f[0][m],g=h[m],l[0][m][1]);for(v=1;v<p;++v)i.call(e,f[v][m],g+=l[v-1][m][1],l[v][m][1])}return o}var t=o,n=wn,r=En,i=bn,s=gn,u=yn;return e.values=function(n){return arguments.length?(t=n,e):t},e.order=function(t){return arguments.length?(n=typeof t=="function"?t:pi.get(t)||wn,e):n},e.offset=function(t){return arguments.length?(r=typeof t=="function"?t:di.get(t)||En,e):r},e.x=function(t){return arguments.length?(s=t,e):s},e.y=function(t){return arguments.length?(u=t,e):u},e.out=function(t){return arguments.length?(i=t,e):i},e};var pi=d3.map({"inside-out":function(e){var t=e.length,n,r,i=e.map(Sn),s=e.map(xn),o=d3.range(t).sort(function(e,t){return i[e]-i[t]}),u=0,a=0,f=[],l=[];for(n=0;n<t;++n)r=o[n],u<a?(u+=s[r],f.push(r)):(a+=s[r],l.push(r));return l.reverse().concat(f)},reverse:function(e){return d3.range(e.length).reverse()},"default":wn}),di=d3.map({silhouette:function(e){var t=e.length,n=e[0].length,r=[],i=0,s,o,u,a=[];for(o=0;o<n;++o){for(s=0,u=0;s<t;s++)u+=e[s][o][1];u>i&&(i=u),r.push(u)}for(o=0;o<n;++o)a[o]=(i-r[o])/2;return a},wiggle:function(e){var t=e.length,n=e[0],r=n.length,i,s,o,u,a,f,l,c,h,p=[];p[0]=c=h=0;for(s=1;s<r;++s){for(i=0,u=0;i<t;++i)u+=e[i][s][1];for(i=0,a=0,l=n[s][0]-n[s-1][0];i<t;++i){for(o=0,f=(e[i][s][1]-e[i][s-1][1])/(2*l);o<i;++o)f+=(e[o][s][1]-e[o][s-1][1])/l;a+=f*e[i][s][1]}p[s]=c-=u?a/u*l:0,c<h&&(h=c)}for(s=0;s<r;++s)p[s]-=h;return p},expand:function(e){var t=e.length,n=e[0].length,r=1/t,i,s,o,u=[];for(s=0;s<n;++s){for(i=0,o=0;i<t;i++)o+=e[i][s][1];if(o)for(i=0;i<t;i++)e[i][s][1]/=o;else for(i=0;i<t;i++)e[i][s][1]=r}for(s=0;s<n;++s)u[s]=0;return u},zero:En});d3.layout.histogram=function(){function e(e,s){var o=[],u=e.map(n,this),a=r.call(this,u,s),f=i.call(this,a,u,s),l,s=-1,c=u.length,h=f.length-1,p=t?1:1/c,d;while(++s<h)l=o[s]=[],l.dx=f[s+1]-(l.x=f[s]),l.y=0;if(h>0){s=-1;while(++s<c)d=u[s],d>=a[0]&&d<=a[1]&&(l=o[d3.bisect(f,d,1,h)-1],l.y+=p,l.push(e[s]))}return o}var t=!0,n=Number,r=kn,i=Nn;return e.value=function(t){return arguments.length?(n=t,e):n},e.range=function(t){return arguments.length?(r=a(t),e):r},e.bins=function(t){return arguments.length?(i=typeof t=="number"?function(e){return Cn(e,t)}:a(t),e):i},e.frequency=function(n){return arguments.length?(t=!!n,e):t},e},d3.layout.hierarchy=function(){function e(t,o,u){var a=i.call(n,t,o);t.depth=o,u.push(t);if(a&&(l=a.length)){var f=-1,l,c=t.children=[],h=0,p=o+1,d;while(++f<l)d=e(a[f],p,u),d.parent=t,c.push(d),h+=d.value;r&&c.sort(r),s&&(t.value=h)}else s&&(t.value=+s.call(n,t,o)||0);return t}function t(e,r){var i=e.children,o=0;if(i&&(a=i.length)){var u=-1,a,f=r+1;while(++u<a)o+=t(i[u],f)}else s&&(o=+s.call(n,e,r)||0);return s&&(e.value=o),o}function n(t){var n=[];return e(t,0,n),n}var r=Mn,i=An,s=On;return n.sort=function(e){return arguments.length?(r=e,n):r},n.children=function(e){return arguments.length?(i=e,n):i},n.value=function(e){return arguments.length?(s=e,n):s},n.revalue=function(e){return t(e,0),e},n},d3.layout.pack=function(){function e(e,i){var s=t.call(this,e,i),o=s[0];o.x=0,o.y=0,Zn(o,function(e){e.r=Math.sqrt(e.value)}),Zn(o,jn);var u=r[0],a=r[1],f=Math.max(2*o.r/u,2*o.r/a);if(n>0){var l=n*f/2;Zn(o,function(e){e.r+=l}),Zn(o,jn),Zn(o,function(e){e.r-=l}),f=Math
.max(2*o.r/u,2*o.r/a)}return qn(o,u/2,a/2,1/f),s}var t=d3.layout.hierarchy().sort(Dn),n=0,r=[1,1];return e.size=function(t){return arguments.length?(r=t,e):r},e.padding=function(t){return arguments.length?(n=+t,e):n},Ln(e,t)},d3.layout.cluster=function(){function e(e,i){var s=t.call(this,e,i),o=s[0],u,a=0;Zn(o,function(e){var t=e.children;t&&t.length?(e.x=zn(t),e.y=Un(t)):(e.x=u?a+=n(e,u):0,e.y=0,u=e)});var f=Wn(o),l=Xn(o),c=f.x-n(f,l)/2,h=l.x+n(l,f)/2;return Zn(o,function(e){e.x=(e.x-c)/(h-c)*r[0],e.y=(1-(o.y?e.y/o.y:1))*r[1]}),s}var t=d3.layout.hierarchy().sort(null).value(null),n=Vn,r=[1,1];return e.separation=function(t){return arguments.length?(n=t,e):n},e.size=function(t){return arguments.length?(r=t,e):r},Ln(e,t)},d3.layout.tree=function(){function e(e,i){function s(e,t){var r=e.children,i=e._tree;if(r&&(o=r.length)){var o,a=r[0],f,l=a,c,h=-1;while(++h<o)c=r[h],s(c,f),l=u(c,f,l),f=c;er(e);var p=.5*(a._tree.prelim+c._tree.prelim);t?(i.prelim=t._tree.prelim+n(e,t),i.mod=i.prelim-p):i.prelim=p}else t&&(i.prelim=t._tree.prelim+n(e,t))}function o(e,t){e.x=e._tree.prelim+t;var n=e.children;if(n&&(i=n.length)){var r=-1,i;t+=e._tree.mod;while(++r<i)o(n[r],t)}}function u(e,t,r){if(t){var i=e,s=e,o=t,u=e.parent.children[0],a=i._tree.mod,f=s._tree.mod,l=o._tree.mod,c=u._tree.mod,h;while(o=Jn(o),i=$n(i),o&&i)u=$n(u),s=Jn(s),s._tree.ancestor=e,h=o._tree.prelim+l-i._tree.prelim-a+n(o,i),h>0&&(tr(nr(o,e,r),e,h),a+=h,f+=h),l+=o._tree.mod,a+=i._tree.mod,c+=u._tree.mod,f+=s._tree.mod;o&&!Jn(s)&&(s._tree.thread=o,s._tree.mod+=l-f),i&&!$n(u)&&(u._tree.thread=i,u._tree.mod+=a-c,r=e)}return r}var a=t.call(this,e,i),f=a[0];Zn(f,function(e,t){e._tree={ancestor:e,prelim:0,mod:0,change:0,shift:0,number:t?t._tree.number+1:0}}),s(f),o(f,-f._tree.prelim);var l=Kn(f,Gn),c=Kn(f,Qn),h=Kn(f,Yn),p=l.x-n(l,c)/2,d=c.x+n(c,l)/2,v=h.depth||1;return Zn(f,function(e){e.x=(e.x-p)/(d-p)*r[0],e.y=e.depth/v*r[1],delete e._tree}),a}var t=d3.layout.hierarchy().sort(null).value(null),n=Vn,r=[1,1];return e.separation=function(t){return arguments.length?(n=t,e):n},e.size=function(t){return arguments.length?(r=t,e):r},Ln(e,t)},d3.layout.treemap=function(){function e(e,t){var n=-1,r=e.length,i,s;while(++n<r)s=(i=e[n]).value*(t<0?0:t),i.area=isNaN(s)||s<=0?0:s}function t(n){var s=n.children;if(s&&s.length){var o=l(n),u=[],a=s.slice(),f,c=Infinity,h,d=p==="slice"?o.dx:p==="dice"?o.dy:p==="slice-dice"?n.depth&1?o.dy:o.dx:Math.min(o.dx,o.dy),v;e(a,o.dx*o.dy/n.value),u.area=0;while((v=a.length)>0)u.push(f=a[v-1]),u.area+=f.area,p!=="squarify"||(h=r(u,d))<=c?(a.pop(),c=h):(u.area-=u.pop().area,i(u,d,o,!1),d=Math.min(o.dx,o.dy),u.length=u.area=0,c=Infinity);u.length&&(i(u,d,o,!0),u.length=u.area=0),s.forEach(t)}}function n(t){var r=t.children;if(r&&r.length){var s=l(t),o=r.slice(),u,a=[];e(o,s.dx*s.dy/t.value),a.area=0;while(u=o.pop())a.push(u),a.area+=u.area,u.z!=null&&(i(a,u.z?s.dx:s.dy,s,!o.length),a.length=a.area=0);r.forEach(n)}}function r(e,t){var n=e.area,r,i=0,s=Infinity,o=-1,u=e.length;while(++o<u){if(!(r=e[o].area))continue;r<s&&(s=r),r>i&&(i=r)}return n*=n,t*=t,n?Math.max(t*i*d/n,n/(t*s*d)):Infinity}function i(e,t,n,r){var i=-1,s=e.length,o=n.x,a=n.y,f=t?u(e.area/t):0,l;if(t==n.dx){if(r||f>n.dy)f=n.dy;while(++i<s)l=e[i],l.x=o,l.y=a,l.dy=f,o+=l.dx=Math.min(n.x+n.dx-o,f?u(l.area/f):0);l.z=!0,l.dx+=n.x+n.dx-o,n.y+=f,n.dy-=f}else{if(r||f>n.dx)f=n.dx;while(++i<s)l=e[i],l.x=o,l.y=a,l.dx=f,a+=l.dy=Math.min(n.y+n.dy-a,f?u(l.area/f):0);l.z=!1,l.dy+=n.y+n.dy-a,n.x+=f,n.dx-=f}}function s(r){var i=h||o(r),s=i[0];return s.x=0,s.y=0,s.dx=a[0],s.dy=a[1],h&&o.revalue(s),e([s],s.dx*s.dy/s.value),(h?n:t)(s),c&&(h=i),i}var o=d3.layout.hierarchy(),u=Math.round,a=[1,1],f=null,l=rr,c=!1,h,p="squarify",d=.5*(1+Math.sqrt(5));return s.size=function(e){return arguments.length?(a=e,s):a},s.padding=function(e){function t(t){var n=e.call(s,t,t.depth);return n==null?rr(t):ir(t,typeof n=="number"?[n,n,n,n]:n)}function n(t){return ir(t,e)}if(!arguments.length)return f;var r;return l=(f=e)==null?rr:(r=typeof e)==="function"?t:r==="number"?(e=[e,e,e,e],n):n,s},s.round=function(e){return arguments.length?(u=e?Math.round:Number,s):u!=Number},s.sticky=function(e){return arguments.length?(c=e,h=null,s):c},s.ratio=function(e){return arguments.length?(d=e,s):d},s.mode=function(e){return arguments.length?(p=e+"",s):p},Ln(s,o)}}(),function(e,t,n,r){function i(t){return t[0]&&e.isPlainObject(t[0])?this.data=t[0]:this.el=t,this.isCoords=!0,this.coords={},this.init(),this}var s=i.prototype;s.init=function(){this.set(),this.original_coords=this.get()},s.set=function(e,t){var n=this.el;n&&!e&&(this.data=n.offset(),this.data.width=n.width(),this.data.height=n.height());if(n&&e&&!t){var r=n.offset();this.data.top=r.top,this.data.left=r.left}var i=this.data;return this.coords.x1=i.left,this.coords.y1=i.top,this.coords.x2=i.left+i.width,this.coords.y2=i.top+i.height,this.coords.cx=i.left+i.width/2,this.coords.cy=i.top+i.height/2,this.coords.width=i.width,this.coords.height=i.height,this.coords.el=n||!1,this},s.update=function(t){if(!t&&!this.el)return this;if(t){var n=e.extend({},this.data,t);return this.data=n,this.set(!0,!0)}return this.set(!0),this},s.get=function(){return this.coords},e.fn.coords=function(){if(this.data("coords"))return this.data("coords");var e=new i(this,arguments[0]);return this.data("coords",e),e}}(jQuery,window,document),function(e,t,n,r){function s(t,n,r){this.options=e.extend(i,r),this.$element=t,this.last_colliders=[],this.last_colliders_coords=[],typeof n=="string"||n instanceof jQuery?this.$colliders=e(n,this.options.colliders_context).not(this.$element):this.colliders=e(n),this.init()}var i={colliders_context:n.body},o=s.prototype;o.init=function(){this.find_collisions()},o.overlaps=function(e,t){var n=!1,r=!1;if(t.x1>=e.x1&&t.x1<=e.x2||t.x2>=e.x1&&t.x2<=e.x2||e.x1>=t.x1&&e.x2<=t.x2)n=!0;if(t.y1>=e.y1&&t.y1<=e.y2||t.y2>=e.y1&&t.y2<=e.y2||e.y1>=t.y1&&e.y2<=t.y2)r=!0;return n&&r},o.detect_overlapping_region=function(e,t){var n="",r="";return e.y1>t.cy&&e.y1<t.y2&&(n="N"),e.y2>t.y1&&e.y2<t.cy&&(n="S"),e.x1>t.cx&&e.x1<t.x2&&(r="W"),e.x2>t.x1&&e.x2<t.cx&&(r="E"),n+r||"C"},o.calculate_overlapped_area_coords=function(t,n){var r=Math.max(t.x1,n.x1),i=Math.max(t.y1,n.y1),s=Math.min(t.x2,n.x2),o=Math.min(t.y2,n.y2);return e({left:r,top:i,width:s-r,height:o-i}).coords().get()},o.calculate_overlapped_area=function(e){return e.width*e.height},o.manage_colliders_start_stop=function(t,n,r){var i=this.last_colliders_coords;for(var s=0,o=i.length;s<o;s++)e.inArray(i[s],t)===-1&&n.call(this,i[s]);for(var u=0,a=t.length;u<a;u++)e.inArray(t[u],i)===-1&&r.call(this,t[u])},o.find_collisions=function(t){var n=this,r=[],i=[],s=this.colliders||this.$colliders,o=s.length,u=n.$element.coords().update(t||!1).get();while(o--){var a=n.$colliders?e(s[o]):s[o],f=a.isCoords?a:a.coords(),l=f.get(),c=n.overlaps(u,l);if(!c)continue;var h=n.detect_overlapping_region(u,l);if(h==="C"){var p=n.calculate_overlapped_area_coords(u,l),d=n.calculate_overlapped_area(p),v={area:d,area_coords:p,region:h,coords:l,player_coords:u,el:a};n.options.on_overlap&&n.options.on_overlap.call(this,v),r.push(f),i.push(v)}}return(n.options.on_overlap_stop||n.options.on_overlap_start)&&this.manage_colliders_start_stop(r,n.options.on_overlap_stop,n.options.on_overlap_start),this.last_colliders_coords=r,i},o.get_closest_colliders=function(e){var t=this.find_collisions(e);return t.sort(function(e,t){return e.region==="C"&&t.region==="C"?e.coords.y1<t.coords.y1||e.coords.x1<t.coords.x1?-1:1:e.area<t.area?1:1}),t},e.fn.collision=function(e,t){return new s(this,e,t)}}(jQuery,window,document),function(e,t){e.debounce=function(e,t,n){var r;return function(){var i=this,s=arguments,o=function(){r=null,n||e.apply(i,s)};n&&!r&&e.apply(i,s),clearTimeout(r),r=setTimeout(o,t)}},e.throttle=function(e,t){var n,r,i,s,o,u,a=debounce(function(){o=s=!1},t);return function(){n=this,r=arguments;var f=function(){i=null,o&&e.apply(n,r),a()};return i||(i=setTimeout(f,t)),s?o=!0:u=e.apply(n,r),a(),s=!0,u}}}(window),function(e,t,n,r){function a(t,r){this.options=e.extend({},i,r),this.$body=e(n.body),this.$container=e(t),this.$dragitems=e(this.options.items,this.$container),this.is_dragging=!1,this.player_min_left=0+this.options.offset_left,this.init()}var i={items:".gs_w",distance:1,limit:!0,offset_left:0,autoscroll:!0,ignore_dragging:["INPUT","TEXTAREA","SELECT","BUTTON"],handle:null},s=e(t),o="ontouchstart"in t,u={start:o?"touchstart":"mousedown.draggable",move:o?"touchmove":"mousemove.draggable",end:o?"touchend":"mouseup.draggable"},f=a.prototype;f.init=function(){this.calculate_positions(),this.$container.css("position","relative"),this.disabled=!1,this.events(),e(t).bind("resize",throttle(e.proxy(this.calculate_positions,this),200))},f.events=function(){this.$container.on("selectstart",e.proxy(this.on_select_start,this)),this.$container.on(u.start,this.options.items,e.proxy(this.drag_handler,this)),this.$body.on(u.end,e.proxy(function(e){this.is_dragging=!1;if(this.disabled)return;this.$body.off(u.move),this.drag_start&&this.on_dragstop(e)},this))},f.get_actual_pos=function(e){var t=e.position();return t},f.get_mouse_pos=function(e){if(o){var t=e.originalEvent;e=t.touches.length?t.touches[0]:t.changedTouches[0]}return{left:e.clientX,top:e.clientY}},f.get_offset=function(e){e.preventDefault();var t=this.get_mouse_pos(e),n=Math.round(t.left-this.mouse_init_pos.left),r=Math.round(t.top-this.mouse_init_pos.top),i=Math.round(this.el_init_offset.left+n-this.baseX),s=Math.round(this.el_init_offset.top+r-this.baseY+this.scrollOffset);return this.options.limit&&(i>this.player_max_left?i=this.player_max_left:i<this.player_min_left&&(i=this.player_min_left)),{left:i,top:s,mouse_left:t.left,mouse_top:t.top}},f.manage_scroll=function(e){var t,n=s.scrollTop(),r=n,i=r+this.window_height,o=i-50,u=r+50,a=e.mouse_left,f=r+e.mouse_top,l=this.doc_height-this.window_height+this.player_height;f>=o&&(t=n+30,t<l&&(s.scrollTop(t),this.scrollOffset=this.scrollOffset+30)),f<=u&&(t=n-30,t>0&&(s.scrollTop(t),this.scrollOffset=this.scrollOffset-30))},f.calculate_positions=function(e){this.window_height=s.height()},f.drag_handler=function(t){var n=t.target.nodeName;if(this.disabled||t.which!==1&&!o)return;if(this.ignore_drag(t))return;var r=this,i=!0;return this.$player=e(t.currentTarget),this.el_init_pos=this.get_actual_pos(this.$player),this.mouse_init_pos=this.get_mouse_pos(t),this.offsetY=this.mouse_init_pos.top-this.el_init_pos.top,this.$body.on(u.move,function(e){var t=r.get_mouse_pos(e),n=Math.abs(t.left-r.mouse_init_pos.left),s=Math.abs(t.top-r.mouse_init_pos.top);return n>r.options.distance||s>r.options.distance?i?(i=!1,r.on_dragstart.call(r,e),!1):(r.is_dragging===!0&&r.on_dragmove.call(r,e),!1):!1}),!1},f.on_dragstart=function(t){t.preventDefault(),this.drag_start=!0,this.is_dragging=!0;var r=this.$container.offset();return this.baseX=Math.round(r.left),this.baseY=Math.round(r.top),this.doc_height=e(n).height(),this.options.helper==="clone"?(this.$helper=this.$player.clone().appendTo(this.$container).addClass("helper"),this.helper=!0):this.helper=!1,this.scrollOffset=0,this.el_init_offset=this.$player.offset(),this.player_width=this.$player.width(),this.player_height=this.$player.height(),this.player_max_left=this.$container.width()-this.player_width+this.options.offset_left,this.options.start&&this.options.start.call(this.$player,t,{helper:this.helper?this.$helper:this.$player}),!1},f.on_dragmove=function(e){var t=this.get_offset(e);this.options.autoscroll&&this.manage_scroll(t),(this.helper?this.$helper:this.$player).css({position:"absolute",left:t.left,top:t.top});var n={position:{left:t.left,top:t.top}};return this.options.drag&&this.options.drag.call(this.$player,e,n),!1},f.on_dragstop=function(e){var t=this.get_offset(e);this.drag_start=!1;var n={position:{left:t.left,top:t.top}};return this.options.stop&&this.options.stop.call(this.$player,e,n),this.helper&&this.$helper.remove(),!1},f.on_select_start=function(e){if(this.disabled)return;if(this.ignore_drag(e))return;return!1},f.enable=function(){this.disabled=!1},f.disable=function(){this.disabled=!0},f.destroy=function(){this.disable(),e.removeData(this.$container,"drag")},f.ignore_drag=function(t){return this.options.handle?!e(t.target).is(this.options.handle):e.inArray(t.target.nodeName,this.options.ignore_dragging)>=0},e.fn.drag=function(t){return this.each(function(){e.data(this,"drag")||e.data(this,"drag",new a(this,t))})}}(jQuery,window,document),function(e,t,n,r){function s(t,n){this.options=e.extend(!0,i,n),this.$el=e(t),this.$wrapper=this.$el.parent(),this.$widgets=this.$el.children(this.options.widget_selector).addClass("gs_w"),this.widgets=[],this.$changed=e([]),this.wrapper_width=this.$wrapper.width(),this.min_widget_width=this.options.widget_margins[0]*2+this.options.widget_base_dimensions[0],this.min_widget_height=this.options.widget_margins[1]*2+this.options.widget_base_dimensions[1],this.init()}var i={namespace:"",widget_selector:"li",widget_margins:[10,10],widget_base_dimensions:[400,225],extra_rows:0,extra_cols:0,min_cols:1,min_rows:15,max_size_x:6,autogenerate_stylesheet:!0,avoid_overlapped_widgets:!0,serialize_params:function(e,t){return{col:t.col,row:t.row,size_x:t.size_x,size_y:t.size_y}},collision:{},draggable:{distance:4}};s.generated_stylesheets=[];var o=s.prototype;o.init=function(){this.generate_grid_and_stylesheet(),this.get_widgets_from_DOM(),this.set_dom_grid_height(),this.$wrapper.addClass("ready"),this.draggable(),e(t).bind("resize",throttle(e.proxy(this.recalculate_faux_grid,this),200))},o.disable=function(){return this.$wrapper.find(".player-revert").removeClass("player-revert"),this.drag_api.disable(),this},o.enable=function(){return this.drag_api.enable(),this},o.add_widget=function(t,n,r,i,s){var o;n||(n=1),r||(r=1),!i&!s?o=this.next_position(n,r):(o={col:i,row:s},this.empty_cells(i,s,n,r));var u=e(t).attr({"data-col":o.col,"data-row":o.row,"data-sizex":n,"data-sizey":r}).addClass("gs_w").appendTo(this.$el).hide();return this.$widgets=this.$widgets.add(u),this.register_widget(u),this.add_faux_rows(o.size_y),this.set_dom_grid_height(),u.fadeIn()},o.resize_widget=function(t,n,r){var i=t.coords().grid;n||(n=i.size_x),r||(r=i.size_y),n>this.cols&&(n=this.cols);var s=this.get_cells_occupied(i),o=i.size_x,u=i.size_y,a=i.col,f=a,l=n>o,c=r>u;if(a+n-1>this.cols){var h=a+(n-1)-this.cols,p=a-h;f=Math.max(1,p)}var d={col:f,row:i.row,size_x:n,size_y:r},v=this.get_cells_occupied(d),m=[];e.each(s.cols,function(t,n){e.inArray(n,v.cols)===-1&&m.push(n)});var g=[];e.each(v.cols,function(t,n){e.inArray(n,s.cols)===-1&&g.push(n)});var y=[];e.each(s.rows,function(t,n){e.inArray(n,v.rows)===-1&&y.push(n)});var b=[];e.each(v.rows,function(t,n){e.inArray(n,s.rows)===-1&&b.push(n)}),this.remove_from_gridmap(i);if(g.length){var w=[f,i.row,n,Math.min(u,r),t];this.empty_cells.apply(this,w)}if(b.length){var E=[f,i.row,n,r,t];this.empty_cells.apply(this,E)}i.col=f,i.size_x=n,i.size_y=r,this.add_to_gridmap(d,t),t.data("coords").update({width:n*this.options.widget_base_dimensions[0]+(n-1)*this.options.widget_margins[0]*2,height:r*this.options.widget_base_dimensions[1]+(r-1)*this.options.widget_margins[1]*2}),r>u&&this.add_faux_rows(r-u),n>o&&this.add_faux_cols(n-o),t.attr({"data-col":f,"data-sizex":n,"data-sizey":r});if(m.length){var S=[m[0],i.row,m.length,Math.min(u,r),t];this.remove_empty_cells.apply(this,S)}if(y.length){var x=[f,i.row,n,r,t];this.remove_empty_cells.apply(this,x)}return t},o.empty_cells=function(t,n,r,i,s){var o=this.widgets_below({col:t,row:n-i,size_x:r,size_y:i});return o.not(s).each(e.proxy(function(t,r){var s=e(r).coords().grid;if(!(s.row<=n+i-1))return;var o=n+i-s.row;this.move_widget_down(e(r),o)},this)),this.set_dom_grid_height(),this},o.remove_empty_cells=function(t,n,r,i,s){var o=this.widgets_below({col:t,row:n,size_x:r,size_y:i});return o.not(s).each(e.proxy(function(t,n){this.move_widget_up(e(n),i)},this)),this.set_dom_grid_height(),this},o.next_position=function(e,t){e||(e=1),t||(t=1);var n=this.gridmap,r=n.length,i=[],s;for(var o=1;o<r;o++){s=n[o].length;for(var u=1;u<=s;u++){var a=this.can_move_to({size_x:e,size_y:t},o,u);a&&i.push({col:o,row:u,size_y:t,size_x:e})}}return i.length?this.sort_by_row_and_col_asc(i)[0]:!1},o.remove_widget=function(t,n,r){var i=t instanceof jQuery?t:e(t),s=i.coords().grid;e.isFunction(n)&&(r=n,n=!1),this.cells_occupied_by_placeholder={},this.$widgets=this.$widgets.not(i);var o=this.widgets_below(i);this.remove_from_gridmap(s),i.fadeOut(e.proxy(function(){i.remove(),n||o.each(e.proxy(function(t,n){this.move_widget_up(e(n),s.size_y)},this)),this.set_dom_grid_height(),r&&r.call(this,t)},this))},o.remove_all_widgets=function(t){return this.$widgets.each(e.proxy(function(e,n){this.remove_widget(n,!0,t)},this)),this},o.serialize=function(t){t||(t=this.$widgets);var n=[];return t.each(e.proxy(function(t,r){n.push(this.options.serialize_params(e(r),e(r).coords().grid))},this)),n},o.serialize_changed=function(){return this.serialize(this.$changed)},o.register_widget=function(e){var t={col:parseInt(e.attr("data-col"),10),row:parseInt(e.attr("data-row"),10),size_x:parseInt(e.attr("data-sizex"),10),size_y:parseInt(e.attr("data-sizey"),10),el:e};return this.options.avoid_overlapped_widgets&&!this.can_move_to({size_x:t.size_x,size_y:t.size_y},t.col,t.row)&&(t=this.next_position(t.size_x,t.size_y),t.el=e,e.attr({"data-col":t.col,"data-row":t.row,"data-sizex":t.size_x,"data-sizey":t.size_y})),e.data("coords",e.coords()),e.data("coords").grid=t,this.add_to_gridmap(t,e),this},o.update_widget_position=function(e,t){return this.for_each_cell_occupied(e,function(e,n){if(!this.gridmap[e])return this;this.gridmap[e][n]=t}),this},o.remove_from_gridmap=function(e){return this.update_widget_position(e,!1)},o.add_to_gridmap=function(t,n){this.update_widget_position(t,n||t.el);if(t.el){var r=this.widgets_below(t.el);r.each(e.proxy(function(t,n){this.move_widget_up(e(n))},this))}},o.draggable=function(){var t=this,n=e.extend(!0,{},this.options.draggable,{offset_left:this.options.widget_margins[0],start:function(n,r){t.$widgets.filter(".player-revert").removeClass("player-revert"),t.$player=e(this),t.$helper=t.options.draggable.helper==="clone"?e(r.helper):t.$player,t.helper=!t.$helper.is(t.$player),t.on_start_drag.call(t,n,r),t.$el.trigger("gridster:dragstart")},stop:function(e,n){t.on_stop_drag.call(t,e,n),t.$el.trigger("gridster:dragstop")},drag:throttle(function(e,n){t.on_drag.call(t,e,n),t.$el.trigger("gridster:drag")},60)});return this.drag_api=this.$el.drag(n).data("drag"),this},o.on_start_drag=function(t,n){this.$helper.add(this.$player).add(this.$wrapper).addClass("dragging"),this.$player.addClass("player"),this.player_grid_data=this.$player.coords().grid,this.placeholder_grid_data=e.extend({},this.player_grid_data),this.$el.css("height",this.$el.height()+this.player_grid_data.size_y*this.min_widget_height);var r=this.faux_grid,i=this.$player.data("coords").coords;this.cells_occupied_by_player=this.get_cells_occupied(this.player_grid_data),this.cells_occupied_by_placeholder=this.get_cells_occupied(this.placeholder_grid_data),this.last_cols=[],this.last_rows=[],this.collision_api=this.$helper.collision(r,this.options.collision),this.$preview_holder=e("<li />",{"class":"preview-holder","data-row":this.$player.attr("data-row"),"data-col":this.$player.attr("data-col"),css:{width:i.width,height:i.height}}).appendTo(this.$el),this.options.draggable.start&&this.options.draggable.start.call(this,t,n)},o.on_drag=function(e,t){if(this.$player===null)return!1;var n={left:t.position.left+this.baseX,top:t.position.top+this.baseY};this.colliders_data=this.collision_api.get_closest_colliders(n),this.on_overlapped_column_change(this.on_start_overlapping_column,this.on_stop_overlapping_column),this.on_overlapped_row_change(this.on_start_overlapping_row,this.on_stop_overlapping_row),this.helper&&this.$player&&this.$player.css({left:t.position.left,top:t.position.top}),this.options.draggable.drag&&this.options.draggable.drag.call(this,e,t)},o.on_stop_drag=function(e,t){this.$helper.add(this.$player).add(this.$wrapper).removeClass("dragging"),t.position.left=t.position.left+this.baseX,t.position.top=t.position.top+this.baseY,this.colliders_data=this.collision_api.get_closest_colliders(t.position),this.on_overlapped_column_change(this.on_start_overlapping_column,this.on_stop_overlapping_column),this.on_overlapped_row_change(this.on_start_overlapping_row,this.on_stop_overlapping_row),this.$player.addClass("player-revert").removeClass("player").attr({"data-col":this.placeholder_grid_data.col,"data-row":this.placeholder_grid_data.row}).css({left:"",top:""}),this.$changed=this.$changed.add(this.$player),this.cells_occupied_by_player=this.get_cells_occupied(this.placeholder_grid_data),this.set_cells_player_occupies(this.placeholder_grid_data.col,this.placeholder_grid_data.row),this.$player.coords().grid.row=this.placeholder_grid_data.row,this.$player.coords().grid.col=this.placeholder_grid_data.col,this.options.draggable.stop&&this.options.draggable.stop.call(this,e,t),this.$preview_holder.remove(),this.$player=null,this.$helper=null,this.placeholder_grid_data={},this.player_grid_data={},this.cells_occupied_by_placeholder={},this.cells_occupied_by_player={},this.set_dom_grid_height()},o.on_overlapped_column_change=function(t,n){if(!this.colliders_data.length)return;var r=this.get_targeted_columns(this.colliders_data[0].el.data.col),i=this.last_cols.length,s=r.length,o;for(o=0;o<s;o++)e.inArray(r[o],this.last_cols)===-1&&(t||e.noop).call(this,r[o]);for(o=0;o<i;o++)e.inArray(this.last_cols[o],r)===-1&&(n||e.noop).call(this,this.last_cols[o]);return this.last_cols=r,this},o.on_overlapped_row_change=function(t,n){if(!this.colliders_data.length)return;var r=this.get_targeted_rows(this.colliders_data[0].el.data.row),i=this.last_rows.length,s=r.length,o;for(o=0;o<s;o++)e.inArray(r[o],this.last_rows)===-1&&(t||e.noop).call(this,r[o]);for(o=0;o<i;o++)e.inArray(this.last_rows[o],r)===-1&&(n||e.noop).call(this,this.last_rows[o]);this.last_rows=r},o.set_player=function(e,t,n){var r=this;n||this.empty_cells_player_occupies();var i=n?{col:e}:r.colliders_data[0].el.data,s=i.col,o=t||i.row;this.player_grid_data={col:s,row:o,size_y:this.player_grid_data.size_y,size_x:this.player_grid_data.size_x},this.cells_occupied_by_player=this.get_cells_occupied(this.player_grid_data);var u=this.get_widgets_overlapped(this.player_grid_data),a=this.widgets_constraints(u);this.manage_movements(a.can_go_up,s,o),this.manage_movements(a.can_not_go_up,s,o);if(!u.length){var f=this.can_go_player_up(this.player_grid_data);f!==!1&&(o=f),this.set_placeholder(s,o)}return{col:s,row:o}},o.widgets_constraints=function(t){var n=e([]),r,i=[],s=[];return t.each(e.proxy(function(t,r){var o=e(r),u=o.coords().grid;this.can_go_widget_up(u)?(n=n.add(o),i.push(u)):s.push(u)},this)),r=t.not(n),{can_go_up:this.sort_by_row_asc(i),can_not_go_up:this.sort_by_row_desc(s)}},o.sort_by_row_asc=function(t){return t=t.sort(function(t,n){return t.row||(t=e(t).coords().grid,n=e(n).coords().grid),t.row>n.row?1:-1}),t},o.sort_by_row_and_col_asc=function(e){return e=e.sort(function(e,t){return e.row>t.row||e.row===t.row&&e.col>t.col?1:-1}),e},o.sort_by_col_asc=function(e){return e=e.sort(function(e,t){return e.col>t.col?1:-1}),e},o.sort_by_row_desc=function(e){return e=e.sort(function(e,t){return e.row+e.size_y<t.row+t.size_y?1:-1}),e},o.manage_movements=function(t,n,r){return e.each(t,e.proxy(function(e,t){var i=t,s=i.el,o=this.can_go_widget_up(i);if(o)this.move_widget_to(s,o),this.set_placeholder(n,o+i.size_y);else{var u=this.can_go_player_up(this.player_grid_data);if(!u){var a=r+this.player_grid_data.size_y-i.row;this.move_widget_down(s,a),this.set_placeholder(n,r)}}},this)),this},o.is_player=function(e,t){if(t&&!this.gridmap[e])return!1;var n=t?this.gridmap[e][t]:e;return n&&(n.is(this.$player)||n.is(this.$helper))},o.is_player_in=function(t,n){var r=this.cells_occupied_by_player||{};return e.inArray(t,r.cols)>=0&&e.inArray(n,r.rows)>=0},o.is_placeholder_in=function(t,n){var r=this.cells_occupied_by_placeholder||{};return this.is_placeholder_in_col(t)&&e.inArray(n,r.rows)>=0},o.is_placeholder_in_col=function(t){var n=this.cells_occupied_by_placeholder||[];return e.inArray(t,n.cols)>=0},o.is_empty=function(e,t){return typeof this.gridmap[e]!="undefined"&&typeof this.gridmap[e][t]!="undefined"&&this.gridmap[e][t]===!1?!0:!1},o.is_occupied=function(e,t){return this.gridmap[e]?this.gridmap[e][t]?!0:!1:!1},o.is_widget=function(e,t){var n=this.gridmap[e];return n?(n=n[t],n?n:!1):!1},o.is_widget_under_player=function(e,t){return this.is_widget(e,t)?this.is_player_in(e,t):!1},o.get_widgets_under_player=function(t){t||(t=this.cells_occupied_by_player||{cols:[],rows:[]});var n=e([]);return e.each(t.cols,e.proxy(function(r,i){e.each(t.rows,e.proxy(function(e,t){this.is_widget(i,t)&&(n=n.add(this.gridmap[i][t]))},this))},this)),n},o.set_placeholder=function(t,n){var r=e.extend({},this.placeholder_grid_data),i=this.widgets_below({col:r.col,row:r.row,size_y:r.size_y,size_x:r.size_x}),s=t+r.size_x-1;s>this.cols&&(t-=s-t);var o=this.placeholder_grid_data.row<n,u=this.placeholder_grid_data.col!==t;this.placeholder_grid_data.col=t,this.placeholder_grid_data.row=n,this.cells_occupied_by_placeholder=this.get_cells_occupied(this.placeholder_grid_data),this.$preview_holder.attr({"data-row":n,"data-col":t}),(o||u)&&i.each(e.proxy(function(n,i){this.move_widget_up(e(i),this.placeholder_grid_data.col-t+r.size_y)},this));var a=this.get_widgets_under_player(this.cells_occupied_by_placeholder);a.length&&a.each(e.proxy(function(t,i){var s=e(i);this.move_widget_down(s,n+r.size_y-s.data("coords").grid.row)},this))},o.can_go_player_up=function(e){var t=e.row+e.size_y-1,n=!0,r=[],i=1e4,s=this.get_widgets_under_player();return this.for_each_column_occupied(e,function(e){var o=this.gridmap[e],u=t+1;r[e]=[];while(--u>0){if(!(this.is_empty(e,u)||this.is_player(e,u)||this.is_widget(e,u)&&o[u].is(s)))break;r[e].push(u),i=u<i?u:i}if(r[e].length===0)return n=!1,!0;r[e].sort()}),n?this.get_valid_rows(e,r,i):!1},o.can_go_widget_up=function(e){var t=e.row+e.size_y-1,n=!0,r=[],i=1e4;return this.for_each_column_occupied(e,function(s){var o=this.gridmap[s];r[s]=[];var u=t+1;while(--u>0){if(this.is_widget(s,u)&&!this.is_player_in(s,u)&&!o[u].is(e.el))break;!this.is_player(s,u)&&!this.is_placeholder_in(s,u)&&!this.is_player_in(s,u)&&r[s].push(u),u<i&&(i=u)}if(r[s].length===0)return n=!1,!0;r[s].sort()}),n?this.get_valid_rows(e,r,i):!1},o.get_valid_rows=function(t,n,r){var i=t.row,s=t.row+t.size_y-1,o=t.size_y,u=r-1,a=[];while(++u<=s){var f=!0;e.each(n,function(t,n){e.isArray(n)&&e.inArray(u,n)===-1&&(f=!1)});if(f===!0){a.push(u);if(a.length===o)break}}var l=!1;return o===1?a[0]!==i&&(l=a[0]||!1):a[0]!==i&&(l=this.get_consecutive_numbers_index(a,o)),l},o.get_consecutive_numbers_index=function(e,t){var n=e.length,r=[],i=!0,s=-1;for(var o=0;o<n;o++){if(i||e[o]===s+1){r.push(o);if(r.length===t)break;i=!1}else r=[],i=!0;s=e[o]}return r.length>=t?e[r[0]]:!1},o.get_widgets_overlapped=function(){var t,n=e([]),r=[],i=this.cells_occupied_by_player.rows.slice(0);return i.reverse(),e.each(this.cells_occupied_by_player.cols,e.proxy(function(t,s){e.each(i,e.proxy(function(t,i){if(!this.gridmap[s])return!0;var o=this.gridmap[s][i];this.is_occupied(s,i)&&!this.is_player(o)&&e.inArray(o,r)===-1&&(n=n.add(o),r.push(o))},this))},this)),n},o.on_start_overlapping_column=function(e){this.set_player(e,!1)},o.on_start_overlapping_row=function(e){this.set_player(!1,e)},o.on_stop_overlapping_column=function(e){this.set_player(e,!1);var t=this;this.for_each_widget_below(e,this.cells_occupied_by_player.rows[0],function(e,n){t.move_widget_up(this,t.player_grid_data.size_y)})},o.on_stop_overlapping_row=function(e){this.set_player(!1,e);var t=this,n=this.cells_occupied_by_player.cols;for(var r=0,i=n.length;r<i;r++)this.for_each_widget_below(n[r],e,function(e,n){t.move_widget_up(this,t.player_grid_data.size_y)})},o.move_widget_to=function(t,n){var r=this,i=t.coords().grid,s=n-i.row,o=this.widgets_below(t),u=this.can_move_to(i,i.col,n,t);return u===!1?!1:(this.remove_from_gridmap(i),i.row=n,this.add_to_gridmap(i),t.attr("data-row",n),this.$changed=this.$changed.add(t),o.each(function(t,n){var i=e(n),s=i.coords().grid,o=r.can_go_widget_up(s);o&&o!==s.row&&r.move_widget_to(i,o)}),this)},o.move_widget_up=function(t,n){var r=t.coords().grid,i=r.row,s=[],o=!0;n||(n=1);if(!this.can_go_up(t))return!1;this.for_each_column_occupied(r,function(r){if(e.inArray(t,s)===-1){var o=t.coords().grid,u=i-n;u=this.can_go_up_to_row(o,r,u);if(!u)return!0;var a=this.widgets_below(t);this.remove_from_gridmap(o),o.row=u,this.add_to_gridmap(o),t.attr("data-row",o.row),this.$changed=this.$changed.add(t),s.push(t),a.each(e.proxy(function(t,r){this.move_widget_up(e(r),n)},this))}})},o.move_widget_down=function(t,n){var r=t.coords().grid,i=r.row,s=[],o=n;if(!t)return!1;if(e.inArray(t,s)===-1){var u=t.coords().grid,a=i+n,f=this.widgets_below(t);this.remove_from_gridmap(u),f.each(e.proxy(function(t,n){var r=e(n),i=r.coords().grid,s=this.displacement_diff(i,u,o);s>0&&this.move_widget_down(r,s)},this)),u.row=a,this.update_widget_position(u,t),t.attr("data-row",u.row),this.$changed=this.$changed.add(t),s.push(t)}},o.can_go_up_to_row=function(t,n,r){var i=this.gridmap,s=!0,o=[],u=t.row,a;this.for_each_column_occupied(t,function(e){var t=i[e];o[e]=[],a=u;while(a--){if(!this.is_empty(e,a)||!!this.is_placeholder_in(e,a))break;o[e].push(a)}if(!o[e].length)return s=!1,!0});if(!s)return!1;a=r;for(a=1;a<u;a++){var f=!0;for(var l=0,c=o.length;l<c;l++)o[l]&&e.inArray(a,o[l])===-1&&(f=!1);if(f===!0){s=a;break}}return s},o.displacement_diff=function(e,t,n){var r=e.row,i=[],s=t.row+t.size_y;this.for_each_column_occupied(e,function(e){var t=0;for(var n=s;n<r;n++)this.is_empty(e,n)&&(t+=1);i.push(t)});var o=Math.max.apply(Math,i);return n-=o,n>0?n:0},o.widgets_below=function(t){var n=e.isPlainObject(t)?t:t.coords().grid,r=this,i=this.gridmap,s=n.row+n.size_y-1,o=e([]);return this.for_each_column_occupied(n,function(t){r.for_each_widget_below(t,s,function(t,n){if(!r.is_player(this)&&e.inArray(this,o)===-1)return o=o.add(this),!0})}),this.sort_by_row_asc(o)},o.set_cells_player_occupies=function(e,t){return this.remove_from_gridmap(this.placeholder_grid_data),this.placeholder_grid_data.col=e,this.placeholder_grid_data.row=t,this.add_to_gridmap(this.placeholder_grid_data,this.$player),this},o.empty_cells_player_occupies=function(){return this.remove_from_gridmap(this.placeholder_grid_data),this},o.can_go_up=function(e){var t=e.coords().grid,n=t.row,r=n-1,i=this.gridmap,s=[],o=!0;return n===1?!1:(this.for_each_column_occupied(t,function(e){var t=this.is_widget(e,r);if(this.is_occupied(e,r)||this.is_player(e,r)||this.is_placeholder_in(e,r)||this.is_player_in(e,r))return o=!1,!0}),o)},o.can_move_to=function(e,t,n,r){var i=this.gridmap,s=e.el,o={size_y:e.size_y,size_x:e.size_x,col:t,row:n},u=!0,a=t+e.size_x-1;return a>this.cols?!1:r&&r<n+e.size_y-1?!1:(this.for_each_cell_occupied(o,function(t,n){var r=this.is_widget(t,n);r&&(!e.el||r.is(s))&&(u=!1)}),u)},o.get_targeted_columns=function(e){var t=(e||this.player_grid_data.col)+(this.player_grid_data.size_x-1),n=[];for(var r=e;r<=t;r++)n.push(r);return n},o.get_targeted_rows=function(e){var t=(e||this.player_grid_data.row)+(this.player_grid_data.size_y-1),n=[];for(var r=e;r<=t;r++)n.push(r);return n},o.get_cells_occupied=function(e){var t={cols:[],rows:[]},n;arguments[1]instanceof jQuery&&(e=arguments[1].coords().grid);for(n=0;n<e.size_x;n++){var r=e.col+n;t.cols.push(r)}for(n=0;n<e.size_y;n++){var i=e.row+n;t.rows.push(i)}return t},o.for_each_cell_occupied=function(e,t){return this.for_each_column_occupied(e,function(n){this.for_each_row_occupied(e,function(e){t.call(this,n,e)})}),this},o.for_each_column_occupied=function(e,t){for(var n=0;n<e.size_x;n++){var r=e.col+n;t.call(this,r,e)}},o.for_each_row_occupied=function(e,t){for(var n=0;n<e.size_y;n++){var r=e.row+n;t.call(this,r,e)}},o._traversing_widgets=function(t,n,r,i,s){var o=this.gridmap;if(!o[r])return;var u,a,f=t+"/"+n;if(arguments[2]instanceof jQuery){var l=arguments[2].coords().grid;r=l.col,i=l.row,s=arguments[3]}var c=[],h=i,p={"for_each/above":function(){while(h--)if(h>0&&this.is_widget(r,h)&&e.inArray(o[r][h],c)===-1){u=s.call(o[r][h],r,h),c.push(o[r][h]);if(u)break}},"for_each/below":function(){for(h=i+1,a=o[r].length;h<a;h++)if(this.is_widget(r,h)&&e.inArray(o[r][h],c)===-1){u=s.call(o[r][h],r,h),c.push(o[r][h]);if(u)break}}};p[f]&&p[f].call(this)},o.for_each_widget_above=function(e,t,n){return this._traversing_widgets("for_each","above",e,t,n),this},o.for_each_widget_below=function(e,t,n){return this._traversing_widgets
("for_each","below",e,t,n),this},o.get_highest_occupied_cell=function(){var e,t=this.gridmap,n=[],r=[];for(var i=t.length-1;i>=1;i--)for(e=t[i].length-1;e>=1;e--)if(this.is_widget(i,e)){n.push(e),r[e]=i;break}var s=Math.max.apply(Math,n);return this.highest_occupied_cell={col:r[s],row:s},this.highest_occupied_cell},o.get_widgets_from=function(t,n){var r=this.gridmap,i=e();return t&&(i=i.add(this.$widgets.filter(function(){var n=e(this).attr("data-col");return n===t||n>t}))),n&&(i=i.add(this.$widgets.filter(function(){var t=e(this).attr("data-row");return t===n||t>n}))),i},o.set_dom_grid_height=function(){var e=this.get_highest_occupied_cell().row;return this.$el.css("height",e*this.min_widget_height),this},o.generate_stylesheet=function(t){var n="",r=this.options.max_size_x,i=0,o=0,u,a;t||(t={}),t.cols||(t.cols=this.cols),t.rows||(t.rows=this.rows),t.namespace||(t.namespace=this.options.namespace),t.widget_base_dimensions||(t.widget_base_dimensions=this.options.widget_base_dimensions),t.widget_margins||(t.widget_margins=this.options.widget_margins),t.min_widget_width=t.widget_margins[0]*2+t.widget_base_dimensions[0],t.min_widget_height=t.widget_margins[1]*2+t.widget_base_dimensions[1];var f=e.param(t);if(e.inArray(f,s.generated_stylesheets)>=0)return!1;s.generated_stylesheets.push(f);for(u=t.cols;u>=0;u--)n+=t.namespace+' [data-col="'+(u+1)+'"] { left:'+(u*t.widget_base_dimensions[0]+u*t.widget_margins[0]+(u+1)*t.widget_margins[0])+"px;} ";for(u=t.rows;u>=0;u--)n+=t.namespace+' [data-row="'+(u+1)+'"] { top:'+(u*t.widget_base_dimensions[1]+u*t.widget_margins[1]+(u+1)*t.widget_margins[1])+"px;} ";for(var l=1;l<=t.rows;l++)n+=t.namespace+' [data-sizey="'+l+'"] { height:'+(l*t.widget_base_dimensions[1]+(l-1)*t.widget_margins[1]*2)+"px;}";for(var c=1;c<=r;c++)n+=t.namespace+' [data-sizex="'+c+'"] { width:'+(c*t.widget_base_dimensions[0]+(c-1)*t.widget_margins[0]*2)+"px;}";return this.add_style_tag(n)},o.add_style_tag=function(e){var t=n,r=t.createElement("style");return t.getElementsByTagName("head")[0].appendChild(r),r.setAttribute("type","text/css"),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(n.createTextNode(e)),this},o.generate_faux_grid=function(e,t){this.faux_grid=[],this.gridmap=[];var n,r;for(n=t;n>0;n--){this.gridmap[n]=[];for(r=e;r>0;r--)this.add_faux_cell(r,n)}return this},o.add_faux_cell=function(t,n){var r=e({left:this.baseX+(n-1)*this.min_widget_width,top:this.baseY+(t-1)*this.min_widget_height,width:this.min_widget_width,height:this.min_widget_height,col:n,row:t,original_col:n,original_row:t}).coords();return e.isArray(this.gridmap[n])||(this.gridmap[n]=[]),this.gridmap[n][t]=!1,this.faux_grid.push(r),this},o.add_faux_rows=function(e){var t=this.rows,n=t+(e||1);for(var r=n;r>t;r--)for(var i=this.cols;i>=1;i--)this.add_faux_cell(r,i);return this.rows=n,this.options.autogenerate_stylesheet&&this.generate_stylesheet(),this},o.add_faux_cols=function(e){var t=this.cols,n=t+(e||1);for(var r=t;r<n;r++)for(var i=this.rows;i>=1;i--)this.add_faux_cell(i,r);return this.cols=n,this.options.autogenerate_stylesheet&&this.generate_stylesheet(),this},o.recalculate_faux_grid=function(){var n=this.$wrapper.width();return this.baseX=(e(t).width()-n)/2,this.baseY=this.$wrapper.offset().top,e.each(this.faux_grid,e.proxy(function(e,t){this.faux_grid[e]=t.update({left:this.baseX+(t.data.col-1)*this.min_widget_width,top:this.baseY+(t.data.row-1)*this.min_widget_height})},this)),this},o.get_widgets_from_DOM=function(){return this.$widgets.each(e.proxy(function(t,n){this.register_widget(e(n))},this)),this},o.generate_grid_and_stylesheet=function(){var n=this.$wrapper.width(),r=this.$wrapper.height(),i=Math.floor(n/this.min_widget_width)+this.options.extra_cols,s=this.$widgets.map(function(){return e(this).attr("data-col")});s=Array.prototype.slice.call(s,0),s.length||(s=[0]);var o=Math.max.apply(Math,s),u=this.options.extra_rows;return this.$widgets.each(function(t,n){u+=+e(n).attr("data-sizey")}),this.cols=Math.max(o,i,this.options.min_cols),this.rows=Math.max(u,this.options.min_rows),this.baseX=(e(t).width()-n)/2,this.baseY=this.$wrapper.offset().top,this.options.autogenerate_stylesheet&&this.generate_stylesheet(),this.generate_faux_grid(this.rows,this.cols)},e.fn.gridster=function(t){return this.each(function(){e(this).data("gridster")||e(this).data("gridster",new s(this,t))})},e.Gridster=o}(jQuery,window,document),vizjslib_git_revision="5c9d1c2b60921fb2b0f4c05b3f92919e84d5ae5e",vizjslib_git_tag="2.1.3-125-g5c9d1c2",function(){function n(e,t,n){var r="";if(!t||t.length===0)return r;for(var i=0;i<t.date.length;i++)t.date[i]==n[e.index]&&(r=t.marks[i]);return r}function r(e,t){var r={name:e,config:{colors:t.colors,grid:{verticalLines:!1,horizontalLines:!1},mouse:{track:!0,trackY:!1,position:"ne"},yaxis:{min:0,autoscale:!0},legend:{show:!1,backgroundColor:"#FFFFFF",backgroundOpacity:0}}};return t.gtype==="whiskers"?r.config.whiskers={show:!0,lineWidth:2}:r.config["lite-lines"]={lineWidth:2,show:!0,fill:!1,fillOpacity:.5},t.y_labels&&(r.config.yaxis={showLabels:!0,min:0}),t.show_markers&&(r.config.markers={show:!0,position:"ct",labelFormatter:function(e){return n(e,t.markers,t.dates)}}),r}function i(e,n,i,s){var o=Report.getAllMetrics(),u=null;$.each(i,function(i,a){config=s,a.envision&&(config=DataProcess.mergeConfig(s,a.envision)),$.inArray(i,t.envision_hide)===-1&&(n[i]=r("report-"+e.getName()+"-"+i,config),u=i,o[i]&&(u=o[i].name),n[i].config.subtitle=u,e.getMainMetric()==i&&(n[i+"_relative"]=r("report-"+e.getName()+"-"+i+"_relative",config),n[i].config["lite-lines"]={show:!1},n[i].config.lines={lineWidth:1,show:!0,stacked:!0,fill:!0,fillOpacity:1}))})}function s(n){var s=["#ffa500","#00A8F0","#C0D800","#ffff00","#00ff00","#4DA74D","#9440ED"],o={colors:s,dates:t.dates,g_type:"",markers:t.markers,y_labels:!1},u=Report.getDataSources(),a={},f={};return n?$.each(u,function(e,t){$.inArray(t.getName(),n)>-1&&(f=t.getMetrics(),i(t,a,f,o))}):$.each(u,function(e,t){f=t.getMetrics(),i(t,a,f,o)}),config=o,a.summary=r("report-summary",config),a.summary.config.xaxis={noTickets:10,showLabels:!0},a.summary.config.handles={show:!0},a.summary.config.selection={mode:"x"},a.summary.config.mouse={},a.connection={name:"report-connection",adapterConstructor:e.components.QuadraticDrawing},a}function o(e,t){var n=[],r=null;return $.each(e,function(e,n){if(n.getMetrics()[t])return r=n,!1}),n.push(r),$.each(e,function(e,t){if(t===r)return;n.push(t)}),n}function u(n,r){var i=n.data.main_metric;t=n.data,r||(r=Report.getDataSources()),r=o(r,i);var u=[];for(var a=0;a<r.length;a++){if(r[a].getData().length===0)continue;u.push(r[a].getName())}var f=n.data,l=s(u),c=new e.Visualization({name:"report-"+u.join(",")}),h=new e.Interaction,p=new e.Interaction,d={};$.each(r,function(e,t){if(t.getData().length===0)return;d=$.extend(d,t.getMetrics())}),$.each(d,function(e,t){if($.inArray(e,f.envision_hide)!==-1)return;if(f[e]===undefined)return;l[e].data=f[e],l[e].data.length<Report.getProjectsList().length&&(l[e].config.legend.show=!0),f[e+"_relative"]&&(l[e].data=f[e+"_relative"])}),l.summary.data=f.summary,l[i].config.legend.show=!0,n.legend_show===!1&&(l[i].config.legend.show=!1),l[i].config.mouse.trackFormatter=n.trackFormatter,n.xTickFormatter&&(l.summary.config.xaxis.tickFormatter=n.xTickFormatter),l[i].config.yaxis.tickFormatter=n.yTickFormatter||function(e){return"$"+e};var v={};$.each(d,function(t,n){if(f[t]===undefined)return;$.inArray(t,f.envision_hide)===-1&&(v[t]=new e.Component(l[t]))}),connection=new e.Component(l.connection),summary=new e.Component(l.summary),$.each(v,function(e,t){c.add(t)}),c.add(connection).add(summary).render(n.container),$.each(v,function(e,t){h.follower(t)}),h.follower(connection).leader(summary).add(e.actions.selection,n.selectionCallback?{callback:n.selectionCallback}:null);var m=[];$.each(v,function(e,t){m.push(t)}),p.group(m).add(e.actions.hit),n.selection&&summary.trigger("select",n.selection)}var e=envision,t={};e.templates.Envision_Report=u}();if(Loader===undefined)var Loader={};(function(){function f(e,t){e.project_name===undefined&&(e.project_name=t.replace("data/json","").replace(/\.\.\//g,""));var n=Report.getProjectsData();n[e.project_name]={dir:t,url:e.project_url}}function l(e,t,n){return all_data_found=!1,a&&(file_no_path=e.replace(Report.getDataDir()+"/",""),data=a[file_no_path],data?(t(data,n),H(),all_data_found=!0):window.console&&Report.log("Can't find in "+Report.all_json_file+" "+e)),all_data_found}function c(e,t,n){if(l(e,t,n))return;$.when($.getJSON(e)).done(function(e){t(e,n),H()}).fail(function(){t([],n),H()})}function h(){var e=["irc","mediawiki"],t=Report.getDataSources();$.each(t,function(t,n){$.inArray(n.getName(),e)>-1?n.setCompaniesData([]):c(n.getCompaniesDataFile(),n.setCompaniesData,n)})}function p(){var e=["mediawiki"],t=Report.getDataSources();$.each(t,function(t,n){$.inArray(n.getName(),e)>-1?n.setReposData([]):c(n.getReposDataFile(),n.setReposData,n)}),c(Report.getReposMapFile(),Report.setReposMap)}function d(){var e=["irc","mediawiki"],t=Report.getDataSources();$.each(t,function(t,n){$.inArray(n.getName(),e)>-1?n.setCountriesData([]):c(n.getCountriesDataFile(),n.setCountriesData,n)})}function v(){var e=["irc","mediawiki"],t=Report.getDataSources();$.each(t,function(t,n){$.inArray(n.getName(),e)>-1?n.setDomainsData([]):c(n.getDomainsDataFile(),n.setDomainsData,n)})}function m(){var e=["irc","mediawiki"],t=Report.getDataSources();$.each(t,function(t,n){$.inArray(n.getName(),e)>-1?n.setProjectsData([]):c(n.getProjectsDataFile(),n.setProjectsData,n)})}function g(){var e=Report.getDataSources();$.each(e,function(e,t){t.getName()==="its"&&c(t.getTimeToFixDataFile(),t.setTimeToFixData,t)})}function y(){var e=Report.getDataSources();$.each(e,function(e,t){t.getName()==="its"&&c(t.getMarkovTableDataFile(),t.setMarkovTableData,t)})}function b(){var e=Report.getDataSources();$.each(e,function(e,t){t.getName()==="mls"&&c(t.getTimeToAttentionDataFile(),t.setTimeToAttentionData,t)})}function w(){var e=Report.getDataSources();$.each(e,function(e,t){c(t.getDemographicsAgingFile(),t.setDemographicsAgingData,t),c(t.getDemographicsBirthFile(),t.setDemographicsBirthData,t)})}function E(e){var t=Report.getDataSources();$.each(t,function(e,t){var n=t.getTopDataFile();if(l(n,t.setGlobalTopData,t))return;$.when($.getJSON(n)).done(function(e){t.setGlobalTopData(e),H()}).fail(function(){t.setGlobalTopData([],t),H()})})}function S(e,t){var n=null;return $.each(Report.getDataSources(),function(r,i){if(t=="repos"&&$.inArray(e,i.getReposData())>-1)return n=i,!1;if(t=="companies"&&$.inArray(e,i.getCompaniesData())>-1)return n=i,!1;if(t=="countries"&&$.inArray(e,i.getCountriesData())>-1)return n=i,!1;if(t=="domains"&&$.inArray(e,i.getDomainsData())>-1)return n=i,!1;if(t=="projects"&&$.inArray(e,i.getProjectsData())>-1)return n=i,!1}),n}function x(e){var t="";return e==="repos"?t="rep":e==="companies"?t="com":e==="countries"?t="cou":e==="domains"?t="dom":e==="projects"&&(t="prj"),t}function T(){var e=Report.getDataSources();$.each(e,function(e,t){c(t.getDataFile(),t.setData,t),c(t.getGlobalDataFile(),t.setGlobalData,t),t instanceof MLS&&c(t.getListsFile(),t.setListsData,t)})}function N(){c("VizGrimoireJS/data/metrics.json",Report.setMetricsDefinition)}function C(){var e=Report.getDataSources();$.each(e,function(e,t){c(t.getPeopleDataFile(),t.setPeopleData,t)})}function k(){c(Report.getDataDir()+"/people.json",Report.setPeopleIdentities)}function L(e){return e.getCompaniesData()===null?!1:!0}function A(e){return e.getReposData()===null?!1:!0}function O(e){return e.getCountriesData()===null?!1:!0}function M(e){return e.getDomainsData()===null?!1:!0}function _(e){return e.getProjectsData()===null?!1:!0}function D(){var e=0,t=Report.getProjectsData(),n=Report.getProjectsDirs();for(var r in t)e++;return e<n.length?!1:!0}function P(){var e=!0;if(Report.getProjectData()===null||Report.getVizConfig()===null)return!1;if(Report.getConfig()===null&&Report.getMarkers()===null)return!1;if(Report.getReposMap()===null)return!1;if(Report.getConfig()===null&&!D())return!1;var t=Report.getDataSources();return $.each(t,function(t,n){if(n.getData()===null)return e=!1,!1;if(n.getGlobalData()===null)return e=!1,!1;if(n.getGlobalTopData()===null)return e=!1,!1;if(n.getDemographicsData().aging===undefined||n.getDemographicsData().birth===undefined)return e=!1,!1;if(n.getName()==="its"&&n.getTimeToFixData()===null)return e=!1,!1;if(n.getName()==="mls"&&n.getTimeToAttentionData()===null)return e=!1,!1}),e}function H(){if(P()){for(var n=0;n<t.length;n++)t[n]();t=[]}if(Loader.check_data_loaded())for(var r=0;r<e.length;r++)e[r].called!==!0&&e[r](),e[r].called=!0}var e=[],t=[],n=[],r=!1,i=!1,s=!1,o=["scr","irc","mediawiki"],u=["scm","mls","its"],a;Loader.data_ready=function(t){e.push(t)},Loader.data_ready_global=function(e){t.push(e)},Loader.set_all_data=function(e){a=e},Loader.data_load=function(){Report.getConfig()!==null&&Report.getConfig().project_info!==undefined?(Report.setProjectData(Report.getConfig().project_info),Report.getConfig().markers&&c(Report.getMarkersFile(),function(e,t){Report.setMarkers(e)})):(c(Report.getProjectFile(),function(e,t){Report.setProjectData(e)}),c(Report.getMarkersFile(),function(e,t){Report.setMarkers(e)}));var e=Report.getProjectsDirs();for(var t=0;t<e.length;t++){var n=e[t],r=Report.getDataDir()+"/project-info.json";c(r,f,n)}c(Report.getProjectsHierarchyFile(),Report.setProjectsHierarchy),c(Report.getMenuElementsFile(),Report.setMenuElements),c(Report.getVizConfigFile(),function(e,t){Report.setVizConfig(e)}),N(),T(),E("authors"),g(),b(),w(),y();if(Report.getConfig()!==null&&Report.getConfig().reports!==undefined){var i=Report.getConfig().reports;$.inArray("companies",i)>-1&&h(),$.inArray("repositories",i)>-1&&p(),$.inArray("countries",i)>-1&&d(),$.inArray("domains",i)>-1&&v(),$.inArray("projects",i)>-1&&m(),$.inArray("people",i)>-1&&(C(),k())}else h(),p(),d(),v(),m(),C(),k()},Loader.get_file_data_div=function(e,t,n){$.when($.getJSON(e)).done(function(r){t(n,e,r)}).fail(function(){t(e,null)})},Loader.check_filters_page=function(e){var t=!0,n=["repos","companies","countries"];return $.each(n,function(n,r){if(!Loader.check_filter_page(e,r))return t=!1,!1}),t},Loader.check_filter_page=function(e,t){var n=!0;e===undefined&&(e=1);var r=Report.getPageSize()*(e-1),i=r+Report.getPageSize();return $.each(Report.getDataSources(),function(e,s){var o=0;t==="repos"&&(o=s.getReposData().length),t==="companies"&&(o=s.getCompaniesData().length),t==="countries"&&(o=s.getCountriesData().length),t==="domains"&&(o=s.getDomainsData().length),t==="projects"&&(o=s.getProjectsData().length),i>o&&(i=o);for(var u=r;u<i;u++){var a;if(t==="repos"){a=s.getReposData()[u];if(s.getReposGlobalData()[a]===undefined||s.getReposMetricsData()[a]===undefined)return n=!1,!1}if(t==="companies"){a=s.getCompaniesData()[u];if(s.getCompaniesGlobalData()[a]===undefined||s.getCompaniesMetricsData()[a]===undefined)return n=!1,!1}if(t==="countries"){a=s.getCountriesData()[u];if(s.getCountriesGlobalData()[a]===undefined||s.getCountriesMetricsData()[a]===undefined)return n=!1,!1}if(t==="domains"){a=s.getDomainsData()[u];if(s.getDomainsGlobalData()[a]===undefined||s.getDomainsMetricsData()[a]===undefined)return n=!1,!1}if(t==="projects"){a=s.getProjectsData()[u];if(s.getProjectsGlobalData()[a]===undefined||s.getProjectsMetricsData()[a]===undefined)return n=!1,!1}}i=r+Report.getPageSize()}),n},Loader.filterTopCheck=function(e,t){var n=!0;return t==="repos"&&Loader.check_item(e,t,"top")===!1?(ds=S(e,t),ds===null?(Report.log("Can't find data source for "+e),!0):($.inArray(ds.getName(),u)>=0&&Loader.data_load_item_top(e,ds,null,Convert.convertFilterTop,t,"top"),!1)):n},Loader.FilterItemCheck=function(e,t){var n=!0,r,i=Report.getReposMap();if(t==="repos"){if(Loader.check_item(e,t)===!1)return r=S(e,t),r===null?(Report.log("Can't find data source for "+e),!0):(Loader.data_load_item(e,r,null,Convert.convertFilterStudyItem,t,null),$.inArray(r.getName(),u)>=0&&Loader.data_load_item_top(e,r,null,Convert.convertFilterStudyItem,t),!1);if(i!==undefined&&i.length!==0){var s=[];$.each(Report.getDataSources(),function(n,r){var i=Convert.getRealItem(r,t,e);i!==undefined&&i!==null&&s.push(i)});if(Loader.check_items(s,t)===!1){for(var a=0;a<s.length;a++)if(Loader.check_item(s[a],t)===!1){r=S(s[a],t);if(r===null){Report.log("Can't find "+s[a]),Report.log("Check repos-map.json");continue}Loader.data_load_item(s[a],r,null,Convert.convertFilterStudyItem,t,s)}n=!1}}}else $.each(Report.getDataSources(),function(r,i){Loader.check_item(e,t)===!1&&(n=!1,Loader.data_load_item(e,i,null,Convert.convertFilterStudyItem,t,null),t==="companies"&&$.inArray(i.getName(),o)===-1&&Loader.data_load_item_top(e,i,null,Convert.convertFilterStudyItem,t))});return n},Loader.check_item=function(e,t,n){var r=!1;return $.each(Report.getDataSources(),function(i,s){if(t==="repos"){if(n==="top"){if($.inArray(s.getName(),u)>=0&&$.inArray(e,s.getReposData())>=0&&s.getRepositoriesTopData()[e]!==undefined)return r=!0,!1}else if(s.getReposGlobalData()[e]!==undefined&&s.getReposMetricsData()[e]!==undefined)return r=!0,!1}else if(t==="companies"){var a=s.getCompaniesData();if(a.length===0)r=!0;else if($.inArray(e,a)===-1)r=!0;else{if(s.getCompaniesGlobalData()[e]===undefined||s.getCompaniesMetricsData()[e]===undefined)return r=!1,!1;if($.inArray(s.getName(),o)===-1&&s.getCompaniesTopData()[e]===undefined)return r=!1,!1;r=!0}}else if(t==="countries"){var f=s.getCountriesData();if(f.length===0)r=!0;else if($.inArray(e,f)===-1)r=!0;else{if(s.getCountriesGlobalData()[e]===undefined||s.getCountriesMetricsData()[e]===undefined)return r=!1,!1;r=!0}}else if(t==="domains"){var l=s.getDomainsData();if(l.length===0)r=!0;else if($.inArray(e,l)===-1)r=!0;else{if(s.getDomainsGlobalData()[e]===undefined||s.getDomainsMetricsData()[e]===undefined)return r=!1,!1;r=!0}}else if(t==="projects"){var c=s.getProjectsData();if(c.length===0)r=!0;else if($.inArray(e,c)===-1)r=!0;else{if(s.getProjectsGlobalData()[e]===undefined||s.getProjectsMetricsData()[e]===undefined)return r=!1,!1;r=!0}}}),r},Loader.check_items=function(e,t){var n=!0;return $.each(e,function(e,r){if(Loader.check_item(r,t)===!1)return n=!1,!1}),n},Loader.data_load_items_page=function(e,t,n,r){t===undefined&&(t=1);if(r==="repos"&&e.getReposData()===null)return!1;if(r==="companies"&&e.getCompaniesData()===null)return!1;if(r==="countries"&&e.getCountriesData()===null)return!1;if(r==="domains"&&e.getDomainsData()===null)return!1;if(r==="projects"&&e.getProjectsData()===null)return!1;var i=0;r==="repos"&&(i=e.getReposData().length),r==="companies"&&(i=e.getCompaniesData().length),r==="countries"&&(i=e.getCountriesData().length),r==="domains"&&(i=e.getDomainsData().length),r==="projects"&&(i=e.getProjectsData().length);if(i===0)return!0;var s=Report.getPageSize()*(t-1),o=s+Report.getPageSize();o>i&&(o=i);for(var u=s;u<o;u++)if(r==="repos"){var a=e.getReposData()[u];Loader.data_load_item(a,e,t,n,"repos")}else if(r==="companies"){var f=e.getCompaniesData()[u];Loader.data_load_item(f,e,t,n,"companies")}else if(r==="countries"){var l=e.getCountriesData()[u];Loader.data_load_item(l,e,t,n,"countries")}else if(r==="domains"){var c=e.getDomainsData()[u];Loader.data_load_item(c,e,t,n,"domains")}else if(r==="projects"){var h=e.getProjectsData()[u];Loader.data_load_item(h,e,t,n,"projects")}},Loader.check_people_item=function(e){var t=!0;return $.each(Report.getDataSources(),function(n,r){if(r.getPeopleGlobalData()[e]===undefined||r.getPeopleMetricsData()[e]===undefined)return t=!1,!1}),t},Loader.data_load_people_item=function(e,t,n){var r=t.getDataDir()+"/people-"+e+"-"+t.getName(),i=r+"-evolutionary.json",s=r+"-static.json";if(a){file_evo_no_path=i.replace(Report.getDataDir()+"/",""),file_static_no_path=s.replace(Report.getDataDir()+"/",""),data_evo=a[file_evo_no_path],data_static=a[file_static_no_path];if(data_evo&&data_static){t.addPeopleMetricsData(e,data_evo,t),t.addPeopleGlobalData(e,data_static,t),Loader.check_people_item(e)&&n(e);return}}$.when($.getJSON(i),$.getJSON(s)).done(function(r,i){t.addPeopleMetricsData(e,r[0],t),t.addPeopleGlobalData(e,i[0],t),Loader.check_people_item(e)&&n(e)}).fail(function(){t.addPeopleMetricsData(e,[],t),t.addPeopleGlobalData(e,[],t),Loader.check_people_item(e)&&n(e)})},Loader.data_load_item_top=function(e,t,n,r,i,s){var o=t.getDataDir()+"/"+e+"-"+t.getName();o+="-"+x(i)+"-top-";if(t.getName()==="scm")o+="authors";else if(t.getName()==="its")o+="closers";else{if(t.getName()!=="mls")return;o+="senders"}o+=".json";if(a){file_no_path=o.replace(Report.getDataDir()+"/",""),data=a[file_no_path];if(data){i==="companies"?t.addCompanyTopData(e,data):i==="repos"&&t.addRepositoryTopData(e,data),Loader.check_item(e,i,s)&&(r.called_item||r(i),r.called_item=!0);return}}$.when($.getJSON(o)).done(function(n){i==="companies"?t.addCompanyTopData(e,n):i==="repos"&&t.addRepositoryTopData(e,n)}).fail(function(){i==="companies"?t.addCompanyTopData(e,[]):i==="repos"&&t.addRepositoryTopData(e,[])}).always(function(){Loader.check_item(e,i,s)&&(r.called_item||r(i),r.called_item=!0)})},Loader.data_load_item=function(e,t,n,r,i,s){function m(e,t,n,r){i==="repos"?(r.addRepoMetricsData(e,t,r),r.addRepoGlobalData(e,n,r)):i==="companies"?(r.addCompanyMetricsData(e,t,r),r.addCompanyGlobalData(e,n,r)):i==="countries"?(r.addCountryMetricsData(e,t,r),r.addCountryGlobalData(e,n,r)):i==="domains"?(r.addDomainMetricsData(e,t,r),r.addDomainGlobalData(e,n,r)):i==="projects"&&(r.addProjectMetricsData(e,t,r),r.addProjectGlobalData(e,n,r))}function g(){n!==null?Loader.check_filter_page(n,i)&&(r.called_page===undefined?(r.called_page={},r.called_page[i]=!0,r(i)):r.called_page[i]||(r(i),r.called_page[i]=!0)):s!==null?Loader.check_items(s,i)&&(r.called_map===undefined?(r.called_map={},r.called_map[i]=!0,r(i)):r.called_map[i]||(r(i),r.called_map[i]=!0)):Loader.check_item(e,i)&&(r.called_item===undefined?(r.called_item={},r.called_item[i]=!0,r(i,e)):r.called_item[i]||(r(i,e),r.called_item[i]=!0))}var o=["irc","mediawiki"],u=["irc","mediawiki"],f=["irc","mediawiki"],l=["mediawiki"],c=["irc","mediawiki"];if(i==="repos"){if($.inArray(t.getName(),l)>-1){t.addRepoMetricsData(e,[],t),t.addRepoGlobalData(e,[],t);return}}else if(i==="companies"){if($.inArray(t.getName(),u)>-1){t.addCompanyMetricsData(e,[],t),t.addCompanyGlobalData(e,[],t);return}}else if(i==="countries"){if($.inArray(t.getName(),o)>-1){t.addCountryMetricsData(e,[],t),t.addCountryGlobalData(e,[],t);return}}else if(i==="domains"){if($.inArray(t.getName(),f)>-1){t.addDomainMetricsData(e,[],t),t.addDomainGlobalData(e,[],t);return}}else{if(i!=="projects")return;if($.inArray(t.getName(),c)>-1){t.addDomainMetricsData(e,[],t),t.addDomainGlobalData(e,[],t);return}}var h=encodeURIComponent(e),p=t.getDataDir()+"/"+h+"-";p+=t.getName()+"-"+x(i);var d=p+"-evolutionary.json",v=p+"-static.json";if(a){file_evo_no_path=decodeURIComponent(d.replace(Report.getDataDir()+"/","")),file_static_no_path=decodeURIComponent(v.replace(Report.getDataDir()+"/","")),data_evo=a[file_evo_no_path],data_static=a[file_static_no_path];if(data_evo&&data_static){m(e,data_evo,data_static,t),g();return}}$.when($.getJSON(d),$.getJSON(v)).done(function(n,r){m(e,n[0],r[0],t)}).always(function(){g()})},Loader.check_data_loaded=function(){var e=!0;if(!P())return!1;var t=Report.getDataSources(),n=["companies","repositories","countries","domains","projects"];return Report.getConfig()!==null&&Report.getConfig().reports!==undefined&&(n=Report.getConfig().reports),$.each(t,function(t,r){if(r.getPeopleData()===null)return e=!1,!1;if($.inArray("companies",n)>-1&&!L(r))return e=!1,!1;if($.inArray("repositories",n)>-1&&!A(r))return e=!1,!1;if($.inArray("countries",n)>-1&&!O(r))return e=!1,!1;if($.inArray("domains",n)>-1&&!M(r))return e=!1,!1;if($.inArray("projects",n)>-1&&!_(r))return e=!1,!1;if(r instanceof MLS&&r.getListsData()===null)return e=!1,!1}),e}})();var DataProcess={};(function(){DataProcess.info=function(){},DataProcess.paginate=function(e,t){if(t===undefined||t===0||isNaN(t))return e;var n=[],r=Report.getPageSize(),i=(t-1)*r;for(var s=i;s<r*t;s++)e[s]&&n.push(e[s]);return n},DataProcess.convert=function(e,t,n){return t==="aggregate"?e=DataProcess.aggregate(e,n):t==="substract"?(e=DataProcess.substract(e,n[0],n[1]),n=["substract"]):t==="substract-aggregate"?(e=DataProcess.substract(e,n[0],n[1]),n=["substract"],e=DataProcess.aggregate(e,n)):t==="divide"&&(e=DataProcess.divide(e,n[0],n[1]),n=["divide"]),e},DataProcess.sortGlobal=function(e,t,n){t===undefined&&(t="scm_commits");var r=[],i=[],s={};s.name=[],s[t]=[];var o=null;n==="companies"?(i=e.getCompaniesData(),o=e.getCompaniesDataFull()):n==="repos"?(i=e.getReposData(),o=e.getReposDataFull()):n==="countries"?i=e.getCountriesData():n==="domains"?(i=e.getDomainsData(),o=e.getDomainsDataFull()):n==="projects"&&(i=e.getProjectsData());if(i===null)return[];if(o===null)return i;if(o instanceof Array||t in o==0)return i;for(var u=0;u<o[t].length;u++){var a=o[t][u];a==="NA"&&(a=0),r.push([o.name[u],a])}return r.sort(function(e,t){return t[1]-e[1]}),$.each(r,function(e,n){s.name.push(n[0]),s[t].push(n[1])}),s.name},DataProcess.orderItems=function(e){$.each($("[class^='FilterItems']"),function(t,n){order_by=$(this).data("order-by");if(order_by!==undefined){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;var r=$(this).data("filter");if(r===undefined)return;if(r!==e)return;Report.log("Ordering with "+order_by+" "+ds+" for "+r);var i=DataProcess.sortGlobal(DS,order_by,r);return r==="companies"&&DS.setCompaniesData(i),r==="repos"&&DS.setReposData(i),r==="countries"&&DS.setCountriesData(i),r==="domains"&&DS.setDomainsData(i),!1}})},DataProcess.mergeConfig=function(e,t){var n={};return $.each(e,function(e,t){n[e]=t}),$.each(t,function(e,t){n[e]=t}),n},DataProcess.hideEmail=function(e){var t=e;return typeof e=="string"&&e.indexOf("@")>-1&&(t=e.split("@")[0]),t},DataProcess.selectPersonName=function(e){var t="",n,r;for(var i=0;i<e.identity.length;i++)n=e.identity[i],r=e.type[i],r==="name"&&n.length>t.length&&(t=n);return t},DataProcess.selectPersonEmail=function(e){var t="",n,r;for(var i=0;i<e.identity.length;i++)n=e.identity[i],r=e.type[i],r==="email"&&(t=n);return t},DataProcess.frameTime=function(e,t){var n={},r=-1,i=-1,s=0;if(t.length===0)return e;var o=e[t[0]].length,u=0;$.each(t,function(t,n){s=0;for(u=0;u<e[n].length;u++){if(e[n][u]!==0){r===-1&&(r=s),s<r&&(r=s);break}s++}}),$.each(t,function(t,n){s=0;for(u=e[n].length-1;u>=0;u--){if(e[n][u]!==0){i===-1&&(i=s),s<i&&(i=s);break}s++}});for(var a in e){n[a]=[];for(u=0;u<e[a].length;u++){if(u<r)continue;if(u>=o-i)continue;n[a].push(e[a][u])}}return n},DataProcess.filterDates=function(e,t,n){var r={};return $.each(n,function(i,s){r[i]=[],$.each(s,function(s,o){var u=n.unixtime[s];u>e&&(!t||t&&u<=t)&&r[i].push(o)})}),r},DataProcess.filterYear=function(e,t){e=parseInt(e,null);var n=(new Date(e.toString())).getTime(),r=(new Date((e+1).toString())).getTime(),i=filterDates(n,r,t);return i},DataProcess.fillDates=function(e,t){if(e[0].length===0)return t;var n=[[],[]],r=0;if(e[0][0]>t[0][0])for(r=0;r<t[0].length;r++)n[0][r]=t[0][r],n[1][r]=t[1][r];for(r=0;r<e[0].length;r++)pos=n[0].indexOf(e[0][r]),pos===-1&&(n[0].push(e[0][r]),n[1].push(e[1][r]));if(e[0][e[0].length-1]<t[0][t[0].length-1])for(r=0;r<t[0].length;r++)pos=n[0].indexOf(t[0][r]),pos===-1&&(n[0].push(t[0][r]),n[1].push(t[1][r]));return n},DataProcess.fillHistory=function(e,t){var n=[[],[]];for(var r=0;r<e.length;r++)pos=t[0].indexOf(e[r]),n[0][r]=e[r],pos!=-1?n[1][r]=t[1][pos]:n[1][r]=0;return n},DataProcess.fillHistoryLines=function(e,t){var n=[[],[]],r=[[],[]],i=[];for(var s=0;s<t.length;s++)n[0].push(t[s][0]),n[1].push(t[s][1]);r=DataProcess.fillHistory(e,n);for(s=0;s<e.length;s++)i.push([r[0][s],r[1][s]]);return i},DataProcess.addRelativeValues=function(e,t){if(e[t]===undefined)return;e[t+"_relative"]=[];var n=[];$.each(e[t],function(e,t){var r=t.data[1];for(var i=0;i<r.length;i++)n[i]===undefined&&(n[i]=0),n[i]+=r[i]}),$.each(e[t],function(r,i){var s=[];for(var o=0;o<i.data[0].length;o++)if(n[o]===0)s[o]=0;else{var u=i.data[1][o]/n[o]*100;s[o]=u}e[t+"_relative"].push({label:i.label,data:[i.data[0],s]})})},DataProcess.aggregate=function(e,t){var n={};return t instanceof Array||(t=[t]),$.each(e,function(r,i){if($.inArray(r,t)>-1){var s=[];s[0]=e[r][0];for(var o=1;o<e[r].length;o++)s[o]=s[o-1]+e[r][o];n[r]=s}else n[r]=e[r]}),n},DataProcess.substract=function(e,t,n){var r={},i=[];for(var s=0;s<e[t].length;s++)i[s]=e[t][s]-e[n][s];return $.each(e,function(t,n){r[t]=e[t]}),r.substract=i,r},DataProcess.divide=function(e,t,n){var r={},i=[];for(var s=0;s<e[t].length;s++)e[t][s]===0||e[n][s]===0?i[s]=0:i[s]=parseInt(e[t][s]/e[n][s],null);return $.each(e,function(t,n){r[t]=e[t]}),r.divide=i,r},DataProcess.revomeLastPoint=function(e){var t={};return $.each(e,function(n,r){t[n]=[];for(var i=0;i<e[n].length-1;i++)t[n].push(e[n][i])}),t}})();var Utils={};(function(){function e(){return $.urlParam("release")===null?!1:!0}function t(){return params="",document.URL.split("?").length>1&&(params=document.URL.split("?")[1]),params}function n(){return aux=document.URL.split("?")[0].split("/"),res=aux[aux.length-1],res}function r(e){return url=e,t().length>0&&(url+="?"+t()),url}function i(t){return url=t,e()&&(url+="?release="+$.urlParam("release")),url}Utils.paramsInURL=t,Utils.isReleasePage=e,Utils.filenameInURL=n,Utils.createLink=r,Utils.createReleaseLink=i,$.urlParam=function(e){var t=(new RegExp("[?&]"+e+"=([^&#]*)")).exec(window.location.href);return t===null?null:t[1]||0}})();var HTMLComposer={};(function(){function e(e,t){var n='<div class="col-md-12">';return n+='<div class="well well-small">',n+='<div class="row">',n+='<div class="col-md-12">',n+="<p>"+u(e)+"</p>",n+="</div>",n+='<div class="col-md-3">',n+='<div class="PersonSummary" data-data-source="'+e+'"></div>',n+="</div>",n+='<div class="col-md-9">',n+='<div class="PersonMetrics" data-data-source="'+e+'"',n+='data-metrics="'+t+'" data-min="true"',n+='data-frame-time="true"></div>',n+="</div>",n+="</div>",n+="</div>",n+="</div>",n}function t(e,t,n){var r='<div class="col-md-12">';return r+='<div class="row">',r+='<div class="col-md-3">',r+='<div class="well">',r+='<div class="FilterItemSummary" data-data-source="'+e+'" data-filter="'+t+'"></div>',r+="</div></div>",r+='<div class="col-md-9">',r+='<div class="well">',$.each(n,function(n,i){r+='<div class="row"><div class="col-md-12"></br></br></div></div>',r+='<div class="row">',r+='<div class="col-md-12">',r+='<div class="FilterItemMetricsEvol" data-data-source="'+e+'"',r+='data-metrics="'+i+'" data-min="true"',r+='data-filter="'+t+'" data-frame-time="true"></div>',r+="</div></div>"}),r+="</div></div></div></div>",r}function n(e,t,n){var r="<table class='table-condensed table-hover'>";r+='<tr><td colspan="2"><p class="subsection-title">'+u(e.getName())+"</p></td></tr>";var i="<tr><td>",s="</td></tr>";return $.each(t,function(t,o){e.getMetrics()[t]?(r+=i+e.getMetrics()[t].name,t==="first_date"||t==="last_date"?r+='</td><td class="numberInTD">'+o+s:r+='</td><td class="numberInTD">'+Report.formatValue(o)+s):n[t]&&(r+=i+n[t],t==="first_date"||t==="last_date"?r+='</td><td class="numberInTD">'+o+s:r+='</td><td class="numberInTD">'+Report.formatValue(o)+s)}),r+="</table>",r}function r(e,t){var n="<table class='table-condensed table-hover'>";return n+="<tr><td>",n+="First contribution: </br>",n+="&nbsp;&nbsp;"+t.first_date,n+="</td></tr><tr><td>",n+="Last contribution: </br>",n+="&nbsp;&nbsp;"+t.last_date,n+="</td></tr><tr><td>",e=="scm"?n+="Commits:</br>&nbsp;&nbsp;"+t.scm_commits:e=="its"?n+="Closed:</br>&nbsp;&nbsp;"+t.its_closed:e=="mls"?n+="Sent:</br>&nbsp;&nbsp;"+t.mls_sent:e=="irc"?n+="Sent:</br>&nbsp;&nbsp;"+t.irc_sent:e=="scr"&&(n+="Closed:</br>&nbsp;&nbsp;"+t.scr_closed),n+="</td></tr>",n+="</table>",n}function s(e,t){var n='<p class="section-title" style="margin-bottom:0px;"><i class="fa fa-user fa-lg"></i> &nbsp;&nbsp;';return e.length>0?n+=e:t.length>0&&(t.indexOf("@")>0&&(t=t.split("@")[0]),n+=t),n+="</p>",n}function o(e,t){var n='<p class="section-title" style="margin-bottom:0px;">';return t==="companies"&&(n+='<i class="fa fa-building-o"></i> &nbsp;&nbsp;'),n+=e,n+="</p>",n}function u(e){var t="";return e==="scm"?t='<i class="fa fa-code"></i> Source Code Management':e==="scr"?t='<i class="fa fa-check"></i> Source Code Review':e==="its"?t='<i class="fa fa-ticket"></i> Issue tracking system':e==="mls"?t='<i class="fa fa-envelope-o"></i> Mailing Lists':e==="irc"?t='<i class="fa fa-comment-o"></i> IRC Channels':e==="mediawiki"?t='<i class="fa fa-pencil-square-o"></i> Wiki':e==="releases"&&(t='<i class="fa fa-umbrella"></i> Forge Releases'
),t}function a(){return html="",params="?data_dir="+$.urlParam("data_dir")+"&release="+$.urlParam("release"),html+='<li><a href="./"><i class="fa fa-home"></i> Home</a></li>',html+='<li><a href="./scm-companies.html'+params+'"><i class="fa fa-code"></i> Source code repositories by companies</a></li>',html+='<li><a href="./mls-companies.html'+params+'"><i class="fa fa-envelope-o"></i> Mailing Lists by companies</a></li>',html+='<li><a href="./its-companies.html'+params+'"><i class="fa fa-ticket"></i> Tickets by companies</a></li>',html}function f(e,t){function n(e,t){return label="",$.each(t,function(t,n){if(n[1]===e)return label=n[0],!1}),label}if(t.length===0)return"";var r=null;if(t[0]instanceof Array){var s=[];$.each(t,function(e,t){s.push(t[1])}),r=t,t=s}return unsupported=["irc.html","qaforums.html","project.html"],ah_label="&nbsp;All history&nbsp;",label=e,label===null?label=ah_label:(label=decodeURIComponent(label),r!==null?(label=n(label,r),label="&nbsp; "+label+" &nbsp;"):label="&nbsp; "+label[0].toUpperCase()+label.substring(1)+" release &nbsp;",t.reverse().push(ah_label),t.reverse()),html='<div class="input-group-btn">',html+='<button type="button" class="btn btn-default btn-lg btn-releaseselector dropdown-toggle"',html+='data-toggle="dropdown">',html+=label,html+='<span class="caret"></span>',html+="</button>",html+='<ul class="dropdown-menu pull-left">',page_name=Utils.filenameInURL(),unsupported.indexOf(page_name)<0?$.each(t,function(e,t){var s=[];params=Utils.paramsInURL().split("&");for(i=0;i<params.length;i++){sub_value=params[i];if(sub_value.length===0)continue;sub_value.indexOf("release")===0?t!=ah_label&&s.push("release="+t):s.push(sub_value)}$.urlParam("release")===null&&s.push("release="+t),t===ah_label?html+='<li><a href="'+page_name+"?"+s.join("&")+'" data-value="'+t+'"> '+t+"</a></li>":(html+='<li><a href="'+page_name+"?"+s.join("&")+'" data-value="'+t+'"> ',r!==null?html+=n(t,r)+"</li>":html+=t[0].toUpperCase()+t.substring(1)+" release</a></li>")}):html+="<li><i>No releases for this section</i></li>",html+="</ul>",html+="</div>",html}function l(e,t,n,r){return html="",html+="<!-- irc -->",html+='<div class="row invisible-box">',blabels=t.split(","),bmetrics=n.split(","),html+=p(e,blabels,bmetrics,!1),html+='<div class="col-md-5">',tsm=r.split(","),html+=d(e,tsm[0],!1),html+="</div>",html+='<div class="col-md-5">',html+=d(e,tsm[1],!1),html+="</div>",html+="</div>",html+="<!-- end irc -->",html}function c(e,t,n,r,i){return html="",html+="<!-- irc -->",html+='<div class="row invisible-box">',blabels=t.split(","),bmetrics=n.split(","),html+=p(e,blabels,bmetrics,!0),html+='<div class="col-md-5">',tsm=r.split(","),html+=d(e,tsm[0],!0),html+="</div>",html+='<div class="col-md-5">',html+=d(e,tsm[1],!0),html+="</div>",html+="</div>",html+="<!-- end irc -->",html}function h(e,t,n,r,i){return i?widget_name="ProjectData":widget_name="GlobalData",html="",html+='<div class="col-xs-'+e+'">',html+='<div class="row thin-border">',html+='<div class="col-md-12">'+t+"</div>",html+="</div>",html+='<div class="row">',html+='<div class="col-md-12 medium-fp-number">',target_page=Utils.createLink(n+".html"),i?(html+='<span class="'+widget_name+'"',html+='data-data-source="'+n+'" data-field="'+r+'"></span>'):(html+='<a href="'+target_page+'"> <span class="'+widget_name+'"',html+='data-data-source="'+n+'" data-field="'+r+'"></span>',html+="</a>"),html+="</div>",html+="</div>",html+="</div>",html}function p(e,t,n,r){return r?widget_name="ProjectData":widget_name="GlobalData",html="",html+="<!-- summary box-->",html+='<div class="col-md-2">',html+='<div class="well well-small">',html+='<div class="row thin-border">',html+='<div class="col-md-12">'+t[0]+"</div>",html+="</div>",html+='<div class="row grey-border">',html+='<div class="col-md-12 big-fp-number">',target_page=Utils.createLink(e+".html"),e==="releases"&&(target_page=Utils.createLink("forge.html")),r?(html+='<span class="'+widget_name+'"',html+='data-data-source="'+e+'" data-field="'+n[0]+'"></span>'):(html+='<a href="'+target_page+'"> <span class="'+widget_name+'"',html+='data-data-source="'+e+'" data-field="'+n[0]+'"></span>',html+="</a>"),html+="</div>",html+="</div>",html+='<div class="row" style="padding: 5px 0px 0px 0px;">',t.length===2&&n.length===2?html+=h("12",t[1],e,n[1],r):t.length===3&&n.length===3?(html+=h("6",t[1],e,n[1],r),html+=h("6",t[2],e,n[2],r)):t.length===4&&n.length===4&&(html+=h("4",t[1],e,n[1],r),html+=h("4",t[2],e,n[2],r),html+=h("4",t[3],e,n[3],r)),html+="</div>",html+="</div>",html+="</div>",html+="<!-- end summary box -->",html}function d(e,t,n){return n?(ts_widget_name="FilterItemMetricsEvol",trend_widget_name="FilterItemMicrodashText",filter_name="projects"):(ts_widget_name="MetricsEvol",trend_widget_name="MicrodashText",filter_name=""),html="",html+='<div class="well well-small">',html+='<div class="'+ts_widget_name+'" data-data-source="'+e+'"',html+=' data-filter="'+filter_name+'"',n&&(html+=' data-frame-time="true"'),html+=' data-metrics="'+t+'" data-min="true" style="height: 100px;"',html+=' data-light-style="true"></div>',n?(html+=' <span class="'+trend_widget_name+'"',html+=' data-filter="'+filter_name+'"',html+=' data-metric="'+t+'"></span>'):(html+='<a href="'+e+'.html" style="color: black;">',html+=' <span class="'+trend_widget_name+'"',html+=' data-filter="'+filter_name+'"',html+=' data-metric="'+t+'"></span>',html+="</a>"),html+="</div>",html}function v(e,t,n,r){text={companies:"Companies","companies-summary":"Companies summary",contributors:"Contributors",countries:"Countries",domains:"Domains",projects:"Projects",repos:"Repositories",tags:"Tags",states:"States"},html="",html+='<li class="dropdown">',html+='<a href="#" class="dropdown-toggle" data-toggle="dropdown">',html+='<i class="fa '+e+'"></i>&nbsp;'+t+' <b class="caret"></b></a>',html+='<ul class="dropdown-menu navmenu-nav">';var i=Utils.createLink(n+".html");return html+='<li><a href="'+i+'">&nbsp;Overview</a></li>',$.each(r,function(e,t){i=Utils.createLink(n+"-"+t+".html");if(text.hasOwnProperty(t)){var r=text[t];if(t==="repos"){var s=Report.getDataSourceByName(n);r=s.getLabelForRepositories(),r=r.charAt(0).toUpperCase()+r.slice(1)}html+='<li><a href="'+i+'">&nbsp;'+r+"</a></li>"}else html+='<li><a href="'+i+'">&nbsp;'+t+"</a></li>"}),html+="</ul></li>",html}function m(){return html="",html+="<!-- summary bar -->",html+='<div class="capped-box overall-summary ">',html+='<div class="stats-switcher-viewport js-stats-switcher-viewport">',html+='<div class="row numbers-summary">',html+='<div class="col-xs-3"><a href="'+Utils.createReleaseLink("scm.html")+'"><span class="GlobalData" ',html+='data-data-source="scm" data-field="scm_commits"></span></a> commits</div>',html+='<div class="col-xs-3"><a href="'+Utils.createReleaseLink("scm.html")+'"><span class="GlobalData" ',html+='data-data-source="scm" data-field="scm_authors"></span></a> developers ',html+="</div>",html+='<div class="col-xs-3"><a href="'+Utils.createReleaseLink("its.html")+'"><span class="GlobalData" ',html+='data-data-source="its" data-field="its_opened"></span></a> tickets</div>',html+='<div class="col-xs-3"><a href="'+Utils.createReleaseLink("mls.html")+'"><span class="GlobalData" ',html+='data-data-source="mls" data-field="mls_sent"></span></a> mail messages ',html+="</div>",html+="</div>",html+="</div>",html+="</div>",html+="<!-- end of summary bar -->",html}function g(e,t){html="",link_exists=!1;try{fname=e.split(".")[0],section=fname.split("-")[0],subsection=fname.split("-")[1];var n=Report.getMenuElements();n[section].indexOf(subsection)>=0&&(link_exists=!0),Utils.isReleasePage()&&link_exists?(link_to=Utils.createReleaseLink(e),html='<a href="'+link_to+'">'+t+"</a>"):link_exists?html='<a href="'+e+'">'+t+"</a>":html=t}catch(r){html=t}return html}function y(e,t,n,r){return r?periods=[""]:periods=["last month","last year",""],width=12/periods.length,html='<div class="row">',$.each(periods,function(r,i){html+='<div class="col-md-'+width+'">',html+='<div class="Top" data-data-source="'+e+'" data-metric="'+t+'"',html+='data-period="'+i+'" data-limit="'+n+'" data-people_links="true"></div>',html+="</div>"}),html+="</div>",html}HTMLComposer.personDSBlock=e,HTMLComposer.filterDSBlock=t,HTMLComposer.DSBlock=l,HTMLComposer.DSBlockProject=c,HTMLComposer.repositorySummaryTable=n,HTMLComposer.personSummaryTable=r,HTMLComposer.personName=s,HTMLComposer.itemName=o,HTMLComposer.sideMenu4Release=a,HTMLComposer.releaseSelector=f,HTMLComposer.sideBarLinks=v,HTMLComposer.overallSummaryBlock=m,HTMLComposer.smartLinks=g,HTMLComposer.TopByPeriod=y})();var Convert={};(function(){function e(e,t){return t.hasOwnProperty(e)&&t[e].title?t[e].title:undefined}function t(e,t){return e.project_id<t.project_id?-1:e.project_id>t.project_id?1:0}function n(e,t){var n=[],r=e,i="",s={};while(t[r].hasOwnProperty("parent_project"))i=t[r].parent_project,s=t[i],s.project_id=i,n.push(s),r=i;return n.reverse()}function r(e,n){var r=[],i={};return $.each(n,function(t,s){n[t].parent_project===e&&(i=n[t],i.project_id=t,r.push(i))}),r.sort(t),r}function i(t,n,i){var s="",o=n.length;return o>0?(children_sort=[],children_names=[],$.each(n,function(e,t){children_names.push(t.title)}),children_names=children_names.sort(),$.each(children_names,function(e,t){$.each(n,function(e,n){if(t===n.title)return children_sort.push(n),!1})}),n=children_sort,s+='<li class="dropdown">',s+='<span data-toggle="tooltip" title="Project name"> '+e(t,i)+"</span>",s+='&nbsp;<a class="dropdown-toggle" data-toggle="dropdown" href="#">',s+='<span data-toggle="tooltip" title="Select subproject" class="badge"> '+o+" Subprojects </span></a>",s+='<ul class="dropdown-menu scrollable-menu">',$.each(n,function(e,t){gchildren=r(t.project_id,i),gchildren.length>0?s+='<li><a href="project.html?project='+t.project_id+'">'+t.title+'&nbsp;&nbsp;<span data-toggle="tooltip" title="Number of suprojects" class="badge">'+gchildren.length+'&nbsp;<i class="fa fa-rocket"></i></span></a></li>':s+='<li><a href="project.html?project='+t.project_id+'">'+t.title+"</a></li>"}),s+='<li class="divider"></li>',s+='<li><a href="./project_map.html"><i class="fa fa-icon fa-sitemap"></i> Projects treemap</a></li>',s+="</ul></li>"):s+="<li>"+e(t,i)+"</li>",s}function s(e){var t='<ol class="breadcrumbtitle">',s=Report.getProjectsHierarchy();if(s.length===0)return"";e===undefined&&(e="root");var o=r(e,s),u=n(e,s);return u.length>0&&$.each(u,function(e,n){n.parent_project?t+='<li><a href="project.html?project='+n.project_id+'">'+n.title+"</a></li>":t+='<li><a href="./">'+n.title+"</a></li>"}),t+=i(e,o,s),t+="</ol>",t}function o(e){var t="";return t=e.replace(" ","_"),t=t.toLowerCase(),t}function u(t,n,i){var s="",o=n.length,a=t;return o>0?(s+="<li>",s+='<a href="project.html?project='+a+'">'+e(t,i)+"</a>",s+='&nbsp;<a data-toggle="collapse" data-parent="#accordion" href="#collapse'+a+'"><span class="badge">'+o+'&nbsp;subprojects</span></a><div id="collapse'+a+'" class="panel-collapse collapse"><ul>',$.each(n,function(e,t){gchildren=r(t.project_id,i),s+=u(t.project_id,gchildren,i)}),s+="</ul></li>"):s+='<li><a href="project.html?project='+t+'">'+e(t,i)+"</a></li>",s}function a(){var e="<ul>",t=Report.getProjectsHierarchy();if(t.length===0)return"";project_id="root";var i=r(project_id,t),s=n(project_id,t);return $.each(i,function(n,i){grandchildren=r(i.project_id,t),e+=u(i.project_id,grandchildren,t)}),e+="</ul>",e}function f(){var e=[],t={data_sources:"Data sources",project_map:"Project map",people:"Contributor",company:"Company",country:"Country",domain:"Domain","scm-companies":"Activity on code repositories by companies","mls-companies":"Activity on mailing lists by companies","its-companies":"Activity on issue trackers by companies"};url_no_params=document.URL.split("?")[0],url_tokens=url_no_params.split("/");var n=url_tokens[url_tokens.length-1].split(".")[0];return n==="project"||n==="index"||n==="release"||n===""?[]:t.hasOwnProperty(n)?(e.push([n,t[n]]),e):[["#","Unavailable section name"]]}function l(){var e=[],t={mls:"MLS overview",irc:"IRC overview",its:"ITS overview",qaforums:"QA Forums overview",scr:"Code Review overview",scm:"SCM overview",wiki:"Wiki overview",downloads:"Downloads",forge:"Forge releases",demographics:"Demographics",data_sources:"Data sources",project_map:"Project map",people:"Contributor",company:"Company",country:"Country",domain:"Domain",release:"Companies analysis by release"},n={companies:"Activity by companies",contributors:"Activity by contributors",countries:"Activity by companies",domains:"Activity by domains",projects:"Activity by project",repos:"Activity by repositories",states:"Activity by states",tags:"Activity by tags"},r={repository:"Repository"};url_no_params=document.URL.split("?")[0],url_tokens=url_no_params.split("/");var i=url_tokens[url_tokens.length-1].split(".")[0];if(i==="project"||i==="index"||i==="")return[];var s=i.split("-");return s[0]==="repository"&&(ds_name=$.urlParam("ds"),s=[ds_name,"repos","repository"]),t.hasOwnProperty(s[0])?(e.push([s[0],t[s[0]]]),s.length>0&&n.hasOwnProperty(s[1])&&(e.push([s[0]+"-"+s[1],n[s[1]]]),s.length>2&&r.hasOwnProperty(s[2])&&e.push([s[0],r[s[2]]])),e):[["#","Unavailable section name"]]}function c(){return $.urlParam("release")!==null&&$.urlParam("release").length>0?!0:!1}function h(e){e===undefined&&(e="root");var t="",n="";t+='<ul class="nav navmenu-nav">';var r=Report.getMenuElements();return e==="root"&&(r.hasOwnProperty("scm")&&(aux=r.scm,aux_html=HTMLComposer.sideBarLinks("fa-code","Source code management","scm",aux),t+=aux_html),r.hasOwnProperty("scr")&&(aux=r.scr,aux_html=HTMLComposer.sideBarLinks("fa-check","Code review","scr",aux),t+=aux_html),r.hasOwnProperty("its")&&(aux=r.its,aux_html=HTMLComposer.sideBarLinks("fa-ticket","Tickets","its",aux),t+=aux_html),r.hasOwnProperty("mls")&&(aux=r.mls,aux_html=HTMLComposer.sideBarLinks("fa-envelope-o","Mailing lists","mls",aux),t+=aux_html),r.hasOwnProperty("qaforums")&&Utils.isReleasePage()===!1&&(aux=r.qaforums,aux_html=HTMLComposer.sideBarLinks("fa-question","Q&A Forums","qaforums",aux),t+=aux_html),r.hasOwnProperty("irc")&&Utils.isReleasePage()===!1&&(aux=r.irc,aux_html=HTMLComposer.sideBarLinks("fa-comment-o","IRC","irc",aux),t+=aux_html),r.hasOwnProperty("downloads")&&Utils.isReleasePage()===!1&&(aux=r.downloads,aux_html=HTMLComposer.sideBarLinks("fa-download","Downloads","downloads",aux),t+=aux_html),r.hasOwnProperty("forge")&&Utils.isReleasePage()===!1&&(aux=r.forge,aux_html=HTMLComposer.sideBarLinks("fa-umbrella","Forge releases","forge",aux),t+=aux_html),r.hasOwnProperty("wiki")&&Utils.isReleasePage()===!1&&(aux=r.wiki,aux_html=HTMLComposer.sideBarLinks("fa-pencil-square-o","Wiki","wiki",aux),t+=aux_html),r.hasOwnProperty("studies")&&Utils.isReleasePage()===!1&&(aux=r.studies,t+='<li class="dropdown">',t+='<a href="#" class="dropdown-toggle" data-toggle="dropdown">',t+='<i class="fa fa-lightbulb-o"></i>&nbsp;Studies <b class="caret"></b></a>',t+='<ul class="dropdown-menu navmenu-nav">',aux.indexOf("demographics")>=0&&(t+='<li><a href="demographics.html">&nbsp;Demographics</a></li>'),aux.indexOf("release")>=0&&(aux=Report.getReleaseNames().reverse(),latest_release=aux[0],t+='<li><a href="release.html?release='+latest_release+'">&nbsp;Companies by release</a></li>'),t+="</ul></li>"),Utils.isReleasePage()===!0?(current_release=$.urlParam("release"),t+='<li><a href="data_sources.html?release='+current_release+'"><i class="fa fa-database"></i> Data sources</a></li>',t+='<li><a href="project_map.html?release='+current_release+'"><i class="fa fa-icon fa-sitemap"></i> Project map</a></li>'):(t+='<li><a href="data_sources.html"><i class="fa fa-database"></i> Data sources</a></li>',t+='<li><a href="project_map.html"><i class="fa fa-icon fa-sitemap"></i> Project map</a></li>'),r.hasOwnProperty("extra")&&(aux=r.extra,n+='<li class="sidemenu-divider"></li>',n+='<li class="sidemenu-smallheader">More links:</li>',$.each(aux,function(e,t){n+='<li><a href="'+t[1]+'">&nbsp;'+t[0]+"</a></li>"})),t+=n),t+="</ul>",t}function p(e){var t='<ol class="breadcrumb">';data=Report.getProjectData(),document.title=data.project_name+" Dashboard";if(e===undefined){var n=l(),r=Utils.paramsInURL();if(n.length>0){t+='<li><a href="./',Utils.isReleasePage()&&(t+="?release="+$.urlParam("release")),t+='">Project Overview</a></li>';var i=1;$.each(n,function(e,r){n.length===i?(t+='<li class="active">'+r[1]+"</li>",document.title=r[1]+" | "+data.project_name+" Dashboard"):Utils.isReleasePage()?(t+='<li><a href="'+r[0]+".html",t+="?release="+$.urlParam("release")+'">',t+=r[1]+"</a></li>"):t+='<li><a href="'+r[0]+'.html">'+r[1]+"</a></li>",i+=1})}else t+='<li class="active">Project Overview</li>',document.title="Project Overview | "+data.project_name+" Dashboard"}else t+="<li> "+l()+"</li>",document.title=l()+" | "+data.project_name+" Dashboard";return t+="</ol>",t}function d(e){var t=Report.getParameterByName("repository");if(t&&$.inArray(t,e.getReposData())<0)return"";var n=e.getName(),r="",i=e.getLabelForRepository(),s=e.getLabelForRepositories();t!==undefined?r=t:r="All "+s,html='<div class="row"><span class="col-md-12">',html='<ol class="filterbar"><li>Filtered by '+i+":&nbsp;&nbsp;</li>",html+='<li><div class="dropdown"><button class="btn btn-default dropdown-toggle" ',html+='type="button" id="dropdownMenu1" data-toggle="dropdown"> '+r+" ",html+='<span class="caret"></span></button>',html+='<ul class="dropdown-menu scroll-menu" role="menu" aria-labelledby="dropdownMenu1">',t&&(html+='<li role="presentation"><a role="menuitem" tabindex="-1" href="'+n+'-contributors.html">',html+="All "+s,html+="</a></li>");var o=e.getReposData();return o.sort(),$.each(o,function(e,n){if(n===t)return;html+='<li role="presentation"><a role="menuitem" tabindex="-1" href="?repository=',html+=n,html+='">',html+=n,html+="</a></li>"}),html+="</ul></div></li></ol>",html+="</span></div>",html}function v(){data=Report.getProjectData(),document.title=data.project_name+" Report by Bitergia",data.title&&(document.title=data.title),$(".report_date").text(data.date),$(".report_name").text(data.project_name),str=data.blog_url,str&&str.length>0?($("#blogEntry").html("<br><a href='"+str+"'>Blog post with some more details</a>"),$(".blog_url").attr("href",data.blog_url)):$("#more_info").hide(),str=data.producer,str&&str.length>0?$("#producer").html(str):$("#producer").html("<a href='http://bitergia.com'>Bitergia</a>"),$(".project_name").text(data.project_name),$("#project_url").attr("href",data.project_url)}function m(e,t){t.help=!0;var n=$(e).data("help");n!==undefined&&(t.help=n),t.show_legend=!1,$(e).data("frame-time")&&(t.frame_time=!0),t.graph=$(e).data("graph"),$(e).data("min")&&(t.show_legend=!1,t.show_labels=!0,t.show_grid=!0,t.help=!1),$(e).data("legend")&&(t.show_legend=!0),t.ligth_style=!1,$(e).data("light-style")&&(t.light_style=!0),$(e).data("custom-title")&&(t.custom_title=$(e).data("custom-title")),t.help&&$(e).data("custom-help")?t.custom_help=$(e).data("custom-help"):t.custom_help="",$(e).data("repo-filter")&&(t.repo_filter=$(e).data("repo-filter"));var r=$(e).data("start");r&&(t.start_time=r);var i=$(e).data("end");i&&(t.end_time=i);var s=$(e).data("remove-last-point");return s&&(t.remove_last_point=!0),t}function g(){return Math.floor(Math.random()*1e3+1)}function y(e,t){if(e==="repos"){if(DS.getReposGlobalData()[t]===undefined||DS.getReposGlobalData()[t].length===0)return!1}else if(e==="companies"){if(DS.getCompaniesGlobalData()[t]===undefined||DS.getCompaniesGlobalData()[t].length===0)return!1}else if(e==="countries"){if(DS.getCountriesGlobalData()[t]===undefined||DS.getCountriesGlobalData()[t].length===0)return!1}else if(e==="companies")if(DS.getDomainsGlobalData()[t]===undefined||DS.getDomainsGlobalData()[t].length===0)return!1;return!0}function b(){var e={};return e.show_desc=!1,e.show_title=!1,e.show_labels=!0,e.show_legend=!1,e}Convert.convertMicrodashText=function(){var e=$(".MicrodashText");e.length>0&&$.each(e,function(e,t){$(this).empty();var n=$(this).data("metric"),r=$(this).data("name"),i=Report.getMetricDS(n)[0];if(i===undefined)return;var s=i.getGlobalData()[n],o='<div class="row">';r&&(o+='<div class="col-xs-3">',o+='<span class="dayschange">'+i.basic_metrics[n].name+"</span>",o+="</div>"),$.each([365,30,7],function(e,t){var s=i.getMetrics()[n].column,u=i.getGlobalData()[n+"_"+t],a=i.getGlobalData()["diff_net"+s+"_"+t],f=i.getGlobalData()["percentage_"+s+"_"+t];f=Math.round(f*10)/10;if(u===undefined)return;var l="";f===0?l=Math.abs(f):a>0?l="+"+f:a<0&&(l="-"+Math.abs(f)),r?o+='<div class="col-xs-3">':o+='<div class="col-xs-4">',o+='<span class="dayschange">Last '+t+" days:</span>",o+=" "+Report.formatValue(u)+"<br>",f===0?o+='<i class="fa fa-arrow-circle-right"></i> <span class="zeropercent">&nbsp;'+l+"%</span>&nbsp;":a>0?o+='<i class="fa fa-arrow-circle-up"></i> <span class="pospercent">&nbsp;'+l+"%</span>&nbsp;":a<0&&(o+='<i class="fa fa-arrow-circle-down"></i> <span class="negpercent">&nbsp;'+l+"%</span>&nbsp;"),o+="</div><!--col-xs-4-->"}),o+="</div><!--row-->",$(t).append(o)})},Convert.convertMicrodash=function(){var e=$(".Microdash");e.length>0&&$.each(e,function(e,t){$(this).empty();var n=$(this).data("metric"),r=$(this).data("text"),i=Report.getMetricDS(n)[0],s=i.getGlobalData()[n],o="<div>";o+='<div style="float:left">',o+='<span class="medium-fp-number">'+Report.formatValue(s),o+="</span> "+i.getMetrics()[n].name,o+="</div>",o+='<div id="Microdash" class="MetricsEvol" data-data-source="'+i.getName()+'" data-metrics="'+n+'" data-min=true style="margin-left:10px; float:left;width:100px; height:25px;"></div>',o+='<div style="clear:both"></div><div>',$.each([365,30,7],function(e,t){var r=i.getMetrics()[n].column,s=i.getGlobalData()["diff_net"+r+"_"+t],u=i.getGlobalData()["percentage_"+r+"_"+t],a=i.getGlobalData()[n+"_"+t];if(a===undefined)return;o+="<span class='dayschange'>"+t+" Days Change</span>:"+Report.formatValue(a)+"&nbsp;",s===0?o+="":s>0?(o+='<i class="icon-circle-arrow-up"></i>',o+="<small>(+"+u+"%)</small>&nbsp;"):s<0&&(o+='<i class="icon-circle-arrow-down"></i>',o+="<small>(-"+Math.abs(u)+"%)</small>&nbsp;")}),o+="</div>",o+="<div>",$(t).append(o)})},Convert.convertSideBar=function(e){var t=$(".SideNavBar");t.length>0&&$.each(t,function(t,n){$(this).empty(),n.id||(n.id="SideNavBar");var r;e&&(r=Report.cleanLabel(e));var i=h(r);$("#"+n.id).append(i),data=Report.getProjectData(),$(".report_name").text(data.project_name),Utils.isReleasePage()&&$(".report_name").attr("href","./?release="+$.urlParam("release"))})},Convert.convertProjectNavBar=function(e){var t=$(".ProjectNavBar");t.length>0&&$.each(t,function(t,n){$(this).empty(),n.id||(n.id="ProjectNavBar");var r;e&&(r=Report.cleanLabel(e));var i=s(r);$("#"+n.id).append(i)})},Convert.convertNavbar=function(){$.get(Report.getHtmlDir()+"navbar.html",function(e){$("#Navbar").html(e);var t=Report.getParameterByName("project");Convert.convertProjectNavBar(t),Convert.convertReleaseSelector(),Convert.convertSideBar(t)})},Convert.convertReleaseSelector=function(){var e=Report.getReleaseNames();if(e.length>0){var t=$(".ReleaseSelector");t.length>0&&$.each(t,function(t,n){$(this).empty(),n.id||(n.id="ReleaseSelector"+g());var r=HTMLComposer.releaseSelector($.urlParam("release"),e);$("#"+n.id).append(r)})}},Convert.convertSectionBreadcrumb=function(e){var t=$(".SectionBreadcrumb");t.length>0&&$.each(t,function(t,n){$(this).empty(),n.id||(n.id="SectionBreadcrumb");var r;e&&(r=Report.cleanLabel(e));var i=p(r);$("#"+n.id).append(i)})},Convert.convertProjectMap=function(){var e=$(".ProjectMap");e.length>0&&$.each(e,function(e,t){$(this).empty(),t.id||(t.id="ProjectMap");var n,r=a();$("#"+t.id).append(r)})},Convert.convertFooter=function(){$.get(Report.getHtmlDir()+"footer.html",function(e){$("#Footer").html(e),$("#vizjs-lib-version").append(vizjslib_git_tag)})},Convert.convertSummary=function(){div_param="Summary";var e=$("."+div_param);e.length>0&&$.each(e,function(e,t){$(this).empty();var n=$(this).data("data-source"),r=Report.getDataSourceByName(n);if(r===null)return;t.id=n+"-Summary",r.displayGlobalSummary(t.id)})},Convert.convertRepositorySelector=function(){var e=$(".repository-selector");e.length>0&&$.each(e,function(e,t){$(this).empty();var n=$(this).data("data-source"),r=Report.getDataSourceByName(n);if(r===null)return;t.id=n+"-repository-selector";var i=d(r);$("#"+t.id).append(i)})},Convert.convertRefcard=function(){$.when($.get(Report.getHtmlDir()+"refcard.html"),$.get(Report.getHtmlDir()+"project-card.html")).done(function(e,t){refcard=e[0],projcard=t[0],$("#Refcard").html(refcard),v(),$.each(Report.getProjectsData(),function(e,t){var n="card-"+e.replace(".","").replace(" ","");$("#Refcard #projects_info").append(projcard),$("#Refcard #projects_info #new_card").attr("id",n),$.each(Report.getDataSources(),function(t,r){if(r.getProject()!==e){$("#"+n+" ."+r.getName()+"-info").hide();return}r.displayData(n)}),$("#"+n+" #project_name").text(e),Report.getProjectsDirs.length>1&&$("#"+n+" .project_info").append(' <a href="VizGrimoireJS/browser/index.html?data_dir=../../'+t.dir+'">Report</a>'),$("#"+n+" #project_url").attr("href",t.url)})})},Convert.convertGlobalData=function(){var e=$(".GlobalData");e.length>0&&$.each(e,function(e,t){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;var n=DS.getGlobalData(),r=$(this).data("field");$(this).text(Report.formatValue(n[r],r))})},Convert.convertProjectData=function(){var e=$(".ProjectData"),t=Report.getParameterByName("project");e.length>0&&$.each(e,function(e,n){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;var r=DS.getProjectsGlobalData()[t];if(r===undefined)return;var i=$(this).data("field");$(this).text(Report.formatValue(r[i],i))})},Convert.convertRadarActivity=function(){var e="RadarActivity",t=$("#"+e);t.length>0&&($.each(t,function(e,t){$(this).empty()}),Viz.displayRadarActivity(e))},Convert.convertRadarCommunity=function(){var e="RadarCommunity",t=$("#"+e);t.length>0&&($.each(t,function(e,t){$(this).empty()}),Viz.displayRadarCommunity("RadarCommunity"))},Convert.convertTreemap=function(){var e="Treemap",t=$("#"+e);if(t.length>0){$.each(t,function(e,t){$(this).empty()});var n=$("#Treemap").data("file");$("#Treemap").empty(),Viz.displayTreeMap("Treemap",n)}},Convert.convertBubbles=function(){div_param="Bubbles";var e=$("."+div_param);e.length>0&&$.each(e,function(e,t){$(this).empty();var n=$(this).data("data-source"),r=Report.getDataSourceByName(n);if(r===null)return;if(r.getData().length===0)return;var i=$(this).data("radius");t.id=n+"-Bubbles",r.displayBubbles(t.id,i)})},Convert.convertMetricsEvol=function(){var e={};e.show_desc=!1,e.show_title=!0,e.show_labels=!0;var t=Report.getVizConfig();t&&$.each(t,function(t,n){e[t]=n});var n="MetricsEvol",r=$("."+n);r.length>0&&$.each(r,function(t,n){var r={};$.each(e,function(e,t){r[e]=t}),$(this).empty();var i=$(this).data("metrics"),s=$(this).data("data-source");r.title=$(this).data("title");var o=Report.getDataSourceByName(s);if(o===null)return;r=m(n,r),n.id=i.replace(/,/g,"-")+"-"+s+"-metrics-evol-"+this.id,n.id=n.id.replace(/\n|\s/g,""),o.displayMetricsEvol(i.split(","),n.id,r,$(this).data("convert"))})},Convert.convertMetricsEvolCustomized=function(e){var t={};t.show_desc=!1,t.show_title=!0,t.show_labels=!0;var n=Report.getVizConfig();n&&$.each(n,function(e,n){t[e]=n});var r="MetricsEvolCustomized",i=$("."+r);i.length>0&&$.each(i,function(n,r){if(e!==$(this).data("filter"))return;var i={};$.each(t,function(e,t){i[e]=t}),$(this).empty();var s=$(this).data("metrics"),o=$(this).data("data-source");i.title=$(this).data("title");var u=Report.getDataSourceByName(o);if(u===null)return;i=m(r,i),r.id=s.replace(/,/g,"-")+"-"+o+"-metrics-evol-"+this.id,r.id=r.id.replace(/\n|\s/g,""),u.displayMetricsEvol(s.split(","),r.id,i,$(this).data("convert"))})},Convert.convertMetricsEvolSelector=function(){var e={};e.show_desc=!1,e.show_title=!0,e.show_labels=!0;var t=Report.getVizConfig();t&&$.each(t,function(t,n){e[t]=n});var n="MetricsEvol",r=$("."+n);r.length>0&&$.each(r,function(t,n){var r={};$.each(e,function(e,t){r[e]=t}),$(this).empty();var i=$(this).data("metrics"),s=$(this).data("data-source"),o=Report.getDataSourceByName(s);if(o===null)return;var u=Report.getParameterByName("repository");r.repo_filter=u,r=m(n,r),n.id=i.replace(/,/g,"-")+"-"+s+"-metrics-evol-"+u,n.id=n.id.replace(/\n|\s/g,""),o.displayMetricsEvol(i.split(","),n.id,r,$(this).data("convert"))})},Convert.convertMetricsEvolSet=function(){div_param="MetricsEvolSet";var e=$("."+div_param);e.length>0&&$.each(e,function(e,t){$(this).empty();var n=$(this).data("all"),r=$(this).data("relative"),i=$(this).data("summary-graph"),s=$(this).data("legend-show");t.id=o+"-MetricsEvolSet-"+this.id;if(n===!0)return t.id=o+"-All",Viz.displayEnvisionAll(t.id,r,s,i),!1;var o=$(this).data("data-source"),u=Report.getDataSourceByName(o);if(u===null)return;u.displayEnvision(t.id,r,s,i)})},Convert.convertTimeTo=function(){var e="TimeTo";divs=$("."+e),divs.length>0&&$.each(divs,function(e,t){$(this).empty();var n=$(this).data("data-source"),r=Report.getDataSourceByName(n);if(r===null)return;var i=$(this).data("quantil"),s=$(this).data("type");t.id=n+"-time-to-"+s+"-"+i,s==="fix"&&r.displayTimeToFix(t.id,i),s==="attention"&&r.displayTimeToAttention(t.id,i)})},Convert.convertMarkovTable=function(){var e="MarkovTable",t=$("."+e),n,r;t.length>0&&$.each(t,function(e,t){$(this).empty(),r=$(this).data("data-source"),n=Report.getDataSourceByName(r);if(n===null)return;if(n.getData().length===0)return;var i=$(this).data("title");t.id=r+"-markov-table",n.displayMarkovTable(t.id,i)})},Convert.convertLastActivity=function(){function t(t,n,r){var i="<h4>Last "+r+"</h4>";$.each(Report.getDataSources(),function(t,s){var o=s.getGlobalData();$.each(o,function(t,s){var u="_"+n;if(t.indexOf(u,t.length-u.length)!==-1){var a=t.substring(0,t.length-u.length);r=a,e[a]&&(r=e[a].name),i+=r+":"+o[t]+"<br>"}})}),$(t).append(i)}var e=Report.getAllMetrics(),n=$(".LastActivity"),r=null,i={Week:7,Month:30,Quarter:90,Year:365};n.length>0&&$.each(n,function(e,n){r=$(n).data("period"),t(n,i[r],r)})},Convert.convertTop=function(){var e="Top",t=$("."+e),n,r;if(t.length>0){var i=0;$.each(t,function(t,s){$(this).empty(),r=$(this).data("data-source"),n=Report.getDataSourceByName(r);if(n===null)return;if(n.getData().length===0)return;var o=!1;$(this).data("show_all")&&(o=!0);var u=$(this).data("metric"),a=$(this).data("limit"),f=$(this).data("graph"),l=$(this).data("people_links"),c=$(this).data("threads_links"),h=$(this).data("period"),p=$(this).data("period_all"),d=Report.getParameterByName("repository");s.id=r+"-"+e+i++,f&&(s.id+="-"+f),h===undefined&&p===undefined&&(p=!0),a===undefined&&(a=10),n.displayTop(s.id,o,u,h,p,f,a,l,c,d)})}},Convert.convertPersonMetrics=function(e,t){var n={};n.show_desc=!1,n.show_title=!1,n.show_labels=!0,divs=$(".PersonMetrics"),divs.length&&$.each(divs,function(r,i){$(this).empty(),ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;var s=$(this).data("metrics");n.show_legend=!1,n.help=!1,$(this).data("frame-time")&&(n.frame_time=!0),$(this).data("legend")&&(n.show_legend=!0),$(this).data("person_id")&&(e=$(this).data("person_id")),$(this).data("person_name")&&(t=$(this).data("person_name")),i.id=s.replace(/,/g,"-")+"-people-metrics",DS.displayMetricsPeople(e,t,s.split(","),i.id,n)})},Convert.convertPersonData=function(e,t){var n=$(".PersonData"),r,i;n.length>0&&$.each(n,function(n,s){$(this).empty(),$(this).data("person_id")&&(e=$(this).data("person_id")),s.id||(s.id="PersonData-"+e+"-"+g());var o=Report.getPeopleIdentities()[e];o?(r=DataProcess.selectPersonName(o),i=DataProcess.selectPersonEmail(o),i="("+DataProcess.hideEmail(i)+")"):(t!==undefined?r=t:r=e,i=""),html=HTMLComposer.personName(r,i),$("#"+s.id).append(html)})},Convert.personSummaryBlock=function(e){var t=$(".PersonSummaryBlock");t.length>0&&$.each(t,function(t,n){if(n.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source"),metric_name=$(this).data("metrics"),DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;if(DS.getPeopleMetricsData()[e].length===0)return;var r=HTMLComposer.personDSBlock(ds_name,metric_name);n.id||(n.id="Parsed"+g()),$("#"+n.id).append(r)})},Convert.convertPersonSummary=function(e,t){var n=$(".PersonSummary");n.length>0&&$.each(n,function(n,r){$(this).empty(),ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;$(this).data("person_id")&&(e=$(this).data("person_id")),$(this).data("person_name")&&(t=$(this).data("person_name")),r.id=ds+"-refcard-people",DS.displayPeopleSummary
(r.id,e,t,DS)})},Convert.convertPeople=function(e,t){e===undefined&&(e=Report.getParameterByName("id")),t===undefined&&(t=Report.getParameterByName("name"));if(e===undefined)return;if(Loader.check_people_item(e)===!1){$.each(Report.getDataSources(),function(t,n){Loader.data_load_people_item(e,n,Convert.convertPeople)});return}Convert.personSummaryBlock(e),Convert.convertPersonData(e,t),Convert.convertPersonSummary(e,t),Convert.convertPersonMetrics(e,t),Convert.activateHelp()},Convert.repositoryDSBlock=function(e){var t=$(".FilterDSBlock");t.length>0&&$.each(t,function(t,n){if(n.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source"),filter_name=$(this).data("filter"),aux=$(this).data("metrics"),metric_names=aux.split(","),$.each(metric_names,function(e,t){metric_names[e]=metric_names[e].replace(/:/g,",")}),DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;if(y(filter_name,e)){var r=HTMLComposer.filterDSBlock(ds_name,filter_name,metric_names);n.id||(n.id="Parsed"+g()),$("#"+n.id).append(r)}})},Convert.convertDSSummaryBlock=function(e){var t=$(".DSSummaryBlock");t.length>0&&$.each(t,function(e,t){if(t.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source"),box_labels=$(this).data("box-labels"),box_metrics=$(this).data("box-metrics"),ts_metrics=$(this).data("ts-metrics"),DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;var n=HTMLComposer.DSBlock(ds_name,box_labels,box_metrics,ts_metrics);t.id||(t.id="Parsed"+g()),$("#"+t.id).append(n)})},Convert.convertDSSummaryBlockProjectFiltered=function(e){var t=$(".DSSummaryBlockProjectFiltered"),n=Report.getParameterByName("project");t.length>0&&$.each(t,function(e,t){if(t.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source"),box_labels=$(this).data("box-labels"),box_metrics=$(this).data("box-metrics"),ts_metrics=$(this).data("ts-metrics"),DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getProjectsGlobalData()[n]===undefined)return;if(DS.getProjectsGlobalData()[n].length===0)return;var r=HTMLComposer.DSBlockProject(ds_name,box_labels,box_metrics,ts_metrics,n);t.id||(t.id="Parsed"+g()),$("#"+t.id).append(r)})},Convert.convertOverallSummaryBlock=function(){var e=$(".OverallSummaryBlock");e.length>0&&$.each(e,function(e,t){if(t.id.indexOf("Parsed")>=0)return;var n=HTMLComposer.overallSummaryBlock();t.id||(t.id="Parsed"+g()),$("#"+t.id).append(n)})},Convert.convertDemographics=function(){var e=$(".Demographics");e.length>0&&$.each(e,function(e,t){$(this).empty(),ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;var n=$(this).data("period");t.id="Demographics-"+ds+"-"+"-"+n,DS.displayDemographics(t.id,n)})},Convert.getRealItem=function(e,t,n){var r=Report.getReposMap();if(r===undefined||r.length===0)return $.inArray(n,e.getReposData())>-1?n:null;var i=null;if(t==="repos"){var s=e.getReposMetricsData()[n];s===undefined?$.each(r,function(t,r){$.each(Report.getDataSources(),function(t,s){if(r[s.getName()]===n)return i=r[e.getName()],!1});if(i!==null)return!1}):i=n}else i=n;return i},Convert.convertFilterItemsSummary=function(e){var t="FilterItemsSummary";divs=$("."+t),divs.length>0&&$.each(divs,function(n,r){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;r.id=ds+"-"+t,$(this).empty(),e==="repos"&&DS.displayReposSummary(r.id,DS),e==="countries"&&DS.displayCountriesSummary(r.id,DS),e==="companies"&&DS.displayCompaniesSummary(r.id,DS),e==="domains"&&DS.displayDomainsSummary(r.id,DS),e==="projects"&&DS.displayProjectsSummary(r.id,DS)})},Convert.convertFilterItemsGlobal=function(e){var t=b(),n="FilterItemsGlobal";divs=$("."+n),divs.length>0&&$.each(divs,function(r,i){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;var s=$(this).data("metric"),o=$(this).data("show-others"),u=$(this).data("order-by");t.show_legend=$(this).data("legend"),$("#"+$(this).data("legend-div")).length>0?t.legend={container:$(this).data("legend-div")}:t.legend={container:null},t.graph=$(this).data("graph"),t.title=$(this).data("title"),t.show_title=1,i.id=s+"-"+n,$(this).empty(),e==="repos"&&DS.displayMetricReposStatic(s,i.id,t,u,o),e==="countries"&&DS.displayMetricCountriesStatic(s,i.id,t,u,o),e==="companies"&&DS.displayMetricCompaniesStatic(s,i.id,t,u,o),e==="domains"&&DS.displayMetricDomainsStatic(s,i.id,t,u,o),e==="projects"&&DS.displayMetricProjectsStatic(s,i.id,t,u,o)})},Convert.convertFilterItemsNav=function(e,t){var n="FilterItemsNav";divs=$("."+n);if(divs.length>0){var r=0;$.each(divs,function(i,s){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;$(this).data("page")&&(t=$(this).data("page")),order_by=$(this).data("order-by"),s.id=ds+"-"+n+"-"+r,r+=1,$(this).empty(),e==="repos"?DS.displayItemsNav(s.id,e,t,order_by):e==="countries"?DS.displayItemsNav(s.id,e,t):e==="companies"?DS.displayItemsNav(s.id,e,t):e==="domains"?DS.displayItemsNav(s.id,e,t):e==="projects"&&DS.displayItemsNav(s.id,e,t)})}},Convert.convertFilterItemsMetricsEvol=function(e){var t=b(),n="FilterItemsMetricsEvol";divs=$("."+n),divs.length>0&&$.each(divs,function(r,i){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;var s=$(this).data("metric"),o=!1;$(this).data("stacked")&&(o=!0),$(this).data("min")&&(config_viz.show_legend=!1,config_viz.show_labels=!0,config_viz.show_grid=!0,config_viz.help=!1);var u=$(this).data("start"),a=$(this).data("end");t.lines={stacked:o},$("#"+$(this).data("legend-div")).length>0?t.legend={container:$(this).data("legend-div")}:t.legend={container:null},t.show_legend=$(this).data("legend"),t.mouse_tracker=$(this).data("mouse_tracker");var f=$(this).data("remove-last-point");f&&(t.remove_last_point=!0),i.id=s+"-"+n,$(this).empty(),e==="companies"?DS.displayMetricCompanies(s,i.id,t,u,a):e==="repos"?DS.displayMetricRepos(s,i.id,t,u,a):e==="domains"?DS.displayMetricDomains(s,i.id,t,u,a):e==="projects"&&DS.displayMetricProjects(s,i.id,t,u,a)})},Convert.convertFilterItemsMiniCharts=function(e,t){var n=b(),r="FilterItemsMiniCharts";divs=$("."+r),divs.length>0&&$.each(divs,function(i,s){ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;$(this).data("page")&&(t=$(this).data("page"));var o=$(this).data("metrics"),u=$(this).data("order-by"),a=!0;$(this).data("show_links")!==undefined&&(a=$(this).data("show_links"));var f=$(this).data("start"),l=$(this).data("end"),c=$(this).data("convert");$(this).data("frame-time")&&(n.frame_time=!0);var h=$(this).data("remove-last-point");h&&(n.remove_last_point=!0),s.id=o.replace(/,/g,"-")+"-"+e+"-"+r,$(this).empty(),e==="repos"?DS.displayReposList(o.split(","),s.id,n,u,t,a,f,l,c):e==="countries"?DS.displayCountriesList(o.split(","),s.id,n,u,t,a,f,l,c):e==="companies"?DS.displayCompaniesList(o.split(","),s.id,n,u,t,a,f,l,c):e==="domains"?DS.displayDomainsList(o.split(","),s.id,n,u,t,a,f,l,c):e==="projects"&&DS.displayProjectsList(o.split(","),s.id,n,u,t,a,f,l,c)})},Convert.convertFilterItemData=function(e,t){var n=$(".FilterItemData");n.length>0&&$.each(n,function(n,r){$(this).empty();var i=Report.cleanLabel(t);r.id||(r.id="FilterItemData"+g()),html=HTMLComposer.itemName(i,e),$("#"+r.id).append(html)})},Convert.convertFilterItemSummary=function(e,t){var n="FilterItemSummary";divs=$("."+n),t!==null&&divs.length>0&&$.each(divs,function(r,i){var s=t;ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;$(this).data("item")&&(s=$(this).data("item")),i.id=ds+"-"+e+"-"+n,$(this).empty(),e==="repos"?DS.displayRepoSummary(i.id,s,DS):e==="countries"?DS.displayCountrySummary(i.id,s,DS):e==="companies"?DS.displayCompanySummary(i.id,s,DS):e==="domains"?DS.displayDomainSummary(i.id,s,DS):e==="projects"&&DS.displayProjectSummary(i.id,s,DS)})},Convert.convertFilterItemMicrodashText=function(e,t){var n=$(".FilterItemMicrodashText");n.length>0&&$.each(n,function(n,r){$(this).empty();var i,s=t,o=$(this).data("metric"),u=$(this).data("name"),a=Report.getMetricDS(o)[0];if(a===undefined)return;if(e!=="projects")return;i=a.getProjectsGlobalData()[t];if(i===undefined)return;var f='<div class="row">';u&&(f+='<div class="col-md-3">',f+='<span class="dayschange">'+a.basic_metrics[o].name+"</span>",f+="</div>"),$.each([365,30,7],function(e,t){var n=a.getMetrics()[o].column,r=i[o+"_"+t],s=i["diff_net"+n+"_"+t],l=i["percentage_"+n+"_"+t];l=Math.round(l*10)/10;if(r===undefined)return;var c="";s>0&&(c="+"+l),s<0&&(c="-"+Math.abs(l)),u?f+='<div class="col-md-3">':f+='<div class="col-md-4">',f+='<span class="dayschange">Last '+t+" days:</span>",f+=" "+Report.formatValue(r)+"<br>",s===0?f+='<i class="fa fa-arrow-circle-right"></i> <span class="zeropercent">&nbsp;'+c+"%</span>&nbsp;":s>0?f+='<i class="fa fa-arrow-circle-up"></i> <span class="pospercent">&nbsp;'+c+"%</span>&nbsp;":s<0&&(f+='<i class="fa fa-arrow-circle-down"></i> <span class="negpercent">&nbsp;'+c+"%</span>&nbsp;"),f+="</div><!--col-md-4-->"}),f+="</div><!--row-->",$(r).append(f)})},Convert.convertFilterItemMetricsEvol=function(e,t){var n=b(),r="FilterItemMetricsEvol";divs=$("."+r),t!==null&&divs.length>0&&$.each(divs,function(i,s){var o=t,u=$(this).data("metrics");ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;$(this).data("item")&&(o=$(this).data("item")),n=m(s,n),s.id=Report.cleanLabel(t).replace(/ /g,"_")+"-",s.id+=u.replace(/,/g,"-")+"-"+ds+"-"+e+"-"+r,$(this).empty(),e==="repos"?DS.displayMetricsRepo(o,u.split(","),s.id,n):e==="countries"?DS.displayMetricsCountry(o,u.split(","),s.id,n):e==="companies"?DS.displayMetricsCompany(o,u.split(","),s.id,n):e==="domains"?DS.displayMetricsDomain(o,u.split(","),s.id,n):e==="projects"&&DS.displayMetricsProject(o,u.split(","),s.id,n)})},Convert.convertFilterItemTop=function(e,t){var n="FilterItemTop";divs=$("."+n),divs.length>0&&$.each(divs,function(r,i){var s=t;$(this).empty(),ds=$(this).data("data-source"),DS=Report.getDataSourceByName(ds);if(DS===null)return;e===undefined&&(e=$(this).data("filter"));if(e!==$(this).data("filter"))return;if(!e)return;$(this).data("item")&&(s=$(this).data("item"));var o=$(this).data("metric"),u=$(this).data("period"),a=$(this).data("titles");i.id=o+"-"+ds+"-"+e+"-"+n+"-"+g(),$(this).empty(),i.className="",e==="companies"&&DS.displayTopCompany(s,i.id,o,u,a)})},Convert.convertSmartLinks=function(){var e=$(".SmartLinks");e.length>0&&$.each(e,function(e,t){if(t.id.indexOf("Parsed")>=0)return;target_page=$(this).data("target"),label=$(this).data("label");var n=HTMLComposer.smartLinks(target_page,label);t.id||(t.id="Parsed"+g()),$("#"+t.id).append(n)})},Convert.convertFilterStudyItem=function(e,t){var n=Convert.convertFilterStudyItem;if(n.done===undefined)n.done={};else if(n.done[e]===!0)return;e==="repositories"&&(e="repos"),t===undefined&&(e==="repos"&&(t=Report.getParameterByName("repository")),e==="countries"&&(t=Report.getParameterByName("country")),e==="companies"&&(t=Report.getParameterByName("company")),e==="domains"&&(t=Report.getParameterByName("domain")),e==="projects"&&(t=Report.getParameterByName("project")));if(!t)return;if(Loader.FilterItemCheck(t,e)===!1)return;Convert.repositoryDSBlock(t),Convert.convertDSSummaryBlockProjectFiltered(),Convert.convertFilterItemData(e,t),Convert.convertFilterItemSummary(e,t),Convert.convertFilterItemMetricsEvol(e,t),Convert.convertFilterItemTop(e,t),Convert.convertFilterItemMicrodashText(e,t),Convert.convertProjectData(),Convert.activateHelp(),Convert.convertMetricsEvolSelector(),n.done[e]=!0},Convert.activateHelp=function(){$(".help").popover({html:!0,trigger:"manual"}).click(function(e){$(this).popover("toggle"),e.stopPropagation()})},Convert.convertFilterStudy=function(e){var t=Report.getCurrentPage();t===null&&(t=Report.getParameterByName("page"),t!==undefined&&Report.setCurrentPage(t));if(t===undefined){if(!($("[class^='FilterItems']").length>0))return;t=1,Report.setCurrentPage(t)}e==="repositories"&&(e="repos");if(Loader.check_filter_page(t,e)===!1){$.each(Report.getDataSources(),function(n,r){Loader.data_load_items_page(r,t,Convert.convertFilterStudy,e)});return}Convert.convertFilterItemsSummary(e),Convert.convertFilterItemsGlobal(e),Convert.convertFilterItemsNav(e,t),Convert.convertFilterItemsMetricsEvol(e),Convert.convertFilterItemsMiniCharts(e,t)},Convert.convertDSTable=function(){var e="DataSourcesTable",t=$("."+e),n,r;if(t.length>0){var i=0;$.each(t,function(t,n){$(this).empty(),n.id=e+i++,Viz.displayDataSourcesTable(n)})}},Convert.convertBasicDivs=function(){Convert.convertNavbar(),Convert.convertSmartLinks(),Convert.convertSectionBreadcrumb(),Convert.convertProjectMap(),Convert.convertFooter(),Convert.convertOverallSummaryBlock(),Convert.convertDSSummaryBlock(),Convert.convertDSTable(),Convert.convertGlobalData(),Convert.convertSummary()},Convert.convertBasicDivsMisc=function(){Convert.convertRadarActivity(),Convert.convertRadarCommunity(),Convert.convertTreemap(),Convert.convertBubbles()},Convert.convertBasicMetrics=function(e){var t=Report.getParameterByName("repository");t===undefined&&Convert.convertMetricsEvol(),Convert.convertTimeTo(),Convert.convertMarkovTable()},Convert.convertModifiedBasicMetrics=function(e){var t=1;if(Loader.check_filter_page(t,e)===!1){$.each(Report.getDataSources(),function(n,r){if(e!=="repos")return;e==="repos"&&(total=r.getReposData().length);for(var i=0;i<total;i++){var s=r.getReposData()[i];Loader.data_load_item(s,r,t,Convert.convertModifiedBasicMetrics,e)}});return}Convert.convertMetricsEvolCustomized(e)},Convert.convertFilterTop=function(e){var t=Report.getParameterByName("repository");if(Loader.filterTopCheck(t,e)===!1)return;Convert.convertTop(),Convert.convertRepositorySelector()}})();if(Report===undefined)var Report={};(function(){function b(){return t}function w(){return n}function E(){return projects_hierarchy}function S(){return menu_elements.menu}function x(){return menu_elements.releases}function T(){return r}function N(e){r=e}function C(){return e}function k(){return h}function L(e){var t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")}function A(e){var t=[];return $.each(Report.getDataSources(),function(n,r){r.getMetrics()[e]&&t.push(r)}),t}function O(){var e={};return $.each(Report.getDataSources(),function(t,n){e=$.extend({},e,n.getMetrics())}),e}function M(){var e=[],t=$.urlParam("release");t!==null&&t.length>0&&(e.push("data/json/"+t),Report.setDataDir("data/json/"+t),e.length>0&&Report.setProjectsDirs(e))}function _(){M();var e=Report.getProjectsDirs(),t,n,r,i,s,o,u,a,f,l;return $.each(e,function(e,c){if(Report.getConfig()===null||Report.getConfig()["data-sources"]===undefined)n=new ITS,Report.registerDataSource(n),r=new MLS,Report.registerDataSource(r),t=new SCM,Report.registerDataSource(t),i=new SCR,Report.registerDataSource(i),s=new IRC,Report.registerDataSource(s),o=new MediaWiki,Report.registerDataSource(o),u=new People,Report.registerDataSource(u),a=new Downloads,Report.registerDataSource(a),f=new QAForums,Report.registerDataSource(f),l=new Releases,Report.registerDataSource(l);else{var h=Report.getConfig()["data-sources"];$.each(h,function(e,c){c==="its"?(n=new ITS,Report.registerDataSource(n)):c==="mls"?(r=new MLS,Report.registerDataSource(r)):c==="scm"?(t=new SCM,Report.registerDataSource(t)):c==="scr"?(i=new SCR,Report.registerDataSource(i)):c==="irc"?(s=new IRC,Report.registerDataSource(s)):c==="mediawiki"?(o=new MediaWiki,Report.registerDataSource(o)):c==="people"?(u=new People,Report.registerDataSource(u)):c==="downloads"?(a=new Downloads,Report.registerDataSource(a)):c==="qaforums"?(f=new QAForums,Report.registerDataSource(f)):c==="releases"?(l=new Releases,Report.registerDataSource(l)):Report.log("Not support data source "+c)})}n&&n.setDataDir(c),r&&r.setDataDir(c),t&&t.setDataDir(c),i&&i.setDataDir(c),s&&s.setDataDir(c),o&&o.setDataDir(c),u&&u.setDataDir(c),a&&a.setDataDir(c),f&&f.setDataDir(c),l&&l.setDataDir(c),t&&n&&t.setITS(n)}),!0}function D(){$.each(Report.getActiveStudies(),function(e,t){var n=t;t==="repositories"&&(n="repos"),DataProcess.orderItems(n),Convert.convertFilterStudy(t),Convert.convertFilterStudyItem(t)})}var e=null,t=null,n=null,r={},i=[],s=null,o="",u="data/json",a="config",f="data/json",l="",c=[f],h={},p={},d;Report.all_json_file=u+"/all.json";var v=a+"/project-info.json";viz_config_file=u+"/viz_cfg.json",markers_file=u+"/markers.json",repos_map_file=u+"/repos-map.json",projects_hierarchy_file=u+"/projects_hierarchy.json",menu_elements_file=a+"/menu-elements.json";var m=10,g=null,y={};Report.createDataSources=_,Report.getAllMetrics=O,Report.getMarkers=b,Report.getVizConfig=w,Report.getProjectsHierarchy=E,Report.getMenuElements=S,Report.getReleaseNames=x,Report.getMetricDS=A,Report.getGridster=T,Report.setGridster=N,Report.getCurrentPage=function(){return g},Report.setCurrentPage=function(e){g=e},Report.getPageSize=function(){return m},Report.setPageSize=function(e){m=e},Report.getProjectData=C,Report.getProjectsData=k,Report.convertStudies=D,Report.getDataSources=function(){return i},Report.registerDataSource=function(e){i.push(e)},Report.setHtmlDir=function(e){o=e},Report.getHtmlDir=function(){return o},Report.getDataDir=function(){return u},Report.setDataDir=function(e){u=e,v=e+"/project-info.json",config_file=e+"/viz_cfg.json",markers_file=e+"/markers.json",repos_mapping_file=u+"/repos-mapping.json",projects_hierarchy_file=u+"/projects_hierarchy.json"},Report.setMarkers=function(e){t=e},Report.getMarkersFile=function(){return markers_file},Report.getReposMap=function(){return d},Report.setReposMap=function(e){d=e},Report.getReposMapFile=function(){return repos_map_file},Report.setVizConfig=function(e){n=e},Report.getVizConfigFile=function(){return viz_config_file},Report.setProjectsHierarchy=function(e){projects_hierarchy=e},Report.getProjectsHierarchyFile=function(){return projects_hierarchy_file},Report.setMenuElements=function(e){menu_elements=e},Report.getMenuElementsFile=function(){return menu_elements_file},Report.setProjectData=function(t){e=t},Report.getProjectFile=function(){return v},Report.getProjectsDirs=function(){return c},Report.setProjectsDirs=function(e){c=e},Report.getProjectsList=function(){var e=[];return $.each(k(),function(t,n){e.push(t)}),e},Report.getProjectsDataSources=function(){return p},Report.setMetricsDefinition=function(e){$.each(Report.getDataSources(),function(t,n){n.setMetricsDefinition(e[n.getName()])})},Report.getPeopleIdentities=function(){return y},Report.setPeopleIdentities=function(e){y=e},Report.cleanLabel=function(e){var t=e,n=null;return e.split("___").length===2?(n=e.split(" "),t=n[0]):e.lastIndexOf("https:__api.github.com_repos_")===0?(t=t.replace("https:__api.github.com_repos_",""),t=t.split("_")[1]):e.lastIndexOf("http")===0||e.split("_").length>3?(n=e.split("_"),t=n.pop(),t===""&&(t=n.pop()),t=t.replace("buglist.cgi?product=",""),t=t.replace("gmane.comp.sysutils.","")):e.lastIndexOf("<")===0&&(t=MLS.displayMLSListName(e)),t},Report.formatValue=function(e,t){if(e===undefined)return"-";var n=["last_date","first_date"],r=e;try{r=parseFloat(e).toFixed(1).toString().replace(/\.0$/,""),r=L(r);if(navigator.language==="es"){var i=r.split(".");i[0]=i[0].replace(/,/g,"."),r=i.join(",")}}catch(s){}return typeof r=="number"&&isNaN(r)&&(r=e.toString()),t!==undefined&&$.inArray(t,n)>-1&&(r=e.toString()),r},Report.escapeHtml=function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},Report.getParameterByName=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),n=t.exec(location.search);return n===null?undefined:Report.escapeHtml(decodeURIComponent(n[1].replace(/\+/g," ")))},Report.getDataSourceByName=function(e){var t=null;return $.each(Report.getDataSources(),function(n,r){if(r.getName()===e)return t=r,!1}),t},Report.displayActiveMenu=function(){var e=window.location.href,t=e.substr(e.lastIndexOf("/")+1,e.length);t=t.split(".html")[0];if(t.indexOf("scm")===0)$(".scm-menu")[0].className=$(".scm-menu")[0].className+" active";else if(t.indexOf("its")===0)$(".its-menu")[0].className=$(".its-menu")[0].className+" active";else if(t.indexOf("mls")===0)$(".mls-menu")[0].className=$(".mls-menu")[0].className+" active";else if(t.indexOf("scr")===0)$(".scr-menu")[0].className=$(".scr-menu")[0].className+" active";else if(t.indexOf("irc")===0)$(".irc-menu")[0].className=$(".irc-menu")[0].className+" active";else if(t.indexOf("qaforum")===0)$(".qaforum-menu")[0].className=$(".qaforum-menu")[0].className+" active";else if(t.indexOf("studies")===0)$(".studies-menu")[0].className=$(".studies-menu")[0].className+" active";else if(t.indexOf("wiki")===0)$(".wiki-menu")[0].className=$(".wiki-menu")[0].className+" active";else if(t.indexOf("downloads")===0)$(".downloads-menu")[0].className=$(".downloads-menu")[0].className+" active";else if(t.indexOf("projects")===0)$(".listprojects-menu")[0].className=$(".listprojects-menu")[0].className+" active";else if(t.indexOf("index")===0||t===""){if($(".summary-menu").length===0)return;$(".summary-menu")[0].className=$(".summary-menu")[0].className+" active"}else $(".experimental-menu")[0]&&($(".experimental-menu")[0].className=$(".experimental-menu")[0].className+" active")},Report.addDataDir=function(){var e,t=window.location.search.substr(1);return t&&t.indexOf("data_dir")!==-1&&(e=window.location.search.substr(1)),e},Report.configDataSources=function(){var e=Report.getProjectsDataSources();$.each(Report.getDataSources(),function(t,n){if(n.getData()instanceof Array)return;$.each(h,function(t,r){if(r.dir===n.getDataDir())return e[t]===undefined&&(e[t]=[]),$.each(e[t],function(e,t){if(n.getName()===t.getName())return!1}),n.setProject(t),e[t].push(n),!1})})},Report.getConfig=function(){return s},Report.setConfig=function(e){s=e,e&&(Report.log("Global config file found"),e["global-html-dir"]&&Report.setHtmlDir(e["global-html-dir"]),e["global-data-dir"]&&(Report.setDataDir(e["global-data-dir"]),Report.setProjectsDirs([e["global-data-dir"]])),e["projects-data-dirs"]&&Report.setProjectsDirs(e["projects-data-dirs"]))},Report.convertGlobal=function(){Convert.convertBasicDivs(),Convert.convertBasicDivsMisc(),Convert.convertBasicMetrics(),Convert.convertDemographics(),Convert.convertMetricsEvolSet(),Convert.convertLastActivity(),Convert.convertMicrodash(),Convert.convertMicrodashText()},Report.getActiveStudies=function(){var e=[],t,n=["repositories","countries","companies","domains","projects"];return Report.getConfig()!==null?t=Report.getConfig().reports:t=n,$.each(n,function(n,r){$.inArray(r,t)>-1&&e.push(r)}),e},Report.convertStudiesGlobal=function(){Convert.convertPeople()};var P=!0;Report.getLog=function(){return P},Report.setLog=function(e){P=e},Report.log=function(e){Report.getLog()===!0&&window.console&&console.log(e)}})(),Loader.data_ready_global(function(){Report.configDataSources(),Report.convertGlobal(),Report.convertStudiesGlobal()}),Loader.data_ready(function(){study="repos",Convert.convertFilterTop(study)}),Loader.data_ready(function(){Report.convertStudies(),$("body").css("cursor","auto"),$("html").click(function(e){$(".help").popover("hide")}),Convert.activateHelp()}),$(document).ready(function(){var e="./config.json";$.getJSON(e,function(e){Report.setConfig(e)}).fail(function(){window.console&&Report.log("Can't read global config file "+e)}).always(function(e){Report.createDataSources(),$.getJSON(Report.all_json_file,function(e){window.console&&Report.log("Loaded all JSON data from "+Report.all_json_file),Loader.set_all_data(e)}).always(function(e){Loader.data_load()}),$("body").css("cursor","progress")})});var resized;$(window).resize(function(){clearTimeout(resized),resized=setTimeout(resizedw,100)});if(Viz===undefined)var Viz={};(function(){function t(e,t){var n="";return $.each(Report.getAllMetrics(),function(e,r){if(r.action===t)return n=r.column,!1}),n}function n(e,t,n){var r="<h4>"+n+"</h4>",i='<table id="itsmarkovtable" class="table table-striped">';i+="<thead><tr><th>Transition</th><th>Number</th><th>Percent</th></tr></thead><tbody>",$.each(t,function(e,n){subdata=t[e],old_value="old_value",new_value="new_value",percent="f",number="issue";for(var r=0;r<subdata[old_value].length;r++){var s=subdata[new_value][r],o=subdata[percent][r];o=Math.round(o*100)/100;var u=subdata[number][r];i+="<tr><td>"+e+" -> "+s+"</td>",i+="<td>"+u+"</td>",i+="<td>"+o+"</td></tr>"}}),i+="</tbody></table>",r+=i,div=$("#"+e),div.append(r);return}function r(e,t){return e.hasOwnProperty(t)?e[t]:t}function i(e,t){var n={};return n.id="id",e==="senders"&&(t==="mls"||t==="irc")&&(n.name="senders",n.action="sent"),e==="authors"&&t==="scm"&&(n.name="authors",n.action="commits"),e==="closers"&&t==="its"&&(n.name="closers",n.action="closed"),t==="scr"&&(e==="mergers"&&(n.name="mergers",n.action="merged"),e==="openers"&&(n.name="openers",n.action="opened"),e==="reviewers"&&(n.name="reviewers",n.action="reviews")),t==="downloads"&&(e==="ips"&&(n.name="ips",n.action="downloads"),e==="packages"&&(n.name="packages",n.action="downloads")),t==="mediawiki"&&e==="authors"&&(n.name="authors",n.action="reviews"),t==="qaforums"&&(e==="senders"||e==="asenders"||e==="qsenders"?(n.name="senders",n.action="sent"):e==="participants"&&(n.name="name",n.action="messages_sent")),t==="releases"&&e==="authors"&&(n.name="username",n.action="releases"),n}function s(){return["last month","last year",""]}function o(e,t,n){var r="";for(var i=0;i<e[n.name].length;i++){if(t&&t<=i)break;var s=e[n.action][i];r+="<tr><td> "+(i+1)+"</td>",r+="<td>",r+=e[n.name][i],r+="</td>",r+="<td>"+s+"</td></tr>"}return r}function u(e,t,n){var r="";for(var i=0;i<e.subject.length;i++){if(t&&t<=i)break;r+="<tr><td>#"+(i+1)+"</td>",r+="<td>";if(n===!0){var s="http://www.google.com/search?output=search&q=X&btnI=1";e.hasOwnProperty("url")&&e.url[i].length>0&&(s="http://www.google.com/search?output=search&q=X%20site%3AY&btnI=1",s=s.replace(/Y/g,e.url[i])),s=s.replace(/X/g,e.subject[i]),r+="<td>",r+='<a target="_blank" href="'+s+'">',r+=e.subject[i]+"</a>",r+='&nbsp;<i class="fa fa-external-link"></i></td>'}else r+="<td>"+e.subject[i]+"</td>";r+="<td>"+e.initiator_name[i]+"</td>",r+="<td>"+e.length[i]+"</td>",r+="</tr>"}return r}function a(e,t,n,r){var i="";for(var s=0;s<e[r.id].length;s++){if(t&&t<=s)break;var o=e[r.action][s];i+="<tr><td>"+(s+1)+"</td>",i+="<td>",n?(i+='<a href="people.html?id='+e[r.id][s],get_params=Utils.paramsInURL(),get_params.length>0&&(i+="&"+get_params),i+='">',i+=DataProcess.hideEmail(e[r.name][s])+"</a>"):i+=DataProcess.hideEmail(e[r.name][s]),i+="</td>",i+="<td>"+o+"</td></tr>"}return i}function f(e,t,n,r){var i="",s=!0;i+='<ul id="myTab" class="nav nav-tabs">';for(var o=0;o<e.length;o++){var u=t+"."+e[o];if(n[u]){var a=e[o],f=a;a===""?(a="all",f="Complete history"):a==="last month"?f="Last 30 days":a==="last year"&&(f="Last 365 days");var l=a.replace(/\ /g,""),c="";s===!0&&(c=' class="active"',s=!1),i+="<li"+c+'><a href="#'+r+t+l+'"data-toogle="tab">',i+=f+"</a></li>"}}return i+="</ul>",i}function l(e,t,n,r,i){var s=t+"_"+e,o="",u="";return s in r&&(o=r[s].desc,o=o.toLowerCase()),i===""?data_period_formatted="Complete history":i==="last month"?data_period_formatted="Last 30 days":i==="last year"&&(data_period_formatted="Last 365 days"),Utils.isReleasePage()&&(data_period_formatted="Release history"),n===!0?u+="<h6>Top "+o+"</h6>":u+='<div class="toptable-title">'+data_period_formatted+"</div>",u}function c(e,t,n,r,c,h,p,d){var v="",m="",g="",y=!0,b=$("#"+e),w=b.attr("data-data-source");periods=s(),d!==undefined&&(y=!1),g+=l(n,w,y,c,d),y===!0&&(v+=f(periods,n,t,w)),m+='<div class="tab-content">';var E=i(n,w);if(y===!0){var S=!0,x="";for(var T=0;T<periods.length;T++){x="";var N=n+"."+periods[T];if(t[N]){var C=periods[T];C===""&&(C="all");var k=C.replace(/\ /g,"");S===!0&&(x=" active in",S=!1),m+='<div class="tab-pane fade'+x+'" id="'+w+n+k+'">',m+='<table class="table table-striped">',n==="threads"?m+=u(t[N],r,p):n==="packages"||n==="ips"?(unit=c[w+"_"+n].action,metric_name=c[w+"_"+n].name,m+="<thead><th>#</th><th>"+metric_name.capitalize()+"</th>",unit!==undefined&&(m+="<th>"+unit.capitalize()+"</th>"),m+="</thead><tbody>",m+=o(t[N],r,E)):(unit=c[w+"_"+n].action,metric_name=c[w+"_"+n].name,m+="<thead><th>#</th><th>"+metric_name.capitalize()+"</th>",unit!==undefined&&(m+="<th>"+unit.capitalize()+"</th>"),m+="</thead><tbody>",m+=a(t[N],r,h,E),m+="</tbody>"),m+="</table>",m+="</div>"}}}else m+='<table class="table table-striped"><tbody>',n==="threads"?m+=u(t,r,p):n==="packages"||n==="ips"?(unit=c[w+"_"+n].action,m+="<thead><th>#</th><th>"+n.capitalize()+"</th>",unit!==undefined&&(m+="<th>"+unit.capitalize()+"</th>"),m+="</thead><tbody>",m+=o(t,r,E)):(unit=c[w+"_"+n].action,m+="<thead><th>#</th><th>"+n.capitalize()+"</th>",unit!==undefined&&(m+="<th>"+unit.capitalize()+"</th>"),m+="</thead><tbody>",m+=a(t,r,h,E),m+="</tbody>"),m+="</tbody></table>";m+="</div>",y===!1&&b.append(g),b.append(v),b.append(m),y===!0&&(script="<script>$('#myTab a').click(function (e) {e.preventDefault();$(this).tab('show');});</script>",b.append(script))}function h(e,n,r,i,s,o,u,a){var f=n.name;if(!i||$.isEmptyObject(i))return;var l=n.action;u&&i[l].length<u&&(u=i[l].length,s=!1);var c=n.column;c===undefined&&(c=t(i,l));var h="Top "+f+" "+r,p=displayTopMetricTable(i,l,c,u,a,h),d=null;if(p===undefined)return;if(o===!1){d=$("#"+e),d.append(p);return}var v="",m="";s&&(v="top-"+s+"-"+c+"-",v+=l+"-"+r,m+="<div id='"+v+"' class='graph' style='float:right'></div>"),m+=p,d=$("#"+e),d.append(m);if(s){var g=i[c],y=i[l];if(u){g=[],y=[];for(var b=0;b<u;b++)g.push(i[c][b]),y.push(i[l][b])}O(v,g,y,s)}}function p(e){dsources=Report.getDataSources(),html='<table class="table table-striped">',html+="<thead><th>Data Source</th><th>From</th>",html+="<th>To <small>(Updated on)</small></th></thead><tbody>",$.each(dsources,function(e,t){if(t.getName()==="people")return;var n=t.getGlobalData(),r=t.getTitle();r===undefined&&(r="-");var i=n.last_date;if(i===undefined)return;var s=n.first_date;s===undefined&&(s="-");var o=n.type;html+="<tr><td>"+r,o!==undefined&&(o=o.toLowerCase(),o=o.charAt(0).toUpperCase()+o.slice(1),html+=" ("+o+")"),html+="</td>",html+="<td>"+s+"</td>",html+="<td>"+i+"</td></tr>"}),html+="</tbody></table>",$(e).append(html)}function d(e,t,n){var r=Report.getAllMetrics(),i='<a href="#" class="help"',s="";if(n===""){var o=function(e,n){if(t[u]===e)return s+="<strong>"+n.name+"</strong>: "+n.desc+"<br>",!1};for(var u=0;u<t.length;u++)$.each(r,o)}else s="<strong>Description</strong>: "+n;i+='data-content="'+s+'" data-html="true">',i+='<img src="qm_15.png"></a>';var a=$("#"+e).prev()[0];a&&a.className==="help"&&$("#"+e).prev().empty(),$("#"+e).before(i)}function v(e,t,n,r,i){(!i||i.help!==!1)&&d(e,t,i.custom_help);var s=[];i.remove_last_point&&(n=DataProcess.revomeLastPoint(n)),i.frame_time&&(n=DataProcess.frameTime(n,t)),i.start_time&&(n=DataProcess.filterDates(i.start_time,i.end_time,n)),$.each(t,function(e,t){if(!n[t])return;var r=[[],[]];$.each(n[t],function(e,i){r[e]=[n.id[e],n[t][e]]});var i=t;Report.getAllMetrics()[t]&&(i=Report.getAllMetrics()[t].name),s.push({label:i,data:r})}),N(e,n,s,r,i)}function m(e,t,n,r,i,s){(!i||i.help!==!1)&&d(e,t,i.custom_help);var o=[],u=t[0],a={};$.each(n,function(e,t){if(t===undefined)return!1;if(t[u]===undefined)return!1;i.remove_last_point&&(t=DataProcess.revomeLastPoint(t)),i.frame_time&&(t=DataProcess.frameTime(t,[u])),i.start_time&&(t=DataProcess.filterDates(i.start_time,i.end_time,t));var n=[[],[]];$.each(t[u],function(e,r){n[e]=[t.id[e],t[u][e]]}),o.push({label:e,data:n}),a=t}),N(e,a,o,r,i)}function g(e,t,n,r,i,s,o,u,a){var f=[],l={};$.each(n,function(e,n){if(n===undefined)return!1;if(n[t]===undefined)return!1;u&&(n=DataProcess.convert(n,u,t)),s&&(n=DataProcess.filterDates(s,o,n)),i.frame_time&&(n=DataProcess.frameTime(n,[t]));var r=[[],[]];for(var a=0;a<n.id.length;a++)r[a]=[n.id[a],n[t][a]];e=Report.cleanLabel(e),f.push({label:
e,data:r}),l=n});if(f.length===0)return;if(a){var c=[];$.each(a,function(e,t){$.each(f,function(e,n){if(t===n.label)return c.push(n),!1})}),f=c}N(e,l,f,r,i)}function y(e,t,n,r,i){var s={subtitle:e,legend:{show:!0,container:t},xaxis:{minorTickFreq:4,mode:"time",timeUnit:"second",timeFormat:"%b %y",margin:!0},yaxis:{min:null,noTicks:2,autoscale:!0},grid:{verticalLines:!1,color:"#000000",outlineWidth:1,outline:"s"},mouse:{container:t,track:!0,trackY:!1,relative:!0,position:"ne",trackFormatter:function(e){var t=n.date[parseInt(e.index,10)];t===undefined?t="":t+="<br>";for(var i=0;i<r.length;i++){var s=r[i].data[e.index][1];if(s===undefined)continue;r.length>1&&r[i].label!==undefined&&(value_name=r[i].label,t+=value_name+":"),t+="<strong>"+Report.formatValue(s)+"</strong><br>"}return t}},selection:{mode:"x",fps:10},shadowSize:4};return i&&(Viz._history=n,Viz._lines_data=r,s.mouse.trackFormatter=Viz[i]),s}function b(e,t){if(t.length===0)return t;if(t.length>1)for(var n=0;n<t.length;n++){var r=t[n].data.length-1;t[n].data[r][1]=undefined}}function w(e,t){if(t.length!==1)return t;var n=t[0].data.length,r=[],i=0;for(var s=0;s<n-1;s++)i=parseInt(e.unixtime[s],10),r.push([i,undefined]);i=parseInt(e.unixtime[n-1],10),r.push([i,t[0].data[n-1][1]]);var o={data:r};return o.points={show:!0,radius:3,lineWidth:1,fillColor:null,shadowSize:0},t.push(o),t[0].data[n-1][1]=undefined,t[1].label=t[0].label,t}function E(e,t,n){var r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=new Date(parseInt(t,10)*1e3),s=r[i.getMonth()]+" "+i.getFullYear();i=new Date(parseInt(n,10)*1e3);var o=r[i.getMonth()]+" "+i.getFullYear();return e+" ( "+s+" - "+o+" )"}function S(e){return e.sort(function(e,t){return e[1]>t[1]||t[1]===undefined?1:-1}),e}function x(e,t,n){t=Math.round(t),n=Math.round(n);var r=e.length,i=[];for(var s=0;s<r;s++)for(var o=e[s].data.length-1;o>0;o--){var u=e[s].data[o][0],a=u<t||u>n;a&&e[s].data.splice(o,1)}var f=[];for(s=0;s<r;s++)i=e[s].data,i=S(i),f.push(i[i.length-1][1]);return f.sort(function(e,t){return e-t}),f[f.length-1]}function T(e){var t=e[0].data[1][0]-e[0].data[0][0],n=e.length,r=0;for(var i=0;i<n;i++){var s=e[i].data.length;r=e[i].data[s-1][0],e[i].data.push([r+t,undefined])}return e}function N(e,t,n,r,i){var s=!1;i&&i.lines&&i.lines.stacked&&(s=!0),s?C(e,t,n,r,i):t.unixtime===undefined?C(e,t,n,r,i):A(e,t,n,r,i)}function C(e,t,n,r,i){var s=document.getElementById(e),o=null;i&&i.legend&&i.legend.container&&(o=$("#"+i.legend.container));var u={subtitle:r,legend:{show:!0,container:o},xaxis:{minorTickFreq:4,tickFormatter:function(e){var n=null;for(var r=0;r<t.id.length;r++)if(parseInt(e,10)===t.id[r]){n=r;break}return t.date[n]}},yaxis:{min:0,noTicks:2,autoscale:!1},grid:{verticalLines:!1,color:"#000000",outlineWidth:1,outline:"s"},mouse:{container:o,track:!0,trackY:!1,trackFormatter:function(e){var r=t.date[parseInt(e.index,10)];r===undefined?r="":r+="<br>";for(var i=0;i<n.length;i++){var s=n[i].data[e.index][1];if(s===undefined)continue;n.length>1&&n[i].label!==undefined&&(r+=n[i].label+":"),r+=Report.formatValue(s)+"<br>"}return r}}};i&&(i.show_title||(u.title=""),"show_legend"in i&&(i.show_legend===!0?u.legend.show=!0:u.legend.show=!1),i.lines&&i.lines.stacked&&(u.lines={stacked:!0,fill:!0,fillOpacity:1,fillBorder:!0,lineWidth:.01}),i.show_labels||(u.xaxis.showLabels=!1,u.yaxis.showLabels=!1),i.show_grid===!1&&(u.grid.verticalLines=!1,u.grid.horizontalLines=!1,u.grid.outlineWidth=0),i.show_mouse===!1&&(u.mouse.track=!1),i.graph==="bars"&&(u.bars={show:!0}),i.light_style===!0&&(u.grid.color="#ccc",u.legend.show=!1),i.custom_title&&(u.subtitle=i.custom_title));var a=!1;i.graph!=="bars"&&n.length===1&&n[0].data[0][0]===0&&(a=!0);if(a){n=w(t,n);var f=t.id[t.id.length-1]+1;n[0].data.push([f,undefined]),n[1].data.push([f,undefined]),t.date.push(""),t.id.push(f)}graph=Flotr.draw(s,n,u),a&&(t.date&&t.date.pop(),t.id&&t.id.pop())}function k(e,t){var n,r=e.length;return n=parseInt(t.unixtime[1],10)-parseInt(t.unixtime[0],10),n/(r+1)}function L(e,t,n,r){var i=e.length,s=e[0].data.length;for(var o=0;o<i;o++)for(var u=0;u<s;u++)n?e[o].data[u][0]=parseInt(t.unixtime[u],10)+o*r:e[o].data[u][0]=parseInt(t.unixtime[u],10);return e}function A(e,t,n,r,i){function c(e){var t=Flotr._.extend(Flotr._.clone(f),e||{});return Flotr.draw(u,n,t)}var s=!1,o;if(n.length===0)return;var u=document.getElementById(e),a=null;i&&i.legend&&i.legend.container&&(a=$("#"+i.legend.container));var f=y(r,a,t,n,i.mouse_tracker);i&&(i.show_title||(f.title=""),"show_legend"in i&&(i.show_legend===!0?f.legend.show=!0:f.legend.show=!1),i.lines&&i.lines.stacked&&(f.lines={stacked:!0,fill:!0,fillOpacity:1,fillBorder:!0,lineWidth:.01}),i.show_labels||(f.xaxis.showLabels=!1,f.yaxis.showLabels=!1),i.show_grid===!1&&(f.grid.verticalLines=!1,f.grid.horizontalLines=!1,f.grid.outlineWidth=0),i.show_mouse===!1&&(f.mouse.track=!1),i.graph==="bars"&&(f.bars={show:!0,stacked:!1,horizontal:!1,barWidth:728e3,lineWidth:1},f.bars.barWidth=k(n,t),s=!0,o=f.bars.barWidth),i.light_style===!0&&(f.grid.color="#ccc",f.legend.show=!1),i.custom_title&&(f.subtitle=i.custom_title),f.mouse.position="n",f.mouse.margin=20),n.length>1&&(f.legend.show=!0),n=L(n,t,s,o);var l=!1;Utils.isReleasePage()===!1&&(i.graph!=="bars"&&n.length===1&&(l=!0),l?(n=w(t,n),T(n)):!l&&n.length>1&&b(t,n)),console.log(f),graph=c(),Flotr.EventAdapter.observe(u,"flotr:select",function(e){var t={xaxis:{minorTickFreq:4,mode:"time",timeUnit:"second",timeFormat:"%b %y",min:e.x1,max:e.x2},yaxis:{min:e.y1,autoscale:!0},grid:{verticalLines:!0,color:"#000000",outlineWidth:1,outline:"s"}};t.subtitle=E(f.subtitle,e.xfirst,e.xsecond);var r=JSON.parse(JSON.stringify(n)),i=x(r,e.x1,e.x2);t.yaxis.max=i+i*.2,graph=c(t)}),Flotr.EventAdapter.observe(u,"flotr:click",function(){c()})}function O(e,t,n,r,i,s,o,u,a){var f=!1;o&&(f=!0);var l=document.getElementById(e),c=null;s&&s.legend&&s.legend.container&&(c=$("#"+s.legend.container));var h=[],p,d="";if(!f)for(p=0;p<n.length;p++)t&&(d=DataProcess.hideEmail(t[p])),h.push({data:[[p,n[p]]],label:d});else for(p=0;p<n.length;p++)t&&(d=DataProcess.hideEmail(t[p])),h.push({data:[[n[p],p]],label:d});var v={subtitle:i,grid:{verticalLines:!1,horizontalLines:!1,outlineWidth:0},xaxis:{showLabels:!1,min:0},yaxis:{showLabels:!1,min:0},mouse:{container:c,track:!0,trackFormatter:function(e){var r="x";f&&(r="y");var i="";return t&&(i=DataProcess.hideEmail(t[parseInt(e[r],10)])+": "),i+n[parseInt(e[r],10)]}},legend:{show:!1,position:"se",backgroundColor:"#D2E8FF",container:c}};s&&(s.show_title||(v.title=""),s.show_legend&&(v.legend.show=!0)),r==="bars"&&(v.bars={show:!0,horizontal:f},u&&(v.bars.color=u,v.bars.fillColor=u),s&&s.show_legend!==!1&&(v.legend={show:!0,position:"ne",container:c}),v.grid.horizontalLines=!0,v.yaxis={showLabels:!0,min:0},s&&s.xaxis&&(v.xaxis={showLabels:s.xaxis,min:0}),a&&(v.yaxis={showLabels:!0,min:0,tickFormatter:a})),r==="pie"&&(v.pie={show:!0},v.mouse.position="ne"),r=Flotr.draw(l,h,v)}function M(e,t,n,r,i,s,o,u){var a=.4,f=n[0].length;n[1].length>f&&(f=n[1].length);var l=!1;s&&(l=!0);var c=document.getElementById(e),h=null;i&&i.legend&&i.legend.container&&(h=$("#"+i.legend.container));var p=[],d,v=[],m=[];for(d=0;d<f;d++){var g,y;n[0].length>d?g=n[0][d]:g=undefined,n[1].length>d?y=n[1][d]:y=undefined,l?(p.push([g,d-a/2]),v.push([y,d+a/2])):(p.push([d-a/2,g]),v.push([d+a/2,y]))}m=[{data:p,label:t[0]},{data:v,label:t[1]}];var b={title:r,bars:{show:!0,horizontal:l,barWidth:a},grid:{verticalLines:!1,horizontalLines:!1,outlineWidth:0},xaxis:{showLabels:!1,min:0},yaxis:{showLabels:!0,min:0},mouse:{container:h,track:!0,trackFormatter:function(e){var n,r="x";l&&(r="y");var i=parseFloat(e[r],1),s=Math.round((i-.2)*10)/10,o=Math.round((i+.2)*10)/10;s===parseInt(i,10)?n=s:n=o;var a=n;u&&(a=n*u);var f=a+" years: ",c,h;return p[n]===undefined?c=0:c=parseInt(p[n][0],10),isNaN(c)&&(c=0),v[n]===undefined?h=0:h=parseInt(v[n][0],10),isNaN(h)&&(h=0),f+=c+" "+t[0],f+=" , ",f+=h+" "+t[1],f+=" ("+parseInt(c/h*100,10)+"% )",f}},legend:{show:!0,position:"ne",backgroundColor:"#D2E8FF",container:h}};i&&(i.show_title||(b.title=""),i.show_legend&&(b.legend.show=!0)),i&&i.show_legend!==!1&&(b.legend={show:!0,position:"ne",container:h}),b.grid.horizontalLines=!0,b.yaxis={showLabels:!0,min:0},o&&(b.yaxis={showLabels:!0,min:0,tickFormatter:o}),i&&i.xaxis&&(b.xaxis={showLabels:i.xaxis,min:0}),graph=Flotr.draw(c,m,b)}function _(e,t,n,r){var i=document.getElementById(e),s=Report.getMetricDS(t)[0],o=Report.getMetricDS(n)[0],u=[];if(s!=o){Report.log("Metrics for bubbles have different data sources");return}var a=[],f=[];$.each(Report.getDataSources(),function(e,t){t.getName()===s.getName()&&(a.push(t.getData()),f.push(t.getProject()))});var l=[[],[]];l=[a[0].id,a[0].date];for(var c=0;c<a.length;c++){if(a[c]instanceof Array)return;l=DataProcess.fillDates(l,[a[c].id,a[c].date])}for(var h=0;h<a.length;h++){var p=[],d=a[h],v=DataProcess.fillHistory(l[0],[d.id,d[t]]),m=DataProcess.fillHistory(l[0],[d.id,d[n]]);for(c=0;c<l[0].length;c++)p.push([l[0][c],v[1][c],m[1][c]]);u.push({label:f[h],data:p})}var g={bubbles:{show:!0,baseRadius:5},mouse:{track:!0,trackFormatter:function(e){var r=a[0].date[e.index]+": ";return r+=e.series.label+" ",r+=e.series.data[e.index][1]+" "+t+",",r+=e.series.data[e.index][2]+" "+n,r}},xaxis:{tickFormatter:function(e){return a[0].date[parseInt(e,10)-a[0].id[0]]}}};s.getName()==="its"&&$.extend(g.bubbles,{baseRadius:1}),r&&$.extend(g.bubbles,{baseRadius:r}),Flotr.draw(i,u,g)}function D(e,t,n,r){if(!n)return;r?period=365*r:r=.25;var i=[],s=[],o=[],u,a={show_legend:!1,xaxis:!0},f,l;for(u=0;u<n.aging.persons.age.length;u++)f=n.aging.persons.age[u],f=f.toString().split(" ")[0],l=parseInt(f/period,10),i[l]||(i[l]=0),i[l]+=1;for(u=0;u<n.birth.persons.age.length;u++)f=n.birth.persons.age[u],f=f.toString().split(" ")[0],f=f.split(" ")[0],l=parseInt(f/period,10),s[l]||(s[l]=0),s[l]+=1;o=["Retained","Attracted"],yticks=function(e,t){var n=r,i="years";return e*=r,e+" "+i};var c=[i,s];n&&M(e,o,c,"",a,!0,yticks,r)}function P(e,t,n){var r=document.getElementById(e),i=$("#"+e).data("max"),s=.2;i||(i=0);for(var o=0;o<n.length;o++)for(var u=0;u<n[o].data.length;u++){var a=n[o].data[u][1];a>i&&(i=a,i=parseInt(i*(1+s),10))}(function(){var e=[n,t]})(),graph=Flotr.draw(r,n,{radar:{show:!0},mouse:{track:!0,trackFormatter:function(e){var r="";for(var i=0;i<n.length;i++)r+=n[i].label+" ",r+=n[i].data[e.index][1]+" ",r+=t[e.index][1]+"<br>";return r}},grid:{circular:!0,minorHorizontalLines:!0},yaxis:{min:0,max:i,minorTickFreq:1},xaxis:{ticks:t}})}function H(e,t){var n=[],r=[],i=[],s=[],o=0,u=0;for(o=0;o<t.length;o++){var a=Report.getMetricDS(t[o]);for(u=0;u<a.length;u++)n[u]||(n[u]=[],s[u]=a[u].getProject()),n[u].push([o,parseInt(a[u].getGlobalData()[t[o]],10)]);r.push([o,a[0].getMetrics()[t[o]].name])}for(u=0;u<n.length;u++)i.push({label:s[u],data:n[u]});P(e,r,i)}function B(e){var t=["scm_committers","scm_authors","its_openers","its_closers","its_changers","mls_senders"];H(e,t)}function j(e){var t=["scm_commits","scm_files","its_opened","its_closed","its_changed","mls_sent"];H(e,t)}function F(e,t,n,r,i){q(e,t,n,r,i)}function I(e,t,n,r,i){q(e,t,n,r,i)}function q(e,t,n,r,i){var s=n.split(","),o=t.data;if(!o[s[0]])return;var u={};u.date=o.date,$.each(o,function(e,t){if($.inArray(e,s)===-1)return;u[e]=[];for(var n=0;n<t.length;n++){var r=parseFloat((parseInt(t[n],null)/24).toFixed(2),10);u[e].push(r)}}),u.id=[];for(var a=0;a<o[s[0]].length;a++)u.id.push(a);var f={show_legend:!0,show_labels:!0};v(e,s,u,n,f)}function R(e,t,n,r,i,s,o,u,a,f,l,h){var p=t.getMetrics();n===undefined&&(n=!0);var d;h===undefined?d=t.getGlobalTopData():d=t.getRepositoriesTopData()[h],Utils.isReleasePage()&&(s=!1,i="");if(s===!0){var v={};$.each(d,function(e,t){var n=e.split("."),i=n[0],s=n[1];if(r&&r!==i)return!0;r&&r===i&&(v[e]=d[e])}),c(e,v,r,a,p,f,l)}else $.each(d,function(t,n){var s=t.split("."),o=s[0],u=s[1];if(r&&r!==o)return!0;if(i!==undefined&&i!==u)return!0;c(e,d[t],r,a,p,f,l,i)})}function U(e,t,n,r,i,s){var o=null;h(n,r,i,t,o,s)}function z(e,t,n,r,i){var s=t.getProject(),o=t.getMetrics()[n],u=null;if(!t.getGlobalTopData()[n])return;data=t.getGlobalTopData()[n][r],h(e,s,o,r,data,u,i)}function W(e,t,n){if(n===undefined){if(t===undefined)return;Loader.get_file_data_div(t,Viz.displayTreeMap,e);return}if(n===null)return;var r=d3.scale.category20c(),i=d3.select("#"+e),s=$("#"+e).width(),o=$("#"+e).height(),u=d3.layout.treemap().size([s,o]).sticky(!0).value(function(e){return e.size}),a=function(){this.style("left",function(e){return e.x+"px"}).style("top",function(e){return e.y+"px"}).style("width",function(e){return Math.max(0,e.dx-1)+"px"}).style("height",function(e){return Math.max(0,e.dy-1)+"px"})},f=i.datum(n).selectAll(".node").data(u.nodes).enter().append("div").attr("class","treemap-node").call(a).style("background",function(e){return e.children?r(e.name):null}).text(function(e){return e.children?null:e.name});d3.selectAll("input").on("change",function(){var t=this.value==="count"?function(){return 1}:function(e){return e.size};f.data(u.value(t).nodes).transition().duration(1500).call(a)})}function X(e,t,n,r,i){var s=null,o="",u=[[],[]];n?$.each(Report.getDataSources(),function(e,t){if(t.getName()===n)return s=t.getMetrics(),!1}):s=Report.getAllMetrics(),$.each(Report.getDataSources(),function(e,t){o=t.getMainMetric();if(n===null&&t.getName()==="scm"||n&&t.getName()==n)return u=[t.getData().id,t.getData()[o]],i===!1&&(u=[t.getData().id,[]]),!1});var a=[[],[]];$.each(t,function(e,t){$.each(t,function(e,t){if(n&&n!==t.getName())return;a=DataProcess.fillDates(a,[t.getData().id,t.getData().date])})});var f=a[0][0],l=document.getElementById(e),c,h=Report.getMarkers();c={container:l,xTickFormatter:function(e){var t=a[1][e-f];return t==="0"&&(t=""),t},yTickFormatter:function(e){return e+""},selection:{data:{x:{min:a[0][0],max:a[0][a[0].length-1]}}}},c.data={summary:DataProcess.fillHistory(a[0],u),markers:h,dates:a[1],envision_hide:r,main_metric:o};var p=null,d=function(e,t){var n=t.getData();if(n[m]===undefined)return;c.data[m]===undefined&&(c.data[m]=[]);var r=DataProcess.fillHistory(a[0],[n.id,n[m]]);if(m===o){c.data[m].push({label:p,data:r});if(n[m+"_relative"]===undefined)return;c.data[m+"_relative"]===undefined&&(c.data[m+"_relative"]=[]),r=DataProcess.fillHistory(a[0],[n.id,n[m+"_relative"]]),c.data[m+"_relative"].push({label:p,data:r})}else c.data[m].push({label:p,data:r})},v=function(e,t){p=e,$.each(t,d)};for(var m in s)$.each(t,v);return c.trackFormatter=function(e){var t=e.series.data,n=t[e.index][0]-f,r={},i=Report.getProjectsList();for(var o=0;o<i.length;o++)r[i[o]]={};var u=a[1][n]+":<br>";for(var l in s){if(c.data[l]===undefined)continue;if($.inArray(l,c.data.envision_hide)>-1)continue;for(o=0;o<i.length;o++){if(c.data[l][o]===undefined)continue;var h=c.data[l][o].label,p=c.data[l][o].data;u=p[1][n],r[h][l]=u}}u="<table><tr><td align='right'>"+a[1][n]+"</td></tr>",u+="<tr>",i.length>1&&(u+="<td></td>");for(l in s){if(c.data[l]===undefined)continue;if($.inArray(l,c.data.envision_hide)>-1)continue;u+="<td>"+s[l].name+"</td>"}return u+="</tr>",$.each(r,function(e,t){var n="<tr>";for(var o in s){if(c.data[o]===undefined)continue;if($.inArray(o,c.data.envision_hide)>-1)continue;mvalue=r[e][o],mvalue===undefined&&(mvalue="n/a"),n+="<td>"+mvalue+"</td>"}i.length>1&&(n="<td>"+e+"</td>"+n),n+="</tr>",u+=n}),u+="</table>",u},c}function V(e){return e===undefined&&(e={}),e.show_desc===undefined&&(e.show_desc=!0),e.show_title===undefined&&(e.show_title=!0),e.show_labels===undefined&&(e.show_labels=!0),e}function J(e,t){var n=e.getMetrics(),r="";for(var i=0;i<t.length;i++)i!==0&&(r+=" vs. "),t[i]in n?r+=n[t[i]].name:r+=t[i];return r}function K(e,t,n,r,i,s){i=V(i);var o="";i.show_title&&(i.title===undefined?o=J(e,t):o=i.title),s!==undefined?m(r,t,n,o,i):v(r,t,n,o,i)}function Q(e,t,n,r,i,s){s=V(s);var o=J(e,n);v(i,n,r,o,s)}function G(e,t,n,r,i,s){s=V(s);var o=J(e,n);v(i,n,r,o,s)}function Y(e,t,n,r,i,s){s=V(s);var o=J(e,n);v(i,n,r,o,s)}function Z(e,t,n,r,i,s){s=V(s);var o=J(e,n);v(i,n,r,o,s)}function et(e,t,n,r,i,s){s=V(s);var o=J(e,n);v(i,n,r,o,s)}function tt(e,t,n,r,i,s){r=V(r),r.show_legend!==!1&&(r.show_legend=!0);var o=e;g(n,e,t,o,r,i,s)}function nt(e,t,n,r,i,s){s=V(s);var o=J(e,n);v(i,n,r,o,s)}function rt(e,t,n,r,i,s,o){r=V(r),r.show_legend!==!1&&(r.show_legend=!0);var u=e;g(n,e,t,u,r,i,s,null,o)}function it(e,t,n,r,i,s){r=V(r),r.show_legend!==!1&&(r.show_legend=!0);var o=e;g(n,e,t,o,r,i,s)}function st(e,t,n,r,i,s){r=V(r),r.show_legend!==!1&&(r.show_legend=!0);var o=e;g(n,e,t,o,r,i,s)}function ot(e,t,n,r,i){i=V(i);var s="";i.title===undefined?s=e:s=i.title;var o=[],u=[],a="bars";i.graph&&(a=i.graph),$.each(n,function(n,r){var i=Report.cleanLabel(r);u.push(i),o.push(t[r][e])}),O(r,u,o,a,s,i)}function ut(e,t,n,r){var i=Report.getProjectsDataSources(),s=Report.getVizConfig(),o=Viz.getEnvisionOptions(e,i,null,s.summary_hide,r);o.legend_show=n,t&&($.each(i,function(e,t){$.each(t,function(e,t){main_metric=t.getMainMetric()})}),DataProcess.addRelativeValues(o.data,main_metric)),new envision.templates.Envision_Report(o)}var e="#ffa500";Viz.displayTop=R,Viz.displayTopCompany=U,Viz.displayTopGlobal=z,Viz.displayBasicChart=O,Viz.displayMetricCompanies=rt,Viz.displayMetricSubReportStatic=ot,Viz.displayMetricsCompany=Q,Viz.displayMetricsDomain=Y,Viz.displayMetricsProject=Z,Viz.displayMetricsPeople=et,Viz.displayMetricsRepo=G,Viz.displayMetricRepos=tt,Viz.displayMetricsCountry=nt,Viz.displayMetricDomains=it,Viz.displayMetricProjects=st,Viz.displayMetricsEvol=K,Viz.displayBubbles=_,Viz.displayDemographicsChart=D,Viz.displayEnvisionAll=ut,Viz.displayTimeToFix=I,Viz.displayTimeToAttention=F,Viz.displayMetricSubReportLines=g,Viz.displayRadarActivity=j,Viz.displayRadarCommunity=B,Viz.displayTreeMap=W,Viz.displayMarkovTable=n,Viz.displayDataSourcesTable=p,Viz.getEnvisionOptions=X,Viz.checkBasicConfig=V,String.prototype.capitalize=function(){return this.replace(/(?:^|\s)\S/g,function(e){return e.toUpperCase()})},Viz.track_formatter_com_pending=function(e){scr=Report.getDataSourceByName("scr"),companies=scr.getCompaniesMetricsData(),dhistory=Viz._history,lines_data=Viz._lines_data;var t=dhistory.date[parseInt(e.index,10)];t===undefined?t="":t+="<br>";for(var n=0;n<lines_data.length;n++){var r=lines_data[n].data[e.index][1];if(r===undefined)continue;lines_data.length>1&&(lines_data[n].label!==undefined&&(company_name=lines_data[n].label),t+=lines_data[n].label+":"),t+="<strong>"+Report.formatValue(r)+"</strong>",company_name&&(t+="("+companies[company_name].pending[e.index]+")"),t+="<br>"}return t},Viz.getEnvisionOptionsMin=function(e,t,n){var r=t.id[0],i=document.getElementById(e),s,o=Report.getMarkers(),u=Report.getAllMetrics();s={container:i,xTickFormatter:function(e){var n=t.date[e-r];return n==="0"&&(n=""),n},yTickFormatter:function(e){return e+""},selection:{data:{x:{min:t.id[0],max:t.id[t.id.length-1]}}}},s.data={summary:[t.id,t.sent],markers:o,dates:t.date,envision_hide:n,main_metric:"sent"};var a=Report.getAllMetrics(),f=null;for(var l in t)f=l,a[l]&&(f=a[l].name),s.data[l]=[{label:f,data:[t.id,t[l]]}];return s.trackFormatter=function(e){var n=e.series.data,i=n[e.index][0]-r,s=t.date[i]+":<br>";for(var o in u){if(t[o]===undefined)continue;s+=t[o][i]+" "+o+" , "}return s},s}})(),IRC.prototype=new DataSource("irc"),ITS.prototype=new DataSource("its"),MediaWiki.prototype=new DataSource("mediawiki"),MLS.prototype=new DataSource("mls"),SCM.prototype=new DataSource("scm"),SCR.prototype=new DataSource("scr"),People.prototype=new DataSource("people"),Downloads.prototype=new DataSource("downloads"),QAForums.prototype=new DataSource("qaforums"),Releases.prototype=new DataSource("releases");var Identity={};(function(){function t(t,n,r){var i="";t===e?i="":i=e,$("#"+r).sortable({handle:".handle",connectWith:"#"+i,start:function(e,t){t.item.siblings(".ui-selected").appendTo(t.item)},stop:function(t,n){n.item.parent()[0].id===e&&n.item.find(".handle").remove(),n.item.parent().append(n.item.find("li")),n.item.parent().find("li").addClass("mjs-nestedSortable-leaf")}}).selectable().find("li").prepend("<div class='handle'></div>")}function n(e,t){$("#"+e.getName()+"filter").autocomplete({source:t,select:function(t,n){return $("#"+e.getName()+"filter").val(""),$("#"+e.getName()+"_people_"+n.item.value).addClass("ui-selected"),!1}})}var e="unique-sortable";Identity.showListNested=function(t,n){list="<ol id="+e+' class="nested_sortable" ',list+='style="padding: 5px; background: #eee;"></ol>',$("#"+t).append(list),$("#"+e).nestedSortable({forcePlaceholderSize:!0,handle:"div",helper:"clone",items:"li",tolerance:"pointer",toleranceElement:"> div",maxLevels:2,isTree:!0,expandOnHover:700,startCollapsed:!0}),$(".disclose").on("click",function(){$(this).closest("li").toggleClass("mjs-nestedSortable-collapsed").toggleClass("mjs-nestedSortable-expanded")})},Identity.showList=function(e,r){var i="",s=r.getPeopleData(),o=[];i='<ol id="'+r.getName()+'-sortable" class="sortable">';for(var u=0;u<s.id.length;u++){var a=s.id[u];typeof a=="string"&&(a=a.replace("@","_at_").replace(".","_")),o.push({value:a,label:s.name[u]}),i+='<li id="'+r.getName()+"_people_"+a+'" ',i+='class="ui-widget-content ui-selectee">',i+='<div><span class="disclose"><span></span></span>',i+=s.id[u]+" "+s.name[u],i+="</div></li>"}i+="</ol>",$("#"+e).append("<input id='"+r.getName()+"filter'>"),n(r,o),$("#"+e).append(i),t(e,i,r.getName()+"-sortable")}})(),vizjslib_git_revision="f0f0a7e0bb793db24891e90f3201ffb5434f0618",vizjslib_git_tag="14.12-2-gf0f0a7e";