(function(d){var e,o="";var a;var c=[];var s;var r=0;var q=false;var i=[];var j=jQuery.fn.css;jQuery.fn.css=function(w,y){var x=o+"display";var v=o+"position";var u=false,B=false;if(y){if(w==x&&y.indexOf('"')!=-1){u=true}else{if(w==v&&y.length==1){B=true}else{return j.apply(this,arguments)}}var A=this;var z;d.each(a,function(D,C){if(u){if(A.is(D)){z=D}}else{d.each(C.chars,function(E,F){if(A.is(F.selector)){z=F.selector}})}});d.each(i,function(C,D){if(D.selector==z){if(u){D.properties[x]=y}else{if(B){D.properties[v]=y}}}});b(i);k()}else{return j.apply(this,arguments)}};d.templateLayoutShowOnReady=function(){document.write("<style> body {visibility:hidden} </style>");q=true};d.setTemplateLayout=function(v,u){if(l()){p();return false}setTimeout(function(){d(window).resize(k)},100);if(typeof v=="string"){v={file:v}}if(u){v.prefix=u}if(v){if(v.prefix){o="-"+v.prefix+"-"}if(v.delay){r=v.delay}if(v.fallback){d("."+v.fallback).remove()}}if(!v){n()}else{e="";if(v.text){e=v.text;d("head").append("<style>"+e+"</style>")}if(v.file){d.get(v.file,function(w){e+=w;k()})}if(!v.file&&!e){n();return false}if(e){k()}}};d.redoTemplateLayout=k;function p(){if(q){d("body").css("visibility","visible");q=false}}function n(){var u=d("style");if(!u.length){return}if(u.text()){e=u.text();k()}else{d.get(document.location.href,function(w){var v=w.match(/<style.*?>([\s\S]*?)<\/style>/);e=v?v[1]:"";k()})}}function f(){e=e.replace(/\/\*[\s\S]*?\*\//g,"");var u=e.split("}");d.each(u,function(){var x=d.trim(this);if(!x){return}var v=h(x);if(!v){return}if(v.selector.indexOf(",")!=-1){var w=v.selector.split(",");d.each(w,function(y,z){i.push({selector:d.trim(z),properties:v.properties})})}else{i.push(v)}});return i}function h(y){if(y.indexOf("@")===0||y.indexOf("{")==-1){return false}var x=y.split("{");var w=d.trim(x[0]);var u=x[1].split(";");var v={};d.each(u,function(){var A=this.split(":");var z=d.trim(A[0]).toLowerCase();var B=d.trim(A[1]);v[z]=B});return{selector:w,properties:v}}function g(F){var C=F.replace(/\n|\r/g," ");var D=C.split('"');var I=[];var w=[];var z={};for(var y=2,x=D.length;y<x;y+=2){var u=D[y];var H="auto";if(u.indexOf("/")!=-1){var E=u.match(/\/\s*(\S+)(.*)/);H=d.trim(E[1])}if(d.trim(u)&&y==x-1){var G=d.trim(D[x-1]).replace(/^\/\s*\S+\s*/,"");if(G&&G.indexOf("/")==-1){if(G.indexOf("(")!=-1){var v=G.match(/minmax(\(.*?\))/g);d.each(v,function(K,J){var L=J.replace(/\s*/g,"");G=G.replace(J,L)})}G=G.replace(/\(\)/,"");w=G.split(/\s+/)}}var B=D[y-1].replace(/[^a-z@\.]/gi,"");B=d.trim(B).split("");d.each(B,function(){z[this]=true});if(H.indexOf("-")==0){return false}I.push({chars:B,height:H})}var A=I[0].chars.length;while(w.length>A){w.pop()}while(w.length<A){w.push("*")}return{rows:I,widths:w,chars:z}}function b(y){var x={};var v={};var u=0;var w=[];d.each(y,function(z,K){var I=K.properties;var D=K.selector;var A=o+"display";var C=o+"position";var G=false;if(D.indexOf("::slot(")!=-1){var H=D.match(/slot\((.)\)/);if(H&&H.length>1){var B=H[1];var J=D.split("::slot")[0];var F={};d.each(I,function(M,N){if(M.indexOf("background")==0||M.indexOf("overflow")!=-1||M.indexOf("vertical-align")!=-1){F[M]=N}});v[J+"|"+B]=F}}if(I[C]&&I[C].length==1){var E=I[C];x[D]={chr:E,props:I};G=true}else{if(I[C]=="same"){c.push(D)}}if(I[A]&&I[A].indexOf('"')!=-1){var L=g(I[A]);if(!L){return}w.push({sel:D,rows:L.rows,widths:L.widths,chars:L.chars,properties:I,pseudo_props:{},num:u,slotEl:G});u++}});w.sort(function(A,z){return !z.slotEl});d.each(w,function(A,z){a[z.sel]=z});d.each(x,function(D,F){var B=false;var E=false;d.each(a,function(G,I){if(G==D){x[G].tplEl=true}if(!I.chars[F.chr]){return}var H=d(D).parents();if(H.is(G)){var K;var J=0;H.each(function(){if(H[J]==d(G)[0]){K=J}J++});if(B===false||K<B){B=K;E=G}}});var z=F.tplEl||false;if(E){var A=E+"|"+F.chr;var C=v[A]||false;a[E].chars[F.chr]={selector:D,props:F.props,pseudo_props:C,tplEl:z,cur_sel:E}}})}function l(){var x='"@"';var w=d("<p></p>");var u=true;try{w.get(0).style.display=x}catch(v){u=false}u=(w.css("display")==x);w.remove();return u}function t(R,O){var Q=R.widths;var D=R.rows;var G=R.properties;var E=[],P=[];var x=d(O);var F=R.chars;d.each(F,function(S,T){if(T!==true){T.slot_w=1;T.slot_h=1}});R.margins=0;function K(V,U){var S=[];d.each(F,function(Y,Z){var X=Z.props.width||"auto";if(Z.col==V&&Z.slot_w==1){var W=A({width:X,top:"auto",left:"auto"},Z.el.clone()).w;S.push(W)}});var T=U.split("-")[0];return Math[T].apply({},S)}function A(V,T){var S=d("<div></div>");S.css({visibility:"hidden",margin:0,padding:0,position:"absolute"});if(T){S.append(T)}if(V){S.css(V)}x.append(S);var U={w:S.width(),h:S.height()};S.remove();return U}function H(V,T,X){var U="auto",S="auto";if(V=="h"){S=T}else{U=T;if(U=="min-content"||U=="max-content"){return K(X,U)}}var W=A({height:S,width:U});return W[V]}function I(V){var T=0;for(var U=V.row;U<V.slot_h+V.row&&U<P.length;U++){T+=P[U]}var S=parseInt(V.el.css("margin-top"));if(S<0){T-=S}return T}function M(T,S,V){var W=F[S].props[T]+"";var U=W;if(W.indexOf("%")!=-1&&T=="width"){U=V*parseInt(W)/100}return U}function y(X){var W=0;for(var T=X.col;T<X.slot_w+X.col;T++){W+=E[T]}var V=X.el.outerWidth(true)-X.el.width();if(V){W-=V}if(X.tplEl){if(D[X.row].height&&D[X.row].height!="*"){a[X.selector].properties.height=D[X.row].height}a[X.selector].properties.width=W;var U=new t(a[X.selector],X.selector);var S=U.make();X.genHeight=S.height;return S.width}return W}function w(T){var S=T.css("border-top-width");var U=T.clone();U.each(function(){d(this).css("position","static")});return A(0,U).h}function C(){if(R.slotEl){G.height=x.height()}if(G.height){x.height(G.height);var S=x.height()}else{var U=0}var V=0;var T=[];d.each(D,function(Y,Z){var X=0;d.each(F,function(ad,ae){if(ae.row==Y){if(ae.props.height){ae.el.height(ae.props.height)}else{ae.el.height("auto")}if(!T[Y]){T[Y]=0}var ac;if(ae.genHeight){ac=ae.genHeight}else{if(ae.slot_h==1){ac=w(ae.el)}else{var ab=w(ae.el)/ae.slot_h;for(var aa=Y;aa<ae.slot_h;aa++){T[aa]=ab}}}if(X<T[Y]){X=T[Y]}if(X<ac){X=ac}}});if(G.height&&G.height!="auto"){V++;X=0}else{if(Z.height!="*"&&Z.height!="auto"){X=H("h",Z.height)}}P[Y]=X;U+=X});if(V){var W=S/V;d.each(D,function(X,Y){if(Y.height=="*"||Y.height=="auto"){P[X]=W}})}else{x.height(U)}}function L(){var W=0;var V=0;if(R.slotEl){x.width(x.width())}x.width(G.width||"100%");var U=x.width();E=[];var T=0;d.each(Q,function(aa,Y){if(Y=="fit-content"){Y=Q[aa]="minmax(min-content,max-content)"}if(Y=="*"||Y=="auto"){V++;W=0}else{if(Y.indexOf("minmax")===0){var ab=Y.match(/\((.*?),(.*?)\)/);var Z=ab[1];var X=ab[2];W=H("w",X,aa);U-=W}else{W=H("w",Y,aa);U-=W}}E.push(W);T+=W});if(U<0){d.each(Q,function(aa,Y){if(Y.indexOf("minmax")!=-1){var ab=Y.match(/\((.*?),(.*?)\)/);var Z=ab[1];var X=ab[2];min_pixels=H("w",Z,aa);E[aa]+=U;U=0;if(E[aa]<min_pixels){E[aa]=min_pixels}}})}var S=U/V;d.each(Q,function(Y,X){if(X=="*"||X=="auto"){E[Y]=S}})}function v(V,U){var S=U||0;var T=V.row;if(F["@"]&&!V.isHolder){S=-1*H("h",x.css("top"))}d.each(P,function(W){if(W<T){S+=this}});return S}function N(U){var T=U.col;var S=0;if(F["@"]&&!U.isHolder){S=-1*H("w",x.css("left"))}d.each(E,function(V){if(V<T){S+=this}});return S}function u(S){d.each(c,function(T,V){var U=d(V);U.each(function(){var X=d(this);var W=false;S.el.each(function(){var Y=d(this);if(!W){W=Y}else{W[W.length++]=Y[0]}if(Y.next()[0]==X[0]){W[W.length++]=X[0]}});if(W.length>1){S.el=W;S.multi=true}})})}function z(){var S=false;var U={};if(x.is("body")){return}d.each(G,function(X,Y){if(X.indexOf("background")===0){S=true;U[X]=Y}});if(!S){return}var W="jq_tpl_bg-"+R.num;var V=x.offset();var T=d("#"+W);if(!T.length){T=d('<div id="'+W+'"></div>');T.css(U)}T.css({"z-index":-2,position:"absolute",top:V.top,left:V.left,width:x.width(),height:x.height()});d("body").append(T)}function B(V,aa){if(aa.pseudo_props){var U=aa.el.offset();var T="jq_tpl"+R.num+"_slot-"+V;var ab=d("#"+T);var X=aa.pseudo_props;if(!ab.length){ab=d('<div id="'+T+'"></div>');d("body").append(ab)}var ac=aa.el.outerWidth(true);var W=I(aa);ab.css({display:"block",position:"absolute","z-index":(R.num-10),top:U.top,left:U.left,width:ac,height:W});if(d("body").is(O)){if(!R.margins){var S=d('<p style="position:static;margin:0;display:block;visibility:hidden;"></p>');x.append(S);R.margins=S.offset();R.margins.left-=parseFloat(x.css("padding-left"));R.margins.top-=parseFloat(x.css("padding-top"));S.remove()}ab.css("left",U.left-R.margins.left);ab.css("top",U.top-R.margins.top)}ab.css(X);if(X["vertical-align"]){var Z=0;var Y=X["vertical-align"];switch(Y){case"middle":Z=W/2-aa.el.height()/2;break;case"bottom":Z=W-aa.el.height();break;case"baseline":Z=W-aa.el.height();break;default:break}aa.el.css("top",v(aa)+Z)}}}function J(){d.each(D,function(S,T){d.each(T.chars,function(U,V){if(V=="."){return}if(V=="@"){F["@"]={selector:O,isHolder:true}}var W=F[V];W.el=d(W.selector);if(U>0&&T.chars[U-1]==V){if(W.slot_h==1){W.slot_w++}}if(S>0&&D[S-1].chars[U]==V){W.slot_h++}if(isNaN(W.row)){W.row=S}if(isNaN(W.col)){W.col=U}if(!W.el.parents().is(O)&&!W.el.is(O)){delete W;return}if(W.el.length>1){W.multi=true}u(W)})});delete F["."]}this.make=function(){x.css("position","relative");J();L();if(F["@"]){F["@"].el.css("left",N(F["@"]))}d.each(F,function(U,V){var T=V.el;var S=y(V);if(V.props.width){S=M("width",U,S)}T.css({display:"block",position:"absolute",width:S});T.css("left",N(V))});C();if(F["@"]){F["@"].el.css("top",v(F["@"]))}d.each(F,function(U,X){if(X.tplEl){a[X.selector].genTop=v(X)}var T=v(X);var W=I(X);var S=T;var V=false;if(X.pseudo_props){if(X.pseudo_props.overflow=="hidden"){V=true}}X.el.each(function(Y){if(Y>0){S+=X.el.eq(Y-1).outerHeight(true)}d(this).css("top",S);if(X.props.height){W=M("height",U,W);d(this).height(W)}if(V){var Z=W-S+T;var ab=(S-T>W);var aa=(X.el.height()+S-T>W);if(ab||aa){d(this).height(ab?0:Z);d(this).css("overflow","hidden")}}});if(X.tplEl){X.el.height(I(X))}B(U,X)});z();if(R.genTop&&F["@"]){F["@"].el.css("top",v(F["@"],R.genTop))}return{height:x.height(),width:x.width()}}}function m(w,u){var v=new t(u,w);v.make()}function k(){if(!a){a={};i=f();var u={};b(i)}setTimeout(function(){d.each(a,m);p()},r);r=0}})(jQuery);
