/* skel-layers.js v1.0.0 | (c) n33 | getskel.com | MIT licensed */ skel.registerPlugin("layers",function(e){function dn(e,r,i){var o,u;this.id=e,this.index=i,this[n]={breakpoints:T,states:T,position:T,side:T,animation:bt,orientation:bt,width:0,height:0,zIndex:this.index,html:"",hidden:P,exclusive:Ot,resetScroll:Ot,resetForms:Ot,swipeToHide:Ot,clickToHide:P},t._.extend(this[n],r),this[W]=t._.newDiv(this[n][qt]),this[W].id=e,this[W]._layer=this,this[s]=T,this[St]=T,this[xt]=T,this[U]=P,u=t._.newElement(this.id,this[W],ht,1),u.onAttach=function(){var e=this[Kt]._layer;e[rt]()||e.init(),e.resume()},u.onDetach=function(){var e=this[Kt]._layer;e.suspend()},this[n].states&&this[n].states!=t._.sd?(t._.cacheElement(u),o=t._[an](this[n].states),t._[_t](o,function(e){t._.addCachedElementToState(o[e],u)})):this[n].breakpoints?(t._.cacheElement(u),o=t._[an](this[n].breakpoints),t._[_t](o,function(e){t._.addCachedElementToBreakpoint(o[e],u)})):t._.attachElement(u)}var t,n="config",r="_skel_layers_translateOrigin",i="cache",s="$element",o="_skel_layers_translate",u="_skel_layers_resetForms",f="visibleWrapper",l="_skel_layers_resume",c="_skel_layers_promote",h="exclusiveLayer",p="_skel_layers_demote",d="moveToVisibleWrapper",v="moveToHiddenWrapper",m="setTimeout",g="right",y="bottom",b="position",w="useActive",E="width",S="css",x="scrollTop",T=null,N="center",C="_skel_layers_suspend",k="prototype",L="left",A="wrapper",O="skel-layers-layer-z-index",M="_skel_layers_init",_="children",D="skel-layers-moved",P=!1,H=".skel-layers-fixed:not(.skel-layers-moved)",B="transform",j="length",F="height",I="top",q="deviceType",R="touchstart.lock click.lock scroll.lock",U="visible",z="hiddenWrapper",W="element",X='
1){for(t=0;t0&&(t[dt](),t[S](E,(t.data(Vt)+r)/12*100+"%"))},e.fn[Lt]=function(){return e(this).parents()[j]>0},e.fn[dt]=function(){var t=e(this);t[kt]("class").match(/(\s+|^)([0-9]+)u(\s+|$)/)&&t.data(Vt,parseInt(RegExp.$2))},e.fn[c]=function(r){var i,s,o;if(this[j]>1){for(i=0;i-1*f&&t>l;break;case g:a=n-1*f&&t<-1*l;break;case I:a=t-1*f&&n>l;break;case y:a=t-1*f&&n<-1*l}if(a)return u[St]=T,u[xt]=T,u[Ft](),P}if(o[x]()==0&&n<0||s>i-2&&s0)return P}),this[s]=o},dn[k][rt]=function(){return this[s]!==T},dn[k][rn]=function(){return this[s].is(":visible")},dn[k][d]=function(){t[i][f][At](this[s])},dn[k][v]=function(){if(!this[s][Lt]())return;t[i][z][At](this[s])},dn[k].resume=function(r){if(!this[rt]())return;this[s][Et](pn).each(function(){t.parseResume(e(this))}),this[n][tt]||this[tn](r)},dn[k].suspend=function(){if(!this[rt]())return;this[s][r](),this[s][Et](pn).each(function(){t.parseSuspend(e(this))}),this[U]&&this[Ft]()},t={cache:{visibleWrapper:T,body:T,exclusiveLayer:T,html:T,htmlbody:T,hiddenWrapper:T,layers:{},window:T,wrapper:T},config:{baseZIndex:1e4,layers:{},speed:250,transform:Ot,transformBreakpoints:T,transformTest:T},eventType:Yt,show:function(e){t._[Pt](function(){t[i][pt][e][tn]()})},hide:function(e){t._[Pt](function(){t[i][pt][e][Ft]()})},toggle:function(e){t._[Pt](function(){var n=t[i][pt][e];n[rn]()?n[Ft]():n[tn]()})},getBaseFontSize:function(){return t._[$t].IEVersion<9?16.5:parseFloat(getComputedStyle(t[i][Qt].get(0)).fontSize)},getHalf:function(e){var t=parseInt(e);return typeof e=="string"&&e.charAt(e[j]-1)=="%"?Math.floor(t/2)+"%":Math.floor(t/2)+Gt},lockView:function(e){t[i][Q][It]=t[i][Q][x](),t._[$t][Dt]&&t[i][cn][S](en+e,tt),t[i][A].on(R,function(e){e[K](),e[V](),t[i][h]&&t[i][h][Ft]()}),t[i][Q].on(yt,function(e){t[i][h]&&t[i][h][Ft]()}),t._[$t][Dt]||t[i][Q].on(vt,function(e){t[i][h]&&t[i][h][Ft]()})},parseInit:function(n){var r,s,o=n.get(0),u=n[kt]("data-action"),a=n[kt]("data-args"),f,c;u&&a&&(a=a.split(","));switch(u){case"toggleLayer":case"layerToggle":n[S](nt,Wt)[S]("cursor","pointer"),r=function(n){n[K](),n[V]();if(t[i][h])return t[i][h][Ft](),P;var r=e(this),s=t[i][pt][a[0]];s[rn]()?s[Ft]():s[tn]()},t._[$t][q]==fn||t._[$t][q]=="wp"?n.on(Yt,r):n.on(t.eventType,r);break;case"navList":f=e(hn+a[0]),r=f[Et]("a"),s=[],r.each(function(){var t=e(this),n,r;n=Math.max(0,t.parents("li")[j]-1),r=t[kt]("href"),s.push(''+t.text()+"")}),s[j]>0&&n[qt]("");break;case"copyText":f=e(hn+a[0]),n[qt](f.text());break;case"copyHTML":f=e(hn+a[0]),n[qt](f[qt]());break;case"moveElementContents":f=e(hn+a[0]),o[l]=function(){f[_]().each(function(){var t=e(this);n[At](t),t[Mt](D)})},o[C]=function(){n[_]().each(function(){var n=e(this);f[At](n),n[Xt](D),t.refresh(n)})},o[l]();break;case"moveElement":f=e(hn+a[0]),o[l]=function(){e(X+f[kt]("id")+'" />').insertBefore(f),n[At](f),f[Mt](D)},o[C]=function(){e(ft+f[kt]("id")).replaceWith(f),f[Xt](D),t.refresh(f)},o[l]();break;case"moveCell":f=e(hn+a[0]),c=e(hn+a[1]),o[l]=function(){e(X+f[kt]("id")+'" />').insertBefore(f),n[At](f),f[S](E,jt),c&&c[Nt]()},o[C]=function(){e(ft+f[kt]("id")).replaceWith(f),f[S](E,""),c&&c[S](E,"")},o[l]();break;default:}},parseResume:function(e){var t=e.get(0);t[l]&&t[l]()},parseSuspend:function(e){var t=e.get(0);t[C]&&t[C]()},recalc:function(e,n){var r=t._.parseMeasurement(e),i;switch(r[1]){case"%":i=Math.floor(n*(r[0]/100));break;case"em":i=t.getBaseFontSize()*r[0];break;default:case Gt:i=r[0]}return i},recalcH:function(n){return t.recalc(n,e(window)[F]())},recalcW:function(n){return t.recalc(n,e(window)[E]())},refresh:function(r){var s;t[n][B]&&(r?s=r.filter(H):s=e(H),s[M]()[Jt](t[i][f]))},unlockView:function(e){t._[$t][Dt]&&t[i][cn][S](en+e,U),t[i][A].off(R),t[i][Q].off(yt),t._[$t][Dt]||t[i][Q].off(vt)},init:function(){n in t[n]&&(t._.extend(t[n],t[n][n]),delete t[n][n]),t._[_t](t[n],function(e){t[n][e]&&typeof t[n][e]==Kt&&b in t[n][e]&&(t[n][pt][e]=t[n][e],delete t[n][e])}),t[n][ln]&&(t[n][B]=t[n][ln]());if(t[n][B]){if(t._[$t][q]==fn&&t._[$t].deviceVersion<4||t._[$t][q]=="wp")t[n][B]=P;t._[$t].IEVersion<10&&(t[n][B]=P),t[n][zt]&&!t._.hasActive(t._[an](t[n][zt]))&&(t[n][B]=P)}t.eventType=t._[$t][Dt]?"touchend":Yt,t.initObjects(),t.initTransforms(),t._[Pt](function(){t.initLayers(),t.initIncludes(),t._.updateState(),t.refresh()})},initIncludes:function(){e(".skel-layers-include").each(function(){t.parseInit(e(this))})},initLayers:function(){var r,s,o,u=1;t._[_t](t[n][pt],function(r){var s;if(!(b in t[n][pt][r]))return;if(!t[n][pt][r][qt]&&(s=e(hn+r))[j]==0)return;o=new dn(r,t[n][pt][r],u++),t[i][pt][r]=o,s&&(s[_]()[Jt](o[W]),s.remove())})},initObjects:function(){t[i][Q]=e(window),t._[Pt](function(){t[i][qt]=e(qt),t[i][Qt]=e(Qt),t[i][cn]=e("html,body"),t[i][Qt].wrapInner('
'),t[i][A]=e("#skel-layers-wrapper"),t[i][A][S](b,un)[S](L,"0")[S](g,"0")[S](I,"0")[M](),t[i][z]=e('
')[Jt](t[i][Qt]),t[i][z][S](F,"100%"),t[i][f]=e('
')[Jt](t[i][Qt]),t[i][f][S](b,un),t._[mt](ht,t[i][z][0]),t._[mt]("skel_layers_visibleWrapper",t[i][f][0]),t._[mt]("skel_layers_wrapper",t[i][A][0]),e("[autofocus]").focus()})},initTransforms:function(){if(t[n][B])e.fn[r]=function(){return e(this)[o](0,0)},e.fn[o]=function(t,n){return e(this)[S](B,"translate("+t+"px, "+n+"px)")},e.fn[M]=function(){return e(this)[S]("backface-visibility",tt)[S]("perspective","500")[Rt]("transition","transform "+t[n][wt]/1e3+"s ease-in-out")};else{var s,u=[];t[i][Q].resize(function(){if(t[n][wt]!=0){var e=t[n][wt];t[n][wt]=0,window[m](function(){t[n][wt]=e,u=[]},e)}}),e.fn[r]=function(){for(var r=0;r