text: function miuGridProcessor(){if("undefined"==typeof miuDomLib)throw new Error("MIU DOM Library is required for MIU Grid");var t=function(t){var e=t.className.split(" "),i=0;for(i=0;i<e.length;i++){var r=e[i];if(/miu-g-cell-[0-9]{0,1}(d[1-9]){0,1}/.test(r)){var l=r.replace("miu-g-cell-","");return l=l.replace("d","."),l=parseFloat(l,10)}}return 1},e=function(t){var e,i=document.querySelectorAll(t+" > .miu-g-in > .miu-g-cell"),r=0;for(r=0;r<i.length;r++)(e=document.createElement("div")).style.marginLeft="auto",e.style.marginRight="auto",miuDomLib.addClass(e,"miu-g-cell-in"),miuDomLib.wrap(i[r],e)},i=function(t){var e=document.createElement("div");e.style.marginLeft="auto",e.style.marginRight="auto",miuDomLib.addClass(e,"miu-g-in"),miuDomLib.wrap(t,e)},r=function(e,i,r,u,o,g,m,a){var n="responsive"===i,s=e.getAttribute("miu-g-selector"),d=miuDomLib.getStyleVal(e,"width")+5,c=Math.floor(d/(r+2*u));c<1&&(c=1);var f=d/c-2*u,b=u,p=document.querySelector(s+" > .miu-g-in"),h=Math.floor((f+1+2*b)*c);p.style.width=h+"px";var y=document.querySelectorAll(s+" > .miu-g-in > .miu-g-cell"),A=!1,v=0;for(v=0;v<y.length;v++)if(1!=t(y[v])){A=!0;break}m&&"autofill"===g&&!A&&(console.log("Full responsive is useless in autofill display mode without multicol and/or splitted cs! Disabling..."),m=!1,e.setAttribute("miu-g-fullresp",m),console.log("Full responsive disabled!"));var w=document.querySelectorAll(s+" > .miu-g-in > .miu-g-cell > .miu-g-cell-in"),L=[],x=0,D=0;for(v=0;v<w.length;v++){var S=w[v].parentNode,q=t(S);w[v].style.width=r*q+"px";var C=b*(q-1),V=miuDomLib.getStyleVal(S,"padding-left");V+=miuDomLib.getStyleVal(S,"padding-right"),V+=miuDomLib.getStyleVal(S,"border-left-width");var F=f*q+2*C-(V+=miuDomLib.getStyleVal(S,"border-right-width"));if(!m&&F<r&&(F=r),m&&F>=h-2*b&&(F=h-2*b,w[v].style.width=F+"px"),n&&(w[v].style.width=F+"px"),S.style.width=F+"px",S.style.height="auto",S.style.position="relative",S.style.marginLeft=b+"px",S.style.marginRight=b+"px",S.style.marginTop=o+"px",S.style.marginBottom=o+"px",S.style.cssFloat=a,m)if(D<c&&D+q>c){var G=(h-((f+L.length)*D+2*L.length*b))/L.length;C=0;for(C=0;C<L.length;C++)n&&(w[L[C].index].style.width=miuDomLib.getStyleVal(w[L[C].index],"width")+G+"px"),L[C].c.style.width=miuDomLib.getStyleVal(L[C].c,"width")+G+"px";L=[{index:v,c:S}],x=1,D=q}else D==c?(x=1,D=q,L=[{index:v,c:S}]):(D+=q,L[x++]={index:v,c:S})}if(m&&D<c){G=(h-((f+L.length)*D+2*L.length*b))/L.length,C=0;for(C=0;C<L.length;C++)n&&(w[L[C].index].style.width=miuDomLib.getStyleVal(w[L[C].index],"width")+G+"px"),L[C].c.style.width=miuDomLib.getStyleVal(L[C].c,"width")+G+"px"}l(e,g,c,o,a)},l=function(t,e,i,r,l){"table"===e&&(u(t),o(t,i)),"autofill"===e&&(u(t),o(t,i),g(t,i,r,l))},u=function(t){var e=t.getAttribute("miu-g-selector"),i=document.querySelector(e+" > .miu-g-in");miuDomLib.remChildsWithClass(i,"miu-clr")},o=function(e,i){if(i>1){var r=e.getAttribute("miu-g-selector"),l=document.querySelector(r+" > .miu-g-in"),u=document.querySelectorAll(r+" > .miu-g-in > .miu-g-cell"),o=0,g=0;for(o=0;o<u.length;o++){var m=u[o],a=t(m);g+a>i?(l.insertBefore(miuDomLib.getClr(),m),g=a):g+=a}}},g=function(e,i,r,l){if(i>1){var u=e.getAttribute("miu-g-selector"),o=(document.querySelector(u+" > .miu-g-in"),document.querySelectorAll(u+" > .miu-g-in > .miu-g-cell"));if(o.length>1){var g=0,m=0;for(g=0;g<o.length;g++){if(1!=t(o[g]))return console.log("Autofill blank spaces option is not supported for multicol and splitted c."),!1}var a=[];for(g=0;g<i;g++)a[g]=0;for(g=0;g<o.length;g+=i){var n=[],s=0;for(m=0;m<i;m++){(d=o[g+m])?(n[m]=miuDomLib.getStyleVal(d,"height"),s=s<n[m]?n[m]:s,a[m]>0&&(d.style.marginTop=-a[m]+"px")):n[m]=0}for(m=0;m<i;m++){var d;(d=o[g+m])&&(d.style.height=s+a[m]+"px",a[m]+=s-n[m]-r+miuDomLib.getStyleVal(d,"border-bottom-width"))}}}}};this.initGrid=function(t){if(t&&t.selector){var l=t.selector,u=document.querySelectorAll(l),o=0;for(o=0;o<u.length;o++){var g=u[o];if(!miuDomLib.hasClass(g,"miu-g")){var m=t.cwfixed?t.cwfixed:g.getAttribute("miu-g-cwfixed")?g.getAttribute("miu-g-cwfixed"):"fixed",a=t.refwidth?t.refwidth:g.getAttribute("miu-g-refwidth")?parseFloat(g.getAttribute("miu-g-refwidth"),10):200,n=t.lrgap?t.lrgap/2:g.getAttribute("miu-g-lrgap")?parseFloat(g.getAttribute("miu-g-lrgap"),10)/2:0,s=t.tbgap?t.tbgap/2:g.getAttribute("miu-g-tbgap")?parseFloat(g.getAttribute("miu-g-tbgap"),10)/2:0,d=t.display?t.display:g.getAttribute("miu-g-display")?g.getAttribute("miu-g-display"):"table",c=t.fullresp?t.fullresp:!!g.getAttribute("miu-g-fullresp")&&"true"==g.getAttribute("miu-g-fullresp"),f=t.ltr?t.ltr:g.getAttribute("miu-g-ltr")?g.getAttribute("miu-g-ltr"):"ltr";if(g){miuDomLib.addClass(g,"miu-g");var b="miu-g-"+(2475+document.querySelectorAll(".miu-g").length);miuDomLib.addClass(g,b);var p="."+b;g.setAttribute("miu-g-selector",p),g.setAttribute("miu-g-cwfixed",m),g.setAttribute("miu-g-refwidth",a),g.setAttribute("miu-g-lrgap",2*n),g.setAttribute("miu-g-btgap",2*s),g.setAttribute("miu-g-display",d),g.setAttribute("miu-g-fullresp",c),g.setAttribute("miu-g-ltr",f),f="rtl"===f?"right":"left",i(g),miuDomLib.addClr(g),e(p),r(g,m,a,n,s,d,c,f)}}}}},document.onreadystatechange=function(){if("interactive"===document.readyState){var t=document.querySelectorAll(".miu-g-container"),e=0;for(e=0;e<t.length;e++){var i=t[e];if(!miuDomLib.hasClass(i,"miu-g")){miuDomLib.addClass(i,"miu-g-ai");var l="miu-g-ai-"+(1356+e);miuDomLib.addClass(i,l),miuGrid.initGrid({selector:"."+l}),miuDomLib.remClass(i,l)}}window.onresize=function(t){var e=document.querySelectorAll(".miu-g"),i=0;for(i=0;i<e.length;i++){var l=e[i],u=l.getAttribute("miu-g-cwfixed"),o=parseFloat(l.getAttribute("miu-g-refwidth"),10),g=parseFloat(l.getAttribute("miu-g-lrgap"),10)/2,m=parseFloat(l.getAttribute("miu-g-btgap"),10)/2,a=l.getAttribute("miu-g-display"),n="true"===l.getAttribute("miu-g-fullresp"),s="rtl"===l.getAttribute("miu-g-ltr")?"right":"left";r(l,u,o,g,m,a,n,s)}}}}}var miuGrid=new miuGridProcessor;