!function(){"use strict";function t(e,o){function i(t,e){return function(){return t.apply(e,arguments)}}var r;if(o=o||{},this.trackingclick=!1,this.trackingclickstart=0,this.targetelement=null,this.touchstartx=0,this.touchstarty=0,this.lasttouchidentifier=0,this.touchboundary=o.touchboundary||10,this.layer=e,this.tapdelay=o.tapdelay||200,this.taptimeout=o.taptimeout||700,!t.notneeded(e)){for(var a=["onmouse","onclick","ontouchstart","ontouchmove","ontouchend","ontouchcancel"],c=this,s=0,u=a.length;u>s;s++)c[a[s]]=i(c[a[s]],c);n&&(e.addeventlistener("mouseover",this.onmouse,!0),e.addeventlistener("mousedown",this.onmouse,!0),e.addeventlistener("mouseup",this.onmouse,!0)),e.addeventlistener("click",this.onclick,!0),e.addeventlistener("touchstart",this.ontouchstart,!1),e.addeventlistener("touchmove",this.ontouchmove,!1),e.addeventlistener("touchend",this.ontouchend,!1),e.addeventlistener("touchcancel",this.ontouchcancel,!1),event.prototype.stopimmediatepropagation||(e.removeeventlistener=function(t,n,o){var i=node.prototype.removeeventlistener;"click"===t?i.call(e,t,n.hijacked||n,o):i.call(e,t,n,o)},e.addeventlistener=function(t,n,o){var i=node.prototype.addeventlistener;"click"===t?i.call(e,t,n.hijacked||(n.hijacked=function(t){t.propagationstopped||n(t)}),o):i.call(e,t,n,o)}),"function"==typeof e.onclick&&(r=e.onclick,e.addeventlistener("click",function(t){r(t)},!1),e.onclick=null)}}var e=navigator.useragent.indexof("windows phone")>=0,n=navigator.useragent.indexof("android")>0&&!e,o=/ip(ad|hone|od)/.test(navigator.useragent)&&!e,i=o&&/os 4_\d(_\d)?/.test(navigator.useragent),r=o&&/os [6-7]_\d/.test(navigator.useragent),a=navigator.useragent.indexof("bb10")>0;t.prototype.needsclick=function(t){switch(t.nodename.tolowercase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(o&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.classname)},t.prototype.needsfocus=function(t){switch(t.nodename.tolowercase()){case"textarea":return!0;case"select":return!n;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readonly;default:return/\bneedsfocus\b/.test(t.classname)}},t.prototype.sendclick=function(t,e){var n,o;document.activeelement&&document.activeelement!==t&&document.activeelement.blur(),o=e.changedtouches[0],n=document.createevent("mouseevents"),n.initmouseevent(this.determineeventtype(t),!0,!0,window,1,o.screenx,o.screeny,o.clientx,o.clienty,!1,!1,!1,!1,0,null),n.forwardedtouchevent=!0,t.dispatchevent(n)},t.prototype.determineeventtype=function(t){return n&&"select"===t.tagname.tolowercase()?"mousedown":"click"},t.prototype.focus=function(t){var e;o&&t.setselectionrange&&0!==t.type.indexof("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setselectionrange(e,e)):t.focus()},t.prototype.updatescrollparent=function(t){var e,n;if(e=t.fastclickscrollparent,!e||!e.contains(t)){n=t;do{if(n.scrollheight>n.offsetheight){e=n,t.fastclickscrollparent=n;break}n=n.parentelement}while(n)}e&&(e.fastclicklastscrolltop=e.scrolltop)},t.prototype.gettargetelementfromeventtarget=function(t){return t.nodetype===node.text_node?t.parentnode:t},t.prototype.ontouchstart=function(t){var e,n,r;if(t.targettouches.length>1)return!0;if(e=this.gettargetelementfromeventtarget(t.target),n=t.targettouches[0],o){if(r=window.getselection(),r.rangecount&&!r.iscollapsed)return!0;if(!i){if(n.identifier&&n.identifier===this.lasttouchidentifier)return t.preventdefault(),!1;this.lasttouchidentifier=n.identifier,this.updatescrollparent(e)}}return this.trackingclick=!0,this.trackingclickstart=t.timestamp,this.targetelement=e,this.touchstartx=n.pagex,this.touchstarty=n.pagey,t.timestamp-this.lastclicktimen||math.abs(e.pagey-this.touchstarty)>n?!0:!1},t.prototype.ontouchmove=function(t){return this.trackingclick?((this.targetelement!==this.gettargetelementfromeventtarget(t.target)||this.touchhasmoved(t))&&(this.trackingclick=!1,this.targetelement=null),!0):!0},t.prototype.findcontrol=function(t){return void 0!==t.control?t.control:t.htmlfor?document.getelementbyid(t.htmlfor):t.queryselector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},t.prototype.ontouchend=function(t){var e,a,c,s,u,l=this.targetelement;if(!this.trackingclick)return!0;if(t.timestamp-this.lastclicktimethis.taptimeout)return!0;if(this.cancelnextclick=!1,this.lastclicktime=t.timestamp,a=this.trackingclickstart,this.trackingclick=!1,this.trackingclickstart=0,r&&(u=t.changedtouches[0],l=document.elementfrompoint(u.pagex-window.pagexoffset,u.pagey-window.pageyoffset)||l,l.fastclickscrollparent=this.targetelement.fastclickscrollparent),c=l.tagname.tolowercase(),"label"===c){if(e=this.findcontrol(l)){if(this.focus(l),n)return!1;l=e}}else if(this.needsfocus(l))return t.timestamp-a>100||o&&window.top!==window&&"input"===c?(this.targetelement=null,!1):(this.focus(l),this.sendclick(l,t),o&&"select"===c||(this.targetelement=null,t.preventdefault()),!1);return o&&!i&&(s=l.fastclickscrollparent,s&&s.fastclicklastscrolltop!==s.scrolltop)?!0:(this.needsclick(l)||(t.preventdefault(),this.sendclick(l,t)),!1)},t.prototype.ontouchcancel=function(){this.trackingclick=!1,this.targetelement=null},t.prototype.onmouse=function(t){return this.targetelement?t.forwardedtouchevent?!0:t.cancelable&&(!this.needsclick(this.targetelement)||this.cancelnextclick)?(t.stopimmediatepropagation?t.stopimmediatepropagation():t.propagationstopped=!0,t.stoppropagation(),t.preventdefault(),!1):!0:!0},t.prototype.onclick=function(t){var e;return this.trackingclick?(this.targetelement=null,this.trackingclick=!1,!0):"submit"===t.target.type&&0===t.detail?!0:(e=this.onmouse(t),e||(this.targetelement=null),e)},t.prototype.destroy=function(){var t=this.layer;n&&(t.removeeventlistener("mouseover",this.onmouse,!0),t.removeeventlistener("mousedown",this.onmouse,!0),t.removeeventlistener("mouseup",this.onmouse,!0)),t.removeeventlistener("click",this.onclick,!0),t.removeeventlistener("touchstart",this.ontouchstart,!1),t.removeeventlistener("touchmove",this.ontouchmove,!1),t.removeeventlistener("touchend",this.ontouchend,!1),t.removeeventlistener("touchcancel",this.ontouchcancel,!1)},t.notneeded=function(t){var e,o,i,r;if("undefined"==typeof window.ontouchstart)return!0;if(o=+(/chrome\/([0-9]+)/.exec(navigator.useragent)||[,0])[1]){if(!n)return!0;if(e=document.queryselector("meta[name=viewport]")){if(-1!==e.content.indexof("user-scalable=no"))return!0;if(o>31&&document.documentelement.scrollwidth<=window.outerwidth)return!0}}if(a&&(i=navigator.useragent.match(/version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(e=document.queryselector("meta[name=viewport]")))){if(-1!==e.content.indexof("user-scalable=no"))return!0;if(document.documentelement.scrollwidth<=window.outerwidth)return!0}return"none"===t.style.mstouchaction||"manipulation"===t.style.touchaction?!0:(r=+(/firefox\/([0-9]+)/.exec(navigator.useragent)||[,0])[1],r>=27&&(e=document.queryselector("meta[name=viewport]"),e&&(-1!==e.content.indexof("user-scalable=no")||document.documentelement.scrollwidth<=window.outerwidth))?!0:"none"===t.style.touchaction||"manipulation"===t.style.touchaction?!0:!1)},t.attach=function(e,n){return new t(e,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return t}):"undefined"!=typeof module&&module.exports?(module.exports=t.attach,module.exports.fastclick=t):window.fastclick=t}();