/* skel-layers.js vx.x | (c) n33 | n33.co | MIT licensed */ skel.registerPlugin("layers",function(e){function un(e,r,i){var o,u;this.id=e,this.index=i,this[n]={breakpoints:L,states:L,position:L,side:L,animation:Rt,orientation:Xt,width:0,height:0,zIndex:this.index,html:"",hidden:H,exclusive:Nt,resetScroll:Nt,resetForms:Nt,swipeToClose:Nt,clickToClose:H},t._.extend(this[n],r),this[z]=t._.newDiv(this[n].html),this[z].id=e,this[z]._layer=this,this[s]=L,this[et]=L,this[vt]=L,this[It]=H,u=t._.cacheElement(this.id,this[z],Y,1),u.onAttach=function(){var e=this.object._layer;e[G]()||e.init(),e.resume()},u.onDetach=function(){var e=this.object._layer;e.suspend()},this[n].states?(o=t._[rn](this[n].states),t._[Bt](o,function(e){t._.addCachedElementToState(t._.sd+o[e],u)})):(this[n].breakpoints?o=t._[rn](this[n].breakpoints):o=t._.breakpointList,t._[Bt](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="_skel_layers_resume",l="_skel_layers_promote",c="activeWrapper",h="exclusiveLayer",p="moveToInactiveWrapper",d="_skel_layers_demote",v="moveToActiveWrapper",m="setTimeout",g="right",y="bottom",b="width",w="scrollTop",E="css",S="useActive",x="center",T="_skel_layers_suspend",N="position",C="prototype",k="left",L=null,A="deactivate",O="wrapper",M="skel-layers-layer-z-index",_="children",D="_skel_layers_init",P="length",H=!1,B="inactiveWrapper",j="deviceType",F="top",I="touchstart.lock click.lock scroll.lock",q="height",R="window",U="transform",z="element",W="recalcW",X="stopPropagation",V="resetForms",$="overflow-x",J="preventDefault",K="-webkit-",Q="padding-bottom",G="isInitialized",Y="skel_layers_inactiveWrapper",Z="-webkit-tap-highlight-color",et="touchPosX",tt="originalEvent",nt="skel-layers-layer-position",rt="z-index",it="skel-layers-layer-index",st="unlockView",ot="animations",ut='
0},e.fn[l]=function(r){var i,s,o;if(this[P]>1){for(i=0;i1){for(t=0;t0&&(t[ft](),t[E](b,(t.data(jt)+r)/12*100+"%"))},un[C][mt]={"top-left":{v:F,h:k,side:k},"top-right":{v:F,h:g,side:g},top:{v:F,h:x,side:F},"top-center":{v:F,h:x,side:F},"bottom-left":{v:y,h:k,side:k},"bottom-right":{v:y,h:g,side:g},bottom:{v:y,h:x,side:y},"bottom-center":{v:y,h:x,side:y},left:{v:x,h:k,side:k},"center-left":{v:x,h:k,side:k},right:{v:x,h:g,side:g},"center-right":{v:x,h:g,side:g}},un[C][ot]={none:{activate:function(e){var t=e[n],r=e[s];r[w](0)[l](t.zIndex).show(),t[V]&&r[u](),e[v]()},deactivate:function(e){var t=e[n],r=e[s];r.hide()[d](),e[p]()}},overlayX:{activate:function(e){var r=e[n],i=e[s];i[w](0)[l](r.zIndex)[E](r[Qt],$t+t[W](t._[S](r[b]))+Ft).show(),r[V]&&i[u](),t[Tt]("x"),e[v](),window[m](function(){i[o]((r[Qt]==g?$t:"")+t[W](t._[S](r[b])),0)},50)},deactivate:function(e){var i=e[n],o=e[s];o[lt](on).blur(),o[r](),window[m](function(){t[st]("x"),e[p](),o[d]().hide()},t[n][dt]+50)}},overlayY:{activate:function(e){var r=e[n],i=e[s];i[w](0)[l](r.zIndex)[E](r[Qt],$t+t[W](t._[S](r[q]))+Ft).show(),r[V]&&i[u](),t[Tt]("y"),e[v](),window[m](function(){i[o](0,(r[Qt]==y?$t:"")+t[W](t._[S](r[q])))},50)},deactivate:function(e){var i=e[n],o=e[s];o[lt](on).blur(),o[r](),window[m](function(){t[st]("y"),e[p](),o[d]().hide()},t[n][dt]+50)}},pushX:{activate:function(e){var r=e[n],a=e[s],f=t[i][O].add(t[i][c][_]());a[w](0)[E](r[Qt],$t+t[W](t._[S](r[b]))+Ft).show(),r[V]&&a[u](),f[l](),t[Tt]("x"),e[v](),window[m](function(){a.add(f)[o]((r[Qt]==g?$t:"")+t[W](t._[S](r[b])),0)},50)},deactivate:function(e){var o=e[n],u=e[s],a=t[i][O].add(t[i][c][_]());u[lt](on).blur(),u.add(a)[r](),window[m](function(){t[st]("x"),u.hide(),e[p](),a[d]()},t[n][dt]+50)}},pushY:{activate:function(e){var r=e[n],a=e[s],f=t[i][O].add(t[i][c][_]());a[w](0)[E](r[Qt],$t+t[Pt](t._[S](r[q]))+Ft).show(),r[V]&&a[u](),t[Tt]("y"),e[v](),window[m](function(){a.add(f)[o](0,(r[Qt]==y?$t:"")+t[Pt](t._[S](r[q])))},50)},deactivate:function(e){var o=e[n],u=e[s],a=t[i][O].add(t[i][c][_]());u[lt](on).blur(),u.add(a)[r](),window[m](function(){t[st]("y"),u.hide(),e[p]()},t[n][dt]+50)}},revealX:{activate:function(e){var r=e[n],a=e[s],f=t[i][O].add(t[i][c][_]());a[w](0).show(),r[V]&&a[u](),f[l](),t[Tt]("x"),e[v](),window[m](function(){f[o]((r[Qt]==g?$t:"")+t[W](t._[S](r[b])),0)},50)},deactivate:function(e){var o=e[n],u=e[s],a=t[i][O].add(t[i][c][_]());u[lt](on).blur(),a[r](),window[m](function(){t[st]("x"),u.hide(),a[d](),e[p]()},t[n][dt]+50)}}},un[C][v]=function(){t[i][c][St](this[s])},un[C][p]=function(){if(!this[s][Et]())return;t[i][B][St](this[s])},un[C][A]=function(){var e,r;if(!this[It]){t[i][B][St](this[z]);return}e=this[n],r=this[n][gt],r in this[ot]||(r=Rt),this[ot][r][A](this),e[at]&&e.exclusive&&t[i][h]===this&&(t[i][h]=L),this[It]=H},un[C][Ut]=function(){var e,r,o;if(this[It]){t[i][c][St](this[z]);return}e=this[n],r=this[s],t._[Wt][j]=="ios"&&e[at]?r[E](b,t[W](t._[S](e[b]))+Ft)[E](q,t[Pt](t._[S](e[q]))+Ft):r[E](q,t._[S](e[q]))[E](b,t._[S](e[b])),o=this[mt][e[N]],r.addClass("skel-layer-"+e[N]).data(nt,e[N]);switch(o.v){case F:r[E](F,0);break;case y:r[E](y,0);break;case x:r[E](F,"50%")[E]("margin-top",$t+t.getHalf(e[q]))}switch(o.h){case k:r[E](k,0);break;case g:r[E](g,0);break;case x:r[E](k,"50%")[E]("margin-left",$t+t.getHalf(e[b]))}this[ot][e[gt]][Ut](this),e[at]&&e.exclusive&&(t[i][h]=this),this[It]=Nt},un[C][G]=function(){return this[s]!==L},un[C].isVisible=function(){return this[s].is(":visible")},un[C].resume=function(r){if(!this[G]())return;this[s][lt](on).each(function(){t.parseResume(e(this))}),this[n][at]||this[Ut](r)},un[C].suspend=function(){if(!this[G]())return;this[s][r](),this[s][lt](on).each(function(){t.parseSuspend(e(this))}),this[It]&&this[A]()},un[C].init=function(){var r=this[n],o=e(this[z]),u=this;o[D](),o[lt](on).each(function(){t.parseInit(e(this))}),o.addClass("skel-layer").data(it,this.index)[E](rt,t[n].baseZIndex)[E](N,"fixed")[E]("-ms-overflow-style","-ms-autohiding-scrollbar")[E]("-webkit-overflow-scrolling","touch").hide();switch(r.orientation){case Xt:o[E]("overflow-y",At);break;case"horizontal":o[E]($,At)}if(!r[N]||!(r[N]in this[mt]))r[N]="top-left";r[Qt]||(r[Qt]=this[mt][r[N]][Qt]);if(!r[gt]||!(r[gt]in this[ot]))r[gt]=Rt;r.clickToClose&&o[lt]("a")[E](Z,Ht).on("click.skel-layers",function(r){var i,s,o=e(this);if(o.hasClass("skel-layers-ignore"))return;r[J](),r[X](),u[A]();if(o.hasClass("skel-layers-ignoreHref"))return;i=o[wt]("href"),s=o[wt]("target"),window[m](function(){s=="_blank"&&t._[Wt][j]!="wp"?window.open(i):window.location.href=i},t[n][dt]+10)}),t._[Wt][j]=="ios"&&o[lt]("input,select,textarea").on("focus",function(n){var r=e(this);n[J](),n[X](),window[m](function(){var e=t[i][R][Lt],n=t[i][R][w]()-e;t[i][R][w](e),o[w](o[w]()+n),r.hide(),window[m](function(){r.show()},0)},100)}),t._[Wt][kt]&&o.on("touchstart",function(e){u[et]=e[tt][Jt][0].pageX,u[vt]=e[tt][Jt][0].pageY}).on("touchmove",function(e){var t,n,i,s,a,f,l;if(u[et]===L||u[vt]===L)return;t=u[et]-e[tt][Jt][0].pageX,n=u[vt]-e[tt][Jt][0].pageY,i=o.outerHeight(),s=o.get(0).scrollHeight-o[w]();if(r.swipeToClose){a=H,f=20,l=50;switch(r[Qt]){case k:a=n-1*f&&t>l;break;case g:a=n-1*f&&t<-1*l;break;case F:a=t-1*f&&n>l;break;case y:a=t-1*f&&n<-1*l}if(a)return u[et]=L,u[vt]=L,u[A](),H}if(o[w]()==0&&n<0||s>i-2&&s0)return H}),this[s]=o},t={config:{baseZIndex:1e4,transform:Nt,transformBreakpoints:L,transformTest:L,speed:250,layers:{}},cache:{layers:{},body:L,window:L,wrapper:L,inactiveWrapper:L,activeWrapper:L,exclusiveLayer:L},eventType:Vt,recalcW:function(t){var n=parseInt(t);return typeof t==qt&&t.charAt(t[P]-1)=="%"&&(n=Math.floor(e(window)[b]()*(n/100))),n},recalcH:function(t){var n=parseInt(t);return typeof t==qt&&t.charAt(t[P]-1)=="%"&&(n=Math.floor(e(window)[q]()*(n/100))),n},getHalf:function(e){var t=parseInt(e);return typeof e==qt&&e.charAt(e[P]-1)=="%"?Math.floor(t/2)+"%":Math.floor(t/2)+Ft},parseSuspend:function(e){var t=e.get(0);t[T]&&t[T]()},parseResume:function(e){var t=e.get(0);t[f]&&t[f]()},parseInit:function(n){var r,s,o=n.get(0),u=n[wt]("data-action"),a=n[wt]("data-args"),l,c;u&&a&&(a=a.split(","));switch(u){case"toggleLayer":case"layerToggle":n[E](Z,Ht)[E]("cursor",tn),r=function(n){n[J](),n[X]();if(t[i][h])return t[i][h][A](),H;var r=e(this),s=t[i][Yt][a[0]];s.isVisible()?s[A]():s[Ut]()},t._[Wt][j]==nn||t._[Wt][j]=="wp"?n.on(Vt,r):n.on(t.eventType,r);break;case"navList":l=e(en+a[0]),r=l[lt]("a"),s=[],r.each(function(){var t=e(this),n;n=Math.max(0,t.parents("li")[P]-1),s.push(''+t.text()+"")}),s[P]>0&&n.html(""),n[lt](".link")[E]("cursor",tn)[E]("display","block");break;case"copyText":l=e(en+a[0]),n.html(l.text());break;case"copyHTML":l=e(en+a[0]),n.html(l.html());break;case"moveElementContents":l=e(en+a[0]),o[f]=function(){l[_]().each(function(){n[St](e(this))})},o[T]=function(){n[_]().each(function(){l[St](e(this))})},o[f]();break;case"moveElement":l=e(en+a[0]),o[f]=function(){e(ut+l[wt]("id")+'" />').insertBefore(l),n[St](l)},o[T]=function(){e(xt+l[wt]("id")).replaceWith(l)},o[f]();break;case"moveCell":l=e(en+a[0]),c=e(en+a[1]),o[f]=function(){e(ut+l[wt]("id")+'" />').insertBefore(l),n[St](l),l[E](b,At),c&&c[yt]()},o[T]=function(){e(xt+l[wt]("id")).replaceWith(l),l[E](b,""),c&&c[E](b,"")},o[f]();break;default:}},lockView:function(e){t[i][R][Lt]=t[i][R][w](),t._[Wt][kt]&&t[i][Kt][E](Gt+e,at),t[i][O].on(I,function(e){e[J](),e[X](),t[i][h]&&t[i][h][A]()}),t[i][R].on(pt,function(e){t[i][h]&&t[i][h][A]()}),t._[Wt][kt]||t[i][R].on(ct,function(e){t[i][h]&&t[i][h][A]()})},unlockView:function(e){t._[Wt][kt]&&t[i][Kt][E](Gt+e,Dt),t[i][O].off(I),t[i][R].off(pt),t._[Wt][kt]||t[i][R].off(ct)},initLayers:function(){var r,s,o,u=1;t._[Bt](t[n][Yt],function(r){var s;if(!t[n][Yt][r].html&&(s=e(en+r))[P]==0)return;o=new un(r,t[n][Yt][r],u++),t[i][Yt][r]=o,s&&(s[_]()[zt](o[z]),s.remove())})},initTransforms:function(){if(t[n][U])e.fn[r]=function(){return e(this)[o](0,0)},e.fn[o]=function(t,n){return e(this)[E](U,"translate("+t+"px, "+n+"px)")},e.fn[D]=function(){return e(this)[E]("backface-visibility",at)[E]("perspective","500")[Mt]("transition","transform "+t[n][dt]/1e3+"s ease-in-out")};else{var s,u=[];t[i][R].resize(function(){if(t[n][dt]!=0){var e=t[n][dt];t[n][dt]=0,window[m](function(){t[n][dt]=e,u=[]},e)}}),e.fn[r]=function(){for(var r=0;r'),t[i][O]=e("#skel-layers-wrapper"),t[i][O][E](N,Zt)[E](k,"0")[E](g,"0")[E](F,"0")[D](),t[i][B]=e('
')[zt](t[i][Kt]),t[i][B][E](q,"100%"),t[i][c]=e('
')[zt](t[i][Kt]),t[i][c][E](N,Zt),t._[ht](Y,t[i][B][0]),t._[ht]("skel_layers_activeWrapper",t[i][c][0]),t._[ht]("skel_layers_wrapper",t[i][O][0]),e("[autofocus]").focus()})},initIncludes:function(){e(".skel-layers-include").each(function(){t.parseInit(e(this))})},init:function(){t[n][sn]&&(t[n][U]=t[n][sn]());if(t[n][U]){if(t._[Wt][j]==nn&&t._[Wt].deviceVersion<4||t._[Wt][j]=="wp")t[n][U]=H;t._[Wt].IEVersion<10&&(t[n][U]=H),t[n][Ot]&&!t._.hasActive(t._[rn](t[n][Ot]))&&(t[n][U]=H)}t.eventType=t._[Wt][kt]?"touchend":Vt,t.initObjects(),t.initTransforms(),t._.DOMReady(function(){t.initLayers(),t.initIncludes(),t._.updateState(),t.refresh()})},refresh:function(){e(".skel-layers-fixed")[D]()[zt](t[i][c])}},t)}(jQuery));