function FastClick(n){"use strict";var i,t=this;if(this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=10,this.layer=n,!n||!n.nodeType)throw new TypeError("Layer must be a document node");(this.onClick=function(){return FastClick.prototype.onClick.apply(t,arguments)},this.onMouse=function(){return FastClick.prototype.onMouse.apply(t,arguments)},this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(t,arguments)},this.onTouchMove=function(){return FastClick.prototype.onTouchMove.apply(t,arguments)},this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(t,arguments)},this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(t,arguments)},FastClick.notNeeded(n))||(this.deviceIsAndroid&&(n.addEventListener("mouseover",this.onMouse,!0),n.addEventListener("mousedown",this.onMouse,!0),n.addEventListener("mouseup",this.onMouse,!0)),n.addEventListener("click",this.onClick,!0),n.addEventListener("touchstart",this.onTouchStart,!1),n.addEventListener("touchmove",this.onTouchMove,!1),n.addEventListener("touchend",this.onTouchEnd,!1),n.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(n.removeEventListener=function(t,i,r){var u=Node.prototype.removeEventListener;t==="click"?u.call(n,t,i.hijacked||i,r):u.call(n,t,i,r)},n.addEventListener=function(t,i,r){var u=Node.prototype.addEventListener;t==="click"?u.call(n,t,i.hijacked||(i.hijacked=function(n){n.propagationStopped||i(n)}),r):u.call(n,t,i,r)}),typeof n.onclick=="function"&&(i=n.onclick,n.addEventListener("click",function(n){i(n)},!1),n.onclick=null))}function ns_onclick(n,t,i,r,u){var e=window,o=e.ns_p,a=o&&o.src,s="&ns_",p=document.referrer.replace(/\/$/,""),t=t||n.href,u=u||"",h={t:0,o:0},v=eventURL=c1_match=c2_match="",w=/\bc1=[^&]+\b/i,b=/\bc2=[^&]+\b/i,k=e.encodeURIComponent?encodeURIComponent:escape,c,y,l,f;return a&&(c1_match=o.src.match(w))&&!w.test(i)&&(v+="&"+c1_match),a&&(c2_match=o.src.match(b))&&!b.test(i)&&(v+="&"+c2_match),a&&(c=o.src,y=c.indexOf("?"),eventURL=c.substr(0,y>-1?y:c.length)+"?"),eventURL=[eventURL,i,v,s,"type=",r,s,"action=view",s,"_t=",+new Date,s,"sc_sv=","3.1312.06",s,"sc_href=",k(t).substr(0,1e3),p?"&c9="+k(p):""].join(""),l=n&&n.target?n.target.replace(/^_/,""):"self",f=new Image,e[l]?(h.t=function(n,t,i){return function(){clearTimeout(i.o);f.onload=f.onerror=function(){return};e[n].location.href=t}}(l,t,h),h.o=setTimeout(h.t,5e3),f.onload=f.onerror=h.t):e.open(t,l,u),f.src=eventURL,!1}FastClick.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0;FastClick.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent);FastClick.prototype.deviceIsIOS4=FastClick.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent);FastClick.prototype.deviceIsIOSWithBadTarget=FastClick.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent);FastClick.prototype.needsClick=function(n){"use strict";switch(n.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(n.disabled)return!0;break;case"input":if(this.deviceIsIOS&&n.type==="file"||n.disabled)return!0;break;case"label":case"video":return!0}return/\bneedsclick\b/.test(n.className)};FastClick.prototype.needsFocus=function(n){"use strict";switch(n.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!this.deviceIsAndroid;case"input":switch(n.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!n.disabled&&!n.readOnly;default:return/\bneedsfocus\b/.test(n.className)}};FastClick.prototype.sendClick=function(n,t){"use strict";var r,i;document.activeElement&&document.activeElement!==n&&document.activeElement.blur();i=t.changedTouches[0];r=document.createEvent("MouseEvents");r.initMouseEvent(this.determineEventType(n),!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null);r.forwardedTouchEvent=!0;n.dispatchEvent(r)};FastClick.prototype.determineEventType=function(n){"use strict";return this.deviceIsAndroid&&n.tagName.toLowerCase()==="select"?"mousedown":"click"};FastClick.prototype.focus=function(n){"use strict";var t;this.deviceIsIOS&&n.setSelectionRange&&n.type.indexOf("date")!==0&&n.type!=="time"?(t=n.value.length,n.setSelectionRange(t,t)):n.focus()};FastClick.prototype.updateScrollParent=function(n){"use strict";var i,t;if(i=n.fastClickScrollParent,!i||!i.contains(n)){t=n;do{if(t.scrollHeight>t.offsetHeight){i=t;n.fastClickScrollParent=t;break}t=t.parentElement}while(t)}i&&(i.fastClickLastScrollTop=i.scrollTop)};FastClick.prototype.getTargetElementFromEventTarget=function(n){"use strict";return n.nodeType===Node.TEXT_NODE?n.parentNode:n};FastClick.prototype.onTouchStart=function(n){"use strict";var i,t,r;if(n.targetTouches.length>1)return!0;if(i=this.getTargetElementFromEventTarget(n.target),t=n.targetTouches[0],this.deviceIsIOS){if(r=window.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;if(!this.deviceIsIOS4){if(t.identifier===this.lastTouchIdentifier)return n.preventDefault(),!1;this.lastTouchIdentifier=t.identifier;this.updateScrollParent(i)}}return this.trackingClick=!0,this.trackingClickStart=n.timeStamp,this.targetElement=i,this.touchStartX=t.pageX,this.touchStartY=t.pageY,n.timeStamp-this.lastClickTime<200&&n.preventDefault(),!0};FastClick.prototype.touchHasMoved=function(n){"use strict";var t=n.changedTouches[0],i=this.touchBoundary;return Math.abs(t.pageX-this.touchStartX)>i||Math.abs(t.pageY-this.touchStartY)>i?!0:!1};FastClick.prototype.onTouchMove=function(n){"use strict";return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(n.target)||this.touchHasMoved(n))&&(this.trackingClick=!1,this.targetElement=null),!0):!0};FastClick.prototype.findControl=function(n){"use strict";return n.control!==undefined?n.control:n.htmlFor?document.getElementById(n.htmlFor):n.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")};FastClick.prototype.onTouchEnd=function(n){"use strict";var u,e,i,r,f,t=this.targetElement;if(!this.trackingClick)return!0;if(n.timeStamp-this.lastClickTime<200)return this.cancelNextClick=!0,!0;if(this.cancelNextClick=!1,this.lastClickTime=n.timeStamp,e=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,this.deviceIsIOSWithBadTarget&&(f=n.changedTouches[0],t=document.elementFromPoint(f.pageX-window.pageXOffset,f.pageY-window.pageYOffset)||t,t.fastClickScrollParent=this.targetElement.fastClickScrollParent),i=t.tagName.toLowerCase(),i==="label"){if(u=this.findControl(t),u){if(this.focus(t),this.deviceIsAndroid)return!1;t=u}}else if(this.needsFocus(t))return n.timeStamp-e>100||this.deviceIsIOS&&window.top!==window&&i==="input"?(this.targetElement=null,!1):(this.focus(t),this.deviceIsIOS4&&i==="select"||(this.targetElement=null,n.preventDefault()),!1);return this.deviceIsIOS&&!this.deviceIsIOS4&&(r=t.fastClickScrollParent,r&&r.fastClickLastScrollTop!==r.scrollTop)?!0:(this.needsClick(t)||(n.preventDefault(),this.sendClick(t,n)),!1)};FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=!1;this.targetElement=null};FastClick.prototype.onMouse=function(n){"use strict";return this.targetElement?n.forwardedTouchEvent?!0:n.cancelable?!this.needsClick(this.targetElement)||this.cancelNextClick?(n.stopImmediatePropagation?n.stopImmediatePropagation():n.propagationStopped=!0,n.stopPropagation(),n.preventDefault(),!1):!0:!0:!0};FastClick.prototype.onClick=function(n){"use strict";var t;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):n.target.type==="submit"&&n.detail===0?!0:(t=this.onMouse(n),t||(this.targetElement=null),t)};FastClick.prototype.destroy=function(){"use strict";var n=this.layer;this.deviceIsAndroid&&(n.removeEventListener("mouseover",this.onMouse,!0),n.removeEventListener("mousedown",this.onMouse,!0),n.removeEventListener("mouseup",this.onMouse,!0));n.removeEventListener("click",this.onClick,!0);n.removeEventListener("touchstart",this.onTouchStart,!1);n.removeEventListener("touchmove",this.onTouchMove,!1);n.removeEventListener("touchend",this.onTouchEnd,!1);n.removeEventListener("touchcancel",this.onTouchCancel,!1)};FastClick.notNeeded=function(n){"use strict";var t,i;if(typeof ontouchstart=="undefined")return!0;if(i=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],i)if(FastClick.prototype.deviceIsAndroid){if(t=document.querySelector("meta[name=viewport]"),t&&(t.content.indexOf("user-scalable=no")!==-1||i>31&&window.innerWidth<=window.screen.width))return!0}else return!0;return n.style.msTouchAction==="none"?!0:!1};FastClick.attach=function(n){"use strict";return new FastClick(n)};typeof define!="undefined"&&define.amd?define(function(){"use strict";return FastClick}):typeof module!="undefined"&&module.exports?(module.exports=FastClick.attach,module.exports.FastClick=FastClick):window.FastClick=FastClick