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QAAL,CAAc,KAAd,CAAoB,IAApB,CAA0B,SAA1B,CAID,CAHC,CAAiB,CAAC,IAAD,CAAO,CAAP,IAGlB,EAAO,IACP,CAvEW,CA0EZ,CAAC,CAAC,EAAF,CAAK,SAAL,CAAiB,UAAW,CAC3B,GAAI,CAAA,CAAI,CAAG,CAAC,CAAC,SAAF,CAAY,SAAZ,CAAX,CAEA;AAIA,MAHA,CAAA,CAAI,CAAC,OAAL,CAAa,KAAK,QAAlB,CAGA,CAFA,CAAC,CAAC,EAAF,CAAK,aAAL,CAAmB,KAAnB,CAAyB,CAAC,CAAC,QAAD,CAA1B,CAAsC,CAAtC,CAEA,CAAO,IACP,CAlFW,CAqFP,CArFO,GAsFX,CAAC,CAAC,EAAF,CAAK,OAAL,CAAe,SAAS,CAAT,CAAgB,CAAhB,CAA0B,IACpC,CAAA,CAAG,CAAG,CAAC,CAAC,IAAD,CAD6B,CAEpC,CAAW,CAAuB,QAApB,QAAO,CAAA,CAFe,CAMxC;AACA,GAHA,CAAC,CAAC,EAAF,CAAK,EAAL,CAAQ,KAAR,CAAc,CAAd,CAAmB,SAAnB,CAGA,CAAqB,QAAjB,WAAO,CAAP,CAAJ,CACC,IAAK,IAAL,GAAa,CAAA,CAAb,CACK,CAAK,CAAC,cAAN,CAAqB,IAArB,CADL,EAEE,CAAiB,CAAC,CAAD,CAAM,IAAN,CAAY,CAAZ,CAFnB,CADD,IAK4B,QAAjB,QAAO,CAAA,CALlB,EAMC,CAAiB,CAAC,CAAD,CAAM,CAAN,CAAa,CAAb,CANlB,CASA,MAAO,CAAA,CACP,CAvGU,CA0GZ,CA1GD,EA0GG,MA1GH,C","file":"jquery.bind-first-0.2.3.min.js","sourcesContent":["/*\n * jQuery.bind-first library v0.2.3\n * Copyright (c) 2013 Vladimir Zhuravlev\n *\n * Released under MIT License\n * @license\n *\n * Date: Thu Feb 6 10:13:59 ICT 2014\n **/\n(function($) {\n\tvar splitVersion = $.fn.jquery.split(\".\");\n\tvar major = parseInt(splitVersion[0]);\n\tvar minor = parseInt(splitVersion[1]);\n\n\tvar JQ_LT_17 = (major < 1) || (major == 1 && minor < 7);\n\t\n\tfunction eventsData($el) {\n\t\treturn JQ_LT_17 ? $el.data('events') : $._data($el[0]).events;\n\t}\n\t\n\tfunction moveHandlerToTop($el, eventName, isDelegated) {\n\t\tvar data = eventsData($el);\n\t\tvar events = data[eventName];\n\n\t\tif (!JQ_LT_17) {\n\t\t\tvar handler = isDelegated ? events.splice(events.delegateCount - 1, 1)[0] : events.pop();\n\t\t\tevents.splice(isDelegated ? 0 : (events.delegateCount || 0), 0, handler);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (isDelegated) {\n\t\t\tdata.live.unshift(data.live.pop());\n\t\t} else {\n\t\t\tevents.unshift(events.pop());\n\t\t}\n\t}\n\t\n\tfunction moveEventHandlers($elems, eventsString, isDelegate) {\n\t\tvar events = eventsString.split(/\\s+/);\n\t\t$elems.each(function() {\n\t\t\tfor (var i = 0; i < events.length; ++i) {\n\t\t\t\tvar pureEventName = $.trim(events[i]).match(/[^\\.]+/i)[0];\n\t\t\t\tmoveHandlerToTop($(this), pureEventName, isDelegate);\n\t\t\t}\n\t\t});\n\t}\n\t\n\tfunction makeMethod(methodName) {\n\t\t$.fn[methodName + 'First'] = function() {\n\t\t\tvar args = $.makeArray(arguments);\n\t\t\tvar eventsString = args.shift();\n\n\t\t\tif (eventsString) {\n\t\t\t\t$.fn[methodName].apply(this, arguments);\n\t\t\t\tmoveEventHandlers(this, eventsString);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\t}\n\n\t// bind\n\tmakeMethod('bind');\n\n\t// one\n\tmakeMethod('one');\n\n\t// delegate\n\t$.fn.delegateFirst = function() {\n\t\tvar args = $.makeArray(arguments);\n\t\tvar eventsString = args[1];\n\t\t\n\t\tif (eventsString) {\n\t\t\targs.splice(0, 2);\n\t\t\t$.fn.delegate.apply(this, arguments);\n\t\t\tmoveEventHandlers(this, eventsString, true);\n\t\t}\n\n\t\treturn this;\n\t};\n\n\t// live\n\t$.fn.liveFirst = function() {\n\t\tvar args = $.makeArray(arguments);\n\n\t\t// live = delegate to the document\n\t\targs.unshift(this.selector);\n\t\t$.fn.delegateFirst.apply($(document), args);\n\n\t\treturn this;\n\t};\n\t\n\t// on (jquery >= 1.7)\n\tif (!JQ_LT_17) {\n\t\t$.fn.onFirst = function(types, selector) {\n\t\t\tvar $el = $(this);\n\t\t\tvar isDelegated = typeof selector === 'string';\n\n\t\t\t$.fn.on.apply($el, arguments);\n\n\t\t\t// events map\n\t\t\tif (typeof types === 'object') {\n\t\t\t\tfor (type in types)\n\t\t\t\t\tif (types.hasOwnProperty(type)) {\n\t\t\t\t\t\tmoveEventHandlers($el, type, isDelegated);\n\t\t\t\t\t}\n\t\t\t} else if (typeof types === 'string') {\n\t\t\t\tmoveEventHandlers($el, types, isDelegated);\n\t\t\t}\n\n\t\t\treturn $el;\n\t\t};\n\t}\n\n})(jQuery);\n"]}