jQuery.template("Tmpl-update-alert-tile",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="data-alert">  <a type="hidden" href="/'),typeof updateAlert.datasetLink!="undefined"&&updateAlert.datasetLink!=null&&__.push($.encode(typeof updateAlert.datasetLink=="function"?updateAlert.datasetLink.call($item):updateAlert.datasetLink)),__.push('" class="datasetUrl"><\/a>  <p class="title">'),typeof updateAlert.indicator!="undefined"&&updateAlert.indicator!=null&&__.push($.encode(typeof updateAlert.indicator=="function"?updateAlert.indicator.call($item):updateAlert.indicator)),__.push("<\/p>  <p>"),typeof(updateAlert.condition===0)!="undefined"&&updateAlert.condition===0!=null&&(typeof(updateAlert.condition===0)=="function"?(updateAlert.condition===0).call($item):updateAlert.condition===0)?(__.push(""),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/update-alert-tile.htm","is less than"))),__.push("")):!0&&(__.push(""),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/update-alert-tile.htm","is more than"))),__.push("")),__.push("<strong> "),typeof updateAlert.value!="undefined"&&updateAlert.value!=null&&__.push($.encode(typeof updateAlert.value=="function"?updateAlert.value.call($item):updateAlert.value)),__.push("<\/strong> "),typeof updateAlert.unit!="undefined"&&updateAlert.unit!=null&&__.push($.encode(typeof updateAlert.unit=="function"?updateAlert.unit.call($item):updateAlert.unit)),__.push("<\/p>   "),typeof updateAlert.points!="undefined"&&updateAlert.points!=null&&$.each(typeof updateAlert.points=="function"?updateAlert.points.call($item):updateAlert.points,function(i,point){with(this)__.push("   "),typeof(i==0)!="undefined"&&i==0!=null&&(typeof(i==0)=="function"?(i==0).call($item):i==0)?(__.push('   <div class="gray-block">    <p class="one-point"><strong>'),typeof point.value!="undefined"&&point.value!=null&&__.push($.encode(typeof point.value=="function"?point.value.call($item):point.value)),__.push("<\/strong>"),typeof updateAlert.unit!="undefined"&&updateAlert.unit!=null&&(typeof updateAlert.unit=="function"?updateAlert.unit.call($item):updateAlert.unit)&&(__.push(" ("),typeof updateAlert.unit!="undefined"&&updateAlert.unit!=null&&__.push($.encode(typeof updateAlert.unit=="function"?updateAlert.unit.call($item):updateAlert.unit)),__.push(")")),__.push(" in <strong>"),typeof point.date!="undefined"&&point.date!=null&&__.push($.encode(typeof point.date=="function"?point.date.call($item):point.date)),__.push("<\/strong><\/p>   <\/div>   ")):typeof(updateAlert.points.length>1)!="undefined"&&updateAlert.points.length>1!=null&&(typeof(updateAlert.points.length>1)=="function"?(updateAlert.points.length>1).call($item):updateAlert.points.length>1)&&(__.push('   <p class="one-point"><strong>'),typeof point.value!="undefined"&&point.value!=null&&__.push($.encode(typeof point.value=="function"?point.value.call($item):point.value)),__.push("<\/strong>"),typeof point.unit!="undefined"&&point.unit!=null&&(typeof point.unit=="function"?point.unit.call($item):point.unit)&&(__.push(" ("),typeof point.unit!="undefined"&&point.unit!=null&&__.push($.encode(typeof point.unit=="function"?point.unit.call($item):point.unit)),__.push(")")),__.push(" in <strong>"),typeof point.date!="undefined"&&point.date!=null&&__.push($.encode(typeof point.date=="function"?point.date.call($item):point.date)),__.push("<\/strong><\/p>   ")),__.push("  ")}),__.push("   "),typeof(updateAlert.points.length>2)!="undefined"&&updateAlert.points.length>2!=null&&(typeof(updateAlert.points.length>2)=="function"?(updateAlert.points.length>2).call($item):updateAlert.points.length>2)&&(__.push('   <p class="more-results">'),typeof $.R2!="undefined"&&$.R2!=null&&__.push($.R2("~/Tmpl/update-alert-tile.htm","and {count} more results",{count:updateAlert.points.length-2})),__.push("<\/p>  ")),__.push("  <p><strong>Source:<\/strong> "),typeof updateAlert.datasetSource!="undefined"&&updateAlert.datasetSource!=null&&__.push($.encode(typeof updateAlert.datasetSource=="function"?updateAlert.datasetSource.call($item):updateAlert.datasetSource)),__.push("<\/p> <\/div>");return __});jQuery.template("Tmpl-user-notifications-collection",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof(notifications&&notifications.length>0)!="undefined"&&(notifications&&notifications.length>0)!=null&&(typeof(notifications&&notifications.length>0)=="function"?(notifications&&notifications.length>0).call($item):notifications&&notifications.length>0)?(__.push('  <div id="hover">   <div id="menu">    <div id="view" class="button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user-notifications-collection.htm","View"))),__.push('<\/div>    <div id="share" class="button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user-notifications-collection.htm","Share"))),__.push('<\/div>    <div id="dismiss" class="button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user-notifications-collection.htm","Dismiss"))),__.push('<\/div>   <\/div>  <\/div>   <div class="component-block-content-list columns">   '),typeof notifications!="undefined"&&notifications!=null&&$.each(typeof notifications=="function"?notifications.call($item):notifications,function(n,notification){with(this)__.push("    "),typeof notification!="undefined"&&notification!=null&&(__=__.concat($item.nest("Tmpl-notification-tile",notification,null))),__.push("   ")}),__.push('   <div id="loading"><\/div>  <\/div> ')):!0&&(__.push('  <div class="feed-info">   <p>    '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user-notifications-collection.htm","Click the icon"))),__.push("<span class='follow' title=\"Follow icon\"><\/span>    "),typeof isCommunity!="undefined"&&isCommunity!=null&&(typeof isCommunity=="function"?isCommunity.call($item):isCommunity)?(__.push("    "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user-notifications-collection.htm","to follow pages and datasets to received notifications when they're updated."))),__.push("    ")):!0&&(__.push("    "),typeof $.R2!="undefined"&&$.R2!=null&&__.push($.R2("~/Tmpl/user-notifications-collection.htm","to follow [datasets|href=/atlas/sources|target=blank] or [data insights|href=/infographics|target=blank] from our experts and get notifications when they're updated.")),__.push("    ")),__.push("    "),typeof $.R2!="undefined"&&$.R2!=null&&__.push($.R2("~/Tmpl/user-notifications-collection.htm","You may also subscribe for data alerts wherever you see the alert symbol <em><\/em>.")),__.push('   <\/p>   <div class="info-bg">    '),typeof isCommunity!="undefined"&&isCommunity!=null&&(typeof isCommunity=="function"?isCommunity.call($item):isCommunity)?__.push('     <span class="circle datasets"><\/span>     <span class="circle viz"><\/span>     <span class="circle alerts"><\/span>    '):!0&&__.push('     <span class="circle datasets"><\/span>     <span class="circle insights"><\/span>     <span class="circle alerts"><\/span>    '),__.push("   <\/div>  <\/div> ")),__.push("");return __});jQuery.template("Tmpl-notification-tile",function(n,$item){var $=n,__=[],$data=$item.data;with($data)__.push('<div class="component-block-item notification" notification-key="'),typeof notificationKey!="undefined"&&notificationKey!=null&&__.push($.encode(typeof notificationKey=="function"?notificationKey.call($item):notificationKey)),__.push('">  '),typeof rssUrl!="undefined"&&rssUrl!=null&&(typeof rssUrl=="function"?rssUrl.call($item):rssUrl)&&(__.push('   <input type="hidden" value="'),typeof rssUrl!="undefined"&&rssUrl!=null&&__.push($.encode(typeof rssUrl=="function"?rssUrl.call($item):rssUrl)),__.push('" name="urlForRss">  ')),__.push("   "),typeof(type===3&&dataAlertContent)!="undefined"&&(type===3&&dataAlertContent)!=null&&(typeof(type===3&&dataAlertContent)=="function"?(type===3&&dataAlertContent).call($item):type===3&&dataAlertContent)?(__.push("  "),typeof(dataAlertContent.newData.length>0)!="undefined"&&dataAlertContent.newData.length>0!=null&&(typeof(dataAlertContent.newData.length>0)=="function"?(dataAlertContent.newData.length>0).call($item):dataAlertContent.newData.length>0)&&__.push('  {{ tmpl({ query: dataAlertContent.query, elapsedTime: elapsedTime, data: dataAlertContent.newData }) "Tmpl-data-alert-tile" }}  '),__.push("   "),typeof(dataAlertContent.correctedData.length>0)!="undefined"&&dataAlertContent.correctedData.length>0!=null&&(typeof(dataAlertContent.correctedData.length>0)=="function"?(dataAlertContent.correctedData.length>0).call($item):dataAlertContent.correctedData.length>0)&&__.push('  {{ tmpl({ query: dataAlertContent.query, elapsedTime: elapsedTime, data: dataAlertContent.correctedData }) "Tmpl-data-alert-tile" }}  '),__.push("  ")):typeof updateAlert!="undefined"&&updateAlert!=null&&(typeof updateAlert=="function"?updateAlert.call($item):updateAlert)?(__.push("  "),!0&&(__=__.concat($item.nest("Tmpl-update-alert-tile",$data))),__.push("  ")):typeof(resource&&resource.type==="Dataset")!="undefined"&&(resource&&resource.type==="Dataset")!=null&&(typeof(resource&&resource.type==="Dataset")=="function"?(resource&&resource.type==="Dataset").call($item):resource&&resource.type==="Dataset")?(__.push('  <div class="datasetlist">   <div class="dataset">    <a class="title" href="'),typeof resource.resourceUrl!="undefined"&&resource.resourceUrl!=null&&__.push($.encode(typeof resource.resourceUrl=="function"?resource.resourceUrl.call($item):resource.resourceUrl)),__.push('">'),typeof resource.title!="undefined"&&resource.title!=null&&__.push($.encode(typeof resource.title=="function"?resource.title.call($item):resource.title)),__.push('<\/a>    <div class="description">     '),typeof resource.rawDescription!="undefined"&&resource.rawDescription!=null&&__.push($.encode(typeof resource.rawDescription=="function"?resource.rawDescription.call($item):resource.rawDescription)),__.push("    <\/div>   <\/div>  <\/div>  ")):typeof resource!="undefined"&&resource!=null&&(typeof resource=="function"?resource.call($item):resource)&&(__.push('  <div class="A4S">   <div class="res-title">    <a href="/'),typeof resource.resourceUrl!="undefined"&&resource.resourceUrl!=null&&__.push($.encode(typeof resource.resourceUrl=="function"?resource.resourceUrl.call($item):resource.resourceUrl)),__.push('">'),typeof resource.title!="undefined"&&resource.title!=null&&__.push($.encode(typeof resource.title=="function"?resource.title.call($item):resource.title)),__.push('<\/a>   <\/div>   <div class="top-block">    <div class="left-block thumbnail-block">     <div class="normal-size">      <div style="position: absolute">       <div class="picture">        <a>         <div class="lazy" data-original="'),typeof resource.bigThumbnailUrl!="undefined"&&resource.bigThumbnailUrl!=null&&__.push($.encode(typeof resource.bigThumbnailUrl=="function"?resource.bigThumbnailUrl.call($item):resource.bigThumbnailUrl)),__.push('"><\/div>        <\/a>       <\/div>      <\/div>     <\/div>    <\/div>    <div class="right-block">     <div class="details">      '),typeof resource.rawDescription!="undefined"&&resource.rawDescription!=null&&(typeof resource.rawDescription=="function"?resource.rawDescription.call($item):resource.rawDescription)&&(__.push('      <div class="description" style="">       <span>'),typeof resource.rawDescription!="undefined"&&resource.rawDescription!=null&&__.push($.encode(typeof resource.rawDescription=="function"?resource.rawDescription.call($item):resource.rawDescription)),__.push("<\/span>      <\/div>      ")),__.push("      "),typeof displayAuthor!="undefined"&&displayAuthor!=null&&(typeof displayAuthor=="function"?displayAuthor.call($item):displayAuthor)&&(__.push('       <div class="details-footer">        <a rel="nofollow" class="author" itemprop="author" itemscope itemtype="https://schema.org/Person" href="'),typeof authorUrl!="undefined"&&authorUrl!=null&&__.push($.encode(typeof authorUrl=="function"?authorUrl.call($item):authorUrl)),__.push('">         <span itemprop="name">'),typeof resource.owner.name!="undefined"&&resource.owner.name!=null&&__.push($.encode(typeof resource.owner.name=="function"?resource.owner.name.call($item):resource.owner.name)),__.push("<\/span>        <\/a>       <\/div>      ")),__.push("     <\/div>    <\/div>   <\/div>  <\/div>  ")),__.push("   "),typeof updateAlert!="undefined"&&updateAlert!=null&&(typeof updateAlert=="function"?updateAlert.call($item):updateAlert)?(__.push('  <div class="line">   <div class="notification-title">    <div class="title data-alert">     '),typeof $.R2!="undefined"&&$.R2!=null&&__.push($.R2("~/Tmpl/notification-tile.htm","<em><\/em> Data alert from {elapsedTime}",{elapsedTime})),__.push("    <\/div>   <\/div>  <\/div>  ")):!0&&(__.push('  <div class="line">   <div class="notification-title">    <div class="title">     '),typeof actionString!="undefined"&&actionString!=null&&__.push($.encode(typeof actionString=="function"?actionString.call($item):actionString)),__.push("     "),typeof topicLinks!="undefined"&&topicLinks!=null&&(typeof topicLinks=="function"?topicLinks.call($item):topicLinks)&&(__.push("     "),typeof topicLinks!="undefined"&&topicLinks!=null&&$.each(typeof topicLinks=="function"?topicLinks.call($item):topicLinks,function(i,topicLink){with(this)__.push("     <a"),typeof topicLink.url!="undefined"&&topicLink.url!=null&&(typeof topicLink.url=="function"?topicLink.url.call($item):topicLink.url)&&(__.push(' href="'),typeof topicLink.url!="undefined"&&topicLink.url!=null&&__.push($.encode(typeof topicLink.url=="function"?topicLink.url.call($item):topicLink.url)),__.push('"')),__.push(">"),typeof topicLink.topic!="undefined"&&topicLink.topic!=null&&__.push($.encode(typeof topicLink.topic=="function"?topicLink.topic.call($item):topicLink.topic)),__.push("<\/a>     "),typeof(i!==topicLinks.length-1)!="undefined"&&i!==topicLinks.length-1!=null&&(typeof(i!==topicLinks.length-1)=="function"?(i!==topicLinks.length-1).call($item):i!==topicLinks.length-1)&&__.push(","),__.push("     ")}),__.push("     ")),__.push("     "),typeof elapsedTime!="undefined"&&elapsedTime!=null&&__.push($.encode(typeof elapsedTime=="function"?elapsedTime.call($item):elapsedTime)),__.push("    <\/div>   <\/div>  <\/div>  ")),__.push(" <\/div>");return __});jQuery.template("Tmpl-data-alert-tile",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="notification-title">  '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/data-alert-tile.htm","Revised data related to query"))),__.push(" <strong>"),typeof query!="undefined"&&query!=null&&__.push($.encode(typeof query=="function"?query.call($item):query)),__.push('<\/strong>  <span class="time">   '),typeof elapsedTime!="undefined"&&elapsedTime!=null&&__.push($.encode(typeof elapsedTime=="function"?elapsedTime.call($item):elapsedTime)),__.push("  <\/span> <\/div>  "),typeof data!="undefined"&&data!=null&&$.each(typeof data=="function"?data.call($item):data,function(n,dataset){with(this)__.push(" <table class=\"data-alert\">  <tr>   <th colspan='2'>     <a target='_blank' href=\""),typeof dataset.url!="undefined"&&dataset.url!=null&&__.push($.encode(typeof dataset.url=="function"?dataset.url.call($item):dataset.url)),__.push('">'),typeof dataset.datasetName!="undefined"&&dataset.datasetName!=null&&__.push($.encode(typeof dataset.datasetName=="function"?dataset.datasetName.call($item):dataset.datasetName)),__.push("<\/a>     "),typeof dataset.datasetSource!="undefined"&&dataset.datasetSource!=null&&(typeof dataset.datasetSource=="function"?dataset.datasetSource.call($item):dataset.datasetSource)&&(__.push('    <span class="source">'),typeof dataset.datasetSource!="undefined"&&dataset.datasetSource!=null&&__.push($.encode(typeof dataset.datasetSource=="function"?dataset.datasetSource.call($item):dataset.datasetSource)),__.push("<\/span>    ")),__.push('     <span class="date">'),typeof Knoema.Utils.toShortDateString!="undefined"&&Knoema.Utils.toShortDateString!=null&&__.push($.encode(Knoema.Utils.toShortDateString(dataset.createdTime))),__.push("<\/span>   <\/th>  <\/tr>   "),typeof dataset.timeseriesList!="undefined"&&dataset.timeseriesList!=null&&$.each(typeof dataset.timeseriesList=="function"?dataset.timeseriesList.call($item):dataset.timeseriesList,function(n,timeseries){with(this)__.push('  <tr>    <td class="timeseries">    <a href=\''),typeof timeseries.url!="undefined"&&timeseries.url!=null&&__.push($.encode(typeof timeseries.url=="function"?timeseries.url.call($item):timeseries.url)),__.push("' target='_blank'>"),typeof timeseries.title!="undefined"&&timeseries.title!=null&&__.push($.encode(typeof timeseries.title=="function"?timeseries.title.call($item):timeseries.title)),__.push('<\/a>   <\/td>    <td>    <span class="value">'),typeof timeseries.value.toFixed!="undefined"&&timeseries.value.toFixed!=null&&__.push($.encode(timeseries.value.toFixed(2))),__.push(" "),typeof timeseries.unit!="undefined"&&timeseries.unit!=null&&__.push($.encode(typeof timeseries.unit=="function"?timeseries.unit.call($item):timeseries.unit)),__.push("<\/span>     "),typeof timeseries.ValueChangeHasValue!="undefined"&&timeseries.ValueChangeHasValue!=null&&(typeof timeseries.ValueChangeHasValue=="function"?timeseries.ValueChangeHasValue.call($item):timeseries.ValueChangeHasValue)?(__.push('    <span class="date"> '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/data-alert-tile.htm","in"))),__.push(" "),typeof timeseries.FormattedDate!="undefined"&&timeseries.FormattedDate!=null&&__.push($.encode(typeof timeseries.FormattedDate=="function"?timeseries.FormattedDate.call($item):timeseries.FormattedDate)),__.push('<\/span>    <span class="changed">     '),typeof(timeseries.ValueChange>0)!="undefined"&&timeseries.ValueChange>0!=null&&(typeof(timeseries.ValueChange>0)=="function"?(timeseries.ValueChange>0).call($item):timeseries.ValueChange>0)&&__.push("+"),__.push("     "),typeof timeseries.value.toFixed!="undefined"&&timeseries.value.toFixed!=null&&__.push($.encode(timeseries.value.toFixed(2))),__.push("     "),typeof(timeseries.ValueChange>0)!="undefined"&&timeseries.ValueChange>0!=null&&(typeof(timeseries.ValueChange>0)=="function"?(timeseries.ValueChange>0).call($item):timeseries.ValueChange>0)?__.push("<text>&#x25B2;<\/text>"):!0&&__.push("<text>&#x25BC;<\/text>"),__.push("    <\/span>    ")):!0&&(__.push("    <span>     "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/data-alert-tile.htm","in"))),__.push(" "),typeof timeseries.FormattedDate!="undefined"&&timeseries.FormattedDate!=null&&__.push($.encode(typeof timeseries.FormattedDate=="function"?timeseries.FormattedDate.call($item):timeseries.FormattedDate)),__.push("/span>     ")),__.push("   <\/td>  <\/tr>  ")}),__.push("   "),typeof dataset.timeseriesCut!="undefined"&&dataset.timeseriesCut!=null&&(typeof dataset.timeseriesCut=="function"?dataset.timeseriesCut.call($item):dataset.timeseriesCut)&&(__.push("  <tr>   <td>    <a href='"),typeof dataset.url!="undefined"&&dataset.url!=null&&__.push($.encode(typeof dataset.url=="function"?dataset.url.call($item):dataset.url)),__.push("' target='_blank'> "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/data-alert-tile.htm","More..."))),__.push("<\/a>   <\/td>   <td>   <\/td>  <\/tr>  ")),__.push(" <\/table> ")}),__.push("");return __})