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