(function(){var r,t=[].indexOf||function(n){for(var t=0,i=this.length;t<i;t++)if(t in this&&this[t]===n)return t;return-1},u=[].slice,i=function(n,t){return function(){return n.apply(t,arguments)}},n={}.hasOwnProperty;r=function(n){return typeof exports=="object"&&typeof module=="object"?n(require("jquery")):typeof define=="function"&&define.amd?define(["jquery"],n):n(jQuery)};r(function(r){var l,k,y,p,d,g,w,e,nt,a,v,s,b,tt,f,h,o,c;return k=function(n,t,i){var f,u,r,e;for(n+="",u=n.split("."),r=u[0],e=u.length>1?i+u[1]:"",f=/(\d+)(\d{3})/;f.test(r);)r=r.replace(f,"$1"+t+"$2");return r+e},v=function(n){var t;return t={digitsAfterDecimal:2,scaler:1,thousandsSep:",",decimalSep:".",prefix:"",suffix:"",showZero:!1},n=r.extend(t,n),function(t){var i;return isNaN(t)||!isFinite(t)?"":t===0&&!n.showZero?"":(i=k((n.scaler*t).toFixed(n.digitsAfterDecimal),n.thousandsSep,n.decimalSep),""+n.prefix+i+n.suffix)}},f=v(),h=v({digitsAfterDecimal:0}),o=v({digitsAfterDecimal:1,scaler:100,suffix:"%"}),y={count:function(n){return n==null&&(n=h),function(){return function(){return{count:0,push:function(){return this.count++},value:function(){return this.count},format:n}}}},countUnique:function(n){return n==null&&(n=h),function(i){var r;return r=i[0],function(){return{uniq:[],push:function(n){var i;if(i=n[r],t.call(this.uniq,i)<0)return this.uniq.push(n[r])},value:function(){return this.uniq.length},format:n,numInputs:r!=null?0:1}}}},listUnique:function(n){return function(i){var r;return r=i[0],function(){return{uniq:[],push:function(n){var i;if(i=n[r],t.call(this.uniq,i)<0)return this.uniq.push(n[r])},value:function(){return this.uniq.join(n)},format:function(n){return n},numInputs:r!=null?0:1}}}},sum:function(n){return n==null&&(n=f),function(t){var i;return i=t[0],function(){return{sum:0,push:function(n){if(!isNaN(parseFloat(n[i])))return this.sum+=parseFloat(n[i])},value:function(){return this.sum},format:n,numInputs:i!=null?0:1}}}},min:function(n){return n==null&&(n=f),function(t){var i;return i=t[0],function(){return{val:null,push:function(n){var r,t;return t=parseFloat(n[i]),isNaN(t)?void 0:this.val=Math.min(t,(r=this.val)!=null?r:t)},value:function(){return this.val},format:n,numInputs:i!=null?0:1}}}},max:function(n){return n==null&&(n=f),function(t){var i;return i=t[0],function(){return{val:null,push:function(n){var r,t;return t=parseFloat(n[i]),isNaN(t)?void 0:this.val=Math.max(t,(r=this.val)!=null?r:t)},value:function(){return this.val},format:n,numInputs:i!=null?0:1}}}},average:function(n){return n==null&&(n=f),function(t){var i;return i=t[0],function(){return{sum:0,len:0,push:function(n){if(!isNaN(parseFloat(n[i])))return this.sum+=parseFloat(n[i]),this.len++},value:function(){return this.sum/this.len},format:n,numInputs:i!=null?0:1}}}},sumOverSum:function(n){return n==null&&(n=f),function(t){var i,r;return r=t[0],i=t[1],function(){return{sumNum:0,sumDenom:0,push:function(n){return isNaN(parseFloat(n[r]))||(this.sumNum+=parseFloat(n[r])),isNaN(parseFloat(n[i]))?void 0:this.sumDenom+=parseFloat(n[i])},value:function(){return this.sumNum/this.sumDenom},format:n,numInputs:r!=null&&i!=null?0:2}}}},sumOverSumBound80:function(n,t){return n==null&&(n=!0),t==null&&(t=f),function(i){var r,u;return u=i[0],r=i[1],function(){return{sumNum:0,sumDenom:0,push:function(n){return isNaN(parseFloat(n[u]))||(this.sumNum+=parseFloat(n[u])),isNaN(parseFloat(n[r]))?void 0:this.sumDenom+=parseFloat(n[r])},value:function(){var t;return t=n?1:-1,(.821187207574908/this.sumDenom+this.sumNum/this.sumDenom+1.2815515655446004*t*Math.sqrt(.410593603787454/(this.sumDenom*this.sumDenom)+this.sumNum*(1-this.sumNum/this.sumDenom)/(this.sumDenom*this.sumDenom)))/(1+1.6423744151498161/this.sumDenom)},format:t,numInputs:u!=null&&r!=null?0:2}}}},fractionOf:function(n,t,i){return t==null&&(t="total"),i==null&&(i=o),function(){var r;return r=1<=arguments.length?u.call(arguments,0):[],function(u,f,e){return{selector:{total:[[],[]],row:[f,[]],col:[[],e]}[t],inner:n.apply(null,r)(u,f,e),push:function(n){return this.inner.push(n)},format:i,value:function(){return this.inner.value()/u.getAggregator.apply(u,this.selector).inner.value()},numInputs:n.apply(null,r)().numInputs}}}}},p=function(n){return{Count:n.count(h),"Count Unique Values":n.countUnique(h),"List Unique Values":n.listUnique(", "),Sum:n.sum(f),"Integer Sum":n.sum(h),Average:n.average(f),Minimum:n.min(f),Maximum:n.max(f),"Sum over Sum":n.sumOverSum(f),"80% Upper Bound":n.sumOverSumBound80(!0,f),"80% Lower Bound":n.sumOverSumBound80(!1,f),"Sum as Fraction of Total":n.fractionOf(n.sum(),"total",o),"Sum as Fraction of Rows":n.fractionOf(n.sum(),"row",o),"Sum as Fraction of Columns":n.fractionOf(n.sum(),"col",o),"Count as Fraction of Total":n.fractionOf(n.count(),"total",o),"Count as Fraction of Rows":n.fractionOf(n.count(),"row",o),"Count as Fraction of Columns":n.fractionOf(n.count(),"col",o)}}(y),b={Table:function(n,t){return s(n,t)},"Table Barchart":function(n,t){return r(s(n,t)).barchart()},Heatmap:function(n,t){return r(s(n,t)).heatmap()},"Row Heatmap":function(n,t){return r(s(n,t)).heatmap("rowheatmap")},"Col Heatmap":function(n,t){return r(s(n,t)).heatmap("colheatmap")}},e={en:{aggregators:p,renderers:b,localeStrings:{renderError:"An error occurred rendering the PivotTable results.",computeError:"An error occurred computing the PivotTable results.",uiRenderError:"An error occurred rendering the PivotTable UI.",selectAll:"Select All",selectNone:"Select None",tooMany:"(too many to list)",filterResults:"Filter results",totals:"Totals",vs:"vs",by:"by"}}},nt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],d=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],c=function(n){return("0"+n).substr(-2,2)},g={bin:function(n,t){return function(i){return i[n]-i[n]%t}},dateFormat:function(n,t,i,r,u){var f;return i==null&&(i=!1),r==null&&(r=nt),u==null&&(u=d),f=i?"UTC":"",function(i){var e;return(e=new Date(Date.parse(i[n])),isNaN(e))?"":t.replace(/%(.)/g,function(n,t){switch(t){case"y":return e["get"+f+"FullYear"]();case"m":return c(e["get"+f+"Month"]()+1);case"n":return r[e["get"+f+"Month"]()];case"d":return c(e["get"+f+"Date"]());case"w":return u[e["get"+f+"Day"]()];case"x":return e["get"+f+"Day"]();case"H":return c(e["get"+f+"Hours"]());case"M":return c(e["get"+f+"Minutes"]());case"S":return c(e["get"+f+"Seconds"]());default:return"%"+t}})}}},a=function(){return function(n,t){var i,u,r,f,e,o,s;if(o=/(\d+)|(\D+)/g,e=/\d/,s=/^0/,typeof n=="number"||typeof t=="number")return isNaN(n)?1:isNaN(t)?-1:n-t;if(i=String(n).toLowerCase(),r=String(t).toLowerCase(),i===r)return 0;if(!(e.test(i)&&e.test(r)))return i>r?1:-1;for(i=i.match(o),r=r.match(o);i.length&&r.length;)if(u=i.shift(),f=r.shift(),u!==f)return e.test(u)&&e.test(f)?u.replace(s,".0")-f.replace(s,".0"):u>f?1:-1;return i.length-r.length}}(this),tt=function(n){var i,t,r;t={};for(i in n)r=n[i],t[r]=i;return function(n,i){return t[n]!=null&&t[i]!=null?t[n]-t[i]:t[n]!=null?-1:t[i]!=null?1:a(n,i)}},w=function(n,t){var i;return i=n(t),r.isFunction(i)?i:a},l=function(){function t(n,r){this.getAggregator=i(this.getAggregator,this);this.getRowKeys=i(this.getRowKeys,this);this.getColKeys=i(this.getColKeys,this);this.sortKeys=i(this.sortKeys,this);this.arrSort=i(this.arrSort,this);this.aggregator=r.aggregator;this.aggregatorName=r.aggregatorName;this.colAttrs=r.cols;this.rowAttrs=r.rows;this.valAttrs=r.vals;this.sorters=r.sorters;this.tree={};this.rowKeys=[];this.colKeys=[];this.rowTotals={};this.colTotals={};this.allTotal=this.aggregator(this,[],[]);this.sorted=!1;t.forEachRecord(n,r.derivedAttributes,function(n){return function(t){if(r.filter(t))return n.processRecord(t)}}(this))}return t.forEachRecord=function(t,i,u){var e,y,o,s,p,h,w,f,c,l,a,v;if(e=r.isEmptyObject(i)?u:function(n){var t,r,f;for(t in i)f=i[t],n[t]=(r=f(n))!=null?r:n[t];return u(n)},r.isFunction(t))return t(e);if(r.isArray(t)){if(r.isArray(t[0])){l=[];for(o in t)if(n.call(t,o)&&(y=t[o],o>0)){f={};c=t[0];for(s in c)n.call(c,s)&&(p=c[s],f[p]=y[s]);l.push(e(f))}return l}for(a=[],h=0,w=t.length;h<w;h++)f=t[h],a.push(e(f));return a}if(t instanceof jQuery)return v=[],r("thead > tr > th",t).each(function(){return v.push(r(this).text())}),r("tbody > tr",t).each(function(){return f={},r("td",this).each(function(n){return f[v[n]]=r(this).text()}),e(f)});throw new Error("unknown input format");},t.convertToArray=function(n){var i;return i=[],t.forEachRecord(n,{},function(n){return i.push(n)}),i},t.prototype.arrSort=function(t){var r,i;return i=function(){var n,u,i;for(i=[],n=0,u=t.length;n<u;n++)r=t[n],i.push(w(this.sorters,r));return i}.call(this),function(t,r){var f,u,e;for(u in i)if(n.call(i,u)&&(e=i[u],f=e(t[u],r[u]),f!==0))return f;return 0}},t.prototype.sortKeys=function(){if(!this.sorted)return this.sorted=!0,this.rowKeys.sort(this.arrSort(this.rowAttrs)),this.colKeys.sort(this.arrSort(this.colAttrs))},t.prototype.getColKeys=function(){return this.sortKeys(),this.colKeys},t.prototype.getRowKeys=function(){return this.sortKeys(),this.rowKeys},t.prototype.processRecord=function(n){var i,u,t,f,c,l,e,s,a,h,v,r,o;for(i=[],r=[],s=this.colAttrs,f=0,c=s.length;f<c;f++)o=s[f],i.push((a=n[o])!=null?a:"null");for(h=this.rowAttrs,e=0,l=h.length;e<l;e++)o=h[e],r.push((v=n[o])!=null?v:"null");return t=r.join(String.fromCharCode(0)),u=i.join(String.fromCharCode(0)),this.allTotal.push(n),r.length!==0&&(this.rowTotals[t]||(this.rowKeys.push(r),this.rowTotals[t]=this.aggregator(this,r,[])),this.rowTotals[t].push(n)),i.length!==0&&(this.colTotals[u]||(this.colKeys.push(i),this.colTotals[u]=this.aggregator(this,[],i)),this.colTotals[u].push(n)),i.length!==0&&r.length!==0?(this.tree[t]||(this.tree[t]={}),this.tree[t][u]||(this.tree[t][u]=this.aggregator(this,r,i)),this.tree[t][u].push(n)):void 0},t.prototype.getAggregator=function(n,t){var i,r,u;return u=n.join(String.fromCharCode(0)),r=t.join(String.fromCharCode(0)),i=n.length===0&&t.length===0?this.allTotal:n.length===0?this.colTotals[r]:t.length===0?this.rowTotals[u]:this.tree[u][r],i!=null?i:{value:function(){return null},format:function(){return""}}},t}(),r.pivotUtilities={aggregatorTemplates:y,aggregators:p,renderers:b,derivers:g,locales:e,naturalSort:a,numberFormat:v,sortAs:tt,PivotData:l},s=function(t,i){var d,nt,a,p,h,tt,s,e,it,v,l,w,b,g,f,u,y,o,rt,c,k;tt={localeStrings:{totals:"Totals"}};i=r.extend(tt,i);a=t.colAttrs;l=t.rowAttrs;b=t.getRowKeys();h=t.getColKeys();v=document.createElement("table");v.className="pvtTable";g=function(n,t,i){var u,f,e,h,o,s,c,r;if(t!==0){for(h=!0,r=u=0,o=i;0<=o?u<=o:u>=o;r=0<=o?++u:--u)n[t-1][r]!==n[t][r]&&(h=!1);if(h)return-1}for(f=0;t+f<n.length;){for(c=!1,r=e=0,s=i;0<=s?e<=s:e>=s;r=0<=s?++e:--e)n[t][r]!==n[t+f][r]&&(c=!0);if(c)break;f++}return f};for(e in a)if(n.call(a,e)){nt=a[e];o=document.createElement("tr");parseInt(e)===0&&l.length!==0&&(u=document.createElement("th"),u.setAttribute("colspan",l.length),u.setAttribute("rowspan",a.length),o.appendChild(u));u=document.createElement("th");u.className="pvtAxisLabel";u.textContent=nt;o.appendChild(u);for(s in h)n.call(h,s)&&(p=h[s],k=g(h,parseInt(s),parseInt(e)),k!==-1&&(u=document.createElement("th"),u.className="pvtColLabel",u.textContent=p[e],u.setAttribute("colspan",k),parseInt(e)===a.length-1&&l.length!==0&&u.setAttribute("rowspan",2),o.appendChild(u)));parseInt(e)===0&&(u=document.createElement("th"),u.className="pvtTotalLabel",u.innerHTML=i.localeStrings.totals,u.setAttribute("rowspan",a.length+(l.length===0?0:1)),o.appendChild(u));v.appendChild(o)}if(l.length!==0){o=document.createElement("tr");for(s in l)n.call(l,s)&&(it=l[s],u=document.createElement("th"),u.className="pvtAxisLabel",u.textContent=it,o.appendChild(u));u=document.createElement("th");a.length===0&&(u.className="pvtTotalLabel",u.innerHTML=i.localeStrings.totals);o.appendChild(u);v.appendChild(o)}for(s in b)if(n.call(b,s)){w=b[s];o=document.createElement("tr");for(e in w)n.call(w,e)&&(rt=w[e],k=g(b,parseInt(s),parseInt(e)),k!==-1&&(u=document.createElement("th"),u.className="pvtRowLabel",u.textContent=rt,u.setAttribute("rowspan",k),parseInt(e)===l.length-1&&a.length!==0&&u.setAttribute("colspan",2),o.appendChild(u)));for(e in h)n.call(h,e)&&(p=h[e],d=t.getAggregator(w,p),c=d.value(),f=document.createElement("td"),f.className="pvtVal row"+s+" col"+e,f.textContent=d.format(c),f.setAttribute("data-value",c),o.appendChild(f));y=t.getAggregator(w,[]);c=y.value();f=document.createElement("td");f.className="pvtTotal rowTotal";f.textContent=y.format(c);f.setAttribute("data-value",c);f.setAttribute("data-for","row"+s);o.appendChild(f);v.appendChild(o)}o=document.createElement("tr");u=document.createElement("th");u.className="pvtTotalLabel";u.innerHTML=i.localeStrings.totals;u.setAttribute("colspan",l.length+(a.length===0?0:1));o.appendChild(u);for(e in h)n.call(h,e)&&(p=h[e],y=t.getAggregator([],p),c=y.value(),f=document.createElement("td"),f.className="pvtTotal colTotal",f.textContent=y.format(c),f.setAttribute("data-value",c),f.setAttribute("data-for","col"+e),o.appendChild(f));return y=t.getAggregator([],[]),c=y.value(),f=document.createElement("td"),f.className="pvtGrandTotal",f.textContent=y.format(c),f.setAttribute("data-value",c),o.appendChild(f),v.appendChild(o),v.setAttribute("data-numrows",b.length),v.setAttribute("data-numcols",h.length),v},r.fn.pivot=function(n,t){var o,u,c,a,h,i,f;o={cols:[],rows:[],vals:[],filter:function(){return!0},aggregator:y.count()(),aggregatorName:"Count",sorters:function(){},derivedAttributes:{},renderer:s,rendererOptions:null,localeStrings:e.en.localeStrings};t=r.extend(o,t);i=null;try{h=new l(n,t);try{i=t.renderer(h,t.rendererOptions)}catch(c){u=c;typeof console!="undefined"&&console!==null&&console.error(u.stack);i=r("<span>").html(t.localeStrings.renderError)}}catch(a){u=a;typeof console!="undefined"&&console!==null&&console.error(u.stack);i=r("<span>").html(t.localeStrings.computeError)}for(f=this[0];f.hasChildNodes();)f.removeChild(f.lastChild);return this.append(i)},r.fn.pivotUI=function(i,u,f,o){var ni,p,ct,nt,y,tt,ti,ii,hi,lt,ri,b,at,h,it,ui,fi,ei,oi,rt,ut,s,ft,et,vt,yt,pt,wt,bt,k,si,ot,st,v,d,kt,dt,g,gt,ht,c;f==null&&(f=!1);o==null&&(o="en");e[o]==null&&(o="en");ti={derivedAttributes:{},aggregators:e[o].aggregators,renderers:e[o].renderers,hiddenAttributes:[],menuLimit:200,cols:[],rows:[],vals:[],exclusions:{},inclusions:{},unusedAttrsVertical:85,autoSortUnusedAttrs:!1,rendererOptions:{localeStrings:e[o].localeStrings},onRefresh:null,filter:function(){return!0},sorters:function(){},localeStrings:e[o].localeStrings};lt=this.data("pivotUIOptions");s=lt==null||f?r.extend(ti,u):lt;try{i=l.convertToArray(i);d=function(){var t,r;t=i[0];r=[];for(h in t)n.call(t,h)&&r.push(h);return r}();vt=s.derivedAttributes;for(y in vt)n.call(vt,y)&&t.call(d,y)<0&&d.push(y);for(nt={},it=0,ui=d.length;it<ui;it++)c=d[it],nt[c]={};l.forEachRecord(i,s.derivedAttributes,function(t){var u,r,i;r=[];for(h in t)n.call(t,h)&&(i=t[h],s.filter(t))&&(i==null&&(i="null"),(u=nt[h])[i]==null&&(u[i]=0),r.push(nt[h][i]++));return r});g=r("<table>",{"class":"pvtUi"}).attr("cellpadding",5);st=r("<td>");ot=r("<select>").addClass("pvtRenderer").appendTo(st).bind("change",function(){return k()});yt=s.renderers;for(c in yt)n.call(yt,c)&&r("<option>").val(c).html(c).appendTo(ot);if(tt=r("<td>").addClass("pvtAxisContainer pvtUnused"),v=function(){var r,n,i;for(i=[],n=0,r=d.length;n<r;n++)y=d[n],t.call(s.hiddenAttributes,y)<0&&i.push(y);return i}(),ht=!1,gt=s.unusedAttrsVertical==="auto"?120:parseInt(s.unusedAttrsVertical),!isNaN(gt)){for(ct=0,rt=0,fi=v.length;rt<fi;rt++)ni=v[rt],ct+=ni.length;ht=ct>gt}s.unusedAttrsVertical===!0||ht?tt.addClass("pvtVertList"):tt.addClass("pvtHorizList");ri=function(n){var u,f,p,e,o,l,c,d,a,v,y,g,it,rt,i;if(c=function(){var t=[];for(h in nt[n])t.push(h);return t}(),l=!1,i=r("<div>").addClass("pvtFilterBox").hide(),i.append(r("<h4>").text(n+" ("+c.length+")")),c.length>s.menuLimit)i.append(r("<p>").html(s.localeStrings.tooMany));else for(f=r("<p>").appendTo(i),f.append(r("<button>",{type:"button"}).html(s.localeStrings.selectAll).bind("click",function(){return i.find("input:visible").prop("checked",!0)})),f.append(r("<button>",{type:"button"}).html(s.localeStrings.selectNone).bind("click",function(){return i.find("input:visible").prop("checked",!1)})),f.append(r("<br>")),f.append(r("<input>",{type:"text",placeholder:s.localeStrings.filterResults,"class":"pvtSearch"}).bind("keyup",function(){var n;return n=r(this).val().toLowerCase(),i.find(".pvtCheckContainer p").each(function(){var t;return t=r(this).text().toLowerCase().indexOf(n),t!==-1?r(this).show():r(this).hide()})})),p=r("<div>").addClass("pvtCheckContainer").appendTo(i),v=c.sort(w(s.sorters,n)),a=0,d=v.length;a<d;a++)h=v[a],rt=nt[n][h],e=r("<label>"),o=!1,s.inclusions[n]?o=t.call(s.inclusions[n],h)<0:s.exclusions[n]&&(o=t.call(s.exclusions[n],h)>=0),l||(l=o),r("<input>").attr("type","checkbox").addClass("pvtFilter").attr("checked",!o).data("filter",[n,h]).appendTo(e),e.append(r("<span>").text(h)),e.append(r("<span>").text(" ("+rt+")")),p.append(r("<p>").append(e));return it=function(){var n;return n=i.find("[type='checkbox']").length-i.find("[type='checkbox']:checked").length,n>0?u.addClass("pvtFilteredAttribute"):u.removeClass("pvtFilteredAttribute"),c.length>s.menuLimit?i.toggle():i.toggle(0,k)},r("<p>").appendTo(i).append(r("<button>",{type:"button"}).text("OK").bind("click",it)),y=function(n){var u,f,t;return t=r(n.currentTarget).position(),u=t.left,f=t.top,i.css({left:u+10,top:f+10}).toggle(),i.find(".pvtSearch").val(""),i.find(".pvtCheckContainer p").show()},g=r("<span>").addClass("pvtTriangle").html(" &#x25BE;").bind("click",y),u=r("<li>").addClass("axis_"+b).append(r("<span>").addClass("pvtAttr").text(n).data("attrName",n).append(g)),l&&u.addClass("pvtFilteredAttribute"),tt.append(u).append(i),u.bind("dblclick",y)};for(b in v)n.call(v,b)&&(y=v[b],ri(y));kt=r("<tr>").appendTo(g);p=r("<select>").addClass("pvtAggregator").bind("change",function(){return k()});pt=s.aggregators;for(c in pt)n.call(pt,c)&&p.append(r("<option>").val(c).html(c));for(r("<td>").addClass("pvtVals").appendTo(kt).append(p).append(r("<br>")),r("<td>").addClass("pvtAxisContainer pvtHorizList pvtCols").appendTo(kt),dt=r("<tr>").appendTo(g),dt.append(r("<td>").addClass("pvtAxisContainer pvtRows").attr("valign","top")),ft=r("<td>").attr("valign","top").addClass("pvtRendererArea").appendTo(dt),s.unusedAttrsVertical===!0||ht?(g.find("tr:nth-child(1)").prepend(st),g.find("tr:nth-child(2)").prepend(tt)):g.prepend(r("<tr>").append(st).append(tt)),this.html(g),wt=s.cols,ut=0,ei=wt.length;ut<ei;ut++)c=wt[ut],this.find(".pvtCols").append(this.find(".axis_"+r.inArray(c,v)));for(bt=s.rows,et=0,oi=bt.length;et<oi;et++)c=bt[et],this.find(".pvtRows").append(this.find(".axis_"+r.inArray(c,v)));s.aggregatorName!=null&&this.find(".pvtAggregator").val(s.aggregatorName);s.rendererName!=null&&this.find(".pvtRenderer").val(s.rendererName);at=!0;si=function(n){return function(){var g,f,o,rt,nt,l,tt,ut,et,y,w,u,d,it,e;if(u={derivedAttributes:s.derivedAttributes,localeStrings:s.localeStrings,rendererOptions:s.rendererOptions,sorters:s.sorters,cols:[],rows:[]},l=(et=s.aggregators[p.val()]([])().numInputs)!=null?et:0,e=[],n.find(".pvtRows li span.pvtAttr").each(function(){return u.rows.push(r(this).data("attrName"))}),n.find(".pvtCols li span.pvtAttr").each(function(){return u.cols.push(r(this).data("attrName"))}),n.find(".pvtVals select.pvtAttrDropdown").each(function(){return l===0?r(this).remove():(l--,r(this).val()!=="")?e.push(r(this).val()):void 0}),l!==0)for(ut=n.find(".pvtVals"),c=w=0,y=l;0<=y?w<y:w>y;c=0<=y?++w:--w){for(nt=r("<select>").addClass("pvtAttrDropdown").append(r("<option>")).bind("change",function(){return k()}),d=0,rt=v.length;d<rt;d++)g=v[d],nt.append(r("<option>").val(g).text(g));ut.append(nt)}if(at&&(e=s.vals,b=0,n.find(".pvtVals select.pvtAttrDropdown").each(function(){return r(this).val(e[b]),b++}),at=!1),u.aggregatorName=p.val(),u.vals=e,u.aggregator=s.aggregators[p.val()](e),u.renderer=s.renderers[ot.val()],f={},n.find("input.pvtFilter").not(":checked").each(function(){var n;return n=r(this).data("filter"),f[n[0]]!=null?f[n[0]].push(n[1]):f[n[0]]=[n[1]]}),o={},n.find("input.pvtFilter:checked").each(function(){var n;return n=r(this).data("filter"),f[n[0]]!=null?o[n[0]]!=null?o[n[0]].push(n[1]):o[n[0]]=[n[1]]:void 0}),u.filter=function(n){var i,r;if(!s.filter(n))return!1;for(h in f)if(i=f[h],r=""+n[h],t.call(i,r)>=0)return!1;return!0},ft.pivot(i,u),tt=r.extend(s,{cols:u.cols,rows:u.rows,vals:e,exclusions:f,inclusions:o,inclusionsInfo:o,aggregatorName:p.val(),rendererName:ot.val()}),n.data("pivotUIOptions",tt),s.autoSortUnusedAttrs&&(it=n.find("td.pvtUnused.pvtAxisContainer"),r(it).children("li").sort(function(n,t){return a(r(n).text(),r(t).text())}).appendTo(it)),ft.css("opacity",1),s.onRefresh!=null)return s.onRefresh(tt)}}(this);k=function(){return function(){return ft.css("opacity",.5),setTimeout(si,10)}}(this);k();this.find(".pvtAxisContainer").sortable({update:function(n,t){if(t.sender==null)return k()},connectWith:this.find(".pvtAxisContainer"),items:"li",placeholder:"pvtPlaceholder"})}catch(hi){ii=hi;typeof console!="undefined"&&console!==null&&console.error(ii.stack);this.html(s.localeStrings.uiRenderError)}return this},r.fn.heatmap=function(n){var h,t,o,s,i,u,c,l,f,e;n==null&&(n="heatmap");l=this.data("numrows");c=this.data("numcols");h=function(n,t,i){var r;return r=function(){switch(n){case"red":return function(n){return"ff"+n+n};case"green":return function(n){return n+"ff"+n};case"blue":return function(n){return""+n+n+"ff"}}}(),function(n){var u,f;return f=255-Math.round(255*(n-t)/(i-t)),u=f.toString(16).split(".")[0],u.length===1&&(u=0+u),r(u)}};t=function(n){return function(t,i){var e,f,u;return f=function(i){return n.find(t).each(function(){var n;return n=r(this).data("value"),n!=null&&isFinite(n)?i(n,r(this)):void 0})},u=[],f(function(n){return u.push(n)}),e=h(i,Math.min.apply(Math,u),Math.max.apply(Math,u)),f(function(n,t){return t.css("background-color","#"+e(n))})}}(this);switch(n){case"heatmap":t(".pvtVal","red");break;case"rowheatmap":for(o=i=0,f=l;0<=f?i<f:i>f;o=0<=f?++i:--i)t(".pvtVal.row"+o,"red");break;case"colheatmap":for(s=u=0,e=c;0<=e?u<e:u>e;s=0<=e?++u:--u)t(".pvtVal.col"+s,"red")}return t(".pvtTotal.rowTotal","red"),t(".pvtTotal.colTotal","red"),this},r.fn.barchart=function(){var i,u,n,e,f,t;for(f=this.data("numrows"),e=this.data("numcols"),i=function(n){return function(t){var i,f,e,u;return i=function(i){return n.find(t).each(function(){var n;return n=r(this).data("value"),n!=null&&isFinite(n)?i(n,r(this)):void 0})},u=[],i(function(n){return u.push(n)}),f=Math.max.apply(Math,u),e=function(n){return 100*n/(1.4*f)},i(function(n,t){var u,i;return u=t.text(),i=r("<div>").css({position:"relative",height:"55px"}),i.append(r("<div>").css({position:"absolute",bottom:0,left:0,right:0,height:e(n)+"%","background-color":"gray"})),i.append(r("<div>").text(u).css({position:"relative","padding-left":"5px","padding-right":"5px"})),t.css({padding:0,"padding-top":"5px","text-align":"center"}).html(i)})}}(this),u=n=0,t=f;0<=t?n<t:n>t;u=0<=t?++n:--n)i(".pvtVal.row"+u);return i(".pvtTotal.colTotal"),this}})}).call(this),function(){var t,i=[].indexOf||function(n){for(var t=0,i=this.length;t<i;t++)if(t in this&&this[t]===n)return t;return-1},r=[].slice,u=function(n,t){return function(){return n.apply(t,arguments)}},n={}.hasOwnProperty;t=function(n){return typeof exports=="object"&&typeof module=="object"?n(require("jquery")):typeof define=="function"&&define.amd?define(["jquery"],n):n(jQuery)};t(function(t){return t.pivotUtilities.cbs_renderers=function(){return{CbsTableRenderer:function(i,r){var kt,et,l,d,h,k,oi,e,o,b,a,y,ft,g,ht,s,u,nt,f,vt,tt,w,dt,p,c,ot=r.errorCode,wt,di,lt,gi,fi,it;oi={localeStrings:{totals:"Totals"}};var st=r.tableState.current.MetaData,gt=r.tableState.current.UserData,v=st.CollectionsData,yt=r.tableInfoService,ni,tr,rt=[],si={},hi={},ci=t.inArray("Topics",i.colAttrs)!==-1||t.inArray("Topics",i.valAttrs)!==-1,ct=t.inArray("Topics",i.rowAttrs)!==-1,ut,pt,li=function(n,t,i){return(i=i||0,n[i]>t[i])?1:n[i]<t[i]?-1:i<n.length?li(n,t,i+1):0},ai=function(n){var t=_.map(n,function(n){return v[n]});return function(n,i){var r=_.map(n,function(n,i){return t[i].Categories[n].Position}),u=_.map(i,function(n,i){return t[i].Categories[n].Position});return li(r,u)}};i.sortKeys=function(){if(!this.sorted)return this.sorted=!0,this.rowKeys.sort(ai(this.rowAttrs)),this.colKeys.sort(ai(this.colAttrs))};var vi=function(){var r=0,u=[],n;return r=t.inArray("Topics",i.colAttrs),r!==-1?_.forEach(i.getColKeys(),function(i){n=i[r];t.inArray(n,u)===-1&&u.push(n)}):(r=t.inArray("Topics",i.rowAttrs),r!==-1?_.forEach(i.getRowKeys(),function(i){n=i[r];t.inArray(n,u)===-1&&u.push(n)}):(n=gt.Collections.Topics.Single_Table[0].Key,u.push(n))),u},ti=function(n,t){for(var u=[n],i=n,r;i.ParentId!==null;)r=t.TopicGroups[i.ParentId],u.unshift(r),i=r;return u},yi=function(){var n=[];return _.forEach(rt,function(t){n.push(ti(t,st))}),n},ir=function(n,t,i,r){if(i>0){var u=r[i-1];if(t<u.length)return u[t].Id===n.Id}return!1},ii=function(n,i,r,u,f){var e=n.shift(),o=t("<div />"),s,h;return n.length===0?ui(o.addClass("topic").attr("data-key",e.Key).text(e.Title),e,!0):(s=ii(n,i+1,r,u,f),f&&ir(e,i,r,u)?o.addClass("topicgroup").append(s):(h=t("<div/>").text(e.Title),o.addClass("topicgroup").addClass("start").append(ui(h,e,!0)).append(s)))},ri=function(n,i,r){if(n.Key==="Topics")return r?t(hi[i]):t(si[i]);var u=n.Categories[i].Title,f=n.Categories[i].Status;return"Voorlopig"==f&&(u+="*"),"NaderVoorlopig"==f&&(u+="**"),ui(t("<div/>").text(u),n.Categories[i],!1)},rr=function(){var r={},n,i=null,u=t.map(vi(),function(n){return v.Topics.Categories[n]});_.forEach(u,function(t){n=t;i===null||n.Unit!==i.Unit?r[n]={Unit:n.Unit,Span:1}:r[i].Span++;i=t})},ur=function(){rr();rt=t.map(vi(),function(n){return v.Topics.Categories[n]});_.forEach(rt,function(n,t){si[n.Key]=ii(ti(rt[t],st),0,t,yi(st),!1);hi[n.Key]=ii(ti(rt[t],st),0,t,yi(st),!0)})},fr=function(n,i){var r=t(n).find("li").not(".dropzone").not(".dragging"),u=t(n).find(i).next();u&&(r=r.not(u));t('<li class="dropzone fa">&nbsp;<\/li>').insertBefore(r)},er=function(n){var i=n.find(".pvtRendererAxisContainer li .pvtAttr").disableSelection().draggableTouch().draggable({cursor:"move",revert:!0,start:function(i,r){var u=n.find(".pvtRendererAxisContainer"),f=t(i.target).closest("li");t(this).draggable("option","cursorAt",{left:Math.floor(r.helper.width()/2),right:Math.floor(r.helper.height()/2)});f.addClass("dragging");u.addClass("dragging");u.each(function(n,t){fr(t,f)});n.find(".pvtRendererAxisContainer li.dropzone").droppable({tolerance:"touch",activeClass:"ui-state-highlight",hoverClass:"drop-hover",drop:function(n,i){var e=i.draggable.closest("li").detach(),r,u,f;e.appendTo(t(n.target));r=[];t(a).find(".pvtRendererAxisContainer.cols span.pvtAttr").each(function(n,i){r.push(t(i).data("attrName"))});r=r.filter(function(n){return n!==undefined});u=[];t(a).find(".pvtRendererAxisContainer.rows span.pvtAttr").each(function(n,i){u.push(t(i).data("attrName"))});u=u.filter(function(n){return n!==undefined});f=[];t(a).find(".pvtRendererAxisContainer.vals span.pvtAttr").each(function(n,i){f.push(t(i).data("attrName"))});f=f.filter(function(n){return n!==undefined});t(a).trigger("rendererAxisChanged",{cols:r,rows:u,vals:f})}})},stop:function(i){var r=n.find(".pvtRendererAxisContainer"),f=t(i.target).closest("li"),u;f.removeClass("dragging");u=r.find(".dropzone");u.remove();r.removeClass("dragging")},helper:function(n){return t(n.target).clone()}});i.draggable("enable")},pi=function(n){var f=n.find(".pvtAttr"),r=0,u,i;f.each(function(){r=Math.max(r,t(this).width())});r>0&&f.each(function(){t(this).width(r)});u=n.find(".pvtAttrSingle");i=0;u.each(function(){i=Math.max(i,t(this).width())});i>0&&u.each(function(){t(this).width(i)})},ui=function(n,i,r){if(!_.isUndefined(i)&&!_.isNull(i)&&!_.isNull(n)){var u=n;return typeof n=="string"&&(u=t.parseHTML(n)),r?t(u).attr("title",yt.tooltip.subjectTooltip(yt,i)):t(u).attr("title",yt.tooltip.dimensionTooltip(yt,i)),t(u).attr("data-placement","auto"),u}};for(ur(),r=t.extend(oi,r.tableState),l=i.colAttrs,y=i.rowAttrs,dt=i.valAttrs,g=i.getRowKeys(),h=i.getColKeys(),a=document.createElement("table"),a.className="pvtTable",t(a).detach(),ut=document.createElement("thead"),pt=document.createElement("tbody"),wt=[],ht=function(n,t,i){var u,f,e,h,o,s,c,r;if(t!==0){for(h=!0,r=u=0,o=i;0<=o?u<=o:u>=o;r=0<=o?++u:--u)n[t-1][r]!==n[t][r]&&(h=!1);if(h)return-1}for(f=0;t+f<n.length;){for(c=!1,r=e=0,s=i;0<=s?e<=s:e>=s;r=0<=s?++e:--e)n[t][r]!==n[t+f][r]&&(c=!0);if(c)break;f++}return f},f=document.createElement("tr"),u=document.createElement("th"),u.className="pvtContainer",c=document.createElement("ul"),c.className="pvtRendererAxisContainer pvtVertList vals clearfix",e=0;e<dt.length;e++)if(tt=dt[e],tt!=="value"){var or=v[tt].Title,wi=gt.Collections[tt],bi=tt==="Topics"?wi.Single_Table[0].Key:wi.Single[0].Key,sr=v[tt].Categories[bi],ki=t("<li>").addClass("axis_"+e).append(t("<span>").addClass("pvtAttr").text(or).data("attrName",tt));ki.append(t("<span>").addClass("pvtAttrSingle").append(ri(v[tt],bi,!1).clone())).append(t("<span>").addClass("pvtAttrEditHandle").html("&#xf0b0;").data("attrName",tt));t(c).append(ki)}if(t(c).append(t("<li>").addClass("ignore")),u.appendChild(c),u.setAttribute("rowspan",1),k=h.length,y.length>0?k+=y.length+1:k++,ct&&k++,u.setAttribute("colspan",Math.max(k,2)),f.appendChild(u),ut.appendChild(f),f=document.createElement("tr"),u=document.createElement("th"),u.className="spacer",u.setAttribute("rowspan",1),u.setAttribute("colspan",k),f.appendChild(u),ut.appendChild(f),!0){f=document.createElement("tr");u=document.createElement("th");u.className="pvtUpperLeftCorner";k=y.length;l.length>0&&k++;ct&&k++;u.setAttribute("colspan",k);u.setAttribute("rowspan",1);f.appendChild(u);u=document.createElement("th");u.className="pvtContainer";c=document.createElement("ul");c.className="pvtRendererAxisContainer pvtHorizList cols clearfix";for(e in l)et=l[e],di=t("<li>").addClass("axis_"+e).append(t("<span>").addClass("pvtAttr").text(v[et].Title).data("attrName",et)).append(t("<span>").addClass("pvtAttrEditHandle").html("&#xf0b0;").data("attrName",et)),t(c).append(di);t(c).append(t("<li>").addClass("ignore"));u.appendChild(c);t(u).append(t("<div>").addClass("bottomborder"));u.setAttribute("colspan",h.length);u.setAttribute("rowspan",1);f.appendChild(u);ut.appendChild(f)}if(l.length===0){if(f=document.createElement("tr"),!0){u=document.createElement("th");u.className="pvtContainer left";u.setAttribute("colspan",y.length+(ct?1:0));u.setAttribute("rowspan",1);c=document.createElement("ul");c.className="pvtRendererAxisContainer pvtVertList rows clearfix";for(e in y)b=y[e],lt=t("<li>").addClass("axis_"+Number(Number(e)+l.length)).append(t("<span>").addClass("pvtAttr").text(v[b].Title).data("attrName",b)).append(t("<span>").addClass("pvtAttrEditHandle").html("&#xf0b0;").data("attrName",b)),t(c).append(lt);t(c).append(t("<li>").addClass("ignore"));u.appendChild(c);f.appendChild(u);u=document.createElement("th");f.appendChild(u)}ut.appendChild(f)}for(o in l)if(n.call(l,o)){if(et=l[o],ni=v[et],f=document.createElement("tr"),parseInt(o)===0){u=document.createElement("th");u.className="pvtContainer left";u.setAttribute("colspan",y.length+1+(ct?1:0));u.setAttribute("rowspan",l.length+(ci?1:0));c=document.createElement("ul");c.className="pvtRendererAxisContainer pvtVertList rows clearfix";for(e in y)b=y[e],lt=t("<li>").addClass("axis_"+Number(Number(e)+l.length)).append(t("<span>").addClass("pvtAttr").text(v[b].Title).data("attrName",b)).append(t("<span>").addClass("pvtAttrEditHandle").html("&#xf0b0;").data("attrName",b)),t(c).append(lt);t(c).append(t("<li>").addClass("ignore"));u.appendChild(c);f.appendChild(u)}if(tr=ni.Categories,!ot||ot!=="TeVeelVoorTabel"){gi=h[h.length-1];for(e in h)n.call(h,e)&&(d=h[e],p=ht(h,parseInt(e),parseInt(o)),p!==-1&&(u=document.createElement("th"),u.className="pvtColLabel",fi=l.length,parseInt(o)==fi-1&&(u.className+=" bottomrow"),fi>0&&parseInt(o)===0&&(u.className+=" toprow"),d[o]==gi[o]&&e<h.length-1&&(u.className+=" lastcol",parseInt(o)===l.length-1&&wt.push(e)),t(u).append(ri(ni,d[o],!0).clone()).attr("colspan",p).appendTo(t(f))))}ut.appendChild(f)}if(ci&&(!ot||ot!=="TeVeelVoorTabel")){f=document.createElement("tr");var bt=null,ei=null,at=null,it,nr=gt.Collections.Topics.Single_Table[0].Key;h.length===0&&t.inArray("Topics",i.valAttrs)!==-1&&(it=v.Topics.Categories[nr],u.className="pvtColLabelUnit",u.innerHTML=it.Unit);for(e in h)n.call(h,e)&&(d=h[e],it=t.inArray("Topics",i.valAttrs)!==-1?v.Topics.Categories[nr]:v.Topics.Categories[d[t.inArray("Topics",i.colAttrs)]],p=ht(h,parseInt(e),parseInt(l.length)),p!==-1&&(bt===null||it.Unit!==bt?(u=document.createElement("th"),u.className="pvtColLabelUnit",u.innerHTML=it.Unit,u.setAttribute("colspan",p),f.appendChild(u),ei=u,bt=it.Unit,at=p):(at=p+at,ei.setAttribute("colspan",at))));ut.appendChild(f)}var bt=null,ei=null,at=null;if(!ot||ot!=="TeVeelVoorTabel"){for(e in g)if(n.call(g,e)){ft=g[e];f=document.createElement("tr");e==0&&(f.className="first");+e%2==1&&(f.className="odd");+e==g.length-1&&(f.className+=" last");for(o in ft)(b=y[o],n.call(ft,o))&&(vt=ft[o],p=ht(g,parseInt(e),parseInt(o)),p!==-1&&(u=document.createElement("th"),b==="Topics"?(u.className="pvtRowLabel topics",rt[0].Key===vt&&(u.className=u.className+" firstinspan"),rt[rt.length-1].Key===vt&&(u.className=u.className+" lastinspan")):u.className="pvtRowLabel notopics",+e+p==g.length&&(u.className+=" last"),u.setAttribute("rowspan",p),parseInt(o)===y.length-1&&l.length!==0&&u.setAttribute("colspan",2),t(u).append(ri(v[b],vt,!0).clone()),f.appendChild(u)));ct&&(it=v.Topics.Categories[ft[t.inArray("Topics",i.rowAttrs)]],p=ht(g,parseInt(e),parseInt(y.length)),u=document.createElement("th"),u.className="pvtColLabelUnit",u.innerHTML=it.Unit,f.appendChild(u));for(o in h)n.call(h,o)&&(d=h[o],kt=i.getAggregator(ft,d),w=kt.value(),s=document.createElement("td"),s.className="pvtVal row"+e+" col"+o,wt.indexOf(o)!=-1&&(s.className+=" lastcol"),s.innerHTML=kt.format(w),s.setAttribute("data-value",w),+o==h.length-1&&(s.className+=" last"),f.appendChild(s));l.length===0&&(nt=i.getAggregator(ft,[]),w=nt.value(),s=document.createElement("td"),s.className="pvtTotal rowTotal last",s.innerHTML=nt.format(w),s.setAttribute("data-value",w),s.setAttribute("data-for","row"+e),f.appendChild(s));pt.appendChild(f)}if(y.length===0){f=document.createElement("tr");f.className="last";u=document.createElement("th");f.appendChild(u);h.length===0&&(nt=i.getAggregator([],[]),w=nt.value(),s=document.createElement("td"),s.className="pvtTotal colTotal last",s.innerHTML=nt.format(w),s.setAttribute("data-value",w),f.appendChild(s));for(o in h)n.call(h,o)&&(d=h[o],nt=i.getAggregator([],d),w=nt.value(),s=document.createElement("td"),s.className="pvtTotal colTotal",wt.indexOf(o)!=-1&&(s.className+=" lastcol"),s.innerHTML=nt.format(w),s.setAttribute("data-value",w),s.setAttribute("data-for","col"+o),+o==h.length-1&&(s.className="last"),f.appendChild(s));pt.appendChild(f)}}a.appendChild(ut);a.appendChild(pt);a.setAttribute("data-numrows",g.length);a.setAttribute("data-numcols",h.length);t(a).find(".pvtRendererAxisContainer").disableSelection();er(t(a),[]);t("#pivotTableOutput").one("justifyVals",function(){pi(t(a).find(".pvtRendererAxisContainer.vals"));pi(t(a).find(".pvtRendererAxisContainer.rows"))});t("#pivotTableOutput").one("enableTooltips",function(){t(".pvtRowLabel div").tooltip({html:!0});t(".pvtColLabel div").tooltip({html:!0});t(".pvtAttrSingle div").tooltip({html:!0})});return a}}}})}.call(this),function(){$(window).ready(function(){var n={lines:13,length:28,width:14,radius:42,scale:1,corners:1,color:"#232176",opacity:.25,rotate:0,direction:1,speed:1,trail:60,fps:20,zIndex:2e9,className:"spinnerjs",top:"50%",left:"50%",shadow:!1,hwaccel:!1,position:"absolute"};window.showSpinner=function(t){window._spinner&&window._spinner.stop();window._spinner=new Spinner(n).spin(t||$("html")[0])};window.stopSpinner=function(){window._spinner&&window._spinner.stop()}})}(),function(){angular.module("CbsApp",["ui.router","ct.ui.router.extras.dsr","ct.ui.router.extras.previous","CbsDomein","CbsDirectives","pascalprecht.translate","CbsFilters","angularModalService","ngSanitize","CbsUi"]);angular.module("odata",["LocalStorageModule"]);angular.module("solr",["LocalStorageModule"]);angular.module("geo",["LocalStorageModule"]);angular.module("sitecore",[]);angular.module("ormMapper",[]);angular.module("CbsDomein",["odata","ormMapper","solr","sitecore"]);angular.module("CbsDirectives",["geo"]);angular.module("CbsFilters",[]);angular.module("CbsUi",[])}(),function(){var n=!1,t;try{n=window.location!==window.parent.location?!0:!1}catch(i){n=!0}t=!1;try{t=n&&window.parent.appPreviewFrameId!==undefined?!0:!1}catch(i){t=!1}angular.module("CbsApp").constant("isInIframe",n);angular.module("CbsApp").constant("isStatFlowFrame",t);angular.module("CbsApp").config(["$stateProvider","$urlRouterProvider","$locationProvider",function(i,r,u){u.html5Mode(!1);var f=_.keys(default_settings.catalogs).join("|");r.otherwise(function(n,t){var r=function(n,t){n=n.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)"),i=r.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":""},f=r("_catalog",t.absUrl()),o=r("_la",t.absUrl()),s=r("tableId",t.absUrl()),e=r("graphType",t.absUrl()),u=t.absUrl(),i;if(u=u.substring(0,u.lastIndexOf("/"))+"/#",i="",f!==""&&_.indexOf(_.keys(default_settings.catalogs),f)>-1&&o!=="")i="/"+f+"/"+o+"/",s!==""&&(i+="dataset/"+s+"/",e!==""&&(i+=e,e==="bar"&&(i+="h"))),window.location.assign(u+i);else return"/"+settings.DEFAULT_CATALOG+"/"+settings.DEFAULT_LANGUAGE+"/"});i.state("app",{abstract:!0,url:"/{_catalog:(?:"+f+")}/{_la:(?:nl|en|de)}",views:{header:n?{}:{templateUrl:"./app/shared/header/header.html",controller:"headerController"},main:{template:"<ui-view/>"},footer:n?{}:{templateUrl:"./app/shared/footer/footer.html",controller:"footerController"}},resolve:{translate:["$translate","$stateParams",function(n,t){var i="locale_"+t._la.toUpperCase();return n.use(i)}],catalogSettings:["$q","catalog","$stateParams","catalogcontentRepository",function(n,t,i,r){return n(function(n){settings.hasInternetAccess?n(r.updateCatalogSettings(settings.catalogs[i._catalog],i._catalog)):n()})}]},onEnter:["$translate","$stateParams","$rootScope",function(t,i,r){if(n){var u=i._catalog.toLowerCase()+".css";$("head").append('<link rel="stylesheet" href="./Content/widget/'+u+'" type="text/css" />')}r.$on("loader_show",function(n,t){showSpinner(t)});r.$on("loader_hide",function(){stopSpinner()})}]});i.state("app.home",{url:"/",controller:"homeController",templateUrl:"./app/components/home/home.html",resolve:{}});n||i.state("app.navigatieScherm",{url:"/navigatieScherm",controller:"navigatieSchermController",templateUrl:"./app/components/navigatieScherm/navigatieScherm.html",resolve:{themaBoom:["catalog","$stateParams",function(n,t){return n.joinTablesThemes(t._catalog,t._la)}]}}).state("app.navigatieScherm.thema",{url:"/thema?themaNr",views:{thematab:{controller:"ThemaController",templateUrl:"./app/components/thema/thema.html"}}}).state("app.navigatieScherm.recent",{url:"/recent",views:{recenttab:{controller:"RecentFiguresController",templateUrl:"./app/components/recent/recent.html"}}}).state("app.navigatieScherm.help",{url:"/help",views:{helptab:{controller:"HelpController",templateUrl:"./app/components/help/help.html"}}}).state("app.navigatieScherm.zoeken",{url:"/zoeken?searchKeywords&page&theme[]&year[]&geo[]",reloadOnSearch:!1,views:{zoekentab:{controller:"ZoekenController",templateUrl:"./app/components/zoeken/zoeken.html"}}});i.state("app.tableUI",{url:"/dataset/{tableId}?dl&ts&fromstatweb",templateUrl:"./app/components/tableview/tableview.html",controller:"tableviewController",params:{ts:Date.now().toString(),searchKeywords:undefined},resolve:{fullTableMeta:["$q","tableState","$stateParams","$translate","$state",function(n,i,r,u,f){$(".nvtooltip").remove();$(".jquerytooltip").click();f.params.tableId!==r.tableId&&(i.AreParamsParsed=!1);var e="locale_"+r._la.toUpperCase();return u.use(e).then(function(){return i.LoadTableFull(r.tableId,t).then(function(n){if(n){if(!t&&!settings.isPreviewEnviroment&&(r._la!==n.MetaData.Language||r._catalog!==n.MetaData.Catalog)){if("nl"===r._la)throw"Ongeldige tabel in combinatie met geselecteerde taal en/of catalogus.";if("en"===r._la)throw"Invalid table in combination with selected language and/or catalog.";}return n}},function(n){throw n;})})}],resolveDeepLink:["$q","tableState","$stateParams","$translate","$state","$location","$http",function(n,t,i,r,u,f,e){var o={},s;return i=angular.extend(i,f.$$search),!_.isUndefined(i.dl)&&(i.dl!==u.params.dl||i.tableId!==u.params.tableId)?(s=settings.HOST_DEEPLINKS+i.dl,e.get(s).then(function(n){if(!_.isUndefined(n.data)){var t=n.data.split("&");_.each(t,function(n){var t=n.split("=");o[t[0]]=t[1]})}i=angular.extend(i,o);delete i.dl},function(n){n.message=r.instant("dictionary.errorResolveDeepLink");throw n;})):void 0}]}}).state("app.tableUI.table",{url:"/table",views:{tabletab:{controller:"pivottableController",templateUrl:"./app/components/pivottable/pivottable.html"}}}).state("app.tableUI.barv",{url:"/barv",views:{barvtab:{template:"<graphbar><\/graphbar>"}}}).state("app.tableUI.barh",{url:"/barh",views:{barhtab:{template:"<graphbar><\/graphbar>"}}}).state("app.tableUI.line",{url:"/line",views:{linetab:{template:"<graphline><\/graphline>"}}}).state("app.tableUI.map",{url:"/map",views:{maptab:{template:"<graphmap><\/graphmap>"}}})}])}(),function(){angular.module("ormMapper").constant("config",{PeriodeIndelingen:["JJ","KW","MM","SJ","HJ","W1","W4","VS","G2","G3","G4","G5","VJ","M3"],GeoIndelingen:["NL","PV","GM","CR","GG","LD","ZK","SG","CP","CS","EG","GA","KD","KM","BR","LB","LG","NO","RB","RE","RP","PO","TR","TG","PD","RA","AM","VR","JZ","BT","MC","ES","VT","ET","RT"]});angular.module("geo").constant("geoSettings",{GeoIndelingenMap:{BU:{Map:"buurt"},WK:{Map:"wijk"},GM:{Map:"gemeente"},PV:{Map:"provincie"},LD:{Map:"landsdeel"},BR:{Map:"Brandweerregio"},CR:{Map:"COROPgebied"},CP:{Map:"COROPplusgebied"},CS:{Map:"COROPsubgebied"},GG:{Map:"GGDregio"},GA:{Map:"Grootstedelijke_agglomeratie"},LB:{Map:"Landbouwgebied"},LG:{Map:"Landbouwgroep"},PO:{Map:"Politieregio"},RP:{Map:"RPAgebied"},RE:{Map:"Regionale_eenheid"},SG:{Map:"Stadsgewest"},TR:{Map:"Toeristengebied"},TG:{Map:"Toeristengroep"},PD:{Map:"Politiedistricten"},RA:{Map:"Regioplus_arbeidsmarktregio"},ZK:{Map:"Zorgkantoorregio"},AM:{Map:"Arbeidsmarktregio"},VR:{Map:"Veiligheidsregio"},JZ:{Map:"Jeugdregio"},BT:{Map:"Basisteams"},MC:{Map:"regionaalmeld_coordinatiepunt"},ES:{Map:"regionale_energiestrategie"},VT:{Map:"veiligthuisregio"},ET:{Map:"subres_regio"},RT:{Map:"ressort"},CG:{Map:"CG_dummy"},SV:{Map:"SV_dummy"},CO:{Map:"CO_dummy"},RS:{Map:"RS_dummy"}}})}(),function(){"use strict";angular.module("CbsApp").run(["$rootScope","$state","$previousState","$translate","$window","$location","ModalService","localStorageService",function(n,t,i,r,u,f,e,o){function s(n,i){$(".jquerytooltip").click();e.showModal({templateUrl:"./app/components/error/error.html",controller:"ErrorController",inputs:{title:r.instant("dictionary.FoutMeldingTitel"),error:i}}).then(function(n){n.element.modal();n.close.then(function(){(i.error==="unretrievable"||i.error==="timeout")&&f.path("/"+t.params._catalog+"/"+t.params._la)})})}function h(n,i,u,o,s,h,c){$(".jquerytooltip").click();e.showModal({templateUrl:"./app/components/error/error.html",controller:"ErrorController",inputs:{title:r.instant("dictionary.FoutMeldingTitel"),error:h}}).then(function(n){n.element.modal();n.close.then(function(){c||(o.name===""?f.path("/"+t.params._catalog+"/"+t.params._la):t.reload())})})}o.cookie.clearAll();n.$on("$stateChangeError",h);n.$on("$customError",s)}])}(),function(){angular.module("CbsApp").config(["localStorageServiceProvider",function(n){n.setStorageType("sessionStorage")}]);angular.module("CbsApp").config(["$httpProvider","isStatFlowFrame",function(n){n.interceptors.push("httpService")}]);angular.module("CbsApp").factory("httpService",["$q","$rootScope",function(n,t){function f(n){return i.Total===i.Completed&&h(),i.Pending++,i.Total++,n}function e(t){return u(),n.reject(t)}function o(n){return i.Pending--,i.Completed++,i.Completed>=i.Total&&u(),n}function s(t){return i.Pending--,i.Completed++,i.Completed>=i.Total&&u(),n.reject(t)}function h(){t.$broadcast("loader_show")}function u(){t.$broadcast("loader_hide")}var i={Total:0,Pending:0,Completed:0},r={};return r.request=f,r.requestError=e,r.response=o,r.responseError=s,r}])}(),function(){angular.module("CbsApp").config(["$translateProvider",function(n){n.useSanitizeValueStrategy("sanitizeParameters");n.preferredLanguage("locale_NL");n.useStaticFilesLoader({prefix:"./app/shared/i18n/",suffix:".json"})}])}();angular.module("CbsFilters").filter("ToDateString",["$filter",function(n){return function(t){var i=t.substring(0,4),u=t.substring(4,6),r=t.substring(6,8),f;switch(u){case"JJ":return i;case"MM":return f=new Date(i,parseInt(r,10)-1),n("date")(f,"MMM yy");case"KW":return i+" "+n("roman")(parseInt(r,10));case"SJ":return i+"/"+(parseInt(i)+1).toString().substring(2,4);case"HJ":return i+" HJ"+r.substring(1,2);case"W1":return i.substring(2,4)+" W"+r;case"W4":return i.substring(2,4)+" "+u+r;case"VS":break;case"G1":return i;case"G2":return i.substring(2,4)+"/"+(parseInt(i)+1).toString().substring(2,4);case"G3":return i.substring(2,4)+"/"+(parseInt(i)+2).toString().substring(2,4);case"G4":return i.substring(2,4)+"/"+(parseInt(i)+3).toString().substring(2,4);case"G5":return i.substring(2,4)+"/"+(parseInt(i)+4).toString().substring(2,4);case"VJ":return i.substring(2,4)+" "+u+r;case"MC":return i.substring(2,4)+" "+u+r;case"M3":return i.substring(2,4)+" M"+parseInt(r,10);default:return r+"-"+u+"-"+i.substring(2,4)}return timeKey}}]);angular.module("CbsFilters").filter("roman",["$filter",function(){return function(n){return["I","II","III","IV","VI","VII","VIII","IX","X"][n-1]}}]);angular.module("CbsFilters").filter("cbsnumber",["$stateParams","$filter",function(n){return function(t,i){var f=n._la,u,r;return _.trim(t)!==""&&!isNaN(t)?(u=".0"+i+"f",r=d3.format(","+u)(t),f!=="en"&&r.length>1&&(r=r.replace(/,/g," ").replace(".",",")),r):t}}]),function(){angular.module("CbsDomein").service("tableState",["$q","$filter","$translate","odataCatalogRepository","odataTableRepository","MetaDataOrm","UserDataOrm","isStatFlowFrame","$location",function(n,t,i,r,u,f,e,o,s){function a(t,i){var r=n.defer(),e=new u(t,i),f={};return e.GetTableDataFull().then(function(n){var t=k(n);f.MetaData=t;h.MetaData=f.MetaData;r.resolve(h)},function(n){r.reject(n)}),r.promise}function v(n,t,i){var r,u;(n.k||n.r||n.t)&&(c.hasTableColumnRowParams=!0,t.KolomDimensions=[],t.RowDimensions=[],t.TableDimensions=[],n.k&&(r=_.split(n.k,","),_.forEach(r,function(n){_.indexOf(i,n)!==-1&&t.KolomDimensions.push(n)}),t.XAxisDimension=t.KolomDimensions[0]),n.r&&(u=_.split(n.r,","),_.forEach(u,function(n){_.indexOf(i,n)!==-1&&t.RowDimensions.push(n)}),t.LegendDimension=t.RowDimensions[0]),n.t&&_.indexOf(i,n.t)!==-1&&(t.TableDimensions[0]=n.t),t.TableDimensions=_.difference(_.difference(i,t.RowDimensions),t.KolomDimensions))}function y(n){var t="";return t=n.split("&").map(function(n){console.log(n);var t=_.trim(n);if(!_.startsWith(t,"k=")&&!_.startsWith(t,"r=")&&!_.startsWith(t,"t=")&&!_.startsWith(t,"dl=")&&!_.startsWith(t,"ts=")&&!_.startsWith(t,"_gu")&&!_.startsWith(t,"h=")&&!_.startsWith(t,"$filter")&&!_.startsWith(t,"$select"))return t}),_.join(t,"")}function p(){var t=y(s.$$absUrl),n="",i;return o&&(n+="&graphtype="+h.UserData.GraphType),h.UserData.GraphType!="Table"&&(h.UserData.RowDimensions=[h.UserData.LegendDimension],h.UserData.KolomDimensions=[h.UserData.XAxisDimension]),_.isEmpty(h.UserData.RowDimensions)||(n+="&r="+_.join(h.UserData.RowDimensions,",")),_.isEmpty(h.UserData.KolomDimensions)||(n+="&k="+_.join(h.UserData.KolomDimensions,",")),_.isEmpty(h.UserData.TableDimensions)||(n+="&t="+_.join(h.UserData.TableDimensions,",")),i=h.MetaData.GeoDetail||h.MetaData.GeoDimension,_.isNull(i)||_.isEmpty(h.UserData.Collections[i].Indeling)||(n+="&_gu="+h.UserData.Collections[i].Indeling),h.UserData.GraphType=="Bar"&&(_.isUndefined(h.UserData.horizontal)||(n+="&h="+h.UserData.horizontal)),_.isUndefined(h.UserData.GetSelection().queryOptions.$filter)||(n+="&$filter="+h.UserData.GetSelection().queryOptions.$filter),_.isUndefined(h.UserData.GetSelection().queryOptions.$select)||(n+="&$select="+h.UserData.GetSelection().queryOptions.$select),t=_.replace(t,/\?$/,""),_.includes(t,"?")?t+n:t+_.replace(n,/^&/,"?")}function w(n){h.params=b(n);var t=d();v(h.params,t,h.MetaData.Collections);h.UserData===undefined&&(h.UserData={});angular.copy(t,h.UserData);h.UserData.AllowInstellingenYaxisSwap=function(){var n=_.filter(h.MetaData.Collections,function(n){return n!==h.UserData.XAxisDimension});return n.length>1};h.params.h?h.UserData.horizontal=h.params.h=="true":h.UserData.GraphType==="Bar"&&(h.UserData.horizontal=!0);h.UserData.AllowYaxisXaxisSwap=function(){return h.UserData.GraphType==="Bar"&&h.UserData.horizontal};c.AreParamsParsed=!0}function b(n){var t={},i,r;return _.forEach(n,function(n,i){n!==undefined&&(t[i]=n)}),i={},_.forEach(h.MetaData.DefaultPresentation,function(n,t){n!==undefined&&(i[t.toLowerCase()]=n)}),_.forEach(h.MetaData.DefaultSelection,function(n,t){n!==undefined&&n!=="undefined"&&(i[t.toLowerCase()]=n)}),r=angular.extend({},i,t),!t.$select&&t.dl&&delete r.$select,!t.$filter&&t.dl&&delete r.$filter,r}function k(n){var t={},r;return t.data=n,r=new f(n),t.Identifier=r.GetIdentifier(),t.Title=r.GetTitle(),t.ShortTitle=r.GetShortTitle(),t.Summary=r.GetSummary(),t.Catalog=r.GetCatalog(),t.Source=r.GetSource(),t.Language=r.GetLanguage(),t.Modified=r.GetModified(),t.DefaultSelection=r.GetDefaultSelection(),t.DefaultPresentation=r.GetDefaultPresentation(),t.GraphType=r.GetGraphType(),t.GraphTypes=r.GetGraphTypes(),t.Collections=r.GetCollections(),t.LegendDimension=r.GetLegendDimension(),t.XAxisDimension=r.GetXAxisDimension(),t.HasTimeDimension=r.HasTimeDimension(),t.HasGeoDimension=r.HasGeoDimension(),t.HasGeoDetail=r.HasGeoDetail(),t.TimeDimension=r.FindTimeDimension(),t.GeoDimension=r.FindGeoDimension(),t.GeoDetail=r.FindGeoDetail(),t.TopicGroups=r.MapTopicGroups(),t.Topics=r.MapTopics(),t.GeoDimensionGroups=r.MapGeoDimensionGroups(),t.GeoDetailGroups=r.MapGeoDetailGroups(),t.Dimensions=r.MapDimensions(),t.CategoryGroups=r.MapCategoryGroups(),t.Line=r.CanLine()&&Object.keys(t.Dimensions[t.TimeDimension].Indelingen).length>0,t.BarHorizontal=r.CanBarHorizontal(),t.BarVertical=t.Line,t.Map=r.CanMap(),t.PortalLink=r.GetPortalLink(),i("dictionary.Onderwerp").then(function(n){t.CollectionsData=angular.extend({},t.Dimensions,{Topics:{Key:"Topics",Title:n,Type:"Topics",Categories:t.Topics}})}),t}function d(){var t={},n=new e(h.params,h.MetaData);return t.GraphType=n.GetGraphType(),t.PreviousType="",t.LegendDimension=n.GetLegendDimension(),t.XAxisDimension=n.GetXAxisDimension(),t.Collections=n.GetCollections(),t.TableDimensions=h.MetaData.Collections.slice(0,-2),t.KolomDimensions=h.MetaData.Collections.slice(-2,-1),t.RowDimensions=["Topics"],t.ToggleCategoriesItems=n.ToggleCategoriesItemsF(),t.SetIndelingen=n.SetIndelingen,t.SetIndeling=n.SetIndeling,t.GetLegendType=n.GetLegendTypeF(),t.GetSelection=n.GetSelectionF(h.MetaData),t.GetDimensionSelection=n.GetDimensionSelectionF(h.MetaData),t.GetDataSet=l,t.GetTopicsFilter=n.GetTopicsFilter,t.GetTimeStartValue=n.GetStartValue,t.GetTimeEndValue=n.GetEndValue,t.GetValuesInTimeDimension=n.GetValuesInTimeDimension,t.ValidateAxis=function(t,i){t!=="Line"&&(t!=="Bar"||i)?t==="Bar"&&i?n.GetValidationForBarHorizontal(this,h.MetaData):t==="Map"&&h.MetaData.HasGeoDimension?n.GetValidationForGeoMap(this,h.MetaData):t==="Map"&&h.MetaData.HasGeoDetail&&n.GetValidationForDetailMap(this,h.MetaData):n.GetValidationForLineBar(this,h.MetaData)},t.TransformGraphType=function(t,i){t==="Table"?n.TransformToTable(this,h.MetaData):t!=="Line"&&(t!=="Bar"||i)?t==="Bar"&&i?n.TransformToBarHorizontal(this,h.MetaData):t==="Map"&&h.MetaData.HasGeoDimension?n.TransformToGeoMap(this,h.MetaData):t==="Map"&&h.MetaData.HasGeoDetail&&n.TransformToGeoDetail(this,h.MetaData):n.TransformToLineBar(this,h.MetaData)},t}function l(r){var e=n.defer(),l=!1,f=h.UserData.GetSelection(h.UserData.GraphType),a,s,c;return r?(a=Math.floor(settings.max_cells/_.size(h.UserData.Collections.Topics.Multiple)),c=new u(h.MetaData.Identifier,o),l=settings.max_cells>1e4,f.queryOptions.$top=a,c.GetUnTypedDataSet(f.queryOptions,l).then(function(n){e.resolve(n.value)},function(n){e.reject(n)})):h.UserData.GraphType.toLowerCase()==="table"&&(f.count>settings.max_cells||f.rowsCount>settings.max_rows||f.columnsCount>settings.max_columns)?(s="",f.count>settings.max_cells&&(s+=i.instant("dictionary.TeVeelCellenVoorTabel").replace("{max_cells}",t("cbsnumber")(settings.max_cells,0)).replace("{cells_count}",t("cbsnumber")(f.count,0))),f.columnsCount>settings.max_columns&&(s+=i.instant("dictionary.TeVeelKolommenVoorTabel").replace("{max_columns}",t("cbsnumber")(settings.max_columns,0)).replace("{columnsCount}",t("cbsnumber")(f.columnsCount,0))),f.rowsCount>settings.max_rows&&(s+=i.instant("dictionary.TeVeelRijenVoorTabel").replace("{max_rows}",t("cbsnumber")(settings.max_rows,0)).replace("{rowsCount}",t("cbsnumber")(f.rowsCount,0))),s+=f.count>1e6?i.instant("dictionary.TeVeelVoorDownload"):i.instant("dictionary.TeVeelVoorTabel").replace("{url}",h.MetaData.PortalLink),e.reject({code:"TeVeelVoorTabel",message:s})):(c=new u(h.MetaData.Identifier,o),l=f.count>1e4,c.GetUnTypedDataSet(f.queryOptions,l).then(function(n){e.resolve(n.value)},function(n){e.reject(n)})),e.promise}var c=this,h={MetaData:{},UserData:{}};this.current=h;this.ParseParams=w;this.AreParamsParsed=!1;this.history=[];this.LoadTableFull=a;this.GetData=l;this.GetSelectionUrl=p;this.hasTableColumnRowParams=!1}])}(),function(){angular.module("CbsDomein").service("catalog",["$q","$filter","$translate","odataCatalogRepository","MetaDataOrm","solrRepository",function(n,t,i,r,u,f){var e=this,s=function(n,t,i){for(var f={},u,r=0;r<n.length;r++)u=n[r],typeof i!="undefined"&&(u[i]=r),f[u[t]]=u;return f},h=function(t,i){var r=n.defer();return o(t,i).then(function(n){r.resolve(_.size(n.Themes))},function(n){r.reject(n)}),r.promise},a=function(n,t){return{$filter:"Catalog eq '"+n+"' and Language eq '"+t+"'",$select:"ID,Identifier,Title,ShortTitle,Modified,Language,RecordCount,ColumnCount,GraphTypes,Summary,Period,Frequency"}},c=function(t,i,r){var u=n.defer();return n.all([f.GetTables({catalog:t,language:i},r)]).then(function(n){u.resolve(n)},function(n){u.reject(n)}),u.promise},l=function(t,i,r){var u=n.defer();return n.all([f.GetChangedTablesLastMonthUntilNow({catalog:t,language:i,numberOfRows:r})]).then(function(n){u.resolve(n)},function(n){u.reject(n)}),u.promise},o=function(t,i){var u=n.defer(),f={$filter:"Catalog eq '"+t+"' and Language eq '"+i+"'"};return n.all([r.GetThemes(f),r.GetTablesThemes()]).then(function(n){var r=n[0].value,o=n[1].value,i,f,t;if(r&&o){i={};for(t in r)i[r[t].ID]=[];for(t=0;t<o.length;t++)f=o[t],i[f.ThemeID]&&i[f.ThemeID].push(f);e.themaBoom={};e.themaBoom.ThemeTable=i;e.themaBoom.Themes=s(r,"ID");u.resolve(e.themaBoom)}},function(n){u.reject(n)}),u.promise};this.themaBoom={};this.joinTablesThemes=o;this.countTableThemes=h;this.getTables=c;this.getChangedTablesLastMonthUntilNow=l}])}(),function(){"use strict";angular.module("CbsDomein").factory("CacheService",["$rootScope","$cacheFactory",function(n,t){return t("jQuery")}])}(),function(){"use strict";angular.module("CbsDomein").factory("MetaService",["$location","$timeout","$stateParams",function(n,t,i){var r={DefaultTitle:default_settings.catalogs[i._catalog].appTitle[i._la],DefaultMobileTitle:default_settings.catalogs[i._catalog].appMobileTitle[i._la]};return r.setMeta=function(i,u){var f,e,o;if("title"==i){f=r.DefaultTitle;u!=r.DefaultTitle&&(f+=" - "+u);$("html head title").text(f);t(function(){var i=function(n,t){var u=n.split("?"),f,i,r;if(u.length>=2){for(f=encodeURIComponent(t)+"=",i=u[1].split(/[&;]/g),r=i.length;r-->0;)i[r].lastIndexOf(f,0)!==-1&&i.splice(r,1);return u[0]+(i.length>0?"?"+i.join("&"):"")}return n},t;"undefined"!=typeof ga&&(t=i(n.url(),"ts"),ga("send","pageview",{page:t,title:f}))});return}if(e=$("html head meta["+i+"]"),o="<meta "+i+' content="'+u+'">',e.length){e.attr("content",u);return}$("head").append(o)},r}])}(),function(){angular.module("CbsDirectives").factory("DataReshaper",["$q",function(){function t(n,t,i,r){var u,f;if(n!==t)return t!=="Topics"?(u={},_.forEach(r,function(r){var f=u[r[n]]||{},e;f[n]=r[n];f.Topics=i[0].Key;e={};e[r[t]]=r[i[0].Key];angular.extend(f,e);u[r[n]]=f}),f=[],_.forEach(u,function(n){f.push(n)}),f):r}var n={};return n.Reshape=t,n}])}(),function(){angular.module("odata").factory("catalogcontentRepository",["$q","sitecoreService","localStorageService",function(n,t){function r(n,i){var r=settings.HOST_ODATA_SITECORE,u=_.curry(function(n){return _.join(n,"_")});return _.flow([u,t.getDefinitionsByPath.bind(this,r,i,100,"ReleaseTime","desc")])(["statline",_.toLower(n),"general"])}function u(n,t){var i=_.curry(function(n,t){return _.groupBy(t,n)}),r=_.curry(function(n,t){return _.filter(t,n)}),u=_.curry(function(n,t,i,r,u){function e(n,t){var r=t.languages,i="nl";return n==="nl-NL"?i:_.filter(r,function(n){return n!==i})[0]}function o(n,t){if(_.isObject(n))return _.merge({},n,t)}var f=[];return _.forEach(u,function(u){var o={};u.forEach(function(u){var f=e(_.get(u,t),r);_.set(o,_.get(u,n),_.set({},f,_.get(u,i)))});f.push(o)}),_.mergeWith(f[0],f[1],o)});return _.flow([_.get,r.bind(this,["Type","Definition"]),i.bind(this,"Language"),u.bind(this,["Title"],["Language"],["Snippet"],t)])(n,"value")}function i(n,t){return r(n,null).then(function(n){return u(n,t)},function(n){console.log(n)})}function f(n,t){return i(t,n).then(function(t){return _.forEach(t,function(t,i){_.set(n,i,t)}),n})}return{getConfigs:i,updateCatalogSettings:f}}])}(),function(){angular.module("odata").factory("homepageRepository",["$q","sitecoreService","localStorageService",function(n,t){function i(n,i){var r=settings.HOST_ODATA_SITECORE,u=_.curry(function(n){return _.join(n,"_")});return _.flow([u,t.getPagesByPath.bind(this,r,i,10,"SortOrder","asc")])(["statline",n,"homepage"])}function r(t,r){var u=n.defer();return i(t,r).then(function(n){u.resolve(_.flow([_.get])(n,"value"))},function(n){console.log(n);u.reject(n)}),u.promise}return{getContent:r}}])}(),function(){angular.module("ormMapper").factory("MetaDataOrm",["config","$q","$translate","geoHierarchyService",function(n,t,i,r){function u(t){var f;this.GetIdentifier=function(){return t.TableInfos.value[0].Identifier};this.GetTitle=function(){return t.TableInfos.value[0].Title};this.GetShortTitle=function(){return t.TableInfos.value[0].ShortTitle};this.GetSummary=function(){return t.TableInfos.value[0].Summary};this.GetCatalog=function(){return t.TableInfos.value[0].Catalog};this.GetSource=function(){var n=t.TableInfos.value[0].Source,i;return n=n.replace("&copy;","").replace("&copy","").trim(),i=n[n.length-1],".,".indexOf(i)>-1&&(n=n.substring(0,n.length-1)),n};this.GetLanguage=function(){return t.TableInfos.value[0].Language};this.GetModified=function(){return t.TableInfos.value[0].Modified};this.GetDefaultSelection=function(){var n={};return _.forEach(t.TableInfos.value[0].DefaultSelection.split("&"),function(t){var i=t.split("=");n[i[0]]=i[1]}),n};this.GetDefaultPresentation=function(){var n={};return _.forEach(t.TableInfos.value[0].DefaultPresentation.split("&"),function(t){var i=t.split("=");n[i[0]]=i[1]}),n};this.GetGraphTypes=function(){return t.TableInfos.value[0].GraphTypes.split(",")};this.CanLine=function(){return this.GetGraphTypes().indexOf("Line")>=0&&this.HasTimeDimension()&&this.HasTopicWithNonStringDatatype()};this.CanBarHorizontal=function(){return this.GetGraphTypes().indexOf("Bar")>=0&&this.HasTopicWithNonStringDatatype()};this.CanBarVertical=function(){return this.GetGraphTypes().indexOf("Line")>=0&&this.HasTimeDimension()&&this.HasTopicWithNonStringDatatype()};this.CanMap=function(){return this.GetGraphTypes().indexOf("Map")>=0&&(this.HasGeoDimension()||this.HasGeoDetail())&&this.HasTopicWithNonStringDatatype()};this.HasTimeDimension=function(){return u("TimeDimension").length>0};this.HasGeoDimension=function(){return u("GeoDimension").length>0};this.HasGeoDetail=function(){return u("GeoDetail").length>0};this.HasTopicWithNonStringDatatype=function(){hasTopicWithNonStringDatatype=!1;for(var n=0;n<t.DataProperties.value.length;n++)if(t.DataProperties.value[n].Type=="Topic"&&t.DataProperties.value[n].Datatype!="String"){hasTopicWithNonStringDatatype=!0;break}return hasTopicWithNonStringDatatype};this.FindTimeDimension=function(){var n=u("TimeDimension");return n.length==1?n[0].Key:null};this.FindGeoDimension=function(){var n=u("GeoDimension");return n.length>0?n[0].Key:null};this.FindGeoDetail=function(){var n=u("GeoDetail");return n.length==1?n[0].Key:null};this.GetGraphType=function(){var t=this.GetDefaultPresentation(),n=[];return _.forEach(this.GetGraphTypes(),function(i){t.graphtype&&t.graphtype.toLowerCase()===i.toLowerCase()&&n.push(i)}),n.length===0&&n.push("Table"),n.join("")};this.GetLegendDimension=function(){var t=this.GetDefaultPresentation(),n=[];return _.forEach(this.GetCollections(),function(i){t._ed&&t._ed.toLowerCase()===i.toLowerCase()&&n.push(i)}),n.length===0&&n.push(""),n.join("")};this.GetXAxisDimension=function(){var t=this.GetDefaultPresentation(),n=[];return _.forEach(this.GetCollections(),function(i){t._td&&t._td.toLowerCase()===i.toLowerCase()&&n.push(i)}),n.length===0&&n.push(""),n.join("")};this.GetCollections=function(){var t=[].concat(u("Dimension"),u("TimeDimension"),u("GeoDimension"),u("GeoDetail")),n=[];return _.forEach(t,function(t){n.push(t.Key)}),n.push("Topics"),n};this.MapTopicGroups=function(){var t=u("TopicGroup"),n={};return _.forEach(t,function(t){n[t.ID]={Id:t.ID,ParentId:t.ParentID,Key:t.Key,Position:t.Position,Title:t.Title,Description:t.Description}}),n};this.MapTopics=function(){var t=u("Topic"),n={};return _.forEach(t,function(t){n[t.Key]={Id:t.ID,Key:t.Key,Title:t.Title,Unit:t.Unit===null?"":t.Unit,ParentId:t.ParentID,Position:t.Position,PresentationType:t.PresentationType,Decimals:t.Decimals,Datatype:t.Datatype,Description:t.Description}}),n};this.MapDimensions=function(){var t=[].concat(u("Dimension"),u("TimeDimension"),u("GeoDimension"),u("GeoDetail")),n={};return _.forEach(t,function(t){n[t.Key]={ID:t.ID,Key:t.Key,Type:t.Type,Title:t.Title,Categories:e(t.Key),Indelingen:o(t.Key,t.Type),Gemeenten:s(t.Key,t.Type)};t.MapYear!==undefined&&t.MapYear!==null&&(n[t.Key].MapYear=t.MapYear)}),n};this.MapCategoryGroups=function(){return t.CategoryGroups};this.MapGeoDimensionGroups=function(){return getCategoryGroupsForGeoDimension()};this.MapGeoDetailGroups=function(){return f()};this.GetPortalLink=function(){return i.instant("dictionary.TemplatePortal_Url").replace("{catalog}",this.GetCatalog()).replace("{identifier}",this.GetIdentifier())};var e=function(n){var i={},r=(t[n]||{}).value;return _.forEach(r,function(n,t){i[n.Key]={Key:n.Key,Title:n.Title,Description:n.Description,Status:n.Status,CategoryGroupID:n.CategoryGroupID||null,Position:t};n.DetailRegionCode&&(i[n.Key].Indeling=n.DetailRegionCode.substring(0,2))}),i},o=function(i,u){var f={},e,o,s;switch(u){case"TimeDimension":e={};o=(t[i]||{}).value;_.forEach(o,function(n){var t=n.Key.substring(4,6);e[t]={Key:t}});_.forEach(n.PeriodeIndelingen,function(n){e[n]!==undefined&&(f[n]=e[n],f[n].Position=_.size(f)-1)});_.some(e,function(n){return n.Key[0]==="0"||n.Key[0]==="1"})&&(f["0%"]={Key:"0%",Position:Number.MAX_VALUE});break;case"GeoDimension":e={};o=(t[i]||{}).value;_.forEach(o,function(n){var t=n.Key.substring(0,2);e[t]={Key:t}});_.forEach(n.GeoIndelingen,function(n){e[n]!==undefined&&(f[n]=e[n],f[n].Position=_.size(f)-1)});break;case"GeoDetail":if(_.isUndefined(i)||_.isNull(i)||_.isUndefined(t)||_.isNull(t))break;s=r.helpers.getUniqueCodes(t,i);_.indexOf(s,"WK")>-1&&(f.WK={Key:"WK",Position:0});_.indexOf(s,"BU")>-1&&(f.BU={Key:"BU",Position:1})}return f},s=function(n,i){var r={},u;switch(i){case"GeoDetail":u=(t[n]||{}).value;_.forEach(u,function(n){if(n.DetailRegionCode===n.Municipality&&n.Municipality!==""){var t=n.Key.substring(2,6);r[t]={Key:t,Title:n.Title}}})}return r},u=function(n){var i=[];return _.forEach(t.DataProperties.value,function(t){t.Type===n&&i.push(t)}),i};getCategoryGroupsForGeoDimension=function(){var n=u("GeoDimension");if(!_.isUndefined(n)&&!_.isNull(n)&&!_.isUndefined(t)&&!_.isNull(t)&&!_.isEmpty(t))return r.getCategoryGroupsForGeoDimension(t,n)};f=function(){var n=u("GeoDetail");if(!_.isUndefined(n)&&!_.isNull(n)&&!_.isUndefined(t)&&!_.isNull(t))return r.getCategoryGroupsForGeoDetail(t,n)}}return u}])}(),function(){angular.module("ormMapper").factory("UserDataOrm",["$q","$translate",function(n,t){function i(n,i){function et(){return!_.isUndefined(i.DefaultSelection)&&_.has(i.DefaultSelection,"")}function dt(n){n.allSelected=_.size(n.Indelingen_tabel)===0&&_.size(n.Multiple)===0}function w(n){for(var r=[],f,u,t=0;t<n.length;t++)if(i.Topics[n[t].Key].Datatype!="String"&&(r.length==0&&(f=i.Topics[n[t].Key].Unit),i.Topics[n[t].Key].Unit==f&&r.push(n[t])),r.length==8)break;if(r.length==0)for(u in i.Topics)if(i.Topics[u].Datatype!="String"){r.push(i.Topics[u]);break}return r}function ot(n){var r=n.GraphType,t,i;return r.toLowerCase()==="table"?(i=$.inArray("Topics",n.TableDimensions)>-1,t=i?"Single_Table":n.GetLegendType()):t=n.LegendDimension==="Topics"?n.GetLegendType():n.XAxisDimension==="Topics"?n.GetLegendType():"Single",t}function st(n,t,i){var s=t.GraphType,f=t.LegendDimension,e=t.XAxisDimension,h=t.TableDimensions,c=t.KolomDimensions,l=t.RowDimensions,a=t.horizontal,o,r,u;if(i!=="Topics"){r=t.Collections[i];u=n.CollectionsData[i].Categories;switch(s.toLowerCase()){case"table":return ui(h,c,l,r,u);case"bar":return a?fi(e,f,r,u):at(e,f,r,u);case"line":return at(e,f,r,u);case"map":return n.HasGeoDimension?o=ei(e,f,r,u):n.HasGeoDetail&&(o=oi(e,f,r,u)),o}}return null}function gt(n,t){var r=p(n.TableDimensions,t.TimeDimension),i=!1;i=r!==-1?b(n,t):k(n,t,n.Collections[t.TimeDimension].Multiple);i||d(n,t)}function ni(n,t){var i=!1;i=n.LegendDimension!==t.TimeDimension?b(n,t):k(n,t,n.Collections[t.TimeDimension].Legend3);i||d(n,t)}function ti(n,t){var i=!1;i=n.LegendDimension===t.TimeDimension||n.XaxisDimension===t.TimeDimension?k(n,t,n.Collections[t.TimeDimension].Legend8):b(n,t);i||d(n,t)}function b(n,t){var r=n.Collections[t.TimeDimension].Single[0].Key.substring(4,6);if(_.includes(_.map(t.CollectionsData[t.TimeDimension].Indelingen,"Key"),r)){n.Collections[t.TimeDimension].Indeling=r;var e=n.Collections[t.TimeDimension].Single[0].Key,u=[],f=0,i=0;return _.forEach(t.CollectionsData[t.TimeDimension].Categories,function(r,o){o.substring(4,6)==n.Collections[t.TimeDimension].Indeling&&(u.push(o),o==e&&(i=f),f++)}),n.Collections[t.TimeDimension].EndValueKey=n.Collections[t.TimeDimension].Single[0].Key,i=i>11?i-11:0,n.Collections[t.TimeDimension].StartValueKey=u[i],!0}return!1}function k(n,t){var e=t.Dimensions[t.TimeDimension].Indelingen[n.Collections[t.TimeDimension].Indeling],o=function(n,t){return t.Key==="0%"?n.substr(4,1)==="0"||n.substr(4,1)==="1":n.substring(4,6)===t.Key},f,r;if(e){f=[];_.forEach(n.Collections[t.TimeDimension].Multiple,function(n){o(n.Key,e)&&f.push(n.Key)});var s=t.CollectionsData[t.TimeDimension].Categories,u=_.map(_.orderBy(_.filter(s,function(n){return o(n.Key,e)}),"Position"),"Key"),i=_.indexOf(u,f[f.length-1]);return i===-1&&(i=u.length-1),r=_.indexOf(u,f[0]),r===-1&&(r=0),r=Math.max(r,i-99),n.GraphType!=="Line"&&(n.GraphType!=="Bar"||n.horizontal)||r!==i||u.length>1&&(i>11?r=i-11:i>0?r=0:i===0&&(r=0,i=1)),n.Collections[t.TimeDimension].EndValueKey=u[i],n.Collections[t.TimeDimension].StartValueKey=u[r],!0}return!1}function d(n,t){var r=_.sortBy(l(t.Dimensions[t.TimeDimension].Indelingen),"Position")[0].Key,i,u;n.Collections[t.TimeDimension].Indeling=r;i=[];_.forEach(t.CollectionsData[t.TimeDimension].Categories,function(n,t){t.substring(4,6)==r&&i.push(t)});n.Collections[t.TimeDimension].EndValueKey=i[i.length-1];u=i.length>12?i.length-13:0;n.Collections[t.TimeDimension].StartValueKey=i[u]}function s(n,t){var u=[],f=_.map(n.Multiple,"Key"),e=_.sortBy(l(i.CollectionsData[t].Categories),"Position");return _.forEach(e,function(t){n.allSelected?u.push(t):(r(_.map(n.Indelingen_tabel,function(n){return n.Key}),t.Key,i.Dimensions[n.Key].Type)||_.includes(f,t.Key))&&u.push(t)}),i.Dimensions[n.Key].Type=="TimeDimension"?u.slice(-8):u.slice(0,8)}function e(n){n.RowDimensions[0]!==""&&(n.LegendDimension=_.isArray(n.RowDimensions[0])?n.RowDimensions[0].join(""):n.RowDimensions[0]);n.KolomDimensions[0]!==""&&(n.XAxisDimension=n.KolomDimensions[0])}function u(n,t){if(n.allSelected){var r=t!=="Topics"?s(n,t):w(_.sortBy(l(i.CollectionsData[t].Categories),"Position"));n.Legend8=r;f(n,t)}}function g(n,t,u){var e=n.Indeling.Key?n.Indeling.Key:n.Indeling,c,o,h;if(n.allSelected=!1,u)n.Indelingen_tabel=[],n.Multiple=[],c=_.sortBy(l(i.CollectionsData[t].Categories),"Position"),_.each(c,function(t){t.Indeling===e&&t.Key.substr(2,4)===n.Gemeente&&n.Multiple.push(t)}),n.Legend8=n.Multiple.slice(0,8),n.Legend3=n.Legend8.slice(0,3),n.Single=n.Legend3.slice(0,1);else{if(n.Indeling&&(n.Indelingen_tabel=[],n.Indelingen_tabel.push({Key:e})),n.Multiple=[],i.TimeDimension===t&&(o=tt(n),h=it(n),o!==""||h!=="")){_.forEach(i.CollectionsData[t].Categories,function(u){r([e],u.Key,i.Dimensions[t].Type)&&rt(u.Key,i.Dimensions[t].Type,o,h)&&n.Multiple.push(u)});n.Legend8=n.Multiple.slice(-8);f(n,t);n.Indelingen_tabel=[];return}n.Legend8=s(n,t);f(n,t)}}function a(n,t,i){n.allSelected=!1;n.Indeling&&(n.Indelingen_tabel=[]);n.Multiple=i==="map"?n.Legend3:n.Legend8}function f(n,t){n.Legend3=t=="Topics"?n.Legend8.slice(0,3):t===i.TimeDimension?n.Legend8.slice(-3):n.Legend8.slice(0,3);ht(n,t)}function ht(n,t){t=="Topics"?(n.Single=n.Legend3.slice(0,1),n.Single_Table=n.Legend3.length>0?n.Legend3.slice(0,1):n.Multiple.slice(0,1)):n.Single=t===i.TimeDimension?n.Legend3.slice(-1):n.Legend3.slice(0,1)}function v(n,t,i){_.isUndefined(n[0])&&(n.splice(0,n.length),_.isUndefined(t[1])?n.push(i.splice(0,1)[0]):n.push(t.splice(1,1)[0]))}function y(n,t,i){_.isUndefined(n[0])&&(n.splice(0,n.length),_.isUndefined(t[1])?n.push(i.splice(0,1)[0]):n.push(t.splice(1,1)[0]))}function nt(n){n.KolomDimensions[0]!==n.LegendDimension&&(n.KolomDimensions[0]=h(n,n.LegendDimension,n.KolomDimensions[0]))}function ct(n){n.RowDimensions[0]!==n.XAxisDimension&&(n.RowDimensions[0]=h(n,n.XAxisDimension,n.RowDimensions[0]))}function lt(n,t){n.RowDimensions[0]!==t.TimeDimension&&(n.RowDimensions[0]=h(n,t.TimeDimension,n.RowDimensions[0]))}function ii(n,t){n.RowDimensions[0]!==t.GeoDimension&&(n.RowDimensions[0]=h(n,t.GeoDimension,n.RowDimensions[0]))}function ri(n,t){n.RowDimensions[0]!==t.GeoDetail&&(n.RowDimensions[0]=h(n,t.GeoDetail,n.RowDimensions[0]))}function h(n,t,i){var r=p(n.RowDimensions,t);return r!==-1?_.isUndefined(i)?_.remove(n.RowDimensions,function(n){return n===t}):n.RowDimensions[r]=i:(r=p(n.TableDimensions,t),r!==-1?_.isUndefined(i)?_.remove(n.TableDimensions,function(n){return n===t}):n.TableDimensions[r]=i:(r=p(n.KolomDimensions,t),r!==-1&&(_.isUndefined(i)?_.remove(n.KolomDimensions,function(n){return n===t}):n.KolomDimensions[r]=i))),t}function p(n,t){var i=-1,r=0;return _.forEach(n,function(n){i===-1&&n===t&&(i=r);r++}),i}function c(n){var t;n.RowDimensions.length>1&&(t=n.RowDimensions.splice(1,n.RowDimensions.length-1),_.forEach(t,function(t){n.TableDimensions.push(t)}));n.KolomDimensions.length>1&&(t=n.KolomDimensions.splice(1,n.KolomDimensions.length-1),_.forEach(t,function(t){n.TableDimensions.push(t)}))}function ui(n,t,u,f,e){var o=[],s,a=0,v=[],y=f.Key,h=$.inArray(y,n)>-1,c=h?f.Single:f.Multiple,l,p,w;return!h&&f.allSelected&&(c=[]),h?_.forEach(c,function(n){o.push("("+f.Key+" eq '"+n.Key+"')")}):(_.forEach(c,function(n){r(_.map(f.Indelingen_tabel,function(n){return n.Key}),n.Key,i.Dimensions[y].Type)||o.push("("+f.Key+" eq '"+n.Key+"')")}),l=f.Indelingen_tabel,l&&_.forEach(l,function(n){o=[].concat(o,ut(f.Key,i.Dimensions[f.Key].Type,n.Key))})),p=_.map(c,function(n){return n.Key}),w=_.map(l,function(n){return n.Key?n.Key:n}),!h&&f.allSelected?(s=e,a=_.size(e),v=[]):(s=_.filter(e,function(n){return _.includes(p,n.Key)||r(w,n.Key,i.Dimensions[y].Type)}),a=s.length,v=o),{queryOptions:v,count:a,selectedCategories:s}}function at(n,t,u,f){var o=[],l,e=u.Key,y,a=[],s=tt(u),h=it(u),v,c;return e===n?(_.isUndefined(u.Indeling)&&(u.Indeling=_.keys(i.Dimensions[e].Indelingen,0)[0]),v=u.Indeling.Key?u.Indeling.Key:u.Indeling,a=[v],s==""&&h==""||s===h?o=[].concat(o,ut(u.Key,i.Dimensions[e].Type,v)):_.forEach(f,function(n){r(a,n.Key,i.Dimensions[e].Type)&&rt(n.Key,i.Dimensions[e].Type,s,h)&&o.push("("+e+" eq '"+n.Key+"')")})):(c=u.Legend8,u.Key!==t&&u.Single[0]!==undefined&&(c=[u.Single[0]]),_.forEach(c,function(n){o.push("("+u.Key+" eq '"+n.Key+"')")})),y=_.map(c,function(n){return n.Key}),l=_.filter(f,function(n){return(_.includes(y,n.Key)||r(a,n.Key,i.Dimensions[e].Type))&&rt(n.Key,i.Dimensions[e].Type,s,h)}),{queryOptions:o,count:l.length,selectedCategories:l}}function fi(n,t,i,r){var e=[],o,f=i.Key,s,u;return f===n?(u=i.Legend8,_.forEach(u,function(n){e.push("("+f+" eq '"+n.Key+"')")})):(u=i.Legend8,f!==t&&i.Single[0]!==undefined&&(u=[i.Single[0]]),_.forEach(u,function(n){e.push("("+f+" eq '"+n.Key+"')")})),s=_.map(u,function(n){return n.Key}),o=_.filter(r,function(n){return _.includes(s,n.Key)}),{queryOptions:e,count:o.length,selectedCategories:o}}function ei(n,t,u,f){var o=[],h,e=u.Key,c,l=[],s;return e===n?(_.isUndefined(u.Indeling)&&(u.Indeling=_.keys(i.Dimensions[e].Indelingen,0)[0]),o=[].concat(o,ut(e,i.Dimensions[e].Type,u.Indeling)),l=[u.Indeling]):(s=u.Legend3,e!==t&&u.Single[0]!==undefined&&(s=[u.Single[0]]),_.forEach(s,function(n){o.push("("+e+" eq '"+n.Key+"')")})),c=_.map(s,function(n){return n.Key}),h=_.filter(f,function(n){return _.includes(c,n.Key)||r(l,n.Key,i.Dimensions[e].Type)}),{queryOptions:o,count:h.length,selectedCategories:h}}function oi(n,t,u,f){var o=[],h,e=u.Key,c,l=[],s;return e===n?(o=[].concat(o,si(e,i.Dimensions[e].Type,u.Gemeente)),l=[u.Gemeente]):(s=u.Legend3,e!==t&&u.Single[0]!==undefined&&(s=[u.Single[0]]),_.forEach(s,function(n){o.push("("+e+" eq '"+n.Key+"')")})),c=_.map(s,function(n){return n.Key}),h=_.filter(f,function(n){return _.includes(c,n.Key)||r(l,n.Key,i.Dimensions[e].Type)}),{queryOptions:o,count:h.length,selectedCategories:h}}function vt(n,t){if(n.Key!==i.TimeDimension)return null;var r=[],u=t?i.Dimensions[i.TimeDimension].Indelingen[t]:i.Dimensions[i.TimeDimension].Indelingen[n.Indeling],f=function(n,t){return t.Key==="0%"?n.substr(4,1)==="0"||n.substr(4,1)==="1":n.substring(4,6)===t.Key};return _.forEach(i.CollectionsData[n.Key].Categories,function(n,t){f(t,u)&&r.push(n)}),r}function tt(n,t,i){var r="",i,t;return _.isUndefined(n)||(i=i||n.StartValueKey!==undefined&&n.StartValueKey.Key||n.StartValueKey,i!=undefined&&i!=""&&(t=t||n.Indeling,(i.indexOf(t)>-1||t=="0%")&&(r=i))),r}function it(n,t,i){var r="",i,t;return _.isUndefined(n)||(i=i||n.EndValueKey!==undefined&&n.EndValueKey.Key||n.EndValueKey,i!=undefined&&i!=""&&(t=t||n.Indeling,(i.indexOf(t)>-1||t=="0%")&&(r=i))),r}function rt(n,t,i,r){if(t==="TimeDimension"){if(i>n)return!1;if(r!="")return r>=n}return!0}function r(n,t,i){switch(i){case"TimeDimension":case"GeoDimension":return _.some(n,function(n){return n==="0%"?t.substr(4,1)=="0"||t.substr(4,1)=="1":t.indexOf(n)>-1});case"GeoDetail":return _.some(n,function(n){return t.substr(2,4)==n})}return!1}function ut(n,t,i){var r=[];switch(t){case"TimeDimension":i&&i!=="0%"?r.push("(substringof('"+i+"',"+n+"))"):r.push("((substring("+n+",4,1) eq '0') or (substring("+n+",4,1) eq '1'))");break;case"GeoDimension":r.push("(substringof('"+i+"',"+n+"))");break;case"GeoDetail":r.push("(substring("+n+",2,4) eq '"+i+"')")}return r}function si(n,t,i){var r=[];switch(t){case"GeoDetail":r.push("(substring("+n+",2,4) eq '"+i+"')")}return r}function hi(t){var f=di(t.Key,i.Dimensions[t.Key].Type,n.$filter),r=undefined,u=undefined;_.forEach(i.Dimensions[t.Key].Gemeenten,function(n){r===undefined&&(r=n.Key);u===undefined&&f[n.Key]!==undefined&&(u=n.Key)});u!==undefined?t.Gemeente=u:r!==undefined&&(t.Gemeente=r);t.Indelingen_tabel=f.foundInSubstring}function ci(t,r,u){var c=ki(t.Key,i.Dimensions[t.Key].Type,n.$filter,n._gu),e=[],s,f,o,h;_.forEach(i.Dimensions[t.Key].Indelingen,function(n){c[n.Key]!==undefined&&e.push({Key:n.Key,Position:n.Position})});e.length>0&&(t.Indeling=e[0].Key,t.Indelingen_tabel=e,t.SubstringOf=!0);s=li(t,i.Dimensions[t.Key].Type);_.size(s)>0&&(_.isUndefined(e[0])||s[0].Position<e[0].Position)&&(t.Indeling=s[0].Key);_.isUndefined(t.Indeling)&&(t.Indeling=_.size(i.Dimensions[t.Key].Indelingen)>0?_.orderBy(i.Dimensions[t.Key].Indelingen,"Position")[0].Key:"");i.Dimensions[t.Key].Type==="TimeDimension"?t.Multiple.length>0?(t.StartValueKey=_.sortBy(t.Multiple,"Key")[0].Key,t.EndValueKey=_.sortBy(t.Multiple,"Key")[t.Multiple.length-1].Key,ft.GetGraphType()!=="Table"&&(t.Indelingen_tabel=[],t.SubstringOf=!1)):t.Indeling!==""&&(f=vt(t),o=f.length,t.EndValueKey=f[o-1].Key,t.StartValueKey=o>11&&!u?f[o-12].Key:f[0].Key,!u&&r&&(t.Multiple=o>11?f.slice(-12):f)):!u&&r&&(h=_.filter(i.CollectionsData[t.Key].Categories,function(n){return _.startsWith(n.Key,t.Indeling)}),t.Multiple.push(h[0]),t.Indelingen_tabel=[],t.SubstringOf=!1)}function li(n,t){var u=n.Multiple,f=_.uniq(_.map(u,function(n){return ai(t,n)})),r=[];return _.forEach(i.Dimensions[n.Key].Indelingen,function(n,t){_.find(f,function(n){return n===t})&&r.push(n)}),_.sortBy(r,["Position"])}function ai(n,t){switch(n){case"TimeDimension":var i=t.Key.substring(4,6);return(i[0]=="0"||i[0]=="1")&&(i="0%"),i;case"GeoDimension":return t.Key.substring(0,2);case"GeoDetail":return t.Indeling}}function yt(n,t,i){function r(n,t){for(var u={},i=n.exec(t),r;i!==null;)r=i[1],u[r]={Key:r},i=n.exec(t);return u}var u=new RegExp("\\("+n+" eq '([^']*?)'\\)","gi");return result=r(u,i)}function vi(n){var u={},t,e;filteredSearchKeywords=pt(n);for(t in i.Topics){for(var o=i.Topics[t].Title,f=wt(filteredSearchKeywords,o),r=i.Topics[t].ParentId;r!==null&&!f;)e=i.TopicGroups[r].Title,f=wt(filteredSearchKeywords,e),r=i.TopicGroups[r].ParentId;f&&Object.keys(u).length<settings.max_selectable_categories&&(u[t]={Key:t})}return u}function yi(t,r){var u={},e,s,f,c;filteredSearchKeywords=pt(r);e=_.orderBy(l(i.Dimensions[t].Categories),"Position");for(s in e){var o=e[s],a=o.Title,h=!1;for(f=0;f<filteredSearchKeywords.length;f++)if(a.toLowerCase().search(filteredSearchKeywords[f].toLowerCase())!=-1){h=!0;break}h&&Object.keys(u).length<settings.max_selectable_categories&&(u[o.Key]=o)}return Object.keys(u).length<1?(c=i.Dimensions[t].Type,yt(t,c,n.$filter)):u}function pt(n){for(var u=t.instant("dictionary.SpecialeTekensVoorZoekparameters"),e,r,f,u=u.split(" "),i=0;i<u.length;i++)e=new RegExp(pi(u[i]),"g"),n=n.replace(e,"");for(r=n.toLowerCase().split(" "),f=t.instant("dictionary.FilterVoorZoekparameters"),f=f.toLowerCase().split(" "),i=0;i<r.length;i++)(f.indexOf(r[i])!=-1||r[i].length<=1)&&(r.splice(i,1),i--);return r}function pi(n){return n.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function wt(n,t){for(var r=!1,i=0;i<n.length;i++)if(t.toLowerCase().search(n[i].toLowerCase())!=-1){r=!0;break}return r}function wi(n){var t={};return n!==undefined&&_.forEach(n.split(", "),function(n){t[n]={Key:n}}),t}function bi(n,t,i){var u=[],s,f,e,r;if(_.forEach(n,function(n,i){t[i]!==undefined&&u.push({Key:i,Position:t[i].Position})}),s=[],angular.equals([],u)){f=[];_.forEach(t,function(n){f.push(n)});e=o(f);r=[];switch(i){case"first":r=e.slice(0,1);break;case"last":r=e.slice(-12)}return r}return o(u)}function o(n){return n.sort(function(n,t){return bt(+n.Position-+t.Position)}),n}function bt(n){return n<0?-1:n>0?1:0}function ki(n,t,i,r){function o(n,t){for(var u={},i=n.exec(t),r;i!==null;)r=i[1],u[r]={Key:r},i=n.exec(t);return u}var f={},u,e;switch(t){case"TimeDimension":u=new RegExp("\\(substringof\\('([^']*?)',"+n+"\\)\\)","gi");f=o(u,i);break;case"GeoDimension":u=new RegExp("\\(substringof\\('([^']*?)',"+n+"\\)\\)","gi");f=o(u,i);break;case"GeoDetail":if(_.isUndefined(r))return{};e=kt(r);f[e]={Key:e}}return f}function di(n,t,i){function f(n,t){for(var r={foundInSubstring:[]},i=n.exec(t),u;i!==null;)u=i[1]||i[2],r[u]={Key:u},i[1]&&r.foundInSubstring.push({Key:i[1]}),i=n.exec(t);return r}var r={},u;switch(t){case"GeoDetail":u=new RegExp("\\(substring\\("+n+",2,4\\) eq '([^']*?)'\\)|\\("+n+" eq '.{2}(.{4})","gi");r=f(u,i)}return r}function l(n){var t=[];return _.forEach(n,function(n){t.push(n)}),t}var ft=this,kt;this.GetGraphType=function(){var t=[];return _.forEach(i.GraphTypes,function(i){n.graphtype&&n.graphtype.toLowerCase()===i.toLowerCase()&&t.push(i)}),t.length===0&&t.push("Table"),t.join("")};this.GetLegendDimension=function(){var t=[];return _.forEach(i.Collections,function(i){n._ed&&n._ed===i&&t.push(i)}),t.length===0&&t.push(i.LegendDimension),t.join("")};this.GetXAxisDimension=function(){var t=[];return _.forEach(i.Collections,function(i){n._td&&n._td.toLowerCase()===i.toLowerCase()&&t.push(i)}),t.length===0&&t.push(i.XAxisDimension),t.join("")};this.GetCollections=function(){var t={};return _.forEach(i.Collections,function(r){var u,e,h,c,l;t[r]={Key:r,Multiple:[],SubstringOf:!1};r==="Topics"?(u={},n.searchKeywords!==undefined&&(u=vi(n.searchKeywords)),Object.keys(u).length==0&&(u=wi(n.$select),_.isUndefined(i.DefaultSelection)||_.isEmpty(Object.keys(i.DefaultSelection)[0])||Object.keys(u).length!=0||(t[r].allSelected=!0),n.dl&&!n.$select&&(t[r].allSelected=!0)),t[r].Multiple=bi(u,i.Topics,"first"),t[r].Legend8=w(t[r].Multiple),f(t[r],t[r].Key)):(u={},e=i.Dimensions[r].Type,u=n.searchKeywords!==undefined?yi(r,n.searchKeywords):yt(r,e,n.$filter),h=[],c=i.Dimensions[r].Categories,_.forEach(u,function(n,t){c[t]!==undefined&&h.push(n)}),t[r].Multiple=o(h),t[r].Indelingen_tabel=[],e!=="Dimension"?ci(t[r],et(),_.has(n,"dl")):!_.has(n,"dl")&&et()&&(l=_.sortBy(i.CollectionsData[r].Categories,"Position"),t[r].Multiple.push(l[0]),t[r].Indelingen_tabel=[],t[r].SubstringOf=!1),e==="GeoDetail"&&hi(t[r]),dt(t[r]),t[r].Legend8=s(t[r],t[r].Key),f(t[r],t[r].Key))}),t};this.GetLegendTypeF=function(){return function(){var n=this.GraphType;switch(!0){case n==="Table":return"Multiple";case n==="Line":case n==="Bar":return"Legend8";case n==="Map":return"Legend3"}return"Legend8"}};this.SetIndelingen=function(n,t){var i=this.Collections[n];i.Indelingen_tabel=t;i.Legend8=s(i,n);f(i,n)};this.SetIndeling=function(n,t,r){var e=_.isUndefined(t.Key)?t:t.Key,u=this.Collections[n],o=i.CollectionsData[n],f,h,c,s;switch(o.Type){case"GeoDetail":c=i.Dimensions[n].Gemeenten;s=_.map(_.orderBy(c,"Title"),"Key");r!=="%%"&&_.find(s,function(n){return n===r})||(r=s[0]);u.Indeling=t;u.Gemeente=r;break;case"TimeDimension":f=e==="0%"?function(n){return n.Key.substring(4,5)==="0"||n.Key.substring(4,5)==="1"}:function(n){return n.Key.substring(4,6)===e};h=_.filter(o.Categories,f);u.Indeling=t;break;case"GeoDimension":f=function(n){return n.Key.substring(0,2)===e};h=_.filter(o.Categories,f);u.Indeling=t}};this.ToggleCategoriesItemsF=function(){function r(n,t){var i=-1,r=0;return _.forEach(n,function(n){i===-1&&n.Key===t&&(i=r);r++}),i}function n(n,t){var i=[];return _.forEach(t,function(t){var u=t,f=r(n,u);f>=0?i.push(n.splice(f,1)[0]):n.push({Key:u})}),i}function t(n,t){result=[];_.forEach(t,function(t){r(n,t.Key)>=0&&result.push({Key:t.Key,Position:t.Position})});result.sort(function(n,t){return bt(+n.Position-+t.Position)});angular.copy(result,n)}return function(r,u,e){var o,h,v,y,l,a,p;switch(e){case"Multiple":o=this.Collections[u];h=o.Multiple;n(h,r);u=="RegioS"?h.length>settings.max_selectable_categories_geo&&h.splice(settings.max_selectable_categories_geo):h.length>settings.max_selectable_categories&&h.splice(settings.max_selectable_categories);t(h,i.CollectionsData[u].Categories);o.Legend8=u!="Topics"?s(o,u):w(o.Multiple);f(o,u);break;case"Legend8":var o=this.Collections[u],h=o.Legend8,c=n(h,r);h.length>8&&h.splice(8);h.length===0&&h.push(c[c.length-1]);t(h,i.CollectionsData[u].Categories);f(o,u);break;case"Legend3":var o=this.Collections[u],h=o.Legend3,c=n(h,r);h.length>3&&h.splice(3);h.length===0&&h.push(c[c.length-1]);t(h,i.CollectionsData[u].Categories);o.Legend8=o.Legend3.slice(0,8);ht(o,u);break;case"Single":var o=this.Collections[u],h=o.Single,c=n(h,r);if(h.length>1&&h.splice(0,h.length-1),h.length===0&&h.push(c[c.length-1]),t(h,i.CollectionsData[u].Categories),l=o.Single[0],this.GraphType==="Table"){var a=_.some(o.Multiple,function(n){return n.Key===l.Key}),b=_.map(o.Indelingen_tabel,"Key"),k=ft.inIndelingen(b,l.Key,i.Dimensions[u].Type);a||k||(o.Multiple=o.Single.slice(0,settings.max_selectable_categories),o.Indelingen_tabel=[],o.Legend8=o.Single.slice(0,8),o.Legend3=o.Single.slice(0,3))}else v=this.GraphType!=="Map"?"Legend8":"Legend3",y=_.some(o[v],function(n){return n.Key===l.Key}),y||(o.Legend8=o.Single.slice(0,8),o.Legend3=o.Single.slice(0,3));break;case"Single_Table":var o=this.Collections[u],h=o.Single_Table,c=n(h,r);h.length>1&&h.splice(0,h.length-1);h.length===0&&h.push(c[c.length-1]);t(h,i.CollectionsData[u].Categories);l=o.Single_Table[0];a=_.some(o.Multiple,function(n){return n.Key===l.Key});a||(o.Multiple=o.Single_Table.slice(0,settings.max_selectable_categories),o.Indelingen_tabel=[],p=o.Single_Table[0].Key,i.CollectionsData[u].Categories[p].Datatype!="String"&&(o.Single=o.Single_Table.slice(0,1),o.Legend8=o.Single.slice(0,8),o.Legend3=o.Single.slice(0,3)))}}};this.GetTopicsFilter=function(){return ot(this)};this.GetDimensionSelectionF=function(n){return function(t){return st(n,this,t)}};this.GetSelectionF=function(n){return function(){var t=this,i,e=[],c=1,o=1,s=1,r=0,u,h,f;return _.forEach(this.Collections,function(r,u){var f=[];u!=="Topics"&&(i=st(n,t,u),f=[].concat(f,i.queryOptions),$.inArray(u,t.RowDimensions)>-1&&(o*=i.count),$.inArray(u,t.KolomDimensions)>-1&&(s*=i.count),c*=i.count);f.length>0&&e.push("("+f.join(" or ")+")")}),u=[],h=ot(this),this.GraphType==="Table"&&this.Collections.Topics.allSelected&&h!=="Single_Table"?_.forEach(n.CollectionsData.Topics.Categories,function(){r++}):(_.forEach(n.Collections,function(n){n!=="Topics"&&u.push(n)}),_.forEach(this.Collections.Topics[h],function(n){u.push(n.Key);r++})),f={},e.length>0&&(f.$filter=e.join(" and ")),u.length>0&&(f.$select=u.join(", ")),$.inArray("Topics",t.RowDimensions)>-1&&(o*=r),$.inArray("Topics",t.KolomDimensions)>-1&&(s*=r),{queryOptions:f,count:c*r,rowsCount:o,columnsCount:s}}};this.GetValidationForLineBar=function(n,t){if(n.LegendDimension!==""&&n.LegendDimension===t.TimeDimension){console.log("LegendDimension is TimeDimension: Switch Axis.");var i=n.LegendDimension;n.LegendDimension=n.XAxisDimension;n.XAxisDimension=i}(n.LegendDimension===""||n.LegendDimension===t.TimeDimension)&&(console.log("LegendDimension is empty or TimeDimension: Topics to Legend."),n.LegendDimension="Topics");n.XAxisDimension!==t.TimeDimension&&(console.log("TimeDimension to XAxis."),n.XAxisDimension=t.TimeDimension)};this.GetValidationForBarHorizontal=function(n,t){n.LegendDimension===""&&(console.log("LegendDimension is empty: Topics to Legend"),n.LegendDimension="Topics");(_.isNull(n.XAxisDimension)||n.XAxisDimension==="")&&(console.log("XAxisDimension is empty: First dimension to XAxisDimension"),n.XAxisDimension=t.Collections[0]);n.XAxisDimension===n.LegendDimension&&(console.log("XAxisDimension is LegendDimension: Topics to Legend"),n.LegendDimension="Topics")};this.GetValidationForGeoMap=function(n,t){if(n.LegendDimension!==""&&n.LegendDimension===t.GeoDimension){console.log("LegendDimension is GeoDimension: Switch Axis.");var i=n.LegendDimension;n.LegendDimension=n.XAxisDimension;n.XAxisDimension=i}(n.LegendDimension===""||n.LegendDimension===t.GeoDimension)&&(console.log("LegendDimension is empty or GeoDimension: Topics to Legend."),n.LegendDimension="Topics");n.XAxisDimension!==t.GeoDimension&&(console.log("GeoDimension to XAxis."),n.XAxisDimension=t.GeoDimension)};this.GetValidationForDetailMap=function(n,t){if(n.LegendDimension!==""&&n.LegendDimension===t.GeoDetail){console.log("LegendDimension is GeoDetail: Switch Axis.");var i=n.LegendDimension;n.LegendDimension=n.XAxisDimension;n.XAxisDimension=i}(n.LegendDimension===""||n.LegendDimension===t.GeoDetail)&&(console.log("LegendDimension is empty or GeoDetail: Topics to Legend, GeoDetail to XAxis."),n.LegendDimension="Topics");n.XAxisDimension!==t.GeoDetail&&(console.log("GeoDetail to XAxis."),n.XAxisDimension=t.GeoDetail)};this.TransformToTable=function(n,t){switch(n.PreviousType.toLowerCase()){case"barv":case"line":t.HasTimeDimension&&n.RowDimensions[0]!=t.TimeDimension&&lt(n,t);nt(n,t);c(n);g(n.Collections[t.TimeDimension],t.TimeDimension);a(n.Collections[n.LegendDimension],n.LegendDimension,"line");n.Collections.Topics.Single_Table=n.Collections.Topics.Single;e(n);break;case"barh":ct(n,t);nt(n,t);a(n.Collections[n.LegendDimension],n.LegendDimension,"barh");a(n.Collections[n.XAxisDimension],n.XAxisDimension,"barh");n.Collections.Topics.Single_Table=n.Collections.Topics.Single;e(n);break;case"map":ct(n,t);nt(n,t);a(n.Collections[n.LegendDimension],n.LegendDimension,"map");g(n.Collections[n.XAxisDimension],n.XAxisDimension,t.HasGeoDetail);n.Collections.Topics.Single_Table=n.Collections.Topics.Single;e(n)}};this.TransformToLineBar=function(n,t){switch(n.PreviousType.toLowerCase()){case"table":gt(n,t);n.RowDimensions[0]!=t.TimeDimension&&lt(n,t);v(n.RowDimensions,n.KolomDimensions,n.TableDimensions);y(n.KolomDimensions,n.RowDimensions,n.TableDimensions);c(n);u(n.Collections[n.KolomDimensions[0]],n.KolomDimensions[0]);u(n.Collections[n.RowDimensions[0]],n.RowDimensions[0]);e(n);break;case"barh":ti(n,t);n.LegendDimension===t.TimeDimension&&(n.LegendDimension=n.XAxisDimension);n.XAxisDimension=t.TimeDimension;break;case"map":ni(n,t);n.XAxisDimension=t.TimeDimension;n.LegendDimension===t.TimeDimension&&(n.LegendDimension=t.GeoDimension||t.GeoDetail)}};this.TransformToBarHorizontal=function(n,t){switch(n.PreviousType.toLowerCase()){case"table":v(n.RowDimensions,n.KolomDimensions,n.TableDimensions);y(n.KolomDimensions,n.RowDimensions,n.TableDimensions);c(n);u(n.Collections[n.KolomDimensions[0]],n.KolomDimensions[0]);u(n.Collections[n.RowDimensions[0]],n.RowDimensions[0]);e(n);break;case"barv":case"line":g(n.Collections[t.TimeDimension],t.TimeDimension);break;case"map":n.XAxisDimension=t.GeoDimension||t.GeoDetail}};this.TransformToGeoMap=function(n,t){switch(n.PreviousType.toLowerCase()){case"table":n.RowDimensions[0]!=t.GeoDimension&&ii(n,t);v(n.RowDimensions,n.KolomDimensions,n.TableDimensions);y(n.KolomDimensions,n.RowDimensions,n.TableDimensions);c(n);u(n.Collections[n.KolomDimensions[0]],n.KolomDimensions[0]);u(n.Collections[n.RowDimensions[0]],n.RowDimensions[0]);e(n);break;case"barv":case"line":n.LegendDimension===t.GeoDimension&&(n.LegendDimension=n.TimeDimension);n.XAxisDimension=t.GeoDimension;break;case"barh":n.LegendDimension===t.GeoDimension&&(n.LegendDimension=n.XAxisDimension);n.XAxisDimension=t.GeoDimension}var r=function(){var i=t.CollectionsData[t.GeoDimension].Indelingen,n=[];return _.forEach(i,function(t){t.Key!="NL"&&n.push(t)}),n.sort(function(n,t){return n.Position>t.Position?1:n.Position<t.Position?-1:0})},i=n.Collections[t.GeoDimension].Indeling;i=="NL"&&(i=r()[0].Key);n.SetIndeling(t.GeoDimension,i)};this.TransformToGeoDetail=function(n,t){switch(n.PreviousType.toLowerCase()){case"table":n.RowDimensions[0]!=t.GeoDetail&&ri(n,t);v(n.RowDimensions,n.KolomDimensions,n.TableDimensions);y(n.KolomDimensions,n.RowDimensions,n.TableDimensions);c(n);u(n.Collections[n.KolomDimensions[0]],n.KolomDimensions[0]);u(n.Collections[n.RowDimensions[0]],n.RowDimensions[0]);e(n);break;case"barv":case"line":n.LegendDimension===t.GeoDetail&&(n.LegendDimension=n.TimeDimension);n.XAxisDimension=t.GeoDetail;break;case"barh":n.LegendDimension===t.GeoDetail&&(n.LegendDimension=n.XAxisDimension);n.XAxisDimension=t.GeoDetail}n.SetIndeling(t.GeoDetail,n.Collections[t.GeoDetail].Indeling,n.Collections[t.GeoDetail].Gemeente)};this.inIndelingen=r;this.GetStartValue=tt;this.GetEndValue=it;this.GetValuesInTimeDimension=vt;kt=function(n){var t=[];return _.forEach(i.Dimensions[i.GeoDetail].Indelingen,function(i){n.toLowerCase()===i.Key.toLowerCase()&&t.push(i.Key)}),t.length===0&&t.push("WK"),t.join("")}}return i}])}(),function(){angular.module("odata").factory("odataCatalogService",["$http","$q","$httpParamSerializer","$translate",function(n,t,i,r){function s(n){var i=t.defer();return f(i,"Tables",n),i.promise}function h(n){var i=t.defer();return f(i,"Themes",n),i.promise}function c(){var n=t.defer();return f(n,"Tables_Themes"),n.promise}function f(i,u,f){var h=r.instant("dictionary.Timeout"),e=!1,s=t.defer();setTimeout(function(){e=!0;s.resolve()},+default_settings.http_timeout);n({method:"GET",url:o+u+l(f),timeout:s.promise,headers:{"Content-Type":"application/json"}}).success(function(n){i.resolve(n)}).error(function(n){e?i.reject({error:"timeout",message:h}):i.reject(n)})}function l(n){var t=i(n);return t!==""?"?"+t:""}var e=settings.HOST_PREFIX,o=e+"ODataCatalog/",u={};return u.GetThemes=h,u.GetTablesThemes=c,u.GetTables=s,u}])}(),function(){angular.module("odata").factory("odataCatalogRepository",["$q","odataCatalogService","localStorageService",function(n,t,i){function u(n){var t=i.get("creationTimestamp");return t!==null&&(new Date).getDate()!==new Date(t).getDate()?(i.clearAll(),null):i.get(n)}function f(n,t){var r=i.get("creationTimestamp");r===null&&i.set("creationTimestamp",new Date);i.set(n,t)}function o(t){var r=n.defer(),i=[];return _.forEach(t,function(n){var t=u("Table:"+n);_.isNull(t)||i.push(t)}),!_.isUndefined(i)&&i.length>0&&!_.isNull(_.get(i,0))?r.resolve(i):r.reject("tables not found in storage."),r.promise}function e(n){_.forEach(_.get(n,"value"),function(n){var t=_.get(n,"ID");f("Table:"+t,n)})}function s(i){var r=n.defer();return t.GetTables(i,[{key:"PublicationChangedDate",value:"[NOW-4YEAR/YEAR TO NOW/YEAR]"}]).then(function(n){e(n);r.resolve(n)}),r.promise}function h(i,r){return o(r).then(function(u){var f=n.defer(),h=_.keyBy(u,function(n){return n.ID}),o=_.difference(r,_.keys(h)),s;return _.size(o)>0?(s=[{key:"PublicationKey",value:{values:o,predicat:"OR"}}],t.GetTables(i,s).then(function(n){e(n);f.resolve({value:_.concat(u,_.get(n,"value"))})})):f.resolve({value:u}),f.promise},function(){var n=[{key:"PublicationKey",value:{values:r,predicat:"OR"}}];return t.GetTables(i,n).then(function(n){return e(n),n})})}function c(i){var e=u("Themes:"+JSON.stringify(i)),r;return e!==null?(r=n.defer(),r.resolve(e),r.promise):t.GetThemes(i).then(function(n){return f("Themes:"+JSON.stringify(i),n),n})}function l(i){var e=u("TablesThemes:"+JSON.stringify(i)),r;return e!==null?(r=n.defer(),r.resolve(e),r.promise):t.GetTablesThemes(i).then(function(n){return f("TablesThemes:"+JSON.stringify(i),n),n})}var r={};return r.GetTables=h,r.GetThemes=c,r.GetTablesThemes=l,r.GetChangedTablesLastMonthUntilNow=s,r}])}(),function(){angular.module("odata").factory("odataTableService",["$http","$q","$httpParamSerializer","$translate",function(n,t,i,r){function h(n){return f(n,"DataProperties")}function c(n){return f(n,"TableInfos")}function l(n,t,i){return f(n,"TypedDataSet",t,i)}function a(n,t,i){return f(n,"UntypedDataSet",t,i)}function v(n,t){return f(n,t)}function y(n){return f(n,"CategoryGroups")}function f(n,i,r,u){var f=t.defer();return p(f,w(n,i),r,u,i==="UntypedDataSet"||i==="TypedDataSet"),f.promise}function p(i,u,f,e,h){var v=r.instant("dictionary.Timeout"),y=r.instant("dictionary.Unretrievable"),p=r.instant("dictionary.NotFound"),c=!1,l=t.defer(),a=this;a.omitID=h;setTimeout(function(){c=!0;l.resolve()},+default_settings.http_timeout);n({method:"GET",url:s(e)+u+b(f),timeout:l.promise,headers:{"Content-Type":"application/json",Accept:"application/json"}}).success(function(n){if(a.omitID){var t=[];_.each(n.value,function(n){t.push(_.omit(n,"ID"))});n.value=t}o(i,n,n["odata.nextLink"])}).error(function(n,t){t===403?i.reject({error:n,message:n}):t===404?i.reject({error:"notfound",message:p}):c?i.reject({error:"timeout",message:v}):i.reject({error:"unretrievable",message:y})})}function o(t,i,r){_.isUndefined(r)?t.resolve(i):n({method:"GET",url:r}).success(function(n){i.value=i.value.concat(n.value);o(t,i,n["odata.nextLink"])}).error(function(n){t.reject(n)})}function w(){return[].slice.call(arguments).join("/")}function b(n){var t=i(n);return t!==""?"?"+t:""}var e=settings.HOST_PREFIX,s=function(n){return n?e+settings.BULK_PREFIX:e+settings.API_PREFIX},u={};return u.GetDataProperties=h,u.GetTableInfos=c,u.GetTypedDataSet=l,u.GetUnTypedDataSet=a,u.GetCollection=v,u.GetCategoryGroups=y,u}])}(),function(){angular.module("odata").factory("odataTableRepository",["$q","odataTableService","localStorageService",function(n,t,i){return function(r,u){function e(n){var t=i.get("creationTimestamp");return t!==null&&(new Date).getDate()!==new Date(t).getDate()?(i.clearAll(),null):i.get(n)}function o(n,t){var r=i.get("creationTimestamp");r===null&&i.set("creationTimestamp",new Date);i.set(n,t)}function h(){return r}function c(){var f=e("TableInfos:"+r),i;return f===null||u?t.GetTableInfos(r).then(function(n){return o("TableInfos:"+r,n),n}):(i=n.defer(),i.resolve(f),i.promise)}function l(){var f=e("DataProperties:"+r),i;return f===null||u?t.GetDataProperties(r).then(function(n){return o("DataProperties:"+r,n),n}):(i=n.defer(),i.resolve(f),i.promise)}function a(i){var f=n.defer(),s={},h=i.length;return _.forEach(i,function(i){var l=function(n){return s[i]=n,h--,h===0&&f.resolve(s),n},a=e(i+":"+r),c;a===null||u?t.GetCollection(r,i).then(function(n){return o(i+":"+r,n),n}).then(l,function(n){f.reject(n)}):(c=n.defer(),c.resolve(a),c.promise.then(l))}),f.promise}function v(){var f=e("CategoryGroups:"+r),i;return f===null||u?t.GetCategoryGroups(r).then(function(n){return o("CategoryGroups:"+r,n),n}):(i=n.defer(),i.resolve(f),i.promise)}function y(n,i){return t.GetUnTypedDataSet(r,n,i)}function s(){var t=n.defer(),i={},u=2,e=function(n){return function(r){i[n]=r;f[n]=r;u--;u==0&&t.resolve(i)}},o=function(n){t.reject(n)};return c(r).then(e("TableInfos"),o),l(r).then(e("DataProperties"),o),t.promise}function p(){var t=n.defer(),i={};return s().then(function(n){i=n;var r=w();r.length>0?a(r).then(function(n){_.forEach(n,function(n,t){i[t]=n;f[t]=n});v().then(function(n){i.CategoryGroups=n.value;t.resolve(i)},function(){console.log("EntityCollection CategoryGroups not found");t.resolve(i)})},function(n){t.reject(n)}):t.resolve(i)},function(n){t.reject(n)}),t.promise}function w(){if(f.DataProperties===undefined)throw"Metadata DataProperties not loaded";var n=[];return _.forEach(f.DataProperties.value,function(t){b(t.Type)&&n.push(t.Key)}),n}function b(n){switch(n){case"Dimension":case"TimeDimension":case"GeoDimension":case"GeoDetail":return!0}return!1}var k=this,r=r,f={};typeof u=="undefined"&&(u=!1);this.GetTableName=h;this.GetTableDataBasic=s;this.GetTableDataFull=p;this.GetUnTypedDataSet=y}}])}(),function(){angular.module("solr").factory("solrService",["$http","$q","$httpParamSerializer","$translate",function(n,t,i,r){function f(n,i,u){var f=t.defer();return e(n,i,u).then(function(n){var t=n,i=t.value;t.value=_.map(i,function(n){return n.Frequency=r.instant("frequency."+n.Frequency),n.ReasonDelivery=r.instant("reasonDelivery."+n.ReasonDelivery),n});f.resolve(t)},function(n){f.reject(n)}),f.promise}function e(i,r,u){var f=t.defer(),e=_.template("<%=solrCatalog %>/select?q=<%= query %><%= filterQuery %>&sort=<%= sort %>&wt=json"),o=function(){var n=i.numberOfRows;return(_.isUndefined(n)||_.isNull(n))&&(n="2147483647"),"*:*&rows="+n},s=function(n){if(!_.isUndefined(n)&&_.isArray(n)&&n.length>0){var t=_.map(n,function(n){return _.isObject(n.value)?n.key+":("+_.join(_.get(n.value,"values")," "+_.get(n.value,"predicat")+" ")+")":n.key+":"+n.value});return"&fq=".concat(_.join(t," &fq="))}return""},h=function(n){return _.isUndefined(n)||_.isNull(n)||_.isUndefined(n.key)||_.isUndefined(n.order)?"":n.key+" "+n.order},c=function(n,t){return n+"_"+t};return n({method:"GET",url:settings.SOLR_SERVICE+e({solrCatalog:c(i.catalog,i.language),query:o(),filterQuery:s(r),sort:h(u)})}).success(function(n){var t=function(n){return{value:_.map(n,function(n){return _.transform(n,function(n,t,i){var r=i.replace("Publication","");r==="Key"?r="ID":r==="ChangedDate"&&(r="Modified");n[r]=t})})}};return f.resolve(t(n.response.docs))}).error(function(n){f.reject(n)}),f.promise}var u={};return u.GetTables=f,u}])}(),function(){angular.module("solr").factory("solrRepository",["$q","solrService","localStorageService",function(n,t,i){function f(n){var t=i.get("creationTimestamp");return t!==null&&(new Date).getDate()!==new Date(t).getDate()?(i.clearAll(),null):i.get(n)}function e(n,t){var r=i.get("creationTimestamp");r===null&&i.set("creationTimestamp",new Date);i.set(n,t)}function o(t){var r=n.defer(),i=[];return _.forEach(t,function(n){var t=f("Table:"+n);_.isNull(t)||i.push(t)}),!_.isUndefined(i)&&i.length>0&&!_.isNull(_.get(i,0))?r.resolve(i):r.reject("tables not found in storage."),r.promise}function u(n){_.forEach(_.get(n,"value"),function(n){var t=_.get(n,"ID");e("Table:"+t,n)})}function s(i){var r=n.defer(),f=[{key:"PublicationChangedDate",value:"[NOW/MONTH-1MONTHS TO NOW]"}];return _.isUndefined(settings.testSolrLastMonthFilter)||(f=settings.testSolrLastMonthFilter),t.GetTables(i,f,{key:"PublicationChangedDate",order:"desc"}).then(function(n){u(n);r.resolve(n)},function(n){r.reject(n)}),r.promise}function h(i,r){return o(r).then(function(f){var e=n.defer(),h=_.keyBy(f,function(n){return n.ID}),o=_.difference(r,_.keys(h)),s;return _.size(o)>0?(s=[{key:"PublicationKey",value:{values:o,predicat:"OR"}}],t.GetTables(i,s).then(function(n){u(n);e.resolve({value:_.concat(f,_.get(n,"value"))})})):e.resolve({value:f}),e.promise},function(){var f=n.defer(),e=[{key:"PublicationKey",value:{values:r,predicat:"OR"}}];return t.GetTables(i,e).then(function(n){u(n);f.resolve(n)},function(n){f.reject(n)}),f.promise})}var r={};return r.GetTables=h,r.GetChangedTablesLastMonthUntilNow=s,r}])}(),function(){angular.module("sitecore").factory("sitecoreService",["$http","$q","$httpParamSerializer",function(n,t){function r(n){return _.isNull(n)?null:n==="nl"?"nl-NL":"en-GB"}function f(n,t,i,u,f,e,o){var s,c=_.curry(function(n,t,i){if(_.isNull(n)||_.isNull(t))return i;var r=_.template("<%=odataUrl %>&$orderby=<%= field %> <%= direction %>"),u={odataUrl:i,field:n,direction:t};return _.flow([r])(u)}),h;return s=_.isNull(i)?_.template("https://<%= odataSiteCoreServer %>GetSearchResultsByPath(Path='<%= path %>')?$top=<%= top %>&$filter=Type eq '<%= type%>'"):_.template("https://<%= odataSiteCoreServer %>GetSearchResultsByPath(Path='<%= path %>')?$top=<%= top %>&$filter=Type eq '<%= type%>' and Language eq '<%= lang%>'"),h={odataSiteCoreServer:n,path:t,top:_.isUndefined(f)?1:f,type:u,lang:r(i)},_.flow([s,c.bind(this,e,o)])(h)}function e(n){var i=t.defer(),r=[];return n.forEach(function(n){return r.push($.ajax({url:encodeURI(n),type:"GET",dataType:"json",Accept:"application/json"}))}),t.all(r).then(function(n){i.resolve(n)},function(n){i.reject(n)}),i.promise}function i(n){var i=t.defer();return $.ajax({url:encodeURI(n),type:"GET",dataType:"json",Accept:"application/json",success:function(n){i.resolve(n)},error:function(n){i.reject(n)}}),i.promise}function u(n,t,r,u,e,o,s){return _.flow([f,i])(n,s,t,r,u,e,o)}function o(n,t,i){return _.isArray(i)?{odataSiteCoreServer:n,filter:_.join(_.map(i,function(n){return" UniqueId eq '".concat(_.toLower(n)).concat("-").concat(_.toLower(r(t))).concat("'")})," or")}:_.isString(i)?{odataSiteCoreServer:n,filter:" UniqueId eq '".concat(_.toLower(i)).concat("-").concat(_.toLower(r(t))).concat("'")}:{odataSiteCoreServer:n,filter:null}}function s(n,t,i){return _.flow([o,_.template("https://<%= odataSiteCoreServer %>Pages?$filter=<%= filter %>")])(n,t,i)}function h(n,t,r){return _.flow([s,i])(n,t,r)}function c(n){return e(n)}function l(n){return i(n)}function a(n){return i(n)}function v(n,t,i,r,f,e){return _.flow([u])(n,t,"Page",i,r,f,e)}function y(n,t,i,r,f,e){return _.flow([u])(n,t,"Definition",i,r,f,e)}return{getPageByUniqueId:h,getPages:c,getPagesByPath:v,getDefinition:l,getDefinitions:a,getDefinitionsByPath:y}}])}(),function(){angular.module("odata").factory("searchService",["$http","$q","$httpParamSerializer",function(n,t,i){function e(n,i,r,u,f){var e=t.defer(),h={q:r,wt:"json",start:(+u-1)*10,facet:"true"};return o(e,s(n,i),h,f),e.promise}function o(t,i,r,e){n({method:"GET",url:u+i+"select"+c(r)+f+h(e)}).success(function(n){t.resolve(n)}).error(function(n){t.reject(n)})}function s(n,t){return n+"_"+t+"/"}function h(n){var t="",i;return _.each(["PublicationThemeID","GeoFacet","TimeFacet"],function(r){n&&n[r]&&n[r].length>0&&(i=_.map(n[r],function(n){return'"'+encodeURIComponent(n)+'"'}),t+="&fq="+r+":("+i.join(" OR ")+")")}),t}function c(n){var t=i(n);return t!==""?"?"+t:""}var u=settings.SOLR_SERVICE,r={},f="&facet.field=TimeFacet&facet.field=GeoFacet&facet.field=PublicationThemeID&facet.limit=-1";return r.GetSearchResults=e,r}])}(),function(n){"use strict";var t,i;if(n.URL=n.URL||n.webkitURL,n.Blob&&n.URL)try{new Blob;return}catch(r){}t=n.BlobBuilder||n.WebKitBlobBuilder||n.MozBlobBuilder||function(n){var s=function(n){return Object.prototype.toString.call(n).match(/^\[object\s(.*)\]$/)[1]},h=function(){this.data=[]},t=function(n,t,i){this.data=n;this.size=n.length;this.type=t;this.encoding=i},u=h.prototype,r=t.prototype,c=n.FileReaderSync,l=function(n){this.code=this[this.name=n]},a="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),f=a.length,i=n.URL||n.webkitURL||n,v=i.createObjectURL,y=i.revokeObjectURL,e=i,p=n.btoa,w=n.atob,b=n.ArrayBuffer,o=n.Uint8Array,k=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(t.fake=r.fake=!0;f--;)l.prototype[a[f]]=f+1;return i.createObjectURL||(e=n.URL=function(n){var t=document.createElementNS("http://www.w3.org/1999/xhtml","a"),i;return t.href=n,"origin"in t||(t.protocol.toLowerCase()==="data:"?t.origin=null:(i=n.match(k),t.origin=i&&i[1])),t}),e.createObjectURL=function(n){var u=n.type,r;return(u===null&&(u="application/octet-stream"),n instanceof t)?(r="data:"+u,n.encoding==="base64")?r+";base64,"+n.data:n.encoding==="URI"?r+","+decodeURIComponent(n.data):p?r+";base64,"+p(n.data):r+","+encodeURIComponent(n.data):v?v.call(i,n):void 0},e.revokeObjectURL=function(n){n.substring(0,5)!=="data:"&&y&&y.call(i,n)},u.append=function(n){var i=this.data,e;if(o&&(n instanceof b||n instanceof o)){for(var u="",f=new o(n),r=0,h=f.length;r<h;r++)u+=String.fromCharCode(f[r]);i.push(u)}else if(s(n)==="Blob"||s(n)==="File")if(c)e=new c,i.push(e.readAsBinaryString(n));else throw new l("NOT_READABLE_ERR");else n instanceof t?n.encoding==="base64"&&w?i.push(w(n.data)):n.encoding==="URI"?i.push(decodeURIComponent(n.data)):n.encoding==="raw"&&i.push(n.data):(typeof n!="string"&&(n+=""),i.push(unescape(encodeURIComponent(n))))},u.getBlob=function(n){return arguments.length||(n=null),new t(this.data.join(""),n,"raw")},u.toString=function(){return"[object BlobBuilder]"},r.slice=function(n,i,r){var u=arguments.length;return u<3&&(r=null),new t(this.data.slice(n,u>1?i:this.data.length),r,this.encoding)},r.toString=function(){return"[object Blob]"},r.close=function(){this.size=0;delete this.data},h}(n);n.Blob=function(n,i){var o=i?i.type||"":"",f=new t,r,e,u;if(n)for(r=0,e=n.length;r<e;r++)Uint8Array&&n[r]instanceof Uint8Array?f.append(n[r].buffer):f.append(n[r]);return u=f.getBlob(o),!u.slice&&u.webkitSlice&&(u.slice=u.webkitSlice),u};i=Object.getPrototypeOf||function(n){return n.__proto__};n.Blob.prototype=i(new n.Blob)}(typeof self!="undefined"&&self||typeof window!="undefined"&&window||this.content||this);var saveAs=saveAs||typeof navigator!="undefined"&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(n){"use strict";if(typeof navigator=="undefined"||!/MSIE [1-9]\./.test(navigator.userAgent)){var i=n.document,v=function(){return n.URL||n.webkitURL||n},y=n.URL||n.webkitURL||n,r=i.createElementNS("http://www.w3.org/1999/xhtml","a"),p=!n.externalHost&&"download"in r,b=function(t){var r=i.createEvent("MouseEvents");r.initMouseEvent("click",!0,!1,n,0,0,0,0,0,!1,!1,!1,!1,0,null);t.dispatchEvent(r)},f=n.webkitRequestFileSystem,h=n.requestFileSystem||f||n.mozRequestFileSystem,w=function(t){(n.setImmediate||n.setTimeout)(function(){throw t;},0)},e="application/octet-stream",c=0,u=[],o=function(){for(var t=u.length,n;t--;)n=u[t],typeof n=="string"?y.revokeObjectURL(n):n.remove();u.length=0},s=function(n,t,i){var r,u;for(t=[].concat(t),r=t.length;r--;)if(u=n["on"+t[r]],typeof u=="function")try{u.call(n,i||n)}catch(f){w(f)}},l=function(t,o){var l=this,k=t.type,g=!1,y,b,nt=function(){var n=v().createObjectURL(t);return u.push(n),n},tt=function(){s(l,"writestart progress write writeend".split(" "))},a=function(){(g||!y)&&(y=nt(t));b?b.location.href=y:window.open(y,"_blank");l.readyState=l.DONE;tt()},w=function(n){return function(){if(l.readyState!==l.DONE)return n.apply(this,arguments)}},it={create:!0,exclusive:!1},rt,d;if(l.readyState=l.INIT,o||(o="download"),p){y=nt(t);i=n.document;r=i.createElementNS("http://www.w3.org/1999/xhtml","a");r.href=y;r.download=o;d=i.createEvent("MouseEvents");d.initMouseEvent("click",!0,!1,n,0,0,0,0,0,!1,!1,!1,!1,0,null);r.dispatchEvent(d);l.readyState=l.DONE;tt();return}if(n.chrome&&k&&k!==e&&(rt=t.slice||t.webkitSlice,t=rt.call(t,0,t.size,e),g=!0),f&&o!=="download"&&(o+=".download"),(k===e||f)&&(b=n),!h){a();return}c+=t.size;h(n.TEMPORARY,c,w(function(n){n.root.getDirectory("saved",it,w(function(n){var i=function(){n.getFile(o,it,w(function(n){n.createWriter(w(function(i){i.onwriteend=function(t){b.location.href=n.toURL();u.push(n);l.readyState=l.DONE;s(l,"writeend",t)};i.onerror=function(){var n=i.error;n.code!==n.ABORT_ERR&&a()};"writestart progress write abort".split(" ").forEach(function(n){i["on"+n]=l["on"+n]});i.write(t);l.abort=function(){i.abort();l.readyState=l.DONE};l.readyState=l.WRITING}),a)}),a)};n.getFile(o,{create:!1},w(function(n){n.remove();i()}),w(function(n){n.code===n.NOT_FOUND_ERR?i():a()}))}),a)}),a)},t=l.prototype,a=function(n,t){return new l(n,t)};return t.abort=function(){var n=this;n.readyState=n.DONE;s(n,"abort")},t.readyState=t.INIT=0,t.WRITING=1,t.DONE=2,t.error=t.onwritestart=t.onprogress=t.onwrite=t.onabort=t.onerror=t.onwriteend=null,n.addEventListener("unload",o,!1),a.unload=function(){o();n.removeEventListener("unload",o,!1)},a}}(typeof self!="undefined"&&self||typeof window!="undefined"&&window||this.content);typeof module!="undefined"&&module!==null?module.exports=saveAs:typeof define!="undefined"&&define!==null&&define.amd!=null&&define([],function(){return saveAs}),function(){angular.module("CbsApp").factory("downloadService",["tableState","$translate","$stateParams","widgetService","$httpParamSerializer","tableInfoService",function(n,t,r,u,f,e){function l(){var t=n.current.UserData.GetSelection(n.current.UserData.GraphType),i=f(t.queryOptions);return settings.HOST_CSVDOWNLOAD_SERVICE+n.current.MetaData.Identifier+"/TypedDataSet?"+i}function a(){var t=n.current.UserData.GetSelection(n.current.UserData.GraphType),i=f(t.queryOptions);return settings.HOST_CSVDOWNLOAD_SERVICE+n.current.MetaData.Identifier+"/UntypedDataSet?"+i}function v(n,t){switch(n){case"Bar":h.save($("#nvd3bar svg"),n,t);break;case"Map":h.save($("#d3maps svg"),n,t);break;case"Line":h.save($("#nvd3line svg"),n,t)}}function y(n,t){switch(n){case"Bar":h.saveAsPng($("#nvd3bar svg"),n,t);break;case"Map":h.saveAsPng($("#d3maps svg"),n,t);break;case"Line":h.saveAsPng($("#nvd3line svg"),n,t)}}function p(){b.save()}function w(){k.save()}function c(n){var t=new Date,i=("0"+t.getDate()).slice(-2),r=("0"+(t.getMonth()+1)).slice(-2),u=t.getFullYear(),f=("0"+t.getHours()).slice(-2),e=("0"+t.getMinutes()).slice(-2),o=("0"+t.getSeconds()).slice(-2),s=i+r+u+"_"+f+e+o,h=n+"_"+s;return h.replace(/[^a-z0-9]/gi,"_")}var o=this;this._findTopicGroup=function(n,t){return $.isNumeric(t)?n.MetaData.TopicGroups[t]:null};this._topicPath=function(n,t){var i=t,r=[];if(i.ParentId===undefined)return r;for(r=[i.Title];i.ParentId!==null;)i=o._findTopicGroup(n,i.ParentId),r.unshift(i.Title);return r};this._appendTopicLabel=function(n,t,i,r){var f=o._topicPath(t,i),u;if(f!==undefined&&f.length>0)for(u=0;u<f.length;u++)u===0?n.text(f[0]):n.append("tspan").text(f[u]).attr("x",u*8+8+r).attr("dy",16);else n.text(i.Title);return n};this._appendTitle=function(n,t,i){var r=t.append("rect"),u=t.append("text").classed("titlebar",!0).attr("y","10").append("tspan").attr("x",0).attr("dy",15).attr("font-size","16px").text(n.MetaData.Title);r.classed("titlebar",!0).attr("x",-i).attr("y",0).attr("width",i).attr("height",40)};this._createTableinfo=function(n,i,r,u,f,e){var s,ut,ft,c,p,g,a,h,w,et,it,ot,nt,st,ht;d3.select(n).selectAll("#selectie").remove();var v=d3.select(n).insert("g",":first-child").attr("id","selectie"),l=16,k=r?40:0;r&&o._appendTitle(i,v,u);var y=[],rt=0,d=null,ct=f?i.UserData.LegendDimension==="Topics"?i.UserData.Collections.Topics.Legend3[e].Key:i.UserData.Collections.Topics.Single[0].Key:i.UserData.Collections.Topics.Single[0].Key,lt=i.MetaData.CollectionsData.Topics.Categories[ct],tt,b=[];for(s in i.MetaData.CollectionsData)ut=i.UserData.LegendDimension,ft=i.UserData.XAxisDimension,f?(c=i.MetaData.CollectionsData[s],c.Type!=="GeoDimension"&&(s==="Topics"?d=i.MetaData.CollectionsData.Topics:y.unshift(s))):s!==ut&&s!==ft&&(s==="Topics"?d=i.MetaData.CollectionsData.Topics:y.unshift(s));p=0;d!==null&&(tt=v.append("text").attr("y",k),tt.append("tspan").attr("class","topicsTitle").attr("x",0).attr("dy",l).attr("font-weight","bold").text(d.Title+": "),rt=tt[0][0].getBBox().width,_.each(i.UserData.Collections.Topics.Legend3,function(n){var t=i.MetaData.CollectionsData.Topics.Categories[n.Key];p=Math.max(p,o._topicPath(i,t).length*l)}));g=0;for(a in y)s=y[a],c=i.MetaData.Dimensions[s],c.Type==="GeoDetail"?(g=1,h=v.append("text").attr("y",k+p+ +a*l),h.append("tspan").attr("class","dimensionTitle").attr("x",0).attr("dy",l).text(t.instant("geoCategories.GM")+": "),b.push(h),h=v.append("text").attr("y",k+p+(+a+g)*l),h.append("tspan").attr("class","dimensionTitle").attr("x",0).attr("dy",l).text(t.instant("dictionary.Regioindeling aanpassen")+": "),b.push(h)):(h=v.append("text").attr("y",k+p+(+a+g)*l),h.append("tspan").attr("class","dimensionTitle").attr("x",0).attr("dy",l).text(c.Title+": "),b.push(h));w=Math.max(rt,d3.max(b,function(n){return n&&n[0][0]?n[0][0].getBBox().width:0})||0)+10;d!==null&&(et=tt.append("tspan").attr("x",w),o._appendTopicLabel(et,i,lt,w));it=0;for(a in y)s=y[a],c=i.UserData.Collections[s],ot=i.UserData.LegendDimension===s?[c.Legend3[e]]:c.Single,nt=ot.map(function(n){var t=i.MetaData.CollectionsData[s].Categories[n.Key];return t.Title}),h=b[+a+it],i.MetaData.Dimensions[s].Type==="GeoDetail"?(st=i.MetaData.Dimensions[i.MetaData.GeoDetail].Gemeenten,ht=st[c.Gemeente].Title,h.append("tspan").attr("x",w).text(ht),it=1,h=b[+a+it],h.append("tspan").attr("x",w).text(t.instant("geoCategories."+c.Indeling))):f?h.append("tspan").attr("x",w).text(nt.length>1?nt[e]:nt[0]):h.append("tspan").attr("x",w).text(nt.join(", "));return v.estimatedHeight=k+p+(+y.length+g)*l,v};this._appendLegend=function(n,t,i){d3.select(n).selectAll("#legend").remove();var c=t.UserData.Collections[t.UserData.LegendDimension].Legend8,l=t.MetaData.CollectionsData[t.UserData.LegendDimension],f=20,e=20,s=d3.select(n).selectAll("g.graybar"),h=d3.select(s[0][s.size()-1]),r=h.append("g").attr("id","legend"),u=h[0][0].getBoundingClientRect().height+30;return r.append("text").attr("class","legendtitle").attr("x",0).attr("y",u).text(l.Title),_.forEach(c,function(n,s){var c=t.MetaData.CollectionsData[t.UserData.LegendDimension].Categories[n.Key],h=o._topicPath(t,c);h.length===0&&h.push(c.Title);i?r.append("rect").attr("x",0).attr("y",s*f+u+e-2).attr("width",30).attr("height",2):r.append("rect").attr("x",0).attr("y",s*f+u+e-10).attr("width",30).attr("height",10);r.append("text").attr("x",40).attr("y",s*f+u+e).text(h.join(" \\ "))}),r};this._createLegend=function(n,t,i){var e=n.UserData.Collections[n.UserData.LegendDimension].Legend8,s=n.MetaData.CollectionsData[n.UserData.LegendDimension],u=20,f=20,h=document.createElementNS("http://www.w3.org/2000/svg","svg"),r=d3.select(h).append("g").attr("id","legend");return r.append("text").attr("class","legendtitle").attr("x",0).attr("y",i).text(s.Title),_.forEach(e,function(e,s){var c=n.MetaData.CollectionsData[n.UserData.LegendDimension].Categories[e.Key],h=o._topicPath(n,c);h.length===0&&h.push(c.Title);t?r.append("rect").attr("x",0).attr("y",s*u+i+f-2).attr("width",30).attr("height",2):r.append("rect").attr("x",0).attr("y",s*u+i+f-10).attr("width",30).attr("height",10);r.append("text").attr("x",40).attr("y",s*u+i+f).text(h.join(" \\ "))}),r};var b=function(){var i="163a72",o="ececec",f="Arial",s;return"CBS"!==r._catalog&&(i=u.getSubtitleBgColor(),f="'"+r._catalog.toLowerCase()+"'"),s=function(){var r=n.current.MetaData.Title,s=$("div.subtitle-container")[0].outerHTML,u=$("#pivotTableOutput").clone(),h=t.instant("dictionary.Bron")+": "+n.current.MetaData.Source,l=c(r)+".html",a=$("#tabelWaarschuwing")&&$("#tabelWaarschuwing").length>0?$("#tabelWaarschuwing")[0].outerHTML||"":"";u.find(".pvtAttrEditHandle").html("&nbsp;");$.get("content/pivot.css",function(n){var g='<html><head><meta charset="utf-8" /><title>Tabel export: '+r+"<\/title><\/head><body>"+s,nt='<div class="source">'+h+"<\/div>",tt="body { font-family: "+f+", sans-serif; } .subtitle { padding: 12px 20px 12px 32px; color: #"+i+"; font-size: 16px; width: auto; margin: 0; } @media(min-width: 992px) { .subtitle { border-radius: 0 8px 8px 0; width: auto; display: inline-block; }} span.pvtAttrEditHandle, .pvtRendererAxisContainer li, .pvtAxisContainer li { cursor: inherit; } .source { padding: 12px ; font-size: 8pt; font-family: "+f+", sans-serif; } span.pvtAttrEditHandle { visibility: hidden; display:none; } .pvtVertList { text-align:left;} th { text-align: left;} .modifiedDate { padding: 0px 20px 0px 32px; background-color: white; color: #"+i+"; font-size: 12px; border-left: none; border-right: none; width: auto; display: block; margin: 0; height: 26px; line-height: 26px; } @media(max-width: 767px) { .modifiedDate { padding: 0px 20px 0px 32px; background-color: white; color: #"+i+"; font-size: 12px; border: 1px solid #"+o+"; border-left: none; border-right: none; margin: 0; width: auto; display: block; line-height: 26px; }} @media(min-width: 992px) { .modifiedDate { padding: 0px 20px 0px 32px; background-color: white; color: #"+i+"; font-size: 12px; border: 1px solid #"+o+"; border-left: none; border-right: none; width: auto; display: inline-block; margin: 0; line-height: 26px; }} .modifiedDate-container { margin-bottom: 30px; margin-top: -1px; } ",it='<style type="text/css">h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 500; line-height: 1.1; } a:hover, a:focus { color: #2A6496; text-decoration: underline; } a:active, a:hover { outline: 0px none; } a { color: #428BCA; text-decoration: none; } '+n+tt+".alert-info { color: #3a87ad; background-color: #d9edf7; border-color: #bce8f1; }.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; font-size: 12px; }h5.onderwerp { font-size: 8pt; font-style: italic; font-weight: normal; } pre { font-family: inherit; font-weight: normal; word-break: inherit; word-wrap: inherit; }<\/style>",p=g+it+a+u.html()+nt+"<\/body><\/html>",k=document.createElement("div"),c,y,w,v,b,d;k.setAttribute("style","height: 50px;");p+=k.outerHTML;c=e();y=document.createElement("div");y.setAttribute("style","font-size: 8pt;margin-left: 12px;border-top: 1px solid grey;");w=document.createElement("h2");w.setAttribute("style","margin-top: 1.5em;");w.innerHTML=t.instant("dictionary.Tabeltoelichting");y.appendChild(w);y.appendChild(c.descriptionDomElement(c));p+=y.outerHTML;v=document.createElement("div");v.setAttribute("style","font-size: 8pt;margin-left: 12px;border-top: 1px solid grey;");b=document.createElement("h2");b.setAttribute("style","margin-top: 1.5em;");b.innerHTML=t.instant("dictionary.OnderwerpenClassificaties");v.appendChild(b);v.appendChild(c.subjectsDomElement(c));v.appendChild(c.dimensionsDomElement(c));p+=v.outerHTML;d=new Blob([p],{type:"text/html"});saveAs(d,l,"text/html")})},{save:s}}(),k=function(){var l=";",u="\r\n",a="|",f=function(n,t,i){return i==null&&(i=!0),i&&(n+='"'),n+=t,i&&(n+='"'),n+l},e=function(n){return n.slice(0,-1)+u},v=function(n){var t=n.find(".topicgroup"),i=_.map(t,function(n){return n.innerText.substr(0,n.innerText.indexOf(u))}).join(u);return i+(u+n.find(".topic").text())},s=function(n){var t=n.find(".topic").length>0;return t?v(n):n.find(".pvtAttrSingle").text()},h=function(t){var i=n.current,r=_.find(i.MetaData.Topics,function(n){return n.Key===t}),u=o._topicPath(i,r);return u.join(a)},y=function(){var g=c(n.current.MetaData.Title)+".csv",l="",p,b,d;l=e(f(l,n.current.MetaData.Title,!0));p=$("#pivotTableOutput").clone();b=t.instant("dictionary.Bron")+": "+n.current.MetaData.Source;p.find(".pvtAttrEditHandle").html("");var nt=p.find("thead"),tt=p.find("tbody"),it=_.some(n.current.UserData.RowDimensions,function(n){return n==="Topics"}),o=0,a=[],w=[],rt=nt.find("tr"),k=!0;_.each(rt,function(n){var t=$(n).find("th");_.each(t,function(n){var r=$(n),t="",l=!0,e=!1,y,b,d,f,nt,g,tt,c,v,p;if(r.hasClass("spacer")){k=!1;return}if(r.hasClass("pvtContainer")){y=r.find(".pvtAttr");b=y.length;e=r.hasClass("left");l=!e;switch(!0){case b===1:if(f=y[0].textContent,d=s(r),d!==""&&(f+=": "+d,l=!1),e||(l=!1),t=f,l){w.push(t);t="";return}break;case b>1:if(f="",_.each(y,function(n){var t=n.textContent,i=s($(n.parentElement));i!==""&&(t+=": "+i,l=!1);f!==""&&(f+="|");f+=t}),t=f,l){w=t.split("|");t="";return}}if(k){nt=t.split("|");_.each(nt,function(n){a[o]===undefined&&(a[o]=[]);a[o].push(n.replace(u,"|"));o++});return}if(e&&it&&(t+="|"),o===0&&t==="")return}else g=r.find(".topic"),g.length>0?(tt=g[0].getAttribute("data-key"),t=h(tt)):t=r.text();for(c=r.attr("colspan"),c=c&&l&&!e?parseInt(c):1,c>1&r.hasClass("pvtUpperLeftCorner")&&c--,v=r.attr("rowspan"),v=v?parseInt(v):1,p=t.split("|"),i=0;i<c;i++)for(j=0;j<v;j++)a[o+j]===undefined&&(a[o+j]=[]),j===v-1?e?_.each(p,function(n){a[o+j].push(n)}):a[o+j].push(t):e?_.each(p,function(){a[o+j].push("")}):a[o+j].push(""),e&&i===c-1&&j<w.length&&(a[o+j][i+p.length-1]=w[j])});a[o]&&a[o].length>0&&o++});var v=0,y=[],ut=tt.find("tr");_.each(ut,function(n){var i=$(n).find("th"),t;_.each(i,function(n){var i=$(n),r="",u=i.find(".topic"),f,t;for(u.length>0?(f=u[0].getAttribute("data-key"),r=h(f)):r=i.text(),t=i.attr("rowspan"),t=t?parseInt(t):1,j=0;j<t;j++)y[v+j]===undefined&&(y[v+j]=[]),y[v+j].push(r)});t=$(n).find("td");_.each(t,function(n){var i=$(n),t=i.text();t=t.replace(/\s/g,"");r._la==="en"&&(t=t.replace(",",""));y[v].push(t)});y[v]&&y[v].length>0&&v++});_.each(a,function(n){_.each(n,function(n){l=f(l,n)});l=e(l)});_.each(y,function(n){_.each(n,function(n){l=f(l,n)});l=e(l)});l=e(f(l,b));d=new Blob(["﻿",l],{type:"text/csv"});saveAs(d,g,"text/csv")};return{save:y}}(),h=function(){var t=!1,s=!1,f=!1,i=n.current,h=function(n){var h=d3.select(n).insert("style",":first-child"),i="",c=document.styleSheets,l,f,o,s,e,a;for(l in c)if(f=c[l],f&&f.href&&(e=f.href.substring(f.href.lastIndexOf("/")+1,f.href.lastIndexOf(".")).toLowerCase(),e==="graphs"||e==="nv.d3"||e==="nv.d3.min"||e==="site-nvd3"||e==="site-nvd3.min")){o=f.cssRules;for(s in o)a=o[s].cssText,a&&(i+=o[s].cssText+"\n")}return i+=".nv-controlsWrap{display:none;}\n",i+="svg g.nvd3 g.nv-legendWrap{display:block;}\n",t&&(i+="path{stroke:#000;stroke-width:0.2px;fill:#fff;}\n",i+="circle{stroke:#000;pointer-events:none;stroke-width:0.5px;fill:none;}\n",i+=".map1 .c1{fill:#FFC597;}\n",i+=".map1 .c2{fill:#F49C0A;}\n",i+=".map1 .c3{fill:#E74D15;}\n",i+=".map1 .c4{fill:#C01F26;}\n",i+=".map1 .c5{fill: #82001E;}\n",i+=".map2 .c1{fill:#C0E7FF;}\n",i+=".map2 .c2{fill:#77CBE5;}\n",i+=".map2 .c3{fill:#3D95D4;}\n",i+=".map2 .c4{fill:#2256A0;}\n",i+=".map2 .c5{fill:#143564;}\n",i+=".map3 .c1{fill:#EDF0C7;}\n",i+=".map3 .c2{fill:#C9DE85;}\n",i+=".map3 .c3{fill:#85BC22;}\n",i+=".map3 .c4{fill:#348A3A;}\n",i+=".map3 .c5{fill:#0F5F34;}\n",i+=".map1.TimeInLegend .c1{fill:#C0E7FF;}\n",i+=".map1.TimeInLegend .c2{fill:#77CBE5;}\n",i+=".map1.TimeInLegend .c3{fill:#3D95D4;}\n",i+=".map1.TimeInLegend .c4{fill:#2256A0;}\n",i+=".map1.TimeInLegend .c5{fill:#143564;}\n",i+=".map2.TimeInLegend .c1{fill:#C0E7FF;}\n",i+=".map2.TimeInLegend .c2{fill:#77CBE5;}\n",i+=".map2.TimeInLegend .c3{fill:#3D95D4;}\n",i+=".map2.TimeInLegend .c4{fill:#2256A0;}\n",i+=".map2.TimeInLegend .c5{fill:#143564;}\n",i+=".map3.TimeInLegend .c1{fill:#C0E7FF;}\n",i+=".map3.TimeInLegend .c2{fill:#77CBE5;}\n",i+=".map3.TimeInLegend .c3{fill:#3D95D4;}\n",i+=".map3.TimeInLegend .c4{fill:#2256A0;}\n",i+=".map3.TimeInLegend .c5{fill:#143564;}\n",i+=" circle.hide{display:none;}\n",i+=".Absolute path{fill:#E5E5E5; !important;}\n",i+=".Relative circle{display:none;}\n",i+="g #CbsLogo path { fill: #aaaaaa; fill-opacity: 0;\tfill-rule: nonzero;\tstroke: none }\n",i+="g.map1 #CbsLogo path { fill-opacity: 1; }\n"),i+=".map1 .maplegend rect:nth-of-type(1) {fill:#FFC597;}\n",i+=".map1 .maplegend rect:nth-of-type(2) {fill:#F49C0A;}\n",i+=".map1 .maplegend rect:nth-of-type(3) {fill:#E74D15;}\n",i+=".map1 .maplegend rect:nth-of-type(4) {fill:#C01F26;}\n",i+=".map1 .maplegend rect:nth-of-type(5) {fill:#82001E;}\n",i+=".map2 .maplegend rect:nth-of-type(1) {fill:#C0E7FF;}\n",i+=".map2 .maplegend rect:nth-of-type(2) {fill:#77CBE5;}\n",i+=".map2 .maplegend rect:nth-of-type(3) {fill:#3D95D4;}\n",i+=".map2 .maplegend rect:nth-of-type(4) {fill:#2256A0;}\n",i+=".map2 .maplegend rect:nth-of-type(5) {fill:#143564;}\n",i+=".map3 .maplegend rect:nth-of-type(1) {fill:#EDF0C7;}\n",i+=".map3 .maplegend rect:nth-of-type(2) {fill:#C9DE85;}\n",i+=".map3 .maplegend rect:nth-of-type(3) {fill:#85BC22;}\n",i+=".map3 .maplegend rect:nth-of-type(4) {fill:#348A3A;}\n",i+=".map3 .maplegend rect:nth-of-type(5) {fill:#0F5F34;}\n",i+=".map1 .maplegend.TimeInLegend rect:nth-of-type(1) {fill:#C0E7FF;}\n",i+=".map1 .maplegend.TimeInLegend rect:nth-of-type(2) {fill:#77CBE5;}\n",i+=".map1 .maplegend.TimeInLegend rect:nth-of-type(3) {fill:#3D95D4;}\n",i+=".map1 .maplegend.TimeInLegend rect:nth-of-type(4) {fill:#2256A0;}\n",i+=".map1 .maplegend.TimeInLegend rect:nth-of-type(5) {fill:#143564;}\n",i+=".map2 .maplegend.TimeInLegend rect:nth-of-type(1) {fill:#C0E7FF;}\n",i+=".map2 .maplegend.TimeInLegend rect:nth-of-type(2) {fill:#77CBE5;}\n",i+=".map2 .maplegend.TimeInLegend rect:nth-of-type(3) {fill:#3D95D4;}\n",i+=".map2 .maplegend.TimeInLegend rect:nth-of-type(4) {fill:#2256A0;}\n",i+=".map2 .maplegend.TimeInLegend rect:nth-of-type(5) {fill:#143564;}\n",i+=".map3 .maplegend.TimeInLegend rect:nth-of-type(1) {fill:#C0E7FF;}\n",i+=".map3 .maplegend.TimeInLegend rect:nth-of-type(2) {fill:#77CBE5;}\n",i+=".map3 .maplegend.TimeInLegend rect:nth-of-type(3) {fill:#3D95D4;}\n",i+=".map3 .maplegend.TimeInLegend rect:nth-of-type(4) {fill:#2256A0;}\n",i+=".map3 .maplegend.TimeInLegend rect:nth-of-type(5) {fill:#143564;}\n","CBS"!==r._catalog&&(i+=u.getSvgCssRules()),h.text(i),h},e=function(n,r,u){var e=30,l=n.clone(),a,c=[0],v,y;return t=r==="Map",s=r==="Bar",f=r==="Line",u=u||!1,a=l.length>0?document.createElementNS("http://www.w3.org/2000/svg","svg"):l.get(0),l.each(function(r,s){var it,k,p,d,rt,w,h,tt,st,ht,ct,y,lt,b;if(t?(it=d3.select(s).node().height.baseVal.value,k=d3.select(s).node().width.baseVal.value,s.setAttribute("height","")):(it=parseInt(d3.select(s).node().style.height,10),k=parseInt(d3.select(s).node().style.width,10),d3.select(s).node().style.height="",p=n.find(".nv-y.nv-axis g.tick text"),d=$.map(p,function(n){return n.getBBox().width}),u&&(p=n.find(".nv-x.nv-axis g.tick text"),d=$.map(p,function(n){return n.getBBox().width})),rt=d3.max(d)||0,e=rt),document.body.appendChild(s),w=o._createTableinfo(s,i,!0,e,t,r),w.attr("transform","translate("+e+", 0)"),h=w.estimatedHeight,t)d3.select(s).selectAll("g.nomap").attr("transform","translate("+e+", "+h+")"),d3.select(s).selectAll("g.paths").attr("transform","translate("+e+", "+h+")"),d3.select(s).selectAll("g.circles").attr("transform","translate("+e+", "+h+")"),d3.select(s).selectAll("g.maplegend").attr("transform","translate("+e+", "+h+")");else{var ut=d3.select(s).select(".nv-wrap"),ft=ut.attr("transform"),et=/\(([^ ,]*)/,ot=/([^ ,]*)\)/,g=+et.exec(ft)[1]+e,nt=+ot.exec(ft)[1]+h;ut.attr("transform","translate("+g+", "+nt+")");tt=d3.select(s).selectAll(".graybar").attr("transform");g=+et.exec(tt)[1]+e;nt=+ot.exec(tt)[1]+h;d3.select(s).selectAll(".graybar").attr("transform","translate("+g+", "+nt+")");st=$(s).find("g.tick line").filter(function(n,t){return+$(t).css("opacity")==1});st.each(function(n,t){t.setAttribute("style","opacity: 1 !important;")});ht=u?$(s).find(".nv-y g.tick text"):$(s).find(".nv-x g.tick text");ht.filter(function(n,t){return+$(t).css("opacity")==1}).each(function(n,t){$(t).css("font-weight")==="bold"?t.setAttribute("style","text-anchor: middle; font-weight: bold; opacity: 1 !important;"):t.setAttribute("style","text-anchor: middle; opacity: 1 !important;")});ct=u?$(s).find(".nv-x g.tick text"):$(s).find(".nv-y g.tick text");ct.filter(function(n,t){return+$(t).css("opacity")==1}).each(function(n,t){t.setAttribute("style","text-anchor: end; opacity: 1 !important;")});o._appendLegend(s,i,f)}if(l.length>0){for(y=document.createElementNS("http://www.w3.org/2000/svg","g"),y.setAttribute("class",s.getAttribute("class")),lt=w[0][0].getBBox().width,c.push(c[r]+Math.max(lt,k)+30),y.setAttribute("transform","translate("+c[r]+", 0)"),b=0;b<s.childNodes.length;b++)y.appendChild(s.childNodes[b].cloneNode(!0));a.appendChild(y)}v=s.getBBox();document.body.removeChild(s)}),h(a),y=c.length>1?c[c.length-2]:0,{xmlAsString:(new XMLSerializer).serializeToString(a),boundingBox:{width:v.width+y,height:v.height}}},l=function(n,t,r){var u=e(n,t,r).xmlAsString,h,f,o,s;u.match(/^<svg[^>]+xmlns="http\:\/\/www\.w3\.org\/2000\/svg"/)||(u=u.replace(/^<svg/,'<svg xmlns="http://www.w3.org/2000/svg"'));u.match(/^<svg[^>]+"http\:\/\/www\.w3\.org\/1999\/xlink"/)||(u=u.replace(/^<svg/,'<svg xmlns:xlink="http://www.w3.org/1999/xlink"'));h=window.location.protocol+"//"+window.location.host;f='<?xml version="1.0" standalone="no"?>\r\n';u=f+u;o=new Blob([u],{type:"image/svg+xml"});s=c(i.MetaData.ShortTitle);saveAs(o,s+".svg","image/svg+xml")},a=function(n,t,r){String.prototype.startsWith||(String.prototype.startsWith=function(n,t){return t=t||0,this.substr(t,n.length)===n});var f=e(n,t,r),o=$(f.xmlAsString),s=c(i.MetaData.ShortTitle),u=f.boundingBox,h=1280/u.width;saveSvgAsPng(o[0],s+".png",{backgroundColor:"#FFFFFF",canvg:canvg,height:u.height,width:u.width,scale:h,encoderType:"image/png",encoderOptions:1})};return{save:l,saveAsPng:a,topicPath:o._topicPath}}(),d=function(){typeof window.saveAs=="function"||typeof window.saveAs=="object"||(window.saveAs=function(n,t,i){var r,u;document.execCommand&&(r=window.open("about:blank","_blank"),r.document.open(i,"replace"),r.document.charset="utf-8",r.document.write(n.data),r.document.close(),u=r.document.execCommand("SaveAs",!1,t),r.close())})}(),s={};return s.DownloadGraphAsSvg=v,s.DownloadGraphAsPng=y,s.DownloadTableHTML=p,s.DownloadCSVTable=w,s.DownloadTypedCSV=l,s.DownloadUntypedCSV=a,s.createTableinfo=o._createTableinfo,s.appendLegend=o._appendLegend,s}])}(),function(){angular.module("CbsApp").factory("treeHelper",["tableState","$translate","$stateParams",function(n,t){var o=function(n){var f=[],r,u={},s=n.Indelingen,e=!1,o=!1,i;return _.forEach(n.Categories,function(n,t){var i=t.substring(4,6);_.has(s,i)||(i[0]==="0"||i[0]==="1"?(o=!0,i="0%"):(e=!0,i="%%"));_.has(u,i)||(u[i]=[]);u[i].push(n)}),i=n.Indelingen,o&&(i=$.extend({},i,{"0%":{Key:"0%",Position:Number.MAX_VALUE}})),e&&(i=$.extend({},i,{"%%":{Key:"%%",Position:Number.MAX_VALUE}})),_.forEach(i,function(n,i){var s=t.instant("timeCategories."+i),o=[],e;r={id:n.Position,title:s,key:n.Key,folder:!0,unselectable:!1};_.forEach(u[i],function(n){e={id:n.Position,title:n.Title,key:n.Key,category:n,unselectable:!1};"Voorlopig"===n.Status&&(e.title+="*");"NaderVoorlopig"===n.Status&&(e.title+="**");o.push(e)});r.children=o;r.expanded=!1;f.push(r)}),f.sort(function(n,t){var i=n.id,r=t.id;return i<r?-1:i>r?1:0})},s=function(n,t){var u=[],i,e=n.Indelingen,f=0;return t.then(function(t){var e=_.filter(t[n.Key],function(n){return n.ParentID==null});return _.forEach(e,function(e){i={id:f++,title:e.Title,key:e.ID,folder:!0,unselectable:!1};i.children=r(t[n.Key],i,f,n.Key);u.push(i)}),u.sort(function(n,t){var i=n.id,r=t.id;return i<r?-1:i>r?1:0})})},r=function(t,i,u,f){var o=[],e,s,l,c;return h(i.key,t)?(s=_.filter(t,function(n){return n.ParentID===i.key}),_.forEach(s,function(n){e={id:u++,title:n.Title,key:n.ID,folder:!0,unselectable:!1};e.children=r(t,e,u,f);o.push(e)})):(l=i.key.substring(0,2),c=_.filter(n.current.MetaData.data[f].value,function(n){return n.CategoryGroupID===i.key}),_.forEach(c,function(n){e={id:u++,title:n.Title,key:n.Key,category:n,unselectable:!1};o.push(e)})),o},h=function(n,t){return _.some(t,function(t){return t.ParentID===n})},c=function(n,t){var r=[],i,u=0;return _.forEach(t,function(t){i={id:u++,title:t.Title,key:t.ID,folder:!0,unselectable:!1};i.children=l(t,i,u,n);r.push(i)}),r},l=function(n,t,i,r){var f=[],u;switch(n.ID){case"NL":u=_.filter(r.Categories,function(n){return n.Key.substring(0,4)===n.Key.trim()});!_.isUndefined(u)&&!_.isNull(u)&&u.length>0&&_.forEach(u,function(n){f.push({id:i++,title:n.Title,key:n.Key,folder:!1,unselectable:!1,category:n})});break;case"WBGM":f=a(r)}return f},a=function(n){var t={},i,r;return _.forEach(n.Categories,function(i,r){var u=r.substring(2,6);_.has(n.Gemeenten,u)&&(_.has(t,u)||(t[u]=[]),t[u].push(i))}),i=n.Gemeenten,r=_.chain(i).map(function(n){var i=_.chain(t[n.Key]).map(function(n){return{id:n.Position,title:n.Title,key:n.Key,unselectable:!1,category:n}}).sortBy(function(n){return n.id}).value(),r=_.find(t[n.Key],function(n){return n.Indeling==="GM"});return{title:n.Title,key:n.Key,position:r.Position,folder:!0,unselectable:!1,expanded:!1,children:i}}).sortBy(function(n){return n.position}).value(),r},u=function(t,i){var f=[],r;return _.forEach(n.current.MetaData.CategoryGroups,function(n){if(n.DimensionKey===t&&n.ParentID===i){r={id:n.ID,title:n.Title,folder:!0,unselectable:!1};var o=u(t,n.ID);_.some(o,e)&&(r.children=o,r.expanded=!1,f.push(r))}}),_.forEach(n.current.MetaData.CollectionsData[t].Categories,function(n){n.CategoryGroupID===i&&(r={id:n.Position,title:n.Title,key:n.Key,category:n},"Voorlopig"===n.Status&&(r.title+="*"),"NaderVoorlopig"===n.Status&&(r.title+="**"),f.push(r))}),f.sort(function(n,t){var i=n.id,r=t.id;return n.category?t.category?i<r?-1:i>r?1:0:1:t.category?-1:i<r?-1:i>r?1:0})},f=function f(t,i,r,u){var o=[],e;return _.forEach(n.current.MetaData.TopicGroups,function(n){if(n.ParentId===t)if(e={id:n.Id,title:n.Title,key:n.Key,folder:!0},i)e.lazy=!0,o.push(e);else{var s=f(n.Id,i,r,u);e.children=s;t===0&&(e.expanded=!0);s.length>0&&o.push(e)}}),_.forEach(n.current.MetaData.Topics,function(n){if(n.ParentId===t){var i=n.Title;r&&(i+="<span class='unit'>"+n.Unit+"<\/span>");e={id:n.Id,title:i,key:n.Key,topic:n,unselectable:n.Datatype==="String"};e.unselectable?u||(e.unselectable=!1,o.push(e)):o.push(e)}}),o.sort(function(n,t){var i=n.id,r=t.id;return i<r?-1:i>r?1:0})},v=function(n){if(n!==undefined){var i=new Date(n.Modified.substring(0,4),n.Modified.substring(5,7)-1,n.Modified.substring(8,10),n.Modified.substring(11,13),n.Modified.substring(14,16),0),o=n.Title+"\n\n",r="",u="",f="",e="";return n.Summary&&(r=n.Summary+"\n\n"),u=t.instant("dictionary.Tijdvak")+": "+n.Period+"\n",f=t.instant("dictionary.Frequentie")+": "+n.Frequency+".\n",e=t.instant("dictionary.Gewijzigd op")+":\n"+i.getDate()+" "+t.instant("month."+i.getMonth())+" "+i.getFullYear()+".",r+u+f+e}},y=function(n,t){var u=$("[rel~=tooltip]"),r=!1,i=!1;$("body").off("mouseenter","[rel~=tooltip]");$("body").on("mouseenter","[rel~=tooltip]",function(n){var e,u,f;if(r=$(this),tip=!t||t===""?r.attr("title"):t,i=$('<div id="tooltip" class="jquerytooltip"><\/div>'),e=n.pageX,!tip||tip==="")return!1;r.removeAttr("title");i.css("opacity",0).html(tip.replace(/\n/g,"<br/>")).appendTo("body");u=function(){$(window).width()<i.outerWidth()*1.5&&i.css("max-width",$(window).width()/2);var n=r.offset().left,t=r.offset().top-i.outerHeight()-20;i.addClass("left");n+i.outerWidth()>$(window).width()?(n=r.offset().left-i.outerWidth()+r.outerWidth()/2+20,i.addClass("right")):i.removeClass("right");t<0?(t=r.offset().top+r.outerHeight(),i.addClass("top")):i.removeClass("top");i.css({left:n,top:t}).animate({top:"+=10",opacity:1},50)};u();$(window).resize(u);f=function(){i.animate({top:"-=10",opacity:0},50,function(){$(this).remove()});r.attr("title",tip)};r.off("mouseleave");r.on("mouseleave",f);i.one("click",f)})},e=function(n){return n.category?!0:n.children?_.some(n.children,e):!1},p=function(n){var t,i;for(n=n.toLowerCase(),t="",i=0;i<n.length;i++)t=n.charAt(i)==="a"?t+"[aàáâãäåæ]":n.charAt(i)==="c"?t+"[cç]":n.charAt(i)==="e"?t+"[eèéêëæ]":n.charAt(i)==="i"?t+"[iìíîï]":n.charAt(i)==="n"?t+"[nñ]":n.charAt(i)==="o"?t+"[oòóôõöø]":n.charAt(i)==="s"?t+"[sß]":n.charAt(i)==="u"?t+"[uùúûü]":n.charAt(i)==="y"?t+"[yÿ]":t+n.charAt(i);return t},i={};return i.BuildTimeTree=o,i.BuildGeoDimensionTree=s,i.BuildGeoDetailTree=c,i.BuildDimensionTree=u,i.BuildTopicsTree=f,i.BuildTooltip=v,i.CustomizeTooltip=y,i.AddDiacritics=p,i}])}(),function(){"use strict";angular.module("CbsDomein").factory("widgetService",["$stateParams",function(n){return{getChartColors:function(){return[]},getSubtitleBgColor:function(){var t=default_settings.catalogs[n._catalog].subtitleBgColor;return t||(t=default_settings.defaultSubtitleBgColor),t},getSvgCssRules:function(){var t="";return"Politie"==n._catalog&&(t+="rect.titlebar { fill: rgb(0, 70, 130); }\n"),t}}}])}(),function(){angular.module("geo").factory("geoService",["$http","$q","$httpParamSerializer",function(n,t,i){function o(){return u.length>0}function s(){var n=t.defer();return f(n,"",{f:"json"}),n.promise}function h(n,i){var r=t.defer();return f(r,n+"/query",i),r.promise}function c(n){var t={type:"FeatureCollection",crs:{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},features:[]};return _.forEach(n.features,function(n){var i={type:"Feature",properties:n.attributes};n.geometry!==undefined&&(n.geometry.rings!==undefined&&(i.geometry={type:"Polygon",coordinates:n.geometry.rings}),n.geometry.x!==undefined&&n.geometry.y!==undefined&&(i.geometry={type:"Point",coordinates:[n.geometry.x,n.geometry.y]}));t.features.push(i)}),t}function f(t,i,r){var f=e+i+l(r);if(_.indexOf(u,f)>-1){error={message:"Pending request",status:499};t.reject(error);return}u.push(f);n({method:"GET",url:f}).then(function(n){_.pull(u,f);t.resolve(n.data)},function(n){_.pull(u,f);t.reject(n)})}function l(n){var t=i(n);return t!==""?"?"+t:""}function a(){return{geometryType:"esriGeometryEnvelope",spatialRel:"",returnGeometry:"true",geometryPercision:"6",outSR:"4326",returnIdsOnly:"false",returnCountOnly:"false",returnZ:"false",returnM:"false",returnDistinctValues:"false",f:"json"}}var e=settings.HOST_GEO_SERVICE,r={},u=[];return r.GetGeoLookUpTable=s,r.GetMap=h,r.GetDefaultOptions=a,r.ToGeoJson=c,r.HasPendingRequests=o,r}])}(),function(){angular.module("geo").factory("geoRepository",["$q","localStorageService","geoSettings","geoService",function(n,t,i,r){function f(n){var i=t.get("creationTimestamp");return i!==null&&(new Date).getDate()!==new Date(i).getDate()?(t.clearAll(),null):t.get(n)}function s(n,i){var r=t.get("creationTimestamp");r===null&&t.set("creationTimestamp",new Date);t.set(n,i)}function h(){var i=f("geo:lookuptable"),t;return i!==null?(t=n.defer(),t.resolve(i),t.promise):r.GetGeoLookUpTable().then(function(n){return s("geo:lookuptable",n),n},function(t){if(t.status===499){var r=50,i=n.defer(),u=setInterval(e,r);function e(){var n=f("geo:lookuptable");n!==null&&(clearInterval(u),i.resolve(n))}return i.promise}console.log(t)})}function a(t,i,u){var f=n.defer(),h=r.GetDefaultOptions(),o,s;return h.where="substring(STATCODE,3,4)='"+u+"'",o=2,s=[],e(t,i,h).then(function(n){s[0]=n;o--;o===0&&f.resolve(s)},function(n){f.reject(n)}),c(t,i,h).then(function(n){s[1]=n;o--;o===0&&f.resolve(s)},function(n){f.reject(n)}),f.promise}function v(t,i){var u=n.defer(),s=r.GetDefaultOptions(),f=2,o=[];return e(t,i,s).then(function(n){o[0]=n;f--;f===0&&u.resolve(o)},function(n){u.reject(n)}),c(t,i,s).then(function(n){o[1]=n;f--;f===0&&u.resolve(o)},function(n){u.reject(n)}),u.promise}function y(t,i,u){var f=n.defer(),o=r.GetDefaultOptions();return o.where="substring(STATCODE,3,4)='"+u+"'",e(t,i,o).then(function(n){f.resolve([n])},function(n){f.reject(n)}),f.promise}function p(t,i){var u=n.defer(),f=r.GetDefaultOptions();return e(t,i,f).then(function(n){u.resolve([n])},function(n){u.reject(n)}),u.promise}function e(t,r,u){var f=n.defer(),e=(i.GeoIndelingenMap[t]||{}).Map;return l("CBS_"+e+"_"+r+"_gegeneraliseerd").then(function(n){u&&u.where===undefined&&(u.where="1=1");u&&u.outFields===undefined&&(u.outFields="STATCODE,STATNAAM");o(n,u).then(function(n){f.resolve(n)},function(n){f.reject(n)})},function(n){f.reject({year:r,indelingenCode:t,message:n})}),f.promise}function c(t,r,u){var f=n.defer(),e=(i.GeoIndelingenMap[t]||{}).Map;return l("CBS_"+e+"_"+r+"_labelpoint").then(function(n){u&&u.where===undefined&&(u.where="1=1");u&&u.outFields===undefined&&(u.outFields="STATCODE,STATNAAM");o(n,u).then(function(n){f.resolve(n)},function(n){f.reject(n)})},function(n){f.reject(n)}),f.promise}function o(t,i){var e=f("geo:"+t+"_"+JSON.stringify(i)),u;return e!==null?(u=n.defer(),u.resolve(e),u.promise):r.GetMap(t,i).then(function(n){var u=r.ToGeoJson(n);return s("geo:"+t+"_"+JSON.stringify(i),u),u},function(u){if(u.status===499){var h=50,c=0,e=n.defer(),s=setInterval(l,h);function l(){var n=f("geo:"+t+"_"+JSON.stringify(i));n!==null&&(clearInterval(s),e.resolve(n));(c++>200||!r.HasPendingRequests())&&(e.resolve(o(t,i)),clearInterval(s))}return e.promise}console.log(u)})}function l(t){var i=n.defer();return h().then(function(n){var r="";_.forEach(n.layers,function(n){n.name.toLowerCase()==t.toLowerCase()&&(r=n.id)});r!==""?i.resolve(r):i.reject("No map number found for: "+t)}),i.promise}var u={};return u.GetGeoLookUpTable=h,u.GetCbsMap=p,u.GetCbsMapWijkenBuurten=y,u.GetCbsMapWithLabelpoints=v,u.GetCbsMapWijkenBuurtenWithLabelpoints=a,u}])}(),function(){angular.module("geo").factory("pdokService",["$http","$q","$httpParamSerializer",function(n,t,i){function c(){return r.length>0}function l(n,i,r){var u=t.defer();return f(u,i,r),u.promise}function f(t,i,u){var e=a(o,[i,s,h],u);if(_.indexOf(r,e)>-1){error={message:"Pending request",status:499};t.reject(error);return}r.push(e);n({method:"GET",url:e}).then(function(n){_.pull(r,e);t.resolve(geojsonRewind(n.data,!0))},function(n){_.pull(r,e);_.endsWith(u.TypeName,"_voorlopig")?t.reject(n):(u.TypeName+="_voorlopig",f(t,i,u))})}function a(n,t,i){var r=_.union([n],t),u=v(i);return _.join(r,"/").concat(u)}function v(n){var t=i(n);return t!==""?"?"+t:""}function e(n){return{REQUEST:"GetFeature",TypeName:n,SERVICE:"WFS",VERSION:"2.0.0",SRSNAME:"EPSG:4326",OUTPUTFORMAT:"json"}}function y(n,t){return _.merge(e(n),{filter:"<Filter><PropertyIsLike wildcard='*' singleChar='.' escape='!'><PropertyName>statcode<\/PropertyName><Literal>"+t+"*<\/Literal><\/PropertyIsLike><\/Filter>"})}var o=settings.PDOK_GEO_SERVICE,s="wfs",h="v1_0",r=[],u={};return u.GetMap=l,u.HasPendingRequests=c,u.GetDefaultPdokOptions=e,u.GetBuurtenPdokOptions=y,u}])}(),function(){angular.module("geo").factory("pdokRepository",["$q","localStorageService","geoSettings","pdokService",function(n,t,i,r){function f(n){var t=(i.GeoIndelingenMap[n]||{}).Map;return _.toLower(t)+"_gegeneraliseerd"}function s(n){var t=(i.GeoIndelingenMap[n]||{}).Map;return _.toLower(t)+"_labelpoint"}function h(n){var i=t.get("creationTimestamp");return i!==null&&(new Date).getDate()!==new Date(i).getDate()?(t.clearAll(),null):t.get(n)}function l(n,i){var r=t.get("creationTimestamp");r===null&&t.set("creationTimestamp",new Date);t.set(n,i)}function a(t,i,u){var h=n.defer(),l=2,a=[],o,v;return o=f(t,i),v=r.GetBuurtenPdokOptions(o,t+u),e(o,i,v).then(function(n){a[0]=n;l--;l===0&&h.resolve(a)},function(n){h.reject(n)}),o=s(t,i),v=r.GetBuurtenPdokOptions(o,t+u),c(o,i,v).then(function(n){a[1]=n;l--;l===0&&h.resolve(a)},function(n){h.reject(n)}),h.promise}function v(t,i){var o=n.defer(),h=2,l=[],u,a;return u=f(t,i),a=r.GetDefaultPdokOptions(u),e(u,i,a).then(function(n){l[0]=n;h--;h===0&&o.resolve(l)},function(n){o.reject(n)}),u=s(t,i),a=r.GetDefaultPdokOptions(u),c(u,i,a).then(function(n){l[1]=n;h--;h===0&&o.resolve(l)},function(n){o.reject(n)}),o.promise}function y(t,i,u){var o=n.defer(),s=f(t,i),h=r.GetBuurtenPdokOptions(s,t+u);return e(s,i,h).then(function(n){o.resolve([n])},function(n){o.reject(n)}),o.promise}function p(t,i){var u=n.defer(),o=f(t,i),s=r.GetDefaultPdokOptions(o);return e(o,i,s).then(function(n){u.resolve([n])},function(n){u.reject(n)}),u.promise}function e(t,i,r){var u=n.defer();return o(t,i,r).then(function(n){u.resolve(n)},function(n){u.reject(n)}),u.promise}function c(t,i,r){var u=n.defer();return o(t,i,r).then(function(n){u.resolve(n)},function(n){u.reject(n)}),u.promise}function o(t,i,u){var f="geo:"+t+"_"+i+"_"+JSON.stringify(u),s=h(f),e;return s!==null?(e=n.defer(),e.resolve(s),e.promise):r.GetMap(t,i,u).then(function(n){return l(f,n),n},function(e){var s;if(e.status===499){var l=50,a=0,s=n.defer(),c=setInterval(v,l);function v(){var n=h(f);n!==null&&(clearInterval(c),s.resolve(n));(a++>200||!r.HasPendingRequests())&&(s.resolve(o(t,i,u)),clearInterval(c))}return s.promise}return s=n.defer(),console.log(e),s.reject(e),s.promise})}var u={};return u.GetCbsMap=p,u.GetCbsMapWijkenBuurten=y,u.GetCbsMapWithLabelpoints=v,u.GetCbsMapWijkenBuurtenWithLabelpoints=a,u}])}(),function(){angular.module("geo").factory("geoHierarchyService",["$http","$q","$httpParamSerializer","$translate",function(n,t,i,r){var u={provinces:null,provCorop:null,provGem:null},s=function(n,i){var f=t.defer(),r=null;return!_.isUndefined(i)&&!_.isNull(i)&&i.length>0&&_.forEach(i,function(t){return r=_.filter(n[t.Key].value,function(n){return n.Key.substring(0,2)=="PV"}),!_.isNull(r)&&_.isArray(r)&&!_.isEmpty(r)?!1:void 0}),_.isNull(r)||!_.isArray(r)||_.isEmpty(r)?u.provinces===null?$.getJSON("app/shared/geoHierarchy/json/provincies.json",function(n){u.provinces=n;f.resolve(u.provinces)},function(n){f.reject(n)}):f.resolve(u.provinces):f.resolve(r.map(function(n){return{code:n.Key.substring(0,4),naam:n.Title}})),f.promise},h=function(){var n=t.defer();return u.provCorop===null?$.getJSON("app/shared/geoHierarchy/json/prov-corop.json",function(t){u.provCorop=t;n.resolve(u.provCorop)},function(t){n.reject(t)}):(n.resolve(u.provCorop),n.promise)},c=function(){var n=t.defer();return u.provGem===null?$.getJSON("app/shared/geoHierarchy/json/prov-gem.json",function(t){u.provGem=t;n.resolve(u.provGem)},function(t){n.reject(t)}):(n.resolve(u.provGem),n.promise)},l=function(n,i){var u=t.defer();return s(n,i).then(function(t){var e={};return i.length>0&&_.forEach(i,function(i){var u=[],l=(n[i.Key]||{}).value,o=[],h,s,c,v;if(_.forEach(l,function(n){o.push(n.Key.substring(0,2))}),o=_.uniq(o),h=r.instant("geoCategories.NL"),s=0,_.includes(o,"NL")&&(u.push({ID:"NL",Index:s++,Title:h}),_.pull(o,"NL")),_.includes(o,"LD")&&(h=r.instant("geoCategories.LD"),u.push({ID:"LD",Index:s++,Title:h}),_.pull(o,"LD")),_.includes(o,"PV")&&(h=r.instant("geoCategories.PV"),u.push({ID:"PV",Index:s++,Title:h}),_.pull(o,"PV")),_.includes(o,"CR")&&(h=r.instant("geoCategories.CRPV"),u.push({ID:"CRPV",Index:s++,Title:h}),u=_.concat(u,f(t,s,"CR")),s=s+t.length,_.pull(o,"CR")),_.includes(o,"GM")&&(h=r.instant("geoCategories.GMPV"),u.push({ID:"GMPV",Index:s++,Title:h}),u=_.concat(u,f(t,s,"GM")),s=s+t.length,_.pull(o,"GM")),c=!1,_.forEach(o,function(n){var t=r.instant("geoCategories."+n);t!=="geoCategories."+n?u.push({ID:n,Index:s++,Title:t}):c=!0}),c&&(v=r.instant("geoCategories.%%"),u.push({ID:"%%",Index:s++,Title:v})),u.length>0)while(!a(l,u));e[i.Key]=u}),u.resolve(e)}),u.promise},f=function(n,t,i){var r=[];return _.forEach(n,function(n){r.push({ID:i+n.code,Index:t++,Title:n.naam,ParentID:i+"PV"})}),r},e=function(n,t,i){var u=r.instant("geoCategories.%%"),f=_.find(n,{ID:t});_.isUndefined(f)&&(_.isUndefined(i)?n.push({ID:t,Index:n.length,Title:u}):n.push({ID:t,Index:n.length,Title:u,ParentID:i}))},a=function(n,i){var r=function(n,t,i,r,u){if(n!==undefined&&n!==null)t.CategoryGroupID=r+n.Provincie;else{var f=u,o=u.substring(0,4);t.CategoryGroupID=f;e(i,f,o)}},f=function(n,t,i){var u=Object.keys(_.groupBy(t,"Provincie")).map(function(n){return"GM"+n}),f=Object.keys(_.groupBy(i,"Provincie")).map(function(n){return"CR"+n}),e=_.xor(n.map(function(n){return n.ID}),u,f),r=_.filter(e,function(n){return n.substring(0,4)==="CRPV"&&n!=="CRPV"||n.substring(0,4)==="GMPV"&&n!=="GMPV"});r.length!==0&&_.remove(n,function(n){return _.indexOf(r,n.ID)>-1})},o=function(n,t,i,u,f){var o,s,h;n==="CR"?(o="CRPV%%",s=_.find(u,{Corop:t.Key.trim()}),r(s,t,i,n,o)):n==="GM"?(o="GMPV%%",s=_.find(f,{gemeente:t.Key.trim()}),r(s,t,i,n,o)):(h="%%",t.CategoryGroupID=h,e(i,h))},u=t.defer();return t.all([h(),c()]).then(function(t){var r=t[0],e=t[1],s=f(i,e,r);_.isUndefined(r)||_.isNull(r)||_.isUndefined(e)||_.isNull(e)||(_.forEach(n,function(n){var t=n.Key.substring(0,2);_.isUndefined(_.find(i,{ID:t}))?o(t,n,i,r,e):n.CategoryGroupID=t}),u.resolve(!0))}),u.promise},o=function(n,t){var r=(n[t]||{}).value,u=_.uniqBy(r,function(n){return n.DetailRegionCode.substring(0,2)}),i=[];return _.forEach(u,function(n){!_.isUndefined(n.DetailRegionCode)&&!_.isNull(n.DetailRegionCode)&&n.DetailRegionCode.length>0?i.push(n.DetailRegionCode.substring(0,2)):i.push(n.Key.substring(0,2))}),i},v=function(n,t){var u=[],i,f;return t.length>0&&(i=o(n,t[0].Key),f=0,_.indexOf(i,"NL")>-1&&u.push({ID:"NL",Index:f++,Title:r.instant("geoCategories.NL")}),_.indexOf(i,"GM")>-1&&(_.indexOf(i,"WK")>-1||_.indexOf(i,"BU")>-1)&&u.push({ID:"WBGM",Index:f++,Title:r.instant("geoCategories.WBGM")})),u};return{getCategoryGroupsForGeoDimension:l,getCategoryGroupsForGeoDetail:v,helpers:{getUniqueCodes:o}}}])}(),function(){angular.module("CbsApp").controller("headerController",["$scope","$rootScope","$state","$stateParams","$window","$location","$translate","$sce",function(n,t,i,r,u,f,e){var y=r._catalog,o=settings.catalogs[y],c=function(){return r._la},l=function(){return o.show_language_switch},p=function(){return o.appTitle[c()]},w=function(){return o.appAdditionalTitle[c()]},b=function(){return o.mainSite_text[r._la]},k=function(){return o.mainSite_url[r._la]},d=function(){return o.dataPortaal_text[r._la]},g=function(){return o.dataPortaal_url[r._la]},h=settings.catalogs[r._catalog].languages,nt=_.keyBy(h.map(function(n){return{key:n,title:e.instant("dictionary.languageSwitch_"+_.toUpper(n)),url:i.href("app.home",{_catalog:r._catalog,_la:n},{absolute:!0})}}),"key"),tt=_.filter(h,function(n){if(_.toLower(n)!==_.toLower(r._la))return n})[0],s=o.navMenu(i,e),it=function(){n.search={searchplaceholder:e.instant("dictionary.ZoekenOpTrefwoord_Placeholder"),searchkeywords:i.params.searchKeywords,searchterm:function(n){var u=$.extend({},r,{searchKeywords:n});i.go("app.navigatieScherm.zoeken",u);t.$broadcast("$searchByKeyword",{resetFacets:!0})}};l()!==undefined&&l()===!0&&s.push({toggle:!0,toggleButtons:nt,isMobileOnly:!0,objectID:4});a(i.current.name,s);v()},rt=function(n){_.map(n,function(n){_.isUndefined(n.cssClass)||_.isNull(n.cssClass)||delete n.cssClass})},a=function(n,t){var i=t.filter(function(t){return n===t.stateName})[0];_.isUndefined(i)||_.isNull(i)||(i.cssClass="current")},v=function(){n.data={appTitle:p(),appAdditionalTitle:w(),homeUrl:i.href("app.home",{},{absolute:!0}),mainSiteText:b(),mainSiteUrl:k(),dataportaalText:d(),dataportaalUrl:g(),languages:h,languageToggleInitValue:tt,navmenu:s}};t.$on("$stateChangeStart",function(n,t){rt(s);a(t.name,s);v()});it()}])}(),function(){angular.module("CbsApp").controller("footerController",["$scope","$rootScope","$state","$stateParams","$window","$location","$translate","$sce",function(n,t,i,r,u,f,e){var h=r._catalog,o=settings.catalogs[h],c=function(){return o.show_language_switch},l=function(){return o.payoff[r._la]},a=function(){return o.copyRight[r._la].replace("{{jaar}}",(new Date).getFullYear())},v=function(){return o.mainSite_text[r._la]},y=function(){return o.dataPortaal_text[r._la]},p=function(){return o.mainSite_url[r._la]},w=function(){return o.dataPortaal_url[r._la]},s=settings.catalogs[r._catalog].languages,b=_.keyBy(s.map(function(n){return{key:n,title:e.instant("dictionary.languageSwitch_"+_.toUpper(n)),url:i.href("app.home",{_catalog:r._catalog,_la:n},{absolute:!0})}}),"key"),k=_.filter(s,function(n){if(_.toLower(n)!==_.toLower(r._la))return n})[0],d=[{toggle:!0,toggleButtons:b,objectID:0},{title:y(),url:w(),objectID:1},{title:v(),url:p(),objectID:2},],g={showTaalSwitch:c(),payOffText:l(),copyRightText:a(),languages:s,languageToggleInitValue:k,menu:d};n.data=g}])}(),function(){angular.module("CbsDirectives").directive("onFinishRender",["$timeout","$parse",function(n,t){return{restrict:"A",link:function(i,r,u){i.$last===!0&&n(function(){i.$emit("ngRepeatFinished");!u.onFinishRender||t(u.onFinishRender)(i)})}}}])}(),function(){angular.module("CbsDirectives").directive("jqueryuiDraggable",[function(){return{restrict:"A",link:function(n,t){t.draggable({axis:"y",handle:".row.dropdown-toggle",zIndex:1e3,revert:"invalid",start:function(t,i){$("div.list-group-item.open").removeClass("open");var r=$(t.target).closest("div.list-group-item");r.closest(".dropzone").hasClass("disabled")?(t.preventDefault(),t.stopPropagation(),$("body").css("cursor","auto")):($(this).draggable("option","cursor","move"),$(this).draggable("option","cursorAt",{top:Math.floor(i.helper.height()/2)}),r.addClass("dragging"),r.closest(".dropzone").addClass("drag-source"),$(i.helper).addClass("ui-draggable-helper"));n.$apply()},stop:function(t){var i=$(t.target).closest("div.list-group-item");$(".dropzone").removeClass("drag-source");i.removeClass("dragging");$("body").css("cursor","auto");n.$apply()},helper:function(n){var t=$(n.target).closest("div.list-group-item");return t.find(".title").clone().css({width:t.width(),height:50,padding:"4px","background-color":"#E5E5E5;","font-size":"12px","font-weight":"bold",color:"#000","margin-left":"7px",opacity:.8})}})}}}])}(),function(){angular.module("CbsDirectives").directive("jqueryuiDroppable",["tableState","$rootScope",function(n,t){return{restrict:"A",link:function(i,r){r.droppable({tolerance:"touch",activeClass:"ui-state-highlight",hoverClass:"drop-hover",drop:function(r,u){var l=angular.element(u.draggable).data("value"),h=angular.element(u.draggable).data("source"),o=angular.element(this),s=o.data("zone"),f,e,c;o.hasClass("disabled")||o.hasClass("list-group-item")?(r.preventDefault(),r.stopPropagation()):(f=n.current.UserData,c=function(){var n=f.LegendDimension;f.LegendDimension=f.XAxisDimension;f.XAxisDimension=n},h!==s&&(h==="yaxis"&&(s==="xaxis"?c():(e=o.find(".drop-hover").data("value"),e&&(f.LegendDimension=e))),h==="xaxis"&&(s==="yaxis"?c():(e=o.find(".drop-hover").data("value"),e&&(f.XAxisDimension=e))),h==="instellingen"&&(s==="yaxis"&&(f.LegendDimension=l),s==="xaxis"&&(f.XAxisDimension=l)),t.$broadcast("doRefresh",f)));$("body").css("cursor","auto");i.$apply()}})}}}])}(),function(){angular.module("CbsApp").controller("homeController",["$scope","$rootScope","$stateParams","isInIframe","MetaService",function(n,t,i,r,u){n.setMeta=function(){var n=default_settings.catalogs[i._catalog].korteUitleg[i._la]||"";n=n.replace(/(<([^>]+)>)/ig,"");u.setMeta("title",u.DefaultTitle);u.setMeta('name="apple-mobile-web-app-title"',u.DefaultMobileTitle);u.setMeta('name="description"',n)};n.setMeta();t.isInIframe=r;r&&t.$broadcast("$stateChangeError",null,null,null,null,"Een widget heeft geen HomePage",!0);n.CurrentDate=(new Date).getFullYear()}])}(),function(){angular.module("CbsDirectives").directive("homecontent",["$filter","$rootScope","$state","$sce","$translate",function(n,t,i,r){return{restrict:"AE",replace:!0,transclude:!1,scope:{},templateUrl:"./app/components/home/homecontent.html",link:function(){},controller:["$rootScope","$scope","$stateParams","$q","homepageRepository","catalog",function(n,t,u,f,e,o){var s,h,c;t.contentItems=null;t.hasContentItems=function(){return t.contentItems===null?null:t.contentItems.length>0};t.getScafoldingSize=function(n){return n===0?"banner-article":"text-article"};t.getStyleMSRows=function(){if(_.isUndefined(t.contentItems)||_.isNull(t.contentItems))return"";var n="-ms-grid-rows: auto";return _.forEach(t.contentItems,function(t,i){i%2!=0&&(n+=" 1fr")}),n+=";"};t.getBackgroundformat=function(){return ResponsiveBootstrapToolkit.is("xs")?"720x360":"1200x600"};t.replaceSiteCoreImageUrl=function(n,t){var i=/\-*(\d+)x(\d+)/;return _.isNull(n)||n==""?"":t===0&&!ResponsiveBootstrapToolkit.is("xs")?n.replace(i,"1200x600"):ResponsiveBootstrapToolkit.is("xs")?n.replace(i,"720x360"):n.replace(i,"720x480")};t.getHomeContent=function(){var n=u._catalog,i=u._la;return f(function(u,f){settings.hasInternetAccess?e.getContent(n,i).then(function(n){t.contentItems=[];_.forEach(n,function(n,i){var u={Index:i,Image:t.replaceSiteCoreImageUrl(n.Image,i),ImageAlt:n.ImageAlt,Title:r.trustAsHtml(n.Title),Body:r.trustAsHtml(n.Snippet)};t.contentItems.push(u)});u(t.contentItems)},function(n){console.log(n);t.contentItems=[];f(n)}):(t.contentItems=[],u(t.contentItems))})};s=function(){var n=u._catalog,t=u._la,i=settings.catalogs[n].korteUitleg[t];return r.trustAsHtml(i)};t.korteUitleg=s;t.backgroundUrl=function(){var n=u._la,i=_.template("url(<%= url%><%= format%>.jpg)");return settings.catalogs[u._catalog].backgroundAppURL[n]===undefined?"none":_.flow([i])({url:settings.catalogs[u._catalog].backgroundAppURL[n],format:t.getBackgroundformat()})};h=u._la;c=u._catalog;t.recentTables=[];var a=function(){var n=f.defer();return o.getChangedTablesLastMonthUntilNow(c,h,5).then(function(t){n.resolve(t[0].value)},function(t){n.reject(t)}),n.promise},l=function(n,t){var r=$.extend({},u,{tableId:t.ID,graphtype:"Table",ts:Date.now().toString()});i.go("app.tableUI.table",r)},v=function(){return a().then(function(n){t.recentTables=n;t.getHomeContent();t.gotoDataSet=l},function(){t.getHomeContent();t.gotoDataSet=l})};v()}]}}])}(),function(){angular.module("CbsApp").factory("tableInfoService",["tableState","$translate","$stateParams","$sce",function(n,t,i,r){var o=function(){var t=n.current.UserData.GetTopicsFilter();return n.current.UserData.Collections.Topics.allSelected?_.map(n.current.MetaData.CollectionsData.Topics.Categories,function(n){return n.Key}):_.map(n.current.UserData.Collections.Topics[t],function(n){return n.Key})},f=function f(t,i){var u=[],r;return _.forEach(n.current.MetaData.TopicGroups,function(n){if(n.ParentId===t){var e=f(n.Id,i);e&&e.length>0&&(r=_.clone(n),r.children=e,u.push(r))}}),_.forEach(n.current.MetaData.Topics,function(n){n.ParentId===t&&_.some(i,function(t){return n.Key===t})&&(r=_.clone(n),u.push(r))}),u.sort(function(n,t){var i=n.Id,r=t.Id;return i<r?-1:i>r?1:0})},s=function(){return _.chain(n.current.UserData.Collections).reject(function(n){return"Topics"===n.Key}).map(function(t){var r=n.current.MetaData.CollectionsData[t.Key].Title,u=n.current.UserData.GetDimensionSelection(t.Key),f=u.selectedCategories,e=_.sortBy(f,["Position"]),o=_.map(e,function(i){var u=n.current.UserData.GraphType,r;if(u==="Map"){if("BU"===t.Indeling&&i.Key.substr(8,2)==="  ")return;if("WK"===t.Indeling&&(i.Key.substr(8,2)!=="  "||i.Key.substr(6,2)==="  "))return}return r={Title:i.Title,Description:i.Description},"Voorlopig"===i.Status&&(r.Title+="*"),"NaderVoorlopig"===i.Status&&(r.Title+="**"),r}),i=o.filter(Boolean);return{Title:r,Description:"",children:i,childrenCount:i.length,Key:t.Key}}).value()},h=function(n){var t=document.createElement("div");return t.innerHTML=n.desc,t},c=function(){var n=document.createElement("h5");return n.innerHTML=t.instant("dictionary.Onderwerpen"),n.setAttribute("class","onderwerp"),n},l=function(n){var i=document.createElement("ul"),t=document.createElement("li"),r=document.createElement("ul");return _.each(n.subjectTree,function(n){r.appendChild(u(n))}),t.appendChild(c()),t.appendChild(r),i.appendChild(t),i},a=function(n){var t=document.createElement("ul");return _.each(n.dimensions,function(n){t.appendChild(u(n))}),t},u=function u(n){var t=document.createElement("li"),r=document.createElement("h5"),i,f;return r.innerHTML=n.Title,r.setAttribute("class","onderwerp"),i=document.createElement("pre"),_.isNull(n.Description)||(i.innerHTML=n.Description),i.setAttribute("style","background-color: inherit; padding: 0; border: none;"),f=document.createElement("ul"),_.each(n.children,function(n){f.appendChild(u(n))}),t.appendChild(r),t.appendChild(i),t.appendChild(f),t},v=function(n,t){return e(t)},y=function(n,t){return e(t)},e=function(n){if(_.isUndefined(n)||_.isUndefined(n)||_.isUndefined(n.Description)||_.isNull(n.Description)||_.isEmpty(n.Description))return null;var i="...\n\n<i>"+t.instant("dictionary.omission")+"<\/i>",r={Description:_.truncate(n.Description,{length:settings.tooltip_truncate_length,separator:/,? +/,omission:i}).replace(/\n/g,"<br />")},u=_.template("<%= Description %>");return u(r)};return function(){var t=o(),i=s();return{id:n.current.MetaData.data.TableInfos.value[0].Identifier,title:n.current.MetaData.data.TableInfos.value[0].Title,desc:r.trustAsHtml("<pre>"+n.current.MetaData.data.TableInfos.value[0].Description+"<\/pre>"),subjectTree:f(null,t),dimensions:i,descriptionDomElement:h,subjectsDomElement:l,dimensionsDomElement:a,tooltip:{dimensionTooltip:v,subjectTooltip:y}}}}])}(),function(){angular.module("CbsApp").controller("tableviewController",["$location","$rootScope","$scope","$state","$stateParams","tableState","fullTableMeta","isInIframe","$translate","MetaService","notificationPanelService",function(n,t,i,r,u,f,e,o,s,h,c){i.isSiderbarShown=null;i.toggleSideBar=function(n){if(i.isSiderbarShown)i.isSiderbarShown=!1;else{var t=$("html, body"),r=$(n.target).offset().top-10;t.stop().animate({scrollTop:r},300,"swing",function(){i.$apply(function(){i.isSiderbarShown=!0})})}};this.SetView=function(n){f.current.UserData.GraphType=n};var l=function(r){t.isInIframe=o;i.selected="table";_.isUndefined(t.showWarning)&&(t.showWarning=!0);r&&(i.state=f.current,i.currentDate=new Date,f.AreParamsParsed||(u=angular.extend(u,n.$$search),f.ParseParams(u)))};i.isBarHorizontal=function(){return f.current.UserData.GraphType==="Bar"&&f.current.UserData.horizontal};i.isGeoDetail=function(){return f.current.MetaData.HasGeoDetail&&f.current.UserData.GraphType==="Map"};i.ModifiedDate=function(){var n=f.current.MetaData.Modified,t;return _.isUndefined(n)||_.isNull(n)?"":(t=new Date(n.substring(0,4),n.substring(5,7)-1,n.substring(8,10),n.substring(11,13),n.substring(14,16),0),t.getDate()+" "+s.instant("month."+t.getMonth())+" "+t.getFullYear())};i.getSelectionUrl=f.GetSelectionUrl;i.closeWarning=function(){t.showWarning=!1};i.setMeta=function(n,t){var i=t.Title,r=t.Summary;h.setMeta("title",i);h.setMeta('name="description"',r)};i.$on("$stateChangeStart",function(n,t,i,e,o){var s,h;$(".nvtooltip").remove();$(".jquerytooltip").click();f.current.MetaData.Identifier!==o.tableId?f.AreParamsParsed=!1:(o.ts&&(f.history[o.ts]=JSON.stringify(f.current.UserData)),_.isUndefined(i.tableId)||(u.tableId!==i.tableId?f.AreParamsParsed&&(f.AreParamsParsed=!1,n.preventDefault(),s=i.ts<o.ts?i.ts:Date.now().toString(),r.go(t.name,$.extend(i,{ts:s}),{location:"replace",reload:!0})):u.tableId===i.tableId&&i.dl!==o.dl?(f.AreParamsParsed=!1,n.preventDefault(),r.go("^",$.extend(u,{ts:Date.now().toString()}),{location:"replace",reload:!0})):(t.name!=="app.tableUI.barh"||f.current.MetaData.BarHorizontal)&&(t.name!=="app.tableUI.barv"||f.current.MetaData.BarVertical)&&(t.name!=="app.tableUI.line"||f.current.MetaData.Line)&&(t.name!=="app.tableUI.map"||f.current.MetaData.Map)||(n.preventDefault(),h=$.extend(u,{graphtype:"Table",ts:Date.now().toString()}),f.current.UserData.GraphType="Table",f.AreParamsParsed=!1,r.go("app.tableUI.table",h,{location:"replace",reload:!0}))))});i.$on("$stateChangeSuccess",function(t,e,o,s,h){var a,v,w,l,y,p,b;if(r.includes("app.tableUI")){if(l=f.current.UserData.GraphType,r.is("app.tableUI")){setTimeout(function(){var n,i;n=l.toLowerCase()==="bar"?f.current.UserData.horizontal?"barh":"barv":l.toLowerCase();i=$.extend(u,{graphtype:l,ts:Date.now().toString()});(n!=="barh"||f.current.MetaData.BarHorizontal)&&(n!=="barv"||f.current.MetaData.BarVertical)&&(n!=="line"||f.current.MetaData.Line)&&(n!=="map"||f.current.MetaData.Map)?r.go("."+n,i,{location:"replace"}):(n="table",t.preventDefault(),i=$.extend(u,{graphtype:"Table"}),f.current.UserData.GraphType="Table",f.AreParamsParsed=!1,r.go("app.tableUI.table",i,{location:"replace",reload:!0}))},0);return}a=r.current.name.split(".").slice(1,3).pop();o.tableId===h.tableId&&o.dl===h.dl&&(v=s.name.split(".").slice(1,3).pop());w=function(n){return n.toLowerCase()==="line"?"Line":n.toLowerCase()==="barv"||n.toLowerCase()==="barh"?"Bar":n.toLowerCase()==="table"?"Table":n.toLowerCase()==="map"?"Map":void 0};(e.name!=="app.tableUI.barh"||f.current.MetaData.BarHorizontal)&&(e.name!=="app.tableUI.barv"||f.current.MetaData.BarVertical)&&(e.name!=="app.tableUI.line"||f.current.MetaData.Line)&&(e.name!=="app.tableUI.map"||f.current.MetaData.Map)?(l=w(a),y=!1,f.current.UserData.PreviousType=v,f.current.UserData.GraphType=l,v===undefined&&(f.current.UserData.PreviousType=l),o.ts&&f.history[o.ts]&&(y=!0,f.current.UserData=$.extend(f.current.UserData,JSON.parse(f.history[o.ts])),p=$(".modal:visible"),p.length>0&&p.each(function(){$(this).modal("hide")}),$("div.modal-backdrop:visible").length>0&&$("div.modal-backdrop").remove(),$(".nvtooltip").remove(),$(".jquerytooltip").click()),f.AreParamsParsed&&(y||f.current.UserData.TransformGraphType(l,a=="barh"),f.current.UserData.horizontal=a=="barh",f.current.UserData.ValidateAxis(l,a=="barh"),i.AllowInstellingenYaxisSwap=f.current.UserData.AllowInstellingenYaxisSwap,i.AllowYaxisXaxisSwap=f.current.UserData.AllowYaxisXaxisSwap,i.selected=a,i.emitRefresh(f.current.UserData),i.setMeta(e,f.current.MetaData))):setTimeout(function(){var n=$.extend(u,{graphtype:"Table",ts:Date.now().toString()});f.current.UserData.GraphType="Table";f.AreParamsParsed=!1;r.go("^",n,{location:"replace",reload:!0});return},0);h.fromstatweb===undefined&&o.fromstatweb&&c.state.isNotificationPanelVisible===!1&&(b=default_settings.catalogs[u._catalog].welcome_text_fromstatweb[u._la],c.ShowWarning(b),_.unset(n.$$search,"fromstatweb"))}});i.emitRefresh=function(n){t.$broadcast("doRefresh",n)};l(e)}])}(),function(){angular.module("CbsApp").controller("navigatieSchermController",["$scope","$rootScope","$state","$stateParams","$location","odataCatalogRepository","catalog",function(n,t,i,r,u){n.gotoSearchSubstate=function(){if(i.current.name!=="app.navigatieScherm.zoeken"){var t=$.extend({},r,{searchKeywords:n.searchKeywords});i.go("app.navigatieScherm.zoeken",t)}};n.$on("$stateChangeSuccess",function(){if(i.includes("app.navigatieScherm")&&!i.is("app.navigatieScherm")&&(n.selected=i.current.name.split(".").slice(1,3).pop(),t.activeNav=n.selected,t.lastNavPath=u.url()),i.is("app.navigatieScherm")){var r="zoeken";t.activeNav&&(r=t.activeNav);i.go("app.navigatieScherm."+r)}})}])}(),function(){angular.module("CbsDirectives").directive("graphline",["$rootScope","$stateParams","$filter","DataReshaper","tableState","downloadService","widgetService",function(n,t,i,r,u,f,e){return{restrict:"AE",replace:!0,transclude:!1,scope:!0,templateUrl:"./app/components/graphLineDirective/graphLine.html",controller:["$scope",function(){}],link:function(n){n.$on("doRefresh",function(n,i){i.GraphType==="Line"&&$("#nvd3line").length!==0&&(u.current.UserData.ValidateAxis("Line"),u.current.UserData.GetDataSet().then(function(n){t(n)}))});var t=function(n){var t={top:30,right:60,bottom:30,left:100},o=80,a=function(){var n=d3.select("div[name=footer]").node();return _.isNull(n)?0:n.getBoundingClientRect().height},v=function(){if($("#nvd3line").length===0)return 0;var n=parseInt(d3.select("#nvd3line").style("width"),10);return Math.max(n,580)},c=function(){if($("#nvd3line").length===0)return 0;var n=$(window).height()-$("#nvd3line").offset().top-a();return Math.max(n,495)},h=function(){return v()},s=function(){return c()-15},l=function(n){var e,r;if($("#selectie").remove(),$("#legend").remove(),e=d3.select("#nvd3line svg g.graybar"),e.select("rect").attr("width",h()-t.left-t.right).attr("height",o),e.attr("transform","translate("+ +t.left+","+(s()-t.bottom-o)+")"),ResponsiveBootstrapToolkit.is("xs")){var i=$("#nvd3line svg").get(0),c=f.createTableinfo(i,u.current,!1,+t.left,!1,0),y=function(){return _.isUndefined(c[0][0])?0:c[0][0].getBoundingClientRect().height},l=f.appendLegend(i,u.current,!0),p=function(){return _.isUndefined(l[0][0])?0:l[0][0].getBoundingClientRect().height};n.height(s()-o-p()-y()).update();c=f.createTableinfo(i,u.current,!1,+t.left,!1,0);var w=d3.select(i).select(".nv-wrap"),b=w.attr("transform"),k=/\(([^ ,]*)/,d=/([^ ,]*)\)/,a=+k.exec(b)[1],v=+d.exec(b)[1]+y();w.attr("transform","translate("+a+", "+v+")");l=f.appendLegend(i,u.current,!0);r=d3.select(i).selectAll(".graybar").attr("transform");r&&(a=+k.exec(r)[1],v=+d.exec(r)[1]-p(),d3.select(i).selectAll(".graybar").attr("transform","translate("+a+", "+v+")"))}d3.select("#nvd3line svg .nv-axis.nv-y .nv-axislabel").attr("style",null);d3.select("#nvd3line svg .nv-axis.nv-x .nv-axislabel").attr("text-anchor","end").attr("x",h()-t.left-t.right).attr("y",70)},y=function(n){var i=d3.select("#nvd3line"),r=i.select("svg"),t=c();i.attr("height",t+"px");r.attr("height",t+"px");$("#nvd3line svg").css({height:t+"px"});n.yAxis.ticks((s()-o)/36);n.width(h()).height(s()-o).update();l(n)};u.current.UserData.ValidateAxis("Line");nv.addGraph(function(){var f=nv.models.lineChart().margin(t).useInteractiveGuideline(!0).showLegend(!1).showXAxis(!0).showYAxis(!0).width(h()).height(s()-o),w,b,g,ft,k,d,nt,a;f.color(e.getChartColors());var tt=r.Reshape(u.current.UserData.XAxisDimension,u.current.UserData.LegendDimension,u.current.UserData.Collections.Topics[u.current.UserData.LegendDimension==="Topics"?"Legend8":"Single"],n),v=[],p={};_.forEach(u.current.UserData.Collections[u.current.UserData.LegendDimension].Legend8,function(n){p[n.Key]=[]});w=0;_.forEach(tt,function(n){var t=n[u.current.UserData.XAxisDimension];v[w]=t;u.current.UserData.XAxisDimension===u.current.MetaData.TimeDimension&&(t=w++);_.forEach(u.current.UserData.Collections[u.current.UserData.LegendDimension].Legend8,function(i){p[i.Key].push({x:t,y:isFinite(n[i.Key])?parseFloat(n[i.Key]):null})})});b=[];_.forEach(u.current.UserData.Collections[u.current.UserData.LegendDimension].Legend8,function(n){b.push({values:p[n.Key],key:u.current.MetaData.CollectionsData[u.current.UserData.LegendDimension].Categories[n.Key].Key})});var it=function(n){var t=i("ToDateString")(v[n]).replace(".",""),r="",f;return u.current.MetaData.HasTimeDimension&&(f=u.current.MetaData.CollectionsData[u.current.MetaData.TimeDimension].Categories[v[n]],_.isUndefined(f)||(r=f.Status),"Voorlopig"==r&&(t+="*"),"NaderVoorlopig"==r&&(t+="**")),t},rt=function(){var n=u.current.MetaData.Topics[u.current.UserData.Collections.Topics.Single[0].Key],t=n.Decimals,r=n.Unit;return function(n){return i("cbsnumber")(n,t)}},ut=u.current.MetaData.CollectionsData[u.current.UserData.XAxisDimension].Type=="TimeDimension";return f.xAxis.axisLabel(u.current.MetaData.CollectionsData[u.current.UserData.XAxisDimension].Title).tickFormat(it).staggerLabels(!ut),g=u.current.MetaData.Topics[u.current.UserData.Collections.Topics.Single[0].Key].Unit,f.yAxis.axisLabel(g).showMaxMin(!1).rotateYLabel(!1).axisLabelDistance(12).ticks((s()-o)/36).tickPadding(10).tickFormat(rt()),ft=function(){d3.select("#nvd3line svg .nv-axis.nv-x .nv-axislabel").attr("text-anchor","end").attr("x",d3.select("#nvd3line svg").node().getBBox().width-70).attr("y",50)},k=d3.select("#nvd3line svg").datum(b).call(function(n){f(n)}),k.select("g.graybar").empty()&&(d=k.insert("g",":first-child"),d.attr("class","graybar").append("rect"),settings.show_cbs_logo&&(nt=d.append("g").attr("id","CbsLogo"),a=nt.append("g"),a.attr("transform","translate(5, 40) scale(0.7)"),a.append("g").attr("id","c").append("path").attr("id","c_path").attr("d","m12.82,6.95l-11.29,0c-0.85,0,-1.53,0.68,-1.53,1.53l0,12.44l12.82,0l0,-5.78l-7.04,0l0,-2.41l7.04,0L12.82,6.946248531341553Zm-1.69,1.68l0,2.41l-5.36,0l-1.68,0l0,1.69l0,2.41l0,1.68l1.68,0l5.36,0l0,2.42l-9.45,0l0,-10.61l9.45,0"),a.append("path").attr("id","b_path").attr("d","m20.78,12.72l2.42,0l0,2.41l-2.42,0l0,-2.41Zm-1.53,-12.72l-4.24,0l0,20.92l13.99,0l0,-12.44c0,-0.85,-0.68,-1.53,-1.53,-1.53l-6.68,0l0,-5.34c0,-0.85,-0.68,-1.61,-1.53,-1.61m-0.16,16.81l1.68,0l2.42,0l1.68,0l0,-1.68l0,-2.41l0,-1.69l-1.68,0l-2.42,0l-1.68,0l0,1.69l0,2.41l0,1.68m0.01,-15.13l0,5.26l0,1.68l1.68,0l6.53,0l0,10.6l-10.62,0l0,-17.55l2.41,0"),a.append("g").attr("id","s").append("path").attr("id","s_path").attr("d","m28.98,23.1l-28.98,0l0,13.74l23.21,0l0,2.18l-23.21,0l0,4.25c0,0.85,0.69,1.53,1.53,1.53l25.92,0c0.84,0,1.53,-0.69,1.53,-1.53l0,-12.22l-23.2,0l0,-2.14L28.98,28.911117553710938L28.98,23.097368240356445Zm-1.68,1.68l0,2.44l-21.5,0l-1.68,0l0,1.68l0,2.14l0,1.68l1.68,0l21.51,0l0,10.38l-25.62,0l0,-2.42l21.53,0l1.69,0l0,-1.68l0,-2.18l0,-1.68l-1.68,0l-21.53,-0.01l0,-10.37l25.61,0"))),$("#nvd3line svg").css({height:c()+"px"}),l(f),window.onresize=function(){y(f)},$("#nvd3line .nvtooltip").remove(),$(".jquerytooltip").click(),f},function(n){var t=n.interactiveLayer.tooltip,r=function(n){var r,e,o,t,f;return n===null?"":(r=d3.select(document.createElement("table")),!0&&(e=r.selectAll("thead").data([n]).enter().append("thead"),e.append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(n.value)),o=r.selectAll("tbody").data([n]).enter().append("tbody"),t=o.selectAll("tr").data(function(n){return n.series}).enter().append("tr").classed("highlight",function(n){return n.highlight}),t.append("td").classed("legend-color-guide",!0).append("div").style("background-color",function(n){return n.color}),t.append("td").classed("key",!0).html(function(n){return u.current.MetaData.CollectionsData[u.current.UserData.LegendDimension].Categories[n.key].Title}),t.append("td").classed("value",!0).html(function(n){var t=u.current.MetaData.Topics[u.current.UserData.Collections.Topics.Single[0].Key],r=t.Decimals;return n.value===null?"":i("cbsnumber")(n.value,r)}),t.selectAll("td").each(function(n){if(n.highlight){var t=d3.scale.linear().domain([0,1]).range(["#fff",n.color]),i=.6;d3.select(this).style("border-bottom-color",t(i)).style("border-top-color",t(i))}}),f=r.node().outerHTML,n.footer!==undefined&&(f+="<div class='footer'>"+n.footer+"<\/div>"),f)};return t.contentGenerator(r),n})};u.current.UserData.GraphType==="Line"&&(u.current.UserData.ValidateAxis("Line"),u.current.UserData.GetDataSet().then(function(n){t(n)}))}}}])}(),function(){angular.module("CbsDirectives").directive("graphbar",["$rootScope","$state","$stateParams","$filter","DataReshaper","$translate","tableState","downloadService","widgetService",function(n,t,i,r,u,f,e,o,s){return{restrict:"AE",replace:!0,transclude:!1,scope:!0,templateUrl:"./app/components/graphBarDirective/graphBar.html",link:function(n){n.$on("doRefresh",function(){if(e.current.UserData.GraphType==="Bar"){n.substate=t.current.name.split(".").slice(1,3).pop();var r=n.substate==="barh"&&e.current.UserData.horizontal||n.substate==="barv"&&!e.current.UserData.horizontal;$("#nvd3bar").length!==0&&r&&(e.current.UserData.ValidateAxis("Bar",e.current.UserData.horizontal),e.current.UserData.GetDataSet().then(function(t){i(t);var r="barv";n.substate==="barh"&&e.current.UserData.horizontal&&(r=n.substate)}))}});var i=function(t){var i=n.substate=="barv"?{top:30,right:60,bottom:30,left:100}:{top:30,right:60,bottom:30,left:260},v=16,h=80,b=function(){var n=d3.select("div[name=footer]").node();return _.isNull(n)?0:n.getBoundingClientRect().height},y=i.left,k=function(){var n,t;return $("#nvd3bar").length===0?0:(n=d3.select("#nvd3bar"),n.node()&&(t=parseInt(n.style("width"),10)),Math.max(t,580))},a=function(){var n,t;return $("#nvd3bar").length===0?0:(n=$("#nvd3bar").offset(),n&&(t=$(window).height()-n.top-b()),Math.max(t,495))},l=function(){return k()-15},c=function(){return a()-15},d=function(n){return $.isNumeric(n)?e.current.MetaData.TopicGroups[n]:null},g=function(n){var t=n,i=[];if(t.ParentId===undefined)return i;for(i=[t.Title];t.ParentId!==null;)t=d(t.ParentId),i.unshift(t.Title);return i},nt=function(n,t){var i=g(t),r;if(i!==undefined&&i.length>0){for(r=0;r<i.length;r++)r==0?n.text(i[0]):n.append("tspan").text(i[r]).attr("x",-5).attr("dy",v);n.attr("y",v*(i.length-1)/-2)}else n.text(t.Title);return n},p=function(t){var u,a,v,et,p,it,ot,r,w,rt;$("#selectie").remove();$("#legend").remove();var r=d3.select("#nvd3bar svg g.graybar"),s=0,f=0;if(ResponsiveBootstrapToolkit.is("xs")){u=$("#nvd3bar svg").get(0);a=o.createTableinfo(u,e.current,!1,+i.left,!1,0);f=a[0][0].getBoundingClientRect().height;v=o.appendLegend(u,e.current,!0);s=+v[0][0].getBoundingClientRect().height;t.height(c()-h-s-f).update();a=o.createTableinfo(u,e.current,!1,+i.left,!1,0);var b=d3.select(u).select(".nv-wrap"),k=b.attr("transform"),ut=+/\(([^ ,]*)/.exec(k)[1],ft=+/([^ ,]*)\)/.exec(k)[1]+f;b.attr("transform","translate("+ut+", "+ft+")");v=o.appendLegend(u,e.current,!1)}if(n.substate=="barv")d3.select("#nvd3bar svg .nv-axis.nv-y .nv-axislabel").attr("style",null),d3.select("#nvd3bar svg .nv-axis.nv-x .nv-axislabel").attr("text-anchor","end").attr("x",l()-i.left-i.right).attr("y",70),r.attr("transform","translate("+ +i.left+","+(c()-i.bottom-h-s)+")"),r.select("rect").attr("width",l()-i.left-i.right).attr("height",h);else{var d=d3.selectAll("#nvd3bar svg .nv-axis.nv-y .tick text")[0],g=Number.MIN_VALUE,tt=Number.MAX_VALUE;_.forEach(d,function(n){var t=n.getBoundingClientRect(),i=d3.select(n);t.left>g?(g=t.right,i.style("opacity",1)):i.style("opacity",0)});_.forEach(d.reverse(),function(n){var t=n.getBoundingClientRect(),i=d3.select(n);t.right<tt?(tt=t.left,i.style("opacity",1)):i.style("opacity",0)});et=d3.select("#nvd3bar svg .nv-axis.nv-y .nv-zeroLine line")[0][0];d3.select("#nvd3bar svg .nv-axis.nv-x .nv-axislabel").attr("style",null).attr("transform",null).attr("x",-5).attr("y",-10);d3.select("#nvd3bar svg .nv-axis.nv-y .nv-axislabel").attr("text-anchor","end").attr("x",l()-i.left-i.right).attr("y",40);e.current.UserData.XAxisDimension==="Topics"&&(p=e.current.MetaData.CollectionsData.Topics.Categories,ot=d3.selectAll("#nvd3bar svg .nv-axis.nv-x .tick.zero text").each(function(n){it=p[n];it&&nt(d3.select(this),p[n])}));r=d3.select("#nvd3bar svg g.graybar");w=+c()-i.bottom-i.top-h-s-f;r.attr("transform","translate("+(+i.left-y)+","+(+i.top+f)+")");r.select("rect").attr("width",y).attr("height",w);rt=r.select("#CbsLogo g");rt.attr("transform","translate(5, "+(+w-40)+") scale(0.7)")}},w=function(n){var i;n.yAxis.ticks((c()-h)/36);var r=d3.select("#nvd3bar"),u=r.select("svg"),t=a();n.width(l()).height(c()-h).update();r.attr("height",t);u.attr("height",t);$("#nvd3bar svg").css({height:t+"px"});i=function(){p(n)};i();setTimeout(i,300)};e.current.UserData.ValidateAxis("Bar",e.current.UserData.horizontal);nv.addGraph(function(){var o,v,nt,b,y,k,d,rt,tt,it,ut,g;if(n.substate=="barv")o=nv.models.multiBarChart().reduceXTicks(!0),o.multibar._options.duration=0;else{o=nv.models.multiBarHorizontalChart();o.dispatch.on("renderEnd",function(){p(o)})}o.margin(i).showControls(!1).showLegend(!1).groupSpacing(.2).width(l()).height(c()-h);o.color(s.getChartColors());v=e.current.UserData.GetLegendType();e.current.UserData.XAxisDimension!=="Topics"?(nt=u.Reshape(e.current.UserData.XAxisDimension,e.current.UserData.LegendDimension,e.current.UserData.Collections.Topics[e.current.UserData.LegendDimension==="Topics"?v:"Single"],t),b=[],y={},_.forEach(e.current.UserData.Collections[e.current.UserData.LegendDimension][v],function(n){y[n.Key]=[]}),k=0,_.forEach(nt,function(n){var t=n[e.current.UserData.XAxisDimension];b[k]=t;e.current.UserData.XAxisDimension===e.current.MetaData.TimeDimension&&(t=k++);_.forEach(e.current.UserData.Collections[e.current.UserData.LegendDimension][v],function(i){y[i.Key].push({x:t,y:isFinite(n[i.Key])?parseFloat(n[i.Key]):null})})}),d=[],_.forEach(e.current.UserData.Collections[e.current.UserData.LegendDimension][v],function(n){var t=e.current.MetaData.CollectionsData[e.current.UserData.LegendDimension].Categories[n.Key].Title,i=n.Status;"Voorlopig"==i&&(t+="*");"NaderVoorlopig"==i&&(t+="**");d.push({values:y[n.Key],key:t})})):(nt=u.Reshape(e.current.UserData.LegendDimension,e.current.UserData.XAxisDimension,e.current.UserData.Collections.Topics[v],t),b=[],y={},_.forEach(e.current.UserData.Collections[e.current.UserData.LegendDimension][v],function(n){y[n.Key]=[]}),k=0,_.forEach(nt,function(n){var i=n[e.current.UserData.LegendDimension],t=n[e.current.UserData.LegendDimension];b[k]=t;e.current.UserData.LegendDimension===e.current.MetaData.TimeDimension&&(t=k++);_.forEach(e.current.UserData.Collections[e.current.UserData.XAxisDimension][v],function(t){y[i].push({x:t.Key,y:isFinite(n[t.Key])?parseFloat(n[t.Key]):null})})}),d=[],_.forEach(e.current.UserData.Collections[e.current.UserData.LegendDimension][v],function(n){var t=e.current.MetaData.CollectionsData[e.current.UserData.LegendDimension].Categories[n.Key].Title,i=n.Status;"Voorlopig"==i&&(t+="*");"NaderVoorlopig"==i&&(t+="**");d.push({values:y[n.Key],key:t})}));var ft=function(n){if(e.current.UserData.XAxisDimension===e.current.MetaData.TimeDimension){var t,i="",u=e.current.MetaData.CollectionsData[e.current.UserData.XAxisDimension].Categories[b[n]];return undefined!==u&&(i=u.Status),t=e.current.UserData.horizontal?e.current.MetaData.CollectionsData[e.current.UserData.XAxisDimension].Categories[b[n]].Title:r("ToDateString")(b[n]).replace(".",""),"Voorlopig"==i&&(t+="*"),"NaderVoorlopig"==i&&(t+="**"),t}return e.current.MetaData.CollectionsData[e.current.UserData.XAxisDimension||e.current.MetaData.XAxisDimension].Categories[n].Title},et=function(){var n=e.current.MetaData.Topics[e.current.UserData.Collections.Topics.Single[0].Key],t=n.Decimals,i=n.Unit;return function(n){return n===null?f.instant("dictionary.GeenNumeriekeWaardeBeschikbaar"):r("cbsnumber")(n,t)}},ot=e.current.MetaData.CollectionsData[e.current.UserData.XAxisDimension].Type=="TimeDimension";return o.xAxis.axisLabel(e.current.MetaData.CollectionsData[e.current.UserData.XAxisDimension].Title).tickFormat(ft).staggerLabels(!ot).showMaxMin(!1),rt=e.current.MetaData.Topics[e.current.UserData.Collections.Topics.Single[0].Key].Unit,o.yAxis.axisLabel(rt).showMaxMin(!1).rotateYLabel(!1).axisLabelDistance(12).ticks((c()-h)/36).tickPadding(10).tickFormat(et()),tt=d3.select("#nvd3bar svg").datum(d).call(function(n){o(n)}),tt.select("g.graybar").empty()&&(it=tt.insert("g",":first-child"),it.attr("class","graybar").append("rect"),settings.show_cbs_logo&&(ut=it.append("g").attr("id","CbsLogo"),g=ut.append("g"),g.attr("transform","translate(5, 40) scale(0.7)"),g.append("g").attr("id","c").append("path").attr("id","c_path").attr("d","m12.82,6.95l-11.29,0c-0.85,0,-1.53,0.68,-1.53,1.53l0,12.44l12.82,0l0,-5.78l-7.04,0l0,-2.41l7.04,0L12.82,6.946248531341553Zm-1.69,1.68l0,2.41l-5.36,0l-1.68,0l0,1.69l0,2.41l0,1.68l1.68,0l5.36,0l0,2.42l-9.45,0l0,-10.61l9.45,0"),g.append("path").attr("id","b_path").attr("d","m20.78,12.72l2.42,0l0,2.41l-2.42,0l0,-2.41Zm-1.53,-12.72l-4.24,0l0,20.92l13.99,0l0,-12.44c0,-0.85,-0.68,-1.53,-1.53,-1.53l-6.68,0l0,-5.34c0,-0.85,-0.68,-1.61,-1.53,-1.61m-0.16,16.81l1.68,0l2.42,0l1.68,0l0,-1.68l0,-2.41l0,-1.69l-1.68,0l-2.42,0l-1.68,0l0,1.69l0,2.41l0,1.68m0.01,-15.13l0,5.26l0,1.68l1.68,0l6.53,0l0,10.6l-10.62,0l0,-17.55l2.41,0"),g.append("g").attr("id","s").append("path").attr("id","s_path").attr("d","m28.98,23.1l-28.98,0l0,13.74l23.21,0l0,2.18l-23.21,0l0,4.25c0,0.85,0.69,1.53,1.53,1.53l25.92,0c0.84,0,1.53,-0.69,1.53,-1.53l0,-12.22l-23.2,0l0,-2.14L28.98,28.911117553710938L28.98,23.097368240356445Zm-1.68,1.68l0,2.44l-21.5,0l-1.68,0l0,1.68l0,2.14l0,1.68l1.68,0l21.51,0l0,10.38l-25.62,0l0,-2.42l21.53,0l1.69,0l0,-1.68l0,-2.18l0,-1.68l-1.68,0l-21.53,-0.01l0,-10.37l25.61,0"))),$("#nvd3bar svg").css({height:a()+"px"}),w(o),window.onresize=function(){w(o)},$("body > .nvtooltip").remove(),$(".jquerytooltip").click(),o})};e.current.UserData.GraphType==="Bar"&&(n.substate=t.current.name.split(".").slice(1,3).pop(),e.current.UserData.ValidateAxis("Bar",e.current.UserData.horizontal),e.current.UserData.GetDataSet().then(function(n){i(n)}))}}}])}(),function(){angular.module("CbsDirectives").directive("graphmap",["$rootScope","$filter","tableState","DataReshaper",function(n,t,i,r){return{restrict:"AE",replace:!0,transclude:!1,scope:!0,templateUrl:"./app/components/graphMapDirective/graphMap.html",link:function(n){n.$on("doRefresh",function(n,r){r.GraphType==="Map"&&(i.current.UserData.ValidateAxis("Map"),i.current.UserData.GetDataSet().then(function(n){t(n)}))});var t=function(t){var u,f,e;i.current.UserData.ValidateAxis("Map");u=[];_.forEach(i.current.UserData.Collections[i.current.UserData.LegendDimension].Legend3,function(n,t){var r={},e="map"+(+t+1),f;r.Key=n.Key;r.Indeling=i.current.UserData.Collections[i.current.UserData.XAxisDimension].Indeling;r.Gemeente=i.current.UserData.Collections[i.current.UserData.XAxisDimension].Gemeente;r.Year=i.current.MetaData.CollectionsData[i.current.UserData.XAxisDimension].MapYear;i.current.UserData.LegendDimension==="Topics"?(f=i.current.MetaData.Topics[n.Key].PresentationType==="Absolute",r.dotsmap=f):(f=i.current.MetaData.Topics[i.current.UserData.Collections.Topics.Single[0].Key].PresentationType==="Absolute",r.dotsmap=f);e+=f?" Absolute":" Relative";r.CssClass=e;i.current.UserData.LegendDimension===i.current.MetaData.TimeDimension&&(r.CssClass+=" TimeInLegend");r.Year===undefined&&(r.Year=i.current.UserData.LegendDimension===i.current.MetaData.TimeDimension?n.Key.slice(0,4):i.current.UserData.Collections[i.current.MetaData.TimeDimension].Single[0].Key.slice(0,4));u.push(r)});n.MapLayers=u;f=i.current.UserData.Collections.Topics;e=r.Reshape(i.current.UserData.XAxisDimension,i.current.UserData.LegendDimension,i.current.UserData.LegendDimension==="Topics"?f.Multiple:f.Single,t);n.dataset=e};i.current.UserData.ValidateAxis("Map");i.current.UserData.GetDataSet().then(function(n){t(n)})}}}])}(),function(){angular.module("CbsDirectives").directive("mapd3",["$injector","$stateParams","$filter","tableState","$translate",function(n,t,i,r,u){return{restrict:"AE",replace:!0,transclude:!1,scope:{year:"@",mapindex:"@",datakey:"@",dotsmap:"@",indeling:"@",gemeente:"@",cssclass:"@",dataset:"="},template:'<div><svg class="{{ cssclass }}"><\/svg>',controller:["$scope",function(t){var i=function(){t.geoRepository=settings.hasInternetAccess||settings.use_pdok?n.get("pdokRepository"):n.get("geoRepository")};i()}],link:function(n,f){var e=314,o=400,y=function(){var i=n.geoRepository.GetCbsMap,r=n.geoRepository.GetCbsMapWijkenBuurten,t;n.dotsmap==="true"&&(i=n.geoRepository.GetCbsMapWithLabelpoints,r=n.geoRepository.GetCbsMapWijkenBuurtenWithLabelpoints);t=i;switch(n.indeling){case"BU":case"WK":t=r}t(n.indeling,n.year,n.gemeente).then(function(t){var i=_.map(n.dataset,function(t){return _.map(_.values(_.pick(t,n.datakey)),h)}),r=_.every(_.flatten(i),function(n){return _.isNull(n)});r?tt(n):it(t[0],t[1])},function(t){nt(t,n.indeling,n.year)})},s=0,l=function(n,t){var u=r.current.MetaData.HasGeoDetail?r.current.MetaData.GeoDetail:r.current.MetaData.GeoDimension,f=r.current.MetaData.Dimensions[u].Categories[n.Key].Title,e=i("cbsnumber")(n.Value);s++;t.attr("svglookup","svg"+s);d3.select('[svglookup="svg'+s+'"] svg path[regiolookup="'+n.Key+'"]').append("title").text(f+": "+e)},p=function(n){return $.isNumeric(n)?r.current.MetaData.TopicGroups[n]:null},a=function(n){var t=n,i=[];if(t.ParentId===undefined)return i;for(i=[t.Title];t.ParentId!==null;)t=p(t.ParentId),i.unshift(t.Title);return i},w=function(n,t,i){var u=a(t),r;if(u!==undefined&&u.length>0)for(r=0;r<u.length;r++)r==0?n.text(u[0]):n.append("tspan").text(u[r]).attr("x",r*8+8+i).attr("dy",16);else n.text(t.Title);return n},b=function(n,t,i,r,f,e,o){var ut=d3.select(n).insert("g",":first-child"),g,c=16,st,d,ft,et,nt,s,l,h,p,ct,it,v,lt,at;g=ut.append("g").attr("id","selectie");var y=[],ot=0,b=null,vt=f?t.UserData.LegendDimension==="Topics"?t.UserData.Collections.Topics.Legend3[e].Key:t.UserData.Collections.Topics.Single[0].Key:t.UserData.Collections.Topics.Single[0].Key,yt=t.MetaData.CollectionsData.Topics.Categories[vt],tt,k=[];for(s in t.MetaData.CollectionsData)if(st=t.UserData.LegendDimension,tdKey=t.UserData.XAxisDimension,f){var l=t.MetaData.CollectionsData[s],ht=t.UserData.LegendDimension,wt=t.MetaData.CollectionsData[ht];o?s===ht&&(s==="Topics"?b=t.MetaData.CollectionsData.Topics:y.unshift(s)):l.Type!=="GeoDimension"&&(s==="Topics"?b=t.MetaData.CollectionsData.Topics:y.unshift(s))}else s!==st&&s!==tdKey&&(s==="Topics"?b=t.MetaData.CollectionsData.Topics:y.unshift(s));d=0;b!==null&&(et=_.max(_.map(t.UserData.Collections.Topics.Legend3,function(n){var i=t.MetaData.CollectionsData.Topics.Categories[n.Key];return a(i).length})),ft=!o||et<=1,tt=g.append("text").attr("y",ft?r:c),tt.append("tspan").attr("class","topicsTitle").attr("x",0).attr("dy",c).attr("font-weight","bold").text(ft?b.Title+": ":""),ot=tt[0][0].getBBox().width,d=et*c);nt=0;for(v in y)s=y[v],l=t.MetaData.Dimensions[s],l.Type==="GeoDetail"?(nt=1,h=g.append("text").attr("y",r+d+ +v*c),h.append("tspan").attr("class","dimensionTitle").attr("x",0).attr("dy",c).text(u.instant("geoCategories.GM")+": "),k.push(h),h=g.append("text").attr("y",r+d+(+v+nt)*c),h.append("tspan").attr("class","dimensionTitle").attr("x",0).attr("dy",c).text(u.instant("dictionary.Regioindeling aanpassen")+": "),k.push(h)):(h=g.append("text").attr("y",r+d+(+v+nt)*c),h.append("tspan").attr("class","dimensionTitle").attr("x",0).attr("dy",c).text(l.Title+": "),k.push(h));p=Math.max(ot,d3.max(k,function(n){return n[0][0].getBBox().width})||0)+10;b!==null&&(ct=tt.append("tspan").attr("x",p),w(ct,yt,p));it=0;for(v in y){var s=y[v],l=t.UserData.Collections[s],pt=t.UserData.LegendDimension===s?[l.Legend3[e]]:l.Single,rt=pt.map(function(n){var i=t.MetaData.CollectionsData[s].Categories[n.Key],r=i.Title;return i.Status==="Voorlopig"&&(r+="*"),r}),h=k[+v+it];t.MetaData.Dimensions[s].Type==="GeoDetail"?(lt=t.MetaData.Dimensions[t.MetaData.GeoDetail].Gemeenten,at=lt[l.Gemeente].Title,h.append("tspan").attr("x",p).text(at),it=1,h=k[+v+it],h.append("tspan").attr("x",p).text(u.instant("geoCategories."+l.Indeling))):f?h.append("tspan").attr("x",p).text(rt.length>1?rt[e]:rt[0]):h.append("tspan").attr("x",p).text(rt.join(", "))}return ut.estimatedHeight=r+d+(+y.length+nt)*c,ut},k=function(n,t,i){if(settings.show_cbs_logo){var u=n.append("g").attr("id","CbsLogo"),r=u.append("g");r.attr("transform","translate("+t+", "+i+") scale(0.7)");r.append("g").attr("id","c").append("path").attr("id","c_path").attr("d","m12.82,6.95l-11.29,0c-0.85,0,-1.53,0.68,-1.53,1.53l0,12.44l12.82,0l0,-5.78l-7.04,0l0,-2.41l7.04,0L12.82,6.946248531341553Zm-1.69,1.68l0,2.41l-5.36,0l-1.68,0l0,1.69l0,2.41l0,1.68l1.68,0l5.36,0l0,2.42l-9.45,0l0,-10.61l9.45,0");r.append("path").attr("id","b_path").attr("d","m20.78,12.72l2.42,0l0,2.41l-2.42,0l0,-2.41Zm-1.53,-12.72l-4.24,0l0,20.92l13.99,0l0,-12.44c0,-0.85,-0.68,-1.53,-1.53,-1.53l-6.68,0l0,-5.34c0,-0.85,-0.68,-1.61,-1.53,-1.61m-0.16,16.81l1.68,0l2.42,0l1.68,0l0,-1.68l0,-2.41l0,-1.69l-1.68,0l-2.42,0l-1.68,0l0,1.69l0,2.41l0,1.68m0.01,-15.13l0,5.26l0,1.68l1.68,0l6.53,0l0,10.6l-10.62,0l0,-17.55l2.41,0");r.append("g").attr("id","s").append("path").attr("id","s_path").attr("d","m28.98,23.1l-28.98,0l0,13.74l23.21,0l0,2.18l-23.21,0l0,4.25c0,0.85,0.69,1.53,1.53,1.53l25.92,0c0.84,0,1.53,-0.69,1.53,-1.53l0,-12.22l-23.2,0l0,-2.14L28.98,28.911117553710938L28.98,23.097368240356445Zm-1.68,1.68l0,2.44l-21.5,0l-1.68,0l0,1.68l0,2.14l0,1.68l1.68,0l21.51,0l0,10.38l-25.62,0l0,-2.42l21.53,0l1.69,0l0,-1.68l0,-2.18l0,-1.68l-1.68,0l-21.53,-0.01l0,-10.37l25.61,0")}},d=function(n,r,u,f,e,o){var w=r.UserData.LegendDimension,b=r.MetaData.CollectionsData[w],nt=r.UserData.Collections[r.UserData.LegendDimension].Legend3,l=b.Categories[f],a=r.MetaData.Topics[r.UserData.Collections.Topics.Single[0].Key],s=l.Decimals||a.Decimals,h=l.Unit||a.Unit,v=20,y=u,k=r.UserData.LegendDimension===r.MetaData.TimeDimension,d=k?"maplegend TimeInLegend":"maplegend",c=d3.select(n).append("g").attr("class",d),p=t._la,g=function(n){return n.to!==o?p=="en"?i("cbsnumber")(n.from,s)+" to "+i("cbsnumber")(n.to,s)+" ("+h+")":i("cbsnumber")(n.from,s)+" tot "+i("cbsnumber")(n.to,s)+" ("+h+")":p=="en"?"more than "+i("cbsnumber")(n.from,s)+" ("+h+")":"meer dan "+i("cbsnumber")(n.from,s)+" ("+h+")"};return c.selectAll("*").remove(),_.forEach(e,function(n,t){c.append("rect").attr("x",0).attr("y",t*v+y-10).attr("width",30).attr("height",10);c.append("text").attr("x",40).attr("y",t*v+y).text(g(n))}),c},h=function(n){switch(n){case"-":return 0}return isNaN(parseFloat(n))?null:parseFloat(n)},g=function(){var i,s,a,e,y,u,p,o,w,t,v;n.dataset!==undefined&&(i=r.current.MetaData.GeoDimension,r.current.MetaData.HasGeoDetail&&(i=r.current.MetaData.GeoDetail),s={},a=[],_.isUndefined(r.current.MetaData.Dimensions[i])||_.isNull(r.current.MetaData.Dimensions[i])||_.forEach(n.dataset,function(t){var u=r.current.MetaData.Dimensions[i].Categories[t[i]],f=_.isUndefined(u.Indeling)?u.Key.substring(0,2):u.Indeling;_.toLower(f)===_.toLower(n.indeling)&&(s[t[i]]={Key:t[i],Value:t[n.datakey]},a.push(t))}),e=5,y=r.current.UserData.LegendDimension===r.current.MetaData.TimeDimension,y?(p=_.map(r.current.UserData.Collections[r.current.MetaData.TimeDimension].Legend3,function(n){return n.Key}),o=_.map(a,function(n){return _.map(_.values(_.pick(n,p)),h)}),u=d3.extent(_.flatten(o))):(o=_.map(a,function(t){return _.map(_.pick(t,n.datakey),h)}),u=d3.extent(_.flatten(o))),w=Math.sqrt(u[1]),t={},f.find("svg g.circles").length===0?(t=d3.scale.quantize().domain([u[0],u[1]]).range(d3.range(e).map(function(n){return"c"+(n+1)})),d3.select(f.find("svg g.paths")[0]).selectAll("path").each(function(){var n=s[d3.select(this).attr("RegioS")];n!==undefined&&(l(n,f),d3.select(this).attr("data-value",n.Value).attr("class",function(){return t(n.Value)}))}),v=d3.range(e).map(function(n){var i=t.invertExtent("c"+(n+1));return{from:i[0],to:i[1]}})):(t=d3.scale.sqrt().domain([u[0],u[1]]).range([1,e]),d3.select(f.find("svg g.circles")[0]).selectAll("circle").each(function(){var n=s[d3.select(this).attr("RegioS")];n!==undefined&&(l(n,f),d3.select(this).attr("data-value",n.Value).attr("class",function(){return"c"+parseInt(t(n.Value),10)}).attr("r",function(){return t(n.Value)*1.2}))}),v=d3.range(e).map(function(n){return{from:t.invert(n+1),to:t.invert(n+2)}})),c(v,e))},c=function(t,i){var u=d3.select(f.find("svg")[0]),c=parseInt(u.node().getBoundingClientRect().height,10),o=0,l=b(u.node(),r.current,o,0,!0,+n.mapindex,!ResponsiveBootstrapToolkit.is("xs")),e=+l.estimatedHeight,s,h;u.selectAll("g.nomap").attr("transform","translate("+o+", "+e+")");u.selectAll("g.paths").attr("transform","translate("+o+", "+e+")");u.selectAll("g.circles").attr("transform","translate("+o+", "+e+")");t&&(s=d(u.node(),r.current,+c+e,n.datakey,t,t[i-1].to),h=s.node().getBBox().height,k(s,0,+u.attr("height")+h+e),h=s.node().getBBox().height,u.attr("height",+u.attr("height")+h+e))},v=function(n,t){n.each(function(){for(var i=d3.select(this),o=i.text().split(/\s+/).reverse(),r,n=[],s=0,f=i.attr("y"),e=0,u=i.text(null).append("tspan").attr("x","50%").attr("y",f).attr("dy",e+"em");r=o.pop();)n.push(r),u.text(n.join(" ")),u.node().getComputedTextLength()>t&&(n.pop(),u.text(n.join(" ")),n=[r],u=i.append("tspan").attr("x","50%").attr("y",f).attr("dy",++s*1.1+e+"em").text(r))})},nt=function(n,t,i){var r=u.instant("dictionary.GeenKaartBeschikbaar").replace("{indelingenCode}",u.instant("geoCategories."+(n.indelingenCode||t))).replace("{year}",n.year||i),s=d3.select(f.find("svg")[0]).attr("width",e).attr("height",o).append("g").attr("class","nomap").append("text").attr("text-anchor","middle").attr("x",+e/2).attr("y",+o/2).text(r).call(v,e/2);c()},tt=function(){var n=u.instant("dictionary.GeenDataBeschikbaar"),t=d3.select(f.find("svg")[0]).attr("width",e).attr("height",o).append("g").attr("class","nomap").append("text").attr("text-anchor","middle").attr("x",+e/2).attr("y",+o/2).text(n).call(v,e/2);c()},it=function(t,i){function rt(){var n={},t=r.current.MetaData.GeoDimension;return r.current.MetaData.HasGeoDetail&&(t=r.current.MetaData.GeoDetail),_.forEach(r.current.MetaData.CollectionsData[t].Categories,function(t){n[t.Key.trim()]={Key:t.Key}}),n}function b(t){var i=p[t],u,f,e,o;if(i===undefined&&(t.indexOf("BU")===0||t.indexOf("WK")===0))for(u=0;i===undefined&&u<=99;)f=(n.year-u).toString(),e=f.substring(f.length-2),i=p[t.replace("BU",e).replace("WK",e)],i===undefined&&u++;return i!==undefined?(o=r.current.MetaData.GeoDimension,r.current.MetaData.HasGeoDetail&&(o=r.current.MetaData.GeoDetail),r.current.MetaData.CollectionsData[o].Categories[i.Key]):undefined}function a(n){var i=n.properties.STATCODE,t;return(settings.hasInternetAccess&&(i=n.properties.statcode),t=b(i),t!==undefined)?t.Key:""}function ut(n){var i=n.properties.STATCODE,t;return(settings.hasInternetAccess&&(i=n.properties.statcode),t=b(i),t!==undefined)?t.Title:""}var s=d3.geo.mercator(),l;s.scale(1).translate([0,0]);var v=d3.geo.path().projection(s),u=v.bounds(t),k=u[1][0]-u[0][0],d=u[1][1]-u[0][1],nt=(u[0][0]+u[1][0])/2,tt=(u[0][1]+u[1][1])/2,c=.85/Math.max(k/e,d/o),it=[e/2-c*nt,o/2-c*tt],h=d3.geo.bounds(t),ft=[(h[1][0]+h[0][0])/2,(h[1][1]+h[0][1])/2],et=[e/2,o/2];s=s.scale(c).translate(it);var y=d3.select(f.find("svg")[0]).attr("width",e).attr("height",o),p=rt(),w=y.append("svg:g").attr("class","paths");w.selectAll("path").remove();w.selectAll("path").data(t.features).enter().append("svg:path").attr("RegioS",function(n){return a(n)}).attr("RegioSNaam",function(n){return ut(n)}).attr("d",v).attr("regiolookup",function(n){return a(n)});i!==undefined&&(l=y.append("svg:g").attr("class","circles"),l.selectAll("circle").remove(),l.selectAll("circle").data(i.features).enter().append("svg:circle").attr("RegioS",function(n){return a(n)}).attr("cx",function(n){return s([n.geometry.coordinates[0],n.geometry.coordinates[1]])[0]}).attr("cy",function(n){return s([n.geometry.coordinates[0],n.geometry.coordinates[1]])[1]}).attr("r",0));g()};$(window).on("resize",function(){});y()}}}])}(),function(){angular.module("CbsDirectives").directive("sidebar",["$filter","$rootScope","$state","$sce","$translate","tableState",function(n,t,i,r,u,f){return{restrict:"AE",replace:!1,transclude:!1,scope:!0,templateUrl:"./app/components/sidebarDirective/sidebar.html",controller:"SidebarController",link:function(n){n.$on("doRefresh",function(){return t()});var t=function(){n.IsLegendDimension=o;n.GetDimensionTitle=s;n.LegendDimension=f.current.UserData.LegendDimension;n.GraphType=f.current.UserData.GraphType;n.Collections=h();n.AllowInstellingenYaxisSwap=f.current.UserData.AllowInstellingenYaxisSwap;n.AllowYaxisXaxisSwap=f.current.UserData.AllowYaxisXaxisSwap;n.LegendType=f.current.UserData.GetLegendType();n.LegendSelections=c();n.LegendCategories=l();n.GetCategories=i;n.IsTimeInLegend=f.current.UserData.LegendDimension===f.current.MetaData.TimeDimension;e(u())},r=function(){var n=d3.select("div[name=footer]").node();return _.isNull(n)?0:n.getBoundingClientRect().height},u=function(){if($(".sidebar").length===0)return 0;var n=$(window).height()-$(".sidebar").offset().top-r()-24;return Math.max(n,495)},e=function(n){$(".sidebar").css({"min-height":n+"px"})},o=function(n){return n===f.current.UserData.LegendDimension},s=function(n){if(!_.isUndefined(n)&&!_.isEmpty(n))return f.current.MetaData.CollectionsData[n].Title},h=function(){return _.reject(f.current.MetaData.Collections,function(n){return n===f.current.UserData.XAxisDimension})},c=function(){if(f.current.UserData.LegendDimension==="")return[];var n=f.current.UserData.Collections[f.current.UserData.LegendDimension];return n[f.current.UserData.GetLegendType()]},l=function(){return i(f.current.UserData.LegendDimension)},i=function(n){if(n==="")return[];var t=[];switch(n){case f.current.MetaData.GeoDetail:break;default:_.forEach(f.current.MetaData.CollectionsData[n].Categories,function(n){t.push(n)})}return t};$(".list-group").on("shown.bs.dropdown",function(n){var u=$(n.target).find("div.tree"),r=u.closest("div.tree-container"),t=r.find("li span.fancytree-selected:first"),f=t.closest("ul.select"),e=f.length>0,i;t.length>0&&(i=Math.max(t.offsetParent().position().top,t.position().top),e&&(i=t.position().top),r.scrollTop(i))});t()}}}])}(),function(){"use strict";angular.module("CbsApp").controller("SidebarController",["$scope","$rootScope","$sce","$translate","treeHelper","tableState",function(n,t,i,r,u,f){var o,h,e=null;n.dropdownClick=function(n){var t=$(n.target);(t.hasClass("form-inline")||t.hasClass("panel-title")||t.hasClass("container list-group-item")||t.hasClass("list-group-wrapper")||t.hasClass("selection-errormessage")||t.hasClass("dropdown-menu")||t.hasClass("tree-container"))&&(event.preventDefault(),n.stopPropagation())};n.filterTree=function(n,t){var s=$(n.target),i,r,f,e;s[0].id==="treeFilterTextLegend"?i="#treeFilterTextLegend":(i=".treefiltertext-",t&&(i+=t.toLowerCase()));r=$(i)[0].value.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");r.length>=2?(f=new RegExp(u.AddDiacritics(r),"ig"),e="<mark>$&<\/mark>",o.filterNodes(function(n){return n.titleWithHighlight=n.title.replace(f,e),f.test(n.title)},{autoExpand:k()})):o.clearFilter()};var k=function(){return o.count()<n.maxItemsFilterExpand},d=function(){n.selectedNodesAreInvalid=!1;n.selectedUnitsAreInvalid=!1;n.layoutCategoryOrTopic=st;n.ToggleSwitchClick=ct;n.showSingleSelectTreeview=nt;n.showMultiSelectTreeview=tt;n.closeMultiSelectTreeviewAndApply=ot;n.SelectSingleCategorieItem=lt;n.SelectLegendCategorieItem=at;n.KeyIsSelected=vt;n.GetTopicGroupsByParent=pt;n.GetTopicsByParent=yt;n.maxItemsFilterExpand=settings.max_items_filter_expand},c=function(n){var t=[],i=n.getSelectedNodes();return $.map(i,function(n){var i=n.data.topic;i&&t.push(n)}),t},g=function(n){var t=[];return _.forEach(n,function(n){var i=n.data.topic.Unit;t.push(i)}),_.uniq(t)},l=function(n){var t=[],i=n.getSelectedNodes();return $.map(i,function(n){var i=n.data.category;i&&t.push(n)}),t},s=function(n){var t=n.getSelectedNodes(!0);$.map(t,function(n){n.fixSelection3FromEndNodes()})},nt=function(n,t){var r=".treefiltertext-",i;t&&(r+=t.toLowerCase());$(r)[0].value="";i=$(n.target).closest(".list-group-item-single").find("div.tree-container");t===f.current.MetaData.GeoDimension?rt(i,t):it(i,t)},tt=function(t){var r,i;n.selectionErrorMessage="";n.unitErrorMessage="";n.selectedNodesAreInvalid=!1;n.selectedUnitsAreInvalid=!1;$("#treeFilterTextLegend")[0].value="";r=$(t.target).closest(".list-group-item-legend").find("div.tree-container");f.current.UserData.LegendDimension===f.current.MetaData.GeoDimension?(i=f.current.UserData.LegendDimension,et(r,i)):f.current.UserData.LegendDimension==="Topics"?ut(r):(i=f.current.UserData.LegendDimension,ft(r,i))},it=function(n,t){n.empty();n.off("click","ul li");var s=t==="Topics"?r.instant("dictionary.Onderwerp"):f.current.MetaData.CollectionsData[t].Title,e=[],o={id:0,root:!0,title:s,folder:!0,unselectable:!1,expanded:!0},i;i=t==="Topics"?u.BuildTopicsTree(null,!1,!1,!0):t===f.current.MetaData.TimeDimension?u.BuildTimeTree(f.current.MetaData.CollectionsData[t]):t===f.current.MetaData.GeoDetail?u.BuildGeoDetailTree(f.current.MetaData.CollectionsData[t]):u.BuildDimensionTree(t,null);o.children=i;e.push(o);i=e;a(n,i,t)},rt=function(n,t){n.empty();n.off("click","ul li");var s=t==="Topics"?r.instant("dictionary.Onderwerp"):f.current.MetaData.CollectionsData[t].Title,i=[],e={id:0,root:!0,title:s,folder:!0,unselectable:!1,expanded:!0},o;return u.BuildGeoDimensionTree(f.current.MetaData.CollectionsData[t],f.current.MetaData.GeoDimensionGroups).then(function(r){e.children=r;i.push(e);o=i;a(n,o,t)})},a=function(n,t,i){var r=$("<div>"),e,u;r.addClass("tree singleselect "+i);r.fancytree({extensions:["filter","glyph"],checkbox:!1,icons:!1,selectMode:1,autoScroll:!0,scrollParent:n,toggleEffect:{effect:"drop",options:{direction:"left"},duration:400},filter:{counter:!1,mode:"hide"},renderTitle:function(n,t){var i=t.node.data.topic;i&&(t.node.title=i.Title,i.Datatype==="String"&&(t.node.title='<span class="grayedout">'+i.Title+"<\/span>"))},renderNode:function(n,t){t.node.li.firstChild.className.indexOf("fancytree-hide")!==-1&&$(t.node.li).addClass("fancytree-hide")},click:function(n,t){n.preventDefault();n.stopPropagation();var r=t.node;t.node.folder?r.toggleExpanded():(h=i==="Topics"?r.data.topic:r.data.category,r.selected||(r.toggleSelected(),$(r.li).addClass("selected")))},glyph:{map:{doc:"fa fa-file-o",docOpen:"fa fa-file-o",checkbox:"fa fa-square-o",checkboxSelected:"fa fa-check-square-o",checkboxUnknown:"fa fa-square",error:"fa fa-warning",expanderClosed:"fa fa-chevron-down",expanderLazy:"fa fa-angle-right",expanderOpen:"fa fa-chevron-up",folder:"fa fa-folder-o",folderOpen:"fa fa-folder-open-o",loading:"fa fa-spinner fa-pulse"}},source:t});t=r.fancytree("getTree");o=t;e=f.current.UserData.Collections[i].Single;u=r.fancytree("getTree").getNodeByKey(e[0].Key);u.setSelected();u.makeVisible();$(u.li).addClass("selected");r.appendTo(n)},ut=function(t){var c,h,l;t.empty();t.off("click","ul li");var y=r.instant("dictionary.Onderwerp"),i=u.BuildTopicsTree(null,!1,!1,!0),a=[],v={id:0,root:!0,title:y,folder:!0,unselectable:!1,expanded:!0};v.children=i;a.push(v);i=a;c=8;f.current.UserData.GraphType==="Map"&&(c=3);h=$("<div>");h.addClass("tree multiselect");h.fancytree({extensions:["filter","glyph"],checkbox:!0,icons:!1,selectMode:3,autoScroll:!0,scrollParent:t,toggleEffect:{effect:"drop",options:{direction:"left"},duration:400},renderTitle:function(n,t){var i=t.node.data.topic;i&&(t.node.title=i.Title+'<span class="unit">'+i.Unit+"<\/span>",i.Datatype==="String"&&(t.node.title='<span class="grayedout">'+i.Title+'<\/span><span class="unit">'+i.Unit+"<\/span>"))},renderNode:function(n,t){t.node.li.firstChild.className.indexOf("fancytree-hide")!==-1&&$(t.node.li).addClass("fancytree-hide")},filter:{counter:!1,mode:"hide"},click:function(n,t){var i;if(b(),i=t.node,n.preventDefault(),n.stopPropagation(),i.folder&&t.targetType!=="checkbox")i.toggleExpanded();else if(i.unselectable)i.toggleExpanded();else if(n.shiftKey){if(e===null||e.getParent()!==i.getParent())return e=i,!1;if(e!==i){for(var r=e,u=[],f=r.getIndex()>i.getIndex(),o=!i.isSelected();r!==null&&r!==i;)(r.match||!t.tree.enableFilter)&&u.push(r),r=f?r.getPrevSibling():r.getNextSibling();_.forEach(u,function(n){n.isSelected()!==o&&n.toggleSelected()})}e=null;p(i,t,c)}else e=i,p(i,t,c),n.preventDefault(),n.stopPropagation()},glyph:{map:{doc:"fa fa-file-o",docOpen:"fa fa-file-o",checkbox:"fa fa-square-o",checkboxSelected:"fa fa-check-square-o",checkboxUnknown:"fa fa-square",error:"fa fa-warning",expanderClosed:"fa fa-chevron-down",expanderLazy:"fa fa-angle-right",expanderOpen:"fa fa-chevron-up",folder:"fa fa-folder-o",folderOpen:"fa fa-folder-open-o",loading:"fa fa-spinner fa-pulse"}},source:i});l=n.LegendSelections;i=h.fancytree("getTree");o=i;_.forEach(l,function(n,t){var r=i.getNodeByKey(l[t].Key);r.setSelected();$(r.li).addClass("selected")});s(i);n.selectedNodesAreInvalid=!1;n.selectedUnitsAreInvalid=!1;h.appendTo(t)},ft=function(n,t){var o,i,r,e;n.empty();n.off("click","ul li");o=f.current.MetaData.CollectionsData[f.current.UserData.LegendDimension].Title;i=t===f.current.MetaData.TimeDimension?u.BuildTimeTree(f.current.MetaData.CollectionsData[t]):t===f.current.MetaData.GeoDetail?u.BuildGeoDetailTree(f.current.MetaData.CollectionsData[t]):u.BuildDimensionTree(t,null);r=[];e={id:0,root:!0,title:o,folder:!0,unselectable:!1,expanded:!0};e.children=i;r.push(e);i=r;v(n,i)},et=function(n,t){n.empty();n.off("click","ul li");var r=f.current.MetaData.CollectionsData[f.current.UserData.LegendDimension].Title,i;return u.BuildGeoDimensionTree(f.current.MetaData.CollectionsData[t],f.current.MetaData.GeoDimensionGroups).then(function(t){var u=[],f={id:0,root:!0,title:r,folder:!0,unselectable:!1,expanded:!0};f.children=t;u.push(f);i=u;v(n,i)})},v=function(t,i){var u=8,r,h;f.current.UserData.GraphType==="Map"&&(u=3);r=$("<div>");r.addClass("tree multiselect dimension");r.fancytree({extensions:["filter","glyph"],checkbox:!0,icons:!1,selectMode:3,autoScroll:!0,scrollParent:t,toggleEffect:{effect:"drop",options:{direction:"left"},duration:400},filter:{counter:!1,mode:"hide"},renderNode:function(n,t){t.node.li.firstChild.className.indexOf("fancytree-hide")!==-1&&$(t.node.li).addClass("fancytree-hide")},click:function(n,t){var i;if(b(),i=t.node,n.preventDefault(),n.stopPropagation(),t.node.folder&&t.targetType!=="checkbox")i.toggleExpanded(),n.preventDefault(),n.stopPropagation();else if(n.shiftKey){if(e===null||e.getParent()!==i.getParent())return e=i,!1;if(e!==i){for(var r=e,f=[],o=r.getIndex()>i.getIndex(),s=!i.isSelected();r!==null&&r!==i;)(r.match||!t.tree.enableFilter)&&f.push(r),r=o?r.getPrevSibling():r.getNextSibling();_.forEach(f,function(n){n.isSelected()!==s&&n.toggleSelected()})}e=null;w(i,t,u)}else e=i,w(i,t,u)},glyph:{map:{doc:"fa fa-file-o",docOpen:"fa fa-file-o",checkbox:"fa fa-square-o",checkboxSelected:"fa fa-check-square-o",checkboxUnknown:"fa fa-square",error:"fa fa-warning",expanderClosed:"fa fa-chevron-down",expanderLazy:"fa fa-angle-right",expanderOpen:"fa fa-chevron-up",folder:"fa fa-folder-o",folderOpen:"fa fa-folder-open-o",loading:"fa fa-spinner fa-pulse"}},source:i});h=n.LegendSelections;i=r.fancytree("getTree");o=i;_.forEach(h,function(n,t){var r=i.getNodeByKey(h[t].Key);r.setSelected();r.makeVisible();$(r.li).addClass("selected")});s(i);n.selectedNodesAreInvalid=!1;r.appendTo(t)},ot=function(i){var s=$(i.target).closest(".dropdown-menu").find("div.tree"),e=s.fancytree("getTree"),o=n.LegendSelections.map(function(n){return n.Key}),r=[],u;if(n.selectedNodesAreInvalid||n.selectedUnitsAreInvalid)return i.stopPropagation(),i.preventDefault(),!1;u=f.current.UserData.LegendDimension==="Topics"?c(e).map(function(n){return n.data.topic.Key}):l(e).map(function(n){return n.data.category.Key});_.forEach(u,function(n){$.inArray(n,o)===-1&&r.push(n)});_.forEach(o,function(n){$.inArray(n,u)===-1&&r.push(n)});f.current.UserData.ToggleCategoriesItems(r,f.current.UserData.LegendDimension,f.current.UserData.GetLegendType());t.$broadcast("doRefresh",f.current.UserData)},st=function(n,t){var r,t,u,e;try{t=t||f.current.UserData.Collections[n].Single[0].Key;u=f.current.MetaData.CollectionsData[n].Categories[t];n==="Topics"?r=y(u,'<div class="topicgroup">'+u.Title+"<\/div>"):(r=u.Title,e=u.Status,e&&("Voorlopig"===e&&(r+="*"),"NaderVoorlopig"===e&&(r+="**")))}catch(o){return i.trustAsHtml("")}return i.trustAsHtml(r)},y=function y(n,t){if(n.ParentId!==null){var i=ht(n.ParentId);return y(i,'<div class="topicgroup">'+i.Title+t+"<\/div>")}return t},ht=function(n){return $.isNumeric(n)?f.current.MetaData.TopicGroups[n]:null},ct=function(){f.current.UserDataLegendDimension=n.Collections[n.Collections.length-1];t.$broadcast("doRefresh",f.current.UserData)},lt=function(n){h&&(f.current.UserData.ToggleCategoriesItems([h.Key],n,"Single"),t.$broadcast("doRefresh",f.current.UserData))},at=function(n,i){f.current.UserData.ToggleCategoriesItems([n],f.current.UserData.LegendDimension,f.current.UserData.GetLegendType());t.$broadcast("doRefresh",f.current.UserData);i.stopPropagation()},vt=function(n,t){var r="Single",i;return t===f.current.UserData.LegendDimension&&(r=f.current.UserData.GetLegendType()),i=!1,_.forEach(f.current.UserData.Collections[t][r],function(t){t.Key===n&&(i=!0)}),i},yt=function(n){var t=[];return _.forEach(f.current.MetaData.Topics,function(i){i.ParentId===n&&t.push(i)}),t},pt=function(n){var t=[];return _.forEach(f.current.MetaData.TopicGroups,function(i){i.ParentId===n&&t.push(i)}),t},p=function(t,i,r){t.selected?$(t.li).removeClass("selected"):$(t.li).addClass("selected");t.toggleSelected();s(i.tree);wt(i.tree,r);n.$apply()},wt=function(t,i){var f=c(t),u=f.length,e;u<1?(n.selectedNodesAreInvalid=!0,n.selectionErrorMessage=r.instant("dictionary.SelectieTeKlein")+i+r.instant("dictionary.OnderwerpHAAKenHAAK")):u<=i?(n.selectionErrorMessage="",n.selectedNodesAreInvalid=!1):(n.selectionErrorMessage=r.instant("dictionary.SelectieTeGroot")+u+r.instant("dictionary.Van")+i+r.instant("dictionary.OnderwerpHAAKenHAAK"),n.selectedNodesAreInvalid=!0);e=g(f);e.length>1?(n.unitErrorMessage=r.instant("dictionary.OnderwerpenVerschillendeEenheid"),n.selectedUnitsAreInvalid=!0):(n.unitErrorMessage="",n.selectedUnitsAreInvalid=!1)},w=function(t,i,r){t.selected?$(t.li).removeClass("selected"):$(t.li).addClass("selected");t.toggleSelected();s(i.tree);bt(i.tree,r);n.$apply()},bt=function(t,i){var u=l(t).length;u<1?(n.selectedNodesAreInvalid=!0,n.selectionErrorMessage=r.instant("dictionary.SelectieTeKlein")+i+r.instant("dictionary.Items"),n.$apply()):u<=i?(n.selectionErrorMessage="",n.selectedNodesAreInvalid=!1,n.$apply()):(n.selectionErrorMessage=r.instant("dictionary.SelectieTeGroot")+u+r.instant("dictionary.Van")+i+r.instant("dictionary.Items"),n.selectedNodesAreInvalid=!0,n.$apply())},b=function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var n=window.getSelection();n.removeAllRanges()}};d()}])}(),function(){angular.module("CbsApp").controller("pivottableController",["$scope","$rootScope","$translate","$state","$stateParams","$filter","tableState","isStatFlowFrame","ModalService","$sce","tableInfoService","notificationPanelService",function(n,t,i,r,u,f,e,o,s,h,c,l){var v=[],y=function(r){n.self=this;n.showWarning=r||!1;_.isUndefined(t.IsInfoCollapsed)&&(t.IsInfoCollapsed=!1);n.infoText="";e.LoadTableFull(u.tableId,o).then(function(){return e.GetData().then(function(r){a(r);$("body").css("-ms-overflow-y","visible");n.bronvermelding=!0;n.bron=e.current.MetaData.Source?e.current.MetaData.Source:"Politie";u.fromstatweb===undefined&&l.state.isNotificationPanelVisible===!1&&(n.infoText=i.instant("dictionary.InfoText"));n.self.lastGoodDataResponse=r;t.$broadcast("doRefresh",e.current.UserData)},p),!0},function(){})};n.CollapseInfo=function(){t.IsInfoCollapsed=!t.IsInfoCollapsed};n.IsCollapsed=function(){return t.IsInfoCollapsed||n.infoText.length==0};var w=function(i,r){var u=e.current.UserData;return u.RowDimensions=r.rows,u.KolomDimensions=r.cols,_.isEqual(u.TableDimensions,r.vals)?(a(n.self.lastGoodDataResponse),$("body").css("-ms-overflow-y","visible"),t.$broadcast("doRefresh",u)):(u.TableDimensions=r.vals,n.showWarning=!1,e.GetData().then(function(i){a(i);$("body").css("-ms-overflow-y","visible");n.self.lastGoodDataResponse=i;t.$broadcast("doRefresh",u)},p)),!0},p=function(i){i&&i.code&&i.code==="TeVeelVoorTabel"?(n.showWarning=!0,n.message=h.trustAsHtml(i.message),a(n.self.lastGoodDataResponse,"TeVeelVoorTabel"),t.$broadcast("updateDownloadLinks",e.current.UserData)):t.$broadcast("$customError",i)},b=function(n,t){var r=[],i={};return _.each(n,function(n){i[n]=null}),i[_.first(t.Collections.Topics.Single_Table).Key]=null,r.push(i),r},a=function(t,i){var r=e.current.UserData,u;v=$.map(e.current.MetaData.Dimensions,function(n,t){return t});_.isUndefined(t)&&_.isUndefined(n.self.lastGoodDataResponse)&&(t=b(v,r));u=melt(t,v,"Topics","value",!0);k(u,e,r.RowDimensions,r.KolomDimensions,$.merge(["value"],r.TableDimensions),i);nt(e);$("#pivotTableOutput").off("rendererAxisChanged");$("#pivotTableOutput").on("rendererAxisChanged",w)},k=function(n,t,i,r,u,e){var s=$.extend($.pivotUtilities.renderers,$.pivotUtilities.cbs_renderers(t,c()),$.pivotUtilities.export_renderers),o=function(i){var r,u=t.current.MetaData.CollectionsData.Topics.Categories,e=f("cbsnumber");_.forEach(n,function(n){r=jQuery.extend({},n);topic=u[n.Topics];topic!=undefined&&(r.value=topic.Datatype!=="String"?e(n.value,topic.Decimals):n.value);i(r)})};$("#pivotTableOutput").pivotUI(o,{rows:i,cols:r,vals:u,aggregators:{CbsAggregator:function(){return g}},rendererName:"CbsTableRenderer",rendererOptions:{tableState:t,tableInfoService:c(),errorCode:e},onRefresh:d},!0)},d=function(){var n=$("#pivotTableOutput").find(".pvtRendererArea").find(".pvtTable").detach();$("#pivotTableOutput").append(n);$("#pivotTableOutput").find(".pvtUi").remove();$("#pivotTableOutput").trigger("justifyVals");$("#pivotTableOutput").trigger("enableTooltips")},g=function(){return{count:0,text:"",push:function(n){this.count++;this.text=n.value},value:function(){return this.count===1?this.text:"error"},format:function(n){return n},numInputs:0}},nt=function(n){var r=n.current.MetaData.CollectionsData,u=$("#pivotTableOutput").find("span.pvtAttr").each(function(n,t){var i=t.firstChild.textContent;i==="value"?$(t).hide():$(t).text(r[i].Title)}),i,t;$("#pivotTableOutput").find(".pvtVals").hide();$("#pivotTableOutput").find(".pvtVals").children().hide();$("#pivotTableOutput").find(".pvtAttrDropdown").empty();$("#pivotTableOutput").find(".pvtAxisContainer").hide();i=function(n){n.allSelected=!n.allSelected;n.allSelected?n.clearSelectionError():n.getSelectionError(n.tree)};t=function(t,r){var u,e={type:r,key:t},f;u="TsTopicsController";"Topics"==t||(f=n.current.MetaData.Dimensions[t],u="TsDimensionController",f.Type==="GeoDimension"&&(u="TsGeoController"),f.Type==="GeoDetail"&&(u="TsGeoDetailController"),f.Type==="TimeDimension"&&(u="TsTimeController"));s.showModal({templateUrl:"./app/components/tableSelect/ts.html",controller:u,inputs:e}).then(function(r){var u=$("#ts_modal .modal-body .tree-body");r.element.modal();r.element.on("hidden.bs.modal",function(){r.element.remove()});r.scope.init(u,e).then(function(f){r.scope.hideSelectAll||(r.scope.allSelected=n.current.UserData.Collections[t].allSelected);r.scope.toggleSelectAll=function(){i(r.scope,e)};u.empty();u.append(f);var o=function(){$(".tree > ul").css("max-height",$(window).height()-150)};$(window).on("resize",null,o);o();r.close.then(function(i){i&&(n.current.UserData.Collections[t].allSelected=r.scope.allSelected,y())});r.closed.then(function(){$(document.body).removeClass("modal-open")});"ontouchend"in document||$(".modal-dialog").draggable({cursor:"move",handle:".modal-header, .modal-footer",cancel:"input, button"})})})};$("#pivotTableOutput").off("click",".pvtRendererAxisContainer.vals .pvtAttrEditHandle");$("#pivotTableOutput").on("click",".pvtRendererAxisContainer.vals .pvtAttrEditHandle",function(){t($(this).data("attrName"),"vals")});$("#pivotTableOutput").off("click",".pvtRendererAxisContainer.rows .pvtAttrEditHandle");$("#pivotTableOutput").on("click",".pvtRendererAxisContainer.rows .pvtAttrEditHandle",function(){t($(this).data("attrName"),"rows")});$("#pivotTableOutput").off("click",".pvtRendererAxisContainer.cols .pvtAttrEditHandle");$("#pivotTableOutput").on("click",".pvtRendererAxisContainer.cols .pvtAttrEditHandle",function(){t($(this).data("attrName"),"cols")})};y()}])}(),function(){"use strict";angular.module("CbsApp").controller("TsTopicsController",["$scope","$rootScope","$translate","$q","$sce","type","close","tableState","treeHelper",function(n,t,i,r,u,f,e,o,s){var c;n.init=function(t){var u=r.defer();return n.userdata=o.current.UserData,n.metadata=o.current.MetaData,n.singleSelection=f==="vals",n.title=i.instant("dictionary.Onderwerp"),n.hideSelectAll=n.singleSelection,n.hideApply=!1,n.Topics=p(),n.allSelected=n.Topics.allSelected||!1,n.allSelectedInitially=n.allSelected||!1,n.lastClickedNode=null,n.maxItems=settings.max_selectable_categories,n.maxItemsFilterExpand=settings.max_items_filter_expand,n.singleSelection?n.hideApply=!0:n.clearSelectionError(),u.resolve(n.fillTopicsTree(t)),u.promise};n.close=function(t){var i=n.singleSelection&&t,r,u;n.singleSelection&&t&&(r=n.userdata.Collections.Topics.Single_Table[0].Key,u=h(n.tree)[0].key,n.userdata.ToggleCategoriesItems([r,u],"Topics","Single_Table"));!n.singleSelection&&t&&(i=w(n.tree));e(i,500);n.singleSelection&&($("#ts_modal").modal("hide"),$("div.modal-backdrop").remove())};c=function(){return n.tree.count()<n.maxItemsFilterExpand};n.filterTree=function(){var i=$("#treeFilterText")[0].value.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),t,r;i.length>=2?(t=new RegExp(s.AddDiacritics(i),"ig"),r="<mark>$&<\/mark>",n.tree.filterNodes(function(n){return n.titleWithHighlight=n.title.replace(t,r),t.test(n.title)},{autoExpand:c()})):n.tree.clearFilter()};n.fillTopicsTree=function(t){var r,u,o,h;t.empty();t.off("click","ul li");r=[];u={id:0,root:!0,title:n.title,folder:!0,unselectable:!1,expanded:!0};u.children=s.BuildTopicsTree(null,!1,!1);r.push(u);var c=r,f=!0,e=3,i=$("<div>");return n.singleSelection?(f=!1,e=1,i.addClass("tree singleselect Topics")):i.addClass("tree multiselect"),i.fancytree({source:c,extensions:["filter","glyph"],checkbox:f,icons:!1,selectMode:e,autoScroll:!0,scrollParent:t,toggleEffect:{effect:"drop",options:{direction:"left"},duration:400},filter:{counter:!1,mode:"hide"},renderTitle:function(t,i){if(!n.singleSelection){var r=i.node.data.topic;r&&(i.node.title=r.Title+'<span class="unit">'+r.Unit+"<\/span>")}},renderNode:function(n,t){t.node.li.firstChild.className.indexOf("fancytree-hide")!==-1&&$(t.node.li).addClass("fancytree-hide")},click:function(t,r){var u;if(b(),t.preventDefault(),t.stopPropagation(),u=r.node,u.folder&&r.targetType!=="checkbox")u.toggleExpanded();else if(n.singleSelection)u.unselectable?u.toggleExpanded():u.selected||(u.toggleSelected(),$(u.li).addClass("selected"));else if(u.unselectable)u.toggleExpanded();else if(t.shiftKey)if(n.lastClickedNode===null||n.lastClickedNode.getParent()!==u.getParent())n.lastClickedNode=u;else{if(n.lastClickedNode!==u){for(var f=n.lastClickedNode,e=[],o=f.getIndex()>u.getIndex(),s=!u.isSelected();f!==null&&f!==u;)(f.match||!r.tree.enableFilter)&&e.push(f),f=o?f.getPrevSibling():f.getNextSibling();_.forEach(e,function(n){n.isSelected()!==s&&n.toggleSelected()})}n.lastClickedNode=null;v(u,r)}else n.lastClickedNode=u,v(u,r);l(i.fancytree("getTree"))},glyph:y()}),n.tree=i.fancytree("getTree"),n.singleSelection?(o=n.userdata.Collections.Topics.Single_Table,h=i.fancytree("getTree").getNodeByKey(o[0].Key),h.setSelected()):n.allSelected?n.tree.getFirstChild().setSelected():(_.forEach(n.Topics.Multiple,function(t,i){var r=n.tree.getNodeByKey(n.Topics.Multiple[i].Key);r.setSelected()}),a(n.tree),n.selectedNodesAreInvalid=!1),l(i.fancytree("getTree")),i};n.getSelectionError=function(t){var r=h(t).length;n.allSelected=t.count()===t.getSelectedNodes().length;n.allSelected?n.clearSelectionError():r<1?(n.selectionErrorMessage=u.trustAsHtml(i.instant("dictionary.SelectieTeKlein")+n.maxItems+i.instant("dictionary.OnderwerpHAAKenHAAK")),n.selectedNodesAreInvalid=!0):r<=n.maxItems?n.clearSelectionError():(n.selectionErrorMessage=u.trustAsHtml(i.instant("dictionary.SelectieTeGroot")+h(t).length+i.instant("dictionary.Van")+n.maxItems+i.instant("dictionary.OnderwerpHAAKenHAAK")+i.instant("dictionary.ErrorDataPortalReference").replace("{url}",o.current.MetaData.PortalLink)),n.selectedNodesAreInvalid=!0)};n.clearSelectionError=function(){n.selectionErrorMessage="";n.selectedNodesAreInvalid=!1};var k=function(){return i.instant("dictionary.TemplatePortal_Url").replace("{catalog}",o.current.MetaData.data.TableInfos.value[0].Catalog).replace("{identifier}",o.current.MetaData.data.TableInfos.value[0].Identifier)},l=function(n){var i=h(n),t;i.length>0&&(t=i[0].data.topic.Unit);n.$div.find("span[class=unit]").closest("li").removeClass("selected blue");_.forEach(n.getSelectedNodes(!0),function(n){var t=$(n.li);t.closest("li").addClass("selected")});t&&n.$div.find("span[class=unit]").filter(function(){return $.trim($(this).text())===t}).closest("li").addClass("blue")},h=function(t){var i=[],r=t.getSelectedNodes();return n.allSelected=t.getRootNode().selected,$.map(r,function(n){var t=n.data.topic;t&&i.push(n)}),i},y=function(){return{map:{doc:"fa fa-file-o",docOpen:"fa fa-file-o",checkbox:"fa fa-square-o",checkboxSelected:"fa fa-check-square-o",checkboxUnknown:"fa fa-square",error:"fa fa-warning",expanderClosed:"fa fa-chevron-down",expanderLazy:"fa fa-angle-right",expanderOpen:"fa fa-chevron-up",folder:"fa fa-folder-o",folderOpen:"fa fa-folder-open-o",loading:"fa fa-spinner fa-pulse"}}},a=function(n){var t=n.getSelectedNodes(!0);$.map(t,function(n){n.fixSelection3FromEndNodes()})},p=function(){return""===n.userdata.Topics?[]:n.userdata.Collections.Topics},w=function(){var t=[],i=_.map(n.Topics.Multiple,"Key"),r=_.map(h(n.tree),"data.topic.Key"),u=!1,f=!1,e=n.singleSelection?"Single":"Multiple";return t=_.concat(_.difference(i,r),_.difference(r,i)),u=(n.allSelected||!1)!==n.allSelectedInitially,f=t.length>0||u,t.length>0&&n.userdata.ToggleCategoriesItems(t,"Topics",e),f},v=function(t,i){t.toggleSelected();a(i.tree);n.getSelectionError(i.tree);n.$apply()},b=function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var n=window.getSelection();n.removeAllRanges()}}}])}(),function(){"use strict";angular.module("CbsApp").controller("TsGeoController",["$scope","$sce","type","close","tableState","$translate","treeHelper",function(n,t,i,r,u,f,e){var c;n.init=function(t,r){return n.gdKey=r.key,n.gd=u.current.MetaData.CollectionsData[n.gdKey],n.gdGroups=u.current.MetaData.GeoDimensionGroups,n.gdUserData=u.current.UserData.Collections[n.gdKey],n.mode="vals"===i?"Single":"Multiple",n.title=n.gd.Title,n.hideApply=!1,n.hideSelectAll="Single"===n.mode,n.allSelectedInitially=n.gdUserData.allSelected||!1,n.lastClickedNode=null,n.maxItems=settings.max_selectable_categories_geo,n.maxItemsFilterExpand=settings.max_items_filter_expand,"Single"===n.mode&&(n.hideApply=!0),n.fillGeoDimensionTree(t,n.gd,n.gdGroups)};c=function(){return n.tree.count()<n.maxItemsFilterExpand};n.filterTree=function(){var i=$("#treeFilterText")[0].value.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),t,r;i.length>=2?(t=new RegExp(e.AddDiacritics(i),"ig"),r="<mark>$&<\/mark>",n.tree.filterNodes(function(n){return n.titleWithHighlight=n.title.replace(t,r),t.test(n.title)},{autoExpand:c()})):n.tree.clearFilter()};n.close=function(t){var i="Single"===n.mode&&t;if(t&&"Single"===n.mode){var e=n.gdUserData.Single[0].Key,f=o().categories[0],s=f.Key.substr(0,2);u.current.UserData.ToggleCategoriesItems([e,f.Key],n.gdKey,"Single");u.current.UserData.SetIndeling(n.gdKey,s)}"Multiple"===n.mode&&t&&(i=a());r(i,500);"Single"===n.mode&&($("#ts_modal").modal("hide"),$("div.modal-backdrop").remove())};n.getSelectionError=function(){var r=o(),i=r.indelingen.length+r.categories.length;i<1?(n.selectionErrorMessage=t.trustAsHtml(f.instant("dictionary.SelectieTeKlein")+n.maxItems+f.instant("dictionary.Groepitems")),n.selectedNodesAreInvalid=!0):i>n.maxItems?(n.selectionErrorMessage=t.trustAsHtml(f.instant("dictionary.SelectieTeGroot")+i+f.instant("dictionary.Van")+n.maxItems+f.instant("dictionary.Groepitems")+f.instant("dictionary.ErrorDataPortalReference").replace("{url}",u.current.MetaData.PortalLink)),n.selectedNodesAreInvalid=!0):n.clearSelectionError()};n.clearSelectionError=function(){n.selectionErrorMessage="";n.selectedNodesAreInvalid=!1};n.fillGeoDimensionTree=function(t,i,r){var o=!0,c=3,a,u,f;return t.empty(),t.off("click","ul li"),u=[],f={id:0,root:!0,title:n.title,folder:!0,unselectable:!1,expanded:!0},e.BuildGeoDimensionTree(i,r).then(function(i){var r,y,p,e;return f.children=i,u.push(f),a=u,"Single"===n.mode&&(o=!1,c=1),r=$("<div>"),"Single"===n.mode?r.addClass("tree singleselect indeling"):r.addClass("tree multiselect indeling"),r.fancytree({source:a,extensions:["filter","glyph"],checkbox:o,icons:!1,selectMode:c,autoScroll:!0,scrollParent:t,toggleEffect:{effect:"drop",options:{direction:"left"},duration:400},filter:{counter:!1,mode:"hide"},renderNode:function(n,t){t.node.li.firstChild.className.indexOf("fancytree-hide")!==-1&&$(t.node.li).addClass("fancytree-hide")},click:function(t,i){var u;if(v(),u=i.node,t.preventDefault(),t.stopPropagation(),i.targetType!=="checkbox"&&i.node.data.category===undefined)u.toggleExpanded(),_.forEach(r.fancytree("getTree").getSelectedNodes(!0),function(n){var t=$(n.li);t.closest("li").addClass("selected")});else if(u.data.category!==undefined){if("Single"===n.mode){u.selected||(_.forEach(r.fancytree("getTree").getSelectedNodes(!0),function(n){var t=$(n.li);n.setSelected(!1);t.closest("li").removeClass("selected")}),u.toggleSelected(),$(u.li).addClass("selected"));return}if(t.shiftKey)if(n.lastClickedNode===null||n.lastClickedNode.getParent()!==u.getParent())n.lastClickedNode=u;else{if(n.lastClickedNode!==u){for(var f=n.lastClickedNode,e=[],o=f.getIndex()>u.getIndex(),s=!u.isSelected();f!==null&&f!==u;)(f.match||!i.tree.enableFilter)&&e.push(f),f=o?f.getPrevSibling():f.getNextSibling();_.forEach(e,function(n){n.isSelected()!==s&&n.toggleSelected()})}n.lastClickedNode=null;h(u,i)}else n.lastClickedNode=u,h(u,i)}else h(u,i)},glyph:{map:{doc:"fa fa-file-o",docOpen:"fa fa-file-o",checkbox:"fa fa-square-o",checkboxSelected:"fa fa-check-square-o",checkboxUnknown:"fa fa-square",error:"fa fa-warning",expanderClosed:"fa fa-chevron-down",expanderLazy:"fa fa-angle-right",expanderOpen:"fa fa-chevron-up",folder:"fa fa-folder-o",folderOpen:"fa fa-folder-open-o",loading:"fa fa-spinner fa-pulse"}}}),"Multiple"===n.mode?(y=n.gdUserData.Multiple,p=n.gdUserData.Indelingen_tabel):y=n.gdUserData.Single,e=r.fancytree("getTree"),n.tree=e,_.forEach(y,function(t,i){var r=e.getNodeByKey(y[i].Key);r.selected=!0;"Single"===n.mode&&r.parent.toggleExpanded();$(r.li).addClass("selected")}),"Multiple"===n.mode&&(n.gdUserData.allSelected?e.getFirstChild().setSelected():_.forEach(p,function(n,t){var i=l(p[t].Key),r=e.getNodeByKey(i);_.forEach(r.children,function(n){n.selected=!0;n.children!=null&&n.children.length>0&&_.forEach(n.children,function(n){n.selected=!0})})})),n.clearSelectionError(),"Multiple"===n.mode&&s(e),r})};var l=function(n){return n=="GM"||n=="CR"?n+"PV":n},a=function(){var f=[],t={},e,i=o(),r={},h=!1,c=!1,l=!1,s=!1;return t.firstIndeling=n.gdUserData.Indeling.Key||n.gdUserData.Indeling,t.indelingen=_.map(n.gdUserData.Indelingen_tabel,"Key"),t.categories=_.map(n.gdUserData.Multiple,"Key"),r.indelingen=_.map(i.indelingen,"Key"),r.categories=_.map(i.categories,"Key"),h=_.xor(t.indelingen,r.indelingen).length>0,c=_.xor(t.categories,r.categories).length>0,l=(n.allSelected||!1)!==n.allSelectedInitially,s=h||c||l,s&&!_.isUndefined(i.firstIndeling)&&u.current.UserData.SetIndeling(n.gdKey,i.firstIndeling.Key),_.forEach(["indelingen","categories"],function(o){f=[];e=r[o];t.indelingen=_.map(n.gdUserData.Indelingen_tabel,"Key");t.categories=_.map(n.gdUserData.Multiple,"Key");f=_.concat(_.difference(t[o],e),_.difference(e,t[o]));switch(o){case"indelingen":u.current.UserData.SetIndelingen(n.gdKey,i[o]);break;case"categories":f.length>0&&u.current.UserData.ToggleCategoriesItems(f,n.gdKey,n.mode)}}),s},o=function(){var u,t,r,f=[],i=[],e=n.tree,o=!0;return u=n.gd.Indelingen,_.forEach(u,function(n){var u=l(n.Key);t=e.getNodeByKey(u);_.isUndefined(r)&&n.Key!="NL"&&(t.selected||t.partsel)&&(r=n);t.selected?f.push(n):(o=!1,_.forEach(t.children,function(n){n.selected&&n.children==null?i.push(n.data.category):n.children!=null&&n.children.length>0&&_.forEach(n.children,function(n){n.selected&&i.push(n.data.category)})}))}),t=e.getNodeByKey("%%"),t&&_.forEach(t.children,function(n){n.selected&&i.push(n.data.category)}),n.allSelected=o,{firstIndeling:r,indelingen:f,categories:i}},s=function(n){var t=n.getSelectedNodes(!0);$.map(t,function(n){n.fixSelection3FromEndNodes()})},h=function(t,i){t.selected?(t.toggleSelected(),s(i.tree),n.getSelectionError(i.tree),n.$apply()):(t.toggleSelected(),s(i.tree),n.selectedNodesAreInvalid=!1,n.$apply(),o().categories.length>n.maxItems?(n.getSelectionError(i.tree),n.$apply()):(n.clearSelectionError(),n.$apply()))},v=function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var n=window.getSelection();n.removeAllRanges()}}}])}(),function(){"use strict";angular.module("CbsApp").controller("TsGeoDetailController",["$scope","$sce","$q","type","close","tableState","$translate","treeHelper",function(n,t,i,r,u,f,e,o){var l;n.init=function(t){var u=i.defer();return n.gdKey=f.current.MetaData.GeoDetail,n.gd=f.current.MetaData.CollectionsData[n.gdKey],n.gdUserData=f.current.UserData.Collections[n.gdKey],n.gdGroups=f.current.MetaData.GeoDetailGroups,n.mode="vals"===r?"Single":"Multiple",n.title=n.gd.Title,n.hideApply=!1,n.hideSelectAll="Single"===n.mode,n.allSelectedInitially=n.gdUserData.allSelected||!1,n.lastClickedNode=null,n.maxItems=settings.max_selectable_categories,n.maxItemsFilterExpand=settings.max_items_filter_expand,"Single"===n.mode&&(n.hideApply=!0),u.resolve(n.fillGeoDimensionTree(t,n.gd,n.gdGroups)),u.promise};l=function(){return n.tree.count()<n.maxItemsFilterExpand};n.filterTree=function(){var i=$("#treeFilterText")[0].value.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),t,r;i.length>=2?(t=new RegExp(o.AddDiacritics(i),"ig"),r="<mark>$&<\/mark>",n.tree.filterNodes(function(n){return n.titleWithHighlight=n.title.replace(t,r),t.test(n.title)},{autoExpand:l()})):n.tree.clearFilter()};n.close=function(t){var r="Single"===n.mode&&t;if("Single"===n.mode&&t){var e=n.gdUserData.Single[0].Key,i=s().categories[0],o=i.Indeling==="BU"?"BU":"WK",h=i.Key.substr(2,4);f.current.UserData.ToggleCategoriesItems([e,i.Key],n.gdKey,"Single");f.current.UserData.SetIndeling(n.gdKey,o,h)}"Multiple"===n.mode&&t&&(r=a());u(r,500);"Single"===n.mode&&($("#ts_modal").modal("hide"),$("div.modal-backdrop").remove())};n.getSelectionError=function(){var r=s(),i=r.indelingen.length+r.categories.length;i<1?(n.selectionErrorMessage=t.trustAsHtml(e.instant("dictionary.SelectieTeKlein")+n.maxItems+e.instant("dictionary.Groepitems")),n.selectedNodesAreInvalid=!0):i>n.maxItems?(n.selectionErrorMessage=t.trustAsHtml(e.instant("dictionary.SelectieTeGroot")+i+e.instant("dictionary.Van")+n.maxItems+e.instant("dictionary.Groepitems")+e.instant("dictionary.ErrorDataPortalReference").replace("{url}",f.current.MetaData.PortalLink)),n.selectedNodesAreInvalid=!0):n.clearSelectionError()};n.clearSelectionError=function(){n.selectionErrorMessage="";n.selectedNodesAreInvalid=!1};n.fillGeoDimensionTree=function(t,i,r){var y=!0,p=3,w,s,l,u,e,a,f;return t.empty(),t.off("click","ul li"),s=[],l={id:0,root:!0,title:n.title,folder:!0,unselectable:!1,expanded:!0},l.children=o.BuildGeoDetailTree(i,r),s.push(l),w=s,"Single"===n.mode&&(y=!1,p=1),u=$("<div>"),"Single"===n.mode?u.addClass("tree singleselect indeling"):u.addClass("tree multiselect indeling"),u.fancytree({source:w,extensions:["filter","glyph"],checkbox:y,icons:!1,selectMode:p,autoScroll:!0,scrollParent:t,toggleEffect:{effect:"drop",options:{direction:"left"},duration:400},filter:{counter:!1,mode:"hide"},renderNode:function(n,t){t.node.li.firstChild.className.indexOf("fancytree-hide")!==-1&&$(t.node.li).addClass("fancytree-hide")},click:function(t,i){var r;if(v(),r=i.node,t.preventDefault(),t.stopPropagation(),i.targetType!=="checkbox"&&r.data.category===undefined)r.toggleExpanded(),_.forEach(u.fancytree("getTree").getSelectedNodes(!0),function(n){var t=$(n.li);t.closest("li").addClass("selected")});else if(r.data.category!==undefined){if("Single"===n.mode){r.selected||(_.forEach(u.fancytree("getTree").getSelectedNodes(!0),function(n){var t=$(n.li);n.setSelected(!1);t.closest("li").removeClass("selected")}),h(r,i),$(r.li).addClass("selected"));return}if(t.shiftKey)if(n.lastClickedNode===null||n.lastClickedNode.getParent()!==r.getParent())n.lastClickedNode=r;else{if(n.lastClickedNode!==r){for(var f=n.lastClickedNode,e=[],o=f.getIndex()>r.getIndex(),s=!r.isSelected();f!==null&&f!==r;)(f.match||!i.tree.enableFilter)&&e.push(f),f=o?f.getPrevSibling():f.getNextSibling();_.forEach(e,function(n){n.isSelected()!==s&&n.toggleSelected()})}n.lastClickedNode=null;h(r,i)}else n.lastClickedNode=r,h(r,i)}else h(r,i)},glyph:{map:{doc:"fa fa-file-o",docOpen:"fa fa-file-o",checkbox:"fa fa-square-o",checkboxSelected:"fa fa-check-square-o",checkboxUnknown:"fa fa-square",error:"fa fa-warning",expanderClosed:"fa fa-chevron-down",expanderLazy:"fa fa-angle-right",expanderOpen:"fa fa-chevron-up",folder:"fa fa-folder-o",folderOpen:"fa fa-folder-open-o",loading:"fa fa-spinner fa-pulse"}}}),"Multiple"===n.mode?(e=n.gdUserData.Multiple,a=n.gdUserData.Indelingen_tabel):e=n.gdUserData.Single,f=u.fancytree("getTree"),n.tree=f,_.forEach(e,function(t,i){var r=f.getNodeByKey(e[i].Key);r.selected=!0;"Single"===n.mode&&r.parent.toggleExpanded();$(r.li).addClass("selected")}),"Multiple"===n.mode&&(n.gdUserData.allSelected?n.tree.getFirstChild().setSelected():_.forEach(a,function(n,t){var i=f.getNodeByKey(a[t].Key);_.forEach(i.children,function(n){n.selected=!0})})),n.clearSelectionError(),"Multiple"===n.mode&&c(f),u};var a=function(){var u,e,t={},i=s(),r={},o=!1,h=!1,c=!1,l=!1,a;return t.firstIndeling=n.gdUserData.Indeling.Key||n.gdUserData.Indeling,t.indelingen=_.map(n.gdUserData.Indelingen_tabel,"Key"),t.categories=_.map(n.gdUserData.Multiple,"Key"),r.indelingen=_.map(i.indelingen,"Key"),r.categories=_.map(i.categories,"Key"),o=_.xor(t.indelingen,r.indelingen).length>0,h=_.xor(t.categories,r.categories).length>0,c=(n.allSelected||!1)!==n.allSelectedInitially,l=o||h||c,_.isUndefined(i.firstIndeling)||(a=_.size(r.indelingen)===0&&_.every(i.categories,function(n){return n.Indeling==="BU"})?"BU":"WK",f.current.UserData.SetIndeling(n.gdKey,a,i.firstIndeling.Key)),_.forEach(["indelingen","categories"],function(o){u=[];e=r[o];t.indelingen=_.map(n.gdUserData.Indelingen_tabel,"Key");t.categories=_.map(n.gdUserData.Multiple,"Key");u=_.concat(_.difference(t[o],e),_.difference(e,t[o]));switch(o){case"indelingen":f.current.UserData.SetIndelingen(n.gdKey,i[o]);break;case"categories":u.length>0&&f.current.UserData.ToggleCategoriesItems(u,n.gdKey,n.mode)}}),l},s=function(){var f,t,i,e=[],r=[],u=n.tree;return n.allSelected=u.getRootNode().selected,f=n.gd.Gemeenten,_.forEach(f,function(n){t=u.getNodeByKey(n.Key);_.isUndefined(i)&&(t.selected||t.partsel)&&(i=n);t.selected?n.Key!=="%%"&&e.push(n):_.forEach(t.children,function(n){n.selected&&r.push(n.data.category)})}),t=u.getNodeByKey("NL"),t&&_.forEach(t.children,function(n){n.selected&&r.push(n.data.category)}),{firstIndeling:i,indelingen:e,categories:r}},c=function(n){if(n.options.selectMode===3){var t=n.getSelectedNodes(!0);$.map(t,function(n){n.fixSelection3FromEndNodes()})}},h=function(t,i){t.selected?(t.toggleSelected(),c(i.tree),n.getSelectionError(i.tree),n.$apply()):(t.toggleSelected(),c(i.tree),n.selectedNodesAreInvalid=!1,n.$apply(),s().length>n.maxItems?(n.getSelectionError(i.tree),n.$apply()):(n.clearSelectionError(),n.$apply()))},v=function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var n=window.getSelection();n.removeAllRanges()}}}])}(),function(){"use strict";angular.module("CbsApp").controller("TsTimeController",["$scope","$sce","$q","type","close","tableState","$translate","treeHelper",function(n,t,i,r,u,f,e,o){var h=f.current.MetaData.TimeDimension,s=f.current.MetaData.CollectionsData[h],l;n.init=function(t){var u=i.defer();return n.singleSelection=r==="vals",n.hideApply=!1,n.hideSelectAll=n.singleSelection,n.title=s.Title,n.allSelectedInitially=f.current.UserData.Collections[h].allSelected||!1,n.lastClickedNode=null,n.maxItems=settings.max_selectable_categories,n.maxItemsFilterExpand=settings.max_items_filter_expand,n.singleSelection?n.hideApply=!0:n.clearSelectionError(),u.resolve(n.fillTimeDimensionTree(t,s)),u.promise};n.close=function(t){var r=n.singleSelection&&t;if(t&&n.singleSelection){var o=f.current.UserData.Collections[s.Key],h=o.Single[0].Key,e=c(n.tree).categories[0],i=e.Key.substring(4,6);(i[0]==="0"||i[0]==="1")&&(i="0%");f.current.UserData.ToggleCategoriesItems([h,e.Key],s.Key,"Single");f.current.UserData.SetIndeling(s.Key,i)}t&&!n.singleSelection&&(r=v(n.tree));u(r,500);n.singleSelection&&($("#ts_modal").modal("hide"),$("div.modal-backdrop").remove())};l=function(){return n.tree.count()<n.maxItemsFilterExpand};n.filterTree=function(){var i=$("#treeFilterText")[0].value.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),t,r;i.length>=2?(t=new RegExp(o.AddDiacritics(i),"ig"),r="<mark>$&<\/mark>",n.tree.filterNodes(function(n){return n.titleWithHighlight=n.title.replace(t,r),t.test(n.title)},{autoExpand:l()})):n.tree.clearFilter()};n.fillTimeDimensionTree=function(t,i){var w,r,u,b,e,s,h;t.empty();t.off("click","ul li");var c=!0,l=3,v=[],p={id:0,root:!0,title:n.title,folder:!0,unselectable:!1,expanded:!0};return p.children=o.BuildTimeTree(i),v.push(p),w=v,r=$("<div>"),n.singleSelection?(c=!1,l=1,r.addClass("tree singleselect indeling")):r.addClass("tree multiselect indeling"),r.fancytree({source:w,checkbox:c,selectMode:l,autoScroll:!0,icons:!1,extensions:["filter","glyph"],scrollParent:t,toggleEffect:{effect:"drop",options:{direction:"left"},duration:400},filter:{counter:!1,mode:"hide"},renderNode:function(n,t){t.node.li.firstChild.className.indexOf("fancytree-hide")!==-1&&$(t.node.li).addClass("fancytree-hide")},click:function(t,i){var r;if(y(),r=i.node,t.preventDefault(),t.stopPropagation(),i.targetType!=="checkbox"&&i.node.data.category===undefined)r.toggleExpanded();else if(r.data.category!==undefined){if(n.singleSelection){r.selected||(r.toggleSelected(),$(r.li).addClass("selected"));return}if(t.shiftKey)if(n.lastClickedNode===null||n.lastClickedNode.getParent()!==i.node.getParent())n.lastClickedNode=r;else{if(n.lastClickedNode!==r){for(var u=n.lastClickedNode,f=[],e=u.getIndex()>r.getIndex(),o=!r.isSelected();u!==null&&u!==r;)(u.match||!i.tree.enableFilter)&&f.push(u),u=e?u.getPrevSibling():u.getNextSibling();_.forEach(f,function(n){n.isSelected()!==o&&n.toggleSelected()})}n.lastClickedNode=null;r.toggleSelected()}else n.lastClickedNode=r,r.toggleSelected()}else r.toggleSelected();n.getSelectionError(i.tree);n.$apply()},glyph:{map:{doc:"fa fa-file-o",docOpen:"fa fa-file-o",checkbox:"fa fa-square-o",checkboxSelected:"fa fa-check-square-o",checkboxUnknown:"fa fa-square",error:"fa fa-warning",expanderClosed:"fa fa-chevron-down",expanderLazy:"fa fa-angle-right",expanderOpen:"fa fa-chevron-up",folder:"fa fa-folder-o",folderOpen:"fa fa-folder-open-o",loading:"fa fa-spinner fa-pulse"}}}),n.tree=r.fancytree("getTree"),u=f.current.UserData.Collections[i.Key],n.singleSelection?(b=u.Single,e=n.tree.getNodeByKey(b[0].Key),e.parent.toggleExpanded(),e.setSelected(),$(e.li).addClass("selected")):(u.allSelected?n.tree.getFirstChild().setSelected():(s=u.Multiple,h=u.Indelingen_tabel,_.forEach(s,function(t,i){var r=n.tree.getNodeByKey(s[i].Key);r.selected=!0}),_.forEach(h,function(t,i){var r=n.tree.getNodeByKey(h[i].Key);_.forEach(r.children,function(n){n.selected=!0})})),a(n.tree),n.selectedNodesAreInvalid=!1),r};n.getSelectionError=function(i){var u=c(i),o=u.indelingen.length,s=u.categories.length,r=o+s;r<1?(n.selectionErrorMessage=t.trustAsHtml(e.instant("dictionary.SelectieTeKlein")+n.maxItems+e.instant("dictionary.Groepitems")),n.selectedNodesAreInvalid=!0):r>n.maxItems?(n.selectionErrorMessage=t.trustAsHtml(e.instant("dictionary.SelectieTeGroot")+r+e.instant("dictionary.Van")+n.maxItems+e.instant("dictionary.Groepitems")+e.instant("dictionary.ErrorDataPortalReference").replace("{url}",f.current.MetaData.PortalLink)),n.selectedNodesAreInvalid=!0):n.clearSelectionError()};n.clearSelectionError=function(){n.selectionErrorMessage="";n.selectedNodesAreInvalid=!1};var b=function(){return e.instant("dictionary.TemplatePortal_Url").replace("{catalog}",f.current.MetaData.data.TableInfos.value[0].Catalog).replace("{identifier}",f.current.MetaData.data.TableInfos.value[0].Identifier)},c=function(t){var r,f=[],u=[],i;return n.allSelected=t.getRootNode().selected,_.forEach(s.Indelingen,function(n){i=t.getNodeByKey(n.Key);_.isUndefined(r)&&(i.selected||i.partsel)&&(r=n);i.selected?f.push(n):_.forEach(i.children,function(n){n.selected&&u.push(n.data.category)})}),i=t.getNodeByKey("%%"),i&&_.forEach(i.children,function(n){n.selected&&u.push(n.data.category)}),{firstIndeling:r,indelingen:f,categories:u}},a=function(n){var t=n.getSelectedNodes(!0);$.map(t,function(n){n.fixSelection3FromEndNodes()})},v=function(t){var r=f.current.UserData.Collections[s.Key],i={},o=[],l,u,e={},v=!1,y=!1,p=!1,a=!1;return i.firstIndeling=r.Indeling.Key||r.Indeling,i.indelingen=_.map(r.Indelingen_tabel,"Key"),i.categories=_.map(r.Multiple,"Key"),u=c(t),e.indelingen=_.map(u.indelingen,"Key"),e.categories=_.map(u.categories,"Key"),v=_.xor(i.indelingen,e.indelingen).length>0,y=_.xor(i.categories,e.categories).length>0,p=(n.allSelected||!1)!==n.allSelectedInitially,a=v||y||p,a&&!_.isUndefined(u.firstIndeling)&&f.current.UserData.SetIndeling(s.Key,u.firstIndeling.Key),_.forEach(["indelingen","categories"],function(t){o=[];l=e[t];i.indelingen=_.map(r.Indelingen_tabel,"Key");i.categories=_.map(r.Multiple,"Key");o=_.concat(_.difference(i[t],l),_.difference(l,i[t]));switch(t){case"indelingen":f.current.UserData.SetIndelingen(h,u[t]);break;case"categories":o.length>0&&f.current.UserData.ToggleCategoriesItems(o,h,n.singleSelection?"Single":"Multiple")}}),a},y=function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var n=window.getSelection();n.removeAllRanges()}}}])}(),function(){"use strict";angular.module("CbsApp").controller("TsDimensionController",["$scope","$sce","$translate","$q","type","key","close","tableState","treeHelper",function(n,t,i,r,u,f,e,o,s){var c;n.init=function(t){var i=r.defer();return n.metadata=o.current.MetaData,n.userdata=o.current.UserData,n.singleSelection=u==="vals",n.hideApply=!1,n.dimension=n.userdata.Collections[f],n.title=n.metadata.Dimensions[f].Title,n.allSelectedInitially=n.dimension.allSelected||!1,n.lastClickedNode=null,n.maxItems=settings.max_selectable_categories,n.maxItemsFilterExpand=settings.max_items_filter_expand,n.singleSelection?n.hideApply=!0:n.clearSelectionError(),i.resolve(n.fillDimensionTree(t,n.dimension.Key)),i.promise};n.close=function(t){var i=n.singleSelection&&t,r,u;t&&n.singleSelection&&(r=n.dimension.Single[0].Key,u=_.map(h(n.tree),"data.category.Key")[0],o.current.UserData.ToggleCategoriesItems([r,u],n.dimension.Key,"Single"));t&&!n.singleSelection&&(i=v(n.tree));e(i,500);n.singleSelection&&($("#ts_modal").modal("hide"),$("div.modal-backdrop").remove())};c=function(){return n.tree.count()<n.maxItemsFilterExpand};n.filterTree=function(){var i=$("#treeFilterText")[0].value.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),t,r;i.length>=2?(t=new RegExp(s.AddDiacritics(i),"ig"),r="<mark>$&<\/mark>",n.tree.filterNodes(function(n){return n.titleWithHighlight=n.title.replace(t,r),t.test(n.title)},{autoExpand:c()})):n.tree.clearFilter()};n.fillDimensionTree=function(t,i){var e,o,h,u,f;t.empty();t.off("click","ul li");e=[];o={id:0,root:!0,title:n.title,folder:!0,unselectable:!1,expanded:!0};o.children=s.BuildDimensionTree(i,null);e.push(o);var v=e,c=!0,l=3,r=$("<div>");return n.singleSelection?(c=!1,l=1,r.addClass("tree singleselect dimension")):r.addClass("tree multiselect dimension"),r.fancytree({source:v,checkbox:c,selectMode:l,autoScroll:!0,icons:!1,extensions:["childcounter","filter","glyph"],scrollParent:t,toggleEffect:{effect:"drop",options:{direction:"left"},duration:400},childcounter:{deep:!0,hideZeros:!1,hideExpanded:!1},filter:{counter:!1,mode:"hide"},renderNode:function(n,t){t.node.li.firstChild.className.indexOf("fancytree-hide")!==-1&&$(t.node.li).addClass("fancytree-hide")},click:function(t,i){var r;if(y(),t.preventDefault(),t.stopPropagation(),r=i.node,n.singleSelection){if(i.node.folder)r.toggleExpanded();else if(!r.isSelected()){r.toggleSelected();$(r.li).addClass("selected");return}}else if(i.node.folder&&i.targetType!=="checkbox")r.toggleExpanded();else if(t.shiftKey)if(n.lastClickedNode===null||n.lastClickedNode.getParent()!==r.getParent())n.lastClickedNode=r;else{if(n.lastClickedNode!==r){for(var u=n.lastClickedNode,f=[],e=u.getIndex()>r.getIndex(),o=!r.isSelected();u!==null&&u!==r;)(u.match||!i.tree.enableFilter)&&f.push(u),u=e?u.getPrevSibling():u.getNextSibling();_.forEach(f,function(n){n.isSelected()!==o&&n.toggleSelected()})}n.lastClickedNode=null;a(r,i)}else n.lastClickedNode=r,a(r,i)},glyph:{map:{doc:"fa fa-file-o",docOpen:"fa fa-file-o",checkbox:"fa fa-square-o",checkboxSelected:"fa fa-check-square-o",checkboxUnknown:"fa fa-square",error:"fa fa-warning",expanderClosed:"fa fa-chevron-down",expanderLazy:"fa fa-angle-right",expanderOpen:"fa fa-chevron-up",folder:"fa fa-folder-o",folderOpen:"fa fa-folder-open-o",loading:"fa fa-spinner fa-pulse"}}}),h=r.fancytree("getTree"),n.tree=h,n.singleSelection?(u=n.dimension.Single,f=n.tree.getNodeByKey(u[0].Key),f.setSelected(),f.makeVisible(),$(f.li).addClass("selected")):n.dimension.allSelected?n.tree.getFirstChild().setSelected():(u=n.dimension.Multiple,_.forEach(u,function(n,t){var i=h.getNodeByKey(u[t].Key);i.setSelected();i.makeVisible()}),n.selectedNodesAreInvalid=!1),r};n.getSelectionError=function(r){var u=h(r).length;n.allSelected=r.count()===r.getSelectedNodes().length;n.allSelected?n.clearSelectionError():u<1?(n.selectionErrorMessage=t.trustAsHtml(i.instant("dictionary.SelectieTeKlein")+n.maxItems+i.instant("dictionary.Items")),n.selectedNodesAreInvalid=!0):u<=n.maxItems?n.clearSelectionError():(n.selectionErrorMessage=t.trustAsHtml(i.instant("dictionary.SelectieTeGroot")+u+i.instant("dictionary.Van")+n.maxItems+i.instant("dictionary.Items")+i.instant("dictionary.ErrorDataPortalReference").replace("{url}",o.current.MetaData.PortalLink)),n.selectedNodesAreInvalid=!0)};n.clearSelectionError=function(){n.selectionErrorMessage="";n.selectedNodesAreInvalid=!1};var h=function(t){var i=[],r=t.getSelectedNodes();return n.allSelected=t.getRootNode().selected,$.map(r,function(n){var t=n.data.category;t&&i.push(n)}),i},l=function(n){var t=n.getSelectedNodes(!0);$.map(t,function(n){n.fixSelection3FromEndNodes()})},a=function(t,i){t.selected?(t.toggleSelected(),l(i.tree),n.getSelectionError(i.tree),n.$apply()):(t.toggleSelected(),l(i.tree),n.selectedNodesAreInvalid=!1,n.$apply(),h(i.tree).length>n.maxItems?(n.getSelectionError(i.tree),n.$apply()):(n.clearSelectionError(),n.$apply()))},v=function(t){var i=[],r=_.map(n.dimension.Multiple,"Key"),u=_.map(h(t),"data.category.Key"),f=!1,e=!1;return i=_.concat(_.difference(r,u),_.difference(u,r)),f=(n.allSelected||!1)!==n.allSelectedInitially,e=i.length>0||f,i.length>0&&n.userdata.ToggleCategoriesItems(i,n.dimension.Key,n.singleSelection?"Single":"Multiple"),e},y=function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var n=window.getSelection();n.removeAllRanges()}}}])}(),function(){angular.module("CbsDirectives").directive("languageSelector",["$translate","$state","$stateParams","CacheService",function(n,t,i,r){return{restrict:"AE",replace:!0,transclude:!1,templateUrl:"./app/components/languageDirective/language.html",controller:["$scope",function(u){u.languageTranslated=function(){return n.instant("dictionary.languageSwitch_"+u.getToggleToLanguage(u.language))};u.getToggleToLanguage=function(n){var r=settings.catalogs[i._catalog].languages,t=_.filter(r,function(t){if(_.toLower(t)!==_.toLower(n))return t});return t.length>1?(console.log("There are more then two languages defined for this Catalog. This is not possible."),"NL"):_.toUpper(t[0])};u.toggleLanguage=function(){u.language=u.getToggleToLanguage(u.language);u.SetLanguage(u.language)};u.SetLanguage=function(n){console.log("SetLanguage: "+n);t.go("app.home",{_catalog:i._catalog,_la:n.toLowerCase()});r.removeAll()};var f=function(){u.language=i._la};f()}],link:function(){}}}])}(),function(){angular.module("CbsDirectives").directive("searchBar",["$filter","$rootScope","$state","$stateParams","$sce","$translate",function(n,t,i,r){return{restrict:"AE",replace:!1,transclude:!1,scope:!0,templateUrl:"./app/components/searchbarDirective/searchbarDirective.html",link:function(n){n.gotoSearchSubstate=function(){if(i.current.name!=="app.navigatieScherm.zoeken"){var n=$.extend({},r,{searchKeywords:t.searchKeywords});i.go("app.navigatieScherm.zoeken",n)}};n.searchByKeyword=function(i){t.$broadcast("$searchByKeyword",i);i&&i.which!==13||n.gotoSearchSubstate(i)}}}}])}(),function(){angular.module("CbsDirectives").directive("notificationpanel",["$filter","$rootScope","$state","$stateParams","$sce","$translate","notificationPanelService",function(n,t,i,r,u,f,e){return{restrict:"AE",replace:!1,transclude:!1,scope:{},templateUrl:"./app/components/notificationPanel/notificationPanel.html",link:function(n){n.GetInfoPanelType=function(){return e.state.notificationPanelType};n.GetInfoPanelText=function(){return e.state.notificationPanelText};n.ShowInfoPanel=function(){return e.state.isNotificationPanelVisible};n.CollapseInfo=function(){e.Hide()}}}}])}(),function(){angular.module("CbsUi").factory("notificationPanelService",["$http","$q","$httpParamSerializer","$translate","$rootScope",function(){var n={isNotificationPanelVisible:!1,notificationPanelType:"info",notificationPanelText:null},i=function(i,r){t();n.notificationPanelText=i;n.notificationPanelType="info";r!==undefined&&r()},r=function(i,r){t();n.notificationPanelText=i;n.notificationPanelType="warning";r!==undefined&&r()},u=function(i,r){t();n.notificationPanelText=i;n.notificationPanelType="error";r!==undefined&&r()},t=function(){n.isNotificationPanelVisible=!0},f=function(){n.isNotificationPanelVisible=!1};return{state:n,ShowInfo:i,ShowWarning:r,ShowError:u,Hide:f,Show:t}}])}(),function(n,t){if(typeof define=="function"&&define.amd)define(["exports","react","styled-components"],t);else if(typeof exports!="undefined")t(exports,require("react"),require("styled-components"));else{var i={exports:{}};t(i.exports,n.React,n.styled);n.Searchbar=i.exports}}(this,function(n,t,i){"use strict";function v(n){var i,t,r;if(n&&n.__esModule)return n;if(i={},n!=null)for(t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(n,t):{},r.get||r.set?Object.defineProperty(i,t,r):i[t]=n[t]);return i.default=n,i}function o(n){return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},o(n)}function g(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function y(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function nt(n,t,i){return t&&y(n.prototype,t),i&&y(n,i),n}function tt(n,t){return t&&(o(t)==="object"||typeof t=="function")?t:u(n)}function c(n){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},c(n)}function it(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&l(n,t)}function l(n,t){return l=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},l(n,t)}function u(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function a(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function p(){var n=f(["\n\t\t\tmin-width: 350px;\n\t\t"]);return p=function(){return n},n}function w(){var n=f(["\n\t\t\tmin-width: 315px;\n\t\t"]);return w=function(){return n},n}function b(){var n=f(["\n\t\t\tmin-width: 275px;\n\t\t"]);return b=function(){return n},n}function k(){var n=f(["\n\t\t-ms-grid-column: 2;\n\t\t-ms-grid-columns: auto auto;\n\t\tgrid-template-columns: auto auto;\t\t\n\t\tposition: static;\n\t\tvisibility: visible;\n\t\topacity: 1;\t\t\n\t\theight: 100%;\n\t\tpadding: 0;\n\t"]);return k=function(){return n},n}function d(){var n=f(["\n\t\tdisplay: none;\n\t"]);return d=function(){return n},n}function f(n,t){return t||(t=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(t)}}))}function r(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");}var h;Object.defineProperty(n,"__esModule",{value:!0});n.default=void 0;t=v(t);i=v(i);h=void 0;var s={tablet:769,midsize:992,desktop:1200},e=Object.keys(s).reduce(function(n,t){var u=this;return r(this,h),n[t]=function(){return r(this,u),i.css(["@media (min-width:","px){","}"],s[t],i.css.apply(void 0,arguments))}.bind(this),n}.bind(void 0),{}),rt=function(n){var u=n.onClick,i=n.className,f=i===void 0?"":i,e=n.children;return r(this,h),t.default.createElement("button",{onClick:u,className:f,type:"button"},e)}.bind(void 0),ut=i.default(rt).withConfig({displayName:"Searchbar__TriggerButton",componentId:"sc-1x58wyj-0"})(["display:block;z-index:1000;top:10px;right:10px;background-color:white;padding:1px 10px;border:none;outline:none;color:#163a72;cursor:pointer;"," i{font-size:16px;}"],e.tablet(d())),ft=i.default.div.withConfig({displayName:"Searchbar__Search",componentId:"sc-1x58wyj-1"})(["position:absolute;z-index:1;top:0;left:0;right:0;visibility:hidden;opacity:0;transition:all .3s ease-in-out;display:-ms-grid;display:grid;-ms-grid-columns:auto 50px;grid-template-columns:auto 50px;align-items:center;background-color:white;padding:10px 15px;","\t &.cbsshow{padding-top:67px;visibility:visible;opacity:1;}input{min-height:44px;width:100%;font-family:'Akko Regular W01',Helvetica,Arial,sans-serif;font-size:16px;color:#777;border:1px solid #777;padding:10px 12px 10px 15px;border-bottom-left-radius:6.63px;border-top-left-radius:6.63px;box-sizing:border-box;-ms-grid-column:1;outline:none;"," "," ","}button{background-color:#163a72;border-radius:6.63px 0 0 6.63px;margin-left:-15px;font-size:19px;padding-right:15px;padding-left:15px;border:1px solid #163a72;min-height:44px;cursor:pointer;-ms-grid-column:2;i{color:#fff;font-size:16px;}}"],e.tablet(k()),e.tablet(b()),e.midsize(w()),e.desktop(p())),et=function(n){function i(n){var f=this,t;return g(this,i),t=tt(this,c(i).call(this,n)),a(u(u(t)),"handleChange",function(n){r(this,f);t.setState({value:n.target.value})}.bind(this)),a(u(u(t)),"clickButton",function(n){r(this,f);n.preventDefault();t.props.search.searchterm(t.state.value);window.innerWidth<s.tablet&&t.props.toggleSearchCallback()}.bind(this)),a(u(u(t)),"handleKeyPress",function(n){r(this,f);n.key==="Enter"&&(t.props.search.searchterm(n.target.value),window.innerWidth<s.tablet&&t.props.toggleSearchCallback())}.bind(this)),t.state={value:""},t}return it(i,n),nt(i,[{key:"render",value:function(){var n=this,i=this.props.showSearch?"cbsshow":"cbshide",u=this.props.changeButton?"cbsclose":"cbsopen";return t.default.createElement(t.default.Fragment,null,t.default.createElement(ut,{onClick:this.props.toggleSearchCallback,className:"slide-out-trigger ".concat(u)},t.default.createElement("i",{className:"fa fa-search"})),t.default.createElement(ft,{className:"searchbar ".concat(i)},t.default.createElement("input",{type:"text",placeholder:this.props.search.searchplaceholder,onFocus:function(t){return r(this,n),t.target.placeholder=""}.bind(this),onBlur:function(t){return r(this,n),t.target.placeholder=this.props.search.searchplaceholder}.bind(this),value:this.state.value,onChange:this.handleChange,onKeyPress:this.handleKeyPress}),t.default.createElement("button",{onClick:this.clickButton},t.default.createElement("i",{className:"fa fa-search"}))))}}],[{key:"getDerivedStateFromProps",value:function(n,t){return n.search.searchkeywords!==t.value?{list:n.search.searchkeywords}:null}}]),i}(t.Component),ot=et;n.default=ot}),function(n,t){if(typeof define=="function"&&define.amd)define(["exports","react","styled-components"],t);else if(typeof exports!="undefined")t(exports,require("react"),require("styled-components"));else{var i={exports:{}};t(i.exports,n.React,n.styled);n.Nav=i.exports}}(this,function(n,t,i){"use strict";function y(n){var i,t,r;if(n&&n.__esModule)return n;if(i={},n!=null)for(t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(n,t):{},r.get||r.set?Object.defineProperty(i,t,r):i[t]=n[t]);return i.default=n,i}function o(n){return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},o(n)}function tt(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function p(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function it(n,t,i){return t&&p(n.prototype,t),i&&p(n,i),n}function rt(n,t){return t&&(o(t)==="object"||typeof t=="function")?t:u(n)}function c(n){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},c(n)}function ut(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&l(n,t)}function l(n,t){return l=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},l(n,t)}function u(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function a(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function w(){var n=f(["\n\t\t\t\ttext-decoration: underline;\n\t\t\t"]);return w=function(){return n},n}function b(){var n=f(["\n\t\tborder-bottom: 0;\n\t\t\n\t\t&:first-child {\n\t\t\t-ms-grid-column: 1;\n\t\t}\n\t\t\n\t\t&:nth-child(2) {\n\t\t\t-ms-grid-column: 2;\n\t\t}\n\t\t\n\t\t&:nth-child(3) {\n\t\t\t-ms-grid-column: 3;\n\t\t}\t\t\n\n\t\t&:nth-child(4) {\n\t\t\t-ms-grid-column: 4;\n\t\t}\t\t\t\n\t"]);return b=function(){return n},n}function k(){var n=f(["\n\t\t\tdisplay:-ms-grid;\n\t\t\tdisplay: grid;\n\t\t\t-ms-grid-columns: auto auto auto auto;\n\t\t\tgrid-template-columns: auto auto auto auto;\n\t\t\talign-items: center;\n\t\t\tjustify-items: stretch;\n\t\t\tgrid-column-gap: 10px;\n\t\t\theight: 100%;\n\t\t\tpadding: 0;\n\t\t\tmargin: 0;\n\t\t\tlist-style: none;\n\t\t"]);return k=function(){return n},n}function d(){var n=f(["\n\t\t-ms-grid-column: 1;\n\t\tposition: static;\n\t\tvisibility: visible;\n\t\topacity: 1;\t\t\n\t\theight: 100%;\n\t"]);return d=function(){return n},n}function g(){var n=f(["\n\t\tdisplay: none;\n\t"]);return g=function(){return n},n}function f(n,t){return t||(t=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(t)}}))}function r(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");}var h;Object.defineProperty(n,"__esModule",{value:!0});n.default=void 0;t=y(t);i=y(i);h=void 0;var v=[],s={tablet:769,midsize:992,desktop:1200},e=Object.keys(s).reduce(function(n,t){var u=this;return r(this,h),n[t]=function(){return r(this,u),i.css(["@media (min-width:","px){","}"],s[t],i.css.apply(void 0,arguments))}.bind(this),n}.bind(void 0),{}),ft=function(n){var u=n.onClick,i=n.className,f=i===void 0?"":i;return r(this,h),t.default.createElement("button",{onClick:u,className:f,type:"button"},t.default.createElement("div",{className:"bar1"}),t.default.createElement("div",{className:"bar2"}),t.default.createElement("div",{className:"bar3"}))}.bind(void 0),et=i.default(ft).withConfig({displayName:"Nav__StyledButton",componentId:"sc-1004g2y-0"})(["display:block;z-index:1000;top:10px;right:10px;background-color:white;padding:1px 10px;border:none;outline:none;cursor:pointer;"," .bar1,.bar2,.bar3{width:20px;height:3px;background-color:#163a72;margin:6px 0;transition:0.4s;}&.cbsclose .bar1{-webkit-transform:rotate(-45deg) translate(-7px,6px);transform:rotate(-45deg) translate(-7px,6px);}&.cbsclose .bar2{opacity:0;}&.cbsclose .bar3{-webkit-transform:rotate(45deg) translate(-6px,-6px);transform:rotate(45deg) translate(-6px,-6px);}"],e.tablet(g())),ot=i.default.nav.withConfig({displayName:"Nav__Menu",componentId:"sc-1004g2y-1"})(["\t position:absolute;z-index:1;top:-200px;left:0;right:0;visibility:hidden;opacity:0;transition:all .3s ease-in-out;"," &.cbsshow{top:0;padding-top:50px;visibility:visible;opacity:1;}ul{padding:25px 0;margin:0;list-style:none;background-color:white;height:100vh;","}"],e.tablet(d()),e.tablet(k())),nt=i.default.li.withConfig({displayName:"Nav__MenuItem",componentId:"sc-1004g2y-2"})(["border-bottom:2px solid transparent;&:hover,&:focus{border-color:#163a72;}"," a{display:block;padding:10px 15px;text-align:center;text-decoration:none;color:#163a72;font-family:'Akko Regular W01',Helvetica,Arial,sans-serif;font-size:18px;font-weight:bold;&:hover{","}}"],e.tablet(b()),e.tablet(w())),st=function(n){function i(n,t){var e=this,f;return tt(this,i),f=rt(this,c(i).call(this,n,t)),a(u(u(f)),"toggleLanguage",function(n){var t=this;r(this,e);n.preventDefault();f.setState({language:f.state.languages.filter(function(n){return r(this,t),n.toLowerCase()!==f.state.language.toLowerCase()?n:void 0}.bind(this))[0]})}.bind(this)),a(u(u(f)),"menuItemClick",function(){r(this,e);window.innerWidth<s.tablet&&f.props.toggleNavCallback()}.bind(this)),a(u(u(f)),"compare",function(n,t){return(r(this,e),n.objectID<t.objectID)?-1:n.objectID>t.objectID?1:0}.bind(this)),f.state={menu:v.concat(f.props.headerproperties.navmenu),language:f.props.headerproperties.languageToggleInitValue,languages:f.props.headerproperties.languages},f}return ut(i,n),it(i,[{key:"updateMenu",value:function(){var n=this;window.innerWidth<s.tablet?this.setState({menu:v.concat(this.props.headerproperties.navmenu).sort(this.compare)}):this.setState({menu:v.concat(this.props.headerproperties.navmenu.filter(function(t){return r(this,n),t.isMobileOnly===!1}.bind(this))).sort(this.compare)})}},{key:"componentDidMount",value:function(){this.updateMenu();window.addEventListener("resize",this.updateMenu.bind(this))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.updateMenu.bind(this))}},{key:"render",value:function(){var n=this,i=this.props.showMenu?"cbsshow":"cbshide",u=this.props.changeButton?"cbsclose":"cbsopen";return t.default.createElement(t.default.Fragment,null,t.default.createElement(et,{onClick:this.props.toggleNavCallback,className:"hamburger ".concat(u)}),t.default.createElement(ot,{className:"menu ".concat(i)},t.default.createElement("ul",null,this.state.menu.map(function(i){return(r(this,n),this.state.language!==undefined&&i.toggle!==undefined&&i.toggle===!0)?t.default.createElement(nt,{key:i.objectID},t.default.createElement("a",{href:i.toggleButtons[this.state.language].url,onClick:this.toggleLanguage},i.toggleButtons[this.state.language].title)):t.default.createElement(nt,{key:i.objectID},t.default.createElement("a",{onClick:this.menuItemClick,href:i.url},i.title))}.bind(this)))))}}]),i}(t.Component),ht=st;n.default=ht}),function(n,t){if(typeof define=="function"&&define.amd)define(["exports","react","styled-components","./cbs.svg","./MobileSlideIn.js","./Nav.js","./Searchbar.js"],t);else if(typeof exports!="undefined")t(exports,require("react"),require("styled-components"),require("./cbs.svg"),require("./MobileSlideIn.js"),require("./Nav.js"),require("./Searchbar.js"));else{var i={exports:{}};t(i.exports,n.React,n.styled,n.cbs,n.MobileSlideIn,n.Nav,n.Searchbar);n.Header=i.exports}}(this,function(n,t,i,r,u,f,e){"use strict";function c(n){return n&&n.__esModule?n:{"default":n}}function w(n){var i,t,r;if(n&&n.__esModule)return n;if(i={},n!=null)for(t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(n,t):{},r.get||r.set?Object.defineProperty(i,t,r):i[t]=n[t]);return i.default=n,i}function l(n){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},l(n)}function vt(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function b(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function yt(n,t,i){return t&&b(n.prototype,t),i&&b(n,i),n}function pt(n,t){return t&&(l(t)==="object"||typeof t=="function")?t:h(n)}function v(n){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},v(n)}function wt(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&y(n,t)}function y(n,t){return y=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},y(n,t)}function h(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function k(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function d(){var n=o(["\n\t\t\t\tmargin: 6px 15px 8px;\n\t\t\t\tfont-size: 24px;\n\t\t\t\tfont-weight: normal;\n\t\t\t"]);return d=function(){return n},n}function g(){var n=o(["\n\t\t\t\tbackground-color: #163a72; \n\t\t\t\tpadding: 7px 20px 10px 90px; \n\t\t\t\tcolor: white; \n\t\t\t\tfont-size: 24px;\n\t\t\t"]);return g=function(){return n},n}function nt(){var n=o(["\n\t\t\tposition: relative;\n\t\t\ttop: -22px; \n\t\t"]);return nt=function(){return n},n}function tt(){var n=o(["\n\t\t-ms-grid-column: 1; \n\t\tgrid-column-start: 1; \n\t\tposition: static; \n\t\theight: 1px;\n\t\tbackground-color: #ececec;\n\t"]);return tt=function(){return n},n}function it(){var n=o(["\n\t\t\torder: 2;\n\t\t"]);return it=function(){return n},n}function rt(){var n=o(["\n\t\t\torder: 1;\n\t\t"]);return rt=function(){return n},n}function ut(){var n=o(["\n\t\t\theight: 64px; \n\t\t\twidth: 45px;\n\t\t"]);return ut=function(){return n},n}function ft(){var n=o(["\n\t\t\tpadding: 10px 15px;\n\t\t"]);return ft=function(){return n},n}function et(){var n=o(["\n\t\tmax-width: 1170px;\n\t"]);return et=function(){return n},n}function ot(){var n=o(["\n\t\tmax-width: 970px;\n\t"]);return ot=function(){return n},n}function st(){var n=o(["\n\t\t-ms-grid-columns: 75px 1fr; \n\t\tgrid-template-columns: 75px 1fr; \n\t\tmax-width: 750px;\n\t"]);return st=function(){return n},n}function ht(){var n=o(["\n\t\tgrid-template-columns: repeat(auto-fit, minmax(100px, 1170px));\n\t"]);return ht=function(){return n},n}function ct(){var n=o(["\n\t\tgrid-template-columns: repeat(auto-fit, minmax(100px, 970px));\n\t"]);return ct=function(){return n},n}function lt(){var n=o(["\n\t\tjustify-content: center; \n\t\tgrid-template-columns: repeat(auto-fit, minmax(100px, 750px));\n\t"]);return lt=function(){return n},n}function o(n,t){return t||(t=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(t)}}))}function a(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");}var p;Object.defineProperty(n,"__esModule",{value:!0});n.default=void 0;t=w(t);i=w(i);r=c(r);u=c(u);f=c(f);e=c(e);p=void 0;var at={tablet:769,midsize:992,desktop:1200},s=Object.keys(at).reduce(function(n,t){var r=this;return a(this,p),n[t]=function(){return a(this,r),i.css(["@media (min-width:","px){","}"],at[t],i.css.apply(void 0,arguments))}.bind(this),n}.bind(void 0),{}),bt=i.default.header.withConfig({displayName:"Header__HeaderElement",componentId:"j1l00r-0"})(["position:relative;background-color:#FFFFFF;"]),kt=i.default.div.withConfig({displayName:"Header__Container",componentId:"j1l00r-1"})(["display:-ms-grid;display:grid;-ms-grid-columns:1fr;"," "," ",""],s.tablet(lt()),s.midsize(ct()),s.desktop(ht())),dt=i.default.div.withConfig({displayName:"Header__Grid",componentId:"j1l00r-2"})(["-ms-grid-column:1;display:-ms-grid;display:grid;-ms-grid-rows:auto auto;grid-template-rows:1fr auto;-ms-grid-columns:38px 1fr;grid-template-columns:38px 1fr;position:relative;width:100%;margin:0 auto;"," "," ",""],s.tablet(st()),s.midsize(ot()),s.desktop(et())),gt=i.default.div.withConfig({displayName:"Header__Logo",componentId:"j1l00r-3"})(["-ms-grid-row:1;-ms-grid-column:1;a{position:relative;z-index:1000;display:block;background-color:#FFF;padding:6px 15px;border-bottom-right-radius:10px;","}img{height:36px;width:auto;","}"],s.tablet(ft()),s.tablet(ut())),ni=i.default.div.withConfig({displayName:"Header__Main",componentId:"j1l00r-4"})(["-ms-grid-row:1;-ms-grid-column:2;-ms-grid-row-align:center;-ms-grid-column-align:end;justify-self:right;display:-ms-grid;display:grid;-ms-grid-columns:auto 1fr;grid-template-columns:auto auto;grid-column-gap:10px;.hamburger{order:2;","}.searchbar{order:1;","}"],s.tablet(rt()),s.tablet(it())),ti=i.default.div.withConfig({displayName:"Header__Sub",componentId:"j1l00r-5"})(["position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;background-color:#FFFFFF;-ms-grid-row:2;-ms-grid-column:2;-ms-grid-column-span:2;grid-column-start:2;grid-column-end:span end;"," .statline-addition{position:absolute;z-index:1;bottom:5px;display:inline-block;background-color:#FFFFFF;border-radius:8px;border-bottom-left-radius:13px;"," a{display:inline-block;background-color:white;padding:6px 7px 6px 15px;border-radius:8px;color:#163a72;font-family:'Soho W01',sans-serif;font-size:16px;font-weight:bold;text-decoration:none;","}span{display:inline-block;margin:6px 0 8px;color:#163a72;font-family:'Akko Regular W01',Helvetica,Arial,sans-serif;font-size:16px;font-weight:bold;","}}"],s.tablet(tt()),s.tablet(nt()),s.tablet(g()),s.tablet(d())),ii=function(n){function i(n,t){var u=this,r;return vt(this,i),r=pt(this,v(i).call(this,n,t)),k(h(h(r)),"toggleNavMenu",function(){a(this,u);r.setState({showMenu:!r.state.showMenu,showSearch:!1,changeSearchButton:!1,changeNavButton:!r.state.changeNavButton})}.bind(this)),k(h(h(r)),"toggleSearchbarMenu",function(){a(this,u);r.setState({showSearch:!r.state.showSearch,showMenu:!1,changeNavButton:!1,changeSearchButton:!r.state.changeSearchButton})}.bind(this)),r.state={showMenu:!1,showSearch:!1,changeNavButton:!1,changeSearchButton:!1},r}return wt(i,n),yt(i,[{key:"render",value:function(){var n=null;return this.props.headerproperties.appAdditionalTitle&&this.props.headerproperties.appAdditionalTitle.length>0&&(n=t.default.createElement("span",null,this.props.headerproperties.appAdditionalTitle)),t.default.createElement(bt,{className:"header"},t.default.createElement(kt,{className:"box"},t.default.createElement(dt,{className:"grid"},t.default.createElement(gt,{className:"grid-item logo-area"},t.default.createElement("a",{href:this.props.headerproperties.homeUrl},t.default.createElement("img",{src:"Content/image/cbs.svg",alt:"CBS logo"}))),t.default.createElement(ni,{className:"grid-item main-area"},t.default.createElement(f.default,{changeButton:this.state.changeNavButton,showMenu:this.state.showMenu,toggleNavCallback:this.toggleNavMenu,headerproperties:this.props.headerproperties}),t.default.createElement(e.default,{changeButton:this.state.changeSearchButton,showSearch:this.state.showSearch,toggleSearchCallback:this.toggleSearchbarMenu,search:this.props.search})),t.default.createElement(ti,{className:"grid-item nav-area"},t.default.createElement("div",{className:"statline-addition"},t.default.createElement("a",{href:this.props.headerproperties.homeUrl,className:"statline"},this.props.headerproperties.appTitle),n)))))}}]),i}(t.Component),ri=ii;n.default=ri}),function(n,t){if(typeof define=="function"&&define.amd)define(["exports","react","reactdom","header"],t);else if(typeof exports!="undefined")t(exports,require("react"),require("reactdom"),require("header"));else{var i={exports:{}};t(i.exports,n.React,n.ReactDOM,n.Header);n.headerDirective=i.exports}}(this,function(n,t,i,r){"use strict";angular.module("CbsDirectives").directive("headerdirective",["$filter","$rootScope","$state","$stateParams","$sce","$translate","$q",function(){var n=function(n,u){function f(){}function e(){n.$watchGroup(["headerproperties","search"],function(n){var f=n[0],e=n[1],o;angular.isDefined(f)&&angular.isDefined(e)&&(o=t.createElement(r.default,{headerproperties:f,search:e}),i.render(o,u[0]))},!0)}f();e()};return{restrict:"E",scope:{headerproperties:"=",navmenu:"=",search:"="},template:"<div><\/div>",link:n}}])}),function(n,t){if(typeof define=="function"&&define.amd)define(["exports","react","styled-components"],t);else if(typeof exports!="undefined")t(exports,require("react"),require("styled-components"));else{var i={exports:{}};t(i.exports,n.React,n.styled);n.Footer=i.exports}}(this,function(n,t,i){"use strict";function l(n){var i,t,r;if(n&&n.__esModule)return n;if(i={},n!=null)for(t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(n,t):{},r.get||r.set?Object.defineProperty(i,t,r):i[t]=n[t]);return i.default=n,i}function e(n){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e(n)}function rt(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function a(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function ut(n,t,i){return t&&a(n.prototype,t),i&&a(n,i),n}function ft(n,t){return t&&(e(t)==="object"||typeof t=="function")?t:h(n)}function o(n){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},o(n)}function et(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&s(n,t)}function s(n,t){return s=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},s(n,t)}function h(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ot(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function v(){var n=r(["\n\t\tpadding-bottom: 3px;\t\n\t\tfont-size: 16px;\n\t"]);return v=function(){return n},n}function y(){var n=r(["\n\t\t\tdisplay:-ms-grid;\n\t\t\tdisplay: grid;\n\t\t"]);return y=function(){return n},n}function p(){var n=r(["\n\t\tfont-size: 26px;\n\t"]);return p=function(){return n},n}function w(){var n=r(["\n\t\tmax-width: 1170px;\n\t"]);return w=function(){return n},n}function b(){var n=r(["\n\t\tmax-width: 970px;\n\t"]);return b=function(){return n},n}function k(){var n=r(["\n\t\t-ms-grid-columns: 1fr auto auto;\n\t\tgrid-template-columns: 1fr auto auto;\n\t\tmax-width: 750px;\n\t"]);return k=function(){return n},n}function d(){var n=r(["\n\t\tgrid-template-columns: repeat(auto-fit, minmax(100px, 1170px));\n\t"]);return d=function(){return n},n}function g(){var n=r(["\n\t\tgrid-template-columns: repeat(auto-fit, minmax(100px, 970px));\n\t"]);return g=function(){return n},n}function nt(){var n=r(["\n\t\tjustify-content: center; \n\t\trepeat(auto-fit, minmax(100px, 750px));\n\t"]);return nt=function(){return n},n}function r(n,t){return t||(t=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(t)}}))}function f(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");}var c;Object.defineProperty(n,"__esModule",{value:!0});n.default=void 0;t=l(t);i=l(i);c=void 0;var tt={tablet:769,midsize:992,desktop:1200},u=Object.keys(tt).reduce(function(n,t){var r=this;return f(this,c),n[t]=function(){return f(this,r),i.css(["@media (min-width:","px){","}"],tt[t],i.css.apply(void 0,arguments))}.bind(this),n}.bind(void 0),{}),st=i.default.footer.withConfig({displayName:"Footer__FooterElement",componentId:"sc-16mhux7-0"})(["background-color:#FFFFFF;padding:5px 15px;border-top:1px solid #DFE8FO;color:#163a72;"]),ht=i.default.div.withConfig({displayName:"Footer__Container",componentId:"sc-16mhux7-1"})(["display:-ms-grid;display:grid;-ms-grid-columns:1fr;gridtemplate-columns:1fr;justify-content:stretc;"," "," ",""],u.tablet(nt()),u.midsize(g()),u.desktop(d())),ct=i.default.div.withConfig({displayName:"Footer__Grid",componentId:"sc-16mhux7-2"})(["-ms-grid-column:1;display:-ms-grid;display:grid;-ms-grid-columns:auto 0 auto;grid-template-columns:auto 0 auto;position:relative;width:100%;margin:0 auto;"," "," ","\t"],u.tablet(k()),u.midsize(b()),u.desktop(w())),lt=i.default.div.withConfig({displayName:"Footer__Slogan",componentId:"sc-16mhux7-3"})(["-ms-grid-column:1;font-family:'Akko Regular W01',Helvetica,Arial,sans-serif;font-size:14px;","\t"],u.tablet(p())),at=i.default.nav.withConfig({displayName:"Footer__Nav",componentId:"sc-16mhux7-4"})(["-ms-grid-column:2;-ms-grid-row-align:center;ul{display:-ms-grid;display:none;-ms-grid-columns:auto auto auto;grid-template-columns:auto auto auto;align-items:center;justify-items:stretch;height:100%;margin:0;list-style:none;text-align:center;","}"],u.tablet(y())),it=i.default.li.withConfig({displayName:"Footer__MenuItem",componentId:"sc-16mhux7-5"})(["\t a{position:relative;top:3px;padding:0 10px;color:#777;font-family:'Akko Regular W01',Helvetica,Arial,sans-serif;font-size:17px;font-weight:normal;line-height:17px;text-decoration:none;}&:first-child{-ms-grid-column:1;}&:nth-child(2){-ms-grid-column:2;}&:nth-child(3){-ms-grid-column:3;}"]),vt=i.default.div.withConfig({displayName:"Footer__Copyright",componentId:"sc-16mhux7-6"})(["-ms-grid-column:3;display:-ms-grid;-ms-grid-row-align:center;justify-self:end;align-self:center;font-family:'Akko Regular W01',Helvetica,Arial,sans-serif;font-size:12px;","\t\t span{position:relative;top:3px;s}"],u.tablet(v())),yt=function(n){function i(n){var r=this,t;return rt(this,i),t=ft(this,o(i).call(this,n)),ot(h(h(t)),"toggleLanguage",function(n){var i=this;f(this,r);n.preventDefault();t.setState({language:t.state.languages.filter(function(n){return f(this,i),n.toLowerCase()!==t.state.language.toLowerCase()?n:void 0}.bind(this))[0]})}.bind(this)),t.state={list:t.props.footerproperties.menu,language:t.props.footerproperties.languageToggleInitValue,payofftext:t.props.footerproperties.payOffText,copyrighttext:t.props.footerproperties.copyRightText,languages:t.props.footerproperties.languages},t}return et(i,n),ut(i,[{key:"render",value:function(){var n=this;return t.default.createElement(st,{className:"footer"},t.default.createElement(ht,{className:"box"},t.default.createElement(ct,{className:"grid"},t.default.createElement(lt,{className:"motto"},this.state.payofftext),t.default.createElement(at,null,t.default.createElement("ul",null,this.state.list.map(function(i){return(f(this,n),this.state.language!==undefined&&i.toggle!==undefined&&i.toggle===!0)?t.default.createElement(it,{key:i.objectID},t.default.createElement("a",{href:i.toggleButtons[this.state.language].url,onClick:this.toggleLanguage},i.toggleButtons[this.state.language].title)):t.default.createElement(it,{key:i.objectID},t.default.createElement("a",{href:i.url},i.title))}.bind(this)))),t.default.createElement(vt,{className:"copyright"},t.default.createElement("span",null,this.state.copyrighttext)))))}}]),i}(t.Component),pt=yt;n.default=pt}),function(n,t){if(typeof define=="function"&&define.amd)define(["exports","react","reactdom","footer"],t);else if(typeof exports!="undefined")t(exports,require("react"),require("reactdom"),require("footer"));else{var i={exports:{}};t(i.exports,n.React,n.ReactDOM,n.Footer);n.headerDirective=i.exports}}(this,function(n,t,i,r){"use strict";angular.module("CbsDirectives").directive("footerdirective",["$filter","$rootScope","$state","$stateParams","$sce","$translate","$q",function(){var n=function(n,u){function f(){}function e(){n.$watchGroup(["footerproperties"],function(n){var f=n[0],e;angular.isDefined(f)&&(e=t.createElement(r.default,{footerproperties:f}),i.render(e,u[0]))},!0)}f();e()};return{restrict:"E",scope:{footerproperties:"="},template:"<div><\/div>",link:n}}])}),function(){angular.module("CbsDirectives").directive("indelingenselect",["$filter","$translate","tableState",function(n,t,i){return{restrict:"AE",replace:!0,transclude:!1,scope:!0,templateUrl:"./app/components/indelingen.select.directive/indelingen.select.html",controller:["$rootScope","$scope","$element",function(r,u,f){var e=i.current.UserData,o=i.current.MetaData,d=o.TimeDimension,h=e.Collections[d],s={},c="",l="";u.dropdownClick=function(n){var t=$(n.target);(!t.hasClass("top-bar-button")||t.hasClass("disabled"))&&n.stopPropagation()};var g=function(){u.SelectIndeling=b;u.GetIndeling=rt;u.CanShowed=ut;u.GetHeaderTitle=et;u.getDimensionTitle=ft;u.GetIndelingTitle=ot;u.IsXaxisTime=tt;u.maxItems=settings.max_selectable_categories;u.ToggleSelect=at;u.SelectPeriod=vt;u.ApplyIndeling=it;u.initializeState=nt;u.ValidateRange=a;u.StartRange={};u.StartRange.Key=e.GetTimeStartValue(h);u.StartRange.Fill=v;u.EndRange={};u.EndRange.Key=e.GetTimeEndValue(h);u.EndRange.Fill=y;f.on("change","#startperiod",function(){var n=$(this).find(":selected").val();u.StartRange.Key=n;y(u.CurrentIndelingKey);a()});f.on("change","#endperiod",function(){var n=$(this).find(":selected").val();u.EndRange.Key=n;v(u.CurrentIndelingKey);a()})},nt=function(){e.Collections[e.XAxisDimension]&&e.Collections[e.XAxisDimension].Indeling&&(u.CurrentIndelingKey=e.Collections[e.XAxisDimension].Indeling);u.IsXaxisTime()&&(p(u.CurrentIndelingKey),c="",l="",u.StartRange.Key=e.GetTimeStartValue(h),u.EndRange.Key=e.GetTimeEndValue(h));u.selectionErrorMessage="";u.isRangeInvalid=!1;b(u.CurrentIndelingKey)},p=function(n){var t=e.GetValuesInTimeDimension(h,n),i=t.length;s={allKeys:t,defaultStartKey:i>11?t[i-12].Key:t[0].Key,defaultEndKey:t[i-1].Key,firstKey:t[0],lastKey:t[i-1]}},w=function(n,t,i){var r=i?'selected="selected" ':"";return"<option "+r+'value="'+n+'" label="'+t+'">'+t+"<\/option>"},v=function(n){var i=$("#startperiod"),r=ht(n),f=u.StartRange.Key.Key||u.StartRange.Key,o=e.GetTimeStartValue(h,n,f),t;i.empty();t="";_.forEach(r,function(n){t+=w(n.Key,n.Title,n.Key===o)});u.safeApply(function(){i.html(t)})},y=function(n){var i=$("#endperiod"),r=ct(n),f=u.EndRange.Key.Key||u.EndRange.Key,o=e.GetTimeEndValue(h,n,f),t;i.empty();t="";_.forEach(r,function(n){var i=n.Title;"Voorlopig"===n.Status&&(i+="*");"NaderVoorlopig"===n.Status&&(i+="**");t+=w(n.Key,i,n.Key===o)});u.safeApply(function(){i.html(t)})},tt=function(){return e.XAxisDimension===o.TimeDimension};u.safeApply=function(n){var t=this.$root.$$phase;t=="$apply"||t=="$digest"?n&&typeof n=="function"&&n():this.$apply(n)};var b=function(n){var t=u.CurrentIndelingKey!==n;u.safeApply(function(){u.CurrentIndelingKey=n});u.IsXaxisTime()&&(p(n),t&&(u.StartRange.Key=s.defaultStartKey,u.EndRange.Key=s.defaultEndKey),v(n),y(n),a())},it=function(){var i=u.CurrentIndelingKey,t=e.XAxisDimension,f=e.Collections[t].Gemeente,n;e.SetIndeling(t,i,f);u.IsXaxisTime()&&(n=k(u.CurrentIndelingKey),n.isValid&&(e.Collections[o.TimeDimension].StartValueKey=n.allSelected?"":u.StartRange.Key,e.Collections[o.TimeDimension].EndValueKey=n.allSelected?"":u.EndRange.Key));r.$broadcast("doRefresh",e)},rt=function(n){return e.XAxisDimension===""?"":o.Dimensions[e.XAxisDimension].Indelingen[n]},ut=function(){var n=[];return e.XAxisDimension===""?!1:(_.forEach(o.CollectionsData[e.XAxisDimension].Indelingen,function(t){n.push(t)}),n.length>0)},ft=function(){var t=e.XAxisDimension,n=o.CollectionsData[e.XAxisDimension];return n.Title},et=function(t){var i="";return(e.XAxisDimension===o.TimeDimension&&(i=t?"Periode":"x-as aanpassen"),e.XAxisDimension===o.GeoDimension&&(i="Regioindeling aanpassen"),e.XAxisDimension===o.GeoDetail&&(i="Regioindeling aanpassen"),i==="")?"":n("translate")("dictionary."+i)},ot=function(t){var i="";return(e.XAxisDimension===o.TimeDimension&&(i="timeCategories"),e.XAxisDimension===o.GeoDimension&&(i="geoCategories"),e.XAxisDimension===o.GeoDetail&&(i="geoCategories"),i==="")?"":n("translate")(i+"."+t)},st=function(){var n=[];return _.forEach(s.allKeys,function(t){lt(t.Key,u.StartRange.Key,u.EndRange.Key)&&n.push(t)}),n},ht=function(){var t=[],n=u.EndRange.Key.Key||u.EndRange.Key;return _.forEach(s.allKeys,function(i){(n===undefined||n===""||i.Key<n)&&t.push(i)}),t},ct=function(){var n=[],t=u.StartRange.Key.Key||u.StartRange.Key;return _.forEach(s.allKeys,function(i){(t===undefined||i.Key>t)&&n.push(i)}),n},a=function(){var n=k(u.CurrentIndelingKey);u.selectionErrorMessage=n.errorMessage;u.isRangeInvalid=!n.isValid},k=function(n){var i="",e=!0,r=u.StartRange.Key===""&&u.EndRange.Key==="",f;return r||(f=st(n),r=f.length===s.allKeys.length,f.length>u.maxItems&&!r&&(e=!1,i=t.instant("dictionary.SelectieTeGroot")+f.length+t.instant("dictionary.Van")+u.maxItems+t.instant("dictionary.Items"),i=i.substring(2,i.length))),{isValid:e,errorMessage:i,allSelected:r}},lt=function(n,t,i){return(t===undefined&&(t=""),t>n)?!1:i!==undefined&&i!==""?i>=n:!0},at=function(){u.SelectPeriod()?(c=u.StartRange.Key,l=u.EndRange.Key,u.StartRange.Key="",u.EndRange.Key=""):(c===""&&(c=s.firstKey),l===""&&(l=s.lastKey),u.StartRange.Key=c,u.EndRange.Key=l,v(u.CurrentIndelingKey),y(u.CurrentIndelingKey));a()},vt=function(){return u.StartRange.Key!==""||u.EndRange.Key!==""};g()}],link:function(n,t){t.on("show.bs.dropdown",n.initializeState);n.$on("doRefresh",function(){n.CanShowed()&&r()});var r=function(){n.UserIndelingKey=u();n.SortedIndelingen=f()},u=function(){return i.current.UserData.Collections[i.current.UserData.XAxisDimension].Indeling},f=function(){var t=i.current.MetaData.Dimensions[i.current.UserData.XAxisDimension].Indelingen,n=[];return _.forEach(t,function(t){t.Key!="NL"&&n.push(t)}),n.sort(function(n,t){return n.Position>t.Position?1:n.Position<t.Position?-1:0})};n.CanShowed()&&r()}}}])}(),function(){angular.module("CbsDirectives").directive("xaxselect",["$filter","$state","$translate","treeHelper","tableState",function(n,t,i,r,u){return{restrict:"AE",replace:!0,transclude:!1,scope:!0,templateUrl:"./app/components/xax.select.directive/xax.select.html",controller:["$rootScope","$scope",function(n,f){var e=null,s;f.dropdownClick=function(n){$target=$(n.target);($target.hasClass("form-inline")||$target.hasClass("panel-title")||$target.hasClass("container list-group-item")||$target.hasClass("list-group-wrapper")||$target.hasClass("selection-errormessage")||$target.hasClass("dropdown-menu")||$target.hasClass("tree-container"))&&n.stopPropagation()};f.filterTree=function(n){var e=$(n.target),i=$("#treeFilterTextXax")[0].value.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),t,u;i.length>=2?(t=new RegExp(r.AddDiacritics(i),"ig"),u="<mark>$&<\/mark>",s.filterNodes(function(n){return n.titleWithHighlight=n.title.replace(t,u),t.test(n.title)},{autoExpand:p()})):f.tree.clearFilter()};var p=function(){return f.tree.count()<f.maxItemsFilterExpand},w=function(){f.substate=t.current.name.split(".").slice(1,3).pop();f.AxisTitle=k;f.selectionErrorMessage="";f.selectedNodesAreInvalid=!1;f.showMultiSelectTreeview=b;f.closeMultiSelectTreeviewAndApply=it;f.maxItemsFilterExpand=settings.max_items_filter_expand},b=function(n){var i,t;$("#treeFilterTextXax")[0].value="";i=$(n.target).closest(".list-group-item").find("div.tree-container");t=u.current.UserData.XAxisDimension;t===u.current.MetaData.GeoDimension?nt(i,t):t!=="Topics"?g(i,t):tt(i)},k=function(){return u.current.MetaData.CollectionsData[u.current.UserData.XAxisDimension].Title},h=function(n){var t=[],i=n.getSelectedNodes();return $.map(i,function(n){var i=n.data.category;i&&t.push(n)}),t},c=function(n){var t=[],i=n.getSelectedNodes();return $.map(i,function(n){var i=n.data.topic;i&&t.push(n)}),t},d=function(n){var t=[];return _.forEach(n,function(n){var i=n.data.topic.Unit;t.push(i)}),_.uniq(t)},o=function(n){var t=n.getSelectedNodes(!0);$.map(t,function(n){n.fixSelection3FromEndNodes()})},g=function(n,t){var o,i,f,e;n.empty();n.off("click","ul li");o=u.current.MetaData.CollectionsData[u.current.UserData.XAxisDimension].Title;i=t===u.current.MetaData.TimeDimension?r.BuildTimeTree(u.current.MetaData.CollectionsData[t]):t===u.current.MetaData.GeoDimension?r.BuildGeoDimensionTree(u.current.MetaData.CollectionsData[t]):t===u.current.MetaData.GeoDetail?r.BuildGeoDetailTree(u.current.MetaData.CollectionsData[t]):r.BuildDimensionTree(t,null);f=[];e={id:0,root:!0,title:o,folder:!0,unselectable:!1,expanded:!0};e.children=i;f.push(e);i=f;l(n,i)},nt=function(n,t){n.empty();n.off("click","ul li");var f=u.current.MetaData.CollectionsData[u.current.UserData.XAxisDimension].Title,i;return r.BuildGeoDimensionTree(u.current.MetaData.CollectionsData[t],u.current.MetaData.GeoDimensionGroups).then(function(t){var r=[],u={id:0,root:!0,title:f,folder:!0,unselectable:!1,expanded:!0};u.children=t;r.push(u);i=r;l(n,i)})},l=function(n,t){var r=8,i,h;u.current.UserData.GraphType==="Map"&&(r=3);i=$("<div>");i.addClass("tree multiselect dimension");i.fancytree({extensions:["filter","glyph"],checkbox:!0,icons:!1,selectMode:3,autoScroll:!0,scrollParent:n,toggleEffect:{effect:"drop",options:{direction:"left"},duration:400},filter:{counter:!1,mode:"hide"},renderNode:function(n,t){t.node.li.firstChild.className.indexOf("fancytree-hide")!==-1&&$(t.node.li).addClass("fancytree-hide")},click:function(n,t){var i;if(y(),i=t.node,n.preventDefault(),n.stopPropagation(),t.node.folder&&t.targetType!=="checkbox")i.toggleExpanded(),n.preventDefault(),n.stopPropagation();else if(n.shiftKey){if(e===null||e.getParent()!==i.getParent())return e=i,!1;if(e!==i){for(var u=e,f=[],o=u.getIndex()>i.getIndex(),s=!i.isSelected();u!==null&&u!==i;)(u.match||!t.tree.enableFilter)&&f.push(u),u=o?u.getPrevSibling():u.getNextSibling();_.forEach(f,function(n){n.isSelected()!==s&&n.toggleSelected()})}e=null;v(i,t,r)}else e=i,v(i,t,r)},glyph:{map:{doc:"fa fa-file-o",docOpen:"fa fa-file-o",checkbox:"fa fa-square-o",checkboxSelected:"fa fa-check-square-o",checkboxUnknown:"fa fa-square",error:"fa fa-warning",expanderClosed:"fa fa-chevron-down",expanderLazy:"fa fa-angle-right",expanderOpen:"fa fa-chevron-up",folder:"fa fa-folder-o",folderOpen:"fa fa-folder-open-o",loading:"fa fa-spinner fa-pulse"}},source:t});f.tree=i.fancytree("getTree");h=u.current.UserData.Collections[u.current.UserData.XAxisDimension].Legend8;t=i.fancytree("getTree");_.forEach(h,function(n,i){var r=t.getNodeByKey(h[i].Key);r.setSelected();r.makeVisible();$(r.li).addClass("selected")});o(t);s=t;f.selectionErrorMessage="";f.selectedNodesAreInvalid=!1;i.appendTo(n)},tt=function(n){var c,h,l;n.empty();n.off("click","ul li");var w=i.instant("dictionary.Onderwerp"),t=r.BuildTopicsTree(null,!1,!1),v=[],p={id:0,root:!0,title:w,folder:!0,unselectable:!1,expanded:!0};p.children=t;v.push(p);t=v;c=8;u.current.UserData.GraphType==="Map"&&(c=3);h=$("<div>");h.addClass("tree multiselect");h.fancytree({extensions:["filter","glyph"],checkbox:!0,icons:!1,selectMode:3,autoScroll:!0,scrollParent:n,toggleEffect:{effect:"drop",options:{direction:"left"},duration:400},renderTitle:function(n,t){var i=t.node.data.topic;i&&(t.node.title=i.Title+'<span class="unit">'+i.Unit+"<\/span>",i.Datatype==="String"&&(t.node.title='<span class="grayedout">'+i.Title+'<\/span><span class="unit">'+i.Unit+"<\/span>"))},renderNode:function(n,t){t.node.li.firstChild.className.indexOf("fancytree-hide")!==-1&&$(t.node.li).addClass("fancytree-hide")},filter:{counter:!1,mode:"hide"},click:function(n,t){var i;if(y(),i=t.node,n.preventDefault(),n.stopPropagation(),i.folder&&t.targetType!=="checkbox")i.toggleExpanded();else if(i.unselectable)i.toggleExpanded();else if(n.shiftKey)if(e===null||e.getParent()!==i.getParent())e=i;else{if(e!==i){for(var r=e,u=[],f=r.getIndex()>i.getIndex(),o=!i.isSelected();r!==null&&r!==i;)(r.match||!t.tree.enableFilter)&&u.push(r),r=f?r.getPrevSibling():r.getNextSibling();_.forEach(u,function(n){n.isSelected()!==o&&n.toggleSelected()})}e=null;a(i,t,c)}else e=i,a(i,t,c)},glyph:{map:{doc:"fa fa-file-o",docOpen:"fa fa-file-o",checkbox:"fa fa-square-o",checkboxSelected:"fa fa-check-square-o",checkboxUnknown:"fa fa-square",error:"fa fa-warning",expanderClosed:"fa fa-chevron-down",expanderLazy:"fa fa-angle-right",expanderOpen:"fa fa-chevron-up",folder:"fa fa-folder-o",folderOpen:"fa fa-folder-open-o",loading:"fa fa-spinner fa-pulse"}},source:t});l=u.current.UserData.Collections.Topics.Legend8;t=h.fancytree("getTree");_.forEach(l,function(n,i){var r=t.getNodeByKey(l[i].Key);r.setSelected();$(r.li).addClass("selected")});o(t);s=t;f.selectionErrorMessage="";f.selectedNodesAreInvalid=!1;h.appendTo(n)},it=function(t){var s=$(t.target).closest(".dropdown-menu").find("div.tree"),e=s.fancytree("getTree"),o=u.current.UserData.Collections[u.current.UserData.XAxisDimension].Legend8.map(function(n){return n.Key}),i=[],r;if(f.selectedNodesAreInvalid)return t.stopPropagation(),t.preventDefault(),!1;r=u.current.UserData.XAxisDimension==="Topics"?c(e).map(function(n){return n.data.topic.Key}):h(e).map(function(n){return n.data.category.Key});_.forEach(r,function(n){$.inArray(n,o)===-1&&i.push(n)});_.forEach(o,function(n){$.inArray(n,r)===-1&&i.push(n)});u.current.UserData.ToggleCategoriesItems(i,u.current.UserData.XAxisDimension,"Legend8");n.$broadcast("doRefresh",u.current.UserData)},a=function(n,t,i){n.selected?$(n.li).removeClass("selected"):$(n.li).addClass("selected");n.toggleSelected();o(t.tree);rt(t.tree,i);f.$apply()},rt=function(n,t){var u=c(n),r=u.length,e;r<1?(f.selectedNodesAreInvalid=!0,f.selectionErrorMessage=i.instant("dictionary.SelectieTeKlein")+t+i.instant("dictionary.OnderwerpHAAKenHAAK")):r<=t?(f.selectionErrorMessage="",f.selectedNodesAreInvalid=!1):(f.selectionErrorMessage=i.instant("dictionary.SelectieTeGroot")+r+i.instant("dictionary.Van")+t+i.instant("dictionary.OnderwerpHAAKenHAAK"),f.selectedNodesAreInvalid=!0);e=d(u);e.length>1?(f.unitErrorMessage=i.instant("dictionary.OnderwerpenVerschillendeEenheid"),f.selectedUnitsAreInvalid=!0):(f.unitErrorMessage="",f.selectedUnitsAreInvalid=!1)},v=function(n,t,i){n.selected?$(n.li).removeClass("selected"):$(n.li).addClass("selected");n.toggleSelected();o(t.tree);ut(t.tree,i);f.$apply()},ut=function(n,t){var r=h(n).length;r<1?(f.selectedNodesAreInvalid=!0,f.selectionErrorMessage=i.instant("dictionary.SelectieTeKlein")+t+i.instant("dictionary.Items"),f.$apply()):r<=t?(f.selectionErrorMessage="",f.selectedNodesAreInvalid=!1,f.$apply()):(f.selectionErrorMessage=i.instant("dictionary.SelectieTeGroot")+r+i.instant("dictionary.Van")+t+i.instant("dictionary.Items"),f.selectedNodesAreInvalid=!0,f.$apply())},y=function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var n=window.getSelection();n.removeAllRanges()}};w()}],link:function(n){n.$on("doRefresh",function(){t()});var t=function(){};t()}}}])}(),function(){angular.module("CbsDirectives").directive("gemeentenselect",["$filter","$translate","treeHelper","tableState",function(n,t,i,r){return{restrict:"AE",replace:!0,transclude:!1,scope:!0,templateUrl:"./app/components/gemeenten.select.directive/gemeenten.select.html",controller:["$rootScope","$scope",function(n,t){var u=function(){t.SelectGemeente=e;t.GetGemeente=s;t.CanShowed=h;t.FilterGemeente=f;t.ApplyIndeling=o;t.CurrentGemeenteKey=r.current.UserData.Collections[r.current.MetaData.GeoDetail].Gemeente};t.clearFilter=function(){t.searchGemeente="";t.$digest()};t.dropdownClick=function(n){var t=$(n.target);t.hasClass("top-bar-button")||n.stopPropagation()};t.resetCurrentIndelingKey=function(){t.CurrentGemeenteKey=r.current.UserData.Collections[r.current.MetaData.GeoDetail].Gemeente};var f=function(n){var r,u,f;if(!n)return function(){return!0};if(r=n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),r.length>=2)return u=new RegExp(i.AddDiacritics(r),"ig"),f="<mark>$&<\/mark>",function(n){return n.titleWithHighlight=n.Title.replace(u,f),u.test(n.Title)};t.tree.clearFilter()},e=function(n){t.CurrentGemeenteKey=n},o=function(){var i=r.current.MetaData.GeoDetail,u=r.current.UserData.Collections[i].Indeling;r.current.UserData.SetIndeling(i,u,t.CurrentGemeenteKey);r.current.UserData.Collections[r.current.MetaData.GeoDetail].Gemeente=t.CurrentGemeenteKey;n.$broadcast("doRefresh",r.current.UserData)},s=function(n){return r.current.MetaData.Dimensions[r.current.MetaData.GeoDetail].Gemeenten[n]},h=function(){return r.current.MetaData.HasGeoDetail};u()}],link:function(t,i){i.on("hidden.bs.dropdown",t.clearFilter);t.$on("doRefresh",function(){t.CanShowed()&&u()});i.on("hide.bs.dropdown",function(){t.resetCurrentIndelingKey();t.$digest()});var u=function(){t.UserGemeenteKey=f();t.SortedGemeenten=e()},f=function(){return r.current.UserData.Collections[r.current.MetaData.GeoDetail].Gemeente},e=function(){var i=r.current.MetaData.Dimensions[r.current.MetaData.GeoDetail].Gemeenten,t=[];return _.forEach(i,function(n){t.push(n)}),n("orderBy")(t,"+Title")};t.CanShowed()&&u()}}}])}(),function(){angular.module("CbsDirectives").directive("graphbuttons",["$window",function(){return{restrict:"AE",replace:!0,transclude:!1,templateUrl:"./app/components/graphButtonsDirective/graphButtons.html",controller:["$rootScope","$scope","$state","$stateParams","$sce","$http","downloadService","$translate","tableState","$filter","$q","isStatFlowFrame","isInIframe","tableInfoService",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v){var w;if(t.metadata=s.current.MetaData,t.userdata=s.current.UserData,t.graphtype=s.current.UserData.GraphType,t.isStatFlowFrame=l,t.isInIframe=a,t.tooLargeForTable=s.current.UserData.GetSelection(s.current.UserData.GraphType)>2e4,t.SetGraphType=function(n,u){var f=s.current.MetaData,o=n==="Line"&&f.Line||n==="Bar"&&u===!1&&f.BarVertical||n==="Bar"&&u===!0&&f.BarHorizontal||n==="Map"&&f.Map||n==="Table",e;o&&(e=$.extend({},r,{ts:Date.now().toString()}),t.graphtype=n,n==="Bar"?(t.substate=u?"barh":"barv",i.go("^."+t.substate,e)):i.go("^."+n.toLowerCase(),e),y())},t.isFullscreenEnabled=screenfull.enabled,t.fullScreenTooltip=function(){return screenfull.isFullscreen?o.instant("dictionary.ExitFullscreenTooltip"):o.instant("dictionary.FullscreenTooltip")},t.toggleFullscreen=function(){screenfull.toggle(document.body)},t.screenStateIcon=function(){return screenfull.isFullscreen?"fa-compress":"fa-expand"},w=function(){var i=$("html");screenfull.isFullscreen&&!i.hasClass("fullscreen")&&i.addClass("fullscreen");screenfull.isFullscreen||i.removeClass("fullscreen");n.$broadcast("doRefresh",t.userdata);t.$digest()},screenfull.enabled){$(document).off(screenfull.raw.fullscreenchange);$(document).on(screenfull.raw.fullscreenchange,w)}var b="",y=function(){var n=s.current.UserData.GetSelection(s.current.UserData.GraphType);n.count<1e6?(t.downloadTypedCSV=e.DownloadTypedCSV(),t.downloadUntypedCSV=e.DownloadUntypedCSV()):(t.downloadTypedCSV="",t.downloadUntypedCSV="");t.tooLargeForTable=n.count>2e4},k=function(){var n=o.instant("dictionary.TemplatePortal_Url").replace("{catalog}",s.current.MetaData.data.TableInfos.value[0].Catalog).replace("{identifier}",s.current.MetaData.data.TableInfos.value[0].Identifier);return u.trustAsHtml($("<span/>").html(n).text())},p=function(n){var t=c.defer(),u=settings.HOST_DEEPLINKS,i=n.split("?"),r;return this.csvType=i[0],r={Id:"",QueryString:i[1]},f.post(u,r).then(function(n){if(_.isUndefined(n.data.Id)){var i;i.message=o.instant("dictionary.errorSaveDeepLink");t.reject(i.message);throw i;}else t.resolve(this.csvType+"?dl="+n.data.Id)},function(n){n.message=o.instant("dictionary.errorResolveDeepLink");t.reject(n.message);throw n;}),t.promise};t.$on("updateDownloadLinks",function(){y()});t.$on("doRefresh",function(){y();t.getTableInfo()});y();t.downloadGraphAsPng=function(){t.downloadingPng=!0;e.DownloadGraphAsPng(s.current.UserData.GraphType,s.current.UserData.horizontal);t.downloadingPng=!1};t.downloadGraphAsSvg=function(){t.downloadingSvg=!0;e.DownloadGraphAsSvg(s.current.UserData.GraphType,s.current.UserData.horizontal);t.downloadingSvg=!1};t.downloadTableHTML=function(){e.DownloadTableHTML()};t.showTableInfo=function(n){t.showingTableInfo=!0;t.getTableInfo();$("#info-modal").modal();$("#info-modal .nav-pills a").click(function(n){n.preventDefault();$(this).tab("show")});n&&n!=="#tab1"?$("#info-modal .nav-pills a:last").click():$("#info-modal .nav-pills a:first").click();setTimeout(function(){$("#info-modal .modal-body a").attr("target","_blank");t.showingTableInfo=!1},0)};t.getTableInfo=function(){t.collapseCategories=function(n){return i.indexOf(n.Key)>-1?!1:n.childrenCount&&n.childrenCount>=500};var i=[];t.categoriesExpanded=function(){n.$broadcast("loader_hide")};t.showSpinner=function(){n.$broadcast("loader_show",$(".modal-content")[0])};t.showAllCategories=function(n){setTimeout(function(){t.$apply(function(){i.push(n.Key)})},100)};t.tableInfo=v()};t.downloadUntypedCSVasTinyUrl=function(){t.downloadTypedCSV!=""&&p(t.downloadUntypedCSV).then(function(n){window.location.href=n})};t.downloadTypedCSVasTinyUrl=function(){t.downloadTypedCSV!=""&&p(t.downloadTypedCSV).then(function(n){window.location.href=n})};t.downloadTableCSV=function(){e.DownloadCSVTable()};t.openDataPortal=function(){window.open(k(),"_blank")};t.print=function(){window.print()};t.copyLinkToCurrentView=function(n){var i=$("#shortUrlContainer"),t;i.select();t=document.execCommand("copy");t&&$("#linkcopied").show();n.stopPropagation()};t.fillLinkBox=function(){var n=s.GetSelectionUrl();b!=n&&$("#linkcopied").hide();b=n;p(n).then(function(n){var t=$("#shortUrlContainer"),i=$("#shortUrlLink a");i.text(n);i.attr("href",n);t.val(n);t.select()})};t.isIOS=/iPad|iPhone|iPod/i.test(navigator.userAgent)&&!window.MSStream;t.substate=i.current.url.replace("/","");t.preventNavigationAndClosing=function(n){n.preventDefault()}}]}}])}(),function(){angular.module("CbsDirectives").directive("themetreecolumn",["$stateParams","$location","$state","treeHelper","catalog","$q","$translate",function(n,t,i,r,u,f,e){return{restrict:"E",replace:!1,transclude:!1,scope:{themaboom:"="},templateUrl:"./app/components/thema/themeTreeColumn.html",controller:["$scope",function(){var n=function(){};n()}],link:function(t){var a=t.themaboom,o=[],v=n._la,k=n._catalog,y=$(window).width(),p=function(n,t,i){var u=[],r,f=_.isNull(n)?null:n.ID,e=a.ThemeTable[f];return e!==undefined&&_.forEach(e,function(t){r={tableIdentifier:t.TableIdentifier,id:t.ID,key:t.ID,"data-item":t.TableIdentifier,isTable:!0,parentID:f,parent:n,parentNode:i};u.push(r)}),_.forEach(a.Themes,function(e){if(e.ParentID===f&&e.Language.toLowerCase()==v)if(r={id:e.ID,number:e.Number,title:e.Title,key:e.Key,isFolder:!0,unselectable:!0,parentID:f,parent:n,parentNode:i},t)r.lazy=!0,u.push(r);else{var o=p(e,t,r);r.children=o;r.expanded=!1;u.push(r)}}),u},d=function(n){var t=f.defer(),i=_.reduce(n,function(n,t){return t.isTable&&n.push(t.tableIdentifier),n},[]);return!_.isUndefined(i)&&i.length>0?u.getTables(k,v,i).then(function(i){var r=_.keyBy(_.get(i[0],"value"),function(n){return n.ID}),u=[];_.forEach(n,function(n){if(n.tableIdentifier!==undefined&&r[n.tableIdentifier]!==undefined){var t=_.clone(n);_.set(t,"table",r[n.tableIdentifier]);_.set(t,"title",r[n.tableIdentifier].Title);u.push(t)}else u.push(n)});t.resolve(u)}):t.resolve(n),t.promise},c=function(t,i,u){return d(t).then(function(t){var o=$("<ul/>").addClass("list-group"),h,s,c;if(ResponsiveBootstrapToolkit.is("xs")&&!_.isUndefined(i)){var l=$("<i/>").addClass("fa fa-angle-left fa-fw").attr("aria-hidden","true"),a=$("<span/>").text(!_.isNull(i)&&i.title?i.title:e.instant("dictionary.ZoekenOpThema")),f=$("<li/>").addClass("previous-item").on("click",i,ut);!_.isNull(i)&&i.title?l.appendTo(f):f.addClass("root");a.appendTo(f);f.appendTo(o)}return(_.isUndefined(i)||_.isNull(i))&&(h=n._la==="en"?"80580":"80578",s=_.findIndex(t,["number",h]),s>-1&&(c=_.pullAt(t,s),t=_.orderBy(t,["title"],["asc"]),t=_.concat(t,c))),_.forEach(t,function(n){if(n.isTable&&_.isUndefined(n.table))return!0;var i=$("<span/>").text(n.title),f=$("<span/>").addClass(n.isFolder?"fa fa-angle-right fa-fw":"fa fa-table fa-fw").attr("aria-hidden","true"),t=$("<li/>").addClass("list-group-item").addClass(n.isFolder?"folder":"table").addClass(n.id==u?"selected":"").on("click",n,it).attr("data-id",n.id);n.isFolder?(t.append(i),f.appendTo(t)):(n.isTable&&(t.attr("title",r.BuildTooltip(n.table)),t.attr("data-placement","auto"),$(t).tooltip()),f.appendTo(t),t.append(i));t.appendTo(o)}),o})},s=function(n,t){if(!_.isUndefined(n)&&!_.isNull(n))return c(n,null,t).then(function(n){$("#treeColumnTableContainer").append($("<div/>").append(n))})},h=function(n,t,i,r){if(!_.isUndefined(t)&&!_.isNull(t))return _.isNull(n)?c(t,i,r).then(function(n){$("#treeColumnTableContainer").find("div").first().replaceWith($("<div>").append(n))}):c(t,i,null).then(function(t){$(n.currentTarget).closest("div").replaceWith($("<div>").append(t))})},g=function(n){$(n).remove()},w=function(n){var t=n.data["data-item"],r=$.extend({},i.params,{tableId:t,ts:Date.now().toString()});i.go("app.tableUI",r);n.preventDefault();n.stopPropagation()},nt=function(n){if(_.isUndefined(n.data.children)||_.isNull(n.data.children)||n.data.children.length===0){n.data.unselectable||w(n);return}h(n,n.data.children,n.data,null)},tt=function(n){var t,i;if(_.isUndefined(n.data.children)||_.isNull(n.data.children)||n.data.children.length===0){n.data.unselectable||w(n);return}t=$(n.currentTarget).closest("div").nextAll();t.length>0&&t.remove();i=$("#treeColumnTableContainer div");i.length===4&&g(i[1]);s(n.data.children,null)},l=function(n,t){return _.isUndefined(n.parentNode)||_.isNull(n.parentNode)?t:(t.push(n.parentID),l(n.parentNode,t))},it=function(n){$(n.currentTarget).parent().children(".selected").removeClass("selected");$(n.currentTarget).addClass("selected");var r=_.toString(n.data.id),u=_.toString(n.data.number),t=l(n.data,[]);return(t.reverse(),t.push(r),i.go("app.navigatieScherm.thema",{themaNr:u},{notify:!1,location:"replace"}),ResponsiveBootstrapToolkit.is("xs"))?nt(n):tt(n)},rt=function(n){_.isNull(n.data)||(_.isNull(n.data.parentID)?h(n,o,null,null):h(n,n.data.parentNode.children,n.data.parentNode,null))},ut=function(n){if(ResponsiveBootstrapToolkit.is("xs"))return rt(n)},ft=function(n,t){var u=function(n,t){var i=_(n).thru(function(n){return _.union(n,_.map(n,"children"))}).flatten().find({id:t});return _.isNull(t)?n:i},r=[],i;return r.push(n),_.pull(t,_.head(t)),i=n,_.forEach(t,function(n){i=u(i.children,n);r.push(i)}),r},et=function(n,t){function r(n,t){_.forEach(n,function(n){n.children&&r(n.children,t);n.number===t&&i.push(n)});return}var i=[];return r(n,t),i.length>0?i[0]:null},ot=function(n,t){var o=_(n).find({id:_.head(t)}),c=ft(o,t),i=_.takeRight(c,3),u=i[0],l=i[1]||null,f=i[1],a=i[2]||null,e=i[2],v=i[3]||null,r=function(n,t){return _.isNull(t)?ResponsiveBootstrapToolkit.is("xs")?h(null,n.children,n,null):s(n.children,null):ResponsiveBootstrapToolkit.is("xs")?h(null,n.children,n,t.id):s(n.children,t.id)};_.isUndefined(u)||r(u,l).then(function(){_.isUndefined(f)||r(f,a).then(function(){_.isUndefined(e)||r(e,v)})})},b;t.init=function(){var i,t,r;if(o=p(null,!1),!_.isUndefined(n.themaNr)&&(i=et(o,n.themaNr),!_.isNull(i)&&(t=l(i,[i.id]).reverse(),_.isArray(t)&&t.length>0))){r=_(o).find({id:_.head(t)});s(o,r.id);ot(o,t);return}s(o,null)};b=function(){var n=$(window).width();y!==n&&(y=n,$("#treeColumnTableContainer").find("div").remove(),t.init())};$(window).on("resize",null,b);t.init()}}}])}(),function(){"use strict";function n(n,t,i,r,u,f,e){n.setMeta=function(){e.setMeta("title",r.instant("meta.Thema.title"));e.setMeta('name="description"',r.instant("meta.Thema.desc"))};var s=t.current,h=u,c=i._la,o=function(){n.setMeta();n.themaBoom=u};o()}angular.module("CbsApp").controller("ThemaController",n);n.$inject=["$scope","$state","$stateParams","$translate","themaBoom","CacheService","MetaService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c){var l=this,a,v;l.setMeta=function(){c.setMeta("title",e.instant("meta.Zoeken.title"));c.setMeta('name="description"',e.instant("meta.Zoeken.desc"))};e.proposedLanguage()!==undefined?a=t.$on("$translateChangeSuccess",function(){l.setMeta();a()}):l.setMeta();n.initialVisible=!1;var b=r.current,y={"fa-table":"Table","cbs-lijn":"Line","cbs-staven-gekanteld":"Bar","cbs-staven":"Bar","cbs-land":"Map"},p=e.instant("dictionary.Tijdvak"),w=e.instant("dictionary.Gewijzigd op");n.$parent.search=function(i){var r,e=i||n.currentpage||u.page||1;return t.lastNavPath=f.url(),u.searchKeywords=undefined,u._catalog&&u._la&&n.searchKeywords?(u.searchKeywords=n.searchKeywords,n.searchKeywordsCurrent=n.searchKeywords,s.GetSearchResults(u._catalog,u._la,n.searchKeywords,e,n.selectedFacets).then(function(t){return r=Math.ceil(t.response.numFound/10),n.searchResults=t,n.lastpage=+r,n.currentpage=+e,r<=10?n.pages=_.range(1,r+1):(n.currentpage<=6&&(n.pages=_.range(1,11)),n.currentpage>6&&(n.pages=_.range(n.currentpage-5,n.currentpage+5)),n.currentpage>r-9&&(n.pages=_.range(r-9,r+1))),t},function(t){n.value="Error: "+t}).finally(function(){})):void 0};n.pager=function(t){n.currentpage=t;r.go("app.navigatieScherm.zoeken",{page:t},{notify:!1,location:"replace"});n.search()};n.isFilterVisible=function(){return $("#facets").is(":visible")};n.showFilter=function(){$("#facets").show()};n.hideFilter=function(){$("#facets").hide()};n.initController=function(){l.setMeta();n.themaBoom=h;n.$parent.searchKeywords=u.searchKeywords;_.isUndefined(u["theme[]"])&&_.isUndefined(u["geo[]"])&&_.isUndefined(u["year[]"])||(n.initialVisible=!0,n.showFilter());$("#search-text").focus()};n.amIxs=function(){return ResponsiveBootstrapToolkit.is("xs")&&!n.initialVisible};n.gotoDataSet=function(n){var f=$(n.target),s=f.closest("li"),o=s.attr("data-item"),t="app.tableUI",i,e;_.forEach(y,function(n,r){f.hasClass(r)&&(t+=r==="cbs-staven-gekanteld"?".barv":r==="cbs-staven"?".barh":"."+n.toLowerCase(),i=n)});f.hasClass("icon")?e=$.extend({},u,{tableId:o,graphtype:i,ts:Date.now().toString()}):(i="Table",t="app.tableUI.table",e=$.extend({},u,{tableId:o,graphtype:i,ts:Date.now().toString()}));r.go(t,e)};n.gewijzigdOpDatum=function(n){var t=new Date(n.substring(0,4),n.substring(5,7)-1,n.substring(8,10),n.substring(11,13),n.substring(14,16),0);return i.trustAsHtml(t.getDate()+" "+e.instant("month."+t.getMonth())+" "+t.getFullYear())};n.gewijzigdOp=function(){return i.trustAsHtml(w+":")};n.verslagPeriodeDatum=function(n){return i.trustAsHtml(n)};n.verslagPeriode=function(){return i.trustAsHtml(p+":")};n.iconsFromGraphTypes=function(n){var t=n?n.split(","):[],i=[];return t&&$.grep(t,function(n){return n.toLowerCase()=="map"}).length>0&&i.push("cbs-land"),i};t.searchKeywords=u.searchKeywords;n.$on("$locationChangeSuccess",function(){n.searchKeywords!==r.params.searchKeywords&&(n.searchKeywords=t.searchKeywords=r.params.searchKeywords,n.$parent.search(1))});n.$on("$searchByKeyword",function(t,i){n.searchKeywords=t.targetScope.searchKeywords;n.searchByKeyword(i)});n.searchByKeyword=function(i){(!i||i.which===13||i.resetFacets)&&(n.$parent.selectedFacets={PublicationThemeID:[],GeoFacet:[],TimeFacet:[]},n.$parent.expandedThemes=[],i.resetFacets||r.go("app.navigatieScherm.zoeken",{searchKeywords:t.searchKeywords,page:1,"geo[]":[],"year[]":[]},{notify:!0}),_.isUndefined(n.$parent.selectedNode)?n.$parent.search(1):n.$parent.unSelectNode(n.$parent.selectedNode))};v=function(){n.isFilterVisible()||ResponsiveBootstrapToolkit.is("xs")||n.showFilter()};$(window).on("resize",null,v);n.initController()}angular.module("CbsApp").controller("ZoekenController",n);n.$inject=["$scope","$rootScope","$sce","$state","$stateParams","$location","$translate","CacheService","searchService","themaBoom","MetaService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o){var s=this,h;s.setMeta=function(){e.setMeta("title",r.instant("meta.Recent.title"));e.setMeta('name="description"',r.instant("meta.Recent.desc"))};var k=t.current,c=i._la,l=i._catalog,a=function(){return r.instant("dictionary.Frequentie")+":"},v=function(){return r.instant("dictionary.Periode")+":"},y=function(){var n=u.defer();return o.getChangedTablesLastMonthUntilNow(l,c).then(function(t){n.resolve(p(t[0].value))},function(t){n.reject(t)}),n.promise},p=function(n){return _.map(n,function(n){var t=w(n);return _.assign(n,{SummaryWithPeriodAndFreq:t.join(" ")}),n})},w=function(n){var t=a(),i=v();return[n.Summary,"<br>",t,n.Frequency+",",i,n.Period]},b=function(n,r){var u=$.extend({},i,{tableId:r.ID,graphtype:"Table",ts:Date.now().toString()});t.go("app.tableUI.table",u)};n.recentTables=[];n.gotoDataSet=b;h=function(){return s.setMeta(),y().then(function(t){n.recentTables=t},function(){n.recentTables=[]})};h()}angular.module("CbsApp").controller("RecentFiguresController",n);n.$inject=["$scope","$state","$stateParams","$translate","$q","CacheService","MetaService","catalog"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){var c=this,l;c.setMeta=function(){o.setMeta("title",r.instant("meta.Help.title"));o.setMeta('name="description"',r.instant("meta.Help.desc"))};var p=t.current,a=i._la,v=i._catalog,y=function(){var t=u.defer(),i=settings.HOST_ODATA_SITECORE,n=settings.catalogs[v].helpPageId;return(_.isUndefined(n)||_.isNull(n))&&(n="9650e2e7-766c-4473-a300-6dadd8fb3427"),h.getPageByUniqueId(i,a,n).then(function(n){var i=n.value[0];t.resolve(i)}),t.promise};n.title="";n.body="";l=function(){return c.setMeta(),y().then(function(t){n.title=f.trustAsHtml(t.Title);n.body=f.trustAsHtml(t.Body)})};l()}angular.module("CbsApp").controller("HelpController",n);n.$inject=["$scope","$state","$stateParams","$translate","$q","$sce","CacheService","MetaService","catalog","sitecoreService"]}(),function(){"use strict";angular.module("CbsDirectives").directive("facets",["$state","$stateParams","$translate","catalog",function(n,t,i){return{restrict:"E",replace:!0,templateUrl:"./app/components/zoeken/facets.html",link:function(r){var u=r.$parent,f=t._la,e=t._catalog;r.shapeFacets=function(){var f,e,u,n,t;r.facets={};f={};n="";_.each(r.searchResults.facet_counts.facet_fields.TimeFacet,function(t,i){if(i&1){t>0&&(f[n]={count:t,year:n});return}n=t});r.facets.years=_.orderBy(f,function(n){return"Prognose"==n.year?-Number.MAX_VALUE:-parseInt(n.year)});e={};n="";_.each(r.searchResults.facet_counts.facet_fields.GeoFacet,function(t,r){if(r&1){var f;"W&B"==n&&(u=0,f=i.instant("geoCategories.WK")+" & "+i.instant("geoCategories.BU"));"GM"==n&&(u=1,f=i.instant("geoCategories.GM"));"PV"==n&&(u=2,f=i.instant("geoCategories.PV"));"other"==n&&(u=3,f=i.instant("geoCategories.%%"));e[n]={id:n,count:t,region:f,order:u};return}n=t});r.facets.regions=_.orderBy(e,function(n){return n.order});var o=function(n){return _.forEach(n,function(n){_.isUndefined(n.count)||n.count!=0?n.children&&(n.children=o(n.children)):n.hidden=!0}),n},h=function(n){var t=function(n){if(n.hidden&&(n.hidden=!1),n.children&&_.each(n.children,function(n){t(n)}),n.root)return n;var i=n.parentNode;i&&n.children&&n.children.length>0&&(i.count+=n.count)};return t(n)},s=function(n,t){return _.chain(n).map(function(n){var i=1e5,r=i-n.count;return t&&("Archief"==n.title||"Archive"==n.title)&&(r=i+1),n.order=r,n}).sortBy("title").sortBy("order").each(function(n){n.children&&(n.children=s(n.children,!1))}).value()};r.themeLookup={};n="";_.each(r.searchResults.facet_counts.facet_fields.PublicationThemeID,function(t,i){if(i&1){r.themeLookup[n]={count:t,theme:n};return}n=t});t={children:r.buildTreeSource(null,null),root:!0};t=h(t);t.children=o(t.children);t.children=s(t.children,!0);r.facets.themes=t};r.buildTreeSource=function(n,i){var u=function(n,i){var e=[],f,o=r.themaBoom.ThemeTable[n];return _.isUndefined(o)||_.forEach(o,function(t){t!==undefined&&t.TableIdentifier!==undefined&&(f={parentNode:i,parent:n,tableIdentifier:t.TableIdentifier},e.push(f))}),_.forEach(r.themaBoom.Themes,function(o){if(o.ParentID===n&&o.Language.toLowerCase()==t._la){var s=0;r.themeLookup[o.ID]&&(s=r.themeLookup[o.ID].count);f={id:o.ID,parentNode:i,parent:o.ParentID,title:o.Title,count:s,folder:!0};f.children=u(o.ID,f);t["theme[]"]&&f.id==t["theme[]"][0]&&(r.nodeFromURL=f);e.push(f)}}),e};return u(n,i)};r.isYearChecked=function(n){return _.includes(u.selectedFacets.TimeFacet,n)};r.isRegionChecked=function(n){return _.includes(u.selectedFacets.GeoFacet,n)};r.toggleYear=function(t){return u.selectedFacets.TimeFacet=_.indexOf(u.selectedFacets.TimeFacet,t)==-1?_.union(u.selectedFacets.TimeFacet,[t]):_.without(u.selectedFacets.TimeFacet,t),n.go("app.navigatieScherm.zoeken",{"year[]":u.selectedFacets.TimeFacet,page:1},{notify:!1,location:"replace"}),u.search(1)};r.toggleRegion=function(t){return u.selectedFacets.GeoFacet=_.indexOf(u.selectedFacets.GeoFacet,t)==-1?_.union(u.selectedFacets.GeoFacet,[t]):_.without(u.selectedFacets.GeoFacet,t),n.go("app.navigatieScherm.zoeken",{"geo[]":u.selectedFacets.GeoFacet,page:1},{notify:!1,location:"replace"}),u.search(1)};r.yearVisibleLimit=function(){return r.yearsVisible>r.yearsLimit&&r.yearsVisible<r.facets.years.length?r.yearsVisible=r.facets.years.length:r.yearsVisible};r.init=function(){r.yearsLimit=5;r.yearsVisible=5;u.selectedFacets={PublicationThemeID:[],GeoFacet:t["geo[]"]||[],TimeFacet:t["year[]"]||[]};u.search();r.$watch("searchResults",function(){r.searchResults&&r.shapeFacets()})};r.init()}}}])}(),function(){"use strict";angular.module("CbsDirectives").directive("themetree",["$stateParams","$location","$state",function(n,t,i){return{restrict:"E",replace:!0,templateUrl:"./app/components/zoeken/themetree.html",link:function(n){var t=n.$parent,r=n.$watch("nodeFromURL",function(t,i){var u=_.isUndefined(t)?"<new>":t.title,r=_.isUndefined(i)?"<old>":i.title;n.nodeFromURL&&u!==r&&r==="<old>"&&n.selectNode(n.nodeFromURL,!0)});n.isThemeHidden=function(i){return i.parent==null&&_.some(n.hiddenThemes,function(n){return n===i.id})?!0:i.hidden?!0:_.isNull(i.parent)?!1:!_.includes(t.expandedThemes,i.parent)};n.isNodeVisible=function(t){return t.hidden?(n.hiddenThemes=_.union(n.hiddenThemes,[t.id]),!1):!0};n.hasSubThemes=function(n){var t=0;return _.forEach(n.children,function(n){n.count&&(t+=n.count)}),t>0};n.isFiltered=function(){return t.selectedNode!=null};n.selectNode=function(u){var f,e,o,s,h;return r(),t.selectedNode=u.id,f=[],e=function(n){_.each(n,function(n){f.push(n.id);n.children&&e(n.children)})},e(n.facets.themes.children),n.hiddenThemes=_.union(n.hiddenThemes,f),o=[],s=function(t){n.hiddenThemes=_.without(n.hiddenThemes,t.id);o.push(t.id);t.parentNode&&s(t.parentNode)},s(u),t.expandedThemes=o,h=function(n){n.children&&(t.selectedFacets.PublicationThemeID=_.union(t.selectedFacets.PublicationThemeID,[n.id]),_.each(n.children,function(n){h(n)}))},t.selectedFacets.PublicationThemeID=[],h(u),i.go("app.navigatieScherm.zoeken",{"theme[]":t.selectedNode,page:1},{notify:!1,location:"replace"}),t.search(1)};t.unSelectNode=function(){return t.selectedNode=null,t.selectedFacets.PublicationThemeID=[],t.expandedThemes=[],n.hiddenThemes=[],i.go("app.navigatieScherm.zoeken",{"theme[]":[],page:1},{notify:!0,location:"replace"}),t.search(1)};n.init=function(){n.themeLimit=5;t.expandedThemes=[];n.hiddenThemes=[]};n.init()}}}])}(),function(){"use strict";function n(n,t,i,r,u,f,e){function s(n){var t="",i=6,r;return t=n||"",r=t.indexOf(" ",i),t.substr(i,r-i)||""}function c(n){var t="",u=n.indexOf(h)+h.length+1,f;return t=n.substr(u,n.length-u).replace(" ","T"),f=Date.parse(t),r("date")(f,i.instant("dictionary.BeschikbaarFormat"))||""}var o="",h="will be released at";o=f&&f.message?f.message:f||"";o.indexOf(i.instant("dictionary.TijdelijkNietBeschikbaar"))>0?(o=i.instant("dictionary.Publicatie")+" "+s(o)+i.instant("dictionary.TijdelijkNietBeschikbaarClient"),u=i.instant("dictionary.PublicatieNietBeschikbaarTitel")):o.indexOf(i.instant("dictionary.Vervallen"))>0?(o=i.instant("dictionary.Publicatie")+" "+s(o)+i.instant("dictionary.VervallenClient"),u=i.instant("dictionary.PublicatieNietBeschikbaarTitel")):o.indexOf(i.instant("dictionary.Gediscontinueerd"))>0?(o=i.instant("dictionary.Publicatie")+" "+s(o)+i.instant("dictionary.GediscontinueerdClient"),u=i.instant("dictionary.PublicatieNietBeschikbaarTitel")):o.indexOf(h)>0&&(o=i.instant("dictionary.Publicatie")+" "+s(o)+i.instant("dictionary.BeschikbaarClient")+c(o),u=i.instant("dictionary.PublicatieNietBeschikbaarTitel"));n.title=t.trustAsHtml(u);n.message=t.trustAsHtml(o);n.close=function(n){e(n,500)}}angular.module("CbsApp").controller("ErrorController",n);n.$inject=["$scope","$sce","$translate","$filter","title","error","close"]}()