jQuery.template("Tmpl-dimension-metadata-fields",function(n,$item){var $=n,__=[],$data=$item.data;with($data)__.push(""),typeof fields.length!="undefined"&&fields.length!=null&&(typeof fields.length=="function"?fields.length.call($item):fields.length)?(__.push('  <table class="knoema-table">   <thead>    <tr>     <th>      '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/dimension-metadata-fields.htm","Name"))),__.push("     <\/th>     <th>      "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/dimension-metadata-fields.htm","Type"))),__.push("     <\/th>     <th>     <\/th>    <\/tr>   <\/thead>   <tbody>    "),typeof fields!="undefined"&&fields!=null&&$.each(typeof fields=="function"?fields.call($item):fields,function(i,field){with(this)__.push("      "),typeof!(isGeo&&!$data.regionId&&(field.type==7||field.type==8))=="undefined"||!(isGeo&&!$data.regionId&&(field.type==7||field.type==8))==null||(typeof!(isGeo&&!$data.regionId&&(field.type==7||field.type==8))=="function"?!(!(isGeo&&!$data.regionId&&(field.type==7||field.type==8))).call($item):isGeo&&!$data.regionId&&(field.type==7||field.type==8))?!0&&(__.push("       <tr>        <td>"),typeof field.displayName!="undefined"&&field.displayName!=null&&__.push($.encode(typeof field.displayName=="function"?field.displayName.call($item):field.displayName)),__.push("<\/td>        <td>"),typeof field.typeName!="undefined"&&field.typeName!=null&&__.push($.encode(typeof field.typeName=="function"?field.typeName.call($item):field.typeName)),__.push("<\/td>        <td>         "),typeof field!="undefined"&&field!=null&&(__=__.concat($item.nest("Tmpl-dimension-metadata-system-field",field,null))),__.push("        <\/td>       <\/tr>      ")):(__.push("       <tr>        <td>         "),typeof(field.name.toLowerCase()=="regionid")!="undefined"&&field.name.toLowerCase()=="regionid"!=null&&(typeof(field.name.toLowerCase()=="regionid")=="function"?(field.name.toLowerCase()=="regionid").call($item):field.name.toLowerCase()=="regionid")?__.push("          RegionId         "):typeof(field.name.toLowerCase()=="id")!="undefined"&&field.name.toLowerCase()=="id"!=null&&(typeof(field.name.toLowerCase()=="id")=="function"?(field.name.toLowerCase()=="id").call($item):field.name.toLowerCase()=="id")?__.push("          Id         "):!0&&(__.push('          <a href="#" class="dimension-metadata-field-edit" data-field-key="'),typeof field.key!="undefined"&&field.key!=null&&__.push($.encode(typeof field.key=="function"?field.key.call($item):field.key)),__.push('" data-field-num="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-field-name="'),typeof field.name!="undefined"&&field.name!=null&&__.push($.encode(typeof field.name=="function"?field.name.call($item):field.name)),__.push('">           '),typeof field.displayName!="undefined"&&field.displayName!=null&&__.push($.encode(typeof field.displayName=="function"?field.displayName.call($item):field.displayName)),__.push("          <\/a>         ")),__.push("        <\/td>        <td>         "),typeof field.typeName!="undefined"&&field.typeName!=null&&__.push($.encode(typeof field.typeName=="function"?field.typeName.call($item):field.typeName)),__.push("        <\/td>        <td>         "),typeof field!="undefined"&&field!=null&&(__=__.concat($item.nest("Tmpl-dimension-metadata-system-field",field,null))),__.push("         "),typeof(field.name.toLowerCase()!="regionid"&&field.name.toLowerCase()!="id")!="undefined"&&(field.name.toLowerCase()!="regionid"&&field.name.toLowerCase()!="id")!=null&&(typeof(field.name.toLowerCase()!="regionid"&&field.name.toLowerCase()!="id")=="function"?(field.name.toLowerCase()!="regionid"&&field.name.toLowerCase()!="id").call($item):field.name.toLowerCase()!="regionid"&&field.name.toLowerCase()!="id")&&(__.push('          &nbsp;|&nbsp; <a href="#" class="dimension-metadata-field-delete" data-field-key="'),typeof field.key!="undefined"&&field.key!=null&&__.push($.encode(typeof field.key=="function"?field.key.call($item):field.key)),__.push('" data-field-num="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/dimension-metadata-fields.htm","Delete"))),__.push("<\/a>         ")),__.push("        <\/td>       <\/tr>      ")),__.push("    ")}),__.push("   <\/tbody>  <\/table>  ")):!0&&(__.push("  "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/dimension-metadata-fields.htm","There are no fields."))),__.push("  ")),__.push("");return __});jQuery.template("Tmpl-dimension-metadata-system-field",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof isSystemField!="undefined"&&isSystemField!=null&&(typeof isSystemField=="function"?isSystemField.call($item):isSystemField)?(__.push('  <a href="#" class="dimension-field-visibility-toggle" data-hide="true"> '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/dimension-metadata-system-field.htm","Show"))),__.push(" <\/a>  ")):!0&&(__.push('  <a href="#" class="dimension-field-visibility-toggle" data-hide="false"> '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/dimension-metadata-system-field.htm","Hide"))),__.push(" <\/a>  ")),__.push("");return __});jQuery.template("Tmpl-dimension-metadata-field-dialog",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="dimension-field-dialog" title="'),typeof title!="undefined"&&title!=null&&__.push($.encode(typeof title=="function"?title.call($item):title)),__.push('">   <div class="form">    <input type="hidden" id="field-num" value="'),typeof fieldNum!="undefined"&&fieldNum!=null&&__.push($.encode(typeof fieldNum=="function"?fieldNum.call($item):fieldNum)),__.push('" />    <input type="hidden" id="field-key" value="'),typeof(field!=null?field.key:" ")!="undefined"&&(field!=null?field.key:" ")!=null&&__.push($.encode(typeof(field!=null?field.key:" ")=="function"?(field!=null?field.key:" ").call($item):field!=null?field.key:" ")),__.push('" />    <div id="validation-message"><\/div>    <input type="hidden" id="field-name" value="'),typeof(field!=null?field.name:" ")!="undefined"&&(field!=null?field.name:" ")!=null&&__.push($.encode(typeof(field!=null?field.name:" ")=="function"?(field!=null?field.name:" ").call($item):field!=null?field.name:" ")),__.push('" />    <label class="dimension-field-dialog-label">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/dimension-metadata-field-dialog.htm","Name:"))),__.push('<\/label>    <input type="text" id="field-display-name" value="'),typeof(field!=null?field.displayName:" ")!="undefined"&&(field!=null?field.displayName:" ")!=null&&__.push($.encode(typeof(field!=null?field.displayName:" ")=="function"?(field!=null?field.displayName:" ").call($item):field!=null?field.displayName:" ")),__.push('" />    <div class="type">     <label>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/dimension-metadata-field-dialog.htm","Type:"))),__.push('<\/label>&nbsp;&nbsp;     <select id="field-type" class="field-select mtl-select">      '),typeof fieldTypes!="undefined"&&fieldTypes!=null&&$.each(typeof fieldTypes=="function"?fieldTypes.call($item):fieldTypes,function(n,fieldType){with(this)__.push("      <option "),typeof(field!=null&&field.type==fieldType.value)!="undefined"&&(field!=null&&field.type==fieldType.value)!=null&&(typeof(field!=null&&field.type==fieldType.value)=="function"?(field!=null&&field.type==fieldType.value).call($item):field!=null&&field.type==fieldType.value)&&__.push("        selected        "),__.push('        value="'),typeof fieldType.value!="undefined"&&fieldType.value!=null&&__.push($.encode(typeof fieldType.value=="function"?fieldType.value.call($item):fieldType.value)),__.push('">       '),typeof fieldType.name!="undefined"&&fieldType.name!=null&&__.push($.encode(typeof fieldType.name=="function"?fieldType.name.call($item):fieldType.name)),__.push("      <\/option>      ")}),__.push("     <\/select>    <\/div>    "),typeof langs!="undefined"&&langs!=null&&(typeof langs=="function"?langs.call($item):langs)&&(__.push('     <div class="locale">      <label>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/dimension-metadata-field-dialog.htm","Locale:"))),__.push('<\/label>      <select id="field-locale" class="field-select mtl-select">       '),typeof Knoema.Utils.keys!="undefined"&&Knoema.Utils.keys!=null&&$.each(Knoema.Utils.keys(langs).reverse(),function(n,loc){with(this)__.push("       <option "),typeof(field!=null&&(field.locale==loc||field.locale==null&&loc=="none"))!="undefined"&&(field!=null&&(field.locale==loc||field.locale==null&&loc=="none"))!=null&&(typeof(field!=null&&(field.locale==loc||field.locale==null&&loc=="none"))=="function"?(field!=null&&(field.locale==loc||field.locale==null&&loc=="none")).call($item):field!=null&&(field.locale==loc||field.locale==null&&loc=="none"))&&__.push("         selected         "),__.push('         value="'),typeof loc!="undefined"&&loc!=null&&__.push($.encode(typeof loc=="function"?loc.call($item):loc)),__.push('">        '),typeof langs[loc]!="undefined"&&langs[loc]!=null&&__.push($.encode(typeof langs[loc]=="function"?langs[loc].call($item):langs[loc])),__.push("       <\/option>       ")}),__.push('      <\/select>     <\/div>     <div class="base-field">      <label>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/dimension-metadata-field-dialog.htm","Base Field:"))),__.push('<\/label>      <select id="base-field" class="field-select mtl-select">       '),typeof fieldNames!="undefined"&&fieldNames!=null&&$.each(typeof fieldNames=="function"?fieldNames.call($item):fieldNames,function(i,fn){with(this)__.push("       <option "),typeof(baseFieldName!=null&&i==baseFieldName)!="undefined"&&(baseFieldName!=null&&i==baseFieldName)!=null&&(typeof(baseFieldName!=null&&i==baseFieldName)=="function"?(baseFieldName!=null&&i==baseFieldName).call($item):baseFieldName!=null&&i==baseFieldName)&&__.push("         selected         "),__.push('         value="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('">        '),typeof fn!="undefined"&&fn!=null&&__.push($.encode(typeof fn=="function"?fn.call($item):fn)),__.push("       <\/option>       ")}),__.push("      <\/select>     <\/div>     ")),__.push("   <\/div>  <\/div>");return __});jQuery.template("Tmpl-dimension-metadata-member-dialog",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="dimension-member-dialog" title="'),typeof title!="undefined"&&title!=null&&__.push($.encode(typeof title=="function"?title.call($item):title)),__.push('">   <div class="form">    <input type="hidden" id="memberKey" value="'),typeof member.key!="undefined"&&member.key!=null&&__.push($.encode(typeof member.key=="function"?member.key.call($item):member.key)),__.push('"/>    <div id="validation-message"><\/div>    <div class="member-line">     <label class="member-label">Name:<\/label>     <input class="member-value" type="text" id="memberName" value="'),typeof member.name!="undefined"&&member.name!=null&&__.push($.encode(typeof member.name=="function"?member.name.call($item):member.name)),__.push('"/>    <\/div>    '),typeof($.grep(dimensionDetails.fields,function(n){return n.name.toLowerCase()=="regionid"}).length>0)!="undefined"&&$.grep(dimensionDetails.fields,function(n){return n.name.toLowerCase()=="regionid"}).length>0!=null&&(typeof($.grep(dimensionDetails.fields,function(n){return n.name.toLowerCase()=="regionid"}).length>0)=="function"?($.grep(dimensionDetails.fields,function(n){return n.name.toLowerCase()=="regionid"}).length>0).call($item):$.grep(dimensionDetails.fields,function(n){return n.name.toLowerCase()=="regionid"}).length>0)&&(__.push('     <div class="member-line">      <label class="member-label">RegionId:<\/label>      <input class="member-value" type="text" id="memberRegionId" value="'),typeof(member.fields!==null)!="undefined"&&member.fields!==null!=null&&(typeof(member.fields!==null)=="function"?(member.fields!==null).call($item):member.fields!==null)&&(__.push(""),typeof member.fields.regionid!="undefined"&&member.fields.regionid!=null&&__.push($.encode(typeof member.fields.regionid=="function"?member.fields.regionid.call($item):member.fields.regionid)),__.push("")),__.push('"/>     <\/div>    ')),__.push("    "),typeof dimensionDetails.fields!="undefined"&&dimensionDetails.fields!=null&&$.each(typeof dimensionDetails.fields=="function"?dimensionDetails.fields.call($item):dimensionDetails.fields,function(i,field){with(this)__.push("     "),typeof(field.name.toLowerCase()!="regionid"&&field.name.toLowerCase()!="id")!="undefined"&&(field.name.toLowerCase()!="regionid"&&field.name.toLowerCase()!="id")!=null&&(typeof(field.name.toLowerCase()!="regionid"&&field.name.toLowerCase()!="id")=="function"?(field.name.toLowerCase()!="regionid"&&field.name.toLowerCase()!="id").call($item):field.name.toLowerCase()!="regionid"&&field.name.toLowerCase()!="id")&&(__.push('      <div class="member-line">       <label class="member-label">'),typeof field.displayName!="undefined"&&field.displayName!=null&&__.push($.encode(typeof field.displayName=="function"?field.displayName.call($item):field.displayName)),__.push(':<\/label>       <input class="member-value" type="text" id="member'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" value="'),typeof member.fields[field.name.charAt(0).toLowerCase()+field.name.slice(1)]!="undefined"&&member.fields[field.name.charAt(0).toLowerCase()+field.name.slice(1)]!=null&&__.push($.encode(typeof member.fields[field.name.charAt(0).toLowerCase()+field.name.slice(1)]=="function"?member.fields[field.name.charAt(0).toLowerCase()+field.name.slice(1)].call($item):member.fields[field.name.charAt(0).toLowerCase()+field.name.slice(1)])),__.push('"/>      <\/div>     ')),__.push("    ")}),__.push("   <\/div>  <\/div>");return __});jQuery.template("Tmpl-confirmation-dialog",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div id="confirmation-dialog" title="'),typeof title!="undefined"&&title!=null&&__.push($.encode(typeof title=="function"?title.call($item):title)),__.push('">   <br />   '),typeof message!="undefined"&&message!=null&&__.push($.encode(typeof message=="function"?message.call($item):message)),__.push("  <\/div>");return __})