diff --git a/client/bundle.js b/client/bundle.js
index 0fce5ccb4e972c942ea0a0e419dd649236c591e5..a1ab4f73a9dd115d5b04cccd4700a547ce22170a 100644
--- a/client/bundle.js
+++ b/client/bundle.js
@@ -1 +1 @@
-!function(e){var t={};function s(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(i,n,function(t){return e[t]}.bind(null,n));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=15)}([function(e,t,s){"use strict";s(1);let i=s(16);const n="Basic "+btoa(i.GuestUserToken+":");let a="http://enc-staging-nomad.esc.rzg.mpg.de/",l="localhost",r="v1.0/";document.location.href.indexOf("nomad-coe.eu")>0&&(a="https://encyclopedia.nomad-coe.eu/",l=".nomad-coe.eu",r="api/v1.0/");let o=a+r;document.querySelector("#guest-user a").href=o+"saml/?sso2";let d=n,h=null;function c(e){let t="";for(let s=0;s<e.length;s++)e.charCodeAt(s)>=47&&e.charCodeAt(s)<58?t+="<sub>"+e[s]+"</sub>":t+=e[s];return t}function p(e){let t=e.substring(1,e.length-1).split(","),s=[];for(var i=0;i<t.length;i++)s.push(parseFloat(t[i]));return s}function u(e){return(e*(180/Math.PI)).toFixed(0)+"&deg;"}function m(e){let t=0;for(var s=0;s<e.length;s++)t+=e[s];return t/e.length}e.exports={searchResults:!1,materialId:null,MAT_VIEW:{structure:"structure",electronicstruct:"electronicstruct",methodology:"methodology",thermalprops:"thermalprops",elasticconst:"elasticconst"},IMAGE_DIR:"img/",USER_COOKIE_DOMAIN:l,ELEMENTS:["H","He","Li","Be","B","C","N","O","F","Ne","Na","Mg","Al","Si","P","S","Cl","Ar","K","Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu","Zn","Ga","Ge","As","Se","Br","Kr","Rb","Sr","Y","Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd","In","Sn","Sb","Te","I","Xe","Cs","Ba","La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu","Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi","Po","At","Rn","Fr","Ra","Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr","Rf","Ha","Sg","Ns","Hs","Mt","Ds","Rg","Cn","Nh","Fl","Mc","Lv","Ts","Og"],setAuthRequestHeader:function(e,t){void 0===t?(d=n,h=null):(d="Basic "+btoa(t+":"),h=e)},getUserData:function(){return h},getServerLocation:function(){return document.location.hostname},authServerReq:function(e,t){var s=new XMLHttpRequest;return s.addEventListener("load",t),console.log("util.authServerReq: ",o+e),s.open("GET",o+e),s.send(),s},serverReq:function(e,t){var s=new XMLHttpRequest;return s.addEventListener("load",t),s.open("GET",e),s.setRequestHeader("Authorization",d),s.send(),s},serverReqPOST:function(e,t,s){var i=new XMLHttpRequest;return i.addEventListener("load",s),i.open("POST",e),i.setRequestHeader("Content-Type","application/json"),i.setRequestHeader("Authorization",d),i.send(t),i},getSearchURL:function(){return o+"materials"},getSuggestionURL:function(e){return o+"suggestions?property="+e},getMaterialURL:function(e){return o+"materials/"+e},getMaterialCalcURL:function(e,t,s=""){return o+"materials/"+e+"/calculations/"+t+(""===s?"":"?property="+s)},getMaterialXsURL:function(e,t){return o+"materials/"+t+"/"+e+"?pagination=off"},getCalcEnergiesURL:function(e,t){return o+"materials/"+e+"/calculations/"+t+"/energies"},getFlaggingURL:function(){return o+"flagme"},setBrowserHashPath:function(e,t){document.location=void 0===t?"#/"+e:"#/"+e+"/"+t},loadLib:function(e){let t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src",e),document.getElementsByTagName("head")[0].appendChild(t)},getNumberArray:p,getCellDataForViewer:function(e){let t={};t.normalizedCell=[p(e.cell.a),p(e.cell.b),p(e.cell.c)],t.periodicity=JSON.parse(e.periodicity),t.labels=[],t.positions=[];for(var s=0;s<e.elements.length;s++)t.labels.push(e.elements[s].label),t.positions.push(p(e.elements[s].position));return t},J2eV:function(e,t){let s=e/1602176565e-28;return void 0===t?s<.01?s.toFixed(6):s.toFixed(3):s.toFixed(t)},eV2J:function(e){return 1602176565e-28*e},m2Angstrom:function(e){return(e/1e-10).toFixed(3)+" &#197;"},getLatticeAnglesValues:function(e,t,s){let i=[0,0,0];return e.forEach(e=>{if(void 0!==e.lattice_parameters&&null!==e.lattice_parameters){let t=p(e.lattice_parameters);i[0]+=t[3],i[1]+=t[4],i[2]+=t[5]}}),s?`<div>&alpha; = ${u(i[0]/e.size)}</div>\n    <div>&beta; = ${u(i[1]/e.size)}</div>\n    <div>&gamma; = ${u(i[2]/e.size)}</div>`:t?`<div>&alpha; = ${u(i[0]/e.size)}</div>`:""},rad2degree:u,m3ToAngstrom3:function(e){return(e/1e-30).toFixed(3)+" &#197;<sup>3</sup>"},getQuantityStatsMap:function(e){let t=["volume","atomic_density","mass_density","lattice_a","lattice_b","lattice_c"],s=["Volume (ų)","Atomic density (Å⁻³)","Mass density (kg/m³)","a (Å)","b (Å)","c (Å)"],i=new Map;return null===e.values().next().value.cell_volume&&(t=["lattice_a","lattice_b","lattice_c"],s=["a (Å)","b (Å)","c (Å)"]),t.forEach((t,n)=>{let a=[];e.forEach(e=>{let s;if("volume"===t)s=e.cell_volume/1e-30;else if("atomic_density"===t)s=1e-30*e.atomic_density;else if("mass_density"===t)s=e.mass_density;else if(t.indexOf("lattice")>=0){let i=p(e.lattice_parameters);"lattice_a"===t?s=i[0]/1e-10:"lattice_b"===t?s=i[1]/1e-10:"lattice_c"===t&&(s=i[2]/1e-10)}a.push(s)});let l={};l.data=a,l.min=Math.min.apply(null,a),l.max=Math.max.apply(null,a),l.equal=l.min===l.max;let r=s[n].split(":");l.label=r[0],2===r.length?l.units=r[1]:l.units="";let o=3;"mass_density"===t&&(o=1),l.html=m(l.data).toFixed(o)+' &nbsp; <span style="font-size: 0.9em">['+l.min.toFixed(o)+" , "+l.max.toFixed(o)+"]</span>",i.set(t,l)}),i},toAngstromMinus3:function(e){return(1e-30*e).toFixed(3)+" &#197;<sup>-3</sup>"},getMaterialTitle:function(e,t){let s;return s=c(e.formula_reduced),void 0!==t&&!1===t&&(s=e.formula_reduced),null!==e.space_group_number&&void 0!==e.space_group_number&&(s+=" - space group "+e.space_group_number),s},getMinMaxHTML:function(e,t){let s=[];return e.forEach(e=>{s.push(e[t])}),"("+Math.min.apply(null,s)+" ... "+Math.max.apply(null,s)+")"},getSubscriptedFormula:c,getAverage:m,generateDiagramSteps:function(e){let t=-Math.floor(Math.log(e/4)*Math.LOG10E),s=Math.pow(10,t),i=Math.ceil(e*s/4),n=[];for(var a=0;a<=4;a++)n[a]=i*a/s;return t=t<0?0:t,[n,t]}}},function(e,t){let s,i;let n,a=new Map;function l(e){return a.get(e)}function r(e){return"eos"===e.substring(0,3)||"par"===e.substring(0,3)}function o(e){return r(e)?parseInt(e.substring(3)):parseInt(e)}e.exports={setMaterialData:function(e){s=e},getMaterialData:function(){return s},getCalculations:function(){return i},getCalc:l,setCalculations:function(e){i=e;for(let e=0;e<i.length;e++)a.set(i[e].id,i[e])},getGroups:function(){return n},setGroups:function(e){n=function(e){let t=new Map;e.forEach((e,s)=>{if("method"!==e.group_type){let s;t.has(e.method_hash)?s=t.get(e.method_hash):(s={ids:[],minEnergies:[]},t.set(e.method_hash,s)),s.ids.push(e.representative_calculation_id),s.minEnergies.push(e.energy_minimum)}});let s=new Map;t.forEach((e,t)=>{let i=Math.min.apply(null,e.minEnergies),n=e.minEnergies.indexOf(i);s.set(t,e.ids[n])});let i=new Map;return e.forEach((e,t)=>{if("method"!==e.group_type){let t={calcs:new Set,method_representative:s.get(e.method_hash)};i.set(function(e){if("equation of state"===e.group_type)return"eos";if("parameter variation"===e.group_type)return"par"}(e)+e.representative_calculation_id,t),e.calculations_list.forEach(e=>t.calcs.add(e))}}),i}(e)},isGroup:r,getGroupType:function(e){let t=e.substring(0,3);return"eos"===t?"equation of state":"par"===t?"parameter variation":null},getCalcReprIntId:o,isInAnyGroup:function(e){let t=!1;return n.forEach((s,i)=>{s.calcs.has(e)&&(t=!0)}),t},isInAnyNotDisabledGroup:function(e){let t=!1;return n.forEach((s,i)=>{"exciting"===l(o(i)).code_name.trim()&&s.calcs.has(e)&&(t=!0)}),t},getGroupLeafId:function(e){let t=null;return n.forEach((s,i)=>{s.calcs.has(e)&&(t=i)}),t},hasThermalData:void 0,hasElecStructureData:void 0}},function(e,t,s){"use strict";const i="http://www.w3.org/2000/svg";e.exports={addPoint:function(e,t,s,n,a){let l=document.createElementNS(i,"circle");return l.setAttribute("r",n),l.setAttribute("cx",t),l.setAttribute("cy",s),void 0!==a&&l.setAttribute("class",a),e.appendChild(l),l},addCircle:function(e,t,s,n,a,l,r){let o=document.createElementNS(i,"circle");return o.setAttribute("r",n),o.setAttribute("cx",t),o.setAttribute("cy",s),o.setAttribute("fill",a),o.setAttribute("stroke",l),o.setAttribute("stroke-width",r),e.appendChild(o),o},addLine:function(e,t,s,n,a,l){let r=document.createElementNS(i,"line");return r.setAttribute("x1",t),r.setAttribute("y1",s),r.setAttribute("x2",n),r.setAttribute("y2",a),void 0!==l&&r.setAttribute("class",l),e.appendChild(r),r},addRect:function(e,t,s,n,a){let l=document.createElementNS(i,"rect");return l.setAttribute("x",t),l.setAttribute("y",s),l.setAttribute("width",n),l.setAttribute("height",a),e.appendChild(l),l},addText:function(e,t,s,n,a="start",l){let r=document.createElementNS(i,"text");return r.setAttribute("x",t),r.setAttribute("y",s),r.textContent=n,r.setAttribute("text-anchor",a),void 0!==l&&r.setAttribute("class",l),e.appendChild(r),r},addPolyline:function(e,t,s){let n=document.createElementNS(i,"polyline");n.setAttribute("points",t),void 0!==s&&n.setAttribute("class",s),e.appendChild(n)},removeElement:function(e){e.parentElement.removeChild(e)}}},function(e,t,s){"use strict";let i=s(0),n=s(22);let a=document.querySelector("#info-tooltip"),l=document.querySelector("#tooltip-content"),r=[],o=null,d=!1,h=null;function c(){null!==o&&window.clearTimeout(o),o=window.setTimeout(e=>a.style.display="none",1e3)}let p=new n(i.IMAGE_DIR+"switch");function u(e){e.addEventListener("mouseover",m),e.addEventListener("mouseout",t=>{c(),e.style.cursor="inherit"}),e.className="info-sys-label"}function m(e){let t=e.target.getBoundingClientRect(),s=e.target.getAttribute("info-sys-data"),i=s.indexOf(".value");if(i>0){let e=h[s.split("-").join(" ").substring(0,i)];if(void 0===e.value_template){let t=e.values[s.split(":")[1]];l.innerHTML=v(t)}else{let t=e.value_template;t.text=y(t.text,s.split(":")[1]),t.link=y(t.link,s.split(":")[1]),l.innerHTML=v(t)}}else l.innerHTML=v(h[s.split("-").join(" ")]);a.style.visibility="hidden",a.style.display="block";let n=a.getBoundingClientRect(),r=n.width-t.width,d=t.left-r/2;d+n.width>window.innerWidth&&(d=window.innerWidth-n.width);let c=-window.pageYOffset;a.style.left=(d<0?5:d)+"px",a.style.top=t.top+t.height-c+"px",a.style.visibility="visible",window.clearTimeout(o),e.target.style.cursor="help"}function y(e,t){let s=e.indexOf("${"),i=e.indexOf("}");return s>=0&&i>=0&&i>s?e.substring(0,s)+t+e.substring(i+1):e}function v(e){let t="";return void 0===e.text||(t+=e.text),void 0!==e.link&&(void 0!==e.text&&(t+="<br>"),t+='<a href="'+e.link+'" target="_blank">More information</a>'),t}document.querySelector("#info-sys-switch-box").appendChild(p.element),p.setListener(e=>{d=!e,e?r.forEach(e=>{e.removeEventListener("mouseover",m),e.className=""}):(null===h&&i.serverReq("infosys.json",e=>h=JSON.parse(e.target.response)),r.forEach(u)),a.addEventListener("mouseover",e=>{window.clearTimeout(o)}),a.addEventListener("mouseout",e=>{c()})}),e.exports={addToInfoSystem:function(e){let t=e.querySelectorAll("span[info-sys-data]");for(let e=0;e<t.length;++e)r.push(t[e]);if(d)for(let e=0;e<t.length;++e)u(t[e])},addElementToInfoSystem:function(e,t){r.push(e),e.setAttribute("info-sys-data",t),d&&u(e)}}},function(e,t,s){"use strict";s(0);let i=document.querySelector("#loading-popup");e.exports={show:function(){let e=i.getBoundingClientRect(),t=(window.innerWidth-e.width)/2,s=(window.innerHeight-e.height)/2;i.style.left=t+"px",i.style.top=s-100+"px",i.style.visibility="visible"},hide:function(){i.style.visibility="hidden"}}},function(e,t,s){"use strict";let i=s(2);const n="http://www.w3.org/2000/svg";e.exports=class{constructor(e={left:20,right:0,top:10,bottom:20}){this.svg=document.createElementNS(n,"svg"),this.plotArea=document.createElementNS(n,"g"),this.svg.appendChild(this.plotArea),this.margins=e,this.parentElement=null,this.yLabelText=null,this.noDataGroup=null}attach(e,t,s){this.parentElement=e,this.parentElement.appendChild(this.svg),this.width=void 0!==t?t:this.parentElement.clientWidth,this.height=void 0!==s?s:this.svg.width,this.svg.setAttribute("width",this.width),this.svg.setAttribute("height",this.height),this.plotRangeX=this.width-this.margins.left-this.margins.right,this.plotRangeY=this.height-this.margins.top-this.margins.bottom}isAttached(){return null!==this.parentElement}setRangeAndLabels(e,t,s,i,n,a){this.xLabel=e,this.xMin=t,this.xMax=s,this.yLabel=i,this.yMin=n,this.yMax=a,this.xRel=this.plotRangeX/(this.xMax-this.xMin),this.yRel=this.plotRangeY/(this.yMax-this.yMin)}drawAxis(e=0,t=0,s=2){if(this.plotArea.setAttribute("transform","matrix(1 0 0 1 "+this.margins.left+" "+(this.height-this.margins.bottom)+")"),this.yLabelText=i.addText(this.svg,0,0,this.yLabel,"middle","axis-steps-big"),this.yLabelText.setAttribute("transform","translate(13,"+(this.plotRangeY/2+this.margins.top)+") rotate(-90)"),i.addText(this.plotArea,this.plotRangeX/2,this.margins.bottom-1,this.xLabel,"middle","axis-steps-big"),null!==e){let t=this.plotRangeX/e;for(let n=0;n<=e;n++)i.addLine(this.plotArea,t*n,0,t*n,4,1),i.addText(this.plotArea,t*n,14,+(t*n/this.xRel+this.xMin).toFixed(s),"middle","statisticsviewersteps")}if(null===t&&this.yMax>0&&this.yMin<0){let e=1;for(;this.yMax*e>this.yMin;){i.addLine(this.plotArea,0,this.transformY(this.yMax*e),-3,this.transformY(this.yMax*e),1);let t=Math.abs(this.yMax*e)>=1e4?(this.yMax*e).toExponential():this.yMax*e;i.addText(this.plotArea,-5,this.transformY(this.yMax*e)+3,t,"end","statisticsviewersteps"),e--}}if(null!==t){let e=this.plotRangeY/t;for(let n=0;n<=t;n++){i.addLine(this.plotArea,0,-e*n,-3,-e*n,1);let t=e*n/this.yRel+this.yMin;Math.abs(t)<.01&&(t=0),i.addText(this.plotArea,-5,-(e*n-3),t.toFixed(s),"end","statisticsviewersteps")}}i.addLine(this.plotArea,0,0,this.plotRangeX+1,0,"main-axis"),i.addLine(this.plotArea,0,0,0,-(this.plotRangeY+1),"main-axis"),i.addLine(this.plotArea,this.plotRangeX,0,this.plotRangeX,-this.plotRangeY,"main-axis"),i.addLine(this.plotArea,0,-this.plotRangeY,this.plotRangeX,-this.plotRangeY,"main-axis")}clear(){this.svg.removeChild(this.plotArea),this.plotArea=document.createElementNS(n,"g"),this.svg.appendChild(this.plotArea),this.plotArea.setAttribute("transform","matrix(1 0 0 1 "+this.margins.left+" "+(this.height-this.margins.bottom)+")"),null!==this.yLabelText&&(this.svg.removeChild(this.yLabelText),this.yLabelText=null),null!==this.noDataGroup&&(this.svg.removeChild(this.noDataGroup),this.noDataGroup=null)}setNoData(){this.clear(),null===this.noDataGroup&&(this.noDataGroup=document.createElementNS(n,"g"),this.svg.appendChild(this.noDataGroup),i.addRect(this.noDataGroup,0,0,this.width,this.height),this.noDataGroup.setAttribute("fill","#EEE"),i.addText(this.noDataGroup,this.width/2,this.height/2+10,"NO DATA","middle","nodata"))}transformY(e){return-this.yRel*(e-this.yMin)}}},function(e,t,s){"use strict";let i=s(0),n=s(1);e.exports=class{constructor(e){this.element=document.createElement("div"),this.element.setAttribute("id",e),this.gotoResultsListener=null,this.gotoOverviewListener=null,this.element.innerHTML='<div class="material-title"></div>',this.element.style.display="none"}attachAndSetEvents(e){e.appendChild(this.element),this.materialTitle=this.element.querySelector(".material-title")}attachNavTree(e){e.attach(this.navTreeWrapper)}setVisible(){this.element.style.display="block"}setMaterialData(){this.materialTitle.innerHTML=i.getMaterialTitle(n.getMaterialData())}updateCalcs(e){}updateMarkedCalc(e){}}},function(e,t,s){"use strict";let i=s(8),n=s(2);s(0);function a(e,t){let s=e[0],i=e[t],n=i[0]-s[0],a=i[1]-s[1],l=i[2]-s[2];return Math.sqrt(n*n+a*a+l*l)}function l(e){return"Gamma"===e||"G"===e?"Γ":e}e.exports=class extends i{constructor(){super({left:55,right:5,top:0,bottom:30}),this.phononMode=!1,this.factor=1602176565e-28}setPhononMode(){this.phononMode=!0,this.factor=1/5034117012222e10,this.outOfRangeColorActivated=!1}attach(e,t,s){super.attach(e,t,s)}getTopAndLowestPoints(e){let t=-1e4,s=1e4;for(let i=0;i<e.length;i++){for(let n=0;n<e[i].band_energies[0].length;n++){let a=Math.max.apply(null,e[i].band_energies[0][n]);a>t&&(t=a),a=Math.min.apply(null,e[i].band_energies[0][n]),a<s&&(s=a)}if(2===e[i].band_energies.length)for(let n=0;n<e[i].band_energies[1].length;n++){let a=Math.max.apply(null,e[i].band_energies[1][n]);a>t&&(t=a),a=Math.min.apply(null,e[i].band_energies[1][n]),a<s&&(s=a)}}return[s/this.factor,t/this.factor]}drawKPointLabel(e,t){n.addText(this.axisGroup,e*this.xRel,16,t,"middle","steps")}setBandStructureData(e){let t;t=void 0!==e.segments?e.segments:e,this.bandGapData=void 0,void 0!==e.band_gap&&void 0!==e.band_gap.position&&(this.bandGapData=e.band_gap.position,this.bandGapData.cbmDistances=[],this.bandGapData.vbmDistances=[]),this.bandsDataSpin1=[],this.bandsDataSpin2=[],this.segmentLimitsX=[],this._reset();let s=this.getTopAndLowestPoints(t),i=s[0],n=s[1];this.phononMode?this.setAxisRangeAndLabels("",0,1,"Frequency (cm⁻¹)",-50,320,i,n,100):this.setAxisRangeAndLabels("",0,1,"Energy (eV)",-6,11,i,n,5);let r=0;for(let e=0;e<t.length;e++){let s=t[e].band_k_points;r+=a(s,s.length-1)}let o=0,d=null,h=!1;for(let e=0;e<t.length;e++){let s=t[e],i=s.band_k_points,n=s.band_segm_labels,c=s.band_energies[0],p=s.band_energies[1];this.bandsDataSpin1.push([]),this.bandsDataSpin2.push([]);let u=a(i,i.length-1);this.segmentLimitsX.push(o/r),null!==n&&(null!==d&&d!==n[0]?this.drawKPointLabel(o/r,l(d)+"|"+l(n[0])):this.drawKPointLabel(o/r,l(n[0])),e===t.length-1&&this.drawKPointLabel(1,l(n[1])),d=n[1]);for(let t=0;t<i.length;t++){let s=(o+a(i,t))/r;if(void 0!==this.bandGapData){if(void 0!==this.bandGapData.lower){let e=this.bandGapData.lower.kpt;i[t][0]===e[0]&&i[t][1]===e[1]&&i[t][2]===e[2]&&this.bandGapData.cbmDistances.push(s)}if(void 0!==this.bandGapData.upper){let e=this.bandGapData.upper.kpt;i[t][0]===e[0]&&i[t][1]===e[1]&&i[t][2]===e[2]&&this.bandGapData.vbmDistances.push(s)}}for(let i=0;i<c[t].length;i++){0===t&&(this.bandsDataSpin1[e][i]=[]);let n=c[t][i]/this.factor;this.bandsDataSpin1[e][i].push({x:s,y:n}),!h&&n>1e4&&(h=!0)}if(void 0!==p)for(let i=0;i<p[t].length;i++){0===t&&(this.bandsDataSpin2[e][i]=[]);let n=p[t][i]/this.factor;this.bandsDataSpin2[e][i].push({x:s,y:n}),!h&&n>1e4&&(h=!0)}}o+=u}if(h)throw"Plotter Data Overflow: Probably the energy data is not in correct units";this.repaint()}repaintData(e,t){let s;this.segmentLimitsX.forEach(s=>{let i=this.transformY(e),a=this.transformY(t);this.phononMode&&(i+=200,a-=200),n.addLine(this.plotContent,s*this.xRel,i,s*this.xRel,a,"segment")});for(var i=0;i<this.bandsDataSpin1.length;i++)for(var a=0;a<this.bandsDataSpin1[i].length;a++){s="";for(var l=0;l<this.bandsDataSpin1[i][a].length;l++)s+=" "+this.xRel*this.bandsDataSpin1[i][a][l].x+" "+this.transformY(this.bandsDataSpin1[i][a][l].y);n.addPolyline(this.plotContent,s,"plotSpin1")}if(this.bandsDataSpin2.length>0)for(i=0;i<this.bandsDataSpin2.length;i++)for(a=0;a<this.bandsDataSpin2[i].length;a++){s="";for(l=0;l<this.bandsDataSpin2[i][a].length;l++)s+=" "+this.xRel*this.bandsDataSpin2[i][a][l].x+" "+this.transformY(this.bandsDataSpin2[i][a][l].y);n.addPolyline(this.plotContent,s,"plotSpin2")}void 0!==this.bandGapData&&(this.bandGapData.cbmDistances.forEach(e=>{let t=this.xRel*e,s=this.transformY(this.bandGapData.lower.energy/this.factor);n.addPoint(this.plotContent,t,s,3,"cbm-vbm-points"),n.addText(this.plotContent,t+4,s-6,"CBM")}),this.bandGapData.vbmDistances.forEach(e=>{let t=this.xRel*e,s=this.transformY(this.bandGapData.upper.energy/this.factor);n.addPoint(this.plotContent,t,s,3,"cbm-vbm-points"),n.addText(this.plotContent,t+4,s+14,"VBM")}))}}},function(e,t,s){"use strict";let i=s(2);const n="http://www.w3.org/2000/svg";e.exports=class{constructor(e={left:20,right:0,top:0,bottom:20}){this.margins=e,this.svg=document.createElementNS(n,"svg"),this.parentElement=null,this.plotContent=null,this.axisGroup=null,this.yAxisLabelsGroup=null,this.yLabelText=null,this.noDataGroup=null,this.yZoom=1,this.yOffset=0,this.repaintListener=null,this.nodataLabel=null,this.outOfRangeColorActivated=!0}attach(e,t,s){this.parentElement=e,this.parentElement.appendChild(this.svg),this.width=void 0!==t?t:this.parentElement.clientWidth,this.height=void 0!==s?s:this.svg.width,this.svg.setAttribute("width",this.width),this.svg.setAttribute("height",this.height),this.plotRangeX=this.width-this.margins.left-this.margins.right,this.plotRangeY=this.height-this.margins.top-this.margins.bottom,this.yAxisArea=document.createElementNS(n,"svg"),this.svg.appendChild(this.yAxisArea);let a=this.margins.left;this.plotAreaHeight=this.height-this.margins.bottom-this.margins.top,this.yAxisArea.setAttribute("width",a),this.yAxisArea.setAttribute("height",this.plotAreaHeight),this.yAxisArea.setAttribute("x",0),this.yAxisArea.setAttribute("y",0),this.plotArea=document.createElementNS(n,"svg"),this.svg.appendChild(this.plotArea),this.plotAreaWidth=this.width-this.margins.left-this.margins.right,this.plotArea.setAttribute("width",this.plotAreaWidth),this.plotArea.setAttribute("height",this.plotAreaHeight),this.plotArea.setAttribute("x",this.margins.left),this.plotArea.setAttribute("y",this.margins.top),this.plotAreaBg=i.addRect(this.plotArea,0,0,this.plotAreaWidth,this.plotAreaHeight),this.plotAreaBg.setAttribute("class","moveable-plot"),this.plotAreaBg.setAttribute("opacity",0),this._events()}isAttached(){return null!==this.parentElement}setAxisRangeAndLabels(e,t,s,n,a,l,r,o,d,h=2){this.xLabel=e,this.xMin=t,this.xMax=s,this.yMinInit=a,this.yMaxInit=l,this.yMin=r,this.yMax=o,this.yLabelGapInit=d,this.xRel=this.plotRangeX/(this.xMax-this.xMin),this.yRel=this.plotRangeY/(this.yMaxInit-this.yMinInit),this._resetAxisGroup(),i.addLine(this.axisGroup,0,0,this.plotRangeX,0,"main-axis"),i.addLine(this.axisGroup,0,0,0,-this.plotRangeY,"main-axis"),i.addLine(this.axisGroup,this.plotRangeX,0,this.plotRangeX,-this.plotRangeY,"main-axis"),i.addLine(this.axisGroup,0,-this.plotRangeY,this.plotRangeX,-this.plotRangeY,"main-axis"),null!==n&&(this.yLabelText=i.addText(this.svg,0,0,n,"middle","axis-steps-big"),this.yLabelText.setAttribute("transform","translate(15,"+(this.plotRangeY/2+this.margins.top)+") rotate(-90)")),null!==e&&i.addText(this.axisGroup,this.plotRangeX/2,this.margins.bottom-12,this.xLabel,"middle","axis-steps-big"),this._resetYAxisLabelGroup(),this.precalculation_1=this.plotAreaHeight+this.yMinInit*this.yRel,this.precalculation_2=this.precalculation_1}_events(){let e;this.plotArea.addEventListener("wheel",e=>{e.preventDefault(),e.deltaY>0&&this.yZoom>.5?this.yZoom-=.2:e.deltaY<0&&this.yZoom<2&&(this.yZoom+=.2),this.repaint(),null!==this.repaintListener&&this.repaintListener(this.yZoom,this.yOffset)}),this.plotArea.addEventListener("mousedown",t=>{t.preventDefault(),e=t.clientY+this.yOffset,this.plotArea.addEventListener("mousemove",s),this.plotArea.addEventListener("mouseup",e=>{this.plotArea.removeEventListener("mousemove",s)}),this.plotArea.addEventListener("mouseout",e=>{this.plotArea.removeEventListener("mousemove",s)})});let t=this;function s(s){t.yOffset=e-s.clientY,t.precalculation_2=t.precalculation_1-t.yOffset,t.repaint(),null!==t.repaintListener&&t.repaintListener(t.yZoom,t.yOffset)}}setYZoomAndOffset(e,t){this.yZoom=e,this.yOffset=t,this.precalculation_2=this.precalculation_1-this.yOffset}setExternalYAxisMax(e){this.externalYAxisMax=e}getYAxisMax(){return this.yAxisMax}repaint(){let e;this._resetYAxisLabelGroup(),e=this.yZoom>1?this.yLabelGapInit/5:this.yLabelGapInit;let t=Math.floor(this.yMin/e)*e,s=Math.ceil(this.yMax/e)*e;if(this.yAxisMax=s,void 0!==this.externalYAxisMax&&(s=this.externalYAxisMax),null!==this.yLabelText)for(let n=t;n<s+1;n+=e)i.addLine(this.yAxisLabelsGroup,this.margins.left,this.transformY(n),this.margins.left-3,this.transformY(n)),i.addText(this.yAxisLabelsGroup,this.margins.left-5,this.transformY(n)+5,n,"end","axis-steps");if(this._resetPlotContent(),this.outOfRangeColorActivated){i.addRect(this.plotContent,0,this.transformY(this.yMax)-2*this.plotAreaHeight,this.plotAreaWidth,2*this.plotAreaHeight).setAttribute("class","out-of-range"),i.addRect(this.plotContent,0,this.transformY(this.yMin),this.plotAreaWidth,2*this.plotAreaHeight).setAttribute("class","out-of-range")}i.addLine(this.plotContent,0,this.transformY(0),this.plotRangeX,this.transformY(0),"zeroline"),this.repaintData(t,s),this.plotArea.removeChild(this.plotAreaBg),this.plotArea.appendChild(this.plotAreaBg)}setRepaintListener(e){this.repaintListener=e}transformY(e){let t=-e*this.yZoom*this.yRel+this.precalculation_2;if(t>1e4)throw"Y coordinate too large";return t}_resetPlotContent(){null!==this.plotContent&&this.plotArea.removeChild(this.plotContent),this.plotContent=document.createElementNS(n,"g"),this.plotArea.appendChild(this.plotContent)}_resetAxisGroup(){null!==this.axisGroup&&this.svg.removeChild(this.axisGroup),this.axisGroup=document.createElementNS(n,"g"),this.svg.appendChild(this.axisGroup),this.axisGroup.setAttribute("transform","matrix(1 0 0 1 "+this.margins.left+" "+(this.height-this.margins.bottom)+")")}_resetYAxisLabelGroup(){null!==this.yLabelText&&(null!==this.yAxisLabelsGroup&&this.yAxisArea.removeChild(this.yAxisLabelsGroup),this.yAxisLabelsGroup=document.createElementNS(n,"g"),this.yAxisArea.appendChild(this.yAxisLabelsGroup))}_reset(){this.yZoom=1,this.yOffset=0,this._resetPlotContent(),null!==this.yLabelText&&(this.svg.removeChild(this.yLabelText),this.yLabelText=null),null!==this.noDataGroup&&(this.svg.removeChild(this.noDataGroup),this.noDataGroup=null)}setNoData(){this._resetYAxisLabelGroup(),this._resetPlotContent(),this._resetAxisGroup(),null===this.noDataGroup&&(this.noDataGroup=document.createElementNS(n,"g"),this.svg.appendChild(this.noDataGroup),i.addRect(this.noDataGroup,0,0,this.width,this.height),this.noDataGroup.setAttribute("fill","#EEE"),i.addText(this.noDataGroup,this.width/2,this.height/2+10,"NO DATA","middle","nodata"))}}},function(e,t,s){let i=s(2),n=s(0),a=s(20),l=s(21),r=s(24),o=s(26),d=s(28),h=s(30),c=s(33),p=s(1),u=s(4),m=null,y={eStruct:null,thermalProps:null};class v{constructor(e){this.hostElement=e,this.viewer=new StructureViewer(e),this.legendElement=document.createElement("div"),this.legendElement.setAttribute("class","element-labels"),this.legendElement.setAttribute("style","position: absolute; bottom: 50px; right: 0"),this.hostElement.appendChild(this.legendElement),this.footerElement=document.createElement("div"),this.footerElement.setAttribute("class","structure-viewer-legend"),this.hostElement.appendChild(this.footerElement),this.footerElement.innerHTML=`\n\n    <div style="float: left; padding-right: 12px" >\n      <input type="checkbox" class="show-axis" checked> Show axis\n    </div>\n\n    <div style="float: left; padding-right: 18px" >\n      <input type="checkbox" class="show-bonds" checked> Show bonds\n    </div>\n\n    <div style="float: left; position:relative;" >\n      <img class="view-reset" style="cursor: pointer;" height="18px"\n        src="${n.IMAGE_DIR}reset.svg" />\n      <div class="view-reset-tooltip" > Reset view </div>\n    </div>\n\n    \x3c!--\n    <div class="view-reset-tooltip" style="float: left; display: none; font-size: 0.8em;" >\n      Set original <br> &nbsp; view\n    </div>\n    --\x3e\n\n    <div class="vr-download" style="float: right"> </div>\n\n    <div style="clear: both;"></div>\n    `,this.axisCheckbox=this.footerElement.querySelector(".show-axis"),this.axisCheckbox.addEventListener("click",e=>{this.viewer.toggleLatticeParameters(this.axisCheckbox.checked)}),this.bondsCheckbox=this.footerElement.querySelector(".show-bonds"),this.bondsCheckbox.addEventListener("click",e=>{this.viewer.toggleBonds(this.bondsCheckbox.checked)}),this.labelsContainer=this.hostElement.querySelector(".element-labels"),this.vrLinksContainer=this.footerElement.querySelector(".vr-download"),this.vrDropDown=new f,this.vrLinksContainer.appendChild(this.vrDropDown.element);let t=this.hostElement.querySelector(".view-reset");t.addEventListener("click",e=>this.viewer.reset()),t.addEventListener("mouseover",e=>{this.hostElement.querySelector(".view-reset-tooltip").style.display="block"}),t.addEventListener("mouseout",e=>{this.hostElement.querySelector(".view-reset-tooltip").style.display="none"})}load(e){this.viewer.load(e),this.createElementLegend()}setMaterialId(e){console.log("pass material id "+e),this.vrDropDown.setMaterialId(e)}changeHostElement(e){this.hostElement!==e&&(this.hostElement.removeChild(this.legendElement),this.hostElement.removeChild(this.footerElement),this.hostElement=e,this.viewer.changeHostElement(e),this.hostElement.appendChild(this.legendElement),this.hostElement.appendChild(this.footerElement))}createElementLegend(){this.labelsContainer.innerHTML="";let e=this.viewer.elements,t=[];for(let s in e)e.hasOwnProperty(s)&&t.push([s,e[s][0],e[s][1]]);t.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}));let s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("width",50),s.setAttribute("height",25*t.length),this.labelsContainer.appendChild(s);for(let e=0;e<t.length;++e){let n=t[e][0],a=t[e][1].toString(16),l=6-a.length;a="#"+Array(l+1).join("0")+a,i.addCircle(s,10,25*e+12,8,a,"#777",1),i.addText(s,24,25*e+18,n,"start","structure-viewer-legend-labels")}}}class f{constructor(e){this.folded=!0,this.element=document.createElement("div"),this.element.innerHTML+=`\n      <div >\n        <span style=" vertical-align: 30%; ">Virtual Reality files</span>\n        <img style="cursor: pointer" src="${n.IMAGE_DIR}folded.png" />\n      </div>\n\n      <div class="vr-download-panel" style="position: relative; display: none">\n\n      </div>\n    `,this.element.tabIndex="0",this.element.style.outline="none",this.foldingPanel=this.element.querySelector(".vr-download-panel"),this.foldBtn=this.element.querySelector("img"),this.foldBtn.addEventListener("click",e=>{this.folded=!this.folded,this.foldBtn.src=this.folded?n.IMAGE_DIR+"folded.png":n.IMAGE_DIR+"unfolded.png",this.foldingPanel.style.display=this.folded?"none":"block"}),this.element.addEventListener("blur",e=>{setTimeout(()=>{this.folded=!0,this.foldBtn.src=n.IMAGE_DIR+"folded.png",this.foldingPanel.style.display="none"},300)})}setMaterialId(e){this.foldingPanel.innerHTML=`\n    <div class="vr-download-panel-unfolded" style="width: 210px;">\n      <div style="padding: 5px; ">\n        <a href="http://nomad.srv.lrz.de/cgi-bin/NOMAD/material?${e}">Get VR file</a>\n      </div>\n      <br>\n      <div style="padding-bottom: 5px; ">Visualization tools for specific devices:</div>\n\n      <div style="padding: 5px; ">\n        <a href="http://nomad.srv.lrz.de/NOMAD/NOMADViveT-Setup.exe">HTC Vive</a>\n      </div>\n      \x3c!--\n      <div style="padding: 5px; ">\n        <a href="http://nomad.srv.lrz.de/NOMAD/NOMADGearvrT.apk">Samsung GearVR</a>\n      </div>\n      --\x3e\n      <div style="padding: 5px; ">\n        <a target="_blank" href="https://play.google.com/store/apps/details?id=com.lrz.nomadvr">Google Cardboard</a>\n      </div>\n\n    </div>\n    `}}e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","material-module"),this.overview=new l,this.overview.attachAndSetEvents(this.element),this.navTree=new a,this.structureViewer=null,this.structureDetails=new r,this.structureDetails.attachAndSetEvents(this.element),this.electronicStructDetails=new o,this.electronicStructDetails.attachAndSetEvents(this.element),this.methodologyDetails=new d,this.methodologyDetails.attachAndSetEvents(this.element),this.thermalDetails=new h,this.thermalDetails.attachAndSetEvents(this.element),this.elasticDetails=new c,this.elasticDetails.attachAndSetEvents(this.element),this.currentDetailView=null}setMaterialView(e){null===m||m.id!==parseInt(e.id)?(this._loadMaterial(e.id,e.view),null!==this.structureViewer&&(this.structureViewer.axisCheckbox.checked=!0,this.structureViewer.bondsCheckbox.checked=!0)):(this._setView(e.view),document.querySelector("title").innerHTML="NOMAD Encyclopedia - "+n.getMaterialTitle(p.getMaterialData(),!1))}getCurrentPageStatus(){let e=null;return null===this.currentDetailView&&(e=this.overview.getEStructChosenCalcs()),{pageId:this.currentDetailViewId,markedLeaf:this.navTree.getMarkedLeaf(),eStructCalcs:e}}_setView(e){null===this.currentDetailView?this.overview.element.style.display="none":this.currentDetailView.element.style.display="none",void 0===e?(this.currentDetailView=null,this.currentDetailViewId=null,this.overview.setVisible(),this.navTree.setLeafMarkedListener(void 0),this._setCellViewer(this.overview.vizBox)):(this.currentDetailViewId=e,this._setDetailView(n.MAT_VIEW[e]))}_setCellViewer(e){null===this.structureViewer?(this.structureViewer=new v(e),null!==m&&(this.structureViewer.load(n.getCellDataForViewer(m)),this.structureViewer.setMaterialId(m.id))):this.structureViewer.changeHostElement(e)}_setDetailView(e){e===n.MAT_VIEW.structure?(this.currentDetailView=this.structureDetails,this.navTree.showCalcsGraphDataAvalability(!1),this.navTree.setHeight(250),this.navTree.setMarkedLeafIfNoneMarked(null)):e===n.MAT_VIEW.electronicstruct?(this.currentDetailView=this.electronicStructDetails,this.navTree.showCalcsGraphDataAvalability(!0),this.navTree.setHeight(400),this.navTree.setMarkedLeafIfNoneMarked(y.eStruct)):e===n.MAT_VIEW.methodology?this.currentDetailView=this.methodologyDetails:e===n.MAT_VIEW.thermalprops&&(this.currentDetailView=this.thermalDetails,this.navTree.showCalcsGraphDataAvalability(!0),this.navTree.setHeight(600),this.navTree.setMarkedLeafIfNoneMarked(y.thermalProps)),this.currentDetailView.setVisible(),e===n.MAT_VIEW.structure&&this._setCellViewer(this.structureDetails.vizBox),e!==n.MAT_VIEW.methodology&&this.currentDetailView.attachNavTree(this.navTree),this.currentDetailView.updateSelection(this.navTree.getTreeSelectedCalcs()),this.currentDetailView.updateMarkedLeaf(this.navTree.getMarkedLeaf()),this.navTree.setTreeSelectionListener(e=>{this.currentDetailView.updateSelection(e)}),this.navTree.setLeafMarkedListener(e=>{this.currentDetailView.updateMarkedLeaf(e)})}_loadMaterial(e,t){this.overview.element.style.visibility="hidden",u.show(),n.serverReq(n.getMaterialURL(e),s=>{m=JSON.parse(s.target.response),n.materialId=m.id,200===s.target.status&&n.serverReq(n.getMaterialXsURL("elements",e),s=>{m.elements=JSON.parse(s.target.response).results,n.serverReq(n.getMaterialXsURL("cells",e),s=>{let i=JSON.parse(s.target.response).results;i[0].is_primitive?m.cell=i[1]:m.cell=i[0],p.setMaterialData(m),document.querySelector("title").innerHTML="NOMAD Encyclopedia - "+n.getMaterialTitle(m,!1),this.overview.setMaterialData(),this.structureDetails.setMaterialData(),this.electronicStructDetails.setMaterialData(),this.methodologyDetails.setMaterialData(),this.thermalDetails.setMaterialData(),this.elasticDetails.setMaterialData(),null!==this.structureViewer&&(this.structureViewer.load(n.getCellDataForViewer(m)),this.structureViewer.setMaterialId(m.id)),n.serverReq(n.getMaterialXsURL("calculations",e),s=>{p.setCalculations(JSON.parse(s.target.response).results),n.serverReq(n.getMaterialXsURL("groups",e),e=>{p.setGroups(JSON.parse(e.target.response).groups);let s=null===m.material_name?m.formula:m.material_name;this.navTree.build(s),this.overview.setCalcsData(y),this.navTree.selectAll(),this._setView(t),this.overview.element.style.visibility="visible",u.hide()})})})})})}}},function(e,t,s){"use strict";let i=s(8),n=s(2),a=s(0);e.exports=class extends i{constructor(e){super(e)}attach(e,t,s){super.attach(e,t,s)}setPoints(e,t){this.pointsSpin1=[],this.pointsSpin2=[],this._reset();let s=e.dos_values[0],i=null;2===e.dos_values.length&&(i=e.dos_values[1]);let l=e.dos_energies,r=[],o=[];for(var d=0;d<l.length;d++){let e=l[d]/1602176565e-28,t=1602176565e-28*s[d];if(r.push(t),o.push(e),this.pointsSpin1.push({x:t,y:e}),null!==i){let t=1602176565e-28*i[d];this.pointsSpin2.push({x:t,y:e}),r.push(t)}}let h=Math.max.apply(null,r),c=Math.max.apply(null,o),p=Math.min.apply(null,o),u=a.generateDiagramSteps(h),m=u[0],y=u[1];this.setAxisRangeAndLabels(null,0,m[m.length-1],"Energy (eV)",-6,11,p,c,5),n.addText(this.axisGroup,this.plotRangeX/2,this.margins.bottom,"DOS (states/eV/cell)","middle","axis-steps-big");for(let e=0;e<m.length;e++){let t=this.plotRangeX*m[e]/m[m.length-1];n.addLine(this.axisGroup,t,0,t,3,1),n.addText(this.axisGroup,t,13,0===e?"0":m[e].toFixed(y),"middle","axis-steps-smaller")}this.repaint()}repaintData(){let e="";for(var t=0;t<this.pointsSpin1.length;t++)e+=" "+this.xRel*this.pointsSpin1[t].x+" "+this.transformY(this.pointsSpin1[t].y);n.addPolyline(this.plotContent,e,"plotSpin1"),e="";for(t=0;t<this.pointsSpin2.length;t++)e+=" "+this.xRel*this.pointsSpin2[t].x+" "+this.transformY(this.pointsSpin2[t].y);n.addPolyline(this.plotContent,e,"plotSpin2")}setYAxisLabelsVisibility(e){null!==this.yAxisLabelsGroup&&(this.yAxisLabelsGroup.style.visibility=e?"visible":"hidden")}}},function(e,t,s){"use strict";let i=s(2),n=s(5);e.exports=class extends n{constructor(){super({left:50,right:16,top:10,bottom:32}),this.tooltip}setData(e){this.clear();let t=e.temperature.indexOf(600)+1,s=e.value.slice(0,t),n=e.temperature.slice(0,t),a=Math.max.apply(null,s);this.setRangeAndLabels("T (K)",0,600,"Cv (J/K/kg)",0,200*Math.ceil(a/200)),this.drawAxis(4,4,0);let l="";n.forEach((e,t)=>{let i=s[t];l+=" "+this.xRel*e+" -"+this.yRel*(i-this.yMin)}),i.addPolyline(this.plotArea,l,"plotSpin1")}}},function(e,t){e.exports=class{constructor(e,t){this.first=!0,this.last=!1,this.element=document.createElement("div"),this.element.className=e,void 0!==t&&(this.element.style.width=t),this.element.innerHTML='\n      <div class="prev-sel-btn" style="float: left; width: 20%;">\n        <div style="padding-left: 10%;">\n          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10.069 11.872" width="20px">\n            <path transform="scale(0.7) translate(-346.291 -664.481)"\n              d="M356.36,666.024l-1.544-1.544-8.525,8.513,8.493,8.447,1.544-1.544-6.8-6.9Z" />\n          </svg>\n        </div>\n      </div>\n      <div class="calc-sel-text" style="float: left; width: 60%;">\n       NOT Calculation\n      </div>\n      <div class="next-sel-btn" style="float: right; width: 20%;">\n        <div style="padding-right: 10%;">\n          <svg xmlns="http://www.w3.org/2000/svg" viewBox="-10.069 -11.872 10.069 11.872" width="20px">\n            <g transform="rotate(180) scale(0.7)">\n              <path d="M10.069,1.544,8.525,0,0,8.513,8.493,16.96l1.544-1.544-6.8-6.9Z"/>\n            </g>\n          </svg>\n        </div>\n      </div>\n      <div style="clear: both;"></div>\n    ',this.prevBtn=this.element.querySelector(".prev-sel-btn"),this.prevIcon=this.element.querySelector(".prev-sel-btn path"),this.calcSelectorTxt=this.element.querySelector(".calc-sel-text"),this.nextBtn=this.element.querySelector(".next-sel-btn"),this.nextIcon=this.element.querySelector(".next-sel-btn path"),this._styleButtons(),this._events()}_events(){this.prevBtn.addEventListener("click",e=>{e.preventDefault(),this.first||(this.first=this.prevListener(),this.last=!1,this._styleButtons())}),this.nextBtn.addEventListener("click",e=>{e.preventDefault(),this.last||(this.first=!1,this.last=this.nextListener(),this._styleButtons())})}_styleButtons(){this.prevIcon.setAttribute("class","calc-selector-icon"+(this.first?"-disabled":"")),this.nextIcon.setAttribute("class","calc-selector-icon"+(this.last?"-disabled":""))}setPrevListener(e){this.prevListener=e}setNextListener(e){this.nextListener=e}setState(e,t,s){this.calcSelectorTxt.innerHTML=e,this.first=t,this.last=s,this._styleButtons()}}},function(e,t,s){"use strict";let i=s(2),n=s(5);class a extends n{constructor(){super({left:54,right:20,top:20,bottom:30}),this.tooltip}drawPoints(e){for(let t=0;t<e.length;t++){let s=i.addPoint(this.plotArea,this.xRel*t,-this.yRel*(e[t]-this.yMin),2,"stats-viewer-point");s.addEventListener("mouseover",s=>{this.tooltip=i.addText(this.plotArea,s.target.getBBox().x+6,s.target.getBBox().y-4,e[t].toFixed(2),"start","tooltip")}),s.addEventListener("mouseout",e=>{i.removeElement(this.tooltip)})}}}class l extends n{constructor(){super({left:4,right:10,top:20,bottom:30})}drawBars(e,t,s){let n=[0,0,0,0,0,0,0,0,0,0];e.forEach(e=>{let i=Math.floor((e-t)/s*10);i>9&&(i=9),n[i]+=1}),n.forEach((e,t)=>{let s=(t+.5)*this.yRel;i.addLine(this.plotArea,0,-s,e*this.xRel,-s,"bar")})}}e.exports=class{constructor(){this.mainGraph=new a,this.freqGraph=new l}attach(e,t,s){this.mainGraph.attach(e,t/2+24,s),this.freqGraph.attach(e,t/2-24,s)}drawPoints(e,t,s,i){let n=s,a=i;i===s&&(n=s-1,a=i+1),this.mainGraph.setRangeAndLabels("Calculation",0,e.length,t,n,a),this.mainGraph.drawAxis(null,i===s?2:4,s>1e3?0:2),this.mainGraph.drawPoints(e);let l=e.length<10?10:10*Math.floor(e.length/10);this.freqGraph.setRangeAndLabels("Occurrence",0,l,"",0,10),this.freqGraph.drawAxis(2,1,1),this.freqGraph.drawBars(e,this.mainGraph.yMin,this.mainGraph.yMax-this.mainGraph.yMin)}clear(){this.mainGraph.clear(),this.freqGraph.clear()}}},function(e,t,s){"use strict";let i,n,a,l,r,o=document.querySelector("body"),d=[],h=[],c=[],p=!1;function u(e,t){let s=document.createElement("div");return s.setAttribute("class","user-guidance"),s.innerHTML='<img src="img/tip'+e+'.png" width="'+t+'px" />',s.style.position="absolute",s.style.display="none",o.appendChild(s),s}function m(e){if(8===e&&!p)return;if(4===e&&!p)return;let t=h[e].domTarget.getBoundingClientRect();d[e].style.top=t.top+h[e].top+window.pageYOffset+"px",d[e].style.left=t.left+h[e].left+"px",d[e].style.display="block"}function y(e){d[e].style.display="none",localStorage.setItem("tip"+e,"off"),c[e]="off"}function v(e){switch(e.preventDefault(),e.target.style.display="none",i){case 2:i=5;break;case 6:i=8;break;default:i++}g(i),m(i)}function f(e,t){null===c[e]&&(t?m(e):d[e].style.display="none")}function g(e){i=e,localStorage.setItem("currentTip",e)}e.exports={init:function(e,t,s,i){n=e,a=t,l=s,r=i,c[3]=localStorage.getItem("tip3"),c[4]=localStorage.getItem("tip4"),c[7]=localStorage.getItem("tip7"),0===d.length&&(d[1]=u(1,220),h[1]={domTarget:n,top:-70,left:-240},d[2]=u(2,280),h[2]={domTarget:n,top:-110,left:80},d[3]=u(3,180),h[3]={domTarget:a,top:180,left:720},d[4]=u(4,240),h[4]={domTarget:l,top:45,left:-250},d[5]=u(5,210),h[5]={domTarget:n,top:-130,left:70},d[6]=u(6,240),h[6]={domTarget:n,top:-100,left:370},d[7]=u(7,220),h[7]={domTarget:r,top:160,left:-40},d[8]=u(8,240),h[8]={domTarget:l,top:30,left:760},d[1].addEventListener("click",v),d[2].addEventListener("click",v),d[3].addEventListener("click",e=>{y(3)}),d[4].addEventListener("click",e=>{y(4)}),d[5].addEventListener("click",v),d[6].addEventListener("click",v),d[7].addEventListener("click",e=>{y(7)}),d[8].addEventListener("click",e=>{e.target.style.display="none",g(10)}));let o=localStorage.getItem("currentTip");null===o?g(1):(o=parseInt(o),o<10&&g(o))},setFinal:function(){p=!0,i<10&&(d[i].style.display="none",g(8),m(i)),f(4,!0)},show:function(e,t,s){i<10&&(e?m(i):d[i].style.display="none"),f(3,e&&t),f(4,e),f(7,e&&s)},showIndependentTip:f}},function(e,t,s){"use strict";let i=s(0),n=s(4),a=s(17),l=s(18),r=s(19),o=s(9),d=s(34),h=s(14),c=s(1),p=document.getElementById("content"),u=document.querySelector("title"),m=document.getElementById("calc-flagging-tab");m.style.top=window.innerHeight/2+"px",m.addEventListener("click",e=>{a.show(v.getCurrentPageStatus())});let y,v,f,g,b=new class{constructor(){this.element=document.querySelector("#breadcrumb-placeholder"),this.element.innerHTML='\n      <span class="goto-page Search">Search</span>\n      <span class="goto-page Results">&nbsp; > &nbsp; <span>Results</span></span>\n      <span class="goto-page Overview">&nbsp; > &nbsp; <span>Overview</span></span>\n      <span class="Details">\n        &nbsp; > &nbsp;\n        <select class="details-dropdown" >\n          <option value="structure">Structure</option>\n          <option value="electronicstruct">Electronic structure</option>\n          <option value="methodology">Methodology</option>\n          <option value="thermalprops">Thermal Properties</option>\n          \x3c!-- elasticconst--\x3e\n        </select>\n      </span>\n    ',this.resultsSel=this.element.querySelector(".Results"),this.overviewSel=this.element.querySelector(".Overview"),this.detailsSel=this.element.querySelector(".Details"),this.detailsDropDown=this.element.querySelector(".details-dropdown"),this.element.querySelector(".Search").addEventListener("click",e=>{i.setBrowserHashPath("search")}),this.resultsSel.addEventListener("click",e=>{i.setBrowserHashPath("search/results")}),this.overviewSel.addEventListener("click",()=>{i.setBrowserHashPath("material",i.materialId)}),this.detailsDropDown.addEventListener("change",e=>{i.setBrowserHashPath("material",c.getMaterialData().id+"/"+e.target.value)});let e=this;this.detailsDropDown.addEventListener("focus",(function t(){let s=e.detailsDropDown.querySelector('option[value="electronicstruct"]');c.hasElecStructureData||e.detailsDropDown.removeChild(s);let i=e.detailsDropDown.querySelector('option[value="thermalprops"]');c.hasThermalData||e.detailsDropDown.removeChild(i),e.detailsDropDown.removeEventListener("focus",t)}))}setState(e,t){this.resultsSel.querySelector("span").style.fontWeight="normal";let s=this.overviewSel.querySelector("span");s.style.fontWeight="normal","search"===e?(this.overviewSel.style.display="none",this.detailsSel.style.display="none","results"===t?(this.resultsSel.style.display="inline",this.resultsSel.querySelector("span").style.fontWeight="bold",this.element.style.visibility="visible"):this.element.style.visibility="hidden"):"material"===e&&(this.element.style.visibility="visible",this.resultsSel.style.display=i.searchResults?"inline":"none",this.overviewSel.style.display="inline",void 0===t?(this.detailsSel.style.display="none",s.style.fontWeight="bold"):(this.detailsSel.style.display="inline",this.detailsDropDown.value=t))}};function x(e){g&&p.removeChild(g),g=e,p.appendChild(g)}l.subscribe("show-material",e=>{console.log("Handling event show-material: "+e.id+" view: "+e.view),b.setState("material",e.view),void 0===f&&(v=new o,f=v.element),v.setMaterialView(e),x(f),h.show(!1),null!==i.getUserData()&&(m.style.visibility="visible")}),l.subscribe("show-search",e=>{console.log("Handling event show-search: "+e),u.innerHTML="NOMAD Encyclopedia - Search",b.setState("search",e),void 0===e?(y.showSearchPage(),n.hide()):"results"===e&&y.showResultsPage(),x(y.element),"hidden"!==m.style.visibility&&(m.style.visibility="hidden")}),r.add("search",e=>l.publish("show-search",e)),r.add("material",(e,t)=>l.publish("show-material",{id:e,view:t})),y=new d,""===document.location.hash&&(document.location+="#/search"),r.route();let S=document.querySelector("#user-name"),w=document.querySelector("#logout-button");let E=function(e){let t=("; "+document.cookie).split("; "+e+"=");if(2===t.length)return t.pop().split(";").shift()}("user_info");if(void 0!==E){let e=JSON.parse((M=E).substring(1,M.length-1).replace(/\\054/g,",").replace(/\\/g,""));"Authenticated"===(T=e).status&&(S.innerHTML=T.user.username,document.querySelector("#guest-user").style.display="none",document.querySelector("#auth-user").style.display="inline",i.setAuthRequestHeader(T.user,T.token.data),g===f&&(m.style.visibility="visible"))}var T,M;w.addEventListener("click",e=>{document.cookie="user_info=; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain="+i.USER_COOKIE_DOMAIN+"; path=/",S.innerHTML="",document.querySelector("#guest-user").style.display="inline",document.querySelector("#auth-user").style.display="none",i.setAuthRequestHeader(),"hidden"!==m.style.visibility&&(m.style.visibility="hidden")})},function(e,t){const s={GuestUserToken:"eyJhbGciOiJIUzI1NiIsImlhdCI6MTUyMzg4MDE1OSwiZXhwIjoxNjgxNTYwMTU5fQ.eyJpZCI6ImVuY2d1aSJ9.MsMWQa3IklH7cQTxRaIRSF9q8D_2LD5Fs2-irpWPTp4"};e.exports=s},function(e,t,s){"use strict";let i=s(0),n=s(1),a=document.querySelector("#flagging-form-popup-bg"),l=document.querySelector("#flagging-form-popup");l.innerHTML='\n\n<div> <img src="img/cross.svg"  height="12px"\n  style="float: right; cursor: pointer" />\n</div>\n\n<div class="form-wrapper">\n  <div class="popup-title"> Error reporting</div>\n  <select id="flagging-category" name="category">\n    <option value="">Select a category *</option>\n    <option value="structure">Structure</option>\n    <option value="electronicstruct">Electronic structure</option>\n    <option value="methodology">Methodology</option>\n    <option value="thermalprops">Thermal properties</option>\n  </select>\n\n  <select id="flagging-subcategory" name="subcategory">\n\n  </select>\n\n  <textarea id="subject" name="subject" style="height:200px"\n  placeholder="Write a short explanation about the error detected" ></textarea>\n\n  <div id="form-validation-msg"> </div>\n\n  <div style="display: flex; justify-content: space-evenly;">\n    <button style="display: block">Send</button>\n  </div>\n\n\n</div>\n';let r=l.querySelector("#flagging-category"),o=r.querySelector('option[value="electronicstruct"]'),d=r.querySelector('option[value="thermalprops"]'),h=l.querySelector("#flagging-subcategory"),c=l.querySelector("img"),p=l.querySelector("#form-validation-msg"),u=l.querySelector("button"),m=null,y=null;function v(){a.style.visibility="hidden",l.style.visibility="hidden",r.selectedIndex=0,h.selectedIndex=0,l.querySelector("textarea").value="",p.innerHTML=""}function f(e,t){let s=document.createElement("option");return s.value=void 0===t?e:t,s.innerHTML=e,s}c.addEventListener("click",e=>{v()}),u.addEventListener("click",e=>{let t=r.options[r.selectedIndex];if(r.disabled||""!==t.value)if(r.disabled&&""===h.value&&t.value!==i.MAT_VIEW.methodology)p.innerHTML="The subcategory fields must be set";else{p.innerHTML="Sending report...";let e=l.querySelector("textarea").value,s=n.getMaterialData().id,a=i.getUserData(),o="User issue | Material "+s,d="**Server:** "+i.getServerLocation()+"\\n\\n**User:** "+a.username+", "+a.email;r.disabled?(d+="\\n\\n**Category:** "+t.text,t.value!==i.MAT_VIEW.methodology&&(d+="\\n\\n**Subcategory:** "+h.options[h.selectedIndex].text+"\\n\\n**Calculation/group marked on the tree:** "+m)):(d+="\\n\\n**Category:** Overview / "+t.text,t.value===i.MAT_VIEW.electronicstruct&&null!==y&&(d+="\\n\\n**Chosen calculations:** "+(null===y.bs?"":"BS calculation "+y.bs)+(null===y.dos?"":" DOS calculation "+y.dos))),d+="\\n\\n**User text:** "+e;let c=`{\n      "title": "${o}",\n      "description": "${d}"}`;console.log("Flagging POST request Json: ",c),i.serverReqPOST(i.getFlaggingURL(),c,e=>{console.log("response",e),200===e.target.status&&v()})}else p.innerHTML="The category fields must be set"}),e.exports={show:function(e){m=e.markedLeaf,y=e.eStructCalcs,o.style.display=n.hasElecStructureData?"block":"none",d.style.display=n.hasThermalData?"block":"none",function(e){if(h.innerHTML="",null===e)r.disabled=!1,h.style.display="none";else switch(r.disabled=!0,h.style.display="block",h.appendChild(f("Choose the subcategory *","")),e){case i.MAT_VIEW.structure:r.selectedIndex=1,h.appendChild(f("Structure representation")),h.appendChild(f("Calculation tree")),h.appendChild(f("Summary")),h.appendChild(f("Specific calculation"));break;case i.MAT_VIEW.electronicstruct:r.selectedIndex=2,h.appendChild(f("Calculation tree")),h.appendChild(f("Summary")),h.appendChild(f("Band structure")),h.appendChild(f("DOS")),h.appendChild(f("Brillouin zone"));break;case i.MAT_VIEW.methodology:r.selectedIndex=3,h.style.display="none";break;case i.MAT_VIEW.thermalprops:r.selectedIndex=4,h.appendChild(f("Calculation tree")),h.appendChild(f("Phonon dispersion")),h.appendChild(f("Phonon DOS")),h.appendChild(f("Specific heat")),h.appendChild(f("Helmholtz free energy"))}}(e.pageId);let t=l.getBoundingClientRect(),s=(window.innerWidth-t.width)/2,c=(window.innerHeight-t.height)/2;l.style.left=s+"px",l.style.top=c-20+"px",l.style.visibility="visible",a.style.visibility="visible"},hide:v}},function(e,t,s){"use strict";var i=new Map,n=-1;e.exports={subscribe:function(e,t){if("function"!=typeof t)return!1;i.has(e)||i.set(e,new Map);var s="uid_"+String(++n);return i.get(e).set(s,t),s},publish:function(e,t){return!!(i.has(e)&&i.get(e).size>0)&&(setTimeout((function(){i.get(e).forEach((function(e,s){e(t)}))}),0),!0)}}},function(e,t,s){"use strict";let i=new Map;function n(){let e,t,s,n=document.location.hash.substring(2);if(n.lastIndexOf("/")===n.length-1&&(n=n.substring(0,n.length-1)),n.indexOf("/")>0){let i=n.split("/");e=i[0],t=i[1],s=i[2]}else e=n;i.has(e)&&i.get(e)(t,s)}window.addEventListener("hashchange",n),e.exports={add:function(e,t){i.set(e,t)},route:n}},function(e,t,s){"use strict";let i=s(0),n=s(1);function a(e,t){let s=new Map;return t.forEach((e,t)=>{let i=n.getCalc(n.getCalcReprIntId(t)),a=i.code_name.trim(),l=i.functional_type;if("exciting"===a)if(s.has(l)){let e=s.get(l);e.has(a)?e.get(a).push(t):e.set(a,[t])}else{let e=new Map;e.set(a,[t]),s.set(l,e)}}),e.forEach(e=>{n.isInAnyNotDisabledGroup(e.id)||function(e,t){let i=e.code_name.trim(),n=e.functional_type;if(s.has(n)){let e=s.get(n);e.has(i)?e.get(i).push(t):e.set(i,[t])}else{let e=new Map;e.set(i,[t]),s.set(n,e)}}(e,e.id+"")}),s}function l(e,t){if(e.className.indexOf("material-l")>=0)return;let s=e.parentElement;for(let t=0;t<s.children.length;t++){let i=s.children[t++];if(i!==e&&i.className.indexOf("selected")<0)return}let i=s.previousElementSibling;if(t)i.className+=" node-selected";else{let e=i.className.indexOf(" node-selected");i.className=i.className.substring(0,e)}l(i,t)}e.exports=class{constructor(){this.selectedCalcs=new Set,this.element=document.createElement("div"),this.element.setAttribute("id","navigation-tree"),this.parentElement=null,this.markedNode=null,this._events()}attach(e){null!==this.parentElement&&this.parentElement.removeChild(this.element),this.parentElement=e,this.parentElement.appendChild(this.element)}build(e){function t(e,t,s,i=0){return`\n        <div class="${e}">\n          <span class="${"node-"+(s?"unfolded":"folded")}"></span>\n          <span class="node-checkbox"></span>\n          <span class="node-label" >${t}</span>\n          ${0===i?"":'<span class="node-counter">('+i+")</span>"}\n        </div>\n      `}function s(e){let t="";return e.has_band_structure&&(t+='<span class="tooltip">B<span class="tooltiptext">Band structure</span></span> '),e.has_dos&&(t+='<span class="tooltip">D<span class="tooltiptext">Density of states</span></span> '),e.has_fermi_surface&&(t+='<span class="tooltip">F<span class="tooltiptext">Fermi surface</span></span>'),e.has_thermal_properties&&(t+='<span class="tooltip">T<span class="tooltiptext">Phonons</span></span>'),'&nbsp; <span class="calc-graph-aval">'+t+"</span>"}this.selectedCalcs.clear(),this.markedNode=null,this.element.innerHTML="",this.calcsInGroups=n.getGroups();let l=a(n.getCalculations(),this.calcsInGroups),r=document.createElement("div");this.element.appendChild(r),r.innerHTML=t("material-l",e,!0);let o=document.createElement("div");r.appendChild(o),l.forEach((e,a)=>{o.innerHTML+=t("functional-l",a,!0);let l=document.createElement("div");o.appendChild(l),e.forEach((e,a)=>{l.innerHTML+=t("code-l",a,!1,e.length);let r=document.createElement("div");l.appendChild(r),r.style.display="none";for(var o=0;o<e.length;o++){let t=s(n.getCalc(n.getCalcReprIntId(e[o]))),a="",l="";n.isGroup(e[o])&&(a='<img class="folder-icon" src="'+i.IMAGE_DIR+'folder.png" />',l="("+this.calcsInGroups.get(e[o]).calcs.size+")"),r.innerHTML+=`\n            <div class="calc-l" data-calc-id="${e[o]}" >\n              <span></span>\n              <span class="node-checkbox"></span>\n\n              <span class="node-label" >\n                ${a} ${e[o]} ${l} ${t}\n              </span>\n\n              <div style="float: right; padding: 1px 10px 0 0;  display: none;">\n                <img  src="${i.IMAGE_DIR}next.png" />\n              </div>\n\n            </div>\n            <div> </div>`}})})}selectAll(e){let t=this.element.children[0].children[0];this._recursiveNodeSelection(t,!0),l(t,!0)}getMarkedLeaf(){return null===this.markedNode?null:this.markedNode.getAttribute("data-calc-id")}setMarkedLeafIfNoneMarked(e){if(null===this.getMarkedLeaf())if(null===e)this._markFirstSelectedNode();else{let t=this.element.querySelector('div[data-calc-id="'+e+'"]');this._setMarkedCalc(t)}}_events(){this.element.addEventListener("click",e=>{let t=e.target.className;if(t.indexOf("folded")>=0)this._foldTreeNode(e.target);else if(t.indexOf("node-checkbox")>=0){let t=e.target.parentElement.className.indexOf("selected")<0;this._recursiveNodeSelection(e.target.parentElement,t),l(e.target.parentElement,t),this.treeSelectionListener(this.selectedCalcs),this._keepCalcMarked(t)}else t.indexOf("node-label")>=0&&"calc-l node-selected"===e.target.parentElement.className&&this._setMarkedCalc(e.target.parentElement)})}_foldTreeNode(e){let t=e.parentElement.nextElementSibling;e.className.indexOf("-folded")>=0?(e.className=e.className.replace("folded","unfolded"),t.style.display="block"):(e.className=e.className.replace("unfolded","folded"),t.style.display="none")}_recursiveNodeSelection(e,t){e.children[1];if(t)e.className+=" node-selected";else{let t=e.className.indexOf(" node-selected");e.className=e.className.substring(0,t)}if(e.className.indexOf("calc-l")>=0){let s=e.getAttribute("data-calc-id");t?this.selectedCalcs.add(s):this.selectedCalcs.delete(s)}else{let s=e.nextElementSibling;for(let e=0;e<s.children.length;e++)this._recursiveNodeSelection(s.children[e++],t)}}setTreeSelectionListener(e){this.treeSelectionListener=e}setLeafMarkedListener(e){this.leafMarkedListener=e}getTreeSelectedCalcs(){return this.selectedCalcs}_keepCalcMarked(e){if(e&&null===this.markedNode)this._markFirstSelectedNode();else if(!e){let e=parseInt(this.markedNode.getAttribute("data-calc-id"));0===this.selectedCalcs.size?(this.markedNode.className=this.markedNode.className.replace("-marked",""),this.markedNode=null,this.leafMarkedListener(null)):this.selectedCalcs.has(e)||this._markFirstSelectedNode()}}_markFirstSelectedNode(){let e=this.element.getElementsByClassName("calc-l");for(var t=0;t<e.length;t++)if(e[t].className.indexOf("node-selected")>=0)return void this._setMarkedCalc(e[t])}_setMarkedCalc(e){if(null!==this.markedNode){this.markedNode.className=this.markedNode.className.replace("-marked",""),this.markedNode.querySelector("div").style.display="none";let e=this.markedNode.querySelector(".folder-icon");null!==e&&(e.src=i.IMAGE_DIR+"folder.png")}e.className+="-marked";let t=e.querySelector(".folder-icon");null!==t&&(t.src=i.IMAGE_DIR+"folder-sel.png"),e.querySelector("div").style.display="block",this.markedNode=e;let s=e.parentElement.previousElementSibling.firstElementChild;"node-folded"===s.className&&(s.className="node-unfolded",s.parentElement.nextElementSibling.style.display="block"),void 0!==this.leafMarkedListener&&this.leafMarkedListener(e.getAttribute("data-calc-id"))}showCalcsGraphDataAvalability(e){let t=this.element.getElementsByClassName("calc-graph-aval");for(var s=0;s<t.length;s++)t[s].style.display=e?"inline":"none"}setHeight(e){this.element.style.height=e+"px"}}},function(e,t,s){"use strict";let i=s(0),n=s(3),a=s(4),l=s(7),r=s(10),o=s(11),d=(s(9),s(1)),h=s(23).SimilarityFinder;e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","overview"),this.materialId,this.element.innerHTML='\n\n    <div class="material-title">\n    </div>\n\n    <div style="float: left; width: 40%;">\n\n      <div id="structure-ov" class="view-box">\n        <div class="title">Structure\n          <img style="float: right" class="to-detail" src="img/more.svg" />\n          <div style="clear: both;"></div>\n        </div>\n\n        <div class="viz-box" style="height: 260px; position: relative"></div>\n\n        <div class="footer">\n          <div ><b><span>System type</span></b>:\n            <span class="system-type-field" ></span>\n          </div>\n          <div class="space-group-field" style="display: none">\n            <b><span info-sys-data="space-group">Space group</span></b>:\n            <span class="space-group-value" ></span>\n          </div>\n          <div class="structure-type-field" style="display: none">\n            <b><span info-sys-data="structure-type">Structure type</span></b>:\n            <span class="structure-type-value" ></span>\n          </div>\n        </div>\n      </div>\n\n\n\x3c!-- ***** Elastic Constants Box\n\n      <div id="elastic-ov" class="view-box">\n        <div class="title">Elastic constants\n          <img style="float: right" class="to-detail" src="img/more.svg" />\n          <div style="clear: both;"></div>\n        </div>\n\n        <div class="info-fields">\n          Not analyzed yet\n        </div>\n\n      </div>\n--\x3e\n\n\n      <div id="methodology-ov" class="view-box">\n        <div class="title">Methodology\n          <img style="float: right" class="to-detail" src="img/more.svg" />\n          <div style="clear: both;"></div>\n        </div>\n\n        <div class="info-fields">\n\n          <div class="info-fields-label" > Available calculations </div>\n\n          <div style="float: left; width: 45%" >\n            <b><span info-sys-data="functional-type">Functional</span></b>\n            <div class="functional-field" > </div>\n          </div>\n          <div style="float: right; width: 45%" >\n            <b><span info-sys-data="code-name">Code</span></b>\n            <div class="code-field"> </div>\n           </div>\n           <div style="clear: both;"></div>\n        </div>\n\n      </div>\n\n    </div>\n\n    <div style="float: right; width: 60%;">\n\n      <div id="e-structure-ov"  class="view-box" > \x3c!--style="height: 610px; "--\x3e\n        <div class="title">Electronic structure\n          <img style="float: right" class="to-detail" src="img/more.svg" />\n          <div style="clear: both;"></div>\n        </div>\n\n        <div > \x3c!-- style="margin: 12% 0; " --\x3e\n\n        <div style="float: left; width: 60%;  ">\n        <div style="padding: 20px 0 20px 30px">\n          <div  class="info-fields-label">\n            <span info-sys-data="band-structure">Band structure</span>\n          </div>\n          <div>\n              <div id="band-plotter" >  </div>\n          </div>\n\n          <div class="footer-bs-calc"></div>\n        </div>\n        </div>\n\n        <div style="float: left; width: 40%;  ">\n          <div style="padding: 20px 30px 20px 60px">\n            <div class="info-fields-label">\n              <span info-sys-data="DOS">DOS</span>\n            </div>\n\n            <div>\n                <div id="dos-plotter" >  </div>\n            </div>\n            <div class="footer-dos-calc"></div>\n          </div>\n        </div>\n\n\n\n        <div style="clear: both;"></div>\n        <table style="width: 100%">\n        <tr>\n          <td class="spin-legend" style="font-size: 0.9em; padding: 6px 30px 10px; display: none;">\n            <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin1"/></svg>\n              Spin <span style=\'font-size: 1.1em\'>⇧</span>  &nbsp;&nbsp;&nbsp;\n\n              <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin2"/></svg>\n              Spin <span style=\'font-size: 1.1em\'>⇩</span>\n          </td>\n          <td class = "similarity-data-field">\n          <div style="float: right; padding: 0px 40px 10px 0px; margin-top: 1px;" class="similarity-finder">\n          </div>\n          </td>\n          </tr>\n          </table>\n        </div>\n        <div style="clear: both;"></div>\n        \x3c!--\n        <div class="footer">\n\n          <b>Band gap</b>: <span class="e-struct-field" ></span>\n        </div>\n        --\x3e\n      </div>\n\n      <div id="thermal-props-ov"  class="view-box" >\n        <div class="title">Vibrational and thermal properties\n          <img style="float: right" class="to-detail thermal-props" src="img/more.svg" />\n          <div style="clear: both;"></div>\n        </div>\n\n        <div style="padding: 36px; ">\n          <div class="info-fields-label">\n            <span info-sys-data="heat-capacity-cv">Specific heat</span>\n          </div>\n\n\n          <div>\n              <div id="heat-plotter" >  </div>\n          </div>\n          <div class="footer-heat-calc" style="text-align: center"></div>\n        </div>\n\n      </div>\n\n    </div>\n\n    <div style="clear: both;"></div>\n    ',this.materialTitle=this.element.getElementsByClassName("material-title")[0],this.systemType=this.element.querySelector(".system-type-field"),this.spaceGroupField=this.element.querySelector(".space-group-field"),this.spaceGroupValue=this.element.querySelector(".space-group-value"),this.structTypeField=this.element.querySelector(".structure-type-field"),this.structTypeValue=this.element.querySelector(".structure-type-value"),this.functional=this.element.querySelector(".functional-field"),this.code=this.element.querySelector(".code-field");let e=this.element.getElementsByClassName("to-detail");this.structureDetailBtn=e[0],this.electronicStructDetailBtn=e[2],this.methodologyDetailBtn=e[1],this.thermalDetailBtn=e[3],this.vizBox=this.element.getElementsByClassName("viz-box")[0],this.bandPlotter=null,this.bsCalcIdBox=this.element.getElementsByClassName("footer-bs-calc")[0],this.dosPlotter=null,this.dosCalcIdBox=this.element.getElementsByClassName("footer-dos-calc")[0],this.heatPlotter=null,this.heatCalcIdBox=this.element.querySelector(".footer-heat-calc"),this.spinLegend=this.element.querySelector(".spin-legend"),n.addToInfoSystem(this.element),this.eStructCalcs={bs:null,dos:null}}attachAndSetEvents(e){e.appendChild(this.element),this._events()}_events(){this.structureDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.structure)}),this.electronicStructDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.electronicstruct)}),this.methodologyDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.methodology)}),this.thermalDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.thermalprops)})}getEStructChosenCalcs(){return this.eStructCalcs}setDetailViewsListener(e){this.detailViewsListener=e}setVisible(){this.element.style.display="block"}setMaterialData(){let e=d.getMaterialData();this.materialTitle.innerHTML=i.getMaterialTitle(e),this.materialId=e.id;let t="bulk"===e.system_type;if(this.systemType.textContent=e.system_type,this.structTypeField.style.display=t&&null!==e.structure_type?"block":"none",this.spaceGroupField.style.display=t?"block":"none",t&&(this.structTypeValue.textContent=e.structure_type,this.spaceGroupValue.textContent=e.space_group_number+" ("+e.space_group_international_short_symbol+")",n.addElementToInfoSystem(this.spaceGroupValue,"space-group.value:"+e.space_group_number)),this.similarityFinder&&this.similarityFinder.element.remove(),e.similarity){this.similarityFinder=new h({left:40,right:16,top:0,bottom:30});const t=this.element.querySelector(".similarity-finder");this.similarityFinder.setSimilarityData(e.similarity),t.appendChild(this.similarityFinder.element),this.similartyDataField=this.element.querySelector(".similarity-data-field"),n.addToInfoSystem(this.similartyDataField)}}_evaluateCalc(e){let t=0;switch("GGA"===e.functional_type&&(t+=100),e.has_band_structure&&e.has_dos&&(t+=10),e.code_name.trim()){case"FHI-aims":t+=3;break;case"VASP":t+=2;break;case"Quantum Espresso":t+=1}return t}setCalcsData(e){let t=d.getCalculations(),s=new Map,h=new Map,c=null,p=null,u=null,m=-1,y=-1;for(let e=0;e<t.length;e++){if(s.has(t[e].functional_type)){let i=s.get(t[e].functional_type);s.set(t[e].functional_type,++i)}else s.set(t[e].functional_type,1);let i=t[e].code_name.trim();if(h.has(i)){let e=h.get(i);h.set(i,++e)}else h.set(i,1);let n=this._evaluateCalc(t[e]);t[e].has_band_structure&&n>m&&(m=n,c=t[e]),t[e].has_dos&&n>y&&(y=n,p=t[e]),null===u&&t[e].has_thermal_properties&&(u=t[e])}null!==c&&(this.eStructCalcs.bs=c.id),null!==p&&(this.eStructCalcs.dos=p.id);let v=null;null!==c?v=c.id:null!==p&&(v=p.id),null===v?e.eStruct=null:d.isInAnyNotDisabledGroup(v)?e.eStruct=d.getGroupLeafId(v):e.eStruct=+v,null===u?e.thermalProps=null:d.isInAnyNotDisabledGroup(u.id)?e.thermalProps=d.getGroupLeafId(u.id):e.thermalProps=+u.id;let f="";s.forEach((e,t)=>{f+='<span info-sys-data="functional-type.value:'+t+'">'+e+" "+t+"</span> <br> "}),this.functional.innerHTML=f,n.addToInfoSystem(this.functional);let g="";if(h.forEach((e,t)=>{g+='<span info-sys-data="code-name.value:'+t+'">'+e+" "+t+"</span> <br> "}),this.code.innerHTML=g,n.addToInfoSystem(this.code),null===c&&null===p)document.getElementById("e-structure-ov").style.display="none",d.hasElecStructureData=!1;else{if(document.getElementById("e-structure-ov").style.display="block",d.hasElecStructureData=!0,null===this.bandPlotter&&(this.bandPlotter=new l,this.bandPlotter.attach(document.getElementById("band-plotter"),void 0,316)),null===this.dosPlotter&&(this.dosPlotter=new r({left:40,right:16,top:0,bottom:30}),this.dosPlotter.attach(document.getElementById("dos-plotter"),void 0,317)),null===c)this.bandPlotter.setNoData(),this.bsCalcIdBox.innerHTML="";else{let e=i.getMaterialCalcURL(c.material,c.id,"band_structure");a.show(),i.serverReq(e,e=>{if(200===e.target.status){let t=JSON.parse(e.target.response).band_structure;this.bandPlotter.setBandStructureData(t),this.bsCalcIdBox.innerHTML="From calculation <b>"+c.id+'</b><br><span style="font-size: 0.8em">('+c.functional_type+" - "+c.code_name+")</span>",2===t.segments[0].band_energies.length&&(this.spinLegend.style.display="block")}a.hide()})}if(null===p)this.dosPlotter.setNoData(),this.dosCalcIdBox.innerHTML="";else{let e=i.getMaterialCalcURL(p.material,p.id,"dos");a.show(),i.serverReq(e,e=>{if(200===e.target.status){let t=JSON.parse(e.target.response).dos;this.dosPlotter.setPoints(t,p),this.dosCalcIdBox.innerHTML="From calculation <b>"+p.id+'</b><br><span style="font-size: 0.8em">('+p.functional_type+" - "+p.code_name+")</span>",2===t.dos_values.length&&(this.spinLegend.style.display="block")}a.hide()})}}if(null===u)document.getElementById("thermal-props-ov").style.display="none",d.hasThermalData=!1;else if(document.getElementById("thermal-props-ov").style.display="block",d.hasThermalData=!0,null===this.heatPlotter&&(this.heatPlotter=new o,this.heatPlotter.attach(document.getElementById("heat-plotter"),void 0,317)),null===u)this.heatPlotter.setNoData(),this.heatCalcIdBox.innerHTML="";else{let e=i.getMaterialCalcURL(u.material,u.id,"specific_heat_cv");a.show(),i.serverReq(e,e=>{if(200===e.target.status){let t=JSON.parse(e.target.response).specific_heat_cv;this.heatPlotter.setData(t),this.heatCalcIdBox.innerHTML="From calculation <b>"+u.id+'</b></b> <span style="font-size: 0.8em">('+u.functional_type+" - "+u.code_name+")</span>"}a.hide()})}}}},function(e,t,s){s(0);e.exports=class{constructor(e){this.off=!0,this.element=document.createElement("span"),this.element.innerHTML+=`\n       <img src="${e}_off.png" width="24px"\n        style="margin-bottom: -1px; cursor: pointer"/>\n    `,this.image=this.element.querySelector("img"),this.element.addEventListener("click",t=>{this.off=!this.off;let s=this.off?e+"_off":e;this.image.setAttribute("src",s+".png"),this.listener(this.off)})}setListener(e){this.listener=e}}},function(e,t,s){let i=s(0);e.exports={SimilarityFinder:class{constructor(){this.folded=!0,this.element=document.createElement("span"),this.element.setAttribute("info-sys-data","similar-materials"),this.element.style="float : right; border: 2px solid #DDD; padding: 2px 2px 0px 3px;",this.element.innerHTML+=`\n        <span style=" vertical-align: 30%;" ><b>Similar materials</b></span>\n        <img style="cursor: pointer" src="${i.IMAGE_DIR}folded.png" />\n\n      <div class="vr-download-panel" style="position: relative; display: none;">\n\n      </div>\n    `,this.element.tabIndex="0",this.element.style.outline="none",this.foldingPanel=this.element.querySelector(".vr-download-panel"),this.foldBtn=this.element.querySelector("img"),this.foldBtn.addEventListener("click",e=>{this.folded=!this.folded,this.foldBtn.src=this.folded?i.IMAGE_DIR+"folded.png":i.IMAGE_DIR+"unfolded.png",this.foldingPanel.style.display=this.folded?"none":"block"}),this.element.addEventListener("blur",e=>{setTimeout(()=>{this.folded=!0,this.foldBtn.src=i.IMAGE_DIR+"folded.png",this.foldingPanel.style.display="none"},300)})}setSimilarityData(e){const t=Object.keys(e).map((function(t){return{data:e[t],key:t}}));t.sort((function(e,t){return e.data.Tc<t.data.Tc?1:e.data.Tc>t.data.Tc?-1:0}));const s=t.slice(0,5),n=document.createElement("table");n.setAttribute("class","similar-materials-panel-unfolded"),n.style="width: 230px; padding-left: 5px;",this.foldingPanel.appendChild(n);const a=document.createElement("tr");a.style="padding: 5px; ",a.innerHTML='<th style = "text-align: left;">Formula (space group)</th><th>:</th><th style = "text-align: left;">Tc</th>',n.appendChild(a),s.forEach((function(e){const t=e.key.split(":")[0],s=document.createElement("tr");s.style="padding: 5px; font-family: 'Arimo', sans-serif; font-size: 10pt; ";const a=`${window.location.toString().replace(/#.*$/,"")}#/material/${t}`;s.innerHTML=`<td><a href="${a}" target="_${t}" style="color:#777; font-family: 'Arimo', sans-serif; font-size: 10pt;">${i.getSubscriptedFormula(e.data.formula)} (${e.data.space_group_number})</a></td><td>:</td> <td>${e.data.Tc.toPrecision(3)}</td>`,n.appendChild(s)}))}}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(3),l=s(12),r=s(13),o=s(25),d=s(1);s(4);class h{constructor(e){this.groupCalcs=null,this.element=document.createElement("div"),this.element.innerHTML='\n    <div>\n\n      <div class="group-components" style="display: none">\n        <div style="padding: 10px 0 30px 10px; " class="eos-host">\n        </div>\n\n        <div style="padding-top: 10px; " class="calc-selector-host">\n        </div>\n      </div>\n\n      <div class="info-fields">\n        <div><b>Lattice constants</b></div>\n        <div class="latt-constants"></div>\n        <div class="volume-field"><b><span info-sys-data="cell-volume">Volume</span></b>:\n          <span class="volume-value" ></span>\n        </div>\n        \x3c!-- <div><b>Pressure</b>: <span class="" ></span>  </div>--\x3e\n        <div class="density-field"><b>Density</b>:\n            <div class="stats-fields" >\n              <span info-sys-data="mass-density">Mass density</span> =\n              <span class="mass-density-value" ></span>\n            </div>\n            <div class="stats-fields" >\n              <span info-sys-data="atomic-density">Atomic density</span> =\n              <span class="atomic-density-value" ></span>\n            </div>\n        </div>\n\n        <div class="energy-field"><b><span info-sys-data="energies">Energies</span></b> (code-specific)</div>\n        <div class="energy-descomp"> </div>\n\n        <div class="wyckoff-pos-calc-field" >\n          <b><span info-sys-data="free-wyckoff-parameters">Wyckoff sites</span></b>\n          (fractional coordinates)\n          <div class="wyckoff-pos-calc-table"> </div>\n        </div>\n\n      </div>\n\n    </div>\n    ',this.groupComponents=this.element.querySelector(".group-components"),this.calcSelector=new l("calc-selector-bar","60%"),this.element.querySelector(".calc-selector-host").appendChild(this.calcSelector.element),this.lattConstantsField=this.element.querySelector(".latt-constants"),this.volumeField=this.element.querySelector(".volume-field"),this.volumeValue=this.element.querySelector(".volume-value"),this.densityField=this.element.querySelector(".density-field"),this.massDensityValue=this.element.querySelector(".mass-density-value"),this.atomicDensityValue=this.element.querySelector(".atomic-density-value"),this.energyField=this.element.querySelector(".energy-field"),this.energyDescompValue=this.element.querySelector(".energy-descomp"),this.wyckoffPosField=this.element.querySelector(".wyckoff-pos-calc-field"),this.wyckoffPosTable=this.element.querySelector(".wyckoff-pos-calc-table"),this.eosViewer=new o,this.eosViewer.attach(this.element.querySelector(".eos-host"),320,280),this.eosViewer.setClickPointListener(e=>{this.groupCalcUpdate(e+"")}),a.addToInfoSystem(this.element),this._events()}_events(){this.calcSelector.setPrevListener(e=>{if(this.groupIndex>0)return this.groupCalcUpdate(this.groupCalcs[--this.groupIndex]+""),0===this.groupIndex}),this.calcSelector.setNextListener(e=>{if(this.groupIndex<this.groupCalcs.length-1)return this.groupCalcUpdate(this.groupCalcs[++this.groupIndex]+""),this.groupIndex===this.groupCalcs.length-1})}update(e,t){if(this.representative=e,this.isGroup=!1,void 0!==t){this.groupCalcs=Array.from(t.calcs),this.groupIndex=this.groupCalcs.indexOf(d.getCalcReprIntId(this.representative)),this.isGroup=!0,this.groupComponents.style.display="block",this.eosViewer.clear();let e,s=[],i=[];this.groupCalcs.forEach(e=>{let t=d.getCalc(e);s.push(t.cell_volume/1e-30);let n=555;t.energy.forEach(e=>{"Total E"===e.e_kind&&(n=e.e_val/1602176565e-28)}),i.push(n)}),d.getCalc(t.method_representative).energy.forEach(t=>{"Total E"===t.e_kind&&(e=t.e_val/1602176565e-28)}),this.eosViewer.draw(s,i,this.groupCalcs,e)}else this.groupComponents.style.display="none";this.groupCalcUpdate(e)}groupCalcUpdate(e){if(null!==e){let t=d.getCalcReprIntId(e);if(null!==this.groupCalcs&&(this.groupIndex=this.groupCalcs.indexOf(t),this.groupIndex>=0)){let e=t+" ("+(this.groupIndex+1)+"/"+this.groupCalcs.length+")";this.calcSelector.setState(e,0===this.groupIndex,this.groupIndex===this.groupCalcs.length-1),this.eosViewer.selectCalc(t)}let s="2D"===d.getMaterialData().system_type,i="bulk"===d.getMaterialData().system_type,a=d.getCalc(t),l=n.getNumberArray(a.lattice_parameters),r=s||i?`<div>b = ${n.m2Angstrom(l[1])}</div>`:"";r+=i?`<div>c = ${n.m2Angstrom(l[2])}</div>`:"";let o=s||i?`<div>&alpha; = ${n.rad2degree(l[3])}</div>`:"";o+=i?`<div>&beta; = ${n.rad2degree(l[4])}</div>\n          <div>&gamma; = ${n.rad2degree(l[5])}</div>`:"",this.lattConstantsField.innerHTML=`\n        <div style="float: left; ">\n          <div>a = ${n.m2Angstrom(l[0])}</div>\n          ${r}\n        </div>\n        <div style="float: left; padding-left: 40px;">\n          ${o}\n        </div>\n        <div style="clear: both;padding: 0"></div>\n      `,this.densityField.style.display=i?"block":"none",this.volumeField.style.display=i?"block":"none",i&&(this.volumeValue.innerHTML=n.m3ToAngstrom3(a.cell_volume),this.atomicDensityValue.innerHTML=n.toAngstromMinus3(a.atomic_density),this.massDensityValue.innerHTML=a.mass_density.toFixed(1)+" kg/m<sup>3</sup>");let h=n.serverReq(n.getCalcEnergiesURL(d.getMaterialData().id,a.id),()=>{let e=!1;if(200===h.status){let s=JSON.parse(h.response).results;for(var t=0;t<s.length;t++)"Total E"===s[t].e_kind&&(e=!0,this.energyDescompValue.innerHTML="<div>Total E = &nbsp; "+n.J2eV(s[t].e_val)+" eV</div>")}this.energyField.style.display=e?"block":"none",this.energyDescompValue.style.display=e?"block":"none"}),c=d.getMaterialData().has_free_wyckoff_parameters&&a.wyckoff_groups_json.length>0;if(this.wyckoffPosField.style.display=c?"block":"none",c){let e=new Map;a.wyckoff_groups_json.forEach(t=>{if(0!==Object.keys(t.variables).length){let s="";for(let e in t.variables)s+=e+" = "+t.variables[e].toFixed(2)+"<br>";let i=[];i.push(t.wyckoff_letter),i.push(s),e.has(t.element)?e.get(t.element).push(i):e.set(t.element,[i])}});let t="";e.forEach((e,s)=>{e.sort((e,t)=>e[0]>t[0]?1:-1);let i=!0;t+='<tr > <td style="width: 30%;">'+s+" </td>",e.forEach(e=>{i?(i=!1,t+='<td style="width: 30%; ">'+e[0]+'</td><td style="width: 40%;">'+e[1]+"</td></tr>"):t+="<tr><td> </td><td>"+e[0]+"</td><td>"+e[1]+"</td></tr>"})}),this.wyckoffPosTable.innerHTML='<table id="calc-wyckoff">'+t+"</table>"}}else console.log("THIS dOESNT BE REACHED")}}class c{constructor(e,t){this.calcMapByFunctional=e,this.hostElement=t,this.graphTrigger=null,this.viewType="text",this.functional=null,this.hostElement.innerHTML+='\n      <div style="float: left" >\n        <svg xmlns="http://www.w3.org/2000/svg" class="chart-tab"\n          viewBox="0 0 15 15" width="15" height="15" style="fill: #c7c7c7;">\n            <rect x="0" y="0"  width="2" height="15" />\n            <rect   x="3" y="5"  width="1.8" height="7"  />\n            <rect  x="6" y="3"  width="1.8" height="9"  />\n            <rect   x="9" y="6"  width="1.8" height="6"  />\n            <rect  x="12" y="2"  width="1.8" height="10"  />\n            <rect x="2" y="13"   width="13" height="2" />\n        </svg>\n        <svg xmlns="http://www.w3.org/2000/svg" class="text-tab"\n          viewBox="0 0 15 15" width="15" height="15" style="fill: #777;">\n            <rect x="0" y="1"   width="15" height="2.5" />\n            <rect   x="0" y="6"  width="15" height="2.5"  />\n            <rect  x="0" y="11"  width="15" height="2.5"  />\n        </svg>\n      </div>\n\n      <div class="functional-tabs" style="float: right">\n      </div>\n\n      <div style="clear: both;"></div>\n\n      <div class="content-placeholder" >\n\n        <div style="display: block" class="text-panel" >\n          <div><b>Lattice constants</b>:\n            <div class="stats-fields latt-constants-field" >\n            </div>\n          </div>\n          <div class="volume-field"><b><span info-sys-data="cell-volume">Volume</span></b> (&#197;<sup>3</sup>):\n            <div class="stats-fields volume-value" > </div>\n          </div>\n          <div class="density-field"><b>Density</b> :\n            <div >\n              <div class="stats-fields" >\n                <span info-sys-data="mass-density">Mass density</span> (kg/m<sup>3</sup>) =\n                <span class="mass-density-value" ></span>\n              </div>\n              <div class="stats-fields" >\n                <span info-sys-data="atomic-density">Atomic density</span> (&#197;<sup>-3</sup>) =\n                <span class="atomic-density-value" ></span>\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <div style="display:none" class="chart-panel" >\n          <div class="charts-placeholder" > </div>\n          <div class="charts-selector" >\n\n          </div>\n        </div>\n\n      </div>\n    ',this.chartTab=this.hostElement.querySelector(".chart-tab"),this.textTab=this.hostElement.querySelector(".text-tab"),this.functionalTabs=this.hostElement.querySelector(".functional-tabs"),this.chartPanel=this.hostElement.querySelector(".chart-panel"),this.textPanel=this.hostElement.querySelector(".text-panel"),this.lattConstantsField=this.hostElement.querySelector(".latt-constants-field"),this.volumeField=this.hostElement.querySelector(".volume-field"),this.volumeFieldValue=this.hostElement.querySelector(".volume-value"),this.densityField=this.hostElement.querySelector(".density-field"),this.massDensityValue=this.hostElement.querySelector(".mass-density-value"),this.atomicDensityValue=this.hostElement.querySelector(".atomic-density-value"),this.calcMapByFunctional.forEach((e,t)=>{this.functionalTabs.innerHTML+='<span class="tab" data-tab="'+t+'">'+t+"</span>"}),this.statsViewer=new r;let s=this.hostElement.querySelector(".charts-placeholder");this.statsViewer.attach(s,350,200),this.chartsSelector=this.hostElement.querySelector(".charts-selector"),this.build(e),this.chartTab.addEventListener("click",e=>{this.chartTab.style.fill="#777",this.viewType="chart",this.textTab.style.fill="#c7c7c7",this.chartPanel.style.display="block",this.textPanel.style.display="none"}),this.textTab.addEventListener("click",e=>{this.textTab.style.fill="#777",this.viewType="text",this.chartTab.style.fill="#c7c7c7",this.textPanel.style.display="block",this.chartPanel.style.display="none"}),this.functionalTabs.addEventListener("click",e=>{"tab"===e.target.className&&(this.statsViewer.clear(),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab",this.functional=e.target.getAttribute("data-tab"),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",this._setData())}),this.chartsSelector.addEventListener("click",e=>{if(0===e.target.className.indexOf("quantity")){this.statsViewer.clear();let t=e.target.getAttribute("data-quantity"),s=this.functionalQuantityMap.get(this.functional).get(t);this.statsViewer.drawPoints(s.data,s.label,s.min,s.max),this.chartsSelector.querySelector(".quantity-selected").className="quantity",e.target.className="quantity-selected"}})}_setData(){let e="2D"===d.getMaterialData().system_type,t="bulk"===d.getMaterialData().system_type,s=this.functionalQuantityMap.get(this.functional),i=e||t?`<div>b (&#197;) = ${s.get("lattice_b").html}</div>`:"";i+=t?`<div>c (&#197;) = ${s.get("lattice_c").html}</div>`:"",this.lattConstantsField.innerHTML=`\n      <div style="float: left; ">\n        <div>a (&#197;) = ${s.get("lattice_a").html}</div>\n        ${i}\n      </div>\n      <div style="float: left; padding-left: 40px;">\n        ${n.getLatticeAnglesValues(this.calcMapByFunctional.get(this.functional),e,t)}\n      </div>\n      <div style="clear: both;padding: 0"></div>\n      `;let a='\n    <span class="quantity-selected" data-quantity="lattice_a">a</span>\n    ';(e||t)&&(a+='<span class="quantity" data-quantity="lattice_b">b</span>'),this.densityField.style.display=t?"block":"none",this.volumeField.style.display=t?"block":"none",t&&(this.volumeFieldValue.innerHTML=s.get("volume").html,this.massDensityValue.innerHTML=s.get("mass_density").html,this.atomicDensityValue.innerHTML=s.get("atomic_density").html,a+='\n        <span class="quantity" data-quantity="lattice_c">c</span>\n        <span class="quantity" data-quantity="volume">volume</span>\n        <span class="quantity" data-quantity="mass_density">mass density</span>\n        <span class="quantity" data-quantity="atomic_density">atomic density</span>\n      '),this.chartsSelector.innerHTML=a;let l=s.get("lattice_a");this.statsViewer.drawPoints(l.data,l.label,l.min,l.max)}build(e){this.calcMapByFunctional=e,this.graphTrigger=null,this.statsViewer.clear(),this.unfoldedElement=null,this.functionalQuantityMap=new Map;for(var t=0;t<this.functionalTabs.children.length;t++)this.functionalTabs.children[t].style.display="none",this.functionalTabs.children[t].className="tab";this.calcMapByFunctional.forEach((e,t)=>{let s=n.getQuantityStatsMap(e);this.functionalQuantityMap.set(t,s),this.functionalTabs.querySelector('[data-tab="'+t+'"]').style.display="inline"});let s=Array.from(this.calcMapByFunctional.keys());(null===this.functional||s.indexOf(this.functional)<0)&&(this.functional=s[0]),this._setData(),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",a.addToInfoSystem(this.hostElement)}}e.exports=class extends i{constructor(){super("Structure"),this.groupsData,this.firstId,this.lastId,this.element.innerHTML+='\n\n      <div style="float: left; width: 36%;">\n        <div class="view-box">\n          <div class="title">Structure </div>\n          <div class="viz-box" style="height: 400px; position: relative"></div>\n\n          <div class="footer-flex-wrapper">\n\n            <div class="fields-container">\n              <div><b><span>System type</span></b>:\n                <span class="struct-field" ></span>\n              </div>\n              <div class="structure-type-field" style="display: none">\n                <b><span info-sys-data="structure-type">Structure type</span></b>:\n                <span class="structure-type-value" ></span>\n              </div>\n              <div class="structure-prototype-field" style="display: none">\n                <b><span info-sys-data="structure-prototype">Structure prototype</span></b>:\n                <span class="structure-prototype-value" ></span>\n              </div>\n              <div class="strukturbericht-field" style="display: none">\n                <b><span info-sys-data="strukturbericht">Strukturbericht designation</span></b>:\n                <span class="strukturbericht-value" ></span>\n              </div>\n            </div>\n\n            <div class="footer-flex" style="display: none">\n\n              <div class="fields-container"\n                style="flex-basis: 70%; border-right: 1px solid #E4E4E4; ">\n\n                <div>\n                  <b><span info-sys-data="crystal-system">Lattice</span></b>:\n                  <span class="lattice-value" ></span>\n                </div>\n                <div>\n                  <b><span info-sys-data="space-group">Space group</span></b>:\n                  <span class="space-group-value" ></span>\n                </div>\n                <div>\n                  <b><span info-sys-data="point-group">Point group</span></b>:\n                  <span class="point-group-value" ></span>\n                </div>\n              </div>\n\n              <div style="flex-basis: 30%; margin-left: 30px;">\n                <div class="fields-container">\n                  <div><b><span info-sys-data="wyckoff-position-population">Wyckoff sites</span></b></div>\n                  <div class="wyckoff-sites-value"> </div>\n                </div>\n              </div>\n\n            </div>\n\n          </div>\n\n        </div>\n      </div>\n\n      <div style="float: left; width: 36%;">\n        <div class="view-box">\n          <div class="title">Calculations</div>\n          <div class="navTreeWrapper"></div>\n\n          <div class="summary-title">Summary  </div>\n          <div style="font-size: 0.85em; text-align: center; padding: 4px;">Based on the calculations selected above</div>\n\n          <div class="info-fields summary-box">\n          \x3c!-- Lattice constants Cell volume, Density panel dynamically generated\n            --\x3e\n          </div>\n        </div>\n      </div>\n\n      <div style="float: right; width: 28%;">\n        <div class="calc-specifics-box">\n\n          <div style="padding-top: 10px; " >\n            <div class="tree-leaf-title"></div>\n          </div>\n\n          <div class="tree-leaf-viewer-host"></div>\n\n          </div>\n        </div>\n\n      </div>\n    </div>\n    ',this.navTreeWrapper=this.element.getElementsByClassName("navTreeWrapper")[0];let e=this.element.getElementsByClassName("struct-field");this.systemTypeField=e[0],this.structTypeField=this.element.querySelector(".structure-type-field"),this.structTypeValue=this.element.querySelector(".structure-type-value"),this.structPrototypeField=this.element.querySelector(".structure-prototype-field"),this.structPrototypeValue=this.element.querySelector(".structure-prototype-value"),this.strukturberichtField=this.element.querySelector(".strukturbericht-field"),this.strukturberichtValue=this.element.querySelector(".strukturbericht-value"),this.lowerBox=this.element.querySelector(".footer-flex"),this.latticeValue=this.element.querySelector(".lattice-value"),this.spaceGroupValue=this.element.querySelector(".space-group-value"),this.pointGroupValue=this.element.querySelector(".point-group-value"),this.wyckoffValue=this.element.querySelector(".wyckoff-sites-value"),this.summaryByFunctionals=null,this.leafTitle=this.element.querySelector(".tree-leaf-title"),this.summaryBox=this.element.querySelector(".summary-box"),this.calcSpecificsBox=this.element.querySelector(".calc-specifics-box"),this.treeLeafViewer=new h,this.element.querySelector(".tree-leaf-viewer-host").appendChild(this.treeLeafViewer.element),this.vizBox=this.element.querySelector(".viz-box"),a.addToInfoSystem(this.element)}setMaterialData(){let e=d.getMaterialData();if(super.setMaterialData(e),this.isBulk="bulk"===e.system_type,this.systemTypeField.textContent=e.system_type,this.structTypeField.style.display=this.isBulk&&null!==e.structure_type?"block":"none",this.structPrototypeField.style.display=this.isBulk&&null!==e.structure_prototype?"block":"none",this.strukturberichtField.style.display=this.isBulk&&null!==e.strukturbericht_designation?"block":"none",this.lowerBox.style.display=this.isBulk?"flex":"none",this.isBulk){this.structTypeValue.textContent=e.structure_type,this.structPrototypeValue.textContent=e.structure_prototype,this.strukturberichtValue.textContent=e.strukturbericht_designation,this.spaceGroupValue.textContent=e.space_group_number+" ("+e.space_group_international_short_symbol+")",this.pointGroupValue.textContent=e.point_group,this.latticeValue.textContent=e.crystal_system;let s=new Map;new Set;for(var t=0;t<e.elements.length;t++){let i=n.ELEMENTS[e.elements[t].label-1];if(s.has(i))s.get(i).add(e.elements[t].wyckoff);else{let n=new Set;n.add(e.elements[t].wyckoff),s.set(i,n)}}let i="";s.forEach((e,t)=>{let s=!0;i+="<tr> <td>"+t+": </td>",e.forEach(e=>{s?(s=!1,i+="<td>"+e+"</td></tr>"):i+="<tr><td> </td><td>"+e+"</td></tr>"})}),this.wyckoffValue.innerHTML="<table>"+i+"</table>"}a.addElementToInfoSystem(this.spaceGroupValue,"space-group.value:"+e.space_group_number),a.addElementToInfoSystem(this.latticeValue,"crystal-system.value:"+e.crystal_system),a.addElementToInfoSystem(this.pointGroupValue,"point-group.value:"+e.point_group)}updateSelection(e){if(e.size>0){this.summaryBox.style.visibility="visible";let t=new Set;e.forEach(e=>{let s;s=d.getGroups().has(e)?d.getCalc(d.getGroups().get(e).method_representative):d.getCalc(parseInt(e)),t.add(s)});let s=function(e){let t=new Map;return e.forEach(e=>{if(t.has(e.functional_type))t.get(e.functional_type).add(e);else{let s=new Set;s.add(e),t.set(e.functional_type,s)}}),t}(t);null===this.summaryByFunctionals?this.summaryByFunctionals=new c(s,this.summaryBox):this.summaryByFunctionals.build(s);let i=0;e.forEach(t=>{i++,1===i?this.firstId=t:i===e.size&&(this.lastId=t)})}else this.summaryBox.style.visibility="hidden"}updateMarkedLeaf(e){null!==e?(this.calcSpecificsBox.style.visibility="visible",d.getGroups().has(e)?this.leafTitle.innerHTML=e+" ("+d.getGroups().get(e).calcs.size+")":this.leafTitle.innerHTML=e):this.calcSpecificsBox.style.visibility="hidden",this.treeLeafViewer.update(e,d.getGroups().get(e))}}},function(e,t,s){"use strict";let i=s(2),n=s(5);e.exports=class extends n{constructor(){super({left:60,right:20,top:30,bottom:40}),this.tooltip,this.calcPointMap=new Map,this.pointSelected=null}draw(e,t,s,n){for(let e=0;e<t.length;e++)555!==t[e]&&(t[e]-=n);let a=function(e){let t=[];return e.forEach(e=>{555!==e&&t.push(e)}),t}(t),l=Math.min.apply(null,e),r=Math.max.apply(null,e),o=0,d=Math.max.apply(null,a);if(l===r)l-=1,r+=1;else{let e=r-l;l-=.1*e,r+=.1*e}if(o===d)o-=1,d+=1;else{let e=d-o;o-=.15*e,d+=.1*e}this.setRangeAndLabels("Volume (ų)",l,r,"E - Eₘᵢₙ (eV)",o,d),this.drawAxis(2,null);let h=this;function c(e,t){let s=h.y(t);i.addLine(e,0,s,-3,s,1);let n=-s/h.yRel+h.yMin;i.addText(e,-5,s+3,n.toFixed(3),"end","statisticsviewersteps")}c(this.plotArea,0),c(this.plotArea,d/2),c(this.plotArea,d),i.addLine(this.plotArea,0,this.y(0),this.plotRangeX,this.y(0),"zeroline"),i.addText(this.plotArea,this.x(r),this.y(0)+12,"Eₘᵢₙ: "+n.toFixed(3)+" eV","end","axis-steps");for(let n=0;n<e.length;n++){let a=0===n?"eos-viewer-sel":"eos-viewer",l=0===n?6:3,r=555===t[n]?20:this.y(t[n]),o=i.addPoint(this.plotArea,this.x(e[n]),r,l,a);0===n&&(this.pointSelected=o),o.addEventListener("mouseover",e=>{this.tooltip=i.addText(this.plotArea,e.target.getBBox().x+10,e.target.getBBox().y-10,"Calc "+s[n],"middle","tooltip")}),o.addEventListener("mouseout",e=>{i.removeElement(this.tooltip)}),o.addEventListener("click",e=>{this.clickPointListener(s[n])}),this.calcPointMap.set(s[n],o)}}selectCalc(e){this.pointSelected.setAttribute("class","eos-viewer"),this.pointSelected.setAttribute("r",3),this.pointSelected=this.calcPointMap.get(e),this.pointSelected.setAttribute("class","eos-viewer-sel"),this.pointSelected.setAttribute("r",6)}setClickPointListener(e){this.clickPointListener=e}x(e){return this.xRel*(e-this.xMin)}y(e){return-this.yRel*(e-this.yMin)}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(3),l=s(12),r=s(13),o=s(27),d=(new(s(5)),s(1)),h=s(4);class c{constructor(e,t){this.calcMapByFunctional=e,this.hostElement=t,this.viewType="text",this.functional=null,this.hostElement.innerHTML+='\n      <div style="float: left" >\n        <svg xmlns="http://www.w3.org/2000/svg" class="chart-tab"\n          viewBox="0 0 15 15" width="15" height="15" style="fill: #c7c7c7;">\n            <rect x="0" y="0"  width="2" height="15" />\n            <rect   x="3" y="5"  width="1.8" height="7"  />\n            <rect  x="6" y="3"  width="1.8" height="9"  />\n            <rect   x="9" y="6"  width="1.8" height="6"  />\n            <rect  x="12" y="2"  width="1.8" height="10"  />\n            <rect x="2" y="13"   width="13" height="2" />\n        </svg>\n        <svg xmlns="http://www.w3.org/2000/svg" class="text-tab"\n          viewBox="0 0 15 15" width="15" height="15" style="fill: #777;">\n            <rect x="0" y="1"   width="15" height="2.5" />\n            <rect   x="0" y="6"  width="15" height="2.5"  />\n            <rect  x="0" y="11"  width="15" height="2.5"  />\n        </svg>\n      </div>\n\n      <div class="functional-tabs" style="float: right">\n      </div>\n\n      <div style="clear: both;"></div>\n\n      <div class="content-placeholder" >\n\n        <div style="display: block" class="text-panel" >\n\n          <div><b><span info-sys-data="band gap">Band gap</span></b> (eV):\n            <div class="stats-fields summary-bandgap-field" > </div>\n          </div>\n        </div>\n\n        <div style="display:none" class="chart-panel" >\n          <div class="charts-placeholder" > </div>\n        </div>\n\n      </div>\n    ',this.chartTab=this.hostElement.querySelector(".chart-tab"),this.textTab=this.hostElement.querySelector(".text-tab"),this.functionalTabs=this.hostElement.querySelector(".functional-tabs"),this.chartPanel=this.hostElement.querySelector(".chart-panel"),this.textPanel=this.hostElement.querySelector(".text-panel"),this.bandgapField=this.hostElement.querySelector(".summary-bandgap-field"),this.statsViewer=new r;let s=this.hostElement.querySelector(".charts-placeholder");this.statsViewer.attach(s,250,150),this.build(e),this.chartTab.addEventListener("click",e=>{this.chartTab.style.fill="#777",this.viewType="chart",this.textTab.style.fill="#c7c7c7",this.chartPanel.style.display="block",this.textPanel.style.display="none"}),this.textTab.addEventListener("click",e=>{this.textTab.style.fill="#777",this.viewType="text",this.chartTab.style.fill="#c7c7c7",this.textPanel.style.display="block",this.chartPanel.style.display="none"}),this.functionalTabs.addEventListener("click",e=>{"tab"===e.target.className&&(this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab",this.functional=e.target.getAttribute("data-tab"),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",this._setData())})}_setData(){let e=this.functionalBandGapMap.get(this.functional);this.bandgapField.innerHTML=e.html,this.statsViewer.clear(),this.statsViewer.drawPoints(e.data,e.label,e.min,e.max)}build(e){0===e.size?(this.hostElement.style.display="none",this.hostElement.previousElementSibling.style.display="none"):(this.hostElement.style.display="block",this.hostElement.previousElementSibling.style.display="block"),this.unfoldedElement=null,this.functionalTabs.innerHTML="",this.functionalBandGapMap=new Map,e.forEach((e,t)=>{let s=[];e.forEach(e=>{s.push(e.band_gap/1602176565e-28)});let i={};i.data=s,i.min=Math.min.apply(null,s),i.max=Math.max.apply(null,s),i.equal=i.min===i.max,i.label="band gap",i.html=n.getAverage(i.data).toFixed(2)+' &nbsp; <span style="font-size: 0.9em">['+i.min.toFixed(2)+" , "+i.max.toFixed(2)+"]</span>",this.functionalBandGapMap.set(t,i);let a="tab";null===this.functional&&(this.functional=t),this.functional===t&&(this._setData(),a="tab-selected"),this.functionalTabs.innerHTML+='<span class="'+a+'" data-tab="'+t+'">'+t+"</span>"}),a.addToInfoSystem(this.hostElement)}}class p{constructor(e){this.hostElement=e,this.bzViewer=null}setCalcData(e,t){null===this.bzViewer&&(this.bzViewer=new BrillouinZoneViewer(this.hostElement)),this.bzViewer.load(this._getBZDataForViewer(e,t)),this.hostElement.style.visibility="visible"}setNoData(){this.hostElement.style.visibility="hidden"}_getBZDataForViewer(e,t){let s=[],i=[];return t.forEach(e=>{s.push(e.band_segm_labels),i.push(e.band_k_points)}),{vertices:e.vertices,faces:e.faces,basis:e.basis,labels:s,segments:i}}}e.exports=class extends i{constructor(){super("Electronic Structure"),this.firstId,this.lastId,this.element.innerHTML+='\n      <div style="float: left; width: 30%;">\n        <div class="view-box">\n          <div class="title">Calculations </div>\n          <div class="navTreeWrapper"></div>\n\n\n          <div class="summary-title">Summary</div>\n          <div class="footer summary-box" style="border-top: 0">\n          </div>\n        </div>\n      </div>\n\n      <div style="float: right; width: 70%;">\n        <div class="view-box e-structure-box">\n\n          <div class="title">Electronic structure</div>\n\n          <div style="padding-top: 10px;">\n            <div class="calc-selector-host"></div>\n          </div>\n\n\n          <div>\n\n            <div  style="padding: 30px  100px 20px 100px; ">\n              <div class="info-fields-label" style="float: left; width: 54%; ">\n                <span info-sys-data="band-structure">Band structure</span>\n              </div>\n              <div class="info-fields-label" style="float: left;">\n                <span info-sys-data="DOS">DOS</span>\n              </div>\n              <div style="clear: both;"></div>\n\n              <div class="calc-bs-dos-plotter" >\n              </div>\n\n              <div>\n              <div class="band-gap-field" style="float: left; width: 56%; text-align: right">\n                <b><span info-sys-data="band-gap">Band gap</span></b>:\n                <span class="band-gap-value" ></span>\n              </div>\n              <div style="clear: both;"></div>\n\n              </div>\n            </div>\n\n            <div class="spin-legend" style="font-size: 0.9em; padding: 0 30px 10px; display: none">\n              <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin1"/></svg>\n              Spin <span style=\'font-size: 1.1em\'>⇧</span>  &nbsp;&nbsp;&nbsp;\n              <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin2"/></svg>\n              Spin <span style=\'font-size: 1.1em\'>⇩</span>\n            </div>\n\n          </div>\n\n          <div class="footer lower-section">\n\n            <div  style="float: left">\n              <div style="padding: 16px; ">\n                <div class="info-fields-label" >\n                  <span info-sys-data="brillouin-zone-viewer">Brillouin zone</span>\n                </div>\n                <div class="bz-viewer-wrapper" style="width: 400px; height: 400px">\n                </div>\n              </div>\n            </div>\n\n            <div class="band" style="float: right; width: 40%;">\n              <div style="padding: 16px; ">\n                <div class="info-fields-label" >\n                  \x3c!-- <span info-sys-data="fermi-surface">Fermi surface </span> --\x3e\n                </div>\n                <div class="fermi-box" >      </div>\n              </div>\n            </div>\n\n            <div style="clear: both;"></div>\n\n          </div> \x3c!-- footer --\x3e\n\n        </div>\n\n      </div> \x3c!-- view-box --\x3e\n    ',this.navTreeWrapper=this.element.getElementsByClassName("navTreeWrapper")[0],this.calcSelector=new l("calc-selector-bar","70%"),this.element.querySelector(".calc-selector-host").appendChild(this.calcSelector.element),this.rightBox=this.element.querySelector(".e-structure-box"),this.summaryByFunctionals=null,this.bsDosPlotter=new o,this.bandGapField=this.element.querySelector(".band-gap-field"),this.bandGapValue=this.element.querySelector(".band-gap-value"),this.spinLegend=this.element.querySelector(".spin-legend"),this.lowerSection=this.element.querySelector(".lower-section"),this.fermiBox=this.element.getElementsByClassName("fermi-box")[0],n.loadLib("lib/x3dom.js"),this.bzViewerWrapper=this.element.querySelector(".bz-viewer-wrapper"),this.bzViewerWrapper=new p(this.bzViewerWrapper),a.addToInfoSystem(this.element),this._events()}_events(){this.calcSelector.setPrevListener(e=>{if(this.groupIndex>0){let e=this.groupCalcs[--this.groupIndex];return this._loadGraphData(e),this._updateSelectorState(e),0===this.groupIndex}}),this.calcSelector.setNextListener(e=>{if(this.groupIndex<this.groupCalcs.length-1){let e=this.groupCalcs[++this.groupIndex];return this._loadGraphData(e),this._updateSelectorState(e),this.groupIndex===this.groupCalcs.length-1}})}updateSelection(e){if(e.size>0){this.rightBox.style.visibility="visible";let t=function(e){let t=new Map;return e.forEach(e=>{let s=d.getCalc(d.getCalcReprIntId(e));if(s.has_band_structure)if(t.has(s.functional_type))t.get(s.functional_type).add(s);else{let e=new Set;e.add(s),t.set(s.functional_type,e)}}),t}(e);null===this.summaryByFunctionals?this.summaryByFunctionals=new c(t,this.element.querySelector(".summary-box")):this.summaryByFunctionals.build(t);let s=0;e.forEach(t=>{s++,1===s&&(this.firstId=t),s===e.size&&(this.lastId=t)})}else this.rightBox.style.visibility="hidden"}updateMarkedLeaf(e){if(this.groupCalcs=null,null!==e){if(d.getGroups().has(e)){this.groupCalcs=Array.from(d.getGroups().get(e).calcs);let t=d.getCalcReprIntId(e);this.groupIndex=this.groupCalcs.indexOf(t),this._updateSelectorState(t)}else this.calcSelector.setState(e,!0,!0);this._loadGraphData(d.getCalcReprIntId(e))}else this.calcSelector.setState("NO SELECTION",!0,!0)}_updateSelectorState(e){let t=e+" ("+(this.groupIndex+1)+"/"+this.groupCalcs.length+")";this.calcSelector.setState(t,0===this.groupIndex,this.groupIndex===this.groupCalcs.length-1)}_loadGraphData(e){let t=d.getCalc(e);if(this.bsDosPlotter.isAttached()||this.bsDosPlotter.attach(this.element.querySelector(".calc-bs-dos-plotter"),void 0,360),null===t||!t.has_band_structure&&!t.has_dos)this.bsDosPlotter.setNoData(),this.bzViewerWrapper.setNoData(),this.bandGapField.style.display="none",this.lowerSection.style.display="none";else{h.show();let e=d.getMaterialData().id;n.serverReq(n.getMaterialCalcURL(e,t.id,"dos"),s=>{let i=JSON.parse(s.target.response).dos;n.serverReq(n.getMaterialCalcURL(e,t.id,"band_structure"),s=>{let a=JSON.parse(s.target.response).band_structure;n.serverReq(n.getMaterialCalcURL(e,t.id,"brillouin_zone_json"),e=>{let s=JSON.parse(e.target.response).brillouin_zone_json;(function(e,t){if(void 0!==e&&2===e.segments[0].band_energies.length)return!0;if(void 0!==t&&2===t.dos_values.length)return!0;return!1})(a,i)&&(this.spinLegend.style.display="block"),this.bsDosPlotter.setUpAndData(a,i,t),t.has_band_structure?(this.bandGapField.style.display="block",this.bandGapValue.textContent=n.J2eV(t.band_gap,2)+" eV ",s?(this.lowerSection.style.display="block",this.bzViewerWrapper.setCalcData(s,a.segments)):(this.lowerSection.style.display="none",this.bzViewerWrapper.setNoData())):(this.lowerSection.style.display="none",this.bandGapField.style.display="none",this.bzViewerWrapper.setNoData()),h.hide()})})})}}setPrevCalcListener(e){this.prevCalcListener=e}setNextCalcListener(e){this.nextCalcListener=e}}},function(e,t,s){let i=s(7),n=s(10);s(2);e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("style","margin: 0 auto"),this.parentElement=null,this.bsPlotter=new i,this.dosPlotter=new n({left:4,right:16,top:0,bottom:30}),this.dosYAxisLabeled=!1}attach(e,t,s){e.appendChild(this.element),this.bsPlotter.attach(this.element,s,s),this.height=s,this.dosPlotter.attach(this.element,this.height/2+20,s),this.parentElement=e}isAttached(){return null!==this.parentElement}setUpAndData(e,t,s){let i;if(this.hasDispData=null!=e,this.hasDosData=null!=t,i=!(!this.hasDosData||this.hasDispData),this.dosYAxisLabeled!==i){this.element.removeChild(this.dosPlotter.svg);let e=i?40:4;this.dosPlotter=new n({left:e,right:16,top:0,bottom:30});let t=this.height/2+e;this.dosPlotter.attach(this.element,t,this.height)}this.dosYAxisLabeled=i,this.hasDispData?(this.bsPlotter.setBandStructureData(e),this.hasDosData&&this.bsPlotter.setRepaintListener((e,t)=>{this.dosPlotter.setYZoomAndOffset(e,t),this.dosPlotter.repaint()})):this.bsPlotter.setNoData(),this.hasDosData?(this.dosPlotter.setPoints(t,s),this.hasDispData&&(this.bsPlotter.setExternalYAxisMax(this.dosPlotter.getYAxisMax()),this.dosPlotter.setRepaintListener((e,t)=>{this.bsPlotter.setYZoomAndOffset(e,t),this.bsPlotter.repaint()}),this.dosPlotter.svg.removeChild(this.dosPlotter.yLabelText),this.dosPlotter.yLabelText=null)):this.dosPlotter.setNoData(),this.dosPlotter.setYAxisLabelsVisibility(i)}setNoData(){this.bsPlotter.setNoData(),this.dosPlotter.setNoData()}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(3),l=s(1),r=s(29);const o=new Map([["single point","Single point"],["GW calculation","GW"],["geometry optimization","Geometry optimization"],["molecular dynamics","Molecular dynamics"],["phonon calculation","Phonon"],["equation of state","Equation of state"],["parameter variation","Parameter variation"],["QHA calculation","QHA"]]),d=new Map([["LDA","LDA"],["GGA","GGA"],["meta-GGA","meta-GGA"],["hybrid-GGA","hybrid-GGA"],["meta-hybrid-GGA","meta-hybrid-GGA"],["HF","HF"]]),h=new Map([["exciting","exciting"],["VASP","VASP"],["FHI-aims","FHI-aims"]]),c=new Map([["full all electron","Full potential"],["pseudopotential","Pseudo potential"]]),p=new Map([["Numeric AOs","Numeric AOs"],["Gaussians","Gaussians"],["(L)APW+lo","(L)APW+lo"],["Plane waves","Plane waves"]]);class u{constructor(e){this.element=document.createElement("div"),this.element.className=e,this.filtersOn=[],this.folded=!0,this.element.innerHTML+=`\n      <div>\n        <div style="display: flex; justify-content: flex-end;">\n          <div class="filter-groups-c-folded" >\n            <span style="vertical-align: top;">Filtering &nbsp;&nbsp;</span>\n          </div>\n          <div class="filter-c-btn" >\n             <img src="${n.IMAGE_DIR}folded.png" />\n            \x3c!--<button class="on">filter</button> --\x3e\n          </div>\n        </div>\n        <div class="filter-groups-c-unfolded" style="display: none">\n          <table style="width: 100%;">\n            <thead>\n            <tr>\n              <th style="width: 12%;"> </th>\n              <th style="width: 16%;">\n                <span>Type</span>\n              </th>\n              <th style="width: 18%;">\n                <span info-sys-data="functional-type">Density functional</span>\n              </th>\n              <th style="width: 12%;">\n                <span info-sys-data="code-name">Code</span>\n              </th>\n              <th style="width: 16%;">\n                <span info-sys-data="pseudopotential-type">Potential</span>\n              </th>\n              <th style="width: 11%;">\n                <span info-sys-data="basis-set-type">Basis set</span>\n              </th>\n              \x3c!-- <th style="width: 9%;"> </th> --\x3e\n            </tr>\n            </thead>\n            <tbody>\n              <tr id="filter-items-row"></tr>\n            </tbody>\n          </table>\n        </div>\n      </div>\n    `,this.unfoldedPanel=this.element.querySelector(".filter-groups-c-unfolded"),this.filterItemsRow=this.element.querySelector("#filter-items-row"),this.foldBtn=this.element.querySelector("img"),this.foldBtn.addEventListener("click",e=>{this.folded=!this.folded,this.foldBtn.src=this.folded?n.IMAGE_DIR+"folded.png":n.IMAGE_DIR+"unfolded.png",this.unfoldedPanel.style.display=this.folded?"none":"block"}),this.element.addEventListener("click",e=>{if("INPUT"===e.target.tagName){let t=this.filtersOn.indexOf(e.target.value);t>=0?this.filtersOn.splice(t,1):this.filtersOn.push(e.target.value),this.itemListener(this.filtersOn)}})}addGroupsItems(e){let t=new Map,s=new Map,i=new Map,n=new Map,a=new Map;e.forEach(e=>{t.has(e.type)||t.set(e.type,o.get(e.type)),s.has(e.functional)||s.set(e.functional,d.get(e.functional)),i.has(e.code)||i.set(e.code,h.get(e.code)),n.has(e.potential)||n.set(e.potential,c.get(e.potential)),a.has(e.basisSet)||a.set(e.basisSet,p.get(e.basisSet))}),this.filterItemsRow.innerHTML="<td></td>",this.filtersOn=[],this.addGroupItems(t),this.addGroupItems(s),this.addGroupItems(i),this.addGroupItems(n),this.addGroupItems(a)}addGroupItems(e){let t="<td>  ";e.forEach((e,s)=>{this.filtersOn.push(s),t+='<input type="checkbox" value="'+s+'" checked><span style="vertical-align: 20%">'+e+"</span> &nbsp;&nbsp; <br> "}),this.filterItemsRow.innerHTML+=t+"</td>"}setItemListener(e){this.itemListener=e}}e.exports=class extends i{constructor(){super("Methodology"),this.sortedCalcs=[],this.markedCalc=null,this.element.innerHTML+='\n\n      <div>\n        <div class="view-box">\n          <div class="title">Methodology</div>\n\n          <div class="filter-placeholder"></div>\n\n          <div class="dataTableWrapper"></div>\n        </div>\n      </div>\n    ',this.dataTableWrapper=this.element.querySelector(".dataTableWrapper"),this.dataTableWrapper.innerHTML+='\n      <table id="methodology-data">\n        <thead>\n        <tr>\n          <th style="width: 12%;">\n            <span>Calculation ID</span>\n            <span class="sorting-button"></span>\n          </th>\n          <th style="width: 16%;">\n            <span>Type</span>\n            <span class="sorting-button"></span>\n          </th>\n          <th style="width: 18%;">\n            <span info-sys-data="functional-type">Density functional</span>\n            <span class="sorting-button"></span>\n          </th>\n          <th style="width: 12%;">\n            <span info-sys-data="code-name">Code</span>\n            <span class="sorting-button"></span>\n          </th>\n          <th style="width: 16%;">\n            <span info-sys-data="pseudopotential-type">Potential</span>\n            <span class="sorting-button"></span>\n          </th>\n          <th style="width: 11%;">\n            <span info-sys-data="basis-set-type">Basis set</span>\n            <span class="sorting-button"></span>\n          </th>\n          \x3c!-- <th style="width: 8%;">\n            <span info-sys-data="basis-set-type">Link</span>\n\n          </th>\n          <th style="width: 8%;">\n            <span info-sys-data="basis-set-type">RV</span>\n\n          </th> --\x3e\n        </tr>\n        </thead>\n        <tbody>\n        </tbody>\n      </table>\n    ',this.tbody=this.dataTableWrapper.querySelector("tbody"),this.moreInfoRow=document.createElement("tr"),this.moreInfoRow.className="moreinfo",this.moreInfoCalcId=null,this.filterComponent=new u("meth-filter-component"),this.element.querySelector(".filter-placeholder").appendChild(this.filterComponent.element),this.filterComponent.setItemListener(e=>{this.sortedCalcs.forEach(t=>{let s=t.dataCalcProps.split(","),i=!0;s.forEach(t=>{e.indexOf(t)<0&&(i=!1)}),t.visible=!!i}),this._render()}),this.sortingButtonWrappers=this.dataTableWrapper.querySelectorAll(".sorting-button"),this.sortingButtons=[];let e=new Map([["id",void 0],["type",void 0],["functional",void 0],["code",void 0],["potential",void 0],["basisSet",void 0]]).keys();this.sortingButtonWrappers.forEach(t=>{let s=e.next().value,i=new r(s);t.appendChild(i.element),this.sortingButtons.push(i),i.setListener((e,t)=>{this.sortingButtons.forEach(e=>{e!==i&&e.init()}),this._sortRowsCalcDataBy(e,t),this._render()})}),a.addToInfoSystem(this.element)}updateSelection(e){this.sortedCalcs=[],l.getCalculations().forEach(e=>{let t=e.run_type;l.getGroups().has(e.id)&&(t=l.getGroupType(e.id)),this.sortedCalcs.push({id:e.id,type:t,functional:e.functional_type,code:e.code_name,potential:e.core_electron_treatment,basisSet:e.basis_set_type,dataCalcProps:t+","+e.functional_type+","+e.code_name+","+e.core_electron_treatment+","+e.basis_set_type,visible:!0})}),this.filterComponent.addGroupsItems(this.sortedCalcs),this._sortRowsCalcDataBy(!0,"id"),this._render()}_sortRowsCalcDataBy(e,t){this.sortedCalcs.sort((s,i)=>s[t]<i[t]?e?-1:1:s[t]>i[t]?e?1:-1:0)}updateMarkedLeaf(e){}_render(){let e="";function t(e){return null==e?"":"("+e+")"}this.sortedCalcs.forEach(s=>{s.visible&&(e+=function(e){let s=l.getCalc(e.id),i=e.type,n="";null!==s.calculation_pid&&void 0!==s.calculation_pid&&(n='<a href="https://repository.nomad-coe.eu/NomadRepository-1.1/views/calculation.zul?pid='+s.calculation_pid+'" target="blank"> <img src="img/download.svg" height="20px" /> </a>');let a=l.getMaterialData().id,r=s.id,o=`<a href="https://labdev-nomad.esc.rzg.mpg.de/remotevis/cM/start/${a}+${r}" `+'target="blank"><img src="img/monitor_icon.png" height="20px" /> </a>';return`\n        <tr data-calc-id="${s.id}" class="data-row">\n        <td>${s.id}</td>\n        <td>\n          <span info-sys-data="calculation-type.value:${i}">\n          ${i}</span>\n        </td>\n        <td>\n          <span info-sys-data="functional-type.value:${s.functional_type}">\n            ${s.functional_type}</span>\n          ${t(s.functional_long_name)}\n        </td>\n        <td>\n          <span info-sys-data="code-name.value:${s.code_name}">\n            ${s.code_name}</span>\n           ${t(s.code_version)}\n        </td>\n\n        <td>\n          <span info-sys-data="core-electron-treatment.value:${s.core_electron_treatment}">\n          ${d=s.core_electron_treatment,"pseudopotential"===d?"pseudopotential":"full all electron"===d?"full potential":d}</span>\n        </td>\n        <td>\n          <span info-sys-data="basis-set-type.value:${s.basis_set_type}">\n            ${s.basis_set_type}</span>\n           ${t(s.basis_set_quality_quantifier)}\n        </td>\n        \x3c!--\n        <td style="padding-top: 8px;padding-bottom: 4px;">${n}\n        </td>\n\n        <td style="padding-top: 8px;padding-bottom: 4px;">${o}\n        </td>--\x3e\n\n        </tr>`;var d}(s))}),this.tbody.innerHTML=e,a.addToInfoSystem(this.tbody)}}},function(e,t,s){s(0);e.exports=class{constructor(e){this.id=e,this.ascending=!0,this.element=document.createElement("span"),this.element.innerHTML+='\n       <img src="img/sorting_init.png" width="12px"\n        style="margin-bottom: -1px; cursor: pointer"/>\n    ',this.image=this.element.querySelector("img"),"id"===e&&this.image.setAttribute("src","img/sorting_ascending.png"),this.element.addEventListener("click",e=>{this.ascending=!this.ascending,this.image.setAttribute("src","img/sorting_"+(this.ascending?"ascending":"descending")+".png"),this.listener(this.ascending,this.id)})}init(){this.image.setAttribute("src","img/sorting_init.png")}setListener(e){this.listener=e}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(3),l=s(1),r=s(4),o=s(11),d=s(31),h=s(32);e.exports=class extends i{constructor(){super("Thermal Properties"),this.firstId,this.lastId,this.element.innerHTML+='\n      <div style="float: left; width: 30%;">\n        <div class="view-box">\n          <div class="title">Calculations </div>\n          <div class="navTreeWrapper"></div>\n        </div>\n      </div>\n\n      <div style="float: right; width: 70%;">\n        <div class="view-box thermal-properties-box">\n\n          <div class="title">Vibrational and thermal properties</div>\n\n          <div style="padding-top: 10px;">\n            <div class="tree-leaf-title"></div>\n          </div>\n\n          <div class="calc-disp-dos-plotter" style="padding: 30px 100px; ">\n            <div class="info-fields-label" style="float: left; width: 52%; ">\n              <span info-sys-data="phonon-dispersion">Phonon dispersion </span>\n            </div>\n            <div class="info-fields-label" style="float: left;">\n              <span info-sys-data="phonon-DOS">Phonon DOS  </span>\n            </div>\n            <div style="clear: both;"></div>\n          </div>\n\n\n          <div class="band" >\n            <div style="padding: 30px 50px; display: flex; justify-content: space-around; ">\n\n              <div >\n                <div class="info-fields-label" >\n                  <span info-sys-data="specific-heat-cv">Specific heat</span>\n                </div>\n                <div class="heat-plotter" >      </div>\n              </div>\n\n              <div>\n                <div class="info-fields-label" >\n                  <span info-sys-data="helmholtz-free-energy">Helmholtz free energy</span>\n                </div>\n                <div class="helmholtz-plotter" >      </div>\n              </div>\n\n            </div>\n          </div>\n\n        </div>\n      </div>\n    ',this.navTreeWrapper=this.element.getElementsByClassName("navTreeWrapper")[0],this.rightBox=this.element.querySelector(".thermal-properties-box"),this.leafTitle=this.element.querySelector(".tree-leaf-title"),this.dispDosPlotter=new h,this.heatPlotter=new o,this.helmholtzPlotter=new d,a.addToInfoSystem(this.element)}_events(){super._events()}updateSelection(e){if(e.size>0){this.rightBox.style.visibility="visible";let t=0;e.forEach(s=>{t++,1===t?this.firstId=s:t===e.size&&(this.lastId=s)})}else this.rightBox.style.visibility="hidden"}updateMarkedLeaf(e){if(null===e)return void(this.leafTitle.innerHTML="NO SELECTION");l.getGroups().has(e)?this.leafTitle.innerHTML=e+" ("+l.getGroups().get(e).calcs.size+")":this.leafTitle.innerHTML=e;let t=l.getCalc(l.getCalcReprIntId(e));if(this.dispDosPlotter.isAttached()||(this.dispDosPlotter.attach(this.element.querySelector(".calc-disp-dos-plotter"),void 0,360),this.heatPlotter.attach(this.element.querySelector(".heat-plotter"),317,317),this.helmholtzPlotter.attach(this.element.querySelector(".helmholtz-plotter"),317,317)),null!==t&&(t.has_phonon_dos||t.has_phonon_dispersion||t.has_thermal_properties)){r.show();let e=l.getMaterialData().id;n.serverReq(n.getMaterialCalcURL(e,t.id,"phonon_dos"),s=>{let i=JSON.parse(s.target.response).phonon_dos;n.serverReq(n.getMaterialCalcURL(e,t.id,"phonon_dispersion"),s=>{let a=JSON.parse(s.target.response).phonon_dispersion;this.dispDosPlotter.setUpAndData(a,i),t.has_thermal_properties?(n.serverReq(n.getMaterialCalcURL(e,t.id,"specific_heat_cv"),e=>{let t=JSON.parse(e.target.response).specific_heat_cv;this.heatPlotter.setData(t)}),n.serverReq(n.getMaterialCalcURL(e,t.id,"helmholtz_free_energy"),e=>{let t=JSON.parse(e.target.response).helmholtz_free_energy;this.helmholtzPlotter.setData(t)})):(this.heatPlotter.setNoData(),this.helmholtzPlotter.setNoData()),r.hide()})})}else this.dispDosPlotter.setNoData(),this.heatPlotter.setNoData(),this.helmholtzPlotter.setNoData()}setPrevCalcListener(e){this.prevCalcListener=e}setNextCalcListener(e){this.nextCalcListener=e}}},function(e,t,s){"use strict";let i=s(2),n=s(5);e.exports=class extends n{constructor(){super({left:60,right:16,top:10,bottom:32}),this.tooltip}setData(e){this.clear();let t=e.temperature.indexOf(600)+1,s=e.value.slice(0,t),n=e.temperature.slice(0,t),a=Math.max.apply(null,s),l=Math.min.apply(null,s),r=1e3*Math.ceil(a/1e3),o=1e3*Math.floor(l/1e3);this.setRangeAndLabels("T (K)",0,600,"F (J/kg)",o,r),this.drawAxis(4,null,0);let d="";n.forEach((e,t)=>{let i=s[t];d+=" "+this.xRel*e+" -"+this.yRel*(i-this.yMin)}),i.addPolyline(this.plotArea,d,"plotSpin1")}}},function(e,t,s){let i=s(7),n=s(8),a=s(2),l=s(0);class r extends n{constructor(){super({left:4,right:16,top:0,bottom:30}),this.outOfRangeColorActivated=!1}attach(e,t,s){super.attach(e,s/2+this.margins.left,s)}setPoints(e){this.pointsSpin1=[],this.pointsSpin2=[],this._reset();let t=e.dos_values[0],s=null;2===e.dos_values.length&&(s=e.dos_values[1]);let i=e.dos_energies,n=[],r=[];for(var o=0;o<i.length;o++){let e,a=5034117012222e10*i[o],l=.029979*t[o];null!==s&&(e=.029979246*s[o]),n.push(l),null!==s&&n.push(e),r.push(a),this.pointsSpin1.push({x:l,y:a}),null!==s&&this.pointsSpin2.push({x:e,y:a})}let d=Math.max.apply(null,n),h=Math.max.apply(null,r),c=Math.min.apply(null,r),p=l.generateDiagramSteps(d),u=p[0],m=p[1];this.setAxisRangeAndLabels(null,0,u[u.length-1],null,-50,320,c,h,100),a.addText(this.axisGroup,this.plotRangeX/2,this.margins.bottom,"DOS (states/cm⁻¹)","middle","axis-steps-big");for(let e=0;e<u.length;e++){let t=this.plotRangeX*u[e]/u[u.length-1];a.addLine(this.axisGroup,t,0,t,3,1),a.addText(this.axisGroup,t,13,0===e?"0":u[e].toFixed(m),"middle","axis-steps-smaller")}this.repaint()}repaintData(){let e="";for(var t=0;t<this.pointsSpin1.length;t++)e+=" "+this.xRel*this.pointsSpin1[t].x+" "+this.transformY(this.pointsSpin1[t].y);a.addPolyline(this.plotContent,e,"plotSpin1"),e="";for(t=0;t<this.pointsSpin2.length;t++)e+=" "+this.xRel*this.pointsSpin2[t].x+" "+this.transformY(this.pointsSpin2[t].y);a.addPolyline(this.plotContent,e,"plotSpin2")}}e.exports=class{constructor(){this.element=document.createElement("div"),this.parentElement=null,this.dispPlotter=new i,this.dispPlotter.setPhononMode(),this.dosPlotter=new r}attach(e,t,s){e.appendChild(this.element),this.dispPlotter.attach(this.element,s,s),this.dosPlotter.attach(this.element,void 0,s),this.parentElement=e}isAttached(){return null!==this.parentElement}setUpAndData(e,t){this.hasDispData=null!=e,this.hasDosData=null!=t,this.hasDispData?(this.dispPlotter.setBandStructureData(e),this.hasDosData&&this.dispPlotter.setRepaintListener((e,t)=>{this.dosPlotter.setYZoomAndOffset(e,t),this.dosPlotter.repaint()})):this.dispPlotter.setNoData(),this.hasDosData?(this.dosPlotter.setPoints(t),this.hasDispData&&this.dosPlotter.setRepaintListener((e,t)=>{this.dispPlotter.setYZoomAndOffset(e,t),this.dispPlotter.repaint()})):this.dosPlotter.setNoData()}setNoData(){this.dispPlotter.setNoData(),this.dosPlotter.setNoData()}}},function(e,t,s){"use strict";let i=s(6),n=(s(0),s(3));e.exports=class extends i{constructor(){super("Elastic constants"),this.sortedLeafs=[],this.markedCalc=null,this.element.innerHTML+='\n\n      <div style="float: left; width: 27%;">\n        <div class="view-box">\n          <div class="title">Calculation </div>\n          <div class="navTreeWrapper"></div>\n        </div>\n      </div>\n\n      <div style="float: right; width: 73%;">\n        <div class="view-box">\n          <div class="title">Elastic constants</div>\n\n          <div>Parameters</div>\n          <div ></div>\n\n\n        </div>\n      </div>\n\n      <div style="clear: both;"></div>\n    ',this.navTreeWrapper=this.element.querySelector(".navTreeWrapper"),n.addToInfoSystem(this.element),this._events()}_events(){}updateSelection(e){console.log("ElasticDetails updateSelection ",e)}updateMarkedLeaf(e){}}},function(e,t,s){"use strict";let i=s(0),n=s(14),a=s(35),l=s(36),r=s(37);function o(e){return e.split("-").join("_")}class d{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","formula-box"),this.element.innerHTML='\n    <div style="padding-bottom: 40px;">\n    <input type="text" class="formula-text-field"\n      placeholder="Add formula to the search query above" >\n      <button class="adding-formula-btn" disabled>Add to query</button>\n    </div>\n    <div>\n    <input type="text" class="material-name-text-field"\n      placeholder="Add material name to the search query above" >\n    <button class="adding-material-name-btn" disabled>Add to query</button>\n    </div>\n    ',this.formulaTextField=this.element.querySelector(".formula-text-field"),this.formulaButton=this.element.querySelector(".adding-formula-btn"),this.materialTextField=this.element.querySelector(".material-name-text-field"),this.materialButton=this.element.querySelector(".adding-material-name-btn"),this.formulaButton.addEventListener("click",e=>{this.addFormulaListener(this.formulaTextField.value),this.formulaTextField.value=""}),this.materialButton.addEventListener("click",e=>{this.addMaterialListener(this.materialTextField.value),this.materialTextField.value=""}),this.formulaTextField.addEventListener("input",e=>{this.formulaButton.disabled=""===this.formulaTextField.value}),this.materialTextField.addEventListener("input",e=>{this.materialButton.disabled=""===this.materialTextField.value})}setAddFormulaListener(e){this.addFormulaListener=e}setAddMaterialListener(e){this.addMaterialListener=e}disable(e){this.formulaTextField.disabled=e,this.formulaButton.disabled=!0,this.materialTextField.disabled=e,this.materialButton.disabled=!0}}e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","search-module"),this.element.innerHTML='\n    <div class="search-page">\n\n      <div class="searchline" style="visibility: hidden">\n        <div class="search-query-wrapper" style="float: left;">\n          <div class="search-query-box" style="float: left;">\n          </div>\n          <button class="clean-btn" style="float: right;">Clear all</button>\n        </div>\n\n        <button style="float: right" class="search-btn" >Search</button>\n        <div style="clear: both;"></div>\n        <div class="exclusive-search-line">\n           Exclusive search <input class="exclusive-search" type="checkbox" >\n        </div>\n      </div>\n\n\n      <div class="add-buttons" >\n        <div  class="tab-buttons" style="width: 70%; display: inline-block">\n          <button class="element-add-btn" id="add-tab-selected">Element</button>\n          <button class="formula-add-btn" style="padding: 10px 20px;" >Formula/Material</button>\n          <button class="props-add-btn" >Properties</button>\n        </div>\n        <div class="bool-buttons" style="width: 28%; display: inline-block" >\n          <button  disabled >AND</button>\n          <button  disabled >OR</button>\n          <button  disabled >NOT</button>\n          <button  disabled >(</button> <button  disabled >)</button>\n          \x3c!--<input type="checkbox" name="and-or" class="not-symbol-btn" />NOT--\x3e\n        </div>\n      </div>\n\n\n      <div>\n        <div class="triangle element-tri" style="margin: -10px 64px; visibility: visible"></div>\n        <div class="triangle formula-tri" style="margin: -10px 30px; visibility: hidden"></div>\n        <div class="triangle props-tri" style="margin: -10px 70px; visibility: hidden"></div>\n      </div>\n\n\n      <div class="add-panel">\n      </div>\n\n    </div> \x3c!-- search-page --\x3e\n\n\n    <div class="results-page" style="display: none">\n    </div>\n\n    ',this.searchPage=this.element.querySelector(".search-page"),this.searchQueryBox=this.element.getElementsByClassName("search-query-box")[0],this.searchLine=this.element.querySelector(".searchline"),this.mainButton=this.element.querySelector(".search-btn"),this.cleanButton=this.element.querySelector(".clean-btn"),this.addButtonsBox=this.element.querySelector(".add-buttons"),this.addElementButton=this.addButtonsBox.querySelector(".element-add-btn"),this.addFormulaButton=this.addButtonsBox.querySelector(".formula-add-btn"),this.addPanel=this.element.querySelector(".add-panel"),this.elementTable=new a,this.elementTable.setClickListener(e=>{this.addElementsInSearchQuery(e),this.addFormulaButton.disabled=!0}),this.elementTable.setDeselectListener(e=>this.removeElementORFormulaInSearchQuery(e)),this.propertiesBox=new r,this.propertiesBox.setAddPropertiesListener(e=>{this.addPropertiesInSearchQuery(e)}),this.formulaBox=new d,this.formulaBox.setAddFormulaListener(e=>{""!==e.trim()&&(this.addTagInSearchQuery(e,"F"),this.addElementButton.disabled=!0,this.formulaBox.disable(!0))}),this.formulaBox.setAddMaterialListener(e=>{""!==e.trim()&&(this.addTagInSearchQuery(e,"material-name"),this.addElementButton.disabled=!0,this.formulaBox.disable(!0))}),this.materialList=new l,this.resultsPage=this.element.querySelector(".results-page"),this.materialList.attachAndSetEvents(this.resultsPage),this.currentTab="element",this.addPanel.appendChild(this.elementTable.element),this.userGuidance=!0,this.showingSearchBox=!1,this.searchQuery=[],this.queryTypes=[],this._events()}_events(){this.mainButton.addEventListener("click",e=>{if(0===this.searchQuery.lenght)i.showUserMsg("No query");else{let e={},t=[];e.search_by={},this.searchQuery.forEach((s,i)=>{"F"===this.queryTypes[i]?e.search_by.formula=s:"E"===this.queryTypes[i]?t.push(s):"S"!==this.queryTypes[i]&&(0===this.queryTypes[i].indexOf("has")?e[o(this.queryTypes[i])]="Yes":e[o(this.queryTypes[i])]=s.split(" | "))}),t.length>0&&(e.search_by.element=t.join(","));let s=this.element.querySelector(".exclusive-search:checked");e.search_by.exclusive=null===s?"0":"1",this.materialList.setSearch(e),i.setBrowserHashPath("search","results")}}),this.cleanButton.addEventListener("click",e=>{this.searchQuery=[],this.queryTypes=[],this.updateSearchQuery(),this.addFormulaButton.disabled=!1,this.addElementButton.disabled=!1,this.formulaBox.disable(!1),this.elementTable.deselectAllElements()}),this.addButtonsBox.addEventListener("click",e=>{if(e.target!==e.currentTarget){let t=e.target.className,s=t.indexOf("add-btn");if(s>0){let i,a=t.substring(0,s-1);"element"===a?i=this.elementTable.element:"props"===a?i=this.propertiesBox.element:"formula"===a&&(i=this.formulaBox.element),this.addPanel.replaceChild(i,this.addPanel.lastChild);let l=this.element.querySelector("."+this.currentTab+"-add-btn");this._setTabSelectedStyles(l,!1),this._setTabSelectedStyles(e.target,!0),this.element.querySelector("."+this.currentTab+"-tri").style.visibility="hidden",this.element.querySelector("."+a+"-tri").style.visibility="visible",this.currentTab=a,this.userGuidance&&("element"===a?(n.showIndependentTip(7,!1),n.showIndependentTip(3,!0)):"props"===a?(n.showIndependentTip(3,!1),n.showIndependentTip(7,!0)):"formula"===a&&(n.showIndependentTip(3,!1),n.showIndependentTip(7,!1)))}}}),this.searchQueryBox.addEventListener("click",e=>{if("remove-label"===e.target.className){let t=e.target.parentElement.getAttribute("data-el");this.removeElementORFormulaInSearchQuery(t)}})}_setTabSelectedStyles(e,t){e.id=t?"add-tab-selected":""}_showSearchBox(){this.showingSearchBox||(this.showingSearchBox=!0,this.searchLine.style.visibility="visible",this.userGuidance&&n.setFinal())}_addItemInSearchQuery(e,t){this.searchQuery.push(e),this.queryTypes.push(t)}addTagInSearchQuery(e,t){"E"===t&&this.searchQuery.indexOf(e)>=0||(this.searchQuery.length>0&&this._addItemInSearchQuery("&","S"),this._addItemInSearchQuery(e,t),this.updateSearchQuery(),this._showSearchBox())}addElementsInSearchQuery(e){let t=e.length;for(;t--;)this.addTagInSearchQuery(e[t],"E");return!0}addPropertiesInSearchQuery(e){e.forEach((e,t)=>{let s=this.queryTypes.indexOf(t);if(s<0)this.addTagInSearchQuery(e.join(" | "),t);else{let t=this.searchQuery[s].split(" | ");e.forEach(e=>{t.indexOf(e)<0&&t.push(e)}),this.searchQuery[s]=t.join(" | "),this.updateSearchQuery(),this._showSearchBox()}})}removeElementORFormulaInSearchQuery(e){let t=this.searchQuery.indexOf(e);if(t>=0){if(this.searchQuery.splice(t,1),this.queryTypes.splice(t,1),t>0){let e=this.searchQuery[t-1];"&"!==e&&"|"!==e||(this.searchQuery.splice(t-1,1),this.queryTypes.splice(t-1,1))}"S"===this.queryTypes[0]&&(this.searchQuery.splice(0,1),this.queryTypes.splice(0,1)),this.updateSearchQuery(),i.ELEMENTS.indexOf(e)>=0?(this.elementTable.deselectElement(e),this.queryTypes.indexOf("E")<0&&(this.addFormulaButton.disabled=!1)):(this.addElementButton.disabled=!1,this.formulaBox.disable(!1))}return!0}updateSearchQuery(){let e="";for(let s=0;s<this.searchQuery.length;s++){let n=this.queryTypes[s];e+="S"===n?`<span class="search-query-symbol" >  ${this.searchQuery[s]} </span>`:`<span class="search-label" data-el="${t=this.searchQuery[s]}" >\n            <img src="img/tag.svg" height="16px" class="remove-label"\n              style="vertical-align: bottom"/>\n          ${"F"===n?i.getSubscriptedFormula(t):t}\n          <img src="img/cross.svg" height="6px" class="remove-label"\n            style="vertical-align: middle; padding: 4px 3px 6px 5px;" />\n          </span>`}var t;console.log("this.updateSearchQuery: ",this.searchQuery,this.queryTypes),this.searchQueryBox.innerHTML=e}showResultsPage(){this.searchPage.style.display="none",this.resultsPage.style.display="block",this.userGuidance&&n.show(!1)}showSearchPage(){this.searchPage.style.display="block",this.resultsPage.style.display="none",this.userGuidance&&setTimeout(()=>{n.init(this.addButtonsBox,this.elementTable.element,this.searchLine,this.propertiesBox.tabsElement),n.show(!0,"element"===this.currentTab,"props"===this.currentTab)},400)}}},function(e,t,s){"use strict";let i=s(0);const n=new Map([[1,["H","Li","Na","K","Rb","Cs","Fr"]],[2,["Be","Mg","Ca","Sr","Ba","Ra"]],[3,["Sc","Y"]],[4,["Ti","Zr","Hf","Rf"]],[5,["V","Nb","Ta","Ha"]],[6,["Cr","Mo","W","Sg"]],[7,["Mn","Tc","Re","Ns"]],[8,["Fe","Ru","Os","Hs"]],[9,["Co","Rh","Ir","Mt"]],[10,["Ni","Pd","Pt","Ds"]],[11,["Cu","Ag","Au","Rg"]],[12,["Zn","Cd","Hg","Cn"]],[13,["B","Al","Ga","In","Tl","Nh"]],[14,["C","Si","Ge","Sn","Pb","Fl"]],[15,["N","P","As","Sb","Bi","Mc"]],[16,["O","S","Se","Te","Po","Lv"]],[17,["F","Cl","Br","I","At","Ts"]],[18,["He","Ne","Ar","Kr","Xe","Rn","Og"]],[19,["La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu"]],[20,["Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr"]]]),a=new Map([["metalloids",["B","Si","Ge","As","Sb","Te","Po"]],["other-non-metals",["H","C","N","O","P","S","Se"]],["halogens",["F","Cl","Br","I","At","Ts"]],["noble-gases",["He","Ne","Ar","Kr","Xe","Rn","Og"]],["alkali-metals",["Li","Na","K","Rb","Cs","Fr"]],["alkaline-earth-metals",["Be","Mg","Ca","Sr","Ba","Ra"]],["lanthanoids",["La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu"]],["actinoids",["Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr"]],["transition-metals",["Sc","Y","Ti","Zr","Hf","Rf","V","Nb","Ta","Ha","Cr","Mo","W","Sg","Mn","Tc","Re","Ns","Fe","Ru","Os","Hs","Co","Rh","Ir","Mt","Ni","Pd","Pt","Ds","Cu","Ag","Au","Rg","Zn","Cd","Hg","Cn"]],["post-transition-metals",["Al","Ga","In","Tl","Nh","Sn","Pb","Fl","Bi","Mc","Lv"]]]),l=new Map([["metalloids","#F9E298"],["other-non-metals","#F2B01D"],["halogens","#85ADC1"],["noble-gases","#F7D660"],["alkali-metals","#D04629"],["alkaline-earth-metals","#F7B57D"],["transition-metals","#F58737"],["post-transition-metals","#AE4747"],["lanthanoids","#3B91AE"],["actinoids","#E97147"]]);let r=["Hydrogen","Helium","Lithium","Beryllium","Boron","Carbon","Nitrogen","Oxygen","Fluorine","Neon","Sodium","Magnesium","Aluminum","Silicon","Phosphorus","Sulfur","Chlorine","Argon","Potassium","Calcium","Scandium","Titanium","Vanadium","Chromium","Manganese","Iron","Cobalt","Nickel","Copper","Zinc","Gallium","Germanium","Arsenic","Selenium","Bromine","Krypton","Rubidium","Strontium","Yttrium","Zirconium","Niobium","Molybdenum","Technetium","Ruthenium","Rhodium","Palladium","Silver","Cadmium","Indium","Tin","Antimony","Tellurium","Iodine","Xenon","Cesium","Barium","Lanthanum","Cerium","Praseodymium","Neodymium","Promethium","Samarium","Europium","Gadolinium","Terbium","Dysprosium","Holmium","Erbium","Thulium","Ytterbium","Lutetium","Hafnium","Tantalum","Tungsten","Rhenium","Osmium","Iridium","Platinum","Gold","Mercury","Thallium","Lead","Bismuth","Polonium","Astatine","Radon","Francium","Radium","Actinium","Thorium","Protactinium","Uranium","Neptunium","Plutonium","Americium","Curium","Berkelium","Californium","Einsteinium","Fermium","Mendelevium","Nobelium","Lawrencium","Rutherfordium","Dubnium","Seaborgium","Bohrium","Hassium","Meitnerium","Darmstadtium","Roentgenium","Copernicium","Nihonium","Flerovium","Moscovium","Livermorium","Tennessine","Oganesson"];function o(e){let t;return a.forEach((function(s,i){s.indexOf(e)>=0&&(t=i)})),t}function d(e){let t=i.ELEMENTS[e-1];return'<td class="cell '+o(t)+'" data-el="el-'+t+'"><b>'+t+"</b> <div>"+e+"</div> </td>"}function h(e){let t=null,s=null;if(e.target.className.indexOf("cell ")>=0?(t=e.target,s=e.target.className):e.target.parentElement.className.indexOf("cell ")>=0&&(t=e.target.parentElement,s=e.target.parentElement.className),null===t)return null;{let e=t.innerHTML,s=e.substring(3,e.indexOf("<",3));return"&nbsp;"===s?null:s}}e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","elementable");let e='<div class="element-info"></div>';e+='<div class="ptWrapper">',e+='<table id="pt-main">',e+="<tbody>",e+="<tr>"+d(1),e+='<td class="cellpad" colspan="16"></td>',e+=d(2)+"</tr>";let t=t=>{e+="<tr>"+d(t)+d(t+1),e+='<td class="cellpad" colspan="10"></td>';for(let s=t+2;s<t+8;s++)e+=d(s);e+="</tr>"};t(3),t(11);let s=19;for(let t=0;t<4;t++){e+="<tr>";for(let t=0;t<18;t++)57===s||89===s?(e+=(n=s,'<td class="cellpad '+o(i.ELEMENTS[n-1])+'" data-el="el-X"><b>&nbsp;</b> <div>&nbsp;</div> </td>'),s+=15):(e+=d(s),s++);e+="</tr>"}var n;e+="</tbody></table>",e+='<div id="specialRows"><table id="pt-laac">';for(let t=0;t<2;t++){e+="<tr>",s=0===t?57:89;for(let t=0;t<15;t++)e+=d(s),s++;e+="</tr>"}e+="</table></div>",e+='<div class="legend">\n      <div class="alkali-metals">Alkali metals</div>\n      <div class="alkaline-earth-metals">Alkaline earth metals</div>\n      <div class="transition-metals">Transition metals</div>\n      <div class="post-transition-metals">Post-transition metals</div>\n      <div class="metalloids">Metalloids</div>\n      <div class="other-non-metals">Other nonmetals</div>\n      <div class="halogens">Halogens</div>\n      <div class="noble-gases">Noble gases</div>\n      <div class="lanthanoids">Lanthanoids</div>\n      <div class="actinoids">Actinoids</div>\n    </div>',e+="</div>",this.element.innerHTML=e,this.elementInfo=this.element.getElementsByClassName("element-info")[0],this.tableZone=this.element.getElementsByClassName("ptWrapper")[0],this._events()}_events(){this.tableZone.addEventListener("click",e=>{if(e.target!==e.currentTarget){let s=e.target.className,i=e.target;if(""===s&&(i=e.target.parentElement,s=e.target.parentElement.className),s.indexOf("cellpad")>=0)return;if(s.indexOf("group-sel")>=0){let e=n.get(parseInt(i.getAttribute("data-group")));this.clickListener(e);for(var t=0;t<e.length;t++)this.selectElement(e[t])}else if(s.indexOf("cell")>=0){let e=i.innerHTML,t=e.substring(3,e.indexOf("<",3));if("&nbsp;"===t)return;s.indexOf("el-selected")>=0?this.deselectListener(t):(this.clickListener([t]),this.selectElement(t))}}},!0),this.tableZone.addEventListener("mouseover",e=>{let t=h(e);if(null!==t){this.elementInfo.style.display="block";let e=l.get(o(t));this.elementInfo.style.borderColor=e;let s=i.ELEMENTS.indexOf(t)+1;this.elementInfo.innerHTML=`\n          <div>\n            <div style="float: right; padding: 3px 4px;border-left: 3px solid ${e};\n              border-bottom: 3px solid ${e}" > ${s} </div>\n            <div style="clear: right;"></div>\n          </div>\n          <div class="symbol">${t} </div>\n          <div class="">${r[s-1]}  </div>\n          `}}),this.tableZone.addEventListener("mouseout",e=>{null!==h(e)&&(this.elementInfo.style.display="none")})}setClickListener(e){this.clickListener=e}setDeselectListener(e){this.deselectListener=e}selectElement(e){this.element.querySelector('td[data-el="el-'+e+'"]').className="cell el-selected"}deselectElement(e){this.element.querySelector('td[data-el="el-'+e+'"]').className="cell "+o(e)}deselectAllElements(){let e=this.element.querySelectorAll("td.el-selected");for(let t=0;t<e.length;++t){let s=e[t].getAttribute("data-el").substring(3);e[t].className="cell "+o(s)}}}},function(e,t,s){"use strict";let i=s(0),n=s(3),a=s(4);e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","matlist"),this.formula=!1,this.matMap=new Map,this.page=0,this.searchJson=null,this.total_results=0,this.pagesNum=0,this.element.innerHTML='\n    <div class="title"> Results </div>\n    <div class="pag-header">\n      <span class="prevButton">\n        <img src="img/prev.svg" style="display: inline;" width="7px"/> &nbsp; prev\n      </span>   &nbsp;&nbsp;\n      <span class="page"> X </span> &nbsp;&nbsp;\n      <span class="nextButton"> next &nbsp;\n        <img src="img/next.svg" width="7px" />\n      </span>\n    </div>\n    <div class="data-container"> </div>',this.titleBox=this.element.getElementsByClassName("title")[0],this.resultsNrTag=this.element.getElementsByClassName("pag-header")[0],this.prevButton=this.element.getElementsByClassName("prevButton")[0],this.pageElement=this.element.getElementsByClassName("page")[0],this.nextButton=this.element.getElementsByClassName("nextButton")[0],this.resultsContainer=this.element.getElementsByClassName("data-container")[0]}attachAndSetEvents(e){e.appendChild(this.element),this._events()}_events(){this.nextButton.addEventListener("click",e=>{this.page!==this.pagesNum&&(this.page++,this._search())}),this.prevButton.addEventListener("click",e=>{1!==this.page&&(this.page--,this._search())}),this.resultsContainer.addEventListener("click",e=>{if(e.target!==e.currentTarget){let t;"mat-row"===e.target.className?t=e.target:"mat-row"===e.target.parentElement.className?t=e.target.parentElement:"mat-row"===e.target.parentElement.parentElement.className&&(t=e.target.parentElement.parentElement),t&&i.setBrowserHashPath("material",t.getAttribute("data-mat-id")),e.stopPropagation()}})}_printMatMap(){console.log("MATMAP:"),this.matMap.forEach((function(e,t,s){console.log(t+" "+JSON.stringify(e))}))}setSearch(e){this.resultsContainer.style.visibility="hidden",this.searchJson=e,this.page=1,this._search()}_search(){this.searchJson.search_by.page=this.page,this.searchJson.search_by.per_page=10;let e=JSON.stringify(this.searchJson);console.log("SENDING: ",e),a.show(),i.serverReqPOST(i.getSearchURL(),e,e=>{let t=JSON.parse(e.target.response);if(console.log("SENDING: ",t),200===e.target.status){this.total_results=t.total_results,this.pagesNum=null===t.pages?1:t.pages.pages;let e=t.results;1===this.total_results?(i.setBrowserHashPath("material",+e[0].id),i.searchResults=!1):(this.setData(e),i.searchResults=!0)}else this.total_results=0,this.pagesNum=0,this.setData([]);this._updateUI(),this.resultsContainer.style.visibility="visible",a.hide()}).addEventListener("error",e=>{console.log("Search ERROR - Not valid query "),this.total_results=0,this.pagesNum=0,this.setData([]),this._updateUI(),this.resultsContainer.style.visibility="visible",a.hide()})}setData(e){this.matMap.clear(),e.forEach(e=>{if(this.matMap.has(e.formula_reduced)){this.matMap.get(e.formula_reduced).push(e)}else{let t=[];t.push(e),this.matMap.set(e.formula_reduced,t)}})}reset(){this.formula=!1,this.matMap.clear(),this.page=0,this.searchJson=null,this._updateUI()}_updateUI(){this.titleBox.innerHTML="Results (total: "+this.total_results+")",this.pageElement.innerHTML="page "+this.page+" / "+this.pagesNum;let e="";0===this.matMap.size?(this.resultsNrTag.style.display="none",this.titleBox.style.display="none",1===this.page&&(e+='<div class="not-found"> No results found </div>')):(this.resultsNrTag.style.display="block",this.titleBox.style.display="block",e+='\n        <table>\n          <thead> <tr>\n            <th style="width: 24%;"></th>\n            <th style="width: 20%;">\n              <span info-sys-data="system-type">System type</span>\n            </th>\n            <th style="width: 16%;">\n              <span info-sys-data="space-group">Space group</span>\n            </th>\n            <th style="width: 22%;">\n              <span info-sys-data="structure-type">Structure type</span>\n            </th>\n            <th style="width: 18%;">Nº calculations</th>\n          </tr> </thead>\n          <tbody>\n      ',this.matMap.forEach((t,s)=>{let n=i.getSubscriptedFormula(s);e+='<tr> <td class="formula" colspan="5"><b>'+n+"</b>",t.length>1&&(e+='<span style="font-size: 0.86em;"> ('+t.length+" structures)</span>"),e+="</td></tr>",t.forEach(t=>{let s=null!==t.material_name?t.material_name:n;e+=`<tr class="mat-row" data-mat-id="${t.id}">\n            <td  > ${s} </td>\n            <td style="text-align:center" >\n              \x3c!--<span info-sys-data="system-type">--\x3e${t.system_type} \x3c!--</span>--\x3e\n            </td>\n            <td style="text-align:center" >\n              ${null===t.space_group_number?"":t.space_group_number}\n            </td>\n            <td> ${null===t.structure_type?"":t.structure_type} </td>\n            <td style="text-align:center" > ${t.nr_of_calculations} </td>\n          </tr>`})}),e+=" </tbody> </table>"),this.resultsContainer.innerHTML=e,n.addToInfoSystem(this.resultsContainer)}}},function(e,t,s){"use strict";let i=s(0),n=s(3);e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","search-properties-box"),this.element.innerHTML='\n    <div class="props-box-tabs-wrapper" style="float: left; width: 25%; ">\n\n      <div class="properties-box-tabs" >\n        <div data-tab="structure" class="props-tab-selected" >Structure </div>\n        <div data-tab="results">Properties </div>\n        <div data-tab="method">Method </div>\n        \x3c!-- <div class="contributors-tab">Contributors </div> --\x3e\n      </div>\n\n    </div>\n\n    <div class="properties-box-panel" style="float: left;width: 75%;height: 100%">\n\n      <div class="props-tab-panel-wrapper" style="height: 86%" >\n\n      <div class="structure-panel props-tab-panel" style="display: block">\n\n\n        <div style="float: left; width: 47%;">\n\n          <div class="field">\n            <div class="field-title"><span info-sys-data="space-group">Space group number</span></div>\n            <input type="text" class="space-group-number-field">\n          </div>\n\n          <div class="field">\n            <div class="field-title">System type</div>\n            <input type="checkbox" class="system-type-field" value="bulk"> Bulk<br>\n            <input type="checkbox" class="system-type-field" value="2D"> 2D<br>\n            <input type="checkbox" class="system-type-field" value="1D"> 1D<br>\n          </div>\n\n          \x3c!--\n          <div class="field">\n            <div class="field-title"><span info-sys-data="mass-density">Mass density</span> <span style="font-weight: normal;">(kg/m<sup>3</sup>)</span></div>\n            Min: <input type="text" class="mass-density-min-field">&nbsp;&nbsp;\n            Max: <input type="text" class="mass-density-max-field">\n          </div>\n          --\x3e\n\n        </div>\n\n        <div style="float: left; width: 5%;"></div>\n\n        <div style="float: right; width: 47%;">\n\n          <div class="field">\n            <div class="field-title"><span info-sys-data="structure-type">Structure type</span></div>\n            <select class="structure-type-field" style="max-width: 174px">\n              <option></option>\n            </select>\n          </div>\n\n          <div class="field">\n            <div class="field-title"><span info-sys-data="crystal-system">Crystal system</span></div>\n            <input type="checkbox" class="crystal-system-field" value="cubic">\n              <span info-sys-data="crystal-system.value:cubic">Cubic</span><br>\n            <input type="checkbox" class="crystal-system-field" value="hexagonal">\n              <span info-sys-data="crystal-system.value:hexagonal">Hexagonal</span><br>\n            <input type="checkbox" class="crystal-system-field" value="trigonal">\n              <span info-sys-data="crystal-system.value:trigonal">Trigonal</span><br>\n            <input type="checkbox" class="crystal-system-field" value="tetragonal">\n              <span info-sys-data="crystal-system.value:tetragonal">Tetragonal</span><br>\n            <input type="checkbox" class="crystal-system-field" value="orthorhombic">\n              <span info-sys-data="crystal-system.value:orthorhombic">Orthorhombic</span><br>\n            <input type="checkbox" class="crystal-system-field" value="monoclinic">\n              <span info-sys-data="crystal-system.value:monoclinic">Monoclinic</span><br>\n            <input type="checkbox" class="crystal-system-field" value="triclinic">\n              <span info-sys-data="crystal-system.value:triclinic">Triclinic</span><br>\n          </div>\n\n        </div>\n        <div style="clear: both;"></div>\n      </div>\n\n      <div class="results-panel props-tab-panel" >\n        \x3c!--\n        <div style="float: left; width: 47%;">\n          <div class="field">\n            <div class="field-title"><span info-sys-data="band-gap">Band gap</span> <span style="font-weight: normal;">(eV)</span></div>\n            Min: <input type="text" class="band-gap-min-field">&nbsp;&nbsp;\n            Max: <input type="text" class="band-gap-max-field">\n          </div>\n        </div>\n\n        <div style="float: left; width: 5%;">  </div>\n\n        <div style="float: right; width: 47%;">\n          <div class="field" style="padding-top: 28px;">\n            <input type="radio" name="band-gap-type" value="d"> Direct<br>\n            <input type="radio" name="band-gap-type" value="i"> Indirect<br>\n            <input type="radio" name="band-gap-type" value="d/i" checked> Both<br>\n          </div>\n        </div>\n        --\x3e\n        <div style="clear: both;"></div>\n\n        <div class="field" style="background-color: #CCC; padding: 10px;">\n          <div style="font-weight: bold; padding-bottom: 6px" >Results containing...</div>\n          <div style="float: left; width: 47%;">\n            <input type="checkbox" class="has-band-structure-field" value="Band structure">\n              <span info-sys-data="has-band-structure">Band structure</span><br>\n            <input type="checkbox" class="has-dos-field" value="DOS">\n              <span info-sys-data="has-dos">DOS</span><br>\n              \x3c!--\n            <input type="checkbox" class="has-fermi-surface-field" value="Fermi surface">\n              <span info-sys-data="has-fermi-surface">Fermi surface</span><br>\n            --\x3e\n          </div>\n          <div style="float: right; width: 47%;">\n          <input type="checkbox" class="has-thermal-properties-field" value="Thermal properties">\n            <span info-sys-data="has-thermal-properties">Thermal properties</span>\n          <br>\n          \x3c!-- <input type="checkbox" class="results-containing-field" value="EOS" disabled>Equation of state<br>--\x3e\n          </div>\n          <div style="clear: both;"></div>\n        </div>\n\n      </div>\n\n      <div class="method-panel props-tab-panel" >\n        <div style="float: left; width: 47%;">\n\n          <div class="field">\n            <div class="field-title"><span info-sys-data="functional-type">Functional type</span></div>\n            <input type="checkbox" class="functional-type-field" value="LDA">\n              <span info-sys-data="functional-type.value:LDA">LDA</span><br>\n            <input type="checkbox" class="functional-type-field" value="GGA">\n              <span info-sys-data="functional-type.value:GGA">GGA</span><br>\n            <input type="checkbox" class="functional-type-field" value="meta-GGA">\n              <span info-sys-data="functional-type.value:meta-GGA">meta-GGA</span><br>\n            <input type="checkbox" class="functional-type-field" value="hybrid-GGA">\n              <span info-sys-data="functional-type.value:hybrid-GGA">hybrid-GGA</span><br>\n            <input type="checkbox" class="functional-type-field" value="hybrid-meta-GGA">\n              <span info-sys-data="functional-type.value:hybrid-meta-GGA">hybrid-meta-GGA</span><br>\n            <input type="checkbox" class="functional-type-field" value="HF">\n              <span info-sys-data="functional-type.value:HF">HF</span><br>\n            <input type="checkbox" class="functional-type-field" value="GW">\n              <span info-sys-data="functional-type.value:GW">GW</span><br>\n          </div>\n\n          <div class="field">\n            <div class="field-title"><span info-sys-data="code-name">Code name</span></div>\n            <select class="code-name-field" >\n              <option></option>\n            </select>\n            \x3c!--\n            <input type="checkbox" class="code-name-field" value="VASP">VASP<br>\n            <input type="checkbox" class="code-name-field" value="quantum-espresso">Quantum Espresso<br>\n            <input type="checkbox" class="code-name-field" value="FHI-aims">FHI-aims<br>\n            <input type="checkbox" class="code-name-field" value="exciting">exciting<br>\n            --\x3e\n          </div>\n\n        </div>\n\n        <div style="float: left; width: 5%;">   </div>\n\n        <div style="float: right; width: 47%;">\n          <div class="field">\n            <div class="field-title"><span info-sys-data="basis-set-type">Basis set</span></div>\n            <input type="checkbox" class="basis-set-type-field" value="Numeric AOs">\n              <span info-sys-data="basis-set-type.value:numeric AOs">Numeric AOs</span><br>\n            <input type="checkbox" class="basis-set-type-field" value="Gaussians">\n              <span info-sys-data="basis-set-type.value:gaussians">Gaussians</span><br>\n            <input type="checkbox" class="basis-set-type-field" value="(L)APW+lo">\n              <span info-sys-data="basis-set-type.value:(L)APW+lo">(L)APW+lo</span><br>\n            <input type="checkbox" class="basis-set-type-field" value="Plane waves">\n              <span info-sys-data="basis-set-type.value:plane waves">Plane waves</span><br>\n          </div>\n        </div>\n\n        <div style="clear: both;"></div>\n      </div>\n\n      </div>\n\n\n      <div class="properties-box-enter-button" style="height: 14%">\n        <button disabled>Add to query</button>\n      </div>\n\n    </div>\n\n    <div style="clear: both;"></div>\n    ',this.tabsElement=this.element.querySelector(".properties-box-tabs"),this.tabSelected=this.element.querySelector('[data-tab="structure"]'),this.tabPanelSelected=this.element.querySelector(".structure-panel"),this.addButton=this.element.querySelector(".properties-box-enter-button button");let e=this.element.querySelector(".code-name-field"),t=i.serverReq(i.getSuggestionURL("code_name"),()=>{JSON.parse(t.response).code_name.forEach(t=>{e.innerHTML+="<option>"+t+"</option>"})}),s=this.element.querySelector(".structure-type-field"),a=i.serverReq(i.getSuggestionURL("structure_type"),()=>{JSON.parse(a.response).structure_type.forEach(e=>{s.innerHTML+="<option>"+e+"</option>"})});n.addToInfoSystem(this.element),this._events()}_events(){this.tabsElement.addEventListener("click",e=>{if(e.target!==e.currentTarget){null!==this.tabSelected&&(this.tabSelected.className=""),this.tabSelected=e.target,this.tabSelected.className="props-tab-selected";let t=e.target.getAttribute("data-tab");null!==this.tabPanelSelected&&(this.tabPanelSelected.style.display="none"),this.tabPanelSelected=this.element.getElementsByClassName(t+"-panel")[0],this.tabPanelSelected.style.display="block",this.checkPropsValues()}}),this.addButton.addEventListener("click",e=>{let t=this.getPropsWithValueFromCurrentTab(!0);this.addPropertiesListener(t),this.addButton.disabled=!0});let e=this.element.querySelector(".properties-box-panel");e.addEventListener("input",e=>{this.checkPropsValues()}),e.addEventListener("change",e=>{this.checkPropsValues()})}checkPropsValues(){let e=this.getPropsWithValueFromCurrentTab(!1);this.addButton.disabled=0===e.size}getPropsWithValueFromCurrentTab(e){let t=this.tabSelected.getAttribute("data-tab"),s=new Map;return"structure"===t?(this.addPropsFromTextFields(s,["space-group-number"],e),this.addPropsFromDropdownList(s,["structure-type"],e),this.addPropsFromCheckboxes(s,["system-type","crystal-system"],e)):"results"===t?this.addPropsFromCheckboxes(s,["has-band-structure","has-dos","has-fermi-surface","has-thermal-properties"],e):"method"===t&&(this.addPropsFromCheckboxes(s,["functional-type","basis-set-type"],e),this.addPropsFromDropdownList(s,["code-name"],e)),s}addPropsFromTextFields(e,t,s){t.forEach(t=>{let i=this.element.querySelector("."+t+"-field");""!==i.value&&(e.set(t,[i.value]),s&&(i.value=""))})}addPropsFromCheckboxes(e,t,s){t.forEach(t=>{let i=this.element.querySelectorAll("."+t+"-field"),n=[];for(var a=0;a<i.length;a++)i[a].checked&&(n.push(i[a].value),s&&(i[a].checked=!1));n.length>0&&e.set(t,n)})}addPropsFromDropdownList(e,t,s){t.forEach(t=>{let i=this.element.querySelector("."+t+"-field"),n=i.options[i.selectedIndex].value;n.length>2&&e.set(t,[n]),s&&(i.selectedIndex=0)})}addBandgapProps(e,t){let s=document.querySelector(".band-gap-min-field"),i=document.querySelector(".band-gap-max-field"),n="band-gap",a="Band Gap";if(""!==s.value&&(a=s.value+" < "+a,n+=":"+s.value,t&&(s.value="")),""!==i.value&&(a+=" < "+i.value,n+=":"+i.value,t&&(i.value="")),"Band Gap"!==a){let t=document.querySelector('input[name="band-gap-type"]:checked').value;"d"===t?n+=":True":"i"===t&&(n+=":False"),e.set(n,[a+" "+t])}}addMassDensityProps(e,t){let s=document.querySelector(".mass-density-min-field"),i=document.querySelector(".mass-density-max-field"),n="mass-density",a="Mass Density";""!==s.value&&(a=s.value+" < "+a,n+=":"+s.value,t&&(s.value="")),""!==i.value&&(a+=" < "+i.value,n+=":"+i.value,t&&(i.value="")),"Mass Density"!==a&&e.set(n,[a])}setAddPropertiesListener(e){this.addPropertiesListener=e}}}]);
\ No newline at end of file
+!function(e){var t={};function s(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(i,n,function(t){return e[t]}.bind(null,n));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=15)}([function(e,t,s){"use strict";s(1);let i=s(16);const n="Basic "+btoa(i.GuestUserToken+":");let a="http://enc-staging-nomad.esc.rzg.mpg.de/",l="localhost",r="v1.0/";document.location.href.indexOf("nomad-coe.eu")>0?(a="https://encyclopedia.nomad-coe.eu/",l=".nomad-coe.eu",r="api/v1.0/"):document.location.href.indexOf("gui")>0&&(a="/",document.location.href.indexOf("staging")>0&&(l=".mpg.de"));let o=a+r;document.querySelector("#guest-user a").href=o+"saml/?sso2";let d=n,h=null;function c(e){let t="";for(let s=0;s<e.length;s++)e.charCodeAt(s)>=47&&e.charCodeAt(s)<58?t+="<sub>"+e[s]+"</sub>":t+=e[s];return t}function p(e){let t=e.substring(1,e.length-1).split(","),s=[];for(var i=0;i<t.length;i++)s.push(parseFloat(t[i]));return s}function u(e){return(e*(180/Math.PI)).toFixed(0)+"&deg;"}function m(e){let t=0;for(var s=0;s<e.length;s++)t+=e[s];return t/e.length}e.exports={searchResults:!1,materialId:null,MAT_VIEW:{structure:"structure",electronicstruct:"electronicstruct",methodology:"methodology",thermalprops:"thermalprops",elasticconst:"elasticconst"},IMAGE_DIR:"img/",USER_COOKIE_DOMAIN:l,ELEMENTS:["H","He","Li","Be","B","C","N","O","F","Ne","Na","Mg","Al","Si","P","S","Cl","Ar","K","Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu","Zn","Ga","Ge","As","Se","Br","Kr","Rb","Sr","Y","Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd","In","Sn","Sb","Te","I","Xe","Cs","Ba","La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu","Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi","Po","At","Rn","Fr","Ra","Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr","Rf","Ha","Sg","Ns","Hs","Mt","Ds","Rg","Cn","Nh","Fl","Mc","Lv","Ts","Og"],setAuthRequestHeader:function(e,t){void 0===t?(d=n,h=null):(d="Basic "+btoa(t+":"),h=e)},getUserData:function(){return h},getServerLocation:function(){return document.location.hostname},authServerReq:function(e,t){var s=new XMLHttpRequest;return s.addEventListener("load",t),console.log("util.authServerReq: ",o+e),s.open("GET",o+e),s.send(),s},serverReq:function(e,t){var s=new XMLHttpRequest;return s.addEventListener("load",t),s.open("GET",e),s.setRequestHeader("Authorization",d),s.send(),s},serverReqPOST:function(e,t,s){var i=new XMLHttpRequest;return i.addEventListener("load",s),i.open("POST",e),i.setRequestHeader("Content-Type","application/json"),i.setRequestHeader("Authorization",d),i.send(t),i},getSearchURL:function(){return o+"materials"},getSuggestionURL:function(e){return o+"suggestions?property="+e},getMaterialURL:function(e){return o+"materials/"+e},getMaterialCalcURL:function(e,t,s=""){return o+"materials/"+e+"/calculations/"+t+(""===s?"":"?property="+s)},getMaterialXsURL:function(e,t){return o+"materials/"+t+"/"+e+"?pagination=off"},getCalcEnergiesURL:function(e,t){return o+"materials/"+e+"/calculations/"+t+"/energies"},getFlaggingURL:function(){return o+"flagme"},setBrowserHashPath:function(e,t){document.location=void 0===t?"#/"+e:"#/"+e+"/"+t},loadLib:function(e){let t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src",e),document.getElementsByTagName("head")[0].appendChild(t)},getNumberArray:p,getCellDataForViewer:function(e){let t={};t.normalizedCell=[p(e.cell.a),p(e.cell.b),p(e.cell.c)],t.periodicity=JSON.parse(e.periodicity),t.labels=[],t.positions=[];for(var s=0;s<e.elements.length;s++)t.labels.push(e.elements[s].label),t.positions.push(p(e.elements[s].position));return t},J2eV:function(e,t){let s=e/1602176565e-28;return void 0===t?s<.01?s.toFixed(6):s.toFixed(3):s.toFixed(t)},eV2J:function(e){return 1602176565e-28*e},m2Angstrom:function(e){return(e/1e-10).toFixed(3)+" &#197;"},getLatticeAnglesValues:function(e,t,s){let i=[0,0,0];return e.forEach(e=>{if(void 0!==e.lattice_parameters&&null!==e.lattice_parameters){let t=p(e.lattice_parameters);i[0]+=t[3],i[1]+=t[4],i[2]+=t[5]}}),s?`<div>&alpha; = ${u(i[0]/e.size)}</div>\n    <div>&beta; = ${u(i[1]/e.size)}</div>\n    <div>&gamma; = ${u(i[2]/e.size)}</div>`:t?`<div>&alpha; = ${u(i[0]/e.size)}</div>`:""},rad2degree:u,m3ToAngstrom3:function(e){return(e/1e-30).toFixed(3)+" &#197;<sup>3</sup>"},getQuantityStatsMap:function(e){let t=["volume","atomic_density","mass_density","lattice_a","lattice_b","lattice_c"],s=["Volume (ų)","Atomic density (Å⁻³)","Mass density (kg/m³)","a (Å)","b (Å)","c (Å)"],i=new Map;return null===e.values().next().value.cell_volume&&(t=["lattice_a","lattice_b","lattice_c"],s=["a (Å)","b (Å)","c (Å)"]),t.forEach((t,n)=>{let a=[];e.forEach(e=>{let s;if("volume"===t)s=e.cell_volume/1e-30;else if("atomic_density"===t)s=1e-30*e.atomic_density;else if("mass_density"===t)s=e.mass_density;else if(t.indexOf("lattice")>=0){let i=p(e.lattice_parameters);"lattice_a"===t?s=i[0]/1e-10:"lattice_b"===t?s=i[1]/1e-10:"lattice_c"===t&&(s=i[2]/1e-10)}a.push(s)});let l={};l.data=a,l.min=Math.min.apply(null,a),l.max=Math.max.apply(null,a),l.equal=l.min===l.max;let r=s[n].split(":");l.label=r[0],2===r.length?l.units=r[1]:l.units="";let o=3;"mass_density"===t&&(o=1),l.html=m(l.data).toFixed(o)+' &nbsp; <span style="font-size: 0.9em">['+l.min.toFixed(o)+" , "+l.max.toFixed(o)+"]</span>",i.set(t,l)}),i},toAngstromMinus3:function(e){return(1e-30*e).toFixed(3)+" &#197;<sup>-3</sup>"},getMaterialTitle:function(e,t){let s;return s=c(e.formula_reduced),void 0!==t&&!1===t&&(s=e.formula_reduced),null!==e.space_group_number&&void 0!==e.space_group_number&&(s+=" - space group "+e.space_group_number),s},getMinMaxHTML:function(e,t){let s=[];return e.forEach(e=>{s.push(e[t])}),"("+Math.min.apply(null,s)+" ... "+Math.max.apply(null,s)+")"},getSubscriptedFormula:c,getAverage:m,generateDiagramSteps:function(e){let t=-Math.floor(Math.log(e/4)*Math.LOG10E),s=Math.pow(10,t),i=Math.ceil(e*s/4),n=[];for(var a=0;a<=4;a++)n[a]=i*a/s;return t=t<0?0:t,[n,t]}}},function(e,t){let s,i;let n,a=new Map;function l(e){return a.get(e)}function r(e){return"eos"===e.substring(0,3)||"par"===e.substring(0,3)}function o(e){return r(e)?parseInt(e.substring(3)):parseInt(e)}e.exports={setMaterialData:function(e){s=e},getMaterialData:function(){return s},getCalculations:function(){return i},getCalc:l,setCalculations:function(e){i=e;for(let e=0;e<i.length;e++)a.set(i[e].id,i[e])},getGroups:function(){return n},setGroups:function(e){n=function(e){let t=new Map;e.forEach((e,s)=>{if("method"!==e.group_type){let s;t.has(e.method_hash)?s=t.get(e.method_hash):(s={ids:[],minEnergies:[]},t.set(e.method_hash,s)),s.ids.push(e.representative_calculation_id),s.minEnergies.push(e.energy_minimum)}});let s=new Map;t.forEach((e,t)=>{let i=Math.min.apply(null,e.minEnergies),n=e.minEnergies.indexOf(i);s.set(t,e.ids[n])});let i=new Map;return e.forEach((e,t)=>{if("method"!==e.group_type){let t={calcs:new Set,method_representative:s.get(e.method_hash)};i.set(function(e){if("equation of state"===e.group_type)return"eos";if("parameter variation"===e.group_type)return"par"}(e)+e.representative_calculation_id,t),e.calculations_list.forEach(e=>t.calcs.add(e))}}),i}(e)},isGroup:r,getGroupType:function(e){let t=e.substring(0,3);return"eos"===t?"equation of state":"par"===t?"parameter variation":null},getCalcReprIntId:o,isInAnyGroup:function(e){let t=!1;return n.forEach((s,i)=>{s.calcs.has(e)&&(t=!0)}),t},isInAnyNotDisabledGroup:function(e){let t=!1;return n.forEach((s,i)=>{"exciting"===l(o(i)).code_name.trim()&&s.calcs.has(e)&&(t=!0)}),t},getGroupLeafId:function(e){let t=null;return n.forEach((s,i)=>{s.calcs.has(e)&&(t=i)}),t},hasThermalData:void 0,hasElecStructureData:void 0}},function(e,t,s){"use strict";const i="http://www.w3.org/2000/svg";e.exports={addPoint:function(e,t,s,n,a){let l=document.createElementNS(i,"circle");return l.setAttribute("r",n),l.setAttribute("cx",t),l.setAttribute("cy",s),void 0!==a&&l.setAttribute("class",a),e.appendChild(l),l},addCircle:function(e,t,s,n,a,l,r){let o=document.createElementNS(i,"circle");return o.setAttribute("r",n),o.setAttribute("cx",t),o.setAttribute("cy",s),o.setAttribute("fill",a),o.setAttribute("stroke",l),o.setAttribute("stroke-width",r),e.appendChild(o),o},addLine:function(e,t,s,n,a,l){let r=document.createElementNS(i,"line");return r.setAttribute("x1",t),r.setAttribute("y1",s),r.setAttribute("x2",n),r.setAttribute("y2",a),void 0!==l&&r.setAttribute("class",l),e.appendChild(r),r},addRect:function(e,t,s,n,a){let l=document.createElementNS(i,"rect");return l.setAttribute("x",t),l.setAttribute("y",s),l.setAttribute("width",n),l.setAttribute("height",a),e.appendChild(l),l},addText:function(e,t,s,n,a="start",l){let r=document.createElementNS(i,"text");return r.setAttribute("x",t),r.setAttribute("y",s),r.textContent=n,r.setAttribute("text-anchor",a),void 0!==l&&r.setAttribute("class",l),e.appendChild(r),r},addPolyline:function(e,t,s){let n=document.createElementNS(i,"polyline");n.setAttribute("points",t),void 0!==s&&n.setAttribute("class",s),e.appendChild(n)},removeElement:function(e){e.parentElement.removeChild(e)}}},function(e,t,s){"use strict";let i=s(0),n=s(22);let a=document.querySelector("#info-tooltip"),l=document.querySelector("#tooltip-content"),r=[],o=null,d=!1,h=null;function c(){null!==o&&window.clearTimeout(o),o=window.setTimeout(e=>a.style.display="none",1e3)}let p=new n(i.IMAGE_DIR+"switch");function u(e){e.addEventListener("mouseover",m),e.addEventListener("mouseout",t=>{c(),e.style.cursor="inherit"}),e.className="info-sys-label"}function m(e){let t=e.target.getBoundingClientRect(),s=e.target.getAttribute("info-sys-data"),i=s.indexOf(".value");if(i>0){let e=h[s.split("-").join(" ").substring(0,i)];if(void 0===e.value_template){let t=e.values[s.split(":")[1]];l.innerHTML=v(t)}else{let t=e.value_template;t.text=y(t.text,s.split(":")[1]),t.link=y(t.link,s.split(":")[1]),l.innerHTML=v(t)}}else l.innerHTML=v(h[s.split("-").join(" ")]);a.style.visibility="hidden",a.style.display="block";let n=a.getBoundingClientRect(),r=n.width-t.width,d=t.left-r/2;d+n.width>window.innerWidth&&(d=window.innerWidth-n.width);let c=-window.pageYOffset;a.style.left=(d<0?5:d)+"px",a.style.top=t.top+t.height-c+"px",a.style.visibility="visible",window.clearTimeout(o),e.target.style.cursor="help"}function y(e,t){let s=e.indexOf("${"),i=e.indexOf("}");return s>=0&&i>=0&&i>s?e.substring(0,s)+t+e.substring(i+1):e}function v(e){let t="";return void 0===e.text||(t+=e.text),void 0!==e.link&&(void 0!==e.text&&(t+="<br>"),t+='<a href="'+e.link+'" target="_blank">More information</a>'),t}document.querySelector("#info-sys-switch-box").appendChild(p.element),p.setListener(e=>{d=!e,e?r.forEach(e=>{e.removeEventListener("mouseover",m),e.className=""}):(null===h&&i.serverReq("infosys.json",e=>h=JSON.parse(e.target.response)),r.forEach(u)),a.addEventListener("mouseover",e=>{window.clearTimeout(o)}),a.addEventListener("mouseout",e=>{c()})}),e.exports={addToInfoSystem:function(e){let t=e.querySelectorAll("span[info-sys-data]");for(let e=0;e<t.length;++e)r.push(t[e]);if(d)for(let e=0;e<t.length;++e)u(t[e])},addElementToInfoSystem:function(e,t){r.push(e),e.setAttribute("info-sys-data",t),d&&u(e)}}},function(e,t,s){"use strict";s(0);let i=document.querySelector("#loading-popup");e.exports={show:function(){let e=i.getBoundingClientRect(),t=(window.innerWidth-e.width)/2,s=(window.innerHeight-e.height)/2;i.style.left=t+"px",i.style.top=s-100+"px",i.style.visibility="visible"},hide:function(){i.style.visibility="hidden"}}},function(e,t,s){"use strict";let i=s(2);const n="http://www.w3.org/2000/svg";e.exports=class{constructor(e={left:20,right:0,top:10,bottom:20}){this.svg=document.createElementNS(n,"svg"),this.plotArea=document.createElementNS(n,"g"),this.svg.appendChild(this.plotArea),this.margins=e,this.parentElement=null,this.yLabelText=null,this.noDataGroup=null}attach(e,t,s){this.parentElement=e,this.parentElement.appendChild(this.svg),this.width=void 0!==t?t:this.parentElement.clientWidth,this.height=void 0!==s?s:this.svg.width,this.svg.setAttribute("width",this.width),this.svg.setAttribute("height",this.height),this.plotRangeX=this.width-this.margins.left-this.margins.right,this.plotRangeY=this.height-this.margins.top-this.margins.bottom}isAttached(){return null!==this.parentElement}setRangeAndLabels(e,t,s,i,n,a){this.xLabel=e,this.xMin=t,this.xMax=s,this.yLabel=i,this.yMin=n,this.yMax=a,this.xRel=this.plotRangeX/(this.xMax-this.xMin),this.yRel=this.plotRangeY/(this.yMax-this.yMin)}drawAxis(e=0,t=0,s=2){if(this.plotArea.setAttribute("transform","matrix(1 0 0 1 "+this.margins.left+" "+(this.height-this.margins.bottom)+")"),this.yLabelText=i.addText(this.svg,0,0,this.yLabel,"middle","axis-steps-big"),this.yLabelText.setAttribute("transform","translate(13,"+(this.plotRangeY/2+this.margins.top)+") rotate(-90)"),i.addText(this.plotArea,this.plotRangeX/2,this.margins.bottom-1,this.xLabel,"middle","axis-steps-big"),null!==e){let t=this.plotRangeX/e;for(let n=0;n<=e;n++)i.addLine(this.plotArea,t*n,0,t*n,4,1),i.addText(this.plotArea,t*n,14,+(t*n/this.xRel+this.xMin).toFixed(s),"middle","statisticsviewersteps")}if(null===t&&this.yMax>0&&this.yMin<0){let e=1;for(;this.yMax*e>this.yMin;){i.addLine(this.plotArea,0,this.transformY(this.yMax*e),-3,this.transformY(this.yMax*e),1);let t=Math.abs(this.yMax*e)>=1e4?(this.yMax*e).toExponential():this.yMax*e;i.addText(this.plotArea,-5,this.transformY(this.yMax*e)+3,t,"end","statisticsviewersteps"),e--}}if(null!==t){let e=this.plotRangeY/t;for(let n=0;n<=t;n++){i.addLine(this.plotArea,0,-e*n,-3,-e*n,1);let t=e*n/this.yRel+this.yMin;Math.abs(t)<.01&&(t=0),i.addText(this.plotArea,-5,-(e*n-3),t.toFixed(s),"end","statisticsviewersteps")}}i.addLine(this.plotArea,0,0,this.plotRangeX+1,0,"main-axis"),i.addLine(this.plotArea,0,0,0,-(this.plotRangeY+1),"main-axis"),i.addLine(this.plotArea,this.plotRangeX,0,this.plotRangeX,-this.plotRangeY,"main-axis"),i.addLine(this.plotArea,0,-this.plotRangeY,this.plotRangeX,-this.plotRangeY,"main-axis")}clear(){this.svg.removeChild(this.plotArea),this.plotArea=document.createElementNS(n,"g"),this.svg.appendChild(this.plotArea),this.plotArea.setAttribute("transform","matrix(1 0 0 1 "+this.margins.left+" "+(this.height-this.margins.bottom)+")"),null!==this.yLabelText&&(this.svg.removeChild(this.yLabelText),this.yLabelText=null),null!==this.noDataGroup&&(this.svg.removeChild(this.noDataGroup),this.noDataGroup=null)}setNoData(){this.clear(),null===this.noDataGroup&&(this.noDataGroup=document.createElementNS(n,"g"),this.svg.appendChild(this.noDataGroup),i.addRect(this.noDataGroup,0,0,this.width,this.height),this.noDataGroup.setAttribute("fill","#EEE"),i.addText(this.noDataGroup,this.width/2,this.height/2+10,"NO DATA","middle","nodata"))}transformY(e){return-this.yRel*(e-this.yMin)}}},function(e,t,s){"use strict";let i=s(0),n=s(1);e.exports=class{constructor(e){this.element=document.createElement("div"),this.element.setAttribute("id",e),this.gotoResultsListener=null,this.gotoOverviewListener=null,this.element.innerHTML='<div class="material-title"></div>',this.element.style.display="none"}attachAndSetEvents(e){e.appendChild(this.element),this.materialTitle=this.element.querySelector(".material-title")}attachNavTree(e){e.attach(this.navTreeWrapper)}setVisible(){this.element.style.display="block"}setMaterialData(){this.materialTitle.innerHTML=i.getMaterialTitle(n.getMaterialData())}updateCalcs(e){}updateMarkedCalc(e){}}},function(e,t,s){"use strict";let i=s(8),n=s(2);s(0);function a(e,t){let s=e[0],i=e[t],n=i[0]-s[0],a=i[1]-s[1],l=i[2]-s[2];return Math.sqrt(n*n+a*a+l*l)}function l(e){return"Gamma"===e||"G"===e?"Γ":e}e.exports=class extends i{constructor(){super({left:55,right:5,top:0,bottom:30}),this.phononMode=!1,this.factor=1602176565e-28}setPhononMode(){this.phononMode=!0,this.factor=1/5034117012222e10,this.outOfRangeColorActivated=!1}attach(e,t,s){super.attach(e,t,s)}getTopAndLowestPoints(e){let t=-1e4,s=1e4;for(let i=0;i<e.length;i++){for(let n=0;n<e[i].band_energies[0].length;n++){let a=Math.max.apply(null,e[i].band_energies[0][n]);a>t&&(t=a),a=Math.min.apply(null,e[i].band_energies[0][n]),a<s&&(s=a)}if(2===e[i].band_energies.length)for(let n=0;n<e[i].band_energies[1].length;n++){let a=Math.max.apply(null,e[i].band_energies[1][n]);a>t&&(t=a),a=Math.min.apply(null,e[i].band_energies[1][n]),a<s&&(s=a)}}return[s/this.factor,t/this.factor]}drawKPointLabel(e,t){n.addText(this.axisGroup,e*this.xRel,16,t,"middle","steps")}setBandStructureData(e){let t;t=void 0!==e.segments?e.segments:e,this.bandGapData=void 0,void 0!==e.band_gap&&void 0!==e.band_gap.position&&(this.bandGapData=e.band_gap.position,this.bandGapData.cbmDistances=[],this.bandGapData.vbmDistances=[]),this.bandsDataSpin1=[],this.bandsDataSpin2=[],this.segmentLimitsX=[],this._reset();let s=this.getTopAndLowestPoints(t),i=s[0],n=s[1];this.phononMode?this.setAxisRangeAndLabels("",0,1,"Frequency (cm⁻¹)",-50,320,i,n,100):this.setAxisRangeAndLabels("",0,1,"Energy (eV)",-6,11,i,n,5);let r=0;for(let e=0;e<t.length;e++){let s=t[e].band_k_points;r+=a(s,s.length-1)}let o=0,d=null,h=!1;for(let e=0;e<t.length;e++){let s=t[e],i=s.band_k_points,n=s.band_segm_labels,c=s.band_energies[0],p=s.band_energies[1];this.bandsDataSpin1.push([]),this.bandsDataSpin2.push([]);let u=a(i,i.length-1);this.segmentLimitsX.push(o/r),null!==n&&(null!==d&&d!==n[0]?this.drawKPointLabel(o/r,l(d)+"|"+l(n[0])):this.drawKPointLabel(o/r,l(n[0])),e===t.length-1&&this.drawKPointLabel(1,l(n[1])),d=n[1]);for(let t=0;t<i.length;t++){let s=(o+a(i,t))/r;if(void 0!==this.bandGapData){if(void 0!==this.bandGapData.lower){let e=this.bandGapData.lower.kpt;i[t][0]===e[0]&&i[t][1]===e[1]&&i[t][2]===e[2]&&this.bandGapData.cbmDistances.push(s)}if(void 0!==this.bandGapData.upper){let e=this.bandGapData.upper.kpt;i[t][0]===e[0]&&i[t][1]===e[1]&&i[t][2]===e[2]&&this.bandGapData.vbmDistances.push(s)}}for(let i=0;i<c[t].length;i++){0===t&&(this.bandsDataSpin1[e][i]=[]);let n=c[t][i]/this.factor;this.bandsDataSpin1[e][i].push({x:s,y:n}),!h&&n>1e4&&(h=!0)}if(void 0!==p)for(let i=0;i<p[t].length;i++){0===t&&(this.bandsDataSpin2[e][i]=[]);let n=p[t][i]/this.factor;this.bandsDataSpin2[e][i].push({x:s,y:n}),!h&&n>1e4&&(h=!0)}}o+=u}if(h)throw"Plotter Data Overflow: Probably the energy data is not in correct units";this.repaint()}repaintData(e,t){let s;this.segmentLimitsX.forEach(s=>{let i=this.transformY(e),a=this.transformY(t);this.phononMode&&(i+=200,a-=200),n.addLine(this.plotContent,s*this.xRel,i,s*this.xRel,a,"segment")});for(var i=0;i<this.bandsDataSpin1.length;i++)for(var a=0;a<this.bandsDataSpin1[i].length;a++){s="";for(var l=0;l<this.bandsDataSpin1[i][a].length;l++)s+=" "+this.xRel*this.bandsDataSpin1[i][a][l].x+" "+this.transformY(this.bandsDataSpin1[i][a][l].y);n.addPolyline(this.plotContent,s,"plotSpin1")}if(this.bandsDataSpin2.length>0)for(i=0;i<this.bandsDataSpin2.length;i++)for(a=0;a<this.bandsDataSpin2[i].length;a++){s="";for(l=0;l<this.bandsDataSpin2[i][a].length;l++)s+=" "+this.xRel*this.bandsDataSpin2[i][a][l].x+" "+this.transformY(this.bandsDataSpin2[i][a][l].y);n.addPolyline(this.plotContent,s,"plotSpin2")}void 0!==this.bandGapData&&(this.bandGapData.cbmDistances.forEach(e=>{let t=this.xRel*e,s=this.transformY(this.bandGapData.lower.energy/this.factor);n.addPoint(this.plotContent,t,s,3,"cbm-vbm-points"),n.addText(this.plotContent,t+4,s-6,"CBM")}),this.bandGapData.vbmDistances.forEach(e=>{let t=this.xRel*e,s=this.transformY(this.bandGapData.upper.energy/this.factor);n.addPoint(this.plotContent,t,s,3,"cbm-vbm-points"),n.addText(this.plotContent,t+4,s+14,"VBM")}))}}},function(e,t,s){"use strict";let i=s(2);const n="http://www.w3.org/2000/svg";e.exports=class{constructor(e={left:20,right:0,top:0,bottom:20}){this.margins=e,this.svg=document.createElementNS(n,"svg"),this.parentElement=null,this.plotContent=null,this.axisGroup=null,this.yAxisLabelsGroup=null,this.yLabelText=null,this.noDataGroup=null,this.yZoom=1,this.yOffset=0,this.repaintListener=null,this.nodataLabel=null,this.outOfRangeColorActivated=!0}attach(e,t,s){this.parentElement=e,this.parentElement.appendChild(this.svg),this.width=void 0!==t?t:this.parentElement.clientWidth,this.height=void 0!==s?s:this.svg.width,this.svg.setAttribute("width",this.width),this.svg.setAttribute("height",this.height),this.plotRangeX=this.width-this.margins.left-this.margins.right,this.plotRangeY=this.height-this.margins.top-this.margins.bottom,this.yAxisArea=document.createElementNS(n,"svg"),this.svg.appendChild(this.yAxisArea);let a=this.margins.left;this.plotAreaHeight=this.height-this.margins.bottom-this.margins.top,this.yAxisArea.setAttribute("width",a),this.yAxisArea.setAttribute("height",this.plotAreaHeight),this.yAxisArea.setAttribute("x",0),this.yAxisArea.setAttribute("y",0),this.plotArea=document.createElementNS(n,"svg"),this.svg.appendChild(this.plotArea),this.plotAreaWidth=this.width-this.margins.left-this.margins.right,this.plotArea.setAttribute("width",this.plotAreaWidth),this.plotArea.setAttribute("height",this.plotAreaHeight),this.plotArea.setAttribute("x",this.margins.left),this.plotArea.setAttribute("y",this.margins.top),this.plotAreaBg=i.addRect(this.plotArea,0,0,this.plotAreaWidth,this.plotAreaHeight),this.plotAreaBg.setAttribute("class","moveable-plot"),this.plotAreaBg.setAttribute("opacity",0),this._events()}isAttached(){return null!==this.parentElement}setAxisRangeAndLabels(e,t,s,n,a,l,r,o,d,h=2){this.xLabel=e,this.xMin=t,this.xMax=s,this.yMinInit=a,this.yMaxInit=l,this.yMin=r,this.yMax=o,this.yLabelGapInit=d,this.xRel=this.plotRangeX/(this.xMax-this.xMin),this.yRel=this.plotRangeY/(this.yMaxInit-this.yMinInit),this._resetAxisGroup(),i.addLine(this.axisGroup,0,0,this.plotRangeX,0,"main-axis"),i.addLine(this.axisGroup,0,0,0,-this.plotRangeY,"main-axis"),i.addLine(this.axisGroup,this.plotRangeX,0,this.plotRangeX,-this.plotRangeY,"main-axis"),i.addLine(this.axisGroup,0,-this.plotRangeY,this.plotRangeX,-this.plotRangeY,"main-axis"),null!==n&&(this.yLabelText=i.addText(this.svg,0,0,n,"middle","axis-steps-big"),this.yLabelText.setAttribute("transform","translate(15,"+(this.plotRangeY/2+this.margins.top)+") rotate(-90)")),null!==e&&i.addText(this.axisGroup,this.plotRangeX/2,this.margins.bottom-12,this.xLabel,"middle","axis-steps-big"),this._resetYAxisLabelGroup(),this.precalculation_1=this.plotAreaHeight+this.yMinInit*this.yRel,this.precalculation_2=this.precalculation_1}_events(){let e;this.plotArea.addEventListener("wheel",e=>{e.preventDefault(),e.deltaY>0&&this.yZoom>.5?this.yZoom-=.2:e.deltaY<0&&this.yZoom<2&&(this.yZoom+=.2),this.repaint(),null!==this.repaintListener&&this.repaintListener(this.yZoom,this.yOffset)}),this.plotArea.addEventListener("mousedown",t=>{t.preventDefault(),e=t.clientY+this.yOffset,this.plotArea.addEventListener("mousemove",s),this.plotArea.addEventListener("mouseup",e=>{this.plotArea.removeEventListener("mousemove",s)}),this.plotArea.addEventListener("mouseout",e=>{this.plotArea.removeEventListener("mousemove",s)})});let t=this;function s(s){t.yOffset=e-s.clientY,t.precalculation_2=t.precalculation_1-t.yOffset,t.repaint(),null!==t.repaintListener&&t.repaintListener(t.yZoom,t.yOffset)}}setYZoomAndOffset(e,t){this.yZoom=e,this.yOffset=t,this.precalculation_2=this.precalculation_1-this.yOffset}setExternalYAxisMax(e){this.externalYAxisMax=e}getYAxisMax(){return this.yAxisMax}repaint(){let e;this._resetYAxisLabelGroup(),e=this.yZoom>1?this.yLabelGapInit/5:this.yLabelGapInit;let t=Math.floor(this.yMin/e)*e,s=Math.ceil(this.yMax/e)*e;if(this.yAxisMax=s,void 0!==this.externalYAxisMax&&(s=this.externalYAxisMax),null!==this.yLabelText)for(let n=t;n<s+1;n+=e)i.addLine(this.yAxisLabelsGroup,this.margins.left,this.transformY(n),this.margins.left-3,this.transformY(n)),i.addText(this.yAxisLabelsGroup,this.margins.left-5,this.transformY(n)+5,n,"end","axis-steps");if(this._resetPlotContent(),this.outOfRangeColorActivated){i.addRect(this.plotContent,0,this.transformY(this.yMax)-2*this.plotAreaHeight,this.plotAreaWidth,2*this.plotAreaHeight).setAttribute("class","out-of-range"),i.addRect(this.plotContent,0,this.transformY(this.yMin),this.plotAreaWidth,2*this.plotAreaHeight).setAttribute("class","out-of-range")}i.addLine(this.plotContent,0,this.transformY(0),this.plotRangeX,this.transformY(0),"zeroline"),this.repaintData(t,s),this.plotArea.removeChild(this.plotAreaBg),this.plotArea.appendChild(this.plotAreaBg)}setRepaintListener(e){this.repaintListener=e}transformY(e){let t=-e*this.yZoom*this.yRel+this.precalculation_2;if(t>1e4)throw"Y coordinate too large";return t}_resetPlotContent(){null!==this.plotContent&&this.plotArea.removeChild(this.plotContent),this.plotContent=document.createElementNS(n,"g"),this.plotArea.appendChild(this.plotContent)}_resetAxisGroup(){null!==this.axisGroup&&this.svg.removeChild(this.axisGroup),this.axisGroup=document.createElementNS(n,"g"),this.svg.appendChild(this.axisGroup),this.axisGroup.setAttribute("transform","matrix(1 0 0 1 "+this.margins.left+" "+(this.height-this.margins.bottom)+")")}_resetYAxisLabelGroup(){null!==this.yLabelText&&(null!==this.yAxisLabelsGroup&&this.yAxisArea.removeChild(this.yAxisLabelsGroup),this.yAxisLabelsGroup=document.createElementNS(n,"g"),this.yAxisArea.appendChild(this.yAxisLabelsGroup))}_reset(){this.yZoom=1,this.yOffset=0,this._resetPlotContent(),null!==this.yLabelText&&(this.svg.removeChild(this.yLabelText),this.yLabelText=null),null!==this.noDataGroup&&(this.svg.removeChild(this.noDataGroup),this.noDataGroup=null)}setNoData(){this._resetYAxisLabelGroup(),this._resetPlotContent(),this._resetAxisGroup(),null===this.noDataGroup&&(this.noDataGroup=document.createElementNS(n,"g"),this.svg.appendChild(this.noDataGroup),i.addRect(this.noDataGroup,0,0,this.width,this.height),this.noDataGroup.setAttribute("fill","#EEE"),i.addText(this.noDataGroup,this.width/2,this.height/2+10,"NO DATA","middle","nodata"))}}},function(e,t,s){let i=s(2),n=s(0),a=s(20),l=s(21),r=s(24),o=s(26),d=s(28),h=s(30),c=s(33),p=s(1),u=s(4),m=null,y={eStruct:null,thermalProps:null};class v{constructor(e){this.hostElement=e,this.viewer=new StructureViewer(e),this.legendElement=document.createElement("div"),this.legendElement.setAttribute("class","element-labels"),this.legendElement.setAttribute("style","position: absolute; bottom: 50px; right: 0"),this.hostElement.appendChild(this.legendElement),this.footerElement=document.createElement("div"),this.footerElement.setAttribute("class","structure-viewer-legend"),this.hostElement.appendChild(this.footerElement),this.footerElement.innerHTML=`\n\n    <div style="float: left; padding-right: 12px" >\n      <input type="checkbox" class="show-axis" checked> Show axis\n    </div>\n\n    <div style="float: left; padding-right: 18px" >\n      <input type="checkbox" class="show-bonds" checked> Show bonds\n    </div>\n\n    <div style="float: left; position:relative;" >\n      <img class="view-reset" style="cursor: pointer;" height="18px"\n        src="${n.IMAGE_DIR}reset.svg" />\n      <div class="view-reset-tooltip" > Reset view </div>\n    </div>\n\n    \x3c!--\n    <div class="view-reset-tooltip" style="float: left; display: none; font-size: 0.8em;" >\n      Set original <br> &nbsp; view\n    </div>\n    --\x3e\n\n    <div class="vr-download" style="float: right"> </div>\n\n    <div style="clear: both;"></div>\n    `,this.axisCheckbox=this.footerElement.querySelector(".show-axis"),this.axisCheckbox.addEventListener("click",e=>{this.viewer.toggleLatticeParameters(this.axisCheckbox.checked)}),this.bondsCheckbox=this.footerElement.querySelector(".show-bonds"),this.bondsCheckbox.addEventListener("click",e=>{this.viewer.toggleBonds(this.bondsCheckbox.checked)}),this.labelsContainer=this.hostElement.querySelector(".element-labels"),this.vrLinksContainer=this.footerElement.querySelector(".vr-download"),this.vrDropDown=new f,this.vrLinksContainer.appendChild(this.vrDropDown.element);let t=this.hostElement.querySelector(".view-reset");t.addEventListener("click",e=>this.viewer.reset()),t.addEventListener("mouseover",e=>{this.hostElement.querySelector(".view-reset-tooltip").style.display="block"}),t.addEventListener("mouseout",e=>{this.hostElement.querySelector(".view-reset-tooltip").style.display="none"})}load(e){this.viewer.load(e),this.createElementLegend()}setMaterialId(e){console.log("pass material id "+e),this.vrDropDown.setMaterialId(e)}changeHostElement(e){this.hostElement!==e&&(this.hostElement.removeChild(this.legendElement),this.hostElement.removeChild(this.footerElement),this.hostElement=e,this.viewer.changeHostElement(e),this.hostElement.appendChild(this.legendElement),this.hostElement.appendChild(this.footerElement))}createElementLegend(){this.labelsContainer.innerHTML="";let e=this.viewer.elements,t=[];for(let s in e)e.hasOwnProperty(s)&&t.push([s,e[s][0],e[s][1]]);t.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}));let s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("width",50),s.setAttribute("height",25*t.length),this.labelsContainer.appendChild(s);for(let e=0;e<t.length;++e){let n=t[e][0],a=t[e][1].toString(16),l=6-a.length;a="#"+Array(l+1).join("0")+a,i.addCircle(s,10,25*e+12,8,a,"#777",1),i.addText(s,24,25*e+18,n,"start","structure-viewer-legend-labels")}}}class f{constructor(e){this.folded=!0,this.element=document.createElement("div"),this.element.innerHTML+=`\n      <div >\n        <span style=" vertical-align: 30%; ">Virtual Reality files</span>\n        <img style="cursor: pointer" src="${n.IMAGE_DIR}folded.png" />\n      </div>\n\n      <div class="vr-download-panel" style="position: relative; display: none">\n\n      </div>\n    `,this.element.tabIndex="0",this.element.style.outline="none",this.foldingPanel=this.element.querySelector(".vr-download-panel"),this.foldBtn=this.element.querySelector("img"),this.foldBtn.addEventListener("click",e=>{this.folded=!this.folded,this.foldBtn.src=this.folded?n.IMAGE_DIR+"folded.png":n.IMAGE_DIR+"unfolded.png",this.foldingPanel.style.display=this.folded?"none":"block"}),this.element.addEventListener("blur",e=>{setTimeout(()=>{this.folded=!0,this.foldBtn.src=n.IMAGE_DIR+"folded.png",this.foldingPanel.style.display="none"},300)})}setMaterialId(e){this.foldingPanel.innerHTML=`\n    <div class="vr-download-panel-unfolded" style="width: 210px;">\n      <div style="padding: 5px; ">\n        <a href="http://nomad.srv.lrz.de/cgi-bin/NOMAD/material?${e}">Get VR file</a>\n      </div>\n      <br>\n      <div style="padding-bottom: 5px; ">Visualization tools for specific devices:</div>\n\n      <div style="padding: 5px; ">\n        <a href="http://nomad.srv.lrz.de/NOMAD/NOMADViveT-Setup.exe">HTC Vive</a>\n      </div>\n      \x3c!--\n      <div style="padding: 5px; ">\n        <a href="http://nomad.srv.lrz.de/NOMAD/NOMADGearvrT.apk">Samsung GearVR</a>\n      </div>\n      --\x3e\n      <div style="padding: 5px; ">\n        <a target="_blank" href="https://play.google.com/store/apps/details?id=com.lrz.nomadvr">Google Cardboard</a>\n      </div>\n\n    </div>\n    `}}e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","material-module"),this.overview=new l,this.overview.attachAndSetEvents(this.element),this.navTree=new a,this.structureViewer=null,this.structureDetails=new r,this.structureDetails.attachAndSetEvents(this.element),this.electronicStructDetails=new o,this.electronicStructDetails.attachAndSetEvents(this.element),this.methodologyDetails=new d,this.methodologyDetails.attachAndSetEvents(this.element),this.thermalDetails=new h,this.thermalDetails.attachAndSetEvents(this.element),this.elasticDetails=new c,this.elasticDetails.attachAndSetEvents(this.element),this.currentDetailView=null}setMaterialView(e){null===m||m.id!==parseInt(e.id)?(this._loadMaterial(e.id,e.view),null!==this.structureViewer&&(this.structureViewer.axisCheckbox.checked=!0,this.structureViewer.bondsCheckbox.checked=!0)):(this._setView(e.view),document.querySelector("title").innerHTML="NOMAD Encyclopedia - "+n.getMaterialTitle(p.getMaterialData(),!1))}getCurrentPageStatus(){let e=null;return null===this.currentDetailView&&(e=this.overview.getEStructChosenCalcs()),{pageId:this.currentDetailViewId,markedLeaf:this.navTree.getMarkedLeaf(),eStructCalcs:e}}_setView(e){null===this.currentDetailView?this.overview.element.style.display="none":this.currentDetailView.element.style.display="none",void 0===e?(this.currentDetailView=null,this.currentDetailViewId=null,this.overview.setVisible(),this.navTree.setLeafMarkedListener(void 0),this._setCellViewer(this.overview.vizBox)):(this.currentDetailViewId=e,this._setDetailView(n.MAT_VIEW[e]))}_setCellViewer(e){null===this.structureViewer?(this.structureViewer=new v(e),null!==m&&(this.structureViewer.load(n.getCellDataForViewer(m)),this.structureViewer.setMaterialId(m.id))):this.structureViewer.changeHostElement(e)}_setDetailView(e){e===n.MAT_VIEW.structure?(this.currentDetailView=this.structureDetails,this.navTree.showCalcsGraphDataAvalability(!1),this.navTree.setHeight(250),this.navTree.setMarkedLeafIfNoneMarked(null)):e===n.MAT_VIEW.electronicstruct?(this.currentDetailView=this.electronicStructDetails,this.navTree.showCalcsGraphDataAvalability(!0),this.navTree.setHeight(400),this.navTree.setMarkedLeafIfNoneMarked(y.eStruct)):e===n.MAT_VIEW.methodology?this.currentDetailView=this.methodologyDetails:e===n.MAT_VIEW.thermalprops&&(this.currentDetailView=this.thermalDetails,this.navTree.showCalcsGraphDataAvalability(!0),this.navTree.setHeight(600),this.navTree.setMarkedLeafIfNoneMarked(y.thermalProps)),this.currentDetailView.setVisible(),e===n.MAT_VIEW.structure&&this._setCellViewer(this.structureDetails.vizBox),e!==n.MAT_VIEW.methodology&&this.currentDetailView.attachNavTree(this.navTree),this.currentDetailView.updateSelection(this.navTree.getTreeSelectedCalcs()),this.currentDetailView.updateMarkedLeaf(this.navTree.getMarkedLeaf()),this.navTree.setTreeSelectionListener(e=>{this.currentDetailView.updateSelection(e)}),this.navTree.setLeafMarkedListener(e=>{this.currentDetailView.updateMarkedLeaf(e)})}_loadMaterial(e,t){this.overview.element.style.visibility="hidden",u.show(),n.serverReq(n.getMaterialURL(e),s=>{m=JSON.parse(s.target.response),n.materialId=m.id,200===s.target.status&&n.serverReq(n.getMaterialXsURL("elements",e),s=>{m.elements=JSON.parse(s.target.response).results,n.serverReq(n.getMaterialXsURL("cells",e),s=>{let i=JSON.parse(s.target.response).results;i[0].is_primitive?m.cell=i[1]:m.cell=i[0],p.setMaterialData(m),document.querySelector("title").innerHTML="NOMAD Encyclopedia - "+n.getMaterialTitle(m,!1),this.overview.setMaterialData(),this.structureDetails.setMaterialData(),this.electronicStructDetails.setMaterialData(),this.methodologyDetails.setMaterialData(),this.thermalDetails.setMaterialData(),this.elasticDetails.setMaterialData(),null!==this.structureViewer&&(this.structureViewer.load(n.getCellDataForViewer(m)),this.structureViewer.setMaterialId(m.id)),n.serverReq(n.getMaterialXsURL("calculations",e),s=>{p.setCalculations(JSON.parse(s.target.response).results),n.serverReq(n.getMaterialXsURL("groups",e),e=>{p.setGroups(JSON.parse(e.target.response).groups);let s=null===m.material_name?m.formula:m.material_name;this.navTree.build(s),this.overview.setCalcsData(y),this.navTree.selectAll(),this._setView(t),this.overview.element.style.visibility="visible",u.hide()})})})})})}}},function(e,t,s){"use strict";let i=s(8),n=s(2),a=s(0);e.exports=class extends i{constructor(e){super(e)}attach(e,t,s){super.attach(e,t,s)}setPoints(e,t){this.pointsSpin1=[],this.pointsSpin2=[],this._reset();let s=e.dos_values[0],i=null;2===e.dos_values.length&&(i=e.dos_values[1]);let l=e.dos_energies,r=[],o=[];for(var d=0;d<l.length;d++){let e=l[d]/1602176565e-28,t=1602176565e-28*s[d];if(r.push(t),o.push(e),this.pointsSpin1.push({x:t,y:e}),null!==i){let t=1602176565e-28*i[d];this.pointsSpin2.push({x:t,y:e}),r.push(t)}}let h=Math.max.apply(null,r),c=Math.max.apply(null,o),p=Math.min.apply(null,o),u=a.generateDiagramSteps(h),m=u[0],y=u[1];this.setAxisRangeAndLabels(null,0,m[m.length-1],"Energy (eV)",-6,11,p,c,5),n.addText(this.axisGroup,this.plotRangeX/2,this.margins.bottom,"DOS (states/eV/cell)","middle","axis-steps-big");for(let e=0;e<m.length;e++){let t=this.plotRangeX*m[e]/m[m.length-1];n.addLine(this.axisGroup,t,0,t,3,1),n.addText(this.axisGroup,t,13,0===e?"0":m[e].toFixed(y),"middle","axis-steps-smaller")}this.repaint()}repaintData(){let e="";for(var t=0;t<this.pointsSpin1.length;t++)e+=" "+this.xRel*this.pointsSpin1[t].x+" "+this.transformY(this.pointsSpin1[t].y);n.addPolyline(this.plotContent,e,"plotSpin1"),e="";for(t=0;t<this.pointsSpin2.length;t++)e+=" "+this.xRel*this.pointsSpin2[t].x+" "+this.transformY(this.pointsSpin2[t].y);n.addPolyline(this.plotContent,e,"plotSpin2")}setYAxisLabelsVisibility(e){null!==this.yAxisLabelsGroup&&(this.yAxisLabelsGroup.style.visibility=e?"visible":"hidden")}}},function(e,t,s){"use strict";let i=s(2),n=s(5);e.exports=class extends n{constructor(){super({left:50,right:16,top:10,bottom:32}),this.tooltip}setData(e){this.clear();let t=e.temperature.indexOf(600)+1,s=e.value.slice(0,t),n=e.temperature.slice(0,t),a=Math.max.apply(null,s);this.setRangeAndLabels("T (K)",0,600,"Cv (J/K/kg)",0,200*Math.ceil(a/200)),this.drawAxis(4,4,0);let l="";n.forEach((e,t)=>{let i=s[t];l+=" "+this.xRel*e+" -"+this.yRel*(i-this.yMin)}),i.addPolyline(this.plotArea,l,"plotSpin1")}}},function(e,t){e.exports=class{constructor(e,t){this.first=!0,this.last=!1,this.element=document.createElement("div"),this.element.className=e,void 0!==t&&(this.element.style.width=t),this.element.innerHTML='\n      <div class="prev-sel-btn" style="float: left; width: 20%;">\n        <div style="padding-left: 10%;">\n          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10.069 11.872" width="20px">\n            <path transform="scale(0.7) translate(-346.291 -664.481)"\n              d="M356.36,666.024l-1.544-1.544-8.525,8.513,8.493,8.447,1.544-1.544-6.8-6.9Z" />\n          </svg>\n        </div>\n      </div>\n      <div class="calc-sel-text" style="float: left; width: 60%;">\n       NOT Calculation\n      </div>\n      <div class="next-sel-btn" style="float: right; width: 20%;">\n        <div style="padding-right: 10%;">\n          <svg xmlns="http://www.w3.org/2000/svg" viewBox="-10.069 -11.872 10.069 11.872" width="20px">\n            <g transform="rotate(180) scale(0.7)">\n              <path d="M10.069,1.544,8.525,0,0,8.513,8.493,16.96l1.544-1.544-6.8-6.9Z"/>\n            </g>\n          </svg>\n        </div>\n      </div>\n      <div style="clear: both;"></div>\n    ',this.prevBtn=this.element.querySelector(".prev-sel-btn"),this.prevIcon=this.element.querySelector(".prev-sel-btn path"),this.calcSelectorTxt=this.element.querySelector(".calc-sel-text"),this.nextBtn=this.element.querySelector(".next-sel-btn"),this.nextIcon=this.element.querySelector(".next-sel-btn path"),this._styleButtons(),this._events()}_events(){this.prevBtn.addEventListener("click",e=>{e.preventDefault(),this.first||(this.first=this.prevListener(),this.last=!1,this._styleButtons())}),this.nextBtn.addEventListener("click",e=>{e.preventDefault(),this.last||(this.first=!1,this.last=this.nextListener(),this._styleButtons())})}_styleButtons(){this.prevIcon.setAttribute("class","calc-selector-icon"+(this.first?"-disabled":"")),this.nextIcon.setAttribute("class","calc-selector-icon"+(this.last?"-disabled":""))}setPrevListener(e){this.prevListener=e}setNextListener(e){this.nextListener=e}setState(e,t,s){this.calcSelectorTxt.innerHTML=e,this.first=t,this.last=s,this._styleButtons()}}},function(e,t,s){"use strict";let i=s(2),n=s(5);class a extends n{constructor(){super({left:54,right:20,top:20,bottom:30}),this.tooltip}drawPoints(e){for(let t=0;t<e.length;t++){let s=i.addPoint(this.plotArea,this.xRel*t,-this.yRel*(e[t]-this.yMin),2,"stats-viewer-point");s.addEventListener("mouseover",s=>{this.tooltip=i.addText(this.plotArea,s.target.getBBox().x+6,s.target.getBBox().y-4,e[t].toFixed(2),"start","tooltip")}),s.addEventListener("mouseout",e=>{i.removeElement(this.tooltip)})}}}class l extends n{constructor(){super({left:4,right:10,top:20,bottom:30})}drawBars(e,t,s){let n=[0,0,0,0,0,0,0,0,0,0];e.forEach(e=>{let i=Math.floor((e-t)/s*10);i>9&&(i=9),n[i]+=1}),n.forEach((e,t)=>{let s=(t+.5)*this.yRel;i.addLine(this.plotArea,0,-s,e*this.xRel,-s,"bar")})}}e.exports=class{constructor(){this.mainGraph=new a,this.freqGraph=new l}attach(e,t,s){this.mainGraph.attach(e,t/2+24,s),this.freqGraph.attach(e,t/2-24,s)}drawPoints(e,t,s,i){let n=s,a=i;i===s&&(n=s-1,a=i+1),this.mainGraph.setRangeAndLabels("Calculation",0,e.length,t,n,a),this.mainGraph.drawAxis(null,i===s?2:4,s>1e3?0:2),this.mainGraph.drawPoints(e);let l=e.length<10?10:10*Math.floor(e.length/10);this.freqGraph.setRangeAndLabels("Occurrence",0,l,"",0,10),this.freqGraph.drawAxis(2,1,1),this.freqGraph.drawBars(e,this.mainGraph.yMin,this.mainGraph.yMax-this.mainGraph.yMin)}clear(){this.mainGraph.clear(),this.freqGraph.clear()}}},function(e,t,s){"use strict";let i,n,a,l,r,o=document.querySelector("body"),d=[],h=[],c=[],p=!1;function u(e,t){let s=document.createElement("div");return s.setAttribute("class","user-guidance"),s.innerHTML='<img src="img/tip'+e+'.png" width="'+t+'px" />',s.style.position="absolute",s.style.display="none",o.appendChild(s),s}function m(e){if(8===e&&!p)return;if(4===e&&!p)return;let t=h[e].domTarget.getBoundingClientRect();d[e].style.top=t.top+h[e].top+window.pageYOffset+"px",d[e].style.left=t.left+h[e].left+"px",d[e].style.display="block"}function y(e){d[e].style.display="none",localStorage.setItem("tip"+e,"off"),c[e]="off"}function v(e){switch(e.preventDefault(),e.target.style.display="none",i){case 2:i=5;break;case 6:i=8;break;default:i++}g(i),m(i)}function f(e,t){null===c[e]&&(t?m(e):d[e].style.display="none")}function g(e){i=e,localStorage.setItem("currentTip",e)}e.exports={init:function(e,t,s,i){n=e,a=t,l=s,r=i,c[3]=localStorage.getItem("tip3"),c[4]=localStorage.getItem("tip4"),c[7]=localStorage.getItem("tip7"),0===d.length&&(d[1]=u(1,220),h[1]={domTarget:n,top:-70,left:-240},d[2]=u(2,280),h[2]={domTarget:n,top:-110,left:80},d[3]=u(3,180),h[3]={domTarget:a,top:180,left:720},d[4]=u(4,240),h[4]={domTarget:l,top:45,left:-250},d[5]=u(5,210),h[5]={domTarget:n,top:-130,left:70},d[6]=u(6,240),h[6]={domTarget:n,top:-100,left:370},d[7]=u(7,220),h[7]={domTarget:r,top:160,left:-40},d[8]=u(8,240),h[8]={domTarget:l,top:30,left:760},d[1].addEventListener("click",v),d[2].addEventListener("click",v),d[3].addEventListener("click",e=>{y(3)}),d[4].addEventListener("click",e=>{y(4)}),d[5].addEventListener("click",v),d[6].addEventListener("click",v),d[7].addEventListener("click",e=>{y(7)}),d[8].addEventListener("click",e=>{e.target.style.display="none",g(10)}));let o=localStorage.getItem("currentTip");null===o?g(1):(o=parseInt(o),o<10&&g(o))},setFinal:function(){p=!0,i<10&&(d[i].style.display="none",g(8),m(i)),f(4,!0)},show:function(e,t,s){i<10&&(e?m(i):d[i].style.display="none"),f(3,e&&t),f(4,e),f(7,e&&s)},showIndependentTip:f}},function(e,t,s){"use strict";let i=s(0),n=s(4),a=s(17),l=s(18),r=s(19),o=s(9),d=s(34),h=s(14),c=s(1),p=document.getElementById("content"),u=document.querySelector("title"),m=document.getElementById("calc-flagging-tab");m.style.top=window.innerHeight/2+"px",m.addEventListener("click",e=>{a.show(v.getCurrentPageStatus())});let y,v,f,g,b=new class{constructor(){this.element=document.querySelector("#breadcrumb-placeholder"),this.element.innerHTML='\n      <span class="goto-page Search">Search</span>\n      <span class="goto-page Results">&nbsp; > &nbsp; <span>Results</span></span>\n      <span class="goto-page Overview">&nbsp; > &nbsp; <span>Overview</span></span>\n      <span class="Details">\n        &nbsp; > &nbsp;\n        <select class="details-dropdown" >\n          <option value="structure">Structure</option>\n          <option value="electronicstruct">Electronic structure</option>\n          <option value="methodology">Methodology</option>\n          <option value="thermalprops">Thermal Properties</option>\n          \x3c!-- elasticconst--\x3e\n        </select>\n      </span>\n    ',this.resultsSel=this.element.querySelector(".Results"),this.overviewSel=this.element.querySelector(".Overview"),this.detailsSel=this.element.querySelector(".Details"),this.detailsDropDown=this.element.querySelector(".details-dropdown"),this.element.querySelector(".Search").addEventListener("click",e=>{i.setBrowserHashPath("search")}),this.resultsSel.addEventListener("click",e=>{i.setBrowserHashPath("search/results")}),this.overviewSel.addEventListener("click",()=>{i.setBrowserHashPath("material",i.materialId)}),this.detailsDropDown.addEventListener("change",e=>{i.setBrowserHashPath("material",c.getMaterialData().id+"/"+e.target.value)});let e=this;this.detailsDropDown.addEventListener("focus",(function t(){let s=e.detailsDropDown.querySelector('option[value="electronicstruct"]');c.hasElecStructureData||e.detailsDropDown.removeChild(s);let i=e.detailsDropDown.querySelector('option[value="thermalprops"]');c.hasThermalData||e.detailsDropDown.removeChild(i),e.detailsDropDown.removeEventListener("focus",t)}))}setState(e,t){this.resultsSel.querySelector("span").style.fontWeight="normal";let s=this.overviewSel.querySelector("span");s.style.fontWeight="normal","search"===e?(this.overviewSel.style.display="none",this.detailsSel.style.display="none","results"===t?(this.resultsSel.style.display="inline",this.resultsSel.querySelector("span").style.fontWeight="bold",this.element.style.visibility="visible"):this.element.style.visibility="hidden"):"material"===e&&(this.element.style.visibility="visible",this.resultsSel.style.display=i.searchResults?"inline":"none",this.overviewSel.style.display="inline",void 0===t?(this.detailsSel.style.display="none",s.style.fontWeight="bold"):(this.detailsSel.style.display="inline",this.detailsDropDown.value=t))}};function x(e){g&&p.removeChild(g),g=e,p.appendChild(g)}l.subscribe("show-material",e=>{console.log("Handling event show-material: "+e.id+" view: "+e.view),b.setState("material",e.view),void 0===f&&(v=new o,f=v.element),v.setMaterialView(e),x(f),h.show(!1),null!==i.getUserData()&&(m.style.visibility="visible")}),l.subscribe("show-search",e=>{console.log("Handling event show-search: "+e),u.innerHTML="NOMAD Encyclopedia - Search",b.setState("search",e),void 0===e?(y.showSearchPage(),n.hide()):"results"===e&&y.showResultsPage(),x(y.element),"hidden"!==m.style.visibility&&(m.style.visibility="hidden")}),r.add("search",e=>l.publish("show-search",e)),r.add("material",(e,t)=>l.publish("show-material",{id:e,view:t})),y=new d,""===document.location.hash&&(document.location+="#/search"),r.route();let S=document.querySelector("#user-name"),w=document.querySelector("#logout-button");let E=function(e){let t=("; "+document.cookie).split("; "+e+"=");if(2===t.length)return t.pop().split(";").shift()}("user_info");if(void 0!==E){let e=JSON.parse((M=E).substring(1,M.length-1).replace(/\\054/g,",").replace(/\\/g,""));"Authenticated"===(T=e).status&&(S.innerHTML=T.user.username,document.querySelector("#guest-user").style.display="none",document.querySelector("#auth-user").style.display="inline",i.setAuthRequestHeader(T.user,T.token.data),g===f&&(m.style.visibility="visible"))}var T,M;w.addEventListener("click",e=>{document.cookie="user_info=; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain="+i.USER_COOKIE_DOMAIN+"; path=/",S.innerHTML="",document.querySelector("#guest-user").style.display="inline",document.querySelector("#auth-user").style.display="none",i.setAuthRequestHeader(),"hidden"!==m.style.visibility&&(m.style.visibility="hidden")})},function(e,t){const s={GuestUserToken:"eyJhbGciOiJIUzI1NiIsImlhdCI6MTUyMzg4MDE1OSwiZXhwIjoxNjgxNTYwMTU5fQ.eyJpZCI6ImVuY2d1aSJ9.MsMWQa3IklH7cQTxRaIRSF9q8D_2LD5Fs2-irpWPTp4"};e.exports=s},function(e,t,s){"use strict";let i=s(0),n=s(1),a=document.querySelector("#flagging-form-popup-bg"),l=document.querySelector("#flagging-form-popup");l.innerHTML='\n\n<div> <img src="img/cross.svg"  height="12px"\n  style="float: right; cursor: pointer" />\n</div>\n\n<div class="form-wrapper">\n  <div class="popup-title"> Error reporting</div>\n  <select id="flagging-category" name="category">\n    <option value="">Select a category *</option>\n    <option value="structure">Structure</option>\n    <option value="electronicstruct">Electronic structure</option>\n    <option value="methodology">Methodology</option>\n    <option value="thermalprops">Thermal properties</option>\n  </select>\n\n  <select id="flagging-subcategory" name="subcategory">\n\n  </select>\n\n  <textarea id="subject" name="subject" style="height:200px"\n  placeholder="Write a short explanation about the error detected" ></textarea>\n\n  <div id="form-validation-msg"> </div>\n\n  <div style="display: flex; justify-content: space-evenly;">\n    <button style="display: block">Send</button>\n  </div>\n\n\n</div>\n';let r=l.querySelector("#flagging-category"),o=r.querySelector('option[value="electronicstruct"]'),d=r.querySelector('option[value="thermalprops"]'),h=l.querySelector("#flagging-subcategory"),c=l.querySelector("img"),p=l.querySelector("#form-validation-msg"),u=l.querySelector("button"),m=null,y=null;function v(){a.style.visibility="hidden",l.style.visibility="hidden",r.selectedIndex=0,h.selectedIndex=0,l.querySelector("textarea").value="",p.innerHTML=""}function f(e,t){let s=document.createElement("option");return s.value=void 0===t?e:t,s.innerHTML=e,s}c.addEventListener("click",e=>{v()}),u.addEventListener("click",e=>{let t=r.options[r.selectedIndex];if(r.disabled||""!==t.value)if(r.disabled&&""===h.value&&t.value!==i.MAT_VIEW.methodology)p.innerHTML="The subcategory fields must be set";else{p.innerHTML="Sending report...";let e=l.querySelector("textarea").value,s=n.getMaterialData().id,a=i.getUserData(),o="User issue | Material "+s,d="**Server:** "+i.getServerLocation()+"\\n\\n**User:** "+a.username+", "+a.email;r.disabled?(d+="\\n\\n**Category:** "+t.text,t.value!==i.MAT_VIEW.methodology&&(d+="\\n\\n**Subcategory:** "+h.options[h.selectedIndex].text+"\\n\\n**Calculation/group marked on the tree:** "+m)):(d+="\\n\\n**Category:** Overview / "+t.text,t.value===i.MAT_VIEW.electronicstruct&&null!==y&&(d+="\\n\\n**Chosen calculations:** "+(null===y.bs?"":"BS calculation "+y.bs)+(null===y.dos?"":" DOS calculation "+y.dos))),d+="\\n\\n**User text:** "+e;let c=`{\n      "title": "${o}",\n      "description": "${d}"}`;console.log("Flagging POST request Json: ",c),i.serverReqPOST(i.getFlaggingURL(),c,e=>{console.log("response",e),200===e.target.status&&v()})}else p.innerHTML="The category fields must be set"}),e.exports={show:function(e){m=e.markedLeaf,y=e.eStructCalcs,o.style.display=n.hasElecStructureData?"block":"none",d.style.display=n.hasThermalData?"block":"none",function(e){if(h.innerHTML="",null===e)r.disabled=!1,h.style.display="none";else switch(r.disabled=!0,h.style.display="block",h.appendChild(f("Choose the subcategory *","")),e){case i.MAT_VIEW.structure:r.selectedIndex=1,h.appendChild(f("Structure representation")),h.appendChild(f("Calculation tree")),h.appendChild(f("Summary")),h.appendChild(f("Specific calculation"));break;case i.MAT_VIEW.electronicstruct:r.selectedIndex=2,h.appendChild(f("Calculation tree")),h.appendChild(f("Summary")),h.appendChild(f("Band structure")),h.appendChild(f("DOS")),h.appendChild(f("Brillouin zone"));break;case i.MAT_VIEW.methodology:r.selectedIndex=3,h.style.display="none";break;case i.MAT_VIEW.thermalprops:r.selectedIndex=4,h.appendChild(f("Calculation tree")),h.appendChild(f("Phonon dispersion")),h.appendChild(f("Phonon DOS")),h.appendChild(f("Specific heat")),h.appendChild(f("Helmholtz free energy"))}}(e.pageId);let t=l.getBoundingClientRect(),s=(window.innerWidth-t.width)/2,c=(window.innerHeight-t.height)/2;l.style.left=s+"px",l.style.top=c-20+"px",l.style.visibility="visible",a.style.visibility="visible"},hide:v}},function(e,t,s){"use strict";var i=new Map,n=-1;e.exports={subscribe:function(e,t){if("function"!=typeof t)return!1;i.has(e)||i.set(e,new Map);var s="uid_"+String(++n);return i.get(e).set(s,t),s},publish:function(e,t){return!!(i.has(e)&&i.get(e).size>0)&&(setTimeout((function(){i.get(e).forEach((function(e,s){e(t)}))}),0),!0)}}},function(e,t,s){"use strict";let i=new Map;function n(){let e,t,s,n=document.location.hash.substring(2);if(n.lastIndexOf("/")===n.length-1&&(n=n.substring(0,n.length-1)),n.indexOf("/")>0){let i=n.split("/");e=i[0],t=i[1],s=i[2]}else e=n;i.has(e)&&i.get(e)(t,s)}window.addEventListener("hashchange",n),e.exports={add:function(e,t){i.set(e,t)},route:n}},function(e,t,s){"use strict";let i=s(0),n=s(1);function a(e,t){let s=new Map;return t.forEach((e,t)=>{let i=n.getCalc(n.getCalcReprIntId(t)),a=i.code_name.trim(),l=i.functional_type;if("exciting"===a)if(s.has(l)){let e=s.get(l);e.has(a)?e.get(a).push(t):e.set(a,[t])}else{let e=new Map;e.set(a,[t]),s.set(l,e)}}),e.forEach(e=>{n.isInAnyNotDisabledGroup(e.id)||function(e,t){let i=e.code_name.trim(),n=e.functional_type;if(s.has(n)){let e=s.get(n);e.has(i)?e.get(i).push(t):e.set(i,[t])}else{let e=new Map;e.set(i,[t]),s.set(n,e)}}(e,e.id+"")}),s}function l(e,t){if(e.className.indexOf("material-l")>=0)return;let s=e.parentElement;for(let t=0;t<s.children.length;t++){let i=s.children[t++];if(i!==e&&i.className.indexOf("selected")<0)return}let i=s.previousElementSibling;if(t)i.className+=" node-selected";else{let e=i.className.indexOf(" node-selected");i.className=i.className.substring(0,e)}l(i,t)}e.exports=class{constructor(){this.selectedCalcs=new Set,this.element=document.createElement("div"),this.element.setAttribute("id","navigation-tree"),this.parentElement=null,this.markedNode=null,this._events()}attach(e){null!==this.parentElement&&this.parentElement.removeChild(this.element),this.parentElement=e,this.parentElement.appendChild(this.element)}build(e){function t(e,t,s,i=0){return`\n        <div class="${e}">\n          <span class="${"node-"+(s?"unfolded":"folded")}"></span>\n          <span class="node-checkbox"></span>\n          <span class="node-label" >${t}</span>\n          ${0===i?"":'<span class="node-counter">('+i+")</span>"}\n        </div>\n      `}function s(e){let t="";return e.has_band_structure&&(t+='<span class="tooltip">B<span class="tooltiptext">Band structure</span></span> '),e.has_dos&&(t+='<span class="tooltip">D<span class="tooltiptext">Density of states</span></span> '),e.has_fermi_surface&&(t+='<span class="tooltip">F<span class="tooltiptext">Fermi surface</span></span>'),e.has_thermal_properties&&(t+='<span class="tooltip">T<span class="tooltiptext">Phonons</span></span>'),'&nbsp; <span class="calc-graph-aval">'+t+"</span>"}this.selectedCalcs.clear(),this.markedNode=null,this.element.innerHTML="",this.calcsInGroups=n.getGroups();let l=a(n.getCalculations(),this.calcsInGroups),r=document.createElement("div");this.element.appendChild(r),r.innerHTML=t("material-l",e,!0);let o=document.createElement("div");r.appendChild(o),l.forEach((e,a)=>{o.innerHTML+=t("functional-l",a,!0);let l=document.createElement("div");o.appendChild(l),e.forEach((e,a)=>{l.innerHTML+=t("code-l",a,!1,e.length);let r=document.createElement("div");l.appendChild(r),r.style.display="none";for(var o=0;o<e.length;o++){let t=s(n.getCalc(n.getCalcReprIntId(e[o]))),a="",l="";n.isGroup(e[o])&&(a='<img class="folder-icon" src="'+i.IMAGE_DIR+'folder.png" />',l="("+this.calcsInGroups.get(e[o]).calcs.size+")"),r.innerHTML+=`\n            <div class="calc-l" data-calc-id="${e[o]}" >\n              <span></span>\n              <span class="node-checkbox"></span>\n\n              <span class="node-label" >\n                ${a} ${e[o]} ${l} ${t}\n              </span>\n\n              <div style="float: right; padding: 1px 10px 0 0;  display: none;">\n                <img  src="${i.IMAGE_DIR}next.png" />\n              </div>\n\n            </div>\n            <div> </div>`}})})}selectAll(e){let t=this.element.children[0].children[0];this._recursiveNodeSelection(t,!0),l(t,!0)}getMarkedLeaf(){return null===this.markedNode?null:this.markedNode.getAttribute("data-calc-id")}setMarkedLeafIfNoneMarked(e){if(null===this.getMarkedLeaf())if(null===e)this._markFirstSelectedNode();else{let t=this.element.querySelector('div[data-calc-id="'+e+'"]');this._setMarkedCalc(t)}}_events(){this.element.addEventListener("click",e=>{let t=e.target.className;if(t.indexOf("folded")>=0)this._foldTreeNode(e.target);else if(t.indexOf("node-checkbox")>=0){let t=e.target.parentElement.className.indexOf("selected")<0;this._recursiveNodeSelection(e.target.parentElement,t),l(e.target.parentElement,t),this.treeSelectionListener(this.selectedCalcs),this._keepCalcMarked(t)}else t.indexOf("node-label")>=0&&"calc-l node-selected"===e.target.parentElement.className&&this._setMarkedCalc(e.target.parentElement)})}_foldTreeNode(e){let t=e.parentElement.nextElementSibling;e.className.indexOf("-folded")>=0?(e.className=e.className.replace("folded","unfolded"),t.style.display="block"):(e.className=e.className.replace("unfolded","folded"),t.style.display="none")}_recursiveNodeSelection(e,t){e.children[1];if(t)e.className+=" node-selected";else{let t=e.className.indexOf(" node-selected");e.className=e.className.substring(0,t)}if(e.className.indexOf("calc-l")>=0){let s=e.getAttribute("data-calc-id");t?this.selectedCalcs.add(s):this.selectedCalcs.delete(s)}else{let s=e.nextElementSibling;for(let e=0;e<s.children.length;e++)this._recursiveNodeSelection(s.children[e++],t)}}setTreeSelectionListener(e){this.treeSelectionListener=e}setLeafMarkedListener(e){this.leafMarkedListener=e}getTreeSelectedCalcs(){return this.selectedCalcs}_keepCalcMarked(e){if(e&&null===this.markedNode)this._markFirstSelectedNode();else if(!e){let e=parseInt(this.markedNode.getAttribute("data-calc-id"));0===this.selectedCalcs.size?(this.markedNode.className=this.markedNode.className.replace("-marked",""),this.markedNode=null,this.leafMarkedListener(null)):this.selectedCalcs.has(e)||this._markFirstSelectedNode()}}_markFirstSelectedNode(){let e=this.element.getElementsByClassName("calc-l");for(var t=0;t<e.length;t++)if(e[t].className.indexOf("node-selected")>=0)return void this._setMarkedCalc(e[t])}_setMarkedCalc(e){if(null!==this.markedNode){this.markedNode.className=this.markedNode.className.replace("-marked",""),this.markedNode.querySelector("div").style.display="none";let e=this.markedNode.querySelector(".folder-icon");null!==e&&(e.src=i.IMAGE_DIR+"folder.png")}e.className+="-marked";let t=e.querySelector(".folder-icon");null!==t&&(t.src=i.IMAGE_DIR+"folder-sel.png"),e.querySelector("div").style.display="block",this.markedNode=e;let s=e.parentElement.previousElementSibling.firstElementChild;"node-folded"===s.className&&(s.className="node-unfolded",s.parentElement.nextElementSibling.style.display="block"),void 0!==this.leafMarkedListener&&this.leafMarkedListener(e.getAttribute("data-calc-id"))}showCalcsGraphDataAvalability(e){let t=this.element.getElementsByClassName("calc-graph-aval");for(var s=0;s<t.length;s++)t[s].style.display=e?"inline":"none"}setHeight(e){this.element.style.height=e+"px"}}},function(e,t,s){"use strict";let i=s(0),n=s(3),a=s(4),l=s(7),r=s(10),o=s(11),d=(s(9),s(1)),h=s(23).SimilarityFinder;e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","overview"),this.materialId,this.element.innerHTML='\n\n    <div class="material-title">\n    </div>\n\n    <div style="float: left; width: 40%;">\n\n      <div id="structure-ov" class="view-box">\n        <div class="title">Structure\n          <img style="float: right" class="to-detail" src="img/more.svg" />\n          <div style="clear: both;"></div>\n        </div>\n\n        <div class="viz-box" style="height: 260px; position: relative"></div>\n\n        <div class="footer">\n          <div ><b><span>System type</span></b>:\n            <span class="system-type-field" ></span>\n          </div>\n          <div class="space-group-field" style="display: none">\n            <b><span info-sys-data="space-group">Space group</span></b>:\n            <span class="space-group-value" ></span>\n          </div>\n          <div class="structure-type-field" style="display: none">\n            <b><span info-sys-data="structure-type">Structure type</span></b>:\n            <span class="structure-type-value" ></span>\n          </div>\n        </div>\n      </div>\n\n\n\x3c!-- ***** Elastic Constants Box\n\n      <div id="elastic-ov" class="view-box">\n        <div class="title">Elastic constants\n          <img style="float: right" class="to-detail" src="img/more.svg" />\n          <div style="clear: both;"></div>\n        </div>\n\n        <div class="info-fields">\n          Not analyzed yet\n        </div>\n\n      </div>\n--\x3e\n\n\n      <div id="methodology-ov" class="view-box">\n        <div class="title">Methodology\n          <img style="float: right" class="to-detail" src="img/more.svg" />\n          <div style="clear: both;"></div>\n        </div>\n\n        <div class="info-fields">\n\n          <div class="info-fields-label" > Available calculations </div>\n\n          <div style="float: left; width: 45%" >\n            <b><span info-sys-data="functional-type">Functional</span></b>\n            <div class="functional-field" > </div>\n          </div>\n          <div style="float: right; width: 45%" >\n            <b><span info-sys-data="code-name">Code</span></b>\n            <div class="code-field"> </div>\n           </div>\n           <div style="clear: both;"></div>\n        </div>\n\n      </div>\n\n    </div>\n\n    <div style="float: right; width: 60%;">\n\n      <div id="e-structure-ov"  class="view-box" > \x3c!--style="height: 610px; "--\x3e\n        <div class="title">Electronic structure\n          <img style="float: right" class="to-detail" src="img/more.svg" />\n          <div style="clear: both;"></div>\n        </div>\n\n        <div > \x3c!-- style="margin: 12% 0; " --\x3e\n\n        <div style="float: left; width: 60%;  ">\n        <div style="padding: 20px 0 20px 30px">\n          <div  class="info-fields-label">\n            <span info-sys-data="band-structure">Band structure</span>\n          </div>\n          <div>\n              <div id="band-plotter" >  </div>\n          </div>\n\n          <div class="footer-bs-calc"></div>\n        </div>\n        </div>\n\n        <div style="float: left; width: 40%;  ">\n          <div style="padding: 20px 30px 20px 60px">\n            <div class="info-fields-label">\n              <span info-sys-data="DOS">DOS</span>\n            </div>\n\n            <div>\n                <div id="dos-plotter" >  </div>\n            </div>\n            <div class="footer-dos-calc"></div>\n          </div>\n        </div>\n\n\n\n        <div style="clear: both;"></div>\n        <table style="width: 100%">\n        <tr>\n          <td class="spin-legend" style="font-size: 0.9em; padding: 6px 30px 10px; display: none;">\n            <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin1"/></svg>\n              Spin <span style=\'font-size: 1.1em\'>⇧</span>  &nbsp;&nbsp;&nbsp;\n\n              <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin2"/></svg>\n              Spin <span style=\'font-size: 1.1em\'>⇩</span>\n          </td>\n          <td class = "similarity-data-field">\n          <div style="float: right; padding: 0px 40px 10px 0px; margin-top: 1px;" class="similarity-finder">\n          </div>\n          </td>\n          </tr>\n          </table>\n        </div>\n        <div style="clear: both;"></div>\n        \x3c!--\n        <div class="footer">\n\n          <b>Band gap</b>: <span class="e-struct-field" ></span>\n        </div>\n        --\x3e\n      </div>\n\n      <div id="thermal-props-ov"  class="view-box" >\n        <div class="title">Vibrational and thermal properties\n          <img style="float: right" class="to-detail thermal-props" src="img/more.svg" />\n          <div style="clear: both;"></div>\n        </div>\n\n        <div style="padding: 36px; ">\n          <div class="info-fields-label">\n            <span info-sys-data="heat-capacity-cv">Specific heat</span>\n          </div>\n\n\n          <div>\n              <div id="heat-plotter" >  </div>\n          </div>\n          <div class="footer-heat-calc" style="text-align: center"></div>\n        </div>\n\n      </div>\n\n    </div>\n\n    <div style="clear: both;"></div>\n    ',this.materialTitle=this.element.getElementsByClassName("material-title")[0],this.systemType=this.element.querySelector(".system-type-field"),this.spaceGroupField=this.element.querySelector(".space-group-field"),this.spaceGroupValue=this.element.querySelector(".space-group-value"),this.structTypeField=this.element.querySelector(".structure-type-field"),this.structTypeValue=this.element.querySelector(".structure-type-value"),this.functional=this.element.querySelector(".functional-field"),this.code=this.element.querySelector(".code-field");let e=this.element.getElementsByClassName("to-detail");this.structureDetailBtn=e[0],this.electronicStructDetailBtn=e[2],this.methodologyDetailBtn=e[1],this.thermalDetailBtn=e[3],this.vizBox=this.element.getElementsByClassName("viz-box")[0],this.bandPlotter=null,this.bsCalcIdBox=this.element.getElementsByClassName("footer-bs-calc")[0],this.dosPlotter=null,this.dosCalcIdBox=this.element.getElementsByClassName("footer-dos-calc")[0],this.heatPlotter=null,this.heatCalcIdBox=this.element.querySelector(".footer-heat-calc"),this.spinLegend=this.element.querySelector(".spin-legend"),n.addToInfoSystem(this.element),this.eStructCalcs={bs:null,dos:null}}attachAndSetEvents(e){e.appendChild(this.element),this._events()}_events(){this.structureDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.structure)}),this.electronicStructDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.electronicstruct)}),this.methodologyDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.methodology)}),this.thermalDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.thermalprops)})}getEStructChosenCalcs(){return this.eStructCalcs}setDetailViewsListener(e){this.detailViewsListener=e}setVisible(){this.element.style.display="block"}setMaterialData(){let e=d.getMaterialData();this.materialTitle.innerHTML=i.getMaterialTitle(e),this.materialId=e.id;let t="bulk"===e.system_type;if(this.systemType.textContent=e.system_type,this.structTypeField.style.display=t&&null!==e.structure_type?"block":"none",this.spaceGroupField.style.display=t?"block":"none",t&&(this.structTypeValue.textContent=e.structure_type,this.spaceGroupValue.textContent=e.space_group_number+" ("+e.space_group_international_short_symbol+")",n.addElementToInfoSystem(this.spaceGroupValue,"space-group.value:"+e.space_group_number)),this.similarityFinder&&this.similarityFinder.element.remove(),e.similarity){this.similarityFinder=new h({left:40,right:16,top:0,bottom:30});const t=this.element.querySelector(".similarity-finder");this.similarityFinder.setSimilarityData(e.similarity),t.appendChild(this.similarityFinder.element),this.similartyDataField=this.element.querySelector(".similarity-data-field"),n.addToInfoSystem(this.similartyDataField)}}_evaluateCalc(e){let t=0;switch("GGA"===e.functional_type&&(t+=100),e.has_band_structure&&e.has_dos&&(t+=10),e.code_name.trim()){case"FHI-aims":t+=3;break;case"VASP":t+=2;break;case"Quantum Espresso":t+=1}return t}setCalcsData(e){let t=d.getCalculations(),s=new Map,h=new Map,c=null,p=null,u=null,m=-1,y=-1;for(let e=0;e<t.length;e++){if(s.has(t[e].functional_type)){let i=s.get(t[e].functional_type);s.set(t[e].functional_type,++i)}else s.set(t[e].functional_type,1);let i=t[e].code_name.trim();if(h.has(i)){let e=h.get(i);h.set(i,++e)}else h.set(i,1);let n=this._evaluateCalc(t[e]);t[e].has_band_structure&&n>m&&(m=n,c=t[e]),t[e].has_dos&&n>y&&(y=n,p=t[e]),null===u&&t[e].has_thermal_properties&&(u=t[e])}null!==c&&(this.eStructCalcs.bs=c.id),null!==p&&(this.eStructCalcs.dos=p.id);let v=null;null!==c?v=c.id:null!==p&&(v=p.id),null===v?e.eStruct=null:d.isInAnyNotDisabledGroup(v)?e.eStruct=d.getGroupLeafId(v):e.eStruct=+v,null===u?e.thermalProps=null:d.isInAnyNotDisabledGroup(u.id)?e.thermalProps=d.getGroupLeafId(u.id):e.thermalProps=+u.id;let f="";s.forEach((e,t)=>{f+='<span info-sys-data="functional-type.value:'+t+'">'+e+" "+t+"</span> <br> "}),this.functional.innerHTML=f,n.addToInfoSystem(this.functional);let g="";if(h.forEach((e,t)=>{g+='<span info-sys-data="code-name.value:'+t+'">'+e+" "+t+"</span> <br> "}),this.code.innerHTML=g,n.addToInfoSystem(this.code),null===c&&null===p)document.getElementById("e-structure-ov").style.display="none",d.hasElecStructureData=!1;else{if(document.getElementById("e-structure-ov").style.display="block",d.hasElecStructureData=!0,null===this.bandPlotter&&(this.bandPlotter=new l,this.bandPlotter.attach(document.getElementById("band-plotter"),void 0,316)),null===this.dosPlotter&&(this.dosPlotter=new r({left:40,right:16,top:0,bottom:30}),this.dosPlotter.attach(document.getElementById("dos-plotter"),void 0,317)),null===c)this.bandPlotter.setNoData(),this.bsCalcIdBox.innerHTML="";else{let e=i.getMaterialCalcURL(c.material,c.id,"band_structure");a.show(),i.serverReq(e,e=>{if(200===e.target.status){let t=JSON.parse(e.target.response).band_structure;this.bandPlotter.setBandStructureData(t),this.bsCalcIdBox.innerHTML="From calculation <b>"+c.id+'</b><br><span style="font-size: 0.8em">('+c.functional_type+" - "+c.code_name+")</span>",2===t.segments[0].band_energies.length&&(this.spinLegend.style.display="block")}a.hide()})}if(null===p)this.dosPlotter.setNoData(),this.dosCalcIdBox.innerHTML="";else{let e=i.getMaterialCalcURL(p.material,p.id,"dos");a.show(),i.serverReq(e,e=>{if(200===e.target.status){let t=JSON.parse(e.target.response).dos;this.dosPlotter.setPoints(t,p),this.dosCalcIdBox.innerHTML="From calculation <b>"+p.id+'</b><br><span style="font-size: 0.8em">('+p.functional_type+" - "+p.code_name+")</span>",2===t.dos_values.length&&(this.spinLegend.style.display="block")}a.hide()})}}if(null===u)document.getElementById("thermal-props-ov").style.display="none",d.hasThermalData=!1;else if(document.getElementById("thermal-props-ov").style.display="block",d.hasThermalData=!0,null===this.heatPlotter&&(this.heatPlotter=new o,this.heatPlotter.attach(document.getElementById("heat-plotter"),void 0,317)),null===u)this.heatPlotter.setNoData(),this.heatCalcIdBox.innerHTML="";else{let e=i.getMaterialCalcURL(u.material,u.id,"specific_heat_cv");a.show(),i.serverReq(e,e=>{if(200===e.target.status){let t=JSON.parse(e.target.response).specific_heat_cv;this.heatPlotter.setData(t),this.heatCalcIdBox.innerHTML="From calculation <b>"+u.id+'</b></b> <span style="font-size: 0.8em">('+u.functional_type+" - "+u.code_name+")</span>"}a.hide()})}}}},function(e,t,s){s(0);e.exports=class{constructor(e){this.off=!0,this.element=document.createElement("span"),this.element.innerHTML+=`\n       <img src="${e}_off.png" width="24px"\n        style="margin-bottom: -1px; cursor: pointer"/>\n    `,this.image=this.element.querySelector("img"),this.element.addEventListener("click",t=>{this.off=!this.off;let s=this.off?e+"_off":e;this.image.setAttribute("src",s+".png"),this.listener(this.off)})}setListener(e){this.listener=e}}},function(e,t,s){let i=s(0);e.exports={SimilarityFinder:class{constructor(){this.folded=!0,this.element=document.createElement("span"),this.element.setAttribute("info-sys-data","similar-materials"),this.element.style="float : right; border: 2px solid #DDD; padding: 2px 2px 0px 3px;",this.element.innerHTML+=`\n        <span style=" vertical-align: 30%;" ><b>Similar materials</b></span>\n        <img style="cursor: pointer" src="${i.IMAGE_DIR}folded.png" />\n\n      <div class="vr-download-panel" style="position: relative; display: none;">\n\n      </div>\n    `,this.element.tabIndex="0",this.element.style.outline="none",this.foldingPanel=this.element.querySelector(".vr-download-panel"),this.foldBtn=this.element.querySelector("img"),this.foldBtn.addEventListener("click",e=>{this.folded=!this.folded,this.foldBtn.src=this.folded?i.IMAGE_DIR+"folded.png":i.IMAGE_DIR+"unfolded.png",this.foldingPanel.style.display=this.folded?"none":"block"}),this.element.addEventListener("blur",e=>{setTimeout(()=>{this.folded=!0,this.foldBtn.src=i.IMAGE_DIR+"folded.png",this.foldingPanel.style.display="none"},300)})}setSimilarityData(e){const t=Object.keys(e).map((function(t){return{data:e[t],key:t}}));t.sort((function(e,t){return e.data.Tc<t.data.Tc?1:e.data.Tc>t.data.Tc?-1:0}));const s=t.slice(0,5),n=document.createElement("table");n.setAttribute("class","similar-materials-panel-unfolded"),n.style="width: 230px; padding-left: 5px;",this.foldingPanel.appendChild(n);const a=document.createElement("tr");a.style="padding: 5px; ",a.innerHTML='<th style = "text-align: left;">Formula (space group)</th><th>:</th><th style = "text-align: left;">Tc</th>',n.appendChild(a),s.forEach((function(e){const t=e.key.split(":")[0],s=document.createElement("tr");s.style="padding: 5px; font-family: 'Arimo', sans-serif; font-size: 10pt; ";const a=`${window.location.toString().replace(/#.*$/,"")}#/material/${t}`;s.innerHTML=`<td><a href="${a}" target="_${t}" style="color:#777; font-family: 'Arimo', sans-serif; font-size: 10pt;">${i.getSubscriptedFormula(e.data.formula)} (${e.data.space_group_number})</a></td><td>:</td> <td>${e.data.Tc.toPrecision(3)}</td>`,n.appendChild(s)}))}}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(3),l=s(12),r=s(13),o=s(25),d=s(1);s(4);class h{constructor(e){this.groupCalcs=null,this.element=document.createElement("div"),this.element.innerHTML='\n    <div>\n\n      <div class="group-components" style="display: none">\n        <div style="padding: 10px 0 30px 10px; " class="eos-host">\n        </div>\n\n        <div style="padding-top: 10px; " class="calc-selector-host">\n        </div>\n      </div>\n\n      <div class="info-fields">\n        <div><b>Lattice constants</b></div>\n        <div class="latt-constants"></div>\n        <div class="volume-field"><b><span info-sys-data="cell-volume">Volume</span></b>:\n          <span class="volume-value" ></span>\n        </div>\n        \x3c!-- <div><b>Pressure</b>: <span class="" ></span>  </div>--\x3e\n        <div class="density-field"><b>Density</b>:\n            <div class="stats-fields" >\n              <span info-sys-data="mass-density">Mass density</span> =\n              <span class="mass-density-value" ></span>\n            </div>\n            <div class="stats-fields" >\n              <span info-sys-data="atomic-density">Atomic density</span> =\n              <span class="atomic-density-value" ></span>\n            </div>\n        </div>\n\n        <div class="energy-field"><b><span info-sys-data="energies">Energies</span></b> (code-specific)</div>\n        <div class="energy-descomp"> </div>\n\n        <div class="wyckoff-pos-calc-field" >\n          <b><span info-sys-data="free-wyckoff-parameters">Wyckoff sites</span></b>\n          (fractional coordinates)\n          <div class="wyckoff-pos-calc-table"> </div>\n        </div>\n\n      </div>\n\n    </div>\n    ',this.groupComponents=this.element.querySelector(".group-components"),this.calcSelector=new l("calc-selector-bar","60%"),this.element.querySelector(".calc-selector-host").appendChild(this.calcSelector.element),this.lattConstantsField=this.element.querySelector(".latt-constants"),this.volumeField=this.element.querySelector(".volume-field"),this.volumeValue=this.element.querySelector(".volume-value"),this.densityField=this.element.querySelector(".density-field"),this.massDensityValue=this.element.querySelector(".mass-density-value"),this.atomicDensityValue=this.element.querySelector(".atomic-density-value"),this.energyField=this.element.querySelector(".energy-field"),this.energyDescompValue=this.element.querySelector(".energy-descomp"),this.wyckoffPosField=this.element.querySelector(".wyckoff-pos-calc-field"),this.wyckoffPosTable=this.element.querySelector(".wyckoff-pos-calc-table"),this.eosViewer=new o,this.eosViewer.attach(this.element.querySelector(".eos-host"),320,280),this.eosViewer.setClickPointListener(e=>{this.groupCalcUpdate(e+"")}),a.addToInfoSystem(this.element),this._events()}_events(){this.calcSelector.setPrevListener(e=>{if(this.groupIndex>0)return this.groupCalcUpdate(this.groupCalcs[--this.groupIndex]+""),0===this.groupIndex}),this.calcSelector.setNextListener(e=>{if(this.groupIndex<this.groupCalcs.length-1)return this.groupCalcUpdate(this.groupCalcs[++this.groupIndex]+""),this.groupIndex===this.groupCalcs.length-1})}update(e,t){if(this.representative=e,this.isGroup=!1,void 0!==t){this.groupCalcs=Array.from(t.calcs),this.groupIndex=this.groupCalcs.indexOf(d.getCalcReprIntId(this.representative)),this.isGroup=!0,this.groupComponents.style.display="block",this.eosViewer.clear();let e,s=[],i=[];this.groupCalcs.forEach(e=>{let t=d.getCalc(e);s.push(t.cell_volume/1e-30);let n=555;t.energy.forEach(e=>{"Total E"===e.e_kind&&(n=e.e_val/1602176565e-28)}),i.push(n)}),d.getCalc(t.method_representative).energy.forEach(t=>{"Total E"===t.e_kind&&(e=t.e_val/1602176565e-28)}),this.eosViewer.draw(s,i,this.groupCalcs,e)}else this.groupComponents.style.display="none";this.groupCalcUpdate(e)}groupCalcUpdate(e){if(null!==e){let t=d.getCalcReprIntId(e);if(null!==this.groupCalcs&&(this.groupIndex=this.groupCalcs.indexOf(t),this.groupIndex>=0)){let e=t+" ("+(this.groupIndex+1)+"/"+this.groupCalcs.length+")";this.calcSelector.setState(e,0===this.groupIndex,this.groupIndex===this.groupCalcs.length-1),this.eosViewer.selectCalc(t)}let s="2D"===d.getMaterialData().system_type,i="bulk"===d.getMaterialData().system_type,a=d.getCalc(t),l=n.getNumberArray(a.lattice_parameters),r=s||i?`<div>b = ${n.m2Angstrom(l[1])}</div>`:"";r+=i?`<div>c = ${n.m2Angstrom(l[2])}</div>`:"";let o=s||i?`<div>&alpha; = ${n.rad2degree(l[3])}</div>`:"";o+=i?`<div>&beta; = ${n.rad2degree(l[4])}</div>\n          <div>&gamma; = ${n.rad2degree(l[5])}</div>`:"",this.lattConstantsField.innerHTML=`\n        <div style="float: left; ">\n          <div>a = ${n.m2Angstrom(l[0])}</div>\n          ${r}\n        </div>\n        <div style="float: left; padding-left: 40px;">\n          ${o}\n        </div>\n        <div style="clear: both;padding: 0"></div>\n      `,this.densityField.style.display=i?"block":"none",this.volumeField.style.display=i?"block":"none",i&&(this.volumeValue.innerHTML=n.m3ToAngstrom3(a.cell_volume),this.atomicDensityValue.innerHTML=n.toAngstromMinus3(a.atomic_density),this.massDensityValue.innerHTML=a.mass_density.toFixed(1)+" kg/m<sup>3</sup>");let h=n.serverReq(n.getCalcEnergiesURL(d.getMaterialData().id,a.id),()=>{let e=!1;if(200===h.status){let s=JSON.parse(h.response).results;for(var t=0;t<s.length;t++)"Total E"===s[t].e_kind&&(e=!0,this.energyDescompValue.innerHTML="<div>Total E = &nbsp; "+n.J2eV(s[t].e_val)+" eV</div>")}this.energyField.style.display=e?"block":"none",this.energyDescompValue.style.display=e?"block":"none"}),c=d.getMaterialData().has_free_wyckoff_parameters&&a.wyckoff_groups_json.length>0;if(this.wyckoffPosField.style.display=c?"block":"none",c){let e=new Map;a.wyckoff_groups_json.forEach(t=>{if(0!==Object.keys(t.variables).length){let s="";for(let e in t.variables)s+=e+" = "+t.variables[e].toFixed(2)+"<br>";let i=[];i.push(t.wyckoff_letter),i.push(s),e.has(t.element)?e.get(t.element).push(i):e.set(t.element,[i])}});let t="";e.forEach((e,s)=>{e.sort((e,t)=>e[0]>t[0]?1:-1);let i=!0;t+='<tr > <td style="width: 30%;">'+s+" </td>",e.forEach(e=>{i?(i=!1,t+='<td style="width: 30%; ">'+e[0]+'</td><td style="width: 40%;">'+e[1]+"</td></tr>"):t+="<tr><td> </td><td>"+e[0]+"</td><td>"+e[1]+"</td></tr>"})}),this.wyckoffPosTable.innerHTML='<table id="calc-wyckoff">'+t+"</table>"}}else console.log("THIS dOESNT BE REACHED")}}class c{constructor(e,t){this.calcMapByFunctional=e,this.hostElement=t,this.graphTrigger=null,this.viewType="text",this.functional=null,this.hostElement.innerHTML+='\n      <div style="float: left" >\n        <svg xmlns="http://www.w3.org/2000/svg" class="chart-tab"\n          viewBox="0 0 15 15" width="15" height="15" style="fill: #c7c7c7;">\n            <rect x="0" y="0"  width="2" height="15" />\n            <rect   x="3" y="5"  width="1.8" height="7"  />\n            <rect  x="6" y="3"  width="1.8" height="9"  />\n            <rect   x="9" y="6"  width="1.8" height="6"  />\n            <rect  x="12" y="2"  width="1.8" height="10"  />\n            <rect x="2" y="13"   width="13" height="2" />\n        </svg>\n        <svg xmlns="http://www.w3.org/2000/svg" class="text-tab"\n          viewBox="0 0 15 15" width="15" height="15" style="fill: #777;">\n            <rect x="0" y="1"   width="15" height="2.5" />\n            <rect   x="0" y="6"  width="15" height="2.5"  />\n            <rect  x="0" y="11"  width="15" height="2.5"  />\n        </svg>\n      </div>\n\n      <div class="functional-tabs" style="float: right">\n      </div>\n\n      <div style="clear: both;"></div>\n\n      <div class="content-placeholder" >\n\n        <div style="display: block" class="text-panel" >\n          <div><b>Lattice constants</b>:\n            <div class="stats-fields latt-constants-field" >\n            </div>\n          </div>\n          <div class="volume-field"><b><span info-sys-data="cell-volume">Volume</span></b> (&#197;<sup>3</sup>):\n            <div class="stats-fields volume-value" > </div>\n          </div>\n          <div class="density-field"><b>Density</b> :\n            <div >\n              <div class="stats-fields" >\n                <span info-sys-data="mass-density">Mass density</span> (kg/m<sup>3</sup>) =\n                <span class="mass-density-value" ></span>\n              </div>\n              <div class="stats-fields" >\n                <span info-sys-data="atomic-density">Atomic density</span> (&#197;<sup>-3</sup>) =\n                <span class="atomic-density-value" ></span>\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <div style="display:none" class="chart-panel" >\n          <div class="charts-placeholder" > </div>\n          <div class="charts-selector" >\n\n          </div>\n        </div>\n\n      </div>\n    ',this.chartTab=this.hostElement.querySelector(".chart-tab"),this.textTab=this.hostElement.querySelector(".text-tab"),this.functionalTabs=this.hostElement.querySelector(".functional-tabs"),this.chartPanel=this.hostElement.querySelector(".chart-panel"),this.textPanel=this.hostElement.querySelector(".text-panel"),this.lattConstantsField=this.hostElement.querySelector(".latt-constants-field"),this.volumeField=this.hostElement.querySelector(".volume-field"),this.volumeFieldValue=this.hostElement.querySelector(".volume-value"),this.densityField=this.hostElement.querySelector(".density-field"),this.massDensityValue=this.hostElement.querySelector(".mass-density-value"),this.atomicDensityValue=this.hostElement.querySelector(".atomic-density-value"),this.calcMapByFunctional.forEach((e,t)=>{this.functionalTabs.innerHTML+='<span class="tab" data-tab="'+t+'">'+t+"</span>"}),this.statsViewer=new r;let s=this.hostElement.querySelector(".charts-placeholder");this.statsViewer.attach(s,350,200),this.chartsSelector=this.hostElement.querySelector(".charts-selector"),this.build(e),this.chartTab.addEventListener("click",e=>{this.chartTab.style.fill="#777",this.viewType="chart",this.textTab.style.fill="#c7c7c7",this.chartPanel.style.display="block",this.textPanel.style.display="none"}),this.textTab.addEventListener("click",e=>{this.textTab.style.fill="#777",this.viewType="text",this.chartTab.style.fill="#c7c7c7",this.textPanel.style.display="block",this.chartPanel.style.display="none"}),this.functionalTabs.addEventListener("click",e=>{"tab"===e.target.className&&(this.statsViewer.clear(),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab",this.functional=e.target.getAttribute("data-tab"),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",this._setData())}),this.chartsSelector.addEventListener("click",e=>{if(0===e.target.className.indexOf("quantity")){this.statsViewer.clear();let t=e.target.getAttribute("data-quantity"),s=this.functionalQuantityMap.get(this.functional).get(t);this.statsViewer.drawPoints(s.data,s.label,s.min,s.max),this.chartsSelector.querySelector(".quantity-selected").className="quantity",e.target.className="quantity-selected"}})}_setData(){let e="2D"===d.getMaterialData().system_type,t="bulk"===d.getMaterialData().system_type,s=this.functionalQuantityMap.get(this.functional),i=e||t?`<div>b (&#197;) = ${s.get("lattice_b").html}</div>`:"";i+=t?`<div>c (&#197;) = ${s.get("lattice_c").html}</div>`:"",this.lattConstantsField.innerHTML=`\n      <div style="float: left; ">\n        <div>a (&#197;) = ${s.get("lattice_a").html}</div>\n        ${i}\n      </div>\n      <div style="float: left; padding-left: 40px;">\n        ${n.getLatticeAnglesValues(this.calcMapByFunctional.get(this.functional),e,t)}\n      </div>\n      <div style="clear: both;padding: 0"></div>\n      `;let a='\n    <span class="quantity-selected" data-quantity="lattice_a">a</span>\n    ';(e||t)&&(a+='<span class="quantity" data-quantity="lattice_b">b</span>'),this.densityField.style.display=t?"block":"none",this.volumeField.style.display=t?"block":"none",t&&(this.volumeFieldValue.innerHTML=s.get("volume").html,this.massDensityValue.innerHTML=s.get("mass_density").html,this.atomicDensityValue.innerHTML=s.get("atomic_density").html,a+='\n        <span class="quantity" data-quantity="lattice_c">c</span>\n        <span class="quantity" data-quantity="volume">volume</span>\n        <span class="quantity" data-quantity="mass_density">mass density</span>\n        <span class="quantity" data-quantity="atomic_density">atomic density</span>\n      '),this.chartsSelector.innerHTML=a;let l=s.get("lattice_a");this.statsViewer.drawPoints(l.data,l.label,l.min,l.max)}build(e){this.calcMapByFunctional=e,this.graphTrigger=null,this.statsViewer.clear(),this.unfoldedElement=null,this.functionalQuantityMap=new Map;for(var t=0;t<this.functionalTabs.children.length;t++)this.functionalTabs.children[t].style.display="none",this.functionalTabs.children[t].className="tab";this.calcMapByFunctional.forEach((e,t)=>{let s=n.getQuantityStatsMap(e);this.functionalQuantityMap.set(t,s),this.functionalTabs.querySelector('[data-tab="'+t+'"]').style.display="inline"});let s=Array.from(this.calcMapByFunctional.keys());(null===this.functional||s.indexOf(this.functional)<0)&&(this.functional=s[0]),this._setData(),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",a.addToInfoSystem(this.hostElement)}}e.exports=class extends i{constructor(){super("Structure"),this.groupsData,this.firstId,this.lastId,this.element.innerHTML+='\n\n      <div style="float: left; width: 36%;">\n        <div class="view-box">\n          <div class="title">Structure </div>\n          <div class="viz-box" style="height: 400px; position: relative"></div>\n\n          <div class="footer-flex-wrapper">\n\n            <div class="fields-container">\n              <div><b><span>System type</span></b>:\n                <span class="struct-field" ></span>\n              </div>\n              <div class="structure-type-field" style="display: none">\n                <b><span info-sys-data="structure-type">Structure type</span></b>:\n                <span class="structure-type-value" ></span>\n              </div>\n              <div class="structure-prototype-field" style="display: none">\n                <b><span info-sys-data="structure-prototype">Structure prototype</span></b>:\n                <span class="structure-prototype-value" ></span>\n              </div>\n              <div class="strukturbericht-field" style="display: none">\n                <b><span info-sys-data="strukturbericht">Strukturbericht designation</span></b>:\n                <span class="strukturbericht-value" ></span>\n              </div>\n            </div>\n\n            <div class="footer-flex" style="display: none">\n\n              <div class="fields-container"\n                style="flex-basis: 70%; border-right: 1px solid #E4E4E4; ">\n\n                <div>\n                  <b><span info-sys-data="crystal-system">Lattice</span></b>:\n                  <span class="lattice-value" ></span>\n                </div>\n                <div>\n                  <b><span info-sys-data="space-group">Space group</span></b>:\n                  <span class="space-group-value" ></span>\n                </div>\n                <div>\n                  <b><span info-sys-data="point-group">Point group</span></b>:\n                  <span class="point-group-value" ></span>\n                </div>\n              </div>\n\n              <div style="flex-basis: 30%; margin-left: 30px;">\n                <div class="fields-container">\n                  <div><b><span info-sys-data="wyckoff-position-population">Wyckoff sites</span></b></div>\n                  <div class="wyckoff-sites-value"> </div>\n                </div>\n              </div>\n\n            </div>\n\n          </div>\n\n        </div>\n      </div>\n\n      <div style="float: left; width: 36%;">\n        <div class="view-box">\n          <div class="title">Calculations</div>\n          <div class="navTreeWrapper"></div>\n\n          <div class="summary-title">Summary  </div>\n          <div style="font-size: 0.85em; text-align: center; padding: 4px;">Based on the calculations selected above</div>\n\n          <div class="info-fields summary-box">\n          \x3c!-- Lattice constants Cell volume, Density panel dynamically generated\n            --\x3e\n          </div>\n        </div>\n      </div>\n\n      <div style="float: right; width: 28%;">\n        <div class="calc-specifics-box">\n\n          <div style="padding-top: 10px; " >\n            <div class="tree-leaf-title"></div>\n          </div>\n\n          <div class="tree-leaf-viewer-host"></div>\n\n          </div>\n        </div>\n\n      </div>\n    </div>\n    ',this.navTreeWrapper=this.element.getElementsByClassName("navTreeWrapper")[0];let e=this.element.getElementsByClassName("struct-field");this.systemTypeField=e[0],this.structTypeField=this.element.querySelector(".structure-type-field"),this.structTypeValue=this.element.querySelector(".structure-type-value"),this.structPrototypeField=this.element.querySelector(".structure-prototype-field"),this.structPrototypeValue=this.element.querySelector(".structure-prototype-value"),this.strukturberichtField=this.element.querySelector(".strukturbericht-field"),this.strukturberichtValue=this.element.querySelector(".strukturbericht-value"),this.lowerBox=this.element.querySelector(".footer-flex"),this.latticeValue=this.element.querySelector(".lattice-value"),this.spaceGroupValue=this.element.querySelector(".space-group-value"),this.pointGroupValue=this.element.querySelector(".point-group-value"),this.wyckoffValue=this.element.querySelector(".wyckoff-sites-value"),this.summaryByFunctionals=null,this.leafTitle=this.element.querySelector(".tree-leaf-title"),this.summaryBox=this.element.querySelector(".summary-box"),this.calcSpecificsBox=this.element.querySelector(".calc-specifics-box"),this.treeLeafViewer=new h,this.element.querySelector(".tree-leaf-viewer-host").appendChild(this.treeLeafViewer.element),this.vizBox=this.element.querySelector(".viz-box"),a.addToInfoSystem(this.element)}setMaterialData(){let e=d.getMaterialData();if(super.setMaterialData(e),this.isBulk="bulk"===e.system_type,this.systemTypeField.textContent=e.system_type,this.structTypeField.style.display=this.isBulk&&null!==e.structure_type?"block":"none",this.structPrototypeField.style.display=this.isBulk&&null!==e.structure_prototype?"block":"none",this.strukturberichtField.style.display=this.isBulk&&null!==e.strukturbericht_designation?"block":"none",this.lowerBox.style.display=this.isBulk?"flex":"none",this.isBulk){this.structTypeValue.textContent=e.structure_type,this.structPrototypeValue.textContent=e.structure_prototype,this.strukturberichtValue.textContent=e.strukturbericht_designation,this.spaceGroupValue.textContent=e.space_group_number+" ("+e.space_group_international_short_symbol+")",this.pointGroupValue.textContent=e.point_group,this.latticeValue.textContent=e.crystal_system;let s=new Map;new Set;for(var t=0;t<e.elements.length;t++){let i=n.ELEMENTS[e.elements[t].label-1];if(s.has(i))s.get(i).add(e.elements[t].wyckoff);else{let n=new Set;n.add(e.elements[t].wyckoff),s.set(i,n)}}let i="";s.forEach((e,t)=>{let s=!0;i+="<tr> <td>"+t+": </td>",e.forEach(e=>{s?(s=!1,i+="<td>"+e+"</td></tr>"):i+="<tr><td> </td><td>"+e+"</td></tr>"})}),this.wyckoffValue.innerHTML="<table>"+i+"</table>"}a.addElementToInfoSystem(this.spaceGroupValue,"space-group.value:"+e.space_group_number),a.addElementToInfoSystem(this.latticeValue,"crystal-system.value:"+e.crystal_system),a.addElementToInfoSystem(this.pointGroupValue,"point-group.value:"+e.point_group)}updateSelection(e){if(e.size>0){this.summaryBox.style.visibility="visible";let t=new Set;e.forEach(e=>{let s;s=d.getGroups().has(e)?d.getCalc(d.getGroups().get(e).method_representative):d.getCalc(parseInt(e)),t.add(s)});let s=function(e){let t=new Map;return e.forEach(e=>{if(t.has(e.functional_type))t.get(e.functional_type).add(e);else{let s=new Set;s.add(e),t.set(e.functional_type,s)}}),t}(t);null===this.summaryByFunctionals?this.summaryByFunctionals=new c(s,this.summaryBox):this.summaryByFunctionals.build(s);let i=0;e.forEach(t=>{i++,1===i?this.firstId=t:i===e.size&&(this.lastId=t)})}else this.summaryBox.style.visibility="hidden"}updateMarkedLeaf(e){null!==e?(this.calcSpecificsBox.style.visibility="visible",d.getGroups().has(e)?this.leafTitle.innerHTML=e+" ("+d.getGroups().get(e).calcs.size+")":this.leafTitle.innerHTML=e):this.calcSpecificsBox.style.visibility="hidden",this.treeLeafViewer.update(e,d.getGroups().get(e))}}},function(e,t,s){"use strict";let i=s(2),n=s(5);e.exports=class extends n{constructor(){super({left:60,right:20,top:30,bottom:40}),this.tooltip,this.calcPointMap=new Map,this.pointSelected=null}draw(e,t,s,n){for(let e=0;e<t.length;e++)555!==t[e]&&(t[e]-=n);let a=function(e){let t=[];return e.forEach(e=>{555!==e&&t.push(e)}),t}(t),l=Math.min.apply(null,e),r=Math.max.apply(null,e),o=0,d=Math.max.apply(null,a);if(l===r)l-=1,r+=1;else{let e=r-l;l-=.1*e,r+=.1*e}if(o===d)o-=1,d+=1;else{let e=d-o;o-=.15*e,d+=.1*e}this.setRangeAndLabels("Volume (ų)",l,r,"E - Eₘᵢₙ (eV)",o,d),this.drawAxis(2,null);let h=this;function c(e,t){let s=h.y(t);i.addLine(e,0,s,-3,s,1);let n=-s/h.yRel+h.yMin;i.addText(e,-5,s+3,n.toFixed(3),"end","statisticsviewersteps")}c(this.plotArea,0),c(this.plotArea,d/2),c(this.plotArea,d),i.addLine(this.plotArea,0,this.y(0),this.plotRangeX,this.y(0),"zeroline"),i.addText(this.plotArea,this.x(r),this.y(0)+12,"Eₘᵢₙ: "+n.toFixed(3)+" eV","end","axis-steps");for(let n=0;n<e.length;n++){let a=0===n?"eos-viewer-sel":"eos-viewer",l=0===n?6:3,r=555===t[n]?20:this.y(t[n]),o=i.addPoint(this.plotArea,this.x(e[n]),r,l,a);0===n&&(this.pointSelected=o),o.addEventListener("mouseover",e=>{this.tooltip=i.addText(this.plotArea,e.target.getBBox().x+10,e.target.getBBox().y-10,"Calc "+s[n],"middle","tooltip")}),o.addEventListener("mouseout",e=>{i.removeElement(this.tooltip)}),o.addEventListener("click",e=>{this.clickPointListener(s[n])}),this.calcPointMap.set(s[n],o)}}selectCalc(e){this.pointSelected.setAttribute("class","eos-viewer"),this.pointSelected.setAttribute("r",3),this.pointSelected=this.calcPointMap.get(e),this.pointSelected.setAttribute("class","eos-viewer-sel"),this.pointSelected.setAttribute("r",6)}setClickPointListener(e){this.clickPointListener=e}x(e){return this.xRel*(e-this.xMin)}y(e){return-this.yRel*(e-this.yMin)}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(3),l=s(12),r=s(13),o=s(27),d=(new(s(5)),s(1)),h=s(4);class c{constructor(e,t){this.calcMapByFunctional=e,this.hostElement=t,this.viewType="text",this.functional=null,this.hostElement.innerHTML+='\n      <div style="float: left" >\n        <svg xmlns="http://www.w3.org/2000/svg" class="chart-tab"\n          viewBox="0 0 15 15" width="15" height="15" style="fill: #c7c7c7;">\n            <rect x="0" y="0"  width="2" height="15" />\n            <rect   x="3" y="5"  width="1.8" height="7"  />\n            <rect  x="6" y="3"  width="1.8" height="9"  />\n            <rect   x="9" y="6"  width="1.8" height="6"  />\n            <rect  x="12" y="2"  width="1.8" height="10"  />\n            <rect x="2" y="13"   width="13" height="2" />\n        </svg>\n        <svg xmlns="http://www.w3.org/2000/svg" class="text-tab"\n          viewBox="0 0 15 15" width="15" height="15" style="fill: #777;">\n            <rect x="0" y="1"   width="15" height="2.5" />\n            <rect   x="0" y="6"  width="15" height="2.5"  />\n            <rect  x="0" y="11"  width="15" height="2.5"  />\n        </svg>\n      </div>\n\n      <div class="functional-tabs" style="float: right">\n      </div>\n\n      <div style="clear: both;"></div>\n\n      <div class="content-placeholder" >\n\n        <div style="display: block" class="text-panel" >\n\n          <div><b><span info-sys-data="band gap">Band gap</span></b> (eV):\n            <div class="stats-fields summary-bandgap-field" > </div>\n          </div>\n        </div>\n\n        <div style="display:none" class="chart-panel" >\n          <div class="charts-placeholder" > </div>\n        </div>\n\n      </div>\n    ',this.chartTab=this.hostElement.querySelector(".chart-tab"),this.textTab=this.hostElement.querySelector(".text-tab"),this.functionalTabs=this.hostElement.querySelector(".functional-tabs"),this.chartPanel=this.hostElement.querySelector(".chart-panel"),this.textPanel=this.hostElement.querySelector(".text-panel"),this.bandgapField=this.hostElement.querySelector(".summary-bandgap-field"),this.statsViewer=new r;let s=this.hostElement.querySelector(".charts-placeholder");this.statsViewer.attach(s,250,150),this.build(e),this.chartTab.addEventListener("click",e=>{this.chartTab.style.fill="#777",this.viewType="chart",this.textTab.style.fill="#c7c7c7",this.chartPanel.style.display="block",this.textPanel.style.display="none"}),this.textTab.addEventListener("click",e=>{this.textTab.style.fill="#777",this.viewType="text",this.chartTab.style.fill="#c7c7c7",this.textPanel.style.display="block",this.chartPanel.style.display="none"}),this.functionalTabs.addEventListener("click",e=>{"tab"===e.target.className&&(this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab",this.functional=e.target.getAttribute("data-tab"),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",this._setData())})}_setData(){let e=this.functionalBandGapMap.get(this.functional);this.bandgapField.innerHTML=e.html,this.statsViewer.clear(),this.statsViewer.drawPoints(e.data,e.label,e.min,e.max)}build(e){0===e.size?(this.hostElement.style.display="none",this.hostElement.previousElementSibling.style.display="none"):(this.hostElement.style.display="block",this.hostElement.previousElementSibling.style.display="block"),this.unfoldedElement=null,this.functionalTabs.innerHTML="",this.functionalBandGapMap=new Map,e.forEach((e,t)=>{let s=[];e.forEach(e=>{s.push(e.band_gap/1602176565e-28)});let i={};i.data=s,i.min=Math.min.apply(null,s),i.max=Math.max.apply(null,s),i.equal=i.min===i.max,i.label="band gap",i.html=n.getAverage(i.data).toFixed(2)+' &nbsp; <span style="font-size: 0.9em">['+i.min.toFixed(2)+" , "+i.max.toFixed(2)+"]</span>",this.functionalBandGapMap.set(t,i);let a="tab";null===this.functional&&(this.functional=t),this.functional===t&&(this._setData(),a="tab-selected"),this.functionalTabs.innerHTML+='<span class="'+a+'" data-tab="'+t+'">'+t+"</span>"}),a.addToInfoSystem(this.hostElement)}}class p{constructor(e){this.hostElement=e,this.bzViewer=null}setCalcData(e,t){null===this.bzViewer&&(this.bzViewer=new BrillouinZoneViewer(this.hostElement)),this.bzViewer.load(this._getBZDataForViewer(e,t)),this.hostElement.style.visibility="visible"}setNoData(){this.hostElement.style.visibility="hidden"}_getBZDataForViewer(e,t){let s=[],i=[];return t.forEach(e=>{s.push(e.band_segm_labels),i.push(e.band_k_points)}),{vertices:e.vertices,faces:e.faces,basis:e.basis,labels:s,segments:i}}}e.exports=class extends i{constructor(){super("Electronic Structure"),this.firstId,this.lastId,this.element.innerHTML+='\n      <div style="float: left; width: 30%;">\n        <div class="view-box">\n          <div class="title">Calculations </div>\n          <div class="navTreeWrapper"></div>\n\n\n          <div class="summary-title">Summary</div>\n          <div class="footer summary-box" style="border-top: 0">\n          </div>\n        </div>\n      </div>\n\n      <div style="float: right; width: 70%;">\n        <div class="view-box e-structure-box">\n\n          <div class="title">Electronic structure</div>\n\n          <div style="padding-top: 10px;">\n            <div class="calc-selector-host"></div>\n          </div>\n\n\n          <div>\n\n            <div  style="padding: 30px  100px 20px 100px; ">\n              <div class="info-fields-label" style="float: left; width: 54%; ">\n                <span info-sys-data="band-structure">Band structure</span>\n              </div>\n              <div class="info-fields-label" style="float: left;">\n                <span info-sys-data="DOS">DOS</span>\n              </div>\n              <div style="clear: both;"></div>\n\n              <div class="calc-bs-dos-plotter" >\n              </div>\n\n              <div>\n              <div class="band-gap-field" style="float: left; width: 56%; text-align: right">\n                <b><span info-sys-data="band-gap">Band gap</span></b>:\n                <span class="band-gap-value" ></span>\n              </div>\n              <div style="clear: both;"></div>\n\n              </div>\n            </div>\n\n            <div class="spin-legend" style="font-size: 0.9em; padding: 0 30px 10px; display: none">\n              <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin1"/></svg>\n              Spin <span style=\'font-size: 1.1em\'>⇧</span>  &nbsp;&nbsp;&nbsp;\n              <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin2"/></svg>\n              Spin <span style=\'font-size: 1.1em\'>⇩</span>\n            </div>\n\n          </div>\n\n          <div class="footer lower-section">\n\n            <div  style="float: left">\n              <div style="padding: 16px; ">\n                <div class="info-fields-label" >\n                  <span info-sys-data="brillouin-zone-viewer">Brillouin zone</span>\n                </div>\n                <div class="bz-viewer-wrapper" style="width: 400px; height: 400px">\n                </div>\n              </div>\n            </div>\n\n            <div class="band" style="float: right; width: 40%;">\n              <div style="padding: 16px; ">\n                <div class="info-fields-label" >\n                  \x3c!-- <span info-sys-data="fermi-surface">Fermi surface </span> --\x3e\n                </div>\n                <div class="fermi-box" >      </div>\n              </div>\n            </div>\n\n            <div style="clear: both;"></div>\n\n          </div> \x3c!-- footer --\x3e\n\n        </div>\n\n      </div> \x3c!-- view-box --\x3e\n    ',this.navTreeWrapper=this.element.getElementsByClassName("navTreeWrapper")[0],this.calcSelector=new l("calc-selector-bar","70%"),this.element.querySelector(".calc-selector-host").appendChild(this.calcSelector.element),this.rightBox=this.element.querySelector(".e-structure-box"),this.summaryByFunctionals=null,this.bsDosPlotter=new o,this.bandGapField=this.element.querySelector(".band-gap-field"),this.bandGapValue=this.element.querySelector(".band-gap-value"),this.spinLegend=this.element.querySelector(".spin-legend"),this.lowerSection=this.element.querySelector(".lower-section"),this.fermiBox=this.element.getElementsByClassName("fermi-box")[0],n.loadLib("lib/x3dom.js"),this.bzViewerWrapper=this.element.querySelector(".bz-viewer-wrapper"),this.bzViewerWrapper=new p(this.bzViewerWrapper),a.addToInfoSystem(this.element),this._events()}_events(){this.calcSelector.setPrevListener(e=>{if(this.groupIndex>0){let e=this.groupCalcs[--this.groupIndex];return this._loadGraphData(e),this._updateSelectorState(e),0===this.groupIndex}}),this.calcSelector.setNextListener(e=>{if(this.groupIndex<this.groupCalcs.length-1){let e=this.groupCalcs[++this.groupIndex];return this._loadGraphData(e),this._updateSelectorState(e),this.groupIndex===this.groupCalcs.length-1}})}updateSelection(e){if(e.size>0){this.rightBox.style.visibility="visible";let t=function(e){let t=new Map;return e.forEach(e=>{let s=d.getCalc(d.getCalcReprIntId(e));if(s.has_band_structure)if(t.has(s.functional_type))t.get(s.functional_type).add(s);else{let e=new Set;e.add(s),t.set(s.functional_type,e)}}),t}(e);null===this.summaryByFunctionals?this.summaryByFunctionals=new c(t,this.element.querySelector(".summary-box")):this.summaryByFunctionals.build(t);let s=0;e.forEach(t=>{s++,1===s&&(this.firstId=t),s===e.size&&(this.lastId=t)})}else this.rightBox.style.visibility="hidden"}updateMarkedLeaf(e){if(this.groupCalcs=null,null!==e){if(d.getGroups().has(e)){this.groupCalcs=Array.from(d.getGroups().get(e).calcs);let t=d.getCalcReprIntId(e);this.groupIndex=this.groupCalcs.indexOf(t),this._updateSelectorState(t)}else this.calcSelector.setState(e,!0,!0);this._loadGraphData(d.getCalcReprIntId(e))}else this.calcSelector.setState("NO SELECTION",!0,!0)}_updateSelectorState(e){let t=e+" ("+(this.groupIndex+1)+"/"+this.groupCalcs.length+")";this.calcSelector.setState(t,0===this.groupIndex,this.groupIndex===this.groupCalcs.length-1)}_loadGraphData(e){let t=d.getCalc(e);if(this.bsDosPlotter.isAttached()||this.bsDosPlotter.attach(this.element.querySelector(".calc-bs-dos-plotter"),void 0,360),null===t||!t.has_band_structure&&!t.has_dos)this.bsDosPlotter.setNoData(),this.bzViewerWrapper.setNoData(),this.bandGapField.style.display="none",this.lowerSection.style.display="none";else{h.show();let e=d.getMaterialData().id;n.serverReq(n.getMaterialCalcURL(e,t.id,"dos"),s=>{let i=JSON.parse(s.target.response).dos;n.serverReq(n.getMaterialCalcURL(e,t.id,"band_structure"),s=>{let a=JSON.parse(s.target.response).band_structure;n.serverReq(n.getMaterialCalcURL(e,t.id,"brillouin_zone_json"),e=>{let s=JSON.parse(e.target.response).brillouin_zone_json;(function(e,t){if(void 0!==e&&2===e.segments[0].band_energies.length)return!0;if(void 0!==t&&2===t.dos_values.length)return!0;return!1})(a,i)&&(this.spinLegend.style.display="block"),this.bsDosPlotter.setUpAndData(a,i,t),t.has_band_structure?(this.bandGapField.style.display="block",this.bandGapValue.textContent=n.J2eV(t.band_gap,2)+" eV ",s?(this.lowerSection.style.display="block",this.bzViewerWrapper.setCalcData(s,a.segments)):(this.lowerSection.style.display="none",this.bzViewerWrapper.setNoData())):(this.lowerSection.style.display="none",this.bandGapField.style.display="none",this.bzViewerWrapper.setNoData()),h.hide()})})})}}setPrevCalcListener(e){this.prevCalcListener=e}setNextCalcListener(e){this.nextCalcListener=e}}},function(e,t,s){let i=s(7),n=s(10);s(2);e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("style","margin: 0 auto"),this.parentElement=null,this.bsPlotter=new i,this.dosPlotter=new n({left:4,right:16,top:0,bottom:30}),this.dosYAxisLabeled=!1}attach(e,t,s){e.appendChild(this.element),this.bsPlotter.attach(this.element,s,s),this.height=s,this.dosPlotter.attach(this.element,this.height/2+20,s),this.parentElement=e}isAttached(){return null!==this.parentElement}setUpAndData(e,t,s){let i;if(this.hasDispData=null!=e,this.hasDosData=null!=t,i=!(!this.hasDosData||this.hasDispData),this.dosYAxisLabeled!==i){this.element.removeChild(this.dosPlotter.svg);let e=i?40:4;this.dosPlotter=new n({left:e,right:16,top:0,bottom:30});let t=this.height/2+e;this.dosPlotter.attach(this.element,t,this.height)}this.dosYAxisLabeled=i,this.hasDispData?(this.bsPlotter.setBandStructureData(e),this.hasDosData&&this.bsPlotter.setRepaintListener((e,t)=>{this.dosPlotter.setYZoomAndOffset(e,t),this.dosPlotter.repaint()})):this.bsPlotter.setNoData(),this.hasDosData?(this.dosPlotter.setPoints(t,s),this.hasDispData&&(this.bsPlotter.setExternalYAxisMax(this.dosPlotter.getYAxisMax()),this.dosPlotter.setRepaintListener((e,t)=>{this.bsPlotter.setYZoomAndOffset(e,t),this.bsPlotter.repaint()}),this.dosPlotter.svg.removeChild(this.dosPlotter.yLabelText),this.dosPlotter.yLabelText=null)):this.dosPlotter.setNoData(),this.dosPlotter.setYAxisLabelsVisibility(i)}setNoData(){this.bsPlotter.setNoData(),this.dosPlotter.setNoData()}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(3),l=s(1),r=s(29);const o=new Map([["single point","Single point"],["GW calculation","GW"],["geometry optimization","Geometry optimization"],["molecular dynamics","Molecular dynamics"],["phonon calculation","Phonon"],["equation of state","Equation of state"],["parameter variation","Parameter variation"],["QHA calculation","QHA"]]),d=new Map([["LDA","LDA"],["GGA","GGA"],["meta-GGA","meta-GGA"],["hybrid-GGA","hybrid-GGA"],["meta-hybrid-GGA","meta-hybrid-GGA"],["HF","HF"]]),h=new Map([["exciting","exciting"],["VASP","VASP"],["FHI-aims","FHI-aims"]]),c=new Map([["full all electron","Full potential"],["pseudopotential","Pseudo potential"]]),p=new Map([["Numeric AOs","Numeric AOs"],["Gaussians","Gaussians"],["(L)APW+lo","(L)APW+lo"],["Plane waves","Plane waves"]]);class u{constructor(e){this.element=document.createElement("div"),this.element.className=e,this.filtersOn=[],this.folded=!0,this.element.innerHTML+=`\n      <div>\n        <div style="display: flex; justify-content: flex-end;">\n          <div class="filter-groups-c-folded" >\n            <span style="vertical-align: top;">Filtering &nbsp;&nbsp;</span>\n          </div>\n          <div class="filter-c-btn" >\n             <img src="${n.IMAGE_DIR}folded.png" />\n            \x3c!--<button class="on">filter</button> --\x3e\n          </div>\n        </div>\n        <div class="filter-groups-c-unfolded" style="display: none">\n          <table style="width: 100%;">\n            <thead>\n            <tr>\n              <th style="width: 12%;"> </th>\n              <th style="width: 16%;">\n                <span>Type</span>\n              </th>\n              <th style="width: 18%;">\n                <span info-sys-data="functional-type">Density functional</span>\n              </th>\n              <th style="width: 12%;">\n                <span info-sys-data="code-name">Code</span>\n              </th>\n              <th style="width: 16%;">\n                <span info-sys-data="pseudopotential-type">Potential</span>\n              </th>\n              <th style="width: 11%;">\n                <span info-sys-data="basis-set-type">Basis set</span>\n              </th>\n              \x3c!-- <th style="width: 9%;"> </th> --\x3e\n            </tr>\n            </thead>\n            <tbody>\n              <tr id="filter-items-row"></tr>\n            </tbody>\n          </table>\n        </div>\n      </div>\n    `,this.unfoldedPanel=this.element.querySelector(".filter-groups-c-unfolded"),this.filterItemsRow=this.element.querySelector("#filter-items-row"),this.foldBtn=this.element.querySelector("img"),this.foldBtn.addEventListener("click",e=>{this.folded=!this.folded,this.foldBtn.src=this.folded?n.IMAGE_DIR+"folded.png":n.IMAGE_DIR+"unfolded.png",this.unfoldedPanel.style.display=this.folded?"none":"block"}),this.element.addEventListener("click",e=>{if("INPUT"===e.target.tagName){let t=this.filtersOn.indexOf(e.target.value);t>=0?this.filtersOn.splice(t,1):this.filtersOn.push(e.target.value),this.itemListener(this.filtersOn)}})}addGroupsItems(e){let t=new Map,s=new Map,i=new Map,n=new Map,a=new Map;e.forEach(e=>{t.has(e.type)||t.set(e.type,o.get(e.type)),s.has(e.functional)||s.set(e.functional,d.get(e.functional)),i.has(e.code)||i.set(e.code,h.get(e.code)),n.has(e.potential)||n.set(e.potential,c.get(e.potential)),a.has(e.basisSet)||a.set(e.basisSet,p.get(e.basisSet))}),this.filterItemsRow.innerHTML="<td></td>",this.filtersOn=[],this.addGroupItems(t),this.addGroupItems(s),this.addGroupItems(i),this.addGroupItems(n),this.addGroupItems(a)}addGroupItems(e){let t="<td>  ";e.forEach((e,s)=>{this.filtersOn.push(s),t+='<input type="checkbox" value="'+s+'" checked><span style="vertical-align: 20%">'+e+"</span> &nbsp;&nbsp; <br> "}),this.filterItemsRow.innerHTML+=t+"</td>"}setItemListener(e){this.itemListener=e}}e.exports=class extends i{constructor(){super("Methodology"),this.sortedCalcs=[],this.markedCalc=null,this.element.innerHTML+='\n\n      <div>\n        <div class="view-box">\n          <div class="title">Methodology</div>\n\n          <div class="filter-placeholder"></div>\n\n          <div class="dataTableWrapper"></div>\n        </div>\n      </div>\n    ',this.dataTableWrapper=this.element.querySelector(".dataTableWrapper"),this.dataTableWrapper.innerHTML+='\n      <table id="methodology-data">\n        <thead>\n        <tr>\n          <th style="width: 12%;">\n            <span>Calculation ID</span>\n            <span class="sorting-button"></span>\n          </th>\n          <th style="width: 16%;">\n            <span>Type</span>\n            <span class="sorting-button"></span>\n          </th>\n          <th style="width: 18%;">\n            <span info-sys-data="functional-type">Density functional</span>\n            <span class="sorting-button"></span>\n          </th>\n          <th style="width: 12%;">\n            <span info-sys-data="code-name">Code</span>\n            <span class="sorting-button"></span>\n          </th>\n          <th style="width: 16%;">\n            <span info-sys-data="pseudopotential-type">Potential</span>\n            <span class="sorting-button"></span>\n          </th>\n          <th style="width: 11%;">\n            <span info-sys-data="basis-set-type">Basis set</span>\n            <span class="sorting-button"></span>\n          </th>\n          \x3c!-- <th style="width: 8%;">\n            <span info-sys-data="basis-set-type">Link</span>\n\n          </th>\n          <th style="width: 8%;">\n            <span info-sys-data="basis-set-type">RV</span>\n\n          </th> --\x3e\n        </tr>\n        </thead>\n        <tbody>\n        </tbody>\n      </table>\n    ',this.tbody=this.dataTableWrapper.querySelector("tbody"),this.moreInfoRow=document.createElement("tr"),this.moreInfoRow.className="moreinfo",this.moreInfoCalcId=null,this.filterComponent=new u("meth-filter-component"),this.element.querySelector(".filter-placeholder").appendChild(this.filterComponent.element),this.filterComponent.setItemListener(e=>{this.sortedCalcs.forEach(t=>{let s=t.dataCalcProps.split(","),i=!0;s.forEach(t=>{e.indexOf(t)<0&&(i=!1)}),t.visible=!!i}),this._render()}),this.sortingButtonWrappers=this.dataTableWrapper.querySelectorAll(".sorting-button"),this.sortingButtons=[];let e=new Map([["id",void 0],["type",void 0],["functional",void 0],["code",void 0],["potential",void 0],["basisSet",void 0]]).keys();this.sortingButtonWrappers.forEach(t=>{let s=e.next().value,i=new r(s);t.appendChild(i.element),this.sortingButtons.push(i),i.setListener((e,t)=>{this.sortingButtons.forEach(e=>{e!==i&&e.init()}),this._sortRowsCalcDataBy(e,t),this._render()})}),a.addToInfoSystem(this.element)}updateSelection(e){this.sortedCalcs=[],l.getCalculations().forEach(e=>{let t=e.run_type;l.getGroups().has(e.id)&&(t=l.getGroupType(e.id)),this.sortedCalcs.push({id:e.id,type:t,functional:e.functional_type,code:e.code_name,potential:e.core_electron_treatment,basisSet:e.basis_set_type,dataCalcProps:t+","+e.functional_type+","+e.code_name+","+e.core_electron_treatment+","+e.basis_set_type,visible:!0})}),this.filterComponent.addGroupsItems(this.sortedCalcs),this._sortRowsCalcDataBy(!0,"id"),this._render()}_sortRowsCalcDataBy(e,t){this.sortedCalcs.sort((s,i)=>s[t]<i[t]?e?-1:1:s[t]>i[t]?e?1:-1:0)}updateMarkedLeaf(e){}_render(){let e="";function t(e){return null==e?"":"("+e+")"}this.sortedCalcs.forEach(s=>{s.visible&&(e+=function(e){let s=l.getCalc(e.id),i=e.type,n="";null!==s.calculation_pid&&void 0!==s.calculation_pid&&(n='<a href="https://repository.nomad-coe.eu/NomadRepository-1.1/views/calculation.zul?pid='+s.calculation_pid+'" target="blank"> <img src="img/download.svg" height="20px" /> </a>');let a=l.getMaterialData().id,r=s.id,o=`<a href="https://labdev-nomad.esc.rzg.mpg.de/remotevis/cM/start/${a}+${r}" `+'target="blank"><img src="img/monitor_icon.png" height="20px" /> </a>';return`\n        <tr data-calc-id="${s.id}" class="data-row">\n        <td>${s.id}</td>\n        <td>\n          <span info-sys-data="calculation-type.value:${i}">\n          ${i}</span>\n        </td>\n        <td>\n          <span info-sys-data="functional-type.value:${s.functional_type}">\n            ${s.functional_type}</span>\n          ${t(s.functional_long_name)}\n        </td>\n        <td>\n          <span info-sys-data="code-name.value:${s.code_name}">\n            ${s.code_name}</span>\n           ${t(s.code_version)}\n        </td>\n\n        <td>\n          <span info-sys-data="core-electron-treatment.value:${s.core_electron_treatment}">\n          ${d=s.core_electron_treatment,"pseudopotential"===d?"pseudopotential":"full all electron"===d?"full potential":d}</span>\n        </td>\n        <td>\n          <span info-sys-data="basis-set-type.value:${s.basis_set_type}">\n            ${s.basis_set_type}</span>\n           ${t(s.basis_set_quality_quantifier)}\n        </td>\n        \x3c!--\n        <td style="padding-top: 8px;padding-bottom: 4px;">${n}\n        </td>\n\n        <td style="padding-top: 8px;padding-bottom: 4px;">${o}\n        </td>--\x3e\n\n        </tr>`;var d}(s))}),this.tbody.innerHTML=e,a.addToInfoSystem(this.tbody)}}},function(e,t,s){s(0);e.exports=class{constructor(e){this.id=e,this.ascending=!0,this.element=document.createElement("span"),this.element.innerHTML+='\n       <img src="img/sorting_init.png" width="12px"\n        style="margin-bottom: -1px; cursor: pointer"/>\n    ',this.image=this.element.querySelector("img"),"id"===e&&this.image.setAttribute("src","img/sorting_ascending.png"),this.element.addEventListener("click",e=>{this.ascending=!this.ascending,this.image.setAttribute("src","img/sorting_"+(this.ascending?"ascending":"descending")+".png"),this.listener(this.ascending,this.id)})}init(){this.image.setAttribute("src","img/sorting_init.png")}setListener(e){this.listener=e}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(3),l=s(1),r=s(4),o=s(11),d=s(31),h=s(32);e.exports=class extends i{constructor(){super("Thermal Properties"),this.firstId,this.lastId,this.element.innerHTML+='\n      <div style="float: left; width: 30%;">\n        <div class="view-box">\n          <div class="title">Calculations </div>\n          <div class="navTreeWrapper"></div>\n        </div>\n      </div>\n\n      <div style="float: right; width: 70%;">\n        <div class="view-box thermal-properties-box">\n\n          <div class="title">Vibrational and thermal properties</div>\n\n          <div style="padding-top: 10px;">\n            <div class="tree-leaf-title"></div>\n          </div>\n\n          <div class="calc-disp-dos-plotter" style="padding: 30px 100px; ">\n            <div class="info-fields-label" style="float: left; width: 52%; ">\n              <span info-sys-data="phonon-dispersion">Phonon dispersion </span>\n            </div>\n            <div class="info-fields-label" style="float: left;">\n              <span info-sys-data="phonon-DOS">Phonon DOS  </span>\n            </div>\n            <div style="clear: both;"></div>\n          </div>\n\n\n          <div class="band" >\n            <div style="padding: 30px 50px; display: flex; justify-content: space-around; ">\n\n              <div >\n                <div class="info-fields-label" >\n                  <span info-sys-data="specific-heat-cv">Specific heat</span>\n                </div>\n                <div class="heat-plotter" >      </div>\n              </div>\n\n              <div>\n                <div class="info-fields-label" >\n                  <span info-sys-data="helmholtz-free-energy">Helmholtz free energy</span>\n                </div>\n                <div class="helmholtz-plotter" >      </div>\n              </div>\n\n            </div>\n          </div>\n\n        </div>\n      </div>\n    ',this.navTreeWrapper=this.element.getElementsByClassName("navTreeWrapper")[0],this.rightBox=this.element.querySelector(".thermal-properties-box"),this.leafTitle=this.element.querySelector(".tree-leaf-title"),this.dispDosPlotter=new h,this.heatPlotter=new o,this.helmholtzPlotter=new d,a.addToInfoSystem(this.element)}_events(){super._events()}updateSelection(e){if(e.size>0){this.rightBox.style.visibility="visible";let t=0;e.forEach(s=>{t++,1===t?this.firstId=s:t===e.size&&(this.lastId=s)})}else this.rightBox.style.visibility="hidden"}updateMarkedLeaf(e){if(null===e)return void(this.leafTitle.innerHTML="NO SELECTION");l.getGroups().has(e)?this.leafTitle.innerHTML=e+" ("+l.getGroups().get(e).calcs.size+")":this.leafTitle.innerHTML=e;let t=l.getCalc(l.getCalcReprIntId(e));if(this.dispDosPlotter.isAttached()||(this.dispDosPlotter.attach(this.element.querySelector(".calc-disp-dos-plotter"),void 0,360),this.heatPlotter.attach(this.element.querySelector(".heat-plotter"),317,317),this.helmholtzPlotter.attach(this.element.querySelector(".helmholtz-plotter"),317,317)),null!==t&&(t.has_phonon_dos||t.has_phonon_dispersion||t.has_thermal_properties)){r.show();let e=l.getMaterialData().id;n.serverReq(n.getMaterialCalcURL(e,t.id,"phonon_dos"),s=>{let i=JSON.parse(s.target.response).phonon_dos;n.serverReq(n.getMaterialCalcURL(e,t.id,"phonon_dispersion"),s=>{let a=JSON.parse(s.target.response).phonon_dispersion;this.dispDosPlotter.setUpAndData(a,i),t.has_thermal_properties?(n.serverReq(n.getMaterialCalcURL(e,t.id,"specific_heat_cv"),e=>{let t=JSON.parse(e.target.response).specific_heat_cv;this.heatPlotter.setData(t)}),n.serverReq(n.getMaterialCalcURL(e,t.id,"helmholtz_free_energy"),e=>{let t=JSON.parse(e.target.response).helmholtz_free_energy;this.helmholtzPlotter.setData(t)})):(this.heatPlotter.setNoData(),this.helmholtzPlotter.setNoData()),r.hide()})})}else this.dispDosPlotter.setNoData(),this.heatPlotter.setNoData(),this.helmholtzPlotter.setNoData()}setPrevCalcListener(e){this.prevCalcListener=e}setNextCalcListener(e){this.nextCalcListener=e}}},function(e,t,s){"use strict";let i=s(2),n=s(5);e.exports=class extends n{constructor(){super({left:60,right:16,top:10,bottom:32}),this.tooltip}setData(e){this.clear();let t=e.temperature.indexOf(600)+1,s=e.value.slice(0,t),n=e.temperature.slice(0,t),a=Math.max.apply(null,s),l=Math.min.apply(null,s),r=1e3*Math.ceil(a/1e3),o=1e3*Math.floor(l/1e3);this.setRangeAndLabels("T (K)",0,600,"F (J/kg)",o,r),this.drawAxis(4,null,0);let d="";n.forEach((e,t)=>{let i=s[t];d+=" "+this.xRel*e+" -"+this.yRel*(i-this.yMin)}),i.addPolyline(this.plotArea,d,"plotSpin1")}}},function(e,t,s){let i=s(7),n=s(8),a=s(2),l=s(0);class r extends n{constructor(){super({left:4,right:16,top:0,bottom:30}),this.outOfRangeColorActivated=!1}attach(e,t,s){super.attach(e,s/2+this.margins.left,s)}setPoints(e){this.pointsSpin1=[],this.pointsSpin2=[],this._reset();let t=e.dos_values[0],s=null;2===e.dos_values.length&&(s=e.dos_values[1]);let i=e.dos_energies,n=[],r=[];for(var o=0;o<i.length;o++){let e,a=5034117012222e10*i[o],l=.029979*t[o];null!==s&&(e=.029979246*s[o]),n.push(l),null!==s&&n.push(e),r.push(a),this.pointsSpin1.push({x:l,y:a}),null!==s&&this.pointsSpin2.push({x:e,y:a})}let d=Math.max.apply(null,n),h=Math.max.apply(null,r),c=Math.min.apply(null,r),p=l.generateDiagramSteps(d),u=p[0],m=p[1];this.setAxisRangeAndLabels(null,0,u[u.length-1],null,-50,320,c,h,100),a.addText(this.axisGroup,this.plotRangeX/2,this.margins.bottom,"DOS (states/cm⁻¹)","middle","axis-steps-big");for(let e=0;e<u.length;e++){let t=this.plotRangeX*u[e]/u[u.length-1];a.addLine(this.axisGroup,t,0,t,3,1),a.addText(this.axisGroup,t,13,0===e?"0":u[e].toFixed(m),"middle","axis-steps-smaller")}this.repaint()}repaintData(){let e="";for(var t=0;t<this.pointsSpin1.length;t++)e+=" "+this.xRel*this.pointsSpin1[t].x+" "+this.transformY(this.pointsSpin1[t].y);a.addPolyline(this.plotContent,e,"plotSpin1"),e="";for(t=0;t<this.pointsSpin2.length;t++)e+=" "+this.xRel*this.pointsSpin2[t].x+" "+this.transformY(this.pointsSpin2[t].y);a.addPolyline(this.plotContent,e,"plotSpin2")}}e.exports=class{constructor(){this.element=document.createElement("div"),this.parentElement=null,this.dispPlotter=new i,this.dispPlotter.setPhononMode(),this.dosPlotter=new r}attach(e,t,s){e.appendChild(this.element),this.dispPlotter.attach(this.element,s,s),this.dosPlotter.attach(this.element,void 0,s),this.parentElement=e}isAttached(){return null!==this.parentElement}setUpAndData(e,t){this.hasDispData=null!=e,this.hasDosData=null!=t,this.hasDispData?(this.dispPlotter.setBandStructureData(e),this.hasDosData&&this.dispPlotter.setRepaintListener((e,t)=>{this.dosPlotter.setYZoomAndOffset(e,t),this.dosPlotter.repaint()})):this.dispPlotter.setNoData(),this.hasDosData?(this.dosPlotter.setPoints(t),this.hasDispData&&this.dosPlotter.setRepaintListener((e,t)=>{this.dispPlotter.setYZoomAndOffset(e,t),this.dispPlotter.repaint()})):this.dosPlotter.setNoData()}setNoData(){this.dispPlotter.setNoData(),this.dosPlotter.setNoData()}}},function(e,t,s){"use strict";let i=s(6),n=(s(0),s(3));e.exports=class extends i{constructor(){super("Elastic constants"),this.sortedLeafs=[],this.markedCalc=null,this.element.innerHTML+='\n\n      <div style="float: left; width: 27%;">\n        <div class="view-box">\n          <div class="title">Calculation </div>\n          <div class="navTreeWrapper"></div>\n        </div>\n      </div>\n\n      <div style="float: right; width: 73%;">\n        <div class="view-box">\n          <div class="title">Elastic constants</div>\n\n          <div>Parameters</div>\n          <div ></div>\n\n\n        </div>\n      </div>\n\n      <div style="clear: both;"></div>\n    ',this.navTreeWrapper=this.element.querySelector(".navTreeWrapper"),n.addToInfoSystem(this.element),this._events()}_events(){}updateSelection(e){console.log("ElasticDetails updateSelection ",e)}updateMarkedLeaf(e){}}},function(e,t,s){"use strict";let i=s(0),n=s(14),a=s(35),l=s(36),r=s(37);function o(e){return e.split("-").join("_")}class d{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","formula-box"),this.element.innerHTML='\n    <div style="padding-bottom: 40px;">\n    <input type="text" class="formula-text-field"\n      placeholder="Add formula to the search query above" >\n      <button class="adding-formula-btn" disabled>Add to query</button>\n    </div>\n    <div>\n    <input type="text" class="material-name-text-field"\n      placeholder="Add material name to the search query above" >\n    <button class="adding-material-name-btn" disabled>Add to query</button>\n    </div>\n    ',this.formulaTextField=this.element.querySelector(".formula-text-field"),this.formulaButton=this.element.querySelector(".adding-formula-btn"),this.materialTextField=this.element.querySelector(".material-name-text-field"),this.materialButton=this.element.querySelector(".adding-material-name-btn"),this.formulaButton.addEventListener("click",e=>{this.addFormulaListener(this.formulaTextField.value),this.formulaTextField.value=""}),this.materialButton.addEventListener("click",e=>{this.addMaterialListener(this.materialTextField.value),this.materialTextField.value=""}),this.formulaTextField.addEventListener("input",e=>{this.formulaButton.disabled=""===this.formulaTextField.value}),this.materialTextField.addEventListener("input",e=>{this.materialButton.disabled=""===this.materialTextField.value})}setAddFormulaListener(e){this.addFormulaListener=e}setAddMaterialListener(e){this.addMaterialListener=e}disable(e){this.formulaTextField.disabled=e,this.formulaButton.disabled=!0,this.materialTextField.disabled=e,this.materialButton.disabled=!0}}e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","search-module"),this.element.innerHTML='\n    <div class="search-page">\n\n      <div class="searchline" style="visibility: hidden">\n        <div class="search-query-wrapper" style="float: left;">\n          <div class="search-query-box" style="float: left;">\n          </div>\n          <button class="clean-btn" style="float: right;">Clear all</button>\n        </div>\n\n        <button style="float: right" class="search-btn" >Search</button>\n        <div style="clear: both;"></div>\n        <div class="exclusive-search-line">\n           Exclusive search <input class="exclusive-search" type="checkbox" >\n        </div>\n      </div>\n\n\n      <div class="add-buttons" >\n        <div  class="tab-buttons" style="width: 70%; display: inline-block">\n          <button class="element-add-btn" id="add-tab-selected">Element</button>\n          <button class="formula-add-btn" style="padding: 10px 20px;" >Formula/Material</button>\n          <button class="props-add-btn" >Properties</button>\n        </div>\n        <div class="bool-buttons" style="width: 28%; display: inline-block" >\n          <button  disabled >AND</button>\n          <button  disabled >OR</button>\n          <button  disabled >NOT</button>\n          <button  disabled >(</button> <button  disabled >)</button>\n          \x3c!--<input type="checkbox" name="and-or" class="not-symbol-btn" />NOT--\x3e\n        </div>\n      </div>\n\n\n      <div>\n        <div class="triangle element-tri" style="margin: -10px 64px; visibility: visible"></div>\n        <div class="triangle formula-tri" style="margin: -10px 30px; visibility: hidden"></div>\n        <div class="triangle props-tri" style="margin: -10px 70px; visibility: hidden"></div>\n      </div>\n\n\n      <div class="add-panel">\n      </div>\n\n    </div> \x3c!-- search-page --\x3e\n\n\n    <div class="results-page" style="display: none">\n    </div>\n\n    ',this.searchPage=this.element.querySelector(".search-page"),this.searchQueryBox=this.element.getElementsByClassName("search-query-box")[0],this.searchLine=this.element.querySelector(".searchline"),this.mainButton=this.element.querySelector(".search-btn"),this.cleanButton=this.element.querySelector(".clean-btn"),this.addButtonsBox=this.element.querySelector(".add-buttons"),this.addElementButton=this.addButtonsBox.querySelector(".element-add-btn"),this.addFormulaButton=this.addButtonsBox.querySelector(".formula-add-btn"),this.addPanel=this.element.querySelector(".add-panel"),this.elementTable=new a,this.elementTable.setClickListener(e=>{this.addElementsInSearchQuery(e),this.addFormulaButton.disabled=!0}),this.elementTable.setDeselectListener(e=>this.removeElementORFormulaInSearchQuery(e)),this.propertiesBox=new r,this.propertiesBox.setAddPropertiesListener(e=>{this.addPropertiesInSearchQuery(e)}),this.formulaBox=new d,this.formulaBox.setAddFormulaListener(e=>{""!==e.trim()&&(this.addTagInSearchQuery(e,"F"),this.addElementButton.disabled=!0,this.formulaBox.disable(!0))}),this.formulaBox.setAddMaterialListener(e=>{""!==e.trim()&&(this.addTagInSearchQuery(e,"material-name"),this.addElementButton.disabled=!0,this.formulaBox.disable(!0))}),this.materialList=new l,this.resultsPage=this.element.querySelector(".results-page"),this.materialList.attachAndSetEvents(this.resultsPage),this.currentTab="element",this.addPanel.appendChild(this.elementTable.element),this.userGuidance=!0,this.showingSearchBox=!1,this.searchQuery=[],this.queryTypes=[],this._events()}_events(){this.mainButton.addEventListener("click",e=>{if(0===this.searchQuery.lenght)i.showUserMsg("No query");else{let e={},t=[];e.search_by={},this.searchQuery.forEach((s,i)=>{"F"===this.queryTypes[i]?e.search_by.formula=s:"E"===this.queryTypes[i]?t.push(s):"S"!==this.queryTypes[i]&&(0===this.queryTypes[i].indexOf("has")?e[o(this.queryTypes[i])]="Yes":e[o(this.queryTypes[i])]=s.split(" | "))}),t.length>0&&(e.search_by.element=t.join(","));let s=this.element.querySelector(".exclusive-search:checked");e.search_by.exclusive=null===s?"0":"1",this.materialList.setSearch(e),i.setBrowserHashPath("search","results")}}),this.cleanButton.addEventListener("click",e=>{this.searchQuery=[],this.queryTypes=[],this.updateSearchQuery(),this.addFormulaButton.disabled=!1,this.addElementButton.disabled=!1,this.formulaBox.disable(!1),this.elementTable.deselectAllElements()}),this.addButtonsBox.addEventListener("click",e=>{if(e.target!==e.currentTarget){let t=e.target.className,s=t.indexOf("add-btn");if(s>0){let i,a=t.substring(0,s-1);"element"===a?i=this.elementTable.element:"props"===a?i=this.propertiesBox.element:"formula"===a&&(i=this.formulaBox.element),this.addPanel.replaceChild(i,this.addPanel.lastChild);let l=this.element.querySelector("."+this.currentTab+"-add-btn");this._setTabSelectedStyles(l,!1),this._setTabSelectedStyles(e.target,!0),this.element.querySelector("."+this.currentTab+"-tri").style.visibility="hidden",this.element.querySelector("."+a+"-tri").style.visibility="visible",this.currentTab=a,this.userGuidance&&("element"===a?(n.showIndependentTip(7,!1),n.showIndependentTip(3,!0)):"props"===a?(n.showIndependentTip(3,!1),n.showIndependentTip(7,!0)):"formula"===a&&(n.showIndependentTip(3,!1),n.showIndependentTip(7,!1)))}}}),this.searchQueryBox.addEventListener("click",e=>{if("remove-label"===e.target.className){let t=e.target.parentElement.getAttribute("data-el");this.removeElementORFormulaInSearchQuery(t)}})}_setTabSelectedStyles(e,t){e.id=t?"add-tab-selected":""}_showSearchBox(){this.showingSearchBox||(this.showingSearchBox=!0,this.searchLine.style.visibility="visible",this.userGuidance&&n.setFinal())}_addItemInSearchQuery(e,t){this.searchQuery.push(e),this.queryTypes.push(t)}addTagInSearchQuery(e,t){"E"===t&&this.searchQuery.indexOf(e)>=0||(this.searchQuery.length>0&&this._addItemInSearchQuery("&","S"),this._addItemInSearchQuery(e,t),this.updateSearchQuery(),this._showSearchBox())}addElementsInSearchQuery(e){let t=e.length;for(;t--;)this.addTagInSearchQuery(e[t],"E");return!0}addPropertiesInSearchQuery(e){e.forEach((e,t)=>{let s=this.queryTypes.indexOf(t);if(s<0)this.addTagInSearchQuery(e.join(" | "),t);else{let t=this.searchQuery[s].split(" | ");e.forEach(e=>{t.indexOf(e)<0&&t.push(e)}),this.searchQuery[s]=t.join(" | "),this.updateSearchQuery(),this._showSearchBox()}})}removeElementORFormulaInSearchQuery(e){let t=this.searchQuery.indexOf(e);if(t>=0){if(this.searchQuery.splice(t,1),this.queryTypes.splice(t,1),t>0){let e=this.searchQuery[t-1];"&"!==e&&"|"!==e||(this.searchQuery.splice(t-1,1),this.queryTypes.splice(t-1,1))}"S"===this.queryTypes[0]&&(this.searchQuery.splice(0,1),this.queryTypes.splice(0,1)),this.updateSearchQuery(),i.ELEMENTS.indexOf(e)>=0?(this.elementTable.deselectElement(e),this.queryTypes.indexOf("E")<0&&(this.addFormulaButton.disabled=!1)):(this.addElementButton.disabled=!1,this.formulaBox.disable(!1))}return!0}updateSearchQuery(){let e="";for(let s=0;s<this.searchQuery.length;s++){let n=this.queryTypes[s];e+="S"===n?`<span class="search-query-symbol" >  ${this.searchQuery[s]} </span>`:`<span class="search-label" data-el="${t=this.searchQuery[s]}" >\n            <img src="img/tag.svg" height="16px" class="remove-label"\n              style="vertical-align: bottom"/>\n          ${"F"===n?i.getSubscriptedFormula(t):t}\n          <img src="img/cross.svg" height="6px" class="remove-label"\n            style="vertical-align: middle; padding: 4px 3px 6px 5px;" />\n          </span>`}var t;console.log("this.updateSearchQuery: ",this.searchQuery,this.queryTypes),this.searchQueryBox.innerHTML=e}showResultsPage(){this.searchPage.style.display="none",this.resultsPage.style.display="block",this.userGuidance&&n.show(!1)}showSearchPage(){this.searchPage.style.display="block",this.resultsPage.style.display="none",this.userGuidance&&setTimeout(()=>{n.init(this.addButtonsBox,this.elementTable.element,this.searchLine,this.propertiesBox.tabsElement),n.show(!0,"element"===this.currentTab,"props"===this.currentTab)},400)}}},function(e,t,s){"use strict";let i=s(0);const n=new Map([[1,["H","Li","Na","K","Rb","Cs","Fr"]],[2,["Be","Mg","Ca","Sr","Ba","Ra"]],[3,["Sc","Y"]],[4,["Ti","Zr","Hf","Rf"]],[5,["V","Nb","Ta","Ha"]],[6,["Cr","Mo","W","Sg"]],[7,["Mn","Tc","Re","Ns"]],[8,["Fe","Ru","Os","Hs"]],[9,["Co","Rh","Ir","Mt"]],[10,["Ni","Pd","Pt","Ds"]],[11,["Cu","Ag","Au","Rg"]],[12,["Zn","Cd","Hg","Cn"]],[13,["B","Al","Ga","In","Tl","Nh"]],[14,["C","Si","Ge","Sn","Pb","Fl"]],[15,["N","P","As","Sb","Bi","Mc"]],[16,["O","S","Se","Te","Po","Lv"]],[17,["F","Cl","Br","I","At","Ts"]],[18,["He","Ne","Ar","Kr","Xe","Rn","Og"]],[19,["La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu"]],[20,["Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr"]]]),a=new Map([["metalloids",["B","Si","Ge","As","Sb","Te","Po"]],["other-non-metals",["H","C","N","O","P","S","Se"]],["halogens",["F","Cl","Br","I","At","Ts"]],["noble-gases",["He","Ne","Ar","Kr","Xe","Rn","Og"]],["alkali-metals",["Li","Na","K","Rb","Cs","Fr"]],["alkaline-earth-metals",["Be","Mg","Ca","Sr","Ba","Ra"]],["lanthanoids",["La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu"]],["actinoids",["Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr"]],["transition-metals",["Sc","Y","Ti","Zr","Hf","Rf","V","Nb","Ta","Ha","Cr","Mo","W","Sg","Mn","Tc","Re","Ns","Fe","Ru","Os","Hs","Co","Rh","Ir","Mt","Ni","Pd","Pt","Ds","Cu","Ag","Au","Rg","Zn","Cd","Hg","Cn"]],["post-transition-metals",["Al","Ga","In","Tl","Nh","Sn","Pb","Fl","Bi","Mc","Lv"]]]),l=new Map([["metalloids","#F9E298"],["other-non-metals","#F2B01D"],["halogens","#85ADC1"],["noble-gases","#F7D660"],["alkali-metals","#D04629"],["alkaline-earth-metals","#F7B57D"],["transition-metals","#F58737"],["post-transition-metals","#AE4747"],["lanthanoids","#3B91AE"],["actinoids","#E97147"]]);let r=["Hydrogen","Helium","Lithium","Beryllium","Boron","Carbon","Nitrogen","Oxygen","Fluorine","Neon","Sodium","Magnesium","Aluminum","Silicon","Phosphorus","Sulfur","Chlorine","Argon","Potassium","Calcium","Scandium","Titanium","Vanadium","Chromium","Manganese","Iron","Cobalt","Nickel","Copper","Zinc","Gallium","Germanium","Arsenic","Selenium","Bromine","Krypton","Rubidium","Strontium","Yttrium","Zirconium","Niobium","Molybdenum","Technetium","Ruthenium","Rhodium","Palladium","Silver","Cadmium","Indium","Tin","Antimony","Tellurium","Iodine","Xenon","Cesium","Barium","Lanthanum","Cerium","Praseodymium","Neodymium","Promethium","Samarium","Europium","Gadolinium","Terbium","Dysprosium","Holmium","Erbium","Thulium","Ytterbium","Lutetium","Hafnium","Tantalum","Tungsten","Rhenium","Osmium","Iridium","Platinum","Gold","Mercury","Thallium","Lead","Bismuth","Polonium","Astatine","Radon","Francium","Radium","Actinium","Thorium","Protactinium","Uranium","Neptunium","Plutonium","Americium","Curium","Berkelium","Californium","Einsteinium","Fermium","Mendelevium","Nobelium","Lawrencium","Rutherfordium","Dubnium","Seaborgium","Bohrium","Hassium","Meitnerium","Darmstadtium","Roentgenium","Copernicium","Nihonium","Flerovium","Moscovium","Livermorium","Tennessine","Oganesson"];function o(e){let t;return a.forEach((function(s,i){s.indexOf(e)>=0&&(t=i)})),t}function d(e){let t=i.ELEMENTS[e-1];return'<td class="cell '+o(t)+'" data-el="el-'+t+'"><b>'+t+"</b> <div>"+e+"</div> </td>"}function h(e){let t=null,s=null;if(e.target.className.indexOf("cell ")>=0?(t=e.target,s=e.target.className):e.target.parentElement.className.indexOf("cell ")>=0&&(t=e.target.parentElement,s=e.target.parentElement.className),null===t)return null;{let e=t.innerHTML,s=e.substring(3,e.indexOf("<",3));return"&nbsp;"===s?null:s}}e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","elementable");let e='<div class="element-info"></div>';e+='<div class="ptWrapper">',e+='<table id="pt-main">',e+="<tbody>",e+="<tr>"+d(1),e+='<td class="cellpad" colspan="16"></td>',e+=d(2)+"</tr>";let t=t=>{e+="<tr>"+d(t)+d(t+1),e+='<td class="cellpad" colspan="10"></td>';for(let s=t+2;s<t+8;s++)e+=d(s);e+="</tr>"};t(3),t(11);let s=19;for(let t=0;t<4;t++){e+="<tr>";for(let t=0;t<18;t++)57===s||89===s?(e+=(n=s,'<td class="cellpad '+o(i.ELEMENTS[n-1])+'" data-el="el-X"><b>&nbsp;</b> <div>&nbsp;</div> </td>'),s+=15):(e+=d(s),s++);e+="</tr>"}var n;e+="</tbody></table>",e+='<div id="specialRows"><table id="pt-laac">';for(let t=0;t<2;t++){e+="<tr>",s=0===t?57:89;for(let t=0;t<15;t++)e+=d(s),s++;e+="</tr>"}e+="</table></div>",e+='<div class="legend">\n      <div class="alkali-metals">Alkali metals</div>\n      <div class="alkaline-earth-metals">Alkaline earth metals</div>\n      <div class="transition-metals">Transition metals</div>\n      <div class="post-transition-metals">Post-transition metals</div>\n      <div class="metalloids">Metalloids</div>\n      <div class="other-non-metals">Other nonmetals</div>\n      <div class="halogens">Halogens</div>\n      <div class="noble-gases">Noble gases</div>\n      <div class="lanthanoids">Lanthanoids</div>\n      <div class="actinoids">Actinoids</div>\n    </div>',e+="</div>",this.element.innerHTML=e,this.elementInfo=this.element.getElementsByClassName("element-info")[0],this.tableZone=this.element.getElementsByClassName("ptWrapper")[0],this._events()}_events(){this.tableZone.addEventListener("click",e=>{if(e.target!==e.currentTarget){let s=e.target.className,i=e.target;if(""===s&&(i=e.target.parentElement,s=e.target.parentElement.className),s.indexOf("cellpad")>=0)return;if(s.indexOf("group-sel")>=0){let e=n.get(parseInt(i.getAttribute("data-group")));this.clickListener(e);for(var t=0;t<e.length;t++)this.selectElement(e[t])}else if(s.indexOf("cell")>=0){let e=i.innerHTML,t=e.substring(3,e.indexOf("<",3));if("&nbsp;"===t)return;s.indexOf("el-selected")>=0?this.deselectListener(t):(this.clickListener([t]),this.selectElement(t))}}},!0),this.tableZone.addEventListener("mouseover",e=>{let t=h(e);if(null!==t){this.elementInfo.style.display="block";let e=l.get(o(t));this.elementInfo.style.borderColor=e;let s=i.ELEMENTS.indexOf(t)+1;this.elementInfo.innerHTML=`\n          <div>\n            <div style="float: right; padding: 3px 4px;border-left: 3px solid ${e};\n              border-bottom: 3px solid ${e}" > ${s} </div>\n            <div style="clear: right;"></div>\n          </div>\n          <div class="symbol">${t} </div>\n          <div class="">${r[s-1]}  </div>\n          `}}),this.tableZone.addEventListener("mouseout",e=>{null!==h(e)&&(this.elementInfo.style.display="none")})}setClickListener(e){this.clickListener=e}setDeselectListener(e){this.deselectListener=e}selectElement(e){this.element.querySelector('td[data-el="el-'+e+'"]').className="cell el-selected"}deselectElement(e){this.element.querySelector('td[data-el="el-'+e+'"]').className="cell "+o(e)}deselectAllElements(){let e=this.element.querySelectorAll("td.el-selected");for(let t=0;t<e.length;++t){let s=e[t].getAttribute("data-el").substring(3);e[t].className="cell "+o(s)}}}},function(e,t,s){"use strict";let i=s(0),n=s(3),a=s(4);e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","matlist"),this.formula=!1,this.matMap=new Map,this.page=0,this.searchJson=null,this.total_results=0,this.pagesNum=0,this.element.innerHTML='\n    <div class="title"> Results </div>\n    <div class="pag-header">\n      <span class="prevButton">\n        <img src="img/prev.svg" style="display: inline;" width="7px"/> &nbsp; prev\n      </span>   &nbsp;&nbsp;\n      <span class="page"> X </span> &nbsp;&nbsp;\n      <span class="nextButton"> next &nbsp;\n        <img src="img/next.svg" width="7px" />\n      </span>\n    </div>\n    <div class="data-container"> </div>',this.titleBox=this.element.getElementsByClassName("title")[0],this.resultsNrTag=this.element.getElementsByClassName("pag-header")[0],this.prevButton=this.element.getElementsByClassName("prevButton")[0],this.pageElement=this.element.getElementsByClassName("page")[0],this.nextButton=this.element.getElementsByClassName("nextButton")[0],this.resultsContainer=this.element.getElementsByClassName("data-container")[0]}attachAndSetEvents(e){e.appendChild(this.element),this._events()}_events(){this.nextButton.addEventListener("click",e=>{this.page!==this.pagesNum&&(this.page++,this._search())}),this.prevButton.addEventListener("click",e=>{1!==this.page&&(this.page--,this._search())}),this.resultsContainer.addEventListener("click",e=>{if(e.target!==e.currentTarget){let t;"mat-row"===e.target.className?t=e.target:"mat-row"===e.target.parentElement.className?t=e.target.parentElement:"mat-row"===e.target.parentElement.parentElement.className&&(t=e.target.parentElement.parentElement),t&&i.setBrowserHashPath("material",t.getAttribute("data-mat-id")),e.stopPropagation()}})}_printMatMap(){console.log("MATMAP:"),this.matMap.forEach((function(e,t,s){console.log(t+" "+JSON.stringify(e))}))}setSearch(e){this.resultsContainer.style.visibility="hidden",this.searchJson=e,this.page=1,this._search()}_search(){this.searchJson.search_by.page=this.page,this.searchJson.search_by.per_page=10;let e=JSON.stringify(this.searchJson);console.log("SENDING: ",e),a.show(),i.serverReqPOST(i.getSearchURL(),e,e=>{let t=JSON.parse(e.target.response);if(console.log("SENDING: ",t),200===e.target.status){this.total_results=t.total_results,this.pagesNum=null===t.pages?1:t.pages.pages;let e=t.results;1===this.total_results?(i.setBrowserHashPath("material",+e[0].id),i.searchResults=!1):(this.setData(e),i.searchResults=!0)}else this.total_results=0,this.pagesNum=0,this.setData([]);this._updateUI(),this.resultsContainer.style.visibility="visible",a.hide()}).addEventListener("error",e=>{console.log("Search ERROR - Not valid query "),this.total_results=0,this.pagesNum=0,this.setData([]),this._updateUI(),this.resultsContainer.style.visibility="visible",a.hide()})}setData(e){this.matMap.clear(),e.forEach(e=>{if(this.matMap.has(e.formula_reduced)){this.matMap.get(e.formula_reduced).push(e)}else{let t=[];t.push(e),this.matMap.set(e.formula_reduced,t)}})}reset(){this.formula=!1,this.matMap.clear(),this.page=0,this.searchJson=null,this._updateUI()}_updateUI(){this.titleBox.innerHTML="Results (total: "+this.total_results+")",this.pageElement.innerHTML="page "+this.page+" / "+this.pagesNum;let e="";0===this.matMap.size?(this.resultsNrTag.style.display="none",this.titleBox.style.display="none",1===this.page&&(e+='<div class="not-found"> No results found </div>')):(this.resultsNrTag.style.display="block",this.titleBox.style.display="block",e+='\n        <table>\n          <thead> <tr>\n            <th style="width: 24%;"></th>\n            <th style="width: 20%;">\n              <span info-sys-data="system-type">System type</span>\n            </th>\n            <th style="width: 16%;">\n              <span info-sys-data="space-group">Space group</span>\n            </th>\n            <th style="width: 22%;">\n              <span info-sys-data="structure-type">Structure type</span>\n            </th>\n            <th style="width: 18%;">Nº calculations</th>\n          </tr> </thead>\n          <tbody>\n      ',this.matMap.forEach((t,s)=>{let n=i.getSubscriptedFormula(s);e+='<tr> <td class="formula" colspan="5"><b>'+n+"</b>",t.length>1&&(e+='<span style="font-size: 0.86em;"> ('+t.length+" structures)</span>"),e+="</td></tr>",t.forEach(t=>{let s=null!==t.material_name?t.material_name:n;e+=`<tr class="mat-row" data-mat-id="${t.id}">\n            <td  > ${s} </td>\n            <td style="text-align:center" >\n              \x3c!--<span info-sys-data="system-type">--\x3e${t.system_type} \x3c!--</span>--\x3e\n            </td>\n            <td style="text-align:center" >\n              ${null===t.space_group_number?"":t.space_group_number}\n            </td>\n            <td> ${null===t.structure_type?"":t.structure_type} </td>\n            <td style="text-align:center" > ${t.nr_of_calculations} </td>\n          </tr>`})}),e+=" </tbody> </table>"),this.resultsContainer.innerHTML=e,n.addToInfoSystem(this.resultsContainer)}}},function(e,t,s){"use strict";let i=s(0),n=s(3);e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","search-properties-box"),this.element.innerHTML='\n    <div class="props-box-tabs-wrapper" style="float: left; width: 25%; ">\n\n      <div class="properties-box-tabs" >\n        <div data-tab="structure" class="props-tab-selected" >Structure </div>\n        <div data-tab="results">Properties </div>\n        <div data-tab="method">Method </div>\n        \x3c!-- <div class="contributors-tab">Contributors </div> --\x3e\n      </div>\n\n    </div>\n\n    <div class="properties-box-panel" style="float: left;width: 75%;height: 100%">\n\n      <div class="props-tab-panel-wrapper" style="height: 86%" >\n\n      <div class="structure-panel props-tab-panel" style="display: block">\n\n\n        <div style="float: left; width: 47%;">\n\n          <div class="field">\n            <div class="field-title"><span info-sys-data="space-group">Space group number</span></div>\n            <input type="text" class="space-group-number-field">\n          </div>\n\n          <div class="field">\n            <div class="field-title">System type</div>\n            <input type="checkbox" class="system-type-field" value="bulk"> Bulk<br>\n            <input type="checkbox" class="system-type-field" value="2D"> 2D<br>\n            <input type="checkbox" class="system-type-field" value="1D"> 1D<br>\n          </div>\n\n          \x3c!--\n          <div class="field">\n            <div class="field-title"><span info-sys-data="mass-density">Mass density</span> <span style="font-weight: normal;">(kg/m<sup>3</sup>)</span></div>\n            Min: <input type="text" class="mass-density-min-field">&nbsp;&nbsp;\n            Max: <input type="text" class="mass-density-max-field">\n          </div>\n          --\x3e\n\n        </div>\n\n        <div style="float: left; width: 5%;"></div>\n\n        <div style="float: right; width: 47%;">\n\n          <div class="field">\n            <div class="field-title"><span info-sys-data="structure-type">Structure type</span></div>\n            <select class="structure-type-field" style="max-width: 174px">\n              <option></option>\n            </select>\n          </div>\n\n          <div class="field">\n            <div class="field-title"><span info-sys-data="crystal-system">Crystal system</span></div>\n            <input type="checkbox" class="crystal-system-field" value="cubic">\n              <span info-sys-data="crystal-system.value:cubic">Cubic</span><br>\n            <input type="checkbox" class="crystal-system-field" value="hexagonal">\n              <span info-sys-data="crystal-system.value:hexagonal">Hexagonal</span><br>\n            <input type="checkbox" class="crystal-system-field" value="trigonal">\n              <span info-sys-data="crystal-system.value:trigonal">Trigonal</span><br>\n            <input type="checkbox" class="crystal-system-field" value="tetragonal">\n              <span info-sys-data="crystal-system.value:tetragonal">Tetragonal</span><br>\n            <input type="checkbox" class="crystal-system-field" value="orthorhombic">\n              <span info-sys-data="crystal-system.value:orthorhombic">Orthorhombic</span><br>\n            <input type="checkbox" class="crystal-system-field" value="monoclinic">\n              <span info-sys-data="crystal-system.value:monoclinic">Monoclinic</span><br>\n            <input type="checkbox" class="crystal-system-field" value="triclinic">\n              <span info-sys-data="crystal-system.value:triclinic">Triclinic</span><br>\n          </div>\n\n        </div>\n        <div style="clear: both;"></div>\n      </div>\n\n      <div class="results-panel props-tab-panel" >\n        \x3c!--\n        <div style="float: left; width: 47%;">\n          <div class="field">\n            <div class="field-title"><span info-sys-data="band-gap">Band gap</span> <span style="font-weight: normal;">(eV)</span></div>\n            Min: <input type="text" class="band-gap-min-field">&nbsp;&nbsp;\n            Max: <input type="text" class="band-gap-max-field">\n          </div>\n        </div>\n\n        <div style="float: left; width: 5%;">  </div>\n\n        <div style="float: right; width: 47%;">\n          <div class="field" style="padding-top: 28px;">\n            <input type="radio" name="band-gap-type" value="d"> Direct<br>\n            <input type="radio" name="band-gap-type" value="i"> Indirect<br>\n            <input type="radio" name="band-gap-type" value="d/i" checked> Both<br>\n          </div>\n        </div>\n        --\x3e\n        <div style="clear: both;"></div>\n\n        <div class="field" style="background-color: #CCC; padding: 10px;">\n          <div style="font-weight: bold; padding-bottom: 6px" >Results containing...</div>\n          <div style="float: left; width: 47%;">\n            <input type="checkbox" class="has-band-structure-field" value="Band structure">\n              <span info-sys-data="has-band-structure">Band structure</span><br>\n            <input type="checkbox" class="has-dos-field" value="DOS">\n              <span info-sys-data="has-dos">DOS</span><br>\n              \x3c!--\n            <input type="checkbox" class="has-fermi-surface-field" value="Fermi surface">\n              <span info-sys-data="has-fermi-surface">Fermi surface</span><br>\n            --\x3e\n          </div>\n          <div style="float: right; width: 47%;">\n          <input type="checkbox" class="has-thermal-properties-field" value="Thermal properties">\n            <span info-sys-data="has-thermal-properties">Thermal properties</span>\n          <br>\n          \x3c!-- <input type="checkbox" class="results-containing-field" value="EOS" disabled>Equation of state<br>--\x3e\n          </div>\n          <div style="clear: both;"></div>\n        </div>\n\n      </div>\n\n      <div class="method-panel props-tab-panel" >\n        <div style="float: left; width: 47%;">\n\n          <div class="field">\n            <div class="field-title"><span info-sys-data="functional-type">Functional type</span></div>\n            <input type="checkbox" class="functional-type-field" value="LDA">\n              <span info-sys-data="functional-type.value:LDA">LDA</span><br>\n            <input type="checkbox" class="functional-type-field" value="GGA">\n              <span info-sys-data="functional-type.value:GGA">GGA</span><br>\n            <input type="checkbox" class="functional-type-field" value="meta-GGA">\n              <span info-sys-data="functional-type.value:meta-GGA">meta-GGA</span><br>\n            <input type="checkbox" class="functional-type-field" value="hybrid-GGA">\n              <span info-sys-data="functional-type.value:hybrid-GGA">hybrid-GGA</span><br>\n            <input type="checkbox" class="functional-type-field" value="hybrid-meta-GGA">\n              <span info-sys-data="functional-type.value:hybrid-meta-GGA">hybrid-meta-GGA</span><br>\n            <input type="checkbox" class="functional-type-field" value="HF">\n              <span info-sys-data="functional-type.value:HF">HF</span><br>\n            <input type="checkbox" class="functional-type-field" value="GW">\n              <span info-sys-data="functional-type.value:GW">GW</span><br>\n          </div>\n\n          <div class="field">\n            <div class="field-title"><span info-sys-data="code-name">Code name</span></div>\n            <select class="code-name-field" >\n              <option></option>\n            </select>\n            \x3c!--\n            <input type="checkbox" class="code-name-field" value="VASP">VASP<br>\n            <input type="checkbox" class="code-name-field" value="quantum-espresso">Quantum Espresso<br>\n            <input type="checkbox" class="code-name-field" value="FHI-aims">FHI-aims<br>\n            <input type="checkbox" class="code-name-field" value="exciting">exciting<br>\n            --\x3e\n          </div>\n\n        </div>\n\n        <div style="float: left; width: 5%;">   </div>\n\n        <div style="float: right; width: 47%;">\n          <div class="field">\n            <div class="field-title"><span info-sys-data="basis-set-type">Basis set</span></div>\n            <input type="checkbox" class="basis-set-type-field" value="Numeric AOs">\n              <span info-sys-data="basis-set-type.value:numeric AOs">Numeric AOs</span><br>\n            <input type="checkbox" class="basis-set-type-field" value="Gaussians">\n              <span info-sys-data="basis-set-type.value:gaussians">Gaussians</span><br>\n            <input type="checkbox" class="basis-set-type-field" value="(L)APW+lo">\n              <span info-sys-data="basis-set-type.value:(L)APW+lo">(L)APW+lo</span><br>\n            <input type="checkbox" class="basis-set-type-field" value="Plane waves">\n              <span info-sys-data="basis-set-type.value:plane waves">Plane waves</span><br>\n          </div>\n        </div>\n\n        <div style="clear: both;"></div>\n      </div>\n\n      </div>\n\n\n      <div class="properties-box-enter-button" style="height: 14%">\n        <button disabled>Add to query</button>\n      </div>\n\n    </div>\n\n    <div style="clear: both;"></div>\n    ',this.tabsElement=this.element.querySelector(".properties-box-tabs"),this.tabSelected=this.element.querySelector('[data-tab="structure"]'),this.tabPanelSelected=this.element.querySelector(".structure-panel"),this.addButton=this.element.querySelector(".properties-box-enter-button button");let e=this.element.querySelector(".code-name-field"),t=i.serverReq(i.getSuggestionURL("code_name"),()=>{JSON.parse(t.response).code_name.forEach(t=>{e.innerHTML+="<option>"+t+"</option>"})}),s=this.element.querySelector(".structure-type-field"),a=i.serverReq(i.getSuggestionURL("structure_type"),()=>{JSON.parse(a.response).structure_type.forEach(e=>{s.innerHTML+="<option>"+e+"</option>"})});n.addToInfoSystem(this.element),this._events()}_events(){this.tabsElement.addEventListener("click",e=>{if(e.target!==e.currentTarget){null!==this.tabSelected&&(this.tabSelected.className=""),this.tabSelected=e.target,this.tabSelected.className="props-tab-selected";let t=e.target.getAttribute("data-tab");null!==this.tabPanelSelected&&(this.tabPanelSelected.style.display="none"),this.tabPanelSelected=this.element.getElementsByClassName(t+"-panel")[0],this.tabPanelSelected.style.display="block",this.checkPropsValues()}}),this.addButton.addEventListener("click",e=>{let t=this.getPropsWithValueFromCurrentTab(!0);this.addPropertiesListener(t),this.addButton.disabled=!0});let e=this.element.querySelector(".properties-box-panel");e.addEventListener("input",e=>{this.checkPropsValues()}),e.addEventListener("change",e=>{this.checkPropsValues()})}checkPropsValues(){let e=this.getPropsWithValueFromCurrentTab(!1);this.addButton.disabled=0===e.size}getPropsWithValueFromCurrentTab(e){let t=this.tabSelected.getAttribute("data-tab"),s=new Map;return"structure"===t?(this.addPropsFromTextFields(s,["space-group-number"],e),this.addPropsFromDropdownList(s,["structure-type"],e),this.addPropsFromCheckboxes(s,["system-type","crystal-system"],e)):"results"===t?this.addPropsFromCheckboxes(s,["has-band-structure","has-dos","has-fermi-surface","has-thermal-properties"],e):"method"===t&&(this.addPropsFromCheckboxes(s,["functional-type","basis-set-type"],e),this.addPropsFromDropdownList(s,["code-name"],e)),s}addPropsFromTextFields(e,t,s){t.forEach(t=>{let i=this.element.querySelector("."+t+"-field");""!==i.value&&(e.set(t,[i.value]),s&&(i.value=""))})}addPropsFromCheckboxes(e,t,s){t.forEach(t=>{let i=this.element.querySelectorAll("."+t+"-field"),n=[];for(var a=0;a<i.length;a++)i[a].checked&&(n.push(i[a].value),s&&(i[a].checked=!1));n.length>0&&e.set(t,n)})}addPropsFromDropdownList(e,t,s){t.forEach(t=>{let i=this.element.querySelector("."+t+"-field"),n=i.options[i.selectedIndex].value;n.length>2&&e.set(t,[n]),s&&(i.selectedIndex=0)})}addBandgapProps(e,t){let s=document.querySelector(".band-gap-min-field"),i=document.querySelector(".band-gap-max-field"),n="band-gap",a="Band Gap";if(""!==s.value&&(a=s.value+" < "+a,n+=":"+s.value,t&&(s.value="")),""!==i.value&&(a+=" < "+i.value,n+=":"+i.value,t&&(i.value="")),"Band Gap"!==a){let t=document.querySelector('input[name="band-gap-type"]:checked').value;"d"===t?n+=":True":"i"===t&&(n+=":False"),e.set(n,[a+" "+t])}}addMassDensityProps(e,t){let s=document.querySelector(".mass-density-min-field"),i=document.querySelector(".mass-density-max-field"),n="mass-density",a="Mass Density";""!==s.value&&(a=s.value+" < "+a,n+=":"+s.value,t&&(s.value="")),""!==i.value&&(a+=" < "+i.value,n+=":"+i.value,t&&(i.value="")),"Mass Density"!==a&&e.set(n,[a])}setAddPropertiesListener(e){this.addPropertiesListener=e}}}]);
\ No newline at end of file
diff --git a/client/src/common/util.js b/client/src/common/util.js
index d79079a2a6e1cb6c4541ececc10ba2a8ecbcae61..5df6cbf184f144901e8e930c5391a487fe67cc01 100644
--- a/client/src/common/util.js
+++ b/client/src/common/util.js
@@ -82,12 +82,12 @@ if (document.location.href.indexOf('nomad-coe.eu') > 0){//
   USER_COOKIE_DOMAIN = '.nomad-coe.eu';
   path = 'api/v1.0/';
 }
- // Case 3: testing-staging environment and local installations (docker containers) of full Encyclopedia stack
-// else if (document.location.href.indexOf('gui') > 0){
-//   API_HOST= '/'; //  USER_COOKIE_DOMAIN = 'localhost' and path = 'v1.0/';
-//   if (document.location.href.indexOf('staging') > 0) // testing-staging server
-//     USER_COOKIE_DOMAIN = '.mpg.de';
-// }
+//  Case 3: testing-staging environment and local installations (docker containers) of full Encyclopedia stack
+else if (document.location.href.indexOf('gui') > 0){
+  API_HOST= '/'; //  USER_COOKIE_DOMAIN = 'localhost' and path = 'v1.0/';
+  if (document.location.href.indexOf('staging') > 0) // testing-staging server
+    USER_COOKIE_DOMAIN = '.mpg.de';
+}
 
 let API_BASE_URL = API_HOST + path;
 //console.log('API host: ',API_HOST,'  USER_COOKIE_DOMAIN: ',USER_COOKIE_DOMAIN);