zepto.min_wev8.js
27.9 KB
var Zepto=function(){function u(t){return null==t?String(t):R[q.call(t)]||"object"}function a(t){return"function"==u(t)}function o(t){return null!=t&&t==t.window}function s(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function r(t){return"object"==u(t)}function c(t){return r(t)&&!o(t)&&Object.getPrototypeOf(t)==Object.prototype}function l(t){return"number"==typeof t.length}function h(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function n(t){return t in e?e[t]:e[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||O[h(t)]?e:e+"px"}function i(t){return"children"in t?C.call(t.children):b.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function p(t,e){return null==e?b(t):b(t).filter(e)}function d(t,e,n,i){return a(e)?e.call(t,n,i):e}function v(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function m(t,e){var n=t.className||"",i=n&&n.baseVal!==g;return e===g?i?n.baseVal:n:void(i?n.baseVal=e:t.className=e)}function y(e){try{return e?"true"==e||"false"!=e&&("null"==e?null:+e+""==e?+e:/^[\[\{]/.test(e)?b.parseJSON(e):e):e}catch(t){return e}}var g,x,b,w,L,E,j=[],C=j.slice,N=j.filter,S=window.document,T={},e={},O={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},P=/^\s*<(\w+|!)[^>]*>/,U=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,A=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Z=/^(?:body|html)$/i,k=/([A-Z])/g,M=["val","css","html","text","data","width","height","offset"],t=S.createElement("table"),$=S.createElement("tr"),D={tr:S.createElement("tbody"),tbody:t,thead:t,tfoot:t,td:$,th:$,"*":S.createElement("div")},_=/complete|loaded|interactive/,F=/^[\w-]*$/,R={},q=R.toString,z={},W=S.createElement("div"),H={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},V=Array.isArray||function(t){return t instanceof Array};return z.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var i,r=t.parentNode,o=!r;return o&&(r=W).appendChild(t),i=~z.qsa(r,e).indexOf(t),o&&W.removeChild(t),i},L=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},E=function(n){return N.call(n,function(t,e){return n.indexOf(t)==e})},z.fragment=function(t,e,n){var i,r,o;return U.test(t)&&(i=b(S.createElement(RegExp.$1))),i||(t.replace&&(t=t.replace(A,"<$1></$2>")),e===g&&(e=P.test(t)&&RegExp.$1),e in D||(e="*"),(o=D[e]).innerHTML=""+t,i=b.each(C.call(o.childNodes),function(){o.removeChild(this)})),c(n)&&(r=b(i),b.each(n,function(t,e){-1<M.indexOf(t)?r[t](e):r.attr(t,e)})),i},z.Z=function(t,e){return(t=t||[]).__proto__=b.fn,t.selector=e||"",t},z.isZ=function(t){return t instanceof z.Z},z.init=function(t,e){var n,i;if(!t)return z.Z();if("string"==typeof t)if("<"==(t=t.trim())[0]&&P.test(t))n=z.fragment(t,RegExp.$1,e),t=null;else{if(e!==g)return b(e).find(t);n=z.qsa(S,t)}else{if(a(t))return b(S).ready(t);if(z.isZ(t))return t;if(V(t))i=t,n=N.call(i,function(t){return null!=t});else if(r(t))n=[t],t=null;else if(P.test(t))n=z.fragment(t.trim(),RegExp.$1,e),t=null;else{if(e!==g)return b(e).find(t);n=z.qsa(S,t)}}return z.Z(n,t)},(b=function(t,e){return z.init(t,e)}).extend=function(e){var n,t=C.call(arguments,1);return"boolean"==typeof e&&(n=e,e=t.shift()),t.forEach(function(t){!function t(e,n,i){for(x in n)i&&(c(n[x])||V(n[x]))?(c(n[x])&&!c(e[x])&&(e[x]={}),V(n[x])&&!V(e[x])&&(e[x]=[]),t(e[x],n[x],i)):n[x]!==g&&(e[x]=n[x])}(e,t,n)}),e},z.qsa=function(t,e){var n,i="#"==e[0],r=!i&&"."==e[0],o=i||r?e.slice(1):e,a=F.test(o);return s(t)&&a&&i?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType?[]:C.call(a&&!i?r?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},b.contains=S.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},b.type=u,b.isFunction=a,b.isWindow=o,b.isArray=V,b.isPlainObject=c,b.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},b.inArray=function(t,e,n){return j.indexOf.call(e,t,n)},b.camelCase=L,b.trim=function(t){return null==t?"":String.prototype.trim.call(t)},b.uuid=0,b.support={},b.expr={},b.map=function(t,e){var n,i,r,o,a=[];if(l(t))for(i=0;i<t.length;i++)null!=(n=e(t[i],i))&&a.push(n);else for(r in t)null!=(n=e(t[r],r))&&a.push(n);return 0<(o=a).length?b.fn.concat.apply([],o):o},b.each=function(t,e){var n,i;if(l(t)){for(n=0;n<t.length;n++)if(!1===e.call(t[n],n,t[n]))return t}else for(i in t)if(!1===e.call(t[i],i,t[i]))return t;return t},b.grep=function(t,e){return N.call(t,e)},window.JSON&&(b.parseJSON=JSON.parse),b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){R["[object "+e+"]"]=e.toLowerCase()}),b.fn={forEach:j.forEach,reduce:j.reduce,push:j.push,sort:j.sort,indexOf:j.indexOf,concat:j.concat,map:function(n){return b(b.map(this,function(t,e){return n.call(t,e,t)}))},slice:function(){return b(C.apply(this,arguments))},ready:function(t){return _.test(S.readyState)&&S.body?t(b):S.addEventListener("DOMContentLoaded",function(){t(b)},!1),this},get:function(t){return t===g?C.call(this):this[0<=t?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(n){return j.every.call(this,function(t,e){return!1!==n.call(t,e,t)}),this},filter:function(e){return a(e)?this.not(this.not(e)):b(N.call(this,function(t){return z.matches(t,e)}))},add:function(t,e){return b(E(this.concat(b(t,e))))},is:function(t){return 0<this.length&&z.matches(this[0],t)},not:function(e){var n=[];if(a(e)&&e.call!==g)this.each(function(t){e.call(this,t)||n.push(this)});else{var i="string"==typeof e?this.filter(e):l(e)&&a(e.item)?C.call(e):b(e);this.forEach(function(t){i.indexOf(t)<0&&n.push(t)})}return b(n)},has:function(t){return this.filter(function(){return r(t)?b.contains(this,t):b(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!r(t)?t:b(t)},last:function(){var t=this[this.length-1];return t&&!r(t)?t:b(t)},find:function(t){var n=this;return t?"object"==typeof t?b(t).filter(function(){var e=this;return j.some.call(n,function(t){return b.contains(t,e)})}):1==this.length?b(z.qsa(this[0],t)):this.map(function(){return z.qsa(this,t)}):b()},closest:function(t,e){var n=this[0],i=!1;for("object"==typeof t&&(i=b(t));n&&!(i?0<=i.indexOf(n):z.matches(n,t));)n=n!==e&&!s(n)&&n.parentNode;return b(n)},parents:function(t){for(var e=[],n=this;0<n.length;)n=b.map(n,function(t){return(t=t.parentNode)&&!s(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return p(e,t)},parent:function(t){return p(E(this.pluck("parentNode")),t)},children:function(t){return p(this.map(function(){return i(this)}),t)},contents:function(){return this.map(function(){return C.call(this.childNodes)})},siblings:function(t){return p(this.map(function(t,e){return N.call(i(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(e){return b.map(this,function(t){return t[e]})},show:function(){return this.each(function(){var t,e,n;"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=(t=this.nodeName,T[t]||(e=S.createElement(t),S.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),T[t]=n),T[t]))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(e){var n=a(e);if(this[0]&&!n)var i=b(e).get(0),r=i.parentNode||1<this.length;return this.each(function(t){b(this).wrapAll(n?e.call(this,t):r?i.cloneNode(!0):i)})},wrapAll:function(t){if(this[0]){b(this[0]).before(t=b(t));for(var e;(e=t.children()).length;)t=e.first();b(t).append(this)}return this},wrapInner:function(r){var o=a(r);return this.each(function(t){var e=b(this),n=e.contents(),i=o?r.call(this,t):r;n.length?n.wrapAll(i):e.append(i)})},unwrap:function(){return this.parent().each(function(){b(this).replaceWith(b(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(e){return this.each(function(){var t=b(this);(e===g?"none"==t.css("display"):e)?t.show():t.hide()})},prev:function(t){return b(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return b(this.pluck("nextElementSibling")).filter(t||"*")},html:function(n){return 0 in arguments?this.each(function(t){var e=this.innerHTML;b(this).empty().append(d(this,n,t,e))}):0 in this?this[0].innerHTML:null},text:function(n){return 0 in arguments?this.each(function(t){var e=d(this,n,t,this.textContent);this.textContent=null==e?"":""+e}):0 in this?this[0].textContent:null},attr:function(e,n){var t;return"string"!=typeof e||1 in arguments?this.each(function(t){if(1===this.nodeType)if(r(e))for(x in e)v(this,x,e[x]);else v(this,e,d(this,n,t,this.getAttribute(e)))}):this.length&&1===this[0].nodeType?!(t=this[0].getAttribute(e))&&e in this[0]?this[0][e]:t:g},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){v(this,t)},this)})},prop:function(e,n){return e=H[e]||e,1 in arguments?this.each(function(t){this[e]=d(this,n,t,this[e])}):this[0]&&this[0][e]},data:function(t,e){var n="data-"+t.replace(k,"-$1").toLowerCase(),i=1 in arguments?this.attr(n,e):this.attr(n);return null!==i?y(i):g},val:function(e){return 0 in arguments?this.each(function(t){this.value=d(this,e,t,this.value)}):this[0]&&(this[0].multiple?b(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(o){if(o)return this.each(function(t){var e=b(this),n=d(this,o,t,e.offset()),i=e.offsetParent().offset(),r={top:n.top-i.top,left:n.left-i.left};"static"==e.css("position")&&(r.position="relative"),e.css(r)});if(!this.length)return null;var t=this[0].getBoundingClientRect();return{left:t.left+window.pageXOffset,top:t.top+window.pageYOffset,width:Math.round(t.width),height:Math.round(t.height)}},css:function(t,e){if(arguments.length<2){var n,i=this[0];if(!i)return;if(n=getComputedStyle(i,""),"string"==typeof t)return i.style[L(t)]||n.getPropertyValue(t);if(V(t)){var r={};return b.each(t,function(t,e){r[e]=i.style[L(e)]||n.getPropertyValue(e)}),r}}var o="";if("string"==u(t))e||0===e?o=h(t)+":"+f(t,e):this.each(function(){this.style.removeProperty(h(t))});else for(x in t)t[x]||0===t[x]?o+=h(x)+":"+f(x,t[x])+";":this.each(function(){this.style.removeProperty(h(x))});return this.each(function(){this.style.cssText+=";"+o})},index:function(t){return t?this.indexOf(b(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return!!t&&j.some.call(this,function(t){return this.test(m(t))},n(t))},addClass:function(n){return n?this.each(function(t){if("className"in this){w=[];var e=m(this);d(this,n,t,e).split(/\s+/g).forEach(function(t){b(this).hasClass(t)||w.push(t)},this),w.length&&m(this,e+(e?" ":"")+w.join(" "))}}):this},removeClass:function(e){return this.each(function(t){if("className"in this){if(e===g)return m(this,"");w=m(this),d(this,e,t,w).split(/\s+/g).forEach(function(t){w=w.replace(n(t)," ")}),m(this,w.trim())}})},toggleClass:function(n,i){return n?this.each(function(t){var e=b(this);d(this,n,t,m(this)).split(/\s+/g).forEach(function(t){(i===g?!e.hasClass(t):i)?e.addClass(t):e.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===g?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===g?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),i=Z.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(b(t).css("margin-top"))||0,n.left-=parseFloat(b(t).css("margin-left"))||0,i.top+=parseFloat(b(e[0]).css("border-top-width"))||0,i.left+=parseFloat(b(e[0]).css("border-left-width"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||S.body;t&&!Z.test(t.nodeName)&&"static"==b(t).css("position");)t=t.offsetParent;return t})}},b.fn.detach=b.fn.remove,["width","height"].forEach(function(i){var r=i.replace(/./,function(t){return t[0].toUpperCase()});b.fn[i]=function(e){var t,n=this[0];return e===g?o(n)?n["inner"+r]:s(n)?n.documentElement["scroll"+r]:(t=this.offset())&&t[i]:this.each(function(t){(n=b(this)).css(i,d(this,e,t,n[i]()))})}}),["after","prepend","before","append"].forEach(function(e,a){var s=a%2;b.fn[e]=function(){var e,i,r=b.map(arguments,function(t){return"object"==(e=u(t))||"array"==e||null==t?t:z.fragment(t)}),o=1<this.length;return r.length<1?this:this.each(function(t,e){i=s?e:e.parentNode,e=0==a?e.nextSibling:1==a?e.firstChild:2==a?e:null;var n=b.contains(S.documentElement,i);r.forEach(function(t){if(o)t=t.cloneNode(!0);else if(!i)return b(t).remove();i.insertBefore(t,e),n&&function t(e,n){n(e);for(var i=0,r=e.childNodes.length;i<r;i++)t(e.childNodes[i],n)}(t,function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},b.fn[s?e+"To":"insert"+(a?"Before":"After")]=function(t){return b(t)[e](this),this}}),z.Z.prototype=b.fn,z.uniq=E,z.deserializeValue=y,b.zepto=z,b}();window.Zepto=Zepto,void 0===window.$&&(window.$=Zepto),function(l){function h(t){return t._zid||(t._zid=e++)}function a(t,e,n,i){if((e=f(e)).ns)var r=(o=e.ns,new RegExp("(?:^| )"+o.replace(" "," .* ?")+"(?: |$)"));var o;return(L[h(t)]||[]).filter(function(t){return!(!t||e.e&&t.e!=e.e||e.ns&&!r.test(t.ns)||n&&h(t.fn)!==h(n)||i&&t.sel!=i)})}function f(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function p(t,e){return t.del&&!n&&t.e in i||!!e}function d(t){return E[t]||n&&i[t]||t}function c(r,t,e,o,a,s,u){var n=h(r),c=L[n]||(L[n]=[]);t.split(/\s/).forEach(function(t){if("ready"==t)return l(document).ready(e);var n=f(t);n.fn=e,n.sel=a,n.e in E&&(e=function(t){var e=t.relatedTarget;return!e||e!==this&&!l.contains(this,e)?n.fn.apply(this,arguments):void 0});var i=(n.del=s)||e;n.proxy=function(t){if(!(t=m(t)).isImmediatePropagationStopped()){t.data=o;var e=i.apply(r,t._args==g?[t]:[t].concat(t._args));return!1===e&&(t.preventDefault(),t.stopPropagation()),e}},n.i=c.length,c.push(n),"addEventListener"in r&&r.addEventListener(d(n.e),n.proxy,p(n,u))})}function v(e,t,n,i,r){var o=h(e);(t||"").split(/\s/).forEach(function(t){a(e,t,n,i).forEach(function(t){delete L[o][t.i],"removeEventListener"in e&&e.removeEventListener(d(t.e),t.proxy,p(t,r))})})}function m(i,r){return(r||!i.isDefaultPrevented)&&(r||(r=i),l.each(t,function(t,e){var n=r[t];i[t]=function(){return this[e]=s,n&&n.apply(r,arguments)},i[e]=j}),(r.defaultPrevented!==g?r.defaultPrevented:"returnValue"in r?!1===r.returnValue:r.getPreventDefault&&r.getPreventDefault())&&(i.isDefaultPrevented=s)),i}function y(t){var e,n={originalEvent:t};for(e in t)r.test(e)||t[e]===g||(n[e]=t[e]);return m(n,t)}var g,e=1,x=Array.prototype.slice,b=l.isFunction,w=function(t){return"string"==typeof t},L={},o={},n="onfocusin"in window,i={focus:"focusin",blur:"focusout"},E={mouseenter:"mouseover",mouseleave:"mouseout"};o.click=o.mousedown=o.mouseup=o.mousemove="MouseEvents",l.event={add:c,remove:v},l.proxy=function(t,e){var n=2 in arguments&&x.call(arguments,2);if(b(t)){var i=function(){return t.apply(e,n?n.concat(x.call(arguments)):arguments)};return i._zid=h(t),i}if(w(e))return n?(n.unshift(t[e],t),l.proxy.apply(null,n)):l.proxy(t[e],t);throw new TypeError("expected function")},l.fn.bind=function(t,e,n){return this.on(t,e,n)},l.fn.unbind=function(t,e){return this.off(t,e)},l.fn.one=function(t,e,n,i){return this.on(t,e,n,i,1)};var s=function(){return!0},j=function(){return!1},r=/^([A-Z]|returnValue$|layer[XY]$)/,t={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};l.fn.delegate=function(t,e,n){return this.on(e,t,n)},l.fn.undelegate=function(t,e,n){return this.off(e,t,n)},l.fn.live=function(t,e){return l(document.body).delegate(this.selector,t,e),this},l.fn.die=function(t,e){return l(document.body).undelegate(this.selector,t,e),this},l.fn.on=function(e,r,n,o,a){var s,u,i=this;return e&&!w(e)?(l.each(e,function(t,e){i.on(t,r,n,e,a)}),i):(w(r)||b(o)||!1===o||(o=n,n=r,r=g),(b(n)||!1===n)&&(o=n,n=g),!1===o&&(o=j),i.each(function(t,i){a&&(s=function(t){return v(i,t.type,o),o.apply(this,arguments)}),r&&(u=function(t){var e,n=l(t.target).closest(r,i).get(0);return n&&n!==i?(e=l.extend(y(t),{currentTarget:n,liveFired:i}),(s||o).apply(n,[e].concat(x.call(arguments,1)))):void 0}),c(i,e,o,n,r,u||s)}))},l.fn.off=function(t,n,e){var i=this;return t&&!w(t)?(l.each(t,function(t,e){i.off(t,n,e)}),i):(w(n)||b(e)||!1===e||(e=n,n=g),!1===e&&(e=j),i.each(function(){v(this,t,e,n)}))},l.fn.trigger=function(t,e){return(t=w(t)||l.isPlainObject(t)?l.Event(t):m(t))._args=e,this.each(function(){t.type in i&&"function"==typeof this[t.type]?this[t.type]():"dispatchEvent"in this?this.dispatchEvent(t):l(this).triggerHandler(t,e)})},l.fn.triggerHandler=function(n,i){var r,o;return this.each(function(t,e){(r=y(w(n)?l.Event(n):n))._args=i,r.target=e,l.each(a(e,n.type||n),function(t,e){return o=e.proxy(r),!r.isImmediatePropagationStopped()&&void 0})}),o},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){l.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),l.Event=function(t,e){w(t)||(t=(e=t).type);var n=document.createEvent(o[t]||"Events"),i=!0;if(e)for(var r in e)"bubbles"==r?i=!!e[r]:n[r]=e[r];return n.initEvent(t,i,!0),m(n)}}(Zepto),function(dh){function fh(t,e,n,i){return t.global?(r=e||vh,o=n,a=i,s=dh.Event(o),dh(r).trigger(s,a),!s.isDefaultPrevented()):void 0;var r,o,a,s}function ih(t,e){var n=e.context;return!1!==e.beforeSend.call(n,t,e)&&!1!==fh(e,n,"ajaxBeforeSend",[t,e])&&void fh(e,n,"ajaxSend",[t,e])}function jh(t,e,n,i){var r=n.context,o="success";n.success.call(r,t,o,e),i&&i.resolveWith(r,[t,o,e]),fh(n,r,"ajaxSuccess",[e,n,t]),lh(o,e,n)}function kh(t,e,n,i,r){var o=i.context;i.error.call(o,n,e,t),r&&r.rejectWith(o,[n,e,t]),fh(i,o,"ajaxError",[n,i,t||e]),lh(e,n,i)}function lh(t,e,n){var i,r=n.context;n.complete.call(r,e,t),fh(n,r,"ajaxComplete",[e,n]),(i=n).global&&!--dh.active&&fh(i,null,"ajaxStop")}function mh(){}function oh(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function qh(t,e,n,i){return dh.isFunction(e)&&(i=n,n=e,e=void 0),dh.isFunction(n)||(i=n,n=void 0),{url:t,data:e,success:n,dataType:i}}var sh,th,uh=0,vh=window.document,wh=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,xh=/^(?:text|application)\/javascript/i,yh=/^(?:text|application)\/xml/i,zh="application/json",Ah="text/html",Bh=/^\s*$/,Ch=vh.createElement("a");Ch.href=window.location.href,dh.active=0,dh.ajaxJSONP=function(n,i){if(!("type"in n))return dh.ajax(n);var r,o,t=n.jsonpCallback,a=(dh.isFunction(t)?t():t)||"jsonp"+ ++uh,s=vh.createElement("script"),u=window[a],e=function(t){dh(s).triggerHandler("error",t||"abort")},c={abort:e};return i&&i.promise(c),dh(s).on("load error",function(t,e){clearTimeout(o),dh(s).off().remove(),"error"!=t.type&&r?jh(r[0],c,n,i):kh(null,e||"error",c,n,i),window[a]=u,r&&dh.isFunction(u)&&u(r[0]),u=r=void 0}),!1===ih(c,n)?e("abort"):(window[a]=function(){r=arguments},s.src=n.url.replace(/\?(.+)=\?/,"?$1="+a),vh.head.appendChild(s),0<n.timeout&&(o=setTimeout(function(){e("timeout")},n.timeout))),c},dh.ajaxSettings={type:"GET",beforeSend:mh,success:mh,error:mh,complete:mh,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:zh,xml:"application/xml, text/xml",html:Ah,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0},dh.ajax=function(Ji){var Ki,ii,Mh,Li=dh.extend({},Ji||{}),Mi=dh.Deferred&&dh.Deferred();for(sh in dh.ajaxSettings)void 0===Li[sh]&&(Li[sh]=dh.ajaxSettings[sh]);(Mh=Li).global&&0==dh.active++&&fh(Mh,null,"ajaxStart"),Li.crossDomain||((Ki=vh.createElement("a")).href=Li.url,Ki.href=Ki.href,Li.crossDomain=Ch.protocol+"//"+Ch.host!=Ki.protocol+"//"+Ki.host),Li.url||(Li.url=window.location.toString()),(ii=Li).processData&&ii.data&&"string"!=dh.type(ii.data)&&(ii.data=dh.param(ii.data,ii.traditional)),!ii.data||ii.type&&"GET"!=ii.type.toUpperCase()||(ii.url=oh(ii.url,ii.data),ii.data=void 0);var Ni=Li.dataType,Oi=/\?.+=\?/.test(Li.url);if(Oi&&(Ni="jsonp"),!1!==Li.cache&&(Ji&&!0===Ji.cache||"script"!=Ni&&"jsonp"!=Ni)||(Li.url=oh(Li.url,"_="+Date.now())),"jsonp"==Ni)return Oi||(Li.url=oh(Li.url,Li.jsonp?Li.jsonp+"=?":!1===Li.jsonp?"":"callback=?")),dh.ajaxJSONP(Li,Mi);var Pi,Qi=Li.accepts[Ni],Ri={},Si=function(t,e){Ri[t.toLowerCase()]=[t,e]},Ti=/^([\w-]+:)\/\//.test(Li.url)?RegExp.$1:window.location.protocol,Ui=Li.xhr(),Vi=Ui.setRequestHeader;if(Mi&&Mi.promise(Ui),Li.crossDomain||Si("X-Requested-With","XMLHttpRequest"),Si("Accept",Qi||"*/*"),(Qi=Li.mimeType||Qi)&&(-1<Qi.indexOf(",")&&(Qi=Qi.split(",",2)[0]),Ui.overrideMimeType&&Ui.overrideMimeType(Qi)),(Li.contentType||!1!==Li.contentType&&Li.data&&"GET"!=Li.type.toUpperCase())&&Si("Content-Type",Li.contentType||"application/x-www-form-urlencoded"),Li.headers)for(th in Li.headers)Si(th,Li.headers[th]);if(Ui.setRequestHeader=Si,!(Ui.onreadystatechange=function(){if(4==Ui.readyState){Ui.onreadystatechange=mh,clearTimeout(Pi);var Zi,$i=!1;if(200<=Ui.status&&Ui.status<300||304==Ui.status||0==Ui.status&&"file:"==Ti){Ni=Ni||((fi=Li.mimeType||Ui.getResponseHeader("content-type"))&&(fi=fi.split(";",2)[0]),fi&&(fi==Ah?"html":fi==zh?"json":xh.test(fi)?"script":yh.test(fi)&&"xml")||"text"),Zi=Ui.responseText;try{"script"==Ni?eval(Zi):"xml"==Ni?Zi=Ui.responseXML:"json"==Ni&&(Zi=Bh.test(Zi)?null:dh.parseJSON(Zi))}catch(t){$i=t}$i?kh($i,"parsererror",Ui,Li,Mi):jh(Zi,Ui,Li,Mi)}else kh(Ui.statusText||null,Ui.status?"error":"abort",Ui,Li,Mi)}var fi})===ih(Ui,Li))return Ui.abort(),kh(null,"abort",Ui,Li,Mi),Ui;if(Li.xhrFields)for(th in Li.xhrFields)Ui[th]=Li.xhrFields[th];var Wi=!("async"in Li)||Li.async;for(th in Ui.open(Li.type,Li.url,Wi,Li.username,Li.password),Ri)Vi.apply(Ui,Ri[th]);return 0<Li.timeout&&(Pi=setTimeout(function(){Ui.onreadystatechange=mh,Ui.abort(),kh(null,"timeout",Ui,Li,Mi)},Li.timeout)),Ui.send(Li.data?Li.data:null),Ui},dh.get=function(){return dh.ajax(qh.apply(null,arguments))},dh.post=function(){var t=qh.apply(null,arguments);return t.type="POST",dh.ajax(t)},dh.getJSON=function(){var t=qh.apply(null,arguments);return t.dataType="json",dh.ajax(t)},dh.fn.load=function(t,e,n){if(!this.length)return this;var i,r=this,o=t.split(/\s/),a=qh(t,e,n),s=a.success;return 1<o.length&&(a.url=o[0],i=o[1]),a.success=function(t){r.html(i?dh("<div>").html(t.replace(wh,"")).find(i):t),s&&s.apply(r,arguments)},dh.ajax(a),this};var Dh=encodeURIComponent;dh.param=function(t,e){var n=[];return n.add=function(t,e){dh.isFunction(e)&&(e=e()),null==e&&(e=""),this.push(Dh(t)+"="+Dh(e))},function n(i,t,r,o){var a,s=dh.isArray(t),u=dh.isPlainObject(t);dh.each(t,function(t,e){a=dh.type(e),o&&(t=r?o:o+"["+(u||"object"==a||"array"==a?t:"")+"]"),!o&&s?i.add(e.name,e.value):"array"==a||!r&&"object"==a?n(i,e,r,t):i.add(t,e)})}(n,t,e),n.join("&").replace(/%20/g,"+")}}(Zepto),function(o){o.fn.serializeArray=function(){var n,i,e=[],r=function(t){return t.forEach?t.forEach(r):void e.push({name:n,value:t})};return this[0]&&o.each(this[0].elements,function(t,e){i=e.type,(n=e.name)&&"fieldset"!=e.nodeName.toLowerCase()&&!e.disabled&&"submit"!=i&&"reset"!=i&&"button"!=i&&"file"!=i&&("radio"!=i&&"checkbox"!=i||e.checked)&&r(o(e).val())}),e},o.fn.serialize=function(){var e=[];return this.serializeArray().forEach(function(t){e.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.value))}),e.join("&")},o.fn.submit=function(t){if(0 in arguments)this.bind("submit",t);else if(this.length){var e=o.Event("submit");this.eq(0).trigger(e),e.isDefaultPrevented()||this.get(0).submit()}return this}}(Zepto),function(n){"__proto__"in{}||n.extend(n.zepto,{Z:function(t,e){return t=t||[],n.extend(t,n.fn),t.selector=e||"",t.__Z=!0,t},isZ:function(t){return"array"===n.type(t)&&"__Z"in t}});try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t){try{return e(t)}catch(t){return null}}}}(Zepto),function(i){var t={nextAll:function(t){for(var e=i(),n=this.next();n.length;)(void 0===t||n.is(t))&&(e=e.add(n)),n=n.next();return e},prevAll:function(t){for(var e=i(),n=this.prev();n.length;)(void 0===t||n.is(t))&&(e=e.add(n)),n=n.prev();return e}};i.extend(i.fn,t)}(Zepto),function(f){f.Callbacks=function(i){i=f.extend({},i);var e,n,r,o,a,s,u=[],c=!i.once&&[],l=function(t){for(e=i.memory&&t,n=!0,s=o||0,o=0,a=u.length,r=!0;u&&s<a;++s)if(!1===u[s].apply(t[0],t[1])&&i.stopOnFalse){e=!1;break}r=!1,u&&(c?c.length&&l(c.shift()):e?u.length=0:h.disable())},h={add:function(){if(u){var t=u.length,n=function(t){f.each(t,function(t,e){"function"==typeof e?i.unique&&h.has(e)||u.push(e):e&&e.length&&"string"!=typeof e&&n(e)})};n(arguments),r?a=u.length:e&&(o=t,l(e))}return this},remove:function(){return u&&f.each(arguments,function(t,e){for(var n;-1<(n=f.inArray(e,u,n));)u.splice(n,1),r&&(n<=a&&--a,n<=s&&--s)}),this},has:function(t){return!(!u||!(t?-1<f.inArray(t,u):u.length))},empty:function(){return a=u.length=0,this},disable:function(){return u=c=e=void 0,this},disabled:function(){return!u},lock:function(){return c=void 0,e||h.disable(),this},locked:function(){return!c},fireWith:function(t,e){return!u||n&&!c||(e=[t,(e=e||[]).slice?e.slice():e],r?c.push(e):l(e)),this},fire:function(){return h.fireWith(this,arguments)},fired:function(){return!!n}};return h}}(Zepto),function(l){var h=Array.prototype.slice;function f(t){var r=[["resolve","done",l.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",l.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",l.Callbacks({memory:1})]],o="pending",a={state:function(){return o},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var e=arguments;return f(function(o){l.each(r,function(t,i){var r=l.isFunction(e[t])&&e[t];s[i[1]](function(){var t=r&&r.apply(this,arguments);if(t&&l.isFunction(t.promise))t.promise().done(o.resolve).fail(o.reject).progress(o.notify);else{var e=this===a?o.promise():this,n=r?[t]:arguments;o[i[0]+"With"](e,n)}})}),e=null}).promise()},promise:function(t){return null!=t?l.extend(t,a):a}},s={};return l.each(r,function(t,e){var n=e[2],i=e[3];a[e[1]]=n.add,i&&n.add(function(){o=i},r[1^t][2].disable,r[2][2].lock),s[e[0]]=function(){return s[e[0]+"With"](this===s?a:this,arguments),this},s[e[0]+"With"]=n.fireWith}),a.promise(s),t&&t.call(s,s),s}l.when=function(t){var r,e,n,i=h.call(arguments),o=i.length,a=0,s=1!==o||t&&l.isFunction(t.promise)?o:0,u=1===s?t:f(),c=function(e,n,i){return function(t){n[e]=this,i[e]=1<arguments.length?h.call(arguments):t,i===r?u.notifyWith(n,i):--s||u.resolveWith(n,i)}};if(1<o)for(r=new Array(o),e=new Array(o),n=new Array(o);a<o;++a)i[a]&&l.isFunction(i[a].promise)?i[a].promise().done(c(a,n,i)).fail(u.reject).progress(c(a,e,r)):--s;return s||u.resolveWith(n,i),u.promise()},l.Deferred=f}(Zepto),function(l){var h=function(){var t,e,n,i,r,o,a=arguments[0]||{},s=1,u=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[1]||{},s=2),"object"==typeof a||l.isFunction(a)||(a={}),u===s&&(a=this,--s);s<u;s++)if(null!=(t=arguments[s]))for(e in t)n=a[e],a!==(i=t[e])&&(c&&i&&(l.isPlainObject(i)||(r=l.isArray(i)))?(o=r?(r=!1,n&&l.isArray(n)?n:[]):n&&l.isPlainObject(n)?n:{},a[e]=h(c,o,i)):void 0!==i&&t.hasOwnProperty(e)&&(a[e]=i));return a};l.extend=h}(Zepto);