Пример #1
0
(function(b,c,d){typeof a!="undefined"&&a.exports?a.exports=d():typeof define=="function"&&define.amd?define(d):c[b]=d()})("bonzo",this,function(){function G(a){return a&&a.nodeName&&(a.nodeType==1||a.nodeType==11)}function H(a,b,c){var d,e,f;if(typeof a=="string")return ab.create(a);G(a)&&(a=[a]);if(c){f=[];for(d=0,e=a.length;d<e;d++)f[d]=X(b,a[d]);return f}return a}function I(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function J(a,b,c,d){var e,f=0,g=a.length;for(;f<g;f++){e=d?a.length-f-1:f;b.call(c||a[e],a[e],e,a)}return a}function K(a,b,c){for(var d=0,e=a.length;d<e;d++)if(G(a[d])){K(a[d].childNodes,b,c);b.call(c||a[d],a[d],d,a)}return a}function L(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function M(a){return a?a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():a}function N(a){a[x]("data-node-uid")||a[w]("data-node-uid",++s);var b=a[x]("data-node-uid");return r[b]||(r[b]={})}function O(a){var b=a[x]("data-node-uid");b&&delete r[b]}function P(a){var b;try{return a===null||a===undefined?undefined:a==="true"?!0:a==="false"?!1:a==="null"?null:(b=parseFloat(a))==a?b:a}catch(c){}return undefined}function Q(a,b,c){for(var d=0,e=a.length;d<e;++d)if(b.call(c||null,a[d],d,a))return!0;return!1}function R(a){a=="transform"&&(a=z.transform)||/^transform-?[Oo]rigin$/.test(a)&&(a=z.transform+"Origin")||a=="float"&&(a=z.cssFloat);return a?L(a):null}function T(a,b,c,d){var e=0,f=b||this,g=[],h=E&&typeof a=="string"&&a.charAt(0)!="<"?E(a):a;J(H(h),function(a,b){J(f,function(d){c(a,g[e++]=b>0?X(f,d):d)},null,d)},this,d);f.length=e;J(g,function(a){f[--e]=a},null,!d);return f}function U(a,b,c){var d=ab(a),e=d.css("position"),f=d.offset(),g="relative",h=e==g,i=[parseInt(d.css("left"),10),parseInt(d.css("top"),10)];if(e=="static"){d.css("position",g);e=g}isNaN(i[0])&&(i[0]=h?0:a.offsetLeft);isNaN(i[1])&&(i[1]=h?0:a.offsetTop);b!=null&&(a.style.left=b-f.left+i[0]+v);c!=null&&(a.style.top=c-f.top+i[1]+v)}function V(a,b){return typeof b=="function"?b(a):b}function W(a){this.length=0;if(a){a=typeof a!="string"&&!a.nodeType&&typeof a.length!="undefined"?a:[a];this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]}}function X(a,b){var c=b.cloneNode(!0),d,e;if(a.$&&typeof a.cloneEvents=="function"){a.$(c).cloneEvents(b);d=a.$(c).find("*");e=a.$(b).find("*");for(var f=0;f<e.length;f++)a.$(d[f]).cloneEvents(e[f])}return c}function Y(b,c,d){var e=this[0];if(!e)return this;if(b==null&&c==null)return(Z(e)?$():{x:e.scrollLeft,y:e.scrollTop})[d];if(Z(e))a.scrollTo(b,c);else{b!=null&&(e.scrollLeft=b);c!=null&&(e.scrollTop=c)}return this}function Z(b){return b===a||/^(?:body|html)$/i.test(b.tagName)}function $(){return{x:a.pageXOffset||c.scrollLeft,y:a.pageYOffset||c.scrollTop}}function _(a){var b=document.createElement("script"),c=a.match(g);b.src=c[1];return b}function ab(a){return new W(a)}var a=window,b=a.document,c=b.documentElement,d="parentNode",e=/^(checked|value|selected|disabled)$/i,f=/^(select|fieldset|table|tbody|tfoot|td|tr|colgroup)$/i,g=/\s*<script +src=['"]([^'"]+)['"]>/,h=["<table>","</table>",1],i=["<table><tbody><tr>","</tr></tbody></table>",3],j=["<select>","</select>",1],k=["_","",0,1],l={thead:h,tbody:h,tfoot:h,colgroup:h,caption:h,tr:["<table><tbody>","</tbody></table>",2],th:i,td:i,col:["<table><colgroup>","</colgroup></table>",2],fieldset:["<form>","</form>",1],legend:["<form><fieldset>","</fieldset></form>",2],option:j,optgroup:j,script:k,style:k,link:k,param:k,base:k},m=/^(checked|selected|disabled)$/,n=/msie/i.test(navigator.userAgent),o,p,q,r={},s=0,t=/^-?[\d\.]+$/,u=/^data-(.+)$/,v="px",w="setAttribute",x="getAttribute",y="getElementsByTagName",z=function(){var a=b.createElement("p");a.innerHTML='<a href="#x">x</a><table style="float:left;"></table>';return{hrefExtended:a[y]("a")[0][x]("href")!="#x",autoTbody:a[y]("tbody").length!==0,computedStyle:b.defaultView&&b.defaultView.getComputedStyle,cssFloat:a[y]("table")[0].style.styleFloat?"styleFloat":"cssFloat",transform:function(){var b=["transform","webkitTransform","MozTransform","OTransform","msTransform"],c;for(c=0;c<b.length;c++)if(b[c]in a.style)return b[c]}(),classList:"classList"in a,opasity:function(){return typeof b.createElement("a").style.opacity!="undefined"}()}}(),A=/(^\s*|\s*$)/g,B=/\s+/,C=String.prototype.toString,D={lineHeight:1,zoom:1,zIndex:1,opacity:1,boxFlex:1,WebkitBoxFlex:1,MozBoxFlex:1},E=b.querySelectorAll&&function(a){return b.querySelectorAll(a)},F=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(A,"")},S=z.computedStyle?function(a,c){var d=null,e=b.defaultView.getComputedStyle(a,"");e&&(d=e[c]);return a.style[c]||d}:n&&c.currentStyle?function(a,b){if(b=="opacity"&&!z.opasity){var c=100;try{c=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(d){try{c=a.filters("alpha").opacity}catch(e){}}return c/100}var f=a.currentStyle?a.currentStyle[b]:null;return a.style[b]||f}:function(a,b){return a.style[b]};if(z.classList){o=function(a,b){return a.classList.contains(b)};p=function(a,b){a.classList.add(b)};q=function(a,b){a.classList.remove(b)}}else{o=function(a,b){return I(b).test(a.className)};p=function(a,b){a.className=F(a.className+" "+b)};q=function(a,b){a.className=F(a.className.replace(I(b)," "))}}W.prototype={get:function(a){return this[a]||null},each:function(a,b){return J(this,a,b)},deepEach:function(a,b){return K(this,a,b)},map:function(a,b){var c=[],d,e;for(e=0;e<this.length;e++){d=a.call(this,this[e],e);b?b(d)&&c.push(d):c.push(d)}return c},html:function(a,b){var d=b?c.textContent===undefined?"innerText":"textContent":"innerHTML",e=this,g=function(b,c){J(H(a,e,c),function(a){b.appendChild(a)})},h=function(c,e){try{if(b||typeof a=="string"&&!f.test(c.tagName))return c[d]=a}catch(h){}g(c,e)};return typeof a!="undefined"?this.empty().each(h):this[0]?this[0][d]:""},text:function(a){return this.html(a,!0)},append:function(a){var b=this;return this.each(function(c,d){J(H(a,b,d),function(a){c.appendChild(a)})})},prepend:function(a){var b=this;return this.each(function(c,d){var e=c.firstChild;J(H(a,b,d),function(a){c.insertBefore(a,e)})})},appendTo:function(a,b){return T.call(this,a,b,function(a,b){a.appendChild(b)})},prependTo:function(a,b){return T.call(this,a,b,function(a,b){a.insertBefore(b,a.firstChild)},1)},before:function(a){var b=this;return this.each(function(c,e){J(H(a,b,e),function(a){c[d].insertBefore(a,c)})})},after:function(a){var b=this;return this.each(function(c,e){J(H(a,b,e),function(a){c[d].insertBefore(a,c.nextSibling)},null,1)})},insertBefore:function(a,b){return T.call(this,a,b,function(a,b){a[d].insertBefore(b,a)})},insertAfter:function(a,b){return T.call(this,a,b,function(a,b){var c=a.nextSibling;c?a[d].insertBefore(b,c):a[d].appendChild(b)},1)},replaceWith:function(a){ab(H(a)).insertAfter(this);return this.remove()},addClass:function(a){a=C.call(a).split(B);return this.each(function(b){J(a,function(a){a&&!o(b,V(b,a))&&p(b,V(b,a))})})},removeClass:function(a){a=C.call(a).split(B);return this.each(function(b){J(a,function(a){a&&o(b,V(b,a))&&q(b,V(b,a))})})},hasClass:function(a){a=C.call(a).split(B);return Q(this,function(b){return Q(a,function(a){return a&&o(b,a)})})},toggleClass:function(a,b){a=C.call(a).split(B);return this.each(function(c){J(a,function(a){a&&(typeof b!="undefined"?b?!o(c,a)&&p(c,a):q(c,a):o(c,a)?q(c,a):p(c,a))})})},show:function(a){a=typeof a=="string"?a:"";return this.each(function(b){b.style.display=a})},hide:function(){return this.each(function(a){a.style.display="none"})},toggle:function(a,b){b=typeof b=="string"?b:"";typeof a!="function"&&(a=null);return this.each(function(c){c.style.display=c.offsetWidth||c.offsetHeight?"none":b;a&&a.call(c)})},first:function(){return ab(this.length?this[0]:[])},last:function(){return ab(this.length?this[this.length-1]:[])},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},parent:function(){return this.related(d)},related:function(a){return this.map(function(b){b=b[a];while(b&&b.nodeType!==1)b=b[a];return b||0},function(a){return a})},focus:function(){this.length&&this[0].focus();return this},blur:function(){this.length&&this[0].blur();return this},css:function(c,d){function g(a,b,c){for(var d in f)if(f.hasOwnProperty(d)){c=f[d];(b=R(d))&&t.test(c)&&!(b in D)&&(c+=v);try{a.style[b]=V(a,c)}catch(e){}}}var e,f=c;if(d===undefined&&typeof c=="string"){d=this[0];if(!d)return null;if(d===b||d===a){e=d===b?ab.doc():ab.viewport();return c=="width"?e.width:c=="height"?e.height:""}return(c=R(c))?S(d,c):null}if(typeof c=="string"){f={};f[c]=d}if(n&&f.opacity){f.filter="alpha(opacity="+f.opacity*100+")";f.zoom=c.zoom||1;delete f.opacity}return this.each(g)},offset:function(a,c){if(!a||typeof a!="object"||typeof a.top!="number"&&typeof a.left!="number"){if(typeof a=="number"||typeof c=="number")return this.each(function(b){U(b,a,c)});if(!this[0])return{top:0,left:0,height:0,width:0};var d=this[0],e=d.ownerDocument.documentElement,f=d.getBoundingClientRect(),g=$(),h=d.offsetWidth,i=d.offsetHeight,j=f.top+g.y-Math.max(0,e&&e.clientTop,b.body.clientTop),k=f.left+g.x-Math.max(0,e&&e.clientLeft,b.body.clientLeft);return{top:j,left:k,height:i,width:h}}return this.each(function(b){U(b,a.left,a.top)})},dim:function(){if(!this.length)return{height:0,width:0};var a=this[0],b=a.nodeType==9&&a.documentElement,c=!b&&!!a.style&&!a.offsetWidth&&!a.offsetHeight?function(b){var c={position:a.style.position||"",visibility:a.style.visibility||"",display:a.style.display||""};b.first().css({position:"absolute",visibility:"hidden",display:"block"});return c}(this):null,d=b?Math.max(a.body.scrollWidth,a.body.offsetWidth,b.scrollWidth,b.offsetWidth,b.clientWidth):a.offsetWidth,e=b?Math.max(a.body.scrollHeight,a.body.offsetHeight,b.scrollHeight,b.offsetHeight,b.clientHeight):a.offsetHeight;c&&this.first().css(c);return{height:e,width:d}},attr:function(a,b){var c=this[0];if(typeof a=="string"||a instanceof String)return typeof b=="undefined"?c?e.test(a)?m.test(a)&&typeof c[a]=="string"?!0:c[a]:a!="href"&&a!="src"||!z.hrefExtended?c[x](a):c[x](a,2):null:this.each(function(c){e.test(a)?c[a]=V(c,b):c[w](a,V(c,b))});for(var d in a)a.hasOwnProperty(d)&&this.attr(d,a[d]);return this},removeAttr:function(a){return this.each(function(b){m.test(a)?b[a]=!1:b.removeAttribute(a)})},val:function(a){return typeof a=="string"?this.attr("value",a):this.length?this[0].value:null},data:function(a,b){var c=this[0],d,e;if(typeof b=="undefined"){if(!c)return null;d=N(c);if(typeof a=="undefined"){J(c.attributes,function(a){(e=(""+a.name).match(u))&&(d[L(e[1])]=P(a.value))});return d}typeof d[a]=="undefined"&&(d[a]=P(this.attr("data-"+M(a))));return d[a]}return this.each(function(c){N(c)[a]=b})},remove:function(){this.deepEach(O);return this.detach()},empty:function(){return this.each(function(a){K(a.childNodes,O);while(a.firstChild)a.removeChild(a.firstChild)})},detach:function(){return this.each(function(a){a[d]&&a[d].removeChild(a)})},scrollTop:function(a){return Y.call(this,null,a,"y")},scrollLeft:function(a){return Y.call(this,a,null,"x")}};ab.setQueryEngine=function(a){E=a;delete ab.setQueryEngine};ab.aug=function(a,b){for(var c in a)a.hasOwnProperty(c)&&((b||W.prototype)[c]=a[c])};ab.create=function(a){return typeof a=="string"&&a!==""?function(){if(g.test(a))return[_(a)];var c=a.match(/^\s*<([^\s>]+)/),e=b.createElement("div"),f=[],h=c?l[c[1].toLowerCase()]:null,i=h?h[2]+1:1,j=h&&h[3],k=d,m=z.autoTbody&&h&&h[0]=="<table>"&&!/<tbody/i.test(a);e.innerHTML=h?h[0]+a+h[1]:a;while(i--)e=e.firstChild;j&&e&&e.nodeType!==1&&(e=e.nextSibling);do(!c||e.nodeType==1)&&(!m||e.tagName&&e.tagName!="TBODY")&&f.push(e);while(e=e.nextSibling);J(f,function(a){a[k]&&a[k].removeChild(a)});return f}():G(a)?[a.cloneNode(!0)]:[]};ab.doc=function(){var a=ab.viewport();return{width:Math.max(b.body.scrollWidth,c.scrollWidth,a.width),height:Math.max(b.body.scrollHeight,c.scrollHeight,a.height)}};ab.firstChild=function(a){for(var b=a.childNodes,c=0,d=b&&b.length||0,e;c<d;c++)b[c].nodeType===1&&(e=b[d=c]);return e};ab.viewport=function(){return{width:n?c.clientWidth:self.innerWidth,height:n?c.clientHeight:self.innerHeight}};ab.isAncestor="compareDocumentPosition"in c?function(a,b){return(a.compareDocumentPosition(b)&16)==16}:"contains"in c?function(a,b){return a!==b&&a.contains(b)}:function(a,b){while(b=b[d])if(b===a)return!0;return!1};return ab});provide("bonzo",a.exports);(function(a){function c(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1}function d(a){var b=[],c=0,d=0,e,f,g;for(;f=a[c];++c){g=!1;for(e=0;e<b.length;++e)if(b[e]===f){g=!0;break}g||(b[d++]=f)}return b}function e(a,c){return typeof c=="undefined"?b(this).dim()[a]:this.css(a,c)}var b=require("bonzo");b.setQueryEngine(a);a.ender(b);a.ender(b(),!0);a.ender({create:function(c){return a(b.create(c))}});a.id=function(b){return a([document.getElementById(b)])};a.ender({parents:function(b,e){if(!this.length)return this;b||(b="*");var f=a(b),g,h,i,j=[];for(g=0,h=this.length;g<h;g++){i=this[g];while(i=i.parentNode)if(~c(f,i)){j.push(i);if(e)break}}return a(d(j))},parent:function(){return a(d(b(this).parent()))},closest:function(a){return this.parents(a,!0)},first:function(){return a(this.length?this[0]:this)},last:function(){return a(this.length?this[this.length-1]:[])},next:function(){return a(b(this).next())},previous:function(){return a(b(this).previous())},appendTo:function(a){return b(this.selector).appendTo(a,this)},prependTo:function(a){return b(this.selector).prependTo(a,this)},insertAfter:function(a){return b(this.selector).insertAfter(a,this)},insertBefore:function(a){return b(this.selector).insertBefore(a,this)},siblings:function(){var b,c,d,e=[];for(b=0,c=this.length;b<c;b++){d=this[b];while(d=d.previousSibling)d.nodeType==1&&e.push(d);d=this[b];while(d=d.nextSibling)d.nodeType==1&&e.push(d)}return a(e)},children:function(){var c,e,f,g=[];for(c=0,e=this.length;c<e;c++){if(!(f=b.firstChild(this[c])))continue;g.push(f);while(f=f.nextSibling)f.nodeType==1&&g.push(f)}return a(d(g))},height:function(a){return e.call(this,"height",a)},width:function(a){return e.call(this,"width",a)}},!0)})(ender)})()
Пример #2
0
!function(b,c){typeof a!="undefined"?a.exports=c():typeof define=="function"&&define.amd?define(b,c):this[b]=c()}("bonzo",function(){function C(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function D(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c||a[d],a[d],d,a);return a}function E(a,b,c){for(var d=0,e=a.length;d<e;d++)K(a[d])&&(E(a[d].childNodes,b,c),b.call(c||a[d],a[d],d,a));return a}function F(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function G(a){return a?a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():a}function H(a){return a[w]("data-node-uid")||a[v]("data-node-uid",++r),uid=a[w]("data-node-uid"),q[uid]||(q[uid]={})}function I(a){uid=a[w]("data-node-uid"),uid&&delete q[uid]}function J(a){try{return a==="true"?!0:a==="false"?!1:a==="null"?null:isNaN(a)?a:parseFloat(a)}catch(b){}return undefined}function K(a){return a&&a.nodeName&&a.nodeType==1}function L(a,b,c,d){for(d=0,j=a.length;d<j;++d)if(b.call(c,a[d],d,a))return!0;return!1}function M(a){return a=="transform"&&(a=y.transform)||/^transform-?[Oo]rigin$/.test(a)&&(a=y.transform+"Origin")||a=="float"&&(a=y.cssFloat),a?F(a):null}function O(a,b,c){var d=0,e=b||this,h=[],i=g&&typeof a=="string"&&a.charAt(0)!="<"?g(a):a;return D(V(i),function(a){D(e,function(b){var g=!b[f]||b[f]&&!b[f][f]?function(){var a=b.cloneNode(!0);return e.$&&e.cloneEvents&&e.$(a).cloneEvents(b),a}():b;c(a,g),h[d]=g,d++})},this),D(h,function(a,b){e[b]=a}),e.length=d,e}function P(a,b,c){var d=Z(a),e=d.css("position"),f=d.offset(),g="relative",h=e==g,i=[parseInt(d.css("left"),10),parseInt(d.css("top"),10)];e=="static"&&(d.css("position",g),e=g),isNaN(i[0])&&(i[0]=h?0:a.offsetLeft),isNaN(i[1])&&(i[1]=h?0:a.offsetTop),b!=null&&(a.style.left=b-f.left+i[0]+u),c!=null&&(a.style.top=c-f.top+i[1]+u)}function Q(a,b){return C(b).test(a.className)}function R(a,b){a.className=B(a.className+" "+b)}function S(a,b){a.className=B(a.className.replace(C(b)," "))}function T(a,b){return typeof b=="function"?b(a):b}function U(a){this.length=0;if(a){a=typeof a!="string"&&!a.nodeType&&typeof a.length!="undefined"?a:[a],this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]}}function V(a){return typeof a=="string"?Z.create(a):K(a)?[a]:a}function W(a,b,d){var e=this[0];return a==null&&b==null?(X(e)?Y():{x:e.scrollLeft,y:e.scrollTop})[d]:(X(e)?c.scrollTo(a,b):(a!=null&&(e.scrollLeft=a),b!=null&&(e.scrollTop=b)),this)}function X(a){return a===c||/^(?:body|html)$/i.test(a.tagName)}function Y(){return{x:c.pageXOffset||e.scrollLeft,y:c.pageYOffset||e.scrollTop}}function Z(a,b){return new U(a,b)}var a=this,b=a.bonzo,c=window,d=c.document,e=d.documentElement,f="parentNode",g=null,h=/^checked|value|selected$/,i=/select|fieldset|table|tbody|tfoot|td|tr|colgroup/i,k=["<table>","</table>",1],l=["<table><tbody><tr>","</tr></tbody></table>",3],m=["<select>","</select>",1],n={thead:k,tbody:k,tfoot:k,colgroup:k,caption:k,tr:["<table><tbody>","</tbody></table>",2],th:l,td:l,col:["<table><colgroup>","</colgroup></table>",2],fieldset:["<form>","</form>",1],legend:["<form><fieldset>","</fieldset></form>",2],option:m,optgroup:m},o=/^checked|selected$/,p=/msie/i.test(navigator.userAgent),q={},r=0,s=/^-?[\d\.]+$/,t=/^data-(.+)$/,u="px",v="setAttribute",w="getAttribute",x="getElementsByTagName",y=function(){var a=d.createElement("p");return a.innerHTML='<a href="#x">x</a><table style="float:left;"></table>',{hrefExtended:a[x]("a")[0][w]("href")!="#x",autoTbody:a[x]("tbody").length!==0,computedStyle:d.defaultView&&d.defaultView.getComputedStyle,cssFloat:a[x]("table")[0].style.styleFloat?"styleFloat":"cssFloat",transform:function(){var b=["webkitTransform","MozTransform","OTransform","msTransform","Transform"],c;for(c=0;c<b.length;c++)if(b[c]in a.style)return b[c]}()}}(),z=/(^\s*|\s*$)/g,A={lineHeight:1,zoom:1,zIndex:1,opacity:1},B=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(z,"")},N=y.computedStyle?function(a,b){var c=null,e=d.defaultView.getComputedStyle(a,"");return e&&(c=e[b]),a.style[b]||c}:p&&e.currentStyle?function(a,b){if(b=="opacity"){var c=100;try{c=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(d){try{c=a.filters("alpha").opacity}catch(e){}}return c/100}var f=a.currentStyle?a.currentStyle[b]:null;return a.style[b]||f}:function(a,b){return a.style[b]};return U.prototype={get:function(a){return this[a]},each:function(a,b){return D(this,a,b)},deepEach:function(a,b){return E(this,a,b)},map:function(a,b){var c=[],d,e;for(e=0;e<this.length;e++)d=a.call(this,this[e],e),b?b(d)&&c.push(d):c.push(d);return c},first:function(){return Z(this.length?this[0]:[])},last:function(){return Z(this.length?this[this.length-1]:[])},html:function(a,b){function f(b){D(V(a),function(a){b.appendChild(a)})}var c=b?e.textContent===undefined?"innerText":"textContent":"innerHTML",d;return typeof a!="undefined"?this.empty().each(function(e){!b&&(d=e.tagName.match(i))?f(e,d[0]):e[c]=a}):this[0]?this[0][c]:""},text:function(a){return this.html(a,1)},addClass:function(a){return this.each(function(b){Q(b,T(b,a))||R(b,T(b,a))})},removeClass:function(a){return this.each(function(b){Q(b,T(b,a))&&S(b,T(b,a))})},hasClass:function(a){return L(this,function(b){return Q(b,a)})},toggleClass:function(a,b){return this.each(function(c){typeof b!="undefined"?b?R(c,a):S(c,a):Q(c,a)?S(c,a):R(c,a)})},show:function(a){return this.each(function(b){b.style.display=a||""})},hide:function(){return this.each(function(a){a.style.display="none"})},append:function(a){return this.each(function(b){D(V(a),function(a){b.appendChild(a)})})},prepend:function(a){return this.each(function(b){var c=b.firstChild;D(V(a),function(a){b.insertBefore(a,c)})})},appendTo:function(a,b){return O.call(this,a,b,function(a,b){a.appendChild(b)})},prependTo:function(a,b){return O.call(this,a,b,function(a,b){a.insertBefore(b,a.firstChild)})},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},related:function(a){return this.map(function(b){b=b[a];while(b&&b.nodeType!==1)b=b[a];return b||0},function(a){return a})},before:function(a){return this.each(function(b){D(Z.create(a),function(a){b[f].insertBefore(a,b)})})},after:function(a){return this.each(function(b){D(Z.create(a),function(a){b[f].insertBefore(a,b.nextSibling)})})},insertBefore:function(a,b){return O.call(this,a,b,function(a,b){a[f].insertBefore(b,a)})},insertAfter:function(a,b){return O.call(this,a,b,function(a,b){var c=a.nextSibling;c?a[f].insertBefore(b,c):a[f].appendChild(b)})},replaceWith:function(a){return this.deepEach(I),this.each(function(b){b.parentNode.replaceChild(Z.create(a)[0],b)})},css:function(a,b,e){function g(a,b,c){for(var d in f)f.hasOwnProperty(d)&&(c=f[d],(b=M(d))&&s.test(c)&&!(b in A)&&(c+=u),a.style[b]=T(a,c))}if(b===undefined&&typeof a=="string")return b=this[0],b?b===d||b===c?(e=b===d?Z.doc():Z.viewport(),a=="width"?e.width:a=="height"?e.height:""):(a=M(a))?N(b,a):null:null;var f=a;return typeof a=="string"&&(f={},f[a]=b),p&&f.opacity&&(f.filter="alpha(opacity="+f.opacity*100+")",f.zoom=a.zoom||1,delete f.opacity),this.each(g)},offset:function(a,b){if(typeof a=="number"||typeof b=="number")return this.each(function(c){P(c,a,b)});if(!this[0])return{top:0,left:0,height:0,width:0};var c=this[0],d=c.offsetWidth,e=c.offsetHeight,f=c.offsetTop,g=c.offsetLeft;while(c=c.offsetParent)f+=c.offsetTop,g+=c.offsetLeft;return{top:f,left:g,height:e,width:d}},dim:function(){var a=this[0],b=!a.offsetWidth&&!a.offsetHeight?function(b,c){return c={position:a.style.position||"",visibility:a.style.visibility||"",display:a.style.display||""},b.first().css({position:"absolute",visibility:"hidden",display:"block"}),c}(this):null,c=a.offsetWidth,d=a.offsetHeight;return b&&this.first().css(b),{height:d,width:c}},attr:function(a,b){var c=this[0];if(typeof a=="string"||a instanceof String)return typeof b=="undefined"?h.test(a)?o.test(a)&&typeof c[a]=="string"?!0:c[a]:a!="href"&&a!="src"||!y.hrefExtended?c[w](a):c[w](a,2):this.each(function(c){h.test(a)?c[a]=T(c,b):c[v](a,T(c,b))});for(var d in a)a.hasOwnProperty(d)&&this.attr(d,a[d]);return this},val:function(a){return typeof a=="string"?this.attr("value",a):this[0].value},removeAttr:function(a){return this.each(function(b){o.test(a)?b[a]=!1:b.removeAttribute(a)})},data:function(a,b){var c=this[0],d,e,f;return typeof b=="undefined"?(e=H(c),typeof a=="undefined"?(D(c.attributes,function(a){(f=(""+a.name).match(t))&&(e[F(f[1])]=J(a.value))}),e):typeof e[a]=="undefined"?e[a]=J(this.attr("data-"+G(a))):e[a]):this.each(function(c){H(c)[a]=b})},remove:function(){return this.deepEach(I),this.each(function(a){a[f]&&a[f].removeChild(a)})},empty:function(){return this.each(function(a){E(a.childNodes,I);while(a.firstChild)a.removeChild(a.firstChild)})},detach:function(){return this.map(function(a){return a[f].removeChild(a)})},scrollTop:function(a){return W.call(this,null,a,"y")},scrollLeft:function(a){return W.call(this,a,null,"x")},toggle:function(a,b){return this.each(function(a){a.style.display=a.offsetWidth||a.offsetHeight?"none":b||""}),a&&a(),this}},Z.setQueryEngine=function(a){g=a,delete Z.setQueryEngine},Z.aug=function(a,b){for(var c in a)a.hasOwnProperty(c)&&((b||U.prototype)[c]=a[c])},Z.create=function(a){return typeof a=="string"&&a!==""?function(){var b=/^\s*<([^\s>]+)/.exec(a),c=d.createElement("div"),e=[],g=b?n[b[1].toLowerCase()]:null,h=g?g[2]+1:1,i=f,j=y.autoTbody&&g&&g[0]=="<table>"&&!/<tbody/i.test(a);c.innerHTML=g?g[0]+a+g[1]:a;while(h--)c=c.firstChild;do(!b||c.nodeType==1)&&(!j||c.tagName.toLowerCase()!="tbody")&&e.push(c);while(c=c.nextSibling);return D(e,function(a){a[i]&&a[i].removeChild(a)}),e}():K(a)?[a.cloneNode(!0)]:[]},Z.doc=function(){var a=Z.viewport();return{width:Math.max(d.body.scrollWidth,e.scrollWidth,a.width),height:Math.max(d.body.scrollHeight,e.scrollHeight,a.height)}},Z.firstChild=function(a){for(var b=a.childNodes,c=0,d=b&&b.length||0,e;c<d;c++)b[c].nodeType===1&&(e=b[d=c]);return e},Z.viewport=function(){return{width:p?e.clientWidth:self.innerWidth,height:p?e.clientHeight:self.innerHeight}},Z.isAncestor="compareDocumentPosition"in e?function(a,b){return(a.compareDocumentPosition(b)&16)==16}:"contains"in e?function(a,b){return a!==b&&a.contains(b)}:function(a,b){while(b=b[f])if(b===a)return!0;return!1},Z.noConflict=function(){return a.bonzo=b,this},Z}),provide("bonzo",a.exports),!function(a){function c(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1}function d(a){var b=[],c,d;e:for(c=0;c<a.length;c++){for(d=0;d<b.length;d++)if(b[d]==a[c])continue e;b[b.length]=a[c]}return b}function e(a,b,c){return a?b.css(c,a):function(a){return b[0]?(a=parseInt(b.css(c),10),isNaN(a)?b[0]["offset"+c.replace(/^\w/,function(a){return a.toUpperCase()})]:a):0}()}var b=require("bonzo");b.setQueryEngine(a),a.ender(b),a.ender(b(),!0),a.ender({create:function(c){return a(b.create(c))}}),a.id=function(b){return a([document.getElementById(b)])},a.ender({parents:function(b,e){var f=a(b),g,h,i,j=[];for(g=0,h=this.length;g<h;g++){i=this[g];while(i=i.parentNode)if(~c(f,i)){j.push(i);if(e)break}}return a(d(j))},closest:function(a){return this.parents(a,!0)},first:function(){return a(this.length?this[0]:this)},last:function(){return a(this.length?this[this.length-1]:[])},next:function(){return a(b(this).next())},previous:function(){return a(b(this).previous())},appendTo:function(a){return b(this.selector).appendTo(a,this)},prependTo:function(a){return b(this.selector).prependTo(a,this)},insertAfter:function(a){return b(this.selector).insertAfter(a,this)},insertBefore:function(a){return b(this.selector).insertBefore(a,this)},siblings:function(){var b,c,d,e=[];for(b=0,c=this.length;b<c;b++){d=this[b];while(d=d.previousSibling)d.nodeType==1&&e.push(d);d=this[b];while(d=d.nextSibling)d.nodeType==1&&e.push(d)}return a(e)},children:function(){var c,e,f=[];for(c=0,l=this.length;c<l;c++){if(!(e=b.firstChild(this[c])))continue;f.push(e);while(e=e.nextSibling)e.nodeType==1&&f.push(e)}return a(d(f))},height:function(a){return e(a,this,"height")},width:function(a){return e(a,this,"width")}},!0)}(ender)}()
(function(b,c,d){typeof a!="undefined"&&a.exports?a.exports=c():typeof d["define"]!="undefined"&&d["define"]=="function"&&d.define.amd?define(b,c):d[b]=c()})("bonzo",function(){function G(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function H(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c||a[d],a[d],d,a);return a}function I(a,b,c){for(var d=0,e=a.length;d<e;d++)O(a[d])&&(I(a[d].childNodes,b,c),b.call(c||a[d],a[d],d,a));return a}function J(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function K(a){return a?a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():a}function L(a){a[y]("data-node-uid")||a[x]("data-node-uid",++t);var b=a[y]("data-node-uid");return s[b]||(s[b]={})}function M(a){var b=a[y]("data-node-uid");b&&delete s[b]}function N(a,b){try{return a===null||a===undefined?undefined:a==="true"?!0:a==="false"?!1:a==="null"?null:(b=parseFloat(a))==a?b:a}catch(c){}return undefined}function O(a){return a&&a.nodeName&&a.nodeType==1}function P(a,b,c,d,e){for(d=0,e=a.length;d<e;++d)if(b.call(c,a[d],d,a))return!0;return!1}function Q(a){return a=="transform"&&(a=A.transform)||/^transform-?[Oo]rigin$/.test(a)&&(a=A.transform+"Origin")||a=="float"&&(a=A.cssFloat),a?J(a):null}function S(a,b,c){var d=0,g=b||this,h=[],i=f&&typeof a=="string"&&a.charAt(0)!="<"?f(a):a;return H(W(i),function(a){H(g,function(b){var f=!b[e]||b[e]&&!b[e][e]?function(){var a=b.cloneNode(!0),c,d;if(g.$&&g.cloneEvents){g.$(a).cloneEvents(b),c=g.$(a).find("*"),d=g.$(b).find("*");for(var e=0;e<d.length;e++)g.$(c[e]).cloneEvents(d[e])}return a}():b;c(a,f),h[d]=f,d++})},this),H(h,function(a,b){g[b]=a}),g.length=d,g}function T(a,b,c){var d=$(a),e=d.css("position"),f=d.offset(),g="relative",h=e==g,i=[parseInt(d.css("left"),10),parseInt(d.css("top"),10)];e=="static"&&(d.css("position",g),e=g),isNaN(i[0])&&(i[0]=h?0:a.offsetLeft),isNaN(i[1])&&(i[1]=h?0:a.offsetTop),b!=null&&(a.style.left=b-f.left+i[0]+w),c!=null&&(a.style.top=c-f.top+i[1]+w)}function U(a,b){return typeof b=="function"?b(a):b}function V(a){this.length=0;if(a){a=typeof a!="string"&&!a.nodeType&&typeof a.length!="undefined"?a:[a],this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]}}function W(a){return typeof a=="string"?$.create(a):O(a)?[a]:a}function X(a,c,d){var e=this[0];return e?a==null&&c==null?(Y(e)?Z():{x:e.scrollLeft,y:e.scrollTop})[d]:(Y(e)?b.scrollTo(a,c):(a!=null&&(e.scrollLeft=a),c!=null&&(e.scrollTop=c)),this):this}function Y(a){return a===b||/^(?:body|html)$/i.test(a.tagName)}function Z(){return{x:b.pageXOffset||d.scrollLeft,y:b.pageYOffset||d.scrollTop}}function $(a,b){return new V(a,b)}var a=this,b=window,c=b.document,d=c.documentElement,e="parentNode",f=null,g=/^(checked|value|selected)$/i,h=/^(select|fieldset|table|tbody|tfoot|td|tr|colgroup)$/i,i=["<table>","</table>",1],j=["<table><tbody><tr>","</tr></tbody></table>",3],k=["<select>","</select>",1],l=["_","",0,1],m={thead:i,tbody:i,tfoot:i,colgroup:i,caption:i,tr:["<table><tbody>","</tbody></table>",2],th:j,td:j,col:["<table><colgroup>","</colgroup></table>",2],fieldset:["<form>","</form>",1],legend:["<form><fieldset>","</fieldset></form>",2],option:k,optgroup:k,script:l,style:l,link:l,param:l,base:l},n=/^(checked|selected)$/,o=/msie/i.test(navigator.userAgent),p,q,r,s={},t=0,u=/^-?[\d\.]+$/,v=/^data-(.+)$/,w="px",x="setAttribute",y="getAttribute",z="getElementsByTagName",A=function(){var a=c.createElement("p");return a.innerHTML='<a href="#x">x</a><table style="float:left;"></table>',{hrefExtended:a[z]("a")[0][y]("href")!="#x",autoTbody:a[z]("tbody").length!==0,computedStyle:c.defaultView&&c.defaultView.getComputedStyle,cssFloat:a[z]("table")[0].style.styleFloat?"styleFloat":"cssFloat",transform:function(){var b=["webkitTransform","MozTransform","OTransform","msTransform","Transform"],c;for(c=0;c<b.length;c++)if(b[c]in a.style)return b[c]}(),classList:"classList"in a}}(),B=/(^\s*|\s*$)/g,C=/\s+/,D=String.prototype.toString,E={lineHeight:1,zoom:1,zIndex:1,opacity:1,boxFlex:1,WebkitBoxFlex:1,MozBoxFlex:1},F=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(B,"")},R=A.computedStyle?function(a,b){var d=null,e=c.defaultView.getComputedStyle(a,"");return e&&(d=e[b]),a.style[b]||d}:o&&d.currentStyle?function(a,b){if(b=="opacity"){var c=100;try{c=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(d){try{c=a.filters("alpha").opacity}catch(e){}}return c/100}var f=a.currentStyle?a.currentStyle[b]:null;return a.style[b]||f}:function(a,b){return a.style[b]};return A.classList?(p=function(a,b){return a.classList.contains(b)},q=function(a,b){a.classList.add(b)},r=function(a,b){a.classList.remove(b)}):(p=function(a,b){return G(b).test(a.className)},q=function(a,b){a.className=F(a.className+" "+b)},r=function(a,b){a.className=F(a.className.replace(G(b)," "))}),V.prototype={get:function(a){return this[a]||null},each:function(a,b){return H(this,a,b)},deepEach:function(a,b){return I(this,a,b)},map:function(a,b){var c=[],d,e;for(e=0;e<this.length;e++)d=a.call(this,this[e],e),b?b(d)&&c.push(d):c.push(d);return c},html:function(a,b){function e(b){H(W(a),function(a){b.appendChild(a)})}var c=b?d.textContent===undefined?"innerText":"textContent":"innerHTML";return typeof a!="undefined"?this.empty().each(function(d){!b&&h.test(d.tagName)?e(d):function(){try{d[c]=a}catch(b){e(d)}}()}):this[0]?this[0][c]:""},text:function(a){return this.html(a,1)},append:function(a){return this.each(function(b){H(W(a),function(a){b.appendChild(a)})})},prepend:function(a){return this.each(function(b){var c=b.firstChild;H(W(a),function(a){b.insertBefore(a,c)})})},appendTo:function(a,b){return S.call(this,a,b,function(a,b){a.appendChild(b)})},prependTo:function(a,b){return S.call(this,a,b,function(a,b){a.insertBefore(b,a.firstChild)})},before:function(a){return this.each(function(b){H($.create(a),function(a){b[e].insertBefore(a,b)})})},after:function(a){return this.each(function(b){H($.create(a),function(a){b[e].insertBefore(a,b.nextSibling)})})},insertBefore:function(a,b){return S.call(this,a,b,function(a,b){a[e].insertBefore(b,a)})},insertAfter:function(a,b){return S.call(this,a,b,function(a,b){var c=a.nextSibling;c?a[e].insertBefore(b,c):a[e].appendChild(b)})},replaceWith:function(a){return this.deepEach(M),this.each(function(b){b.parentNode.replaceChild($.create(a)[0],b)})},addClass:function(a){return a=D.call(a).split(C),this.each(function(b){H(a,function(a){a&&!p(b,U(b,a))&&q(b,U(b,a))})})},removeClass:function(a){return a=D.call(a).split(C),this.each(function(b){H(a,function(a){a&&p(b,U(b,a))&&r(b,U(b,a))})})},hasClass:function(a){return a=D.call(a).split(C),P(this,function(b){return P(a,function(a){return a&&p(b,a)})})},toggleClass:function(a,b){return a=D.call(a).split(C),this.each(function(c){H(a,function(a){a&&(typeof b!="undefined"?b?q(c,a):r(c,a):p(c,a)?r(c,a):q(c,a))})})},show:function(a){return this.each(function(b){b.style.display=a||""})},hide:function(){return this.each(function(a){a.style.display="none"})},toggle:function(a,b){return this.each(function(a){a.style.display=a.offsetWidth||a.offsetHeight?"none":b||""}),a&&a(),this},first:function(){return $(this.length?this[0]:[])},last:function(){return $(this.length?this[this.length-1]:[])},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},parent:function(){return this.related(e)},related:function(a){return this.map(function(b){b=b[a];while(b&&b.nodeType!==1)b=b[a];return b||0},function(a){return a})},focus:function(){return this.length&&this[0].focus(),this},blur:function(){return this.each(function(a){a.blur()})},css:function(a,d,e){function g(a,b,c){for(var d in f)f.hasOwnProperty(d)&&(c=f[d],(b=Q(d))&&u.test(c)&&!(b in E)&&(c+=w),a.style[b]=U(a,c))}if(d===undefined&&typeof a=="string")return d=this[0],d?d===c||d===b?(e=d===c?$.doc():$.viewport(),a=="width"?e.width:a=="height"?e.height:""):(a=Q(a))?R(d,a):null:null;var f=a;return typeof a=="string"&&(f={},f[a]=d),o&&f.opacity&&(f.filter="alpha(opacity="+f.opacity*100+")",f.zoom=a.zoom||1,delete f.opacity),this.each(g)},offset:function(a,b){if(typeof a=="number"||typeof b=="number")return this.each(function(c){T(c,a,b)});if(!this[0])return{top:0,left:0,height:0,width:0};var c=this[0],d=c.offsetWidth,e=c.offsetHeight,f=c.offsetTop,g=c.offsetLeft;while(c=c.offsetParent)f+=c.offsetTop,g+=c.offsetLeft,c!=document.body&&(f-=c.scrollTop,g-=c.scrollLeft);return{top:f,left:g,height:e,width:d}},dim:function(){if(!this.length)return{height:0,width:0};var a=this[0],b=!a.offsetWidth&&!a.offsetHeight?function(b,c){return c={position:a.style.position||"",visibility:a.style.visibility||"",display:a.style.display||""},b.first().css({position:"absolute",visibility:"hidden",display:"block"}),c}(this):null,c=a.offsetWidth,d=a.offsetHeight;return b&&this.first().css(b),{height:d,width:c}},attr:function(a,b){var c=this[0];if(typeof a=="string"||a instanceof String)return typeof b=="undefined"?c?g.test(a)?n.test(a)&&typeof c[a]=="string"?!0:c[a]:a!="href"&&a!="src"||!A.hrefExtended?c[y](a):c[y](a,2):null:this.each(function(c){g.test(a)?c[a]=U(c,b):c[x](a,U(c,b))});for(var d in a)a.hasOwnProperty(d)&&this.attr(d,a[d]);return this},removeAttr:function(a){return this.each(function(b){n.test(a)?b[a]=!1:b.removeAttribute(a)})},val:function(a){return typeof a=="string"?this.attr("value",a):this.length?this[0].value:null},data:function(a,b){var c=this[0],d,e,f;return typeof b=="undefined"?c?(e=L(c),typeof a=="undefined"?(H(c.attributes,function(a){(f=(""+a.name).match(v))&&(e[J(f[1])]=N(a.value))}),e):(typeof e[a]=="undefined"&&(e[a]=N(this.attr("data-"+K(a)))),e[a])):null:this.each(function(c){L(c)[a]=b})},remove:function(){return this.deepEach(M),this.each(function(a){a[e]&&a[e].removeChild(a)})},empty:function(){return this.each(function(a){I(a.childNodes,M);while(a.firstChild)a.removeChild(a.firstChild)})},detach:function(){return this.map(function(a){return a[e].removeChild(a)})},scrollTop:function(a){return X.call(this,null,a,"y")},scrollLeft:function(a){return X.call(this,a,null,"x")}},$.setQueryEngine=function(a){f=a,delete $.setQueryEngine},$.aug=function(a,b){for(var c in a)a.hasOwnProperty(c)&&((b||V.prototype)[c]=a[c])},$.create=function(a){return typeof a=="string"&&a!==""?function(){var b=/^\s*<([^\s>]+)/.exec(a),d=c.createElement("div"),f=[],g=b?m[b[1].toLowerCase()]:null,h=g?g[2]+1:1,i=g&&g[3],j=e,k=A.autoTbody&&g&&g[0]=="<table>"&&!/<tbody/i.test(a);d.innerHTML=g?g[0]+a+g[1]:a;while(h--)d=d.firstChild;i&&d&&d.nodeType!==1&&(d=d.nextSibling);do(!b||d.nodeType==1)&&(!k||d.tagName.toLowerCase()!="tbody")&&f.push(d);while(d=d.nextSibling);return H(f,function(a){a[j]&&a[j].removeChild(a)}),f}():O(a)?[a.cloneNode(!0)]:[]},$.doc=function(){var a=$.viewport();return{width:Math.max(c.body.scrollWidth,d.scrollWidth,a.width),height:Math.max(c.body.scrollHeight,d.scrollHeight,a.height)}},$.firstChild=function(a){for(var b=a.childNodes,c=0,d=b&&b.length||0,e;c<d;c++)b[c].nodeType===1&&(e=b[d=c]);return e},$.viewport=function(){return{width:o?d.clientWidth:self.innerWidth,height:o?d.clientHeight:self.innerHeight}},$.isAncestor="compareDocumentPosition"in d?function(a,b){return(a.compareDocumentPosition(b)&16)==16}:"contains"in d?function(a,b){return a!==b&&a.contains(b)}:function(a,b){while(b=b[e])if(b===a)return!0;return!1},$},this),provide("bonzo",a.exports),function(a){function c(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1}function d(a){var b=[],c=0,d=0,e,f,g;for(;f=a[c];++c){g=!1;for(e=0;e<b.length;++e)if(b[e]===f){g=!0;break}g||(b[d++]=f)}return b}function e(a,c){return typeof c=="undefined"?b(this).dim()[a]:this.css(a,c)}var b=require("bonzo");b.setQueryEngine(a),a.ender(b),a.ender(b(),!0),a.ender({create:function(c){return a(b.create(c))}}),a.id=function(b){return a([document.getElementById(b)])},a.ender({parents:function(b,e){if(!this.length)return this;var f=a(b),g,h,i,j=[];for(g=0,h=this.length;g<h;g++){i=this[g];while(i=i.parentNode)if(~c(f,i)){j.push(i);if(e)break}}return a(d(j))},parent:function(){return a(d(b(this).parent()))},closest:function(a){return this.parents(a,!0)},first:function(){return a(this.length?this[0]:this)},last:function(){return a(this.length?this[this.length-1]:[])},next:function(){return a(b(this).next())},previous:function(){return a(b(this).previous())},appendTo:function(a){return b(this.selector).appendTo(a,this)},prependTo:function(a){return b(this.selector).prependTo(a,this)},insertAfter:function(a){return b(this.selector).insertAfter(a,this)},insertBefore:function(a){return b(this.selector).insertBefore(a,this)},siblings:function(){var b,c,d,e=[];for(b=0,c=this.length;b<c;b++){d=this[b];while(d=d.previousSibling)d.nodeType==1&&e.push(d);d=this[b];while(d=d.nextSibling)d.nodeType==1&&e.push(d)}return a(e)},children:function(){var c,e,f,g=[];for(c=0,e=this.length;c<e;c++){if(!(f=b.firstChild(this[c])))continue;g.push(f);while(f=f.nextSibling)f.nodeType==1&&g.push(f)}return a(d(g))},height:function(a){return e.call(this,"height",a)},width:function(a){return e.call(this,"width",a)}},!0)}(ender)}()
Пример #4
0
(function(t,n,r){typeof e!="undefined"&&e.exports?e.exports=r():typeof define=="function"&&define.amd?define(r):n[t]=r()})("bonzo",this,function(){function D(e){return e&&e.nodeName&&(e.nodeType==1||e.nodeType==11)}function P(e,t,n){var r,i,s;if(typeof e=="string")return et.create(e);D(e)&&(e=[e]);if(n){s=[];for(r=0,i=e.length;r<i;r++)s[r]=Q(t,e[r]);return s}return e}function H(e){return new RegExp("(^|\\s+)"+e+"(\\s+|$)")}function B(e,t,n,r){var i,s=0,o=e.length;for(;s<o;s++)i=r?e.length-s-1:s,t.call(n||e[i],e[i],i,e);return e}function j(e,t,n){for(var r=0,i=e.length;r<i;r++)D(e[r])&&(j(e[r].childNodes,t,n),t.call(n||e[r],e[r],r,e));return e}function F(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function I(e){return e?e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():e}function q(e){e[x]("data-node-uid")||e[S]("data-node-uid",++y);var t=e[x]("data-node-uid");return g[t]||(g[t]={})}function R(e){var t=e[x]("data-node-uid");t&&delete g[t]}function U(e){var t;try{return e===null||e===undefined?undefined:e==="true"?!0:e==="false"?!1:e==="null"?null:(t=parseFloat(e))==e?t:e}catch(n){}return undefined}function z(e,t,n){for(var r=0,i=e.length;r<i;++r)if(t.call(n||null,e[r],r,e))return!0;return!1}function W(e){return e=="transform"&&(e=N.transform)||/^transform-?[Oo]rigin$/.test(e)&&(e=N.transform+"Origin")||e=="float"&&(e=N.cssFloat),e?F(e):null}function X(e,t,n,r){var i=0,s=t||this,o=[],u=O&&typeof e=="string"&&e.charAt(0)!="<"?O(e):e;return B(P(u),function(e,t){B(s,function(r){n(e,o[i++]=t>0?Q(s,r):r)},null,r)},this,r),s.length=i,B(o,function(e){s[--i]=e},null,!r),s}function V(e,t,n){var r=et(e),i=r.css("position"),s=r.offset(),o="relative",u=i==o,a=[parseInt(r.css("left"),10),parseInt(r.css("top"),10)];i=="static"&&(r.css("position",o),i=o),isNaN(a[0])&&(a[0]=u?0:e.offsetLeft),isNaN(a[1])&&(a[1]=u?0:e.offsetTop),t!=null&&(e.style.left=t-s.left+a[0]+E),n!=null&&(e.style.top=n-s.top+a[1]+E)}function $(e,t){return typeof t=="function"?t(e):t}function J(t,n,r){var i=this[0];return i?t==null&&n==null?(G(i)?Y():{x:i.scrollLeft,y:i.scrollTop})[r]:(G(i)?e.scrollTo(t,n):(t!=null&&(i.scrollLeft=t),n!=null&&(i.scrollTop=n)),this):this}function K(e){this.length=0;if(e){e=typeof e!="string"&&!e.nodeType&&typeof e.length!="undefined"?e:[e],this.length=e.length;for(var t=0;t<e.length;t++)this[t]=e[t]}}function Q(e,t){var n=t.cloneNode(!0),r,i,s;if(e.$&&typeof e.cloneEvents=="function"){e.$(n).cloneEvents(t),r=e.$(n).find("*"),i=e.$(t).find("*");for(s=0;s<i.length;s++)e.$(r[s]).cloneEvents(i[s])}return n}function G(t){return t===e||/^(?:body|html)$/i.test(t.tagName)}function Y(){return{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop}}function Z(e){var t=document.createElement("script"),n=e.match(o);return t.src=n[1],t}function et(e){return new K(e)}var e=window,t=e.document,n=t.documentElement,r="parentNode",i=/^(checked|value|selected|disabled)$/i,s=/^(select|fieldset|table|tbody|tfoot|td|tr|colgroup)$/i,o=/\s*<script +src=['"]([^'"]+)['"]>/,u=["<table>","</table>",1],a=["<table><tbody><tr>","</tr></tbody></table>",3],f=["<select>","</select>",1],l=["_","",0,1],c={thead:u,tbody:u,tfoot:u,colgroup:u,caption:u,tr:["<table><tbody>","</tbody></table>",2],th:a,td:a,col:["<table><colgroup>","</colgroup></table>",2],fieldset:["<form>","</form>",1],legend:["<form><fieldset>","</fieldset></form>",2],option:f,optgroup:f,script:l,style:l,link:l,param:l,base:l},h=/^(checked|selected|disabled)$/,p=/msie/i.test(navigator.userAgent),d,v,m,g={},y=0,b=/^-?[\d\.]+$/,w=/^data-(.+)$/,E="px",S="setAttribute",x="getAttribute",T="getElementsByTagName",N=function(){var e=t.createElement("p");return e.innerHTML='<a href="#x">x</a><table style="float:left;"></table>',{hrefExtended:e[T]("a")[0][x]("href")!="#x",autoTbody:e[T]("tbody").length!==0,computedStyle:t.defaultView&&t.defaultView.getComputedStyle,cssFloat:e[T]("table")[0].style.styleFloat?"styleFloat":"cssFloat",transform:function(){var t=["transform","webkitTransform","MozTransform","OTransform","msTransform"],n;for(n=0;n<t.length;n++)if(t[n]in e.style)return t[n]}(),classList:"classList"in e,opasity:function(){return typeof t.createElement("a").style.opacity!="undefined"}()}}(),C=/(^\s*|\s*$)/g,k=/\s+/,L=String.prototype.toString,A={lineHeight:1,zoom:1,zIndex:1,opacity:1,boxFlex:1,WebkitBoxFlex:1,MozBoxFlex:1},O=t.querySelectorAll&&function(e){return t.querySelectorAll(e)},M=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(C,"")},_=N.computedStyle?function(e,n){var r=null,i=t.defaultView.getComputedStyle(e,"");return i&&(r=i[n]),e.style[n]||r}:!p||!n.currentStyle?function(e,t){return e.style[t]}:function(e,t){var n,r;if(t=="opacity"&&!N.opasity){n=100;try{n=e.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(i){try{n=e.filters("alpha").opacity}catch(s){}}return n/100}return r=e.currentStyle?e.currentStyle[t]:null,e.style[t]||r};return N.classList?(d=function(e,t){return e.classList.contains(t)},v=function(e,t){e.classList.add(t)},m=function(e,t){e.classList.remove(t)}):(d=function(e,t){return H(t).test(e.className)},v=function(e,t){e.className=M(e.className+" "+t)},m=function(e,t){e.className=M(e.className.replace(H(t)," "))}),K.prototype={get:function(e){return this[e]||null},each:function(e,t){return B(this,e,t)},deepEach:function(e,t){return j(this,e,t)},map:function(e,t){var n=[],r,i;for(i=0;i<this.length;i++)r=e.call(this,this[i],i),t?t(r)&&n.push(r):n.push(r);return n},html:function(e,t){var r=t?n.textContent===undefined?"innerText":"textContent":"innerHTML",i=this,o=function(t,n){B(P(e,i,n),function(e){t.appendChild(e)})},u=function(n,i){try{if(t||typeof e=="string"&&!s.test(n.tagName))return n[r]=e}catch(u){}o(n,i)};return typeof e!="undefined"?this.empty().each(u):this[0]?this[0][r]:""},text:function(e){return this.html(e,!0)},append:function(e){var t=this;return this.each(function(n,r){B(P(e,t,r),function(e){n.appendChild(e)})})},prepend:function(e){var t=this;return this.each(function(n,r){var i=n.firstChild;B(P(e,t,r),function(e){n.insertBefore(e,i)})})},appendTo:function(e,t){return X.call(this,e,t,function(e,t){e.appendChild(t)})},prependTo:function(e,t){return X.call(this,e,t,function(e,t){e.insertBefore(t,e.firstChild)},1)},before:function(e){var t=this;return this.each(function(n,i){B(P(e,t,i),function(e){n[r].insertBefore(e,n)})})},after:function(e){var t=this;return this.each(function(n,i){B(P(e,t,i),function(e){n[r].insertBefore(e,n.nextSibling)},null,1)})},insertBefore:function(e,t){return X.call(this,e,t,function(e,t){e[r].insertBefore(t,e)})},insertAfter:function(e,t){return X.call(this,e,t,function(e,t){var n=e.nextSibling;n?e[r].insertBefore(t,n):e[r].appendChild(t)},1)},replaceWith:function(e){return et(P(e)).insertAfter(this),this.remove()},clone:function(e){var t=[],n,r;for(r=0,n=this.length;r<n;r++)t[r]=Q(e||this,this[r]);return et(t)},addClass:function(e){return e=L.call(e).split(k),this.each(function(t){B(e,function(e){e&&!d(t,$(t,e))&&v(t,$(t,e))})})},removeClass:function(e){return e=L.call(e).split(k),this.each(function(t){B(e,function(e){e&&d(t,$(t,e))&&m(t,$(t,e))})})},hasClass:function(e){return e=L.call(e).split(k),z(this,function(t){return z(e,function(e){return e&&d(t,e)})})},toggleClass:function(e,t){return e=L.call(e).split(k),this.each(function(n){B(e,function(e){e&&(typeof t!="undefined"?t?!d(n,e)&&v(n,e):m(n,e):d(n,e)?m(n,e):v(n,e))})})},show:function(e){return e=typeof e=="string"?e:"",this.each(function(t){t.style.display=e})},hide:function(){return this.each(function(e){e.style.display="none"})},toggle:function(e,t){return t=typeof t=="string"?t:"",typeof e!="function"&&(e=null),this.each(function(n){n.style.display=n.offsetWidth||n.offsetHeight?"none":t,e&&e.call(n)})},first:function(){return et(this.length?this[0]:[])},last:function(){return et(this.length?this[this.length-1]:[])},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},parent:function(){return this.related(r)},related:function(e){return et(this.map(function(t){t=t[e];while(t&&t.nodeType!==1)t=t[e];return t||0},function(e){return e}))},focus:function(){return this.length&&this[0].focus(),this},blur:function(){return this.length&&this[0].blur(),this},css:function(n,r){function o(e,t,n){for(var r in s)if(s.hasOwnProperty(r)){n=s[r],(t=W(r))&&b.test(n)&&!(t in A)&&(n+=E);try{e.style[t]=$(e,n)}catch(i){}}}var i,s=n;return r===undefined&&typeof n=="string"?(r=this[0],r?r===t||r===e?(i=r===t?et.doc():et.viewport(),n=="width"?i.width:n=="height"?i.height:""):(n=W(n))?_(r,n):null:null):(typeof n=="string"&&(s={},s[n]=r),p&&s.opacity&&(s.filter="alpha(opacity="+s.opacity*100+")",s.zoom=n.zoom||1,delete s.opacity),this.each(o))},offset:function(e,n){if(!e||typeof e!="object"||typeof e.top!="number"&&typeof e.left!="number"){if(typeof e=="number"||typeof n=="number")return this.each(function(t){V(t,e,n)});if(!this[0])return{top:0,left:0,height:0,width:0};var r=this[0],i=r.ownerDocument.documentElement,s=r.getBoundingClientRect(),o=Y(),u=r.offsetWidth,a=r.offsetHeight,f=s.top+o.y-Math.max(0,i&&i.clientTop,t.body.clientTop),l=s.left+o.x-Math.max(0,i&&i.clientLeft,t.body.clientLeft);return{top:f,left:l,height:a,width:u}}return this.each(function(t){V(t,e.left,e.top)})},dim:function(){if(!this.length)return{height:0,width:0};var e=this[0],t=e.nodeType==9&&e.documentElement,n=!t&&!!e.style&&!e.offsetWidth&&!e.offsetHeight?function(t){var n={position:e.style.position||"",visibility:e.style.visibility||"",display:e.style.display||""};return t.first().css({position:"absolute",visibility:"hidden",display:"block"}),n}(this):null,r=t?Math.max(e.body.scrollWidth,e.body.offsetWidth,t.scrollWidth,t.offsetWidth,t.clientWidth):e.offsetWidth,i=t?Math.max(e.body.scrollHeight,e.body.offsetHeight,t.scrollHeight,t.offsetHeight,t.clientHeight):e.offsetHeight;return n&&this.first().css(n),{height:i,width:r}},attr:function(e,t){var n=this[0],r;if(typeof e=="string"||e instanceof String)return typeof t=="undefined"?n?i.test(e)?h.test(e)&&typeof n[e]=="string"?!0:n[e]:e!="href"&&e!="src"||!N.hrefExtended?n[x](e):n[x](e,2):null:this.each(function(n){i.test(e)?n[e]=$(n,t):n[S](e,$(n,t))});for(r in e)e.hasOwnProperty(r)&&this.attr(r,e[r]);return this},removeAttr:function(e){return this.each(function(t){h.test(e)?t[e]=!1:t.removeAttribute(e)})},val:function(e){return typeof e=="string"?this.attr("value",e):this.length?this[0].value:null},data:function(e,t){var n=this[0],r,i;return typeof t=="undefined"?n?(r=q(n),typeof e=="undefined"?(B(n.attributes,function(e){(i=(""+e.name).match(w))&&(r[F(i[1])]=U(e.value))}),r):(typeof r[e]=="undefined"&&(r[e]=U(this.attr("data-"+I(e)))),r[e])):null:this.each(function(n){q(n)[e]=t})},remove:function(){return this.deepEach(R),this.detach()},empty:function(){return this.each(function(e){j(e.childNodes,R);while(e.firstChild)e.removeChild(e.firstChild)})},detach:function(){return this.each(function(e){e[r]&&e[r].removeChild(e)})},scrollTop:function(e){return J.call(this,null,e,"y")},scrollLeft:function(e){return J.call(this,e,null,"x")}},et.setQueryEngine=function(e){O=e,delete et.setQueryEngine},et.aug=function(e,t){for(var n in e)e.hasOwnProperty(n)&&((t||K.prototype)[n]=e[n])},et.create=function(e){return typeof e=="string"&&e!==""?function(){if(o.test(e))return[Z(e)];var n=e.match(/^\s*<([^\s>]+)/),i=t.createElement("div"),s=[],u=n?c[n[1].toLowerCase()]:null,a=u?u[2]+1:1,f=u&&u[3],l=r,h=N.autoTbody&&u&&u[0]=="<table>"&&!/<tbody/i.test(e);i.innerHTML=u?u[0]+e+u[1]:e;while(a--)i=i.firstChild;f&&i&&i.nodeType!==1&&(i=i.nextSibling);do(!n||i.nodeType==1)&&(!h||i.tagName&&i.tagName!="TBODY")&&s.push(i);while(i=i.nextSibling);return B(s,function(e){e[l]&&e[l].removeChild(e)}),s}():D(e)?[e.cloneNode(!0)]:[]},et.doc=function(){var e=et.viewport();return{width:Math.max(t.body.scrollWidth,n.scrollWidth,e.width),height:Math.max(t.body.scrollHeight,n.scrollHeight,e.height)}},et.firstChild=function(e){for(var t=e.childNodes,n=0,r=t&&t.length||0,i;n<r;n++)t[n].nodeType===1&&(i=t[r=n]);return i},et.viewport=function(){return{width:p?n.clientWidth:self.innerWidth,height:p?n.clientHeight:self.innerHeight}},et.isAncestor="compareDocumentPosition"in n?function(e,t){return(e.compareDocumentPosition(t)&16)==16}:"contains"in n?function(e,t){return e!==t&&e.contains(t)}:function(e,t){while(t=t[r])if(t===e)return!0;return!1},et}),typeof provide=="function"&&provide("bonzo",e.exports),function(e){function n(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}function r(e){var t=[],n=0,r=0,i,s,o;for(;s=e[n];++n){o=!1;for(i=0;i<t.length;++i)if(t[i]===s){o=!0;break}o||(t[r++]=s)}return t}function i(e,n){return typeof n=="undefined"?t(this).dim()[e]:this.css(e,n)}var t=require("bonzo");t.setQueryEngine(e),e.ender(t),e.ender(t(),!0),e.ender({create:function(n){return e(t.create(n))}}),e.id=function(t){return e([document.getElementById(t)])},e.ender({parents:function(t,i){if(!this.length)return this;t||(t="*");var s=e(t),o,u,a,f=[];for(o=0,u=this.length;o<u;o++){a=this[o];while(a=a.parentNode)if(~n(s,a)){f.push(a);if(i)break}}return e(r(f))},parent:function(){return e(r(t(this).parent()))},closest:function(e){return this.parents(e,!0)},first:function(){return e(this.length?this[0]:this)},last:function(){return e(this.length?this[this.length-1]:[])},next:function(){return e(t(this).next())},previous:function(){return e(t(this).previous())},related:function(n){return e(t(this).related(n))},appendTo:function(e){return t(this.selector).appendTo(e,this)},prependTo:function(e){return t(this.selector).prependTo(e,this)},insertAfter:function(e){return t(this.selector).insertAfter(e,this)},insertBefore:function(e){return t(this.selector).insertBefore(e,this)},clone:function(){return e(t(this).clone(this))},siblings:function(){var t,n,r,i=[];for(t=0,n=this.length;t<n;t++){r=this[t];while(r=r.previousSibling)r.nodeType==1&&i.push(r);r=this[t];while(r=r.nextSibling)r.nodeType==1&&i.push(r)}return e(i)},children:function(){var n,i,s,o=[];for(n=0,i=this.length;n<i;n++){if(!(s=t.firstChild(this[n])))continue;o.push(s);while(s=s.nextSibling)s.nodeType==1&&o.push(s)}return e(r(o))},height:function(e){return i.call(this,"height",e)},width:function(e){return i.call(this,"width",e)}},!0)}(ender)}(),function(){var e={exports:{}},t=e.exports;
Пример #5
0
(function(t,n,r){typeof e!="undefined"&&e.exports?e.exports=n():typeof r["define"]=="function"&&r.define.amd?define(t,n):r[t]=n()})("bonzo",function(){function _(e){return new RegExp("(^|\\s+)"+e+"(\\s+|$)")}function D(e,t,n){for(var r=0,i=e.length;r<i;r++)t.call(n||e[r],e[r],r,e);return e}function P(e,t,n){for(var r=0,i=e.length;r<i;r++)q(e[r])&&(P(e[r].childNodes,t,n),t.call(n||e[r],e[r],r,e));return e}function H(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function B(e){return e?e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():e}function j(e){e[T]("data-node-uid")||e[x]("data-node-uid",++b);var t=e[T]("data-node-uid");return y[t]||(y[t]={})}function F(e){var t=e[T]("data-node-uid");t&&delete y[t]}function I(e){var t;try{return e===null||e===undefined?undefined:e==="true"?!0:e==="false"?!1:e==="null"?null:(t=parseFloat(e))==e?t:e}catch(n){}return undefined}function q(e){return e&&e.nodeName&&(e.nodeType==1||e.nodeType==11)}function R(e,t,n){for(var r=0,i=e.length;r<i;++r)if(t.call(n||null,e[r],r,e))return!0;return!1}function U(e){return e=="transform"&&(e=C.transform)||/^transform-?[Oo]rigin$/.test(e)&&(e=C.transform+"Origin")||e=="float"&&(e=C.cssFloat),e?H(e):null}function W(e,t,n){var r=0,o=t||this,u=[],a=s&&typeof e=="string"&&e.charAt(0)!="<"?s(e):e;return D(J(a),function(e){D(o,function(t){var s=!t[i]||t[i]&&!t[i][i]?function(){var e=t.cloneNode(!0),n,r;if(o.$&&typeof o.cloneEvents=="function"){o.$(e).cloneEvents(t),n=o.$(e).find("*"),r=o.$(t).find("*");for(var i=0;i<r.length;i++)o.$(n[i]).cloneEvents(r[i])}return e}():t;n(e,s),u[r]=s,r++})},this),D(u,function(e,t){o[t]=e}),o.length=r,o}function X(e,t,n){var r=Y(e),i=r.css("position"),s=r.offset(),o="relative",u=i==o,a=[parseInt(r.css("left"),10),parseInt(r.css("top"),10)];i=="static"&&(r.css("position",o),i=o),isNaN(a[0])&&(a[0]=u?0:e.offsetLeft),isNaN(a[1])&&(a[1]=u?0:e.offsetTop),t!=null&&(e.style.left=t-s.left+a[0]+S),n!=null&&(e.style.top=n-s.top+a[1]+S)}function V(e,t){return typeof t=="function"?t(e):t}function $(e){this.length=0;if(e){e=typeof e!="string"&&!e.nodeType&&typeof e.length!="undefined"?e:[e],this.length=e.length;for(var t=0;t<e.length;t++)this[t]=e[t]}}function J(e){return typeof e=="string"?Y.create(e):q(e)?[e]:e}function K(e,n,r){var i=this[0];return i?e==null&&n==null?(Q(i)?G():{x:i.scrollLeft,y:i.scrollTop})[r]:(Q(i)?t.scrollTo(e,n):(e!=null&&(i.scrollLeft=e),n!=null&&(i.scrollTop=n)),this):this}function Q(e){return e===t||/^(?:body|html)$/i.test(e.tagName)}function G(){return{x:t.pageXOffset||r.scrollLeft,y:t.pageYOffset||r.scrollTop}}function Y(e){return new $(e)}var e=this,t=window,n=t.document,r=n.documentElement,i="parentNode",s=null,o=/^(checked|value|selected)$/i,u=/^(select|fieldset|table|tbody|tfoot|td|tr|colgroup)$/i,a=["<table>","</table>",1],f=["<table><tbody><tr>","</tr></tbody></table>",3],l=["<select>","</select>",1],c=["_","",0,1],h={thead:a,tbody:a,tfoot:a,colgroup:a,caption:a,tr:["<table><tbody>","</tbody></table>",2],th:f,td:f,col:["<table><colgroup>","</colgroup></table>",2],fieldset:["<form>","</form>",1],legend:["<form><fieldset>","</fieldset></form>",2],option:l,optgroup:l,script:c,style:c,link:c,param:c,base:c},p=/^(checked|selected)$/,d=/msie/i.test(navigator.userAgent),v,m,g,y={},b=0,w=/^-?[\d\.]+$/,E=/^data-(.+)$/,S="px",x="setAttribute",T="getAttribute",N="getElementsByTagName",C=function(){var e=n.createElement("p");return e.innerHTML='<a href="#x">x</a><table style="float:left;"></table>',{hrefExtended:e[N]("a")[0][T]("href")!="#x",autoTbody:e[N]("tbody").length!==0,computedStyle:n.defaultView&&n.defaultView.getComputedStyle,cssFloat:e[N]("table")[0].style.styleFloat?"styleFloat":"cssFloat",transform:function(){var t=["webkitTransform","MozTransform","OTransform","msTransform","Transform"],n;for(n=0;n<t.length;n++)if(t[n]in e.style)return t[n]}(),classList:"classList"in e}}(),k=/(^\s*|\s*$)/g,L=/\s+/,A=String.prototype.toString,O={lineHeight:1,zoom:1,zIndex:1,opacity:1,boxFlex:1,WebkitBoxFlex:1,MozBoxFlex:1},M=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(k,"")},z=C.computedStyle?function(e,t){var r=null,i=n.defaultView.getComputedStyle(e,"");return i&&(r=i[t]),e.style[t]||r}:d&&r.currentStyle?function(e,t){if(t=="opacity"){var n=100;try{n=e.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(r){try{n=e.filters("alpha").opacity}catch(i){}}return n/100}var s=e.currentStyle?e.currentStyle[t]:null;return e.style[t]||s}:function(e,t){return e.style[t]};return C.classList?(v=function(e,t){return e.classList.contains(t)},m=function(e,t){e.classList.add(t)},g=function(e,t){e.classList.remove(t)}):(v=function(e,t){return _(t).test(e.className)},m=function(e,t){e.className=M(e.className+" "+t)},g=function(e,t){e.className=M(e.className.replace(_(t)," "))}),$.prototype={get:function(e){return this[e]||null},each:function(e,t){return D(this,e,t)},deepEach:function(e,t){return P(this,e,t)},map:function(e,t){var n=[],r,i;for(i=0;i<this.length;i++)r=e.call(this,this[i],i),t?t(r)&&n.push(r):n.push(r);return n},html:function(e,t){function i(t){D(J(e),function(e){t.appendChild(e)})}var n=t?r.textContent===undefined?"innerText":"textContent":"innerHTML";return typeof e!="undefined"?this.empty().each(function(r){!t&&u.test(r.tagName)?i(r):function(){try{r[n]=e}catch(t){i(r)}}()}):this[0]?this[0][n]:""},text:function(e){return this.html(e,!0)},append:function(e){return this.each(function(t){D(J(e),function(e){t.appendChild(e)})})},prepend:function(e){return this.each(function(t){var n=t.firstChild;D(J(e),function(e){t.insertBefore(e,n)})})},appendTo:function(e,t){return W.call(this,e,t,function(e,t){e.appendChild(t)})},prependTo:function(e,t){return W.call(this,e,t,function(e,t){e.insertBefore(t,e.firstChild)})},before:function(e){return this.each(function(t){D(Y.create(e),function(e){t[i].insertBefore(e,t)})})},after:function(e){return this.each(function(t){D(Y.create(e),function(e){t[i].insertBefore(e,t.nextSibling)})})},insertBefore:function(e,t){return W.call(this,e,t,function(e,t){e[i].insertBefore(t,e)})},insertAfter:function(e,t){return W.call(this,e,t,function(e,t){var n=e.nextSibling;n?e[i].insertBefore(t,n):e[i].appendChild(t)})},replaceWith:function(e){return this.deepEach(F),this.each(function(t){t.parentNode.replaceChild(Y.create(e)[0],t)})},addClass:function(e){return e=A.call(e).split(L),this.each(function(t){D(e,function(e){e&&!v(t,V(t,e))&&m(t,V(t,e))})})},removeClass:function(e){return e=A.call(e).split(L),this.each(function(t){D(e,function(e){e&&v(t,V(t,e))&&g(t,V(t,e))})})},hasClass:function(e){return e=A.call(e).split(L),R(this,function(t){return R(e,function(e){return e&&v(t,e)})})},toggleClass:function(e,t){return e=A.call(e).split(L),this.each(function(n){D(e,function(e){e&&(typeof t!="undefined"?t?m(n,e):g(n,e):v(n,e)?g(n,e):m(n,e))})})},show:function(e){return this.each(function(t){t.style.display=e||""})},hide:function(){return this.each(function(e){e.style.display="none"})},toggle:function(e,t){return this.each(function(e){e.style.display=e.offsetWidth||e.offsetHeight?"none":t||""}),e&&e(),this},first:function(){return Y(this.length?this[0]:[])},last:function(){return Y(this.length?this[this.length-1]:[])},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},parent:function(){return this.related(i)},related:function(e){return this.map(function(t){t=t[e];while(t&&t.nodeType!==1)t=t[e];return t||0},function(e){return e})},focus:function(){return this.length&&this[0].focus(),this},blur:function(){return this.length&&this[0].blur(),this},css:function(e,r){function o(e,t,n){for(var r in s)s.hasOwnProperty(r)&&(n=s[r],(t=U(r))&&w.test(n)&&!(t in O)&&(n+=S),e.style[t]=V(e,n))}var i;if(r===undefined&&typeof e=="string")return r=this[0],r?r===n||r===t?(i=r===n?Y.doc():Y.viewport(),e=="width"?i.width:e=="height"?i.height:""):(e=U(e))?z(r,e):null:null;var s=e;return typeof e=="string"&&(s={},s[e]=r),d&&s.opacity&&(s.filter="alpha(opacity="+s.opacity*100+")",s.zoom=e.zoom||1,delete s.opacity),this.each(o)},offset:function(e,t){if(typeof e=="number"||typeof t=="number")return this.each(function(n){X(n,e,t)});if(!this[0])return{top:0,left:0,height:0,width:0};var r=this[0],i=r.offsetWidth,s=r.offsetHeight,o=r.offsetTop,u=r.offsetLeft;while(r=r.offsetParent)o+=r.offsetTop,u+=r.offsetLeft,r!=n.body&&(o-=r.scrollTop,u-=r.scrollLeft);return{top:o,left:u,height:s,width:i}},dim:function(){if(!this.length)return{height:0,width:0};var e=this[0],t=!e.offsetWidth&&!e.offsetHeight?function(t){var n={position:e.style.position||"",visibility:e.style.visibility||"",display:e.style.display||""};return t.first().css({position:"absolute",visibility:"hidden",display:"block"}),n}(this):null,n=e.offsetWidth,r=e.offsetHeight;return t&&this.first().css(t),{height:r,width:n}},attr:function(e,t){var n=this[0];if(typeof e=="string"||e instanceof String)return typeof t=="undefined"?n?o.test(e)?p.test(e)&&typeof n[e]=="string"?!0:n[e]:e!="href"&&e!="src"||!C.hrefExtended?n[T](e):n[T](e,2):null:this.each(function(n){o.test(e)?n[e]=V(n,t):n[x](e,V(n,t))});for(var r in e)e.hasOwnProperty(r)&&this.attr(r,e[r]);return this},removeAttr:function(e){return this.each(function(t){p.test(e)?t[e]=!1:t.removeAttribute(e)})},val:function(e){return typeof e=="string"?this.attr("value",e):this.length?this[0].value:null},data:function(e,t){var n=this[0],r,i,s;return typeof t=="undefined"?n?(i=j(n),typeof e=="undefined"?(D(n.attributes,function(e){(s=(""+e.name).match(E))&&(i[H(s[1])]=I(e.value))}),i):(typeof i[e]=="undefined"&&(i[e]=I(this.attr("data-"+B(e)))),i[e])):null:this.each(function(n){j(n)[e]=t})},remove:function(){return this.deepEach(F),this.each(function(e){e[i]&&e[i].removeChild(e)})},empty:function(){return this.each(function(e){P(e.childNodes,F);while(e.firstChild)e.removeChild(e.firstChild)})},detach:function(){return this.each(function(e){e[i].removeChild(e)})},scrollTop:function(e){return K.call(this,null,e,"y")},scrollLeft:function(e){return K.call(this,e,null,"x")}},Y.setQueryEngine=function(e){s=e,delete Y.setQueryEngine},Y.aug=function(e,t){for(var n in e)e.hasOwnProperty(n)&&((t||$.prototype)[n]=e[n])},Y.create=function(e){return typeof e=="string"&&e!==""?function(){var t=/^\s*<([^\s>]+)/.exec(e),r=n.createElement("div"),s=[],o=t?h[t[1].toLowerCase()]:null,u=o?o[2]+1:1,a=o&&o[3],f=i,l=C.autoTbody&&o&&o[0]=="<table>"&&!/<tbody/i.test(e);r.innerHTML=o?o[0]+e+o[1]:e;while(u--)r=r.firstChild;a&&r&&r.nodeType!==1&&(r=r.nextSibling);do(!t||r.nodeType==1)&&(!l||r.tagName.toLowerCase()!="tbody")&&s.push(r);while(r=r.nextSibling);return D(s,function(e){e[f]&&e[f].removeChild(e)}),s}():q(e)?[e.cloneNode(!0)]:[]},Y.doc=function(){var e=Y.viewport();return{width:Math.max(n.body.scrollWidth,r.scrollWidth,e.width),height:Math.max(n.body.scrollHeight,r.scrollHeight,e.height)}},Y.firstChild=function(e){for(var t=e.childNodes,n=0,r=t&&t.length||0,i;n<r;n++)t[n].nodeType===1&&(i=t[r=n]);return i},Y.viewport=function(){return{width:d?r.clientWidth:self.innerWidth,height:d?r.clientHeight:self.innerHeight}},Y.isAncestor="compareDocumentPosition"in r?function(e,t){return(e.compareDocumentPosition(t)&16)==16}:"contains"in r?function(e,t){return e!==t&&e.contains(t)}:function(e,t){while(t=t[i])if(t===e)return!0;return!1},Y},this),provide("bonzo",e.exports),function(e){function n(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}function r(e){var t=[],n=0,r=0,i,s,o;for(;s=e[n];++n){o=!1;for(i=0;i<t.length;++i)if(t[i]===s){o=!0;break}o||(t[r++]=s)}return t}function i(e,n){return typeof n=="undefined"?t(this).dim()[e]:this.css(e,n)}var t=require("bonzo");t.setQueryEngine(e),e.ender(t),e.ender(t(),!0),e.ender({create:function(n){return e(t.create(n))}}),e.id=function(t){return e([document.getElementById(t)])},e.ender({parents:function(t,i){if(!this.length)return this;var s=e(t),o,u,a,f=[];for(o=0,u=this.length;o<u;o++){a=this[o];while(a=a.parentNode)if(~n(s,a)){f.push(a);if(i)break}}return e(r(f))},parent:function(){return e(r(t(this).parent()))},closest:function(e){return this.parents(e,!0)},first:function(){return e(this.length?this[0]:this)},last:function(){return e(this.length?this[this.length-1]:[])},next:function(){return e(t(this).next())},previous:function(){return e(t(this).previous())},appendTo:function(e){return t(this.selector).appendTo(e,this)},prependTo:function(e){return t(this.selector).prependTo(e,this)},insertAfter:function(e){return t(this.selector).insertAfter(e,this)},insertBefore:function(e){return t(this.selector).insertBefore(e,this)},siblings:function(){var t,n,r,i=[];for(t=0,n=this.length;t<n;t++){r=this[t];while(r=r.previousSibling)r.nodeType==1&&i.push(r);r=this[t];while(r=r.nextSibling)r.nodeType==1&&i.push(r)}return e(i)},children:function(){var n,i,s,o=[];for(n=0,i=this.length;n<i;n++){if(!(s=t.firstChild(this[n])))continue;o.push(s);while(s=s.nextSibling)s.nodeType==1&&o.push(s)}return e(r(o))},height:function(e){return i.call(this,"height",e)},width:function(e){return i.call(this,"width",e)}},!0)}(ender)}(),function(){function r(){function t(){var e=parseInt(location.hash.replace("#",""));return isNaN(e)?0:e}function r(t){t>=0&&t<e.length&&(location.hash=t)}function i(){e.removeClass("current"),n(e[t()]).addClass("current")}var e=n("section");this.attach=function(){window.addEventListener("hashchange",i)},this.left=function(){r(t()-1)},this.right=function(){r(t()+1)},i()}var e={exports:{}},t=e.exports,n=require("ender");n(document).ready(function(){var e=new r;e.attach(),n(document).keydown(function(t){t.keyCode===37?e.left():t.keyCode===39&&e.right()})}),provide("html-slides",e.exports),n.ender(e.exports)}(),function(){var e={exports:{}},t=e.exports;provide("clientside-npm-slides",e.exports),$.ender(e.exports)}()
Пример #6
0
(function(t,n,r){typeof e!="undefined"&&e.exports?e.exports=n():typeof r["define"]=="function"&&r.define.amd?define(t,n):r[t]=n()})("bonzo",function(){function M(e){return new RegExp("(^|\\s+)"+e+"(\\s+|$)")}function _(e,t,n,r){var i,s=0,o=e.length;for(;s<o;s++)i=r?e.length-s-1:s,t.call(n||e[i],e[i],i,e);return e}function D(e,t,n){for(var r=0,i=e.length;r<i;r++)I(e[r])&&(D(e[r].childNodes,t,n),t.call(n||e[r],e[r],r,e));return e}function P(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function H(e){return e?e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():e}function B(e){e[x]("data-node-uid")||e[S]("data-node-uid",++y);var t=e[x]("data-node-uid");return g[t]||(g[t]={})}function j(e){var t=e[x]("data-node-uid");t&&delete g[t]}function F(e){var t;try{return e===null||e===undefined?undefined:e==="true"?!0:e==="false"?!1:e==="null"?null:(t=parseFloat(e))==e?t:e}catch(n){}return undefined}function I(e){return e&&e.nodeName&&(e.nodeType==1||e.nodeType==11)}function q(e,t,n){for(var r=0,i=e.length;r<i;++r)if(t.call(n||null,e[r],r,e))return!0;return!1}function R(e){return e=="transform"&&(e=N.transform)||/^transform-?[Oo]rigin$/.test(e)&&(e=N.transform+"Origin")||e=="float"&&(e=N.cssFloat),e?P(e):null}function z(e,t,n,r){var s=0,o=t||this,u=[],a=i&&typeof e=="string"&&e.charAt(0)!="<"?i(e):e;return _($(a),function(e,t){_(o,function(r){n(e,u[s++]=t>0?J(o,r):r)},null,r)},this,r),o.length=s,_(u,function(e){o[--s]=e},null,!r),o}function W(e,t,n){var r=Y(e),i=r.css("position"),s=r.offset(),o="relative",u=i==o,a=[parseInt(r.css("left"),10),parseInt(r.css("top"),10)];i=="static"&&(r.css("position",o),i=o),isNaN(a[0])&&(a[0]=u?0:e.offsetLeft),isNaN(a[1])&&(a[1]=u?0:e.offsetTop),t!=null&&(e.style.left=t-s.left+a[0]+E),n!=null&&(e.style.top=n-s.top+a[1]+E)}function X(e,t){return typeof t=="function"?t(e):t}function V(e){this.length=0;if(e){e=typeof e!="string"&&!e.nodeType&&typeof e.length!="undefined"?e:[e],this.length=e.length;for(var t=0;t<e.length;t++)this[t]=e[t]}}function $(e,t,n){var r,i,s;if(typeof e=="string")return Y.create(e);I(e)&&(e=[e]);if(n){s=[];for(r=0,i=e.length;r<i;r++)s[r]=J(t,e[r]);return s}return e}function J(e,t){var n=t.cloneNode(!0),r,i;if(e.$&&typeof e.cloneEvents=="function"){e.$(n).cloneEvents(t),r=e.$(n).find("*"),i=e.$(t).find("*");for(var s=0;s<i.length;s++)e.$(r[s]).cloneEvents(i[s])}return n}function K(t,n,r){var i=this[0];return i?t==null&&n==null?(Q(i)?G():{x:i.scrollLeft,y:i.scrollTop})[r]:(Q(i)?e.scrollTo(t,n):(t!=null&&(i.scrollLeft=t),n!=null&&(i.scrollTop=n)),this):this}function Q(t){return t===e||/^(?:body|html)$/i.test(t.tagName)}function G(){return{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop}}function Y(e){return new V(e)}var e=window,t=e.document,n=t.documentElement,r="parentNode",i=null,s=/^(checked|value|selected|disabled)$/i,o=/^(select|fieldset|table|tbody|tfoot|td|tr|colgroup)$/i,u=["<table>","</table>",1],a=["<table><tbody><tr>","</tr></tbody></table>",3],f=["<select>","</select>",1],l=["_","",0,1],c={thead:u,tbody:u,tfoot:u,colgroup:u,caption:u,tr:["<table><tbody>","</tbody></table>",2],th:a,td:a,col:["<table><colgroup>","</colgroup></table>",2],fieldset:["<form>","</form>",1],legend:["<form><fieldset>","</fieldset></form>",2],option:f,optgroup:f,script:l,style:l,link:l,param:l,base:l},h=/^(checked|selected|disabled)$/,p=/msie/i.test(navigator.userAgent),d,v,m,g={},y=0,b=/^-?[\d\.]+$/,w=/^data-(.+)$/,E="px",S="setAttribute",x="getAttribute",T="getElementsByTagName",N=function(){var e=t.createElement("p");return e.innerHTML='<a href="#x">x</a><table style="float:left;"></table>',{hrefExtended:e[T]("a")[0][x]("href")!="#x",autoTbody:e[T]("tbody").length!==0,computedStyle:t.defaultView&&t.defaultView.getComputedStyle,cssFloat:e[T]("table")[0].style.styleFloat?"styleFloat":"cssFloat",transform:function(){var t=["transform","webkitTransform","MozTransform","OTransform","msTransform"],n;for(n=0;n<t.length;n++)if(t[n]in e.style)return t[n]}(),classList:"classList"in e,opasity:function(){return typeof t.createElement("a").style.opacity!="undefined"}()}}(),C=/(^\s*|\s*$)/g,k=/\s+/,L=String.prototype.toString,A={lineHeight:1,zoom:1,zIndex:1,opacity:1,boxFlex:1,WebkitBoxFlex:1,MozBoxFlex:1},O=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(C,"")},U=N.computedStyle?function(e,n){var r=null,i=t.defaultView.getComputedStyle(e,"");return i&&(r=i[n]),e.style[n]||r}:p&&n.currentStyle?function(e,t){if(t=="opacity"&&!N.opasity){var n=100;try{n=e.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(r){try{n=e.filters("alpha").opacity}catch(i){}}return n/100}var s=e.currentStyle?e.currentStyle[t]:null;return e.style[t]||s}:function(e,t){return e.style[t]};return N.classList?(d=function(e,t){return e.classList.contains(t)},v=function(e,t){e.classList.add(t)},m=function(e,t){e.classList.remove(t)}):(d=function(e,t){return M(t).test(e.className)},v=function(e,t){e.className=O(e.className+" "+t)},m=function(e,t){e.className=O(e.className.replace(M(t)," "))}),V.prototype={get:function(e){return this[e]||null},each:function(e,t){return _(this,e,t)},deepEach:function(e,t){return D(this,e,t)},map:function(e,t){var n=[],r,i;for(i=0;i<this.length;i++)r=e.call(this,this[i],i),t?t(r)&&n.push(r):n.push(r);return n},html:function(e,t){var r=t?n.textContent===undefined?"innerText":"textContent":"innerHTML",i=this,s=function(t,n){_($(e,i,n),function(e){t.appendChild(e)})},u=function(n,i){try{if(t||typeof e=="string"&&!o.test(n.tagName))return n[r]=e}catch(u){}s(n,i)};return typeof e!="undefined"?this.empty().each(u):this[0]?this[0][r]:""},text:function(e){return this.html(e,!0)},append:function(e){var t=this;return this.each(function(n,r){_($(e,t,r),function(e){n.appendChild(e)})})},prepend:function(e){var t=this;return this.each(function(n,r){var i=n.firstChild;_($(e,t,r),function(e){n.insertBefore(e,i)})})},appendTo:function(e,t){return z.call(this,e,t,function(e,t){e.appendChild(t)})},prependTo:function(e,t){return z.call(this,e,t,function(e,t){e.insertBefore(t,e.firstChild)},1)},before:function(e){var t=this;return this.each(function(n,i){_($(e,t,i),function(e){n[r].insertBefore(e,n)})})},after:function(e){var t=this;return this.each(function(n,i){_($(e,t,i),function(e){n[r].insertBefore(e,n.nextSibling)},null,1)})},insertBefore:function(e,t){return z.call(this,e,t,function(e,t){e[r].insertBefore(t,e)})},insertAfter:function(e,t){return z.call(this,e,t,function(e,t){var n=e.nextSibling;n?e[r].insertBefore(t,n):e[r].appendChild(t)},1)},replaceWith:function(e){return Y($(e)).insertAfter(this),this.remove()},addClass:function(e){return e=L.call(e).split(k),this.each(function(t){_(e,function(e){e&&!d(t,X(t,e))&&v(t,X(t,e))})})},removeClass:function(e){return e=L.call(e).split(k),this.each(function(t){_(e,function(e){e&&d(t,X(t,e))&&m(t,X(t,e))})})},hasClass:function(e){return e=L.call(e).split(k),q(this,function(t){return q(e,function(e){return e&&d(t,e)})})},toggleClass:function(e,t){return e=L.call(e).split(k),this.each(function(n){_(e,function(e){e&&(typeof t!="undefined"?t?v(n,e):m(n,e):d(n,e)?m(n,e):v(n,e))})})},show:function(e){return e=typeof e=="string"?e:"",this.each(function(t){t.style.display=e})},hide:function(){return this.each(function(e){e.style.display="none"})},toggle:function(e,t){return t=typeof t=="string"?t:"",typeof e!="function"&&(e=null),this.each(function(n){n.style.display=n.offsetWidth||n.offsetHeight?"none":t,e&&e.call(n)})},first:function(){return Y(this.length?this[0]:[])},last:function(){return Y(this.length?this[this.length-1]:[])},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},parent:function(){return this.related(r)},related:function(e){return this.map(function(t){t=t[e];while(t&&t.nodeType!==1)t=t[e];return t||0},function(e){return e})},focus:function(){return this.length&&this[0].focus(),this},blur:function(){return this.length&&this[0].blur(),this},css:function(n,r){function o(e,t,n){for(var r in s)if(s.hasOwnProperty(r)){n=s[r],(t=R(r))&&b.test(n)&&!(t in A)&&(n+=E);try{e.style[t]=X(e,n)}catch(i){}}}var i,s=n;return r===undefined&&typeof n=="string"?(r=this[0],r?r===t||r===e?(i=r===t?Y.doc():Y.viewport(),n=="width"?i.width:n=="height"?i.height:""):(n=R(n))?U(r,n):null:null):(typeof n=="string"&&(s={},s[n]=r),p&&s.opacity&&(s.filter="alpha(opacity="+s.opacity*100+")",s.zoom=n.zoom||1,delete s.opacity),this.each(o))},offset:function(e,n){if(!e||typeof e!="object"||typeof e.top!="number"&&typeof e.left!="number"){if(typeof e=="number"||typeof n=="number")return this.each(function(t){W(t,e,n)});if(!this[0])return{top:0,left:0,height:0,width:0};var r=this[0],i=r.ownerDocument.documentElement,s=r.getBoundingClientRect(),o=G(),u=r.offsetWidth,a=r.offsetHeight,f=s.top+o.y-Math.max(0,i&&i.clientTop,t.body.clientTop),l=s.left+o.x-Math.max(0,i&&i.clientLeft,t.body.clientLeft);return{top:f,left:l,height:a,width:u}}return this.each(function(t){W(t,e.left,e.top)})},dim:function(){if(!this.length)return{height:0,width:0};var e=this[0],t=e.nodeType==9&&e.documentElement,n=!t&&!!e.style&&!e.offsetWidth&&!e.offsetHeight?function(t){var n={position:e.style.position||"",visibility:e.style.visibility||"",display:e.style.display||""};return t.first().css({position:"absolute",visibility:"hidden",display:"block"}),n}(this):null,r=t?Math.max(e.body.scrollWidth,e.body.offsetWidth,t.scrollWidth,t.offsetWidth,t.clientWidth):e.offsetWidth,i=t?Math.max(e.body.scrollHeight,e.body.offsetHeight,t.scrollWidth,t.offsetWidth,t.clientHeight):e.offsetHeight;return n&&this.first().css(n),{height:i,width:r}},attr:function(e,t){var n=this[0];if(typeof e=="string"||e instanceof String)return typeof t=="undefined"?n?s.test(e)?h.test(e)&&typeof n[e]=="string"?!0:n[e]:e!="href"&&e!="src"||!N.hrefExtended?n[x](e):n[x](e,2):null:this.each(function(n){s.test(e)?n[e]=X(n,t):n[S](e,X(n,t))});for(var r in e)e.hasOwnProperty(r)&&this.attr(r,e[r]);return this},removeAttr:function(e){return this.each(function(t){h.test(e)?t[e]=!1:t.removeAttribute(e)})},val:function(e){return typeof e=="string"?this.attr("value",e):this.length?this[0].value:null},data:function(e,t){var n=this[0],r,i;return typeof t=="undefined"?n?(r=B(n),typeof e=="undefined"?(_(n.attributes,function(e){(i=(""+e.name).match(w))&&(r[P(i[1])]=F(e.value))}),r):(typeof r[e]=="undefined"&&(r[e]=F(this.attr("data-"+H(e)))),r[e])):null:this.each(function(n){B(n)[e]=t})},remove:function(){return this.deepEach(j),this.detach()},empty:function(){return this.each(function(e){D(e.childNodes,j);while(e.firstChild)e.removeChild(e.firstChild)})},detach:function(){return this.each(function(e){e[r]&&e[r].removeChild(e)})},scrollTop:function(e){return K.call(this,null,e,"y")},scrollLeft:function(e){return K.call(this,e,null,"x")}},Y.setQueryEngine=function(e){i=e,delete Y.setQueryEngine},Y.aug=function(e,t){for(var n in e)e.hasOwnProperty(n)&&((t||V.prototype)[n]=e[n])},Y.create=function(e){return typeof e=="string"&&e!==""?function(){var n=/^\s*<([^\s>]+)/.exec(e),i=t.createElement("div"),s=[],o=n?c[n[1].toLowerCase()]:null,u=o?o[2]+1:1,a=o&&o[3],f=r,l=N.autoTbody&&o&&o[0]=="<table>"&&!/<tbody/i.test(e);i.innerHTML=o?o[0]+e+o[1]:e;while(u--)i=i.firstChild;a&&i&&i.nodeType!==1&&(i=i.nextSibling);do(!n||i.nodeType==1)&&(!l||i.tagName.toLowerCase()!="tbody")&&s.push(i);while(i=i.nextSibling);return _(s,function(e){e[f]&&e[f].removeChild(e)}),s}():I(e)?[e.cloneNode(!0)]:[]},Y.doc=function(){var e=Y.viewport();return{width:Math.max(t.body.scrollWidth,n.scrollWidth,e.width),height:Math.max(t.body.scrollHeight,n.scrollHeight,e.height)}},Y.firstChild=function(e){for(var t=e.childNodes,n=0,r=t&&t.length||0,i;n<r;n++)t[n].nodeType===1&&(i=t[r=n]);return i},Y.viewport=function(){return{width:p?n.clientWidth:self.innerWidth,height:p?n.clientHeight:self.innerHeight}},Y.isAncestor="compareDocumentPosition"in n?function(e,t){return(e.compareDocumentPosition(t)&16)==16}:"contains"in n?function(e,t){return e!==t&&e.contains(t)}:function(e,t){while(t=t[r])if(t===e)return!0;return!1},Y},this),provide("bonzo",e.exports),function(e){function n(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}function r(e){var t=[],n=0,r=0,i,s,o;for(;s=e[n];++n){o=!1;for(i=0;i<t.length;++i)if(t[i]===s){o=!0;break}o||(t[r++]=s)}return t}function i(e,n){return typeof n=="undefined"?t(this).dim()[e]:this.css(e,n)}var t=require("bonzo");t.setQueryEngine(e),e.ender(t),e.ender(t(),!0),e.ender({create:function(n){return e(t.create(n))}}),e.id=function(t){return e([document.getElementById(t)])},e.ender({parents:function(t,i){if(!this.length)return this;t||(t="*");var s=e(t),o,u,a,f=[];for(o=0,u=this.length;o<u;o++){a=this[o];while(a=a.parentNode)if(~n(s,a)){f.push(a);if(i)break}}return e(r(f))},parent:function(){return e(r(t(this).parent()))},closest:function(e){return this.parents(e,!0)},first:function(){return e(this.length?this[0]:this)},last:function(){return e(this.length?this[this.length-1]:[])},next:function(){return e(t(this).next())},previous:function(){return e(t(this).previous())},appendTo:function(e){return t(this.selector).appendTo(e,this)},prependTo:function(e){return t(this.selector).prependTo(e,this)},insertAfter:function(e){return t(this.selector).insertAfter(e,this)},insertBefore:function(e){return t(this.selector).insertBefore(e,this)},siblings:function(){var t,n,r,i=[];for(t=0,n=this.length;t<n;t++){r=this[t];while(r=r.previousSibling)r.nodeType==1&&i.push(r);r=this[t];while(r=r.nextSibling)r.nodeType==1&&i.push(r)}return e(i)},children:function(){var n,i,s,o=[];for(n=0,i=this.length;n<i;n++){if(!(s=t.firstChild(this[n])))continue;o.push(s);while(s=s.nextSibling)s.nodeType==1&&o.push(s)}return e(r(o))},height:function(e){return i.call(this,"height",e)},width:function(e){return i.call(this,"width",e)}},!0)}(ender)}(),function(){var e={exports:{}},t=e.exports;!function(t,n){typeof e!="undefined"?e.exports=n():typeof define=="function"&&define.amd?define(t,n):this[t]=n()}("traversty",function(){var e=this,t=e.traversty,n=window.document,r=n.documentElement,i=Object.prototype.toString,s=Array.prototype.slice,o=function(e,t,n,r,i){while(r<t.length)if(e[i=t[r++]+n])return i}(r,["msM","webkitM","mozM","oM","m"],"atchesSelector",0),u=function(e){return i.call(e)==="[object Number]"},a=function(e){return i.call(e)==="[object String]"},f=function(e){return i.call(e)==="[object Function]"},l=function(e){return e===void 0},c=function(e){return e&&e.nodeType===1},h=function(e,t){return l(e)&&!u(t)?0:u(e)?e:u(t)?t:null},p=function(e){return a(e)?e:"*"},d=function(e,t){return s.call(t.querySelectorAll(e),0)},v=function(e,t){return e==="*"||t[o](e)},m=d,g=v,y=function(e,t){return function(n,r){if(/,/.test(n)){var i=[],s=-1,o=r.getElementsByTagName("*");while(++s<o.length)c(o[s])&&t(n,o[s])&&i.push(o[s]);return i}return e(n,r)}},b="compareDocumentPosition"in r?function(e,t){return(t.compareDocumentPosition(e)&16)==16}:"contains"in r?function(e,t){return t=t.nodeType===9||t==window?r:t,t!==e&&t.contains(e)}:function(e,t){while(e=e.parentNode)if(e===t)return 1;return 0},w=function(e){var t=[],n=-1,r,i;while(++n<e.length){r=-1,i=!1;while(++r<t.length)if(t[r]===e[n]){i=!0;break}i||t.push(e[n])}return t},E=function(e,t){var n=[],r,i=0,s,o=e.length,u;while(i<o){s=0,u=(r=t(e[i],i++)).length;while(s<u)n.push(r[s++])}return n},S=function(e,t,n,r,i){return r=h(n,r),n=p(n),E(e,function(e,s){var o=r||0,u=[];i||(e=e[t]);while(e&&(r===null||o>=0))c(e)&&(!i||i===!0||i(e,s))&&g(n,e)&&(r===null||o--===0)&&(r===null&&t!=="nextSibling"?u=[e].concat(u):u.push(e)),e=e[t];return u})},x=function(e,t,n){return t<0&&(t=e+t),t<0||t>=e?null:!t&&t!==0?n:t},T=function(e,t){var n=[],r=0,i=e.length;for(;r<i;r++)t(e[r],r)&&n.push(e[r]);return n},N=function(e){var t;return c(e)?function(t){return t===e}:(t=typeof e)=="function"?function(t,n){return e.call(t,n)}:t=="string"&&e.length?function(t){return g(e,t)}:function(){return!1}},C=function(e){return function(){return!e.apply(this,arguments)}},k=function(){function r(e){this.length=0;if(e){e=w(!e.nodeType&&!l(e.length)?e:[e]);var t=this.length=e.length;while(t--)this[t]=e[t]}}function i(e){return new r(a(e)?m(e,n):e)}return r.prototype={down:function(e,t){return t=h(e,t),e=p(e),k(E(this,function(n){var r=m(e,n);return t===null?r:[r[t]]||[]}))},up:function(e,t){return k(S(this,"parentNode",e,t))},parents:function(){return r.prototype.up.apply(this,arguments.length?arguments:["*"])},closest:function(e,t){if(u(e))t=e,e="*";else{if(!a(e))return k([]);u(t)||(t=0)}return k(S(this,"parentNode",e,t,!0))},previous:function(e,t){return k(S(this,"previousSibling",e,t))},next:function(e,t){return k(S(this,"nextSibling",e,t))},siblings:function(e,t){var n=this,r=s.call(this,0),i=0,o=r.length;for(;i<o;i++){r[i]=r[i].parentNode.firstChild;while(!c(r[i]))r[i]=r[i].nextSibling}return l(e)&&(e="*"),k(S(r,"nextSibling",e||"*",t,function(e,t){return e!==n[t]}))},children:function(e,t){return k(S(r.prototype.down.call(this),"nextSibling",e||"*",t,!0))},first:function(){return r.prototype.eq.call(this,0)},last:function(){return r.prototype.eq.call(this,-1)},eq:function(e){return k((e=x(this.length,e,0))===null?[]:this[e])},slice:function(e,t){var n=t,r=this.length,i=[];e=x(r,Math.max(-this.length,e),0),n=x(t<0?r:r+1,t,r),t=n===null||n>r?t<0?0:r:n;while(e!==null&&e<t)i.push(this[e++]);return k(i)},filter:function(e){return k(T(this,N(e)))},not:function(e){return k(T(this,C(N(e))))},has:function(e){return k(T(this,c(e)?function(t){return b(e,t)}:typeof e=="string"&&e.length?function(t){return m(e,t).length}:function(){return!1}))},is:function(e){var t=0,n=this.length,r=N(e);for(;t<n;t++)if(r(this[t],t))return!0;return!1}},r.prototype.prev=r.prototype.previous,i.setSelectorEngine=function(e){var t,r,i,s,o,u=n.createElement("p"),l=e.select||e.sel||e;u.innerHTML="<a/><i/><b/>",i=u.firstChild;try{s=f(e.matching)?function(t,n){return e.matching([n],t).length>0}:f(e.is)?function(t,n){return e.is(n,t)}:f(e.matchesSelector)?function(t,n){return e.matchesSelector(n,t)}:f(e.match)?function(t,n){return e.match(n,t)}:null,s||(t=e("a",u),s=f(t._is)?function(t,n){return e(n)._is(t)}:f(t.matching)?function(t,n){return e(n).matching(t).length>0}:f(t.is)&&!t.is.__ignore?function(t,n){return e(n).is(t)}:f(t.matchesSelector)?function(t,n){return e(n).matchesSelector(t)}:f(t.match)?function(t,n){return e(n).match(t)}:null);if(!s)throw"Traversty: couldn't find selector engine's `matchesSelector`";if(s("x,y",u)||!s("a,p",u))throw"Traversty: couldn't make selector engine's `matchesSelector` work";if((r=l("b,a",u)).length!==2)throw"Traversty: don't know how to use this selector engine";o=r[0]===i?l:y(l,s);if((r=o("b,a",u)).length!==2||r[0]!==i)throw"Traversty: couldn't make selector engine work";g=s,m=o}catch(c){throw a(c)?c:"Traversty: error while figuring out how the selector engine works: "+(c.message||c)}finally{u=null}},i.noConflict=function(){return e.traversty=t,this},i}();return k}),provide("traversty",e.exports),function(e){var t=require("traversty"),n=!1,r=function(r){var i=function(s,o,u){if(!n){try{t.setSelectorEngine(e)}catch(a){}n=!0}return i=r=="is"?function(e,n){return t(e)[r](n)}:function(n,i,s){return e(t(n)[r](i,s))},i(s,o,u)};return function(e,t){return i(this,e,t)}},i="up down next previous prev parents closest siblings children first last eq slice filter not is has".split(" "),s={},o=i.length;e.fn.is&&(e.fn._is=e.fn.is);while(--o>=0)s[i[o]]=r(i[o]);e.ender(s,!0),e.fn.is.__ignore=!0}(ender)}(),function(){var e={exports:{}},t=e.exports;