jQuery.template("api-usage",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof records!="undefined"&&records!=null&&$.each(typeof records=="function"?records.call($item):records,function(n,r){with(this)__.push(" "),typeof r.app!="undefined"&&r.app!=null&&(typeof r.app=="function"?r.app.call($item):r.app)&&(__.push(' <tr data-app-key="'),typeof r.app.key!="undefined"&&r.app.key!=null&&__.push($.encode(typeof r.app.key=="function"?r.app.key.call($item):r.app.key)),__.push('">  <td class="name">'),typeof r.app.title!="undefined"&&r.app.title!=null&&__.push($.encode(typeof r.app.title=="function"?r.app.title.call($item):r.app.title)),__.push('<span class="community">'),typeof r.app.communityName!="undefined"&&r.app.communityName!=null&&__.push($.encode(typeof r.app.communityName=="function"?r.app.communityName.call($item):r.app.communityName)),__.push('<\/span><\/td>  <td class="owner">'),typeof r.app.owner!="undefined"&&r.app.owner!=null&&__.push($.encode(typeof r.app.owner=="function"?r.app.owner.call($item):r.app.owner)),__.push("<span>"),typeof r.app.ownerEmail!="undefined"&&r.app.ownerEmail!=null&&__.push($.encode(typeof r.app.ownerEmail=="function"?r.app.ownerEmail.call($item):r.app.ownerEmail)),__.push('<\/span><\/td>  <td class="lastused">'),typeof r.lastUsed!="undefined"&&r.lastUsed!=null&&__.push($.encode(typeof r.lastUsed=="function"?r.lastUsed.call($item):r.lastUsed)),__.push("<span>"),typeof r.lastUsedTime!="undefined"&&r.lastUsedTime!=null&&__.push($.encode(typeof r.lastUsedTime=="function"?r.lastUsedTime.call($item):r.lastUsedTime)),__.push('<\/span><\/td>  <td class="credits">'),typeof r.count!="undefined"&&r.count!=null&&__.push($.encode(typeof r.count=="function"?r.count.call($item):r.count)),__.push("<\/td> <\/tr> ")),__.push(" ")}),__.push("");return __});jQuery.template("dataset-thumbnail",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<a href="'),typeof href!="undefined"&&href!=null&&__.push($.encode(typeof href=="function"?href.call($item):href)),__.push('" class="dataset-thumbnail '),typeof size!="undefined"&&size!=null&&__.push($.encode(typeof size=="function"?size.call($item):size)),__.push('">   <div class="value">    <span>'),typeof count!="undefined"&&count!=null&&__.push($.encode(typeof count=="function"?count.call($item):count)),__.push("<\/span>    <br />    "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/sys/community/dataset-thumbnail.htm","datasets available"))),__.push('   <\/div>   <div class="title">'),typeof topic!="undefined"&&topic!=null&&__.push($.encode(typeof topic=="function"?topic.call($item):topic)),__.push("<\/div>  <\/a>");return __});jQuery.template("datasets-alternative-pending",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="pending-status">  <div>   <span>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/sys/community/datasets-alternative-pending.htm","Pending"))),__.push('<\/span><a href="" class="cancel-request-access" data-dataset-id="'),typeof datasetId!="undefined"&&datasetId!=null&&__.push($.encode(typeof datasetId=="function"?datasetId.call($item):datasetId)),__.push('" data-origin-dataset-id="'),typeof originDatasetId!="undefined"&&originDatasetId!=null&&__.push($.encode(typeof originDatasetId=="function"?originDatasetId.call($item):originDatasetId)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/sys/community/datasets-alternative-pending.htm","Cancel"))),__.push("<\/a>  <\/div>  "),typeof created!="undefined"&&created!=null&&(typeof created=="function"?created.call($item):created)?(__.push('   <div class="abstract">'),typeof $.R2!="undefined"&&$.R2!=null&&__.push($.R2("~/Tmpl/sys/community/datasets-alternative-pending.htm","requested by {requesterName} on {requestedDate}",{requesterName:ownerName,requestedDate:Knoema.Utils.toLocaleShortDateAndShortTimeString(created)})),__.push("<\/div>  ")):!0&&(__.push('   <div class="abstract">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/sys/community/datasets-alternative-pending.htm","requested by"))),__.push(" "),typeof ownerName!="undefined"&&ownerName!=null&&__.push($.encode(typeof ownerName=="function"?ownerName.call($item):ownerName)),__.push("<\/div>  ")),__.push(" <\/div>");return __});jQuery.template("datasets-alternative-request",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<a href="" class="request-access" data-dataset-id="'),typeof originDatasetId!="undefined"&&originDatasetId!=null&&__.push($.encode(typeof originDatasetId=="function"?originDatasetId.call($item):originDatasetId)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/sys/community/datasets-alternative-request.htm","Request Access"))),__.push("<\/a>");return __});jQuery.template("datasets-alternative",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof items!="undefined"&&items!=null&&$.each(typeof items=="function"?items.call($item):items,function(n,item){with(this)__.push(' <tr class="type-match filter-match" data-id="'),typeof item.originDatasetId!="undefined"&&item.originDatasetId!=null&&__.push($.encode(typeof item.originDatasetId=="function"?item.originDatasetId.call($item):item.originDatasetId)),__.push('" data-name="'),typeof item.datasetName!="undefined"&&item.datasetName!=null&&__.push($.encode(typeof item.datasetName=="function"?item.datasetName.call($item):item.datasetName)),__.push('">  <td class="dataset" data-sort-value="'),typeof item.datasetName!="undefined"&&item.datasetName!=null&&__.push($.encode(typeof item.datasetName=="function"?item.datasetName.call($item):item.datasetName)),__.push('">   '),typeof item.datasetUrl!="undefined"&&item.datasetUrl!=null&&(typeof item.datasetUrl=="function"?item.datasetUrl.call($item):item.datasetUrl)?(__.push('    <span><a href="'),typeof item.datasetUrl!="undefined"&&item.datasetUrl!=null&&__.push($.encode(typeof item.datasetUrl=="function"?item.datasetUrl.call($item):item.datasetUrl)),__.push('" target="_blank">'),typeof item.datasetName!="undefined"&&item.datasetName!=null&&__.push($.encode(typeof item.datasetName=="function"?item.datasetName.call($item):item.datasetName)),__.push("<\/a><\/span>   ")):!0&&(__.push("    <span>"),typeof item.datasetName!="undefined"&&item.datasetName!=null&&__.push($.encode(typeof item.datasetName=="function"?item.datasetName.call($item):item.datasetName)),__.push("<\/span>   ")),__.push('   <a href="/apps/data/providers/'),typeof Knoema.Utils.makeIdFromName!="undefined"&&Knoema.Utils.makeIdFromName!=null&&__.push($.encode(Knoema.Utils.makeIdFromName(item.provider))),__.push('" class="abstract">'),typeof item.provider!="undefined"&&item.provider!=null&&__.push($.encode(typeof item.provider=="function"?item.provider.call($item):item.provider)),__.push('<\/a>  <\/td>  <td class="permissions">   '),typeof item.permissions!="undefined"&&item.permissions!=null&&(typeof item.permissions=="function"?item.permissions.call($item):item.permissions)?(__.push("    <div>"),typeof item.permissions!="undefined"&&item.permissions!=null&&__.push($.encode(typeof item.permissions=="function"?item.permissions.call($item):item.permissions)),__.push("<\/div>   ")):typeof!item.datasetId!="undefined"&&!item.datasetId!=null&&(typeof!item.datasetId=="function"?(!item.datasetId).call($item):!item.datasetId)?(__.push("    "),typeof item!="undefined"&&item!=null&&(__=__.concat($item.nest("datasets-alternative-request",item,null))),__.push("   ")):!0&&(__.push("    "),typeof item!="undefined"&&item!=null&&(__=__.concat($item.nest("datasets-alternative-pending",item,null))),__.push("   ")),__.push("  <\/td> <\/tr> ")}),__.push("");return __});jQuery.template("datasets-expired",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof items!="undefined"&&items!=null&&$.each(typeof items=="function"?items.call($item):items,function(n,item){with(this)__.push(' <tr class="type-match filter-match '),typeof item.hasUpdate!="undefined"&&item.hasUpdate!=null&&(typeof item.hasUpdate=="function"?item.hasUpdate.call($item):item.hasUpdate)&&__.push(" ready-for-update "),__.push('"   data-name="'),typeof item.title!="undefined"&&item.title!=null&&__.push($.encode(typeof item.title=="function"?item.title.call($item):item.title)),__.push('"  data-id="'),typeof item.id!="undefined"&&item.id!=null&&__.push($.encode(typeof item.id=="function"?item.id.call($item):item.id)),__.push('"  data-update-name="'),typeof item.updateName!="undefined"&&item.updateName!=null&&__.push($.encode(typeof item.updateName=="function"?item.updateName.call($item):item.updateName)),__.push('"  '),typeof item.keepShortcutTitle!="undefined"&&item.keepShortcutTitle!=null&&(typeof item.keepShortcutTitle=="function"?item.keepShortcutTitle.call($item):item.keepShortcutTitle)&&__.push(" data-keep-shortcut-title "),__.push('>  <td class="dataset" data-sort-value="'),typeof item.title!="undefined"&&item.title!=null&&__.push($.encode(typeof item.title=="function"?item.title.call($item):item.title)),__.push('">   <a target="_blank" href="'),typeof item.resourceUrl!="undefined"&&item.resourceUrl!=null&&__.push($.encode(typeof item.resourceUrl=="function"?item.resourceUrl.call($item):item.resourceUrl)),__.push('">'),typeof item.title!="undefined"&&item.title!=null&&__.push($.encode(typeof item.title=="function"?item.title.call($item):item.title)),__.push('<\/a>  <\/td>  <td class="source">   '),typeof(item.source?item.source.name:"")!="undefined"&&(item.source?item.source.name:"")!=null&&__.push($.encode(typeof(item.source?item.source.name:"")=="function"?(item.source?item.source.name:"").call($item):item.source?item.source.name:"")),__.push('  <\/td>  <td class="category">   '),typeof item.category!="undefined"&&item.category!=null&&__.push($.encode(typeof item.category=="function"?item.category.call($item):item.category)),__.push('  <\/td>  <td class="expired-on">   '),typeof(item.nextReleaseDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.nextReleaseDate)):"")!="undefined"&&(item.nextReleaseDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.nextReleaseDate)):"")!=null&&__.push($.encode(typeof(item.nextReleaseDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.nextReleaseDate)):"")=="function"?(item.nextReleaseDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.nextReleaseDate)):"").call($item):item.nextReleaseDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.nextReleaseDate)):"")),__.push('  <\/td>  <td class="update-expected">   '),typeof(item.expectedUpdateDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.expectedUpdateDate)):"")!="undefined"&&(item.expectedUpdateDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.expectedUpdateDate)):"")!=null&&__.push($.encode(typeof(item.expectedUpdateDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.expectedUpdateDate)):"")=="function"?(item.expectedUpdateDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.expectedUpdateDate)):"").call($item):item.expectedUpdateDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.expectedUpdateDate)):"")),__.push("  <\/td> <\/tr> ")}),__.push("");return __});jQuery.template("datasets-failed",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof items!="undefined"&&items!=null&&$.each(typeof items=="function"?items.call($item):items,function(n,item){with(this)__.push(' <tr class="type-match filter-match" data-name="'),typeof item.title!="undefined"&&item.title!=null&&__.push($.encode(typeof item.title=="function"?item.title.call($item):item.title)),__.push('">  <td class="dataset" data-sort-value="'),typeof item.title!="undefined"&&item.title!=null&&__.push($.encode(typeof item.title=="function"?item.title.call($item):item.title)),__.push('">   <a target="_blank" href="'),typeof item.resourceUrl!="undefined"&&item.resourceUrl!=null&&__.push($.encode(typeof item.resourceUrl=="function"?item.resourceUrl.call($item):item.resourceUrl)),__.push('">'),typeof item.title!="undefined"&&item.title!=null&&__.push($.encode(typeof item.title=="function"?item.title.call($item):item.title)),__.push('<\/a>  <\/td>  <td class="source">   '),typeof(item.source?item.source.name:"")!="undefined"&&(item.source?item.source.name:"")!=null&&__.push($.encode(typeof(item.source?item.source.name:"")=="function"?(item.source?item.source.name:"").call($item):item.source?item.source.name:"")),__.push('  <\/td>  <td class="category">   '),typeof item.category!="undefined"&&item.category!=null&&__.push($.encode(typeof item.category=="function"?item.category.call($item):item.category)),__.push('  <\/td>  <td class="last-update-on">   '),typeof(item.publicationDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.publicationDate)):"")!="undefined"&&(item.publicationDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.publicationDate)):"")!=null&&__.push($.encode(typeof(item.publicationDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.publicationDate)):"")=="function"?(item.publicationDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.publicationDate)):"").call($item):item.publicationDate?Knoema.Utils.toShortDateString(new Knoema.Utils.UTCDate(item.publicationDate)):"")),__.push("  <\/td> <\/tr> ")}),__.push("");return __});jQuery.template("datasets-requests",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof items!="undefined"&&items!=null&&$.each(typeof items=="function"?items.call($item):items,function(n,item){with(this)__.push(' <tr class="type-match filter-match">  <td class="checkbox" data-id="'),typeof item.id!="undefined"&&item.id!=null&&__.push($.encode(typeof item.id=="function"?item.id.call($item):item.id)),__.push('" data-userkey="'),typeof item.requestedBy.key!="undefined"&&item.requestedBy.key!=null&&__.push($.encode(typeof item.requestedBy.key=="function"?item.requestedBy.key.call($item):item.requestedBy.key)),__.push('"><i class="knoema-ico"><\/i><\/td>  <td class="dataset" data-sort-value="'),typeof item.name!="undefined"&&item.name!=null&&__.push($.encode(typeof item.name=="function"?item.name.call($item):item.name)),__.push('">   <span><a href="'),typeof item.url!="undefined"&&item.url!=null&&__.push($.encode(typeof item.url=="function"?item.url.call($item):item.url)),__.push('">'),typeof item.name!="undefined"&&item.name!=null&&__.push($.encode(typeof item.name=="function"?item.name.call($item):item.name)),__.push('<\/a><\/span>   <span class="abstract">'),typeof item.source!="undefined"&&item.source!=null&&__.push($.encode(typeof item.source=="function"?item.source.call($item):item.source)),__.push('<\/span>  <\/td>  <td class="category">   '),typeof item.category!="undefined"&&item.category!=null&&__.push($.encode(typeof item.category=="function"?item.category.call($item):item.category)),__.push('  <\/td>  <td class="requestedBy">   <span><a href="'),typeof item.requestedBy.url!="undefined"&&item.requestedBy.url!=null&&__.push($.encode(typeof item.requestedBy.url=="function"?item.requestedBy.url.call($item):item.requestedBy.url)),__.push('">'),typeof item.requestedBy.name!="undefined"&&item.requestedBy.name!=null&&__.push($.encode(typeof item.requestedBy.name=="function"?item.requestedBy.name.call($item):item.requestedBy.name)),__.push('<\/a><\/span>   <span class="abstract">'),typeof item.requestedBy.email!="undefined"&&item.requestedBy.email!=null&&__.push($.encode(typeof item.requestedBy.email=="function"?item.requestedBy.email.call($item):item.requestedBy.email)),__.push('<\/span>  <\/td>  <td class="date">   '),typeof Knoema.Utils.toLocaleShortDateAndShortTimeString!="undefined"&&Knoema.Utils.toLocaleShortDateAndShortTimeString!=null&&__.push($.encode(Knoema.Utils.toLocaleShortDateAndShortTimeString(item.date))),__.push("  <\/td> <\/tr> ")}),__.push("");return __});jQuery.template("datasets-statistics",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="total"><span>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/sys/community/datasets-statistics.htm","Total"))),__.push("<\/span><span>"),typeof totalDatasets.toLocaleString!="undefined"&&totalDatasets.toLocaleString!=null&&__.push($.encode(totalDatasets.toLocaleString())),__.push('<\/span><\/div> <div class="bar">  '),typeof lineItems!="undefined"&&lineItems!=null&&$.each(typeof lineItems=="function"?lineItems.call($item):lineItems,function(n,item){with(this)__.push("   "),typeof(item.count!==0)!="undefined"&&item.count!==0!=null&&(typeof(item.count!==0)=="function"?(item.count!==0).call($item):item.count!==0)&&(__.push('    <span class="'),typeof item.class!="undefined"&&item.class!=null&&__.push($.encode(typeof item.class=="function"?item.class.call($item):item.class)),__.push(' line" style="width:'),typeof Math.max!="undefined"&&Math.max!=null&&__.push($.encode(Math.max(Math.floor(100*item.count/totalDatasets),1))),__.push('%"><\/span>   ')),__.push("  ")}),__.push(' <\/div> <div class="legend">  '),typeof legendItems!="undefined"&&legendItems!=null&&$.each(typeof legendItems=="function"?legendItems.call($item):legendItems,function(n,item){with(this)__.push('   <div class="legend-item '),typeof item.class!="undefined"&&item.class!=null&&__.push($.encode(typeof item.class=="function"?item.class.call($item):item.class)),__.push('">    <span class="'),typeof item.class!="undefined"&&item.class!=null&&__.push($.encode(typeof item.class=="function"?item.class.call($item):item.class)),__.push(' circle"><\/span><span class="name">'),typeof item.name!="undefined"&&item.name!=null&&__.push($.encode(typeof item.name=="function"?item.name.call($item):item.name)),__.push('<\/span>    <span class="'),typeof item.class!="undefined"&&item.class!=null&&__.push($.encode(typeof item.class=="function"?item.class.call($item):item.class)),__.push(' count">'),typeof count.toLocaleString!="undefined"&&count.toLocaleString!=null&&__.push($.encode(count.toLocaleString())),__.push("<\/span>    "),typeof item.tooltip!="undefined"&&item.tooltip!=null&&(typeof item.tooltip=="function"?item.tooltip.call($item):item.tooltip)&&(__.push('     <div class="tooltip">'),typeof item.tooltip!="undefined"&&item.tooltip!=null&&__.push($.encode(typeof item.tooltip=="function"?item.tooltip.call($item):item.tooltip)),__.push("<\/div>    ")),__.push("   <\/div>  ")}),__.push(" <\/div>");return __});jQuery.template("datasets-usage",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof items!="undefined"&&items!=null&&$.each(typeof items=="function"?items.call($item):items,function(n,item){with(this)__.push(' <tr class="type-match filter-match"  data-name="'),typeof item.name!="undefined"&&item.name!=null&&__.push($.encode(typeof item.name=="function"?item.name.call($item):item.name)),__.push('">  <td class="dataset" data-sort-value="'),typeof item.name!="undefined"&&item.name!=null&&__.push($.encode(typeof item.name=="function"?item.name.call($item):item.name)),__.push('">   <a target="_blank" href="'),typeof item.url!="undefined"&&item.url!=null&&__.push($.encode(typeof item.url=="function"?item.url.call($item):item.url)),__.push('">'),typeof item.name!="undefined"&&item.name!=null&&__.push($.encode(typeof item.name=="function"?item.name.call($item):item.name)),__.push('<\/a>  <\/td>  <td class="views">   <div>'),typeof item.views!="undefined"&&item.views!=null&&__.push($.encode(typeof item.views=="function"?item.views.call($item):item.views)),__.push('<\/div>  <\/td>  <td class="downloads">   <div>'),typeof item.downloads!="undefined"&&item.downloads!=null&&__.push($.encode(typeof item.downloads=="function"?item.downloads.call($item):item.downloads)),__.push('<\/div>  <\/td>  <td class="credits">   <div>'),typeof item.credits!="undefined"&&item.credits!=null&&__.push($.encode(typeof item.credits=="function"?item.credits.call($item):item.credits)),__.push("<\/div>  <\/td> <\/tr> ")}),__.push("");return __});jQuery.template("visualization-thumbnail",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<a href="'),typeof resourceUrl!="undefined"&&resourceUrl!=null&&__.push($.encode(typeof resourceUrl=="function"?resourceUrl.call($item):resourceUrl)),__.push('" class="dashboard">   <div class="empty-page">    <div style="background: url('),typeof thumbnailUrl!="undefined"&&thumbnailUrl!=null&&__.push($.encode(typeof thumbnailUrl=="function"?thumbnailUrl.call($item):thumbnailUrl)),__.push(') no-repeat center"><\/div>   <\/div>   <div class="title">'),typeof title!="undefined"&&title!=null&&__.push($.encode(typeof title=="function"?title.call($item):title)),__.push("<\/div>  <\/a>");return __})