/* skel-layers.js v1.0 | (c) n33 | n33.co | 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:Mt,resetScroll:Mt,resetForms:Mt,swipeToHide:Mt,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._.cacheElement(this.id,this[W],ct,1),u.onAttach=function(){var e=this[Vt]._layer;e[rt]()||e.init(),e.resume()},u.onDetach=function(){var e=this[Vt]._layer;e.suspend()},this[n].states&&this[n].states!=t._.sd?(o=t._[hn](this[n].states),t._[Ot](o,function(e){t._.addCachedElementToState(o[e],u)})):(this[n].breakpoints?o=t._[hn](this[n].breakpoints):o=t._.breakpointList,t._[Ot](o,function(e){t._.addCachedElementToBreakpoint(o[e],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(Kt)+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(Kt,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[jt](),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][sn]=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][wt](fn).each(function(){t.parseResume(e(this))}),this[n][tt]||this[en](r)},dn[k].suspend=function(){if(!this[rt]())return;this[s][r](),this[s][wt](fn).each(function(){t.parseSuspend(e(this))}),this[U]&&this[jt]()},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:Mt,transformBreakpoints:T,transformTest:T},eventType:Yt,show:function(e){t._[Pt](function(){t[i][pt][e][en]()})},hide:function(e){t._[Pt](function(){t[i][pt][e][jt]()})},toggle:function(e){t._[Pt](function(){var n=t[i][pt][e];n[sn]()?n[jt]():n[en]()})},getBaseFontSize:function(){return t._[Jt].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)+Zt},lockView:function(e){t[i][Q][It]=t[i][Q][x](),t._[Jt][Ht]&&t[i][ln][S](on+e,tt),t[i][A].on(R,function(e){e[K](),e[V](),t[i][h]&&t[i][h][jt]()}),t[i][Q].on(yt,function(e){t[i][h]&&t[i][h][jt]()}),t._[Jt][Ht]||t[i][Q].on(vt,function(e){t[i][h]&&t[i][h][jt]()})},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][jt](),P;var r=e(this),s=t[i][pt][a[0]];s[sn]()?s[jt]():s[en]()},t._[Jt][q]==an||t._[Jt][q]=="wp"?n.on(Yt,r):n.on(t.eventType,r);break;case"navList":f=e(pn+a[0]),r=f[wt]("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(pn+a[0]),n[qt](f.text());break;case"copyHTML":f=e(pn+a[0]),n[qt](f[qt]());break;case"moveElementContents":f=e(pn+a[0]),o[l]=function(){f[_]().each(function(){var t=e(this);n[At](t),t[Bt](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(pn+a[0]),o[l]=function(){e(X+f[kt]("id")+'" />').insertBefore(f),n[At](f),f[Bt](D)},o[C]=function(){e(ht+f[kt]("id")).replaceWith(f),f[Xt](D),t.refresh(f)},o[l]();break;case"moveCell":f=e(pn+a[0]),c=e(pn+a[1]),o[l]=function(){e(X+f[kt]("id")+'" />').insertBefore(f),n[At](f),f[S](E,Ft),c&&c[Nt]()},o[C]=function(){e(ht+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 Zt: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]()[$t](t[i][f]))},unlockView:function(e){t._[Jt][Ht]&&t[i][ln][S](on+e,U),t[i][A].off(R),t[i][Q].off(yt),t._[Jt][Ht]||t[i][Q].off(vt)},init:function(){n in t[n]&&(t._.extend(t[n],t[n][n]),delete t[n][n]),t._[Ot](t[n],function(e){t[n][e]&&typeof t[n][e]==Vt&&b in t[n][e]&&(t[n][pt][e]=t[n][e],delete t[n][e])}),t[n][cn]&&(t[n][B]=t[n][cn]());if(t[n][B]){if(t._[Jt][q]==an&&t._[Jt].deviceVersion<4||t._[Jt][q]=="wp")t[n][B]=P;t._[Jt].IEVersion<10&&(t[n][B]=P),t[n][zt]&&!t._.hasActive(t._[hn](t[n][zt]))&&(t[n][B]=P)}t.eventType=t._[Jt][Ht]?"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._[Ot](t[n][pt],function(r){var s;if(!(b in t[n][pt][r]))return;if(!t[n][pt][r][qt]&&(s=e(pn+r))[j]==0)return;o=new dn(r,t[n][pt][r],u++),t[i][pt][r]=o,s&&(s[_]()[$t](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][ln]=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('
')[$t](t[i][Qt]),t[i][z][S](F,"100%"),t[i][f]=e('
')[$t](t[i][Qt]),t[i][f][S](b,un),t._[mt](ct,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][Et]/1e3+"s ease-in-out")};else{var s,u=[];t[i][Q].resize(function(){if(t[n][Et]!=0){var e=t[n][Et];t[n][Et]=0,window[m](function(){t[n][Et]=e,u=[]},e)}}),e.fn[r]=function(){for(var r=0;r